You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
8.8 KiB

  1. $ax5picker-z-index: 2000 !default;
  2. $ax5picker-box-model: border-box !default;
  3. $ax5picker-bg: #fff !default;
  4. $ax5picker-inner-border: 1px solid !default;
  5. $ax5picker-inner-border-color: #ddd !default;
  6. $ax5picker-box-shadow: 0px 0px 3px 0px rgba(0, 0, 0, 0.175) !default;
  7. $ax5picker-border-radius: 5px !default;
  8. $ax5picker-body-padding: 5px !default;
  9. $ax5picker-heading-padding: 10px 15px !default;
  10. $ax5picker-buttons-padding: 10px 0px 5px 0px !default;
  11. $ax5picker-content-border: 0px solid !default;
  12. $ax5picker-content-border-color: none !default;
  13. $ax5picker-content-border-radius: 0px !default;
  14. $ax5picker-content-padding: 0px !default;
  15. $ax5picker-easing-time-open: 0.1s !default;
  16. $ax5picker-easing-time-close: 0.1s !default;
  17. $ax5picker-arrow-size: 10px !default;
  18. $ax5picker-arrow-border-width: 1px !default;
  19. //** Border color for elements within dialog
  20. $ax5picker-default-text: #222 !default;
  21. $ax5picker-default-border-color: #ddd !default;
  22. $ax5picker-default-heading-bg: #f5f5f5 !default;
  23. $ax5picker-primary-text: #fff !default;
  24. $ax5picker-primary-border-color: $brand-primary !default;
  25. $ax5picker-primary-heading-bg: $brand-primary !default;
  26. $ax5picker-success-text: #3c763d !default;
  27. $ax5picker-success-border-color: #dff0d8 !default;
  28. $ax5picker-success-heading-bg: darken(adjust-hue(#dff0d8, -10), 5%) !default;
  29. $ax5picker-info-text: #31708f !default;
  30. $ax5picker-info-border-color: #d9edf7 !default;
  31. $ax5picker-info-heading-bg: darken(adjust-hue(#d9edf7, -10), 5%) !default;
  32. $ax5picker-warning-text: #8a6d3b !default;
  33. $ax5picker-warning-border-color: #fcf8e3 !default;
  34. $ax5picker-warning-heading-bg: darken(adjust-hue(#fcf8e3, -10), 5%) !default;
  35. $ax5picker-danger-text: #a94442 !default;
  36. $ax5picker-danger-border-color: #f2dede !default;
  37. $ax5picker-danger-heading-bg: darken(adjust-hue(#f2dede, -10), 5%) !default;
  38. @mixin ax-picker() {
  39. box-sizing: border-box;
  40. *,
  41. *:before,
  42. *:after {
  43. box-sizing: border-box;
  44. }
  45. z-index: $ax5picker-z-index;
  46. position: absolute;
  47. left: 0px;
  48. top: 0px;
  49. //overflow: hidden;
  50. }
  51. @mixin picker-variant($text-color, $border-color, $heading-bg-color) {
  52. @include ax-background($ax5picker-bg);
  53. border: $ax5picker-inner-border;
  54. border-color: $border-color;
  55. border-radius: $ax5picker-border-radius;
  56. box-shadow: $ax5picker-box-shadow;
  57. .ax-picker-heading {
  58. font-weight: 600;
  59. padding: $ax5picker-heading-padding;
  60. border-bottom: 1px solid transparent;
  61. @include border-top-radius($ax5picker-border-radius - 1);
  62. color: $text-color;
  63. @include ax-background($heading-bg-color);
  64. .badge {
  65. font-size: 0.8em;
  66. color: $heading-bg-color;
  67. @include ax-background($text-color);
  68. }
  69. }
  70. .ax-picker-body {
  71. padding: $ax5picker-body-padding;
  72. text-align: center;
  73. .ax-picker-content {
  74. min-width: 50px;
  75. .ax-picker-content-box {
  76. border: $ax5picker-content-border;
  77. border-color: $ax5picker-content-border-color;
  78. border-radius: $ax5picker-content-border-radius;
  79. padding: $ax5picker-content-padding;
  80. overflow: hidden;
  81. }
  82. }
  83. .ax-picker-buttons {
  84. padding: $ax5picker-buttons-padding;
  85. button {
  86. &:not(:last-child) {
  87. margin-right: 3px;
  88. }
  89. }
  90. }
  91. }
  92. &.direction-top {
  93. .ax-picker-arrow {
  94. @include picker-arrow($ax5picker-arrow-size, $ax5picker-arrow-border-width, $border-color, top);
  95. }
  96. }
  97. &.direction-right {
  98. .ax-picker-arrow {
  99. @include picker-arrow($ax5picker-arrow-size, $ax5picker-arrow-border-width, $border-color, right);
  100. }
  101. }
  102. &.direction-bottom {
  103. .ax-picker-arrow {
  104. @include picker-arrow($ax5picker-arrow-size, $ax5picker-arrow-border-width, $border-color, bottom);
  105. }
  106. }
  107. &.direction-left {
  108. .ax-picker-arrow {
  109. @include picker-arrow($ax5picker-arrow-size, $ax5picker-arrow-border-width, $border-color, left);
  110. }
  111. }
  112. }
  113. @mixin picker-arrow($arrow-size, $arrow-border-width, $border-color, $arrow-direction) {
  114. //
  115. //@debug( nth($ax5picker-inner-border, 3) );
  116. $arrow-bg: nth($ax5picker-bg, 1);
  117. $arrow-border-color: $border-color;
  118. position: absolute;
  119. width: 0;
  120. height: 0;
  121. @if ($arrow-direction == top) {
  122. left: 50%;
  123. top: 0px;
  124. } @else if ($arrow-direction == right) {
  125. right: 0px;
  126. top: 50%;
  127. } @else if ($arrow-direction == bottom) {
  128. left: 50%;
  129. bottom: 0px;
  130. } @else if ($arrow-direction == left) {
  131. left: 0px;
  132. top: 50%;
  133. }
  134. &:before {
  135. content: ' ';
  136. position: absolute;
  137. width: 0;
  138. height: 0;
  139. @if ($arrow-direction == top) {
  140. left: - ($arrow-size);
  141. top: - ($arrow-size * 2);
  142. border-left: $arrow-size solid transparent;
  143. border-right: $arrow-size solid transparent;
  144. border-bottom: ($arrow-size * 2) solid $arrow-border-color;
  145. } @else if ($arrow-direction == right) {
  146. right: - ($arrow-size * 2);
  147. top: - ($arrow-size);
  148. border-top: $arrow-size solid transparent;
  149. border-bottom: $arrow-size solid transparent;
  150. border-left: ($arrow-size * 2) solid $arrow-border-color;
  151. } @else if ($arrow-direction == bottom) {
  152. left: - ($arrow-size);
  153. bottom: - ($arrow-size * 2);
  154. border-left: $arrow-size solid transparent;
  155. border-right: $arrow-size solid transparent;
  156. border-top: ($arrow-size * 2) solid $arrow-border-color;
  157. } @else if ($arrow-direction == left) {
  158. left: - ($arrow-size * 2);
  159. top: - ($arrow-size);
  160. border-top: $arrow-size solid transparent;
  161. border-bottom: $arrow-size solid transparent;
  162. border-right: ($arrow-size * 2) solid $arrow-border-color;
  163. }
  164. }
  165. &:after {
  166. content: ' ';
  167. position: absolute;
  168. width: 0;
  169. height: 0;
  170. @if ($arrow-direction == top) {
  171. left: - ($arrow-size);
  172. top: - ($arrow-size * 2) + ($arrow-border-width * 2);
  173. border-left: ($arrow-size) solid transparent;
  174. border-right: ($arrow-size) solid transparent;
  175. border-bottom: ($arrow-size * 2) solid $arrow-bg;
  176. } @else if ($arrow-direction == right) {
  177. right: - ($arrow-size * 2) + ($arrow-border-width * 2);
  178. top: - ($arrow-size);
  179. border-top: ($arrow-size) solid transparent;
  180. border-bottom: ($arrow-size) solid transparent;
  181. border-left: ($arrow-size * 2) solid $arrow-bg;
  182. } @else if ($arrow-direction == bottom) {
  183. left: - ($arrow-size);
  184. bottom: - ($arrow-size * 2) + ($arrow-border-width * 2);
  185. border-left: ($arrow-size) solid transparent;
  186. border-right: ($arrow-size) solid transparent;
  187. border-top: ($arrow-size * 2) solid $arrow-bg;
  188. } @else if ($arrow-direction == left) {
  189. left: - ($arrow-size * 2) + ($arrow-border-width * 2);
  190. top: - ($arrow-size);
  191. border-top: ($arrow-size) solid transparent;
  192. border-bottom: ($arrow-size) solid transparent;
  193. border-right: ($arrow-size * 2) solid $arrow-bg;
  194. }
  195. }
  196. }
  197. @include keyframes(ax-picker) {
  198. 0% {
  199. opacity: 0.0;
  200. //@include transform(scale(0));
  201. @include transform(translate(0, -10%));
  202. }
  203. 100% {
  204. opacity: 1.0;
  205. //@include transform(scale(1));
  206. @include transform(translate(0, 0));
  207. }
  208. }
  209. @include keyframes(ax-picker-destroy) {
  210. from {
  211. //@include transform(scale(1));
  212. opacity: 1.0;
  213. @include transform(translate(0, 0));
  214. }
  215. to {
  216. //@include transform(scale(0.95));
  217. opacity: 0.0;
  218. @include transform(translate(0, -10%));
  219. }
  220. }
  221. // mixins --------------------------------------------- end
  222. .ax5-ui-picker {
  223. @include ax-picker();
  224. @include perspective(1000px);
  225. @include transform-style(preserve-3d);
  226. @include animation(ax-picker $ax5picker-easing-time-open);
  227. @include transform(translateZ(0));
  228. @include transform-origin(center top);
  229. /* flip type
  230. @include backface-visibility(visible);
  231. @include transform(translateY(0%) rotateX(0deg));
  232. */
  233. @include picker-variant($ax5picker-default-text, $ax5picker-default-border-color, $ax5picker-default-heading-bg);
  234. &.primary {
  235. @include picker-variant($ax5picker-primary-text, $ax5picker-primary-border-color, $ax5picker-primary-heading-bg);
  236. }
  237. &.success {
  238. @include picker-variant($ax5picker-success-text, $ax5picker-success-border-color, $ax5picker-success-heading-bg);
  239. }
  240. &.info {
  241. @include picker-variant($ax5picker-info-text, $ax5picker-info-border-color, $ax5picker-info-heading-bg);
  242. }
  243. &.warning {
  244. @include picker-variant($ax5picker-warning-text, $ax5picker-warning-border-color, $ax5picker-warning-heading-bg);
  245. }
  246. &.danger {
  247. @include picker-variant($ax5picker-danger-text, $ax5picker-danger-border-color, $ax5picker-danger-heading-bg);
  248. }
  249. &.destroy {
  250. @include animation(ax-picker-destroy $ax5picker-easing-time-close $ease-in-back forwards);
  251. }
  252. &.direction-top {
  253. @include transform-origin(center top);
  254. }
  255. &.direction-right {
  256. @include transform-origin(right center);
  257. }
  258. &.direction-bottom {
  259. @include transform-origin(center bottom);
  260. }
  261. &.direction-left {
  262. @include transform-origin(left center);
  263. }
  264. }
  265. // picker handle
  266. @mixin ax5picker-handle(){
  267. &[data-ax5picker] {
  268. .input-group-addon {
  269. cursor: pointer;
  270. &:not(:last-child) {
  271. border-left: 0 none;
  272. border-right: 0 none;
  273. }
  274. &.color-preview{
  275. padding: 0;
  276. }
  277. [data-ax5picker-color="preview"]{
  278. display: block;
  279. }
  280. }
  281. }
  282. }
  283. .input-group {
  284. @include ax5picker-handle();
  285. }
  286. .form-group {
  287. @include ax5picker-handle();
  288. }