buefy 0.9.13 → 0.9.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (265) hide show
  1. package/CHANGELOG.md +1706 -1639
  2. package/README.md +1 -1
  3. package/dist/buefy.css +313 -1
  4. package/dist/buefy.esm.js +4431 -2331
  5. package/dist/buefy.esm.min.js +2 -2
  6. package/dist/buefy.js +4467 -2364
  7. package/dist/buefy.min.css +1 -1
  8. package/dist/buefy.min.js +2 -2
  9. package/dist/cjs/autocomplete.js +5 -5
  10. package/dist/cjs/button.js +3 -3
  11. package/dist/cjs/carousel.js +4 -4
  12. package/dist/cjs/{chunk-34949503.js → chunk-0d6f213f.js} +2 -2
  13. package/dist/cjs/{chunk-2c7de785.js → chunk-0e3108f5.js} +2 -2
  14. package/dist/cjs/{chunk-2911aa4b.js → chunk-1438658c.js} +14 -11
  15. package/dist/cjs/{chunk-114191ae.js → chunk-1f7e4ed3.js} +3 -3
  16. package/dist/cjs/{chunk-a11294f9.js → chunk-334bc809.js} +1 -1
  17. package/dist/cjs/chunk-45739695.js +332 -0
  18. package/dist/cjs/{chunk-c7b2aa4b.js → chunk-4bcfaf1c.js} +0 -0
  19. package/dist/cjs/{chunk-f5106717.js → chunk-5058e659.js} +3 -3
  20. package/dist/cjs/{chunk-61023b09.js → chunk-545e1c7f.js} +102 -16
  21. package/dist/cjs/{chunk-30670fac.js → chunk-54b0042d.js} +19 -3
  22. package/dist/cjs/{chunk-fe2f57ee.js → chunk-5ed8a75a.js} +2 -2
  23. package/dist/cjs/{chunk-d120e215.js → chunk-73f8eef8.js} +8 -2
  24. package/dist/cjs/{chunk-2062216d.js → chunk-7c11fdde.js} +5 -4
  25. package/dist/cjs/{chunk-3cc5d9a6.js → chunk-841c0e0f.js} +1 -1
  26. package/dist/cjs/{chunk-9e4cf4c5.js → chunk-87a116d9.js} +0 -0
  27. package/dist/cjs/{chunk-fefd7b77.js → chunk-a53b7aff.js} +0 -0
  28. package/dist/cjs/{chunk-d0f8ea39.js → chunk-c0a093d7.js} +7 -7
  29. package/dist/cjs/{chunk-7da0c017.js → chunk-c8abb3ed.js} +21 -21
  30. package/dist/cjs/{chunk-c6fbc7b4.js → chunk-d0df905a.js} +15 -2
  31. package/dist/cjs/{chunk-d54e40f6.js → chunk-e86d3eeb.js} +1 -8
  32. package/dist/cjs/{chunk-6cb902f8.js → chunk-e872f5e2.js} +1 -1
  33. package/dist/cjs/{chunk-2ae50815.js → chunk-f5285f14.js} +4 -4
  34. package/dist/cjs/clockpicker.js +8 -8
  35. package/dist/cjs/colorpicker.js +1752 -0
  36. package/dist/cjs/config.js +1 -1
  37. package/dist/cjs/datepicker.js +11 -11
  38. package/dist/cjs/datetimepicker.js +30 -14
  39. package/dist/cjs/dialog.js +5 -5
  40. package/dist/cjs/dropdown.js +3 -3
  41. package/dist/cjs/field.js +2 -2
  42. package/dist/cjs/helpers.js +21 -1
  43. package/dist/cjs/icon.js +2 -2
  44. package/dist/cjs/image.js +2 -2
  45. package/dist/cjs/index.js +27 -22
  46. package/dist/cjs/input.js +4 -4
  47. package/dist/cjs/loading.js +5 -5
  48. package/dist/cjs/menu.js +2 -2
  49. package/dist/cjs/message.js +4 -9
  50. package/dist/cjs/modal.js +5 -5
  51. package/dist/cjs/navbar.js +4 -1
  52. package/dist/cjs/notification.js +7 -7
  53. package/dist/cjs/numberinput.js +30 -21
  54. package/dist/cjs/pagination.js +7 -7
  55. package/dist/cjs/progress.js +3 -3
  56. package/dist/cjs/rate.js +2 -2
  57. package/dist/cjs/select.js +4 -4
  58. package/dist/cjs/sidebar.js +1 -1
  59. package/dist/cjs/slider.js +3 -3
  60. package/dist/cjs/snackbar.js +5 -4
  61. package/dist/cjs/steps.js +5 -5
  62. package/dist/cjs/table.js +157 -146
  63. package/dist/cjs/tabs.js +7 -7
  64. package/dist/cjs/taginput.js +5 -5
  65. package/dist/cjs/timepicker.js +12 -12
  66. package/dist/cjs/toast.js +3 -3
  67. package/dist/cjs/tooltip.js +4 -4
  68. package/dist/cjs/upload.js +23 -9
  69. package/dist/components/autocomplete/index.js +24 -2
  70. package/dist/components/autocomplete/index.min.js +2 -2
  71. package/dist/components/breadcrumb/index.js +1 -1
  72. package/dist/components/breadcrumb/index.min.js +1 -1
  73. package/dist/components/button/index.js +8 -2
  74. package/dist/components/button/index.min.js +2 -2
  75. package/dist/components/carousel/index.js +8 -2
  76. package/dist/components/carousel/index.min.js +2 -2
  77. package/dist/components/checkbox/index.js +1 -1
  78. package/dist/components/checkbox/index.min.js +1 -1
  79. package/dist/components/clockpicker/index.js +41 -22
  80. package/dist/components/clockpicker/index.min.js +2 -2
  81. package/dist/components/collapse/index.js +1 -1
  82. package/dist/components/collapse/index.min.js +1 -1
  83. package/dist/components/colorpicker/index.js +4318 -0
  84. package/dist/components/colorpicker/index.min.js +2 -0
  85. package/dist/components/datepicker/index.js +48 -26
  86. package/dist/components/datepicker/index.min.js +2 -2
  87. package/dist/components/datetimepicker/index.js +66 -28
  88. package/dist/components/datetimepicker/index.min.js +2 -2
  89. package/dist/components/dialog/index.js +8 -2
  90. package/dist/components/dialog/index.min.js +2 -2
  91. package/dist/components/dropdown/index.js +14 -1
  92. package/dist/components/dropdown/index.min.js +2 -2
  93. package/dist/components/field/index.js +21 -21
  94. package/dist/components/field/index.min.js +1 -1
  95. package/dist/components/icon/index.js +8 -2
  96. package/dist/components/icon/index.min.js +2 -2
  97. package/dist/components/image/index.js +1 -1
  98. package/dist/components/image/index.min.js +1 -1
  99. package/dist/components/input/index.js +8 -2
  100. package/dist/components/input/index.min.js +2 -2
  101. package/dist/components/loading/index.js +1 -1
  102. package/dist/components/loading/index.min.js +1 -1
  103. package/dist/components/menu/index.js +8 -2
  104. package/dist/components/menu/index.min.js +2 -2
  105. package/dist/components/message/index.js +11 -9
  106. package/dist/components/message/index.min.js +2 -2
  107. package/dist/components/modal/index.js +1 -1
  108. package/dist/components/modal/index.min.js +1 -1
  109. package/dist/components/navbar/index.js +4 -1
  110. package/dist/components/navbar/index.min.js +2 -2
  111. package/dist/components/notification/index.js +13 -13
  112. package/dist/components/notification/index.min.js +2 -2
  113. package/dist/components/numberinput/index.js +34 -19
  114. package/dist/components/numberinput/index.min.js +2 -2
  115. package/dist/components/pagination/index.js +107 -16
  116. package/dist/components/pagination/index.min.js +2 -2
  117. package/dist/components/progress/index.js +2 -2
  118. package/dist/components/progress/index.min.js +2 -2
  119. package/dist/components/radio/index.js +1 -1
  120. package/dist/components/radio/index.min.js +1 -1
  121. package/dist/components/rate/index.js +8 -2
  122. package/dist/components/rate/index.min.js +2 -2
  123. package/dist/components/select/index.js +8 -2
  124. package/dist/components/select/index.min.js +2 -2
  125. package/dist/components/sidebar/index.js +1 -1
  126. package/dist/components/sidebar/index.min.js +1 -1
  127. package/dist/components/skeleton/index.js +1 -1
  128. package/dist/components/skeleton/index.min.js +1 -1
  129. package/dist/components/slider/index.js +2 -2
  130. package/dist/components/slider/index.min.js +2 -2
  131. package/dist/components/snackbar/index.js +4 -10
  132. package/dist/components/snackbar/index.min.js +2 -2
  133. package/dist/components/steps/index.js +8 -2
  134. package/dist/components/steps/index.min.js +2 -2
  135. package/dist/components/switch/index.js +1 -1
  136. package/dist/components/switch/index.min.js +1 -1
  137. package/dist/components/table/index.js +253 -133
  138. package/dist/components/table/index.min.js +2 -2
  139. package/dist/components/tabs/index.js +10 -4
  140. package/dist/components/tabs/index.min.js +2 -2
  141. package/dist/components/tag/index.js +1 -1
  142. package/dist/components/tag/index.min.js +1 -1
  143. package/dist/components/taginput/index.js +24 -2
  144. package/dist/components/taginput/index.min.js +2 -2
  145. package/dist/components/timepicker/index.js +41 -22
  146. package/dist/components/timepicker/index.min.js +2 -2
  147. package/dist/components/toast/index.js +2 -9
  148. package/dist/components/toast/index.min.js +2 -2
  149. package/dist/components/tooltip/index.js +2 -2
  150. package/dist/components/tooltip/index.min.js +2 -2
  151. package/dist/components/upload/index.js +20 -6
  152. package/dist/components/upload/index.min.js +2 -2
  153. package/dist/esm/autocomplete.js +6 -6
  154. package/dist/esm/button.js +4 -4
  155. package/dist/esm/carousel.js +4 -4
  156. package/dist/esm/{chunk-18e8b067.js → chunk-1a4fde6d.js} +102 -17
  157. package/dist/esm/{chunk-3773c62d.js → chunk-22cf6667.js} +2 -2
  158. package/dist/esm/{chunk-ece062a7.js → chunk-262b3f82.js} +1 -1
  159. package/dist/esm/chunk-455cdeae.js +317 -0
  160. package/dist/esm/{chunk-d7f92d97.js → chunk-5435bd9a.js} +5 -4
  161. package/dist/esm/{chunk-e7c9b2cb.js → chunk-58cdbf2b.js} +2 -2
  162. package/dist/esm/{chunk-29ca0df8.js → chunk-60a03517.js} +1 -1
  163. package/dist/esm/{chunk-21fc0948.js → chunk-66cef090.js} +7 -7
  164. package/dist/esm/{chunk-71a547bc.js → chunk-690d5be4.js} +1 -1
  165. package/dist/esm/{chunk-83eb0d37.js → chunk-6adc5c5d.js} +3 -3
  166. package/dist/esm/{chunk-c9c58d0c.js → chunk-6d0f2352.js} +0 -0
  167. package/dist/esm/{chunk-8d0f95b8.js → chunk-6d96579e.js} +4 -4
  168. package/dist/esm/{chunk-22e9f916.js → chunk-6fb4a069.js} +14 -11
  169. package/dist/esm/{chunk-75a5af93.js → chunk-84c6dfd6.js} +0 -0
  170. package/dist/esm/{chunk-ae8ab23a.js → chunk-a628d44d.js} +3 -3
  171. package/dist/esm/{chunk-b0c0c6b0.js → chunk-c9c18b2f.js} +0 -0
  172. package/dist/esm/{chunk-9f7f7441.js → chunk-d35985c7.js} +0 -0
  173. package/dist/esm/{chunk-799e084d.js → chunk-d9232770.js} +1 -8
  174. package/dist/esm/{chunk-4b67a181.js → chunk-dbd43ef1.js} +15 -2
  175. package/dist/esm/{chunk-d92f0cd9.js → chunk-e044aa02.js} +8 -2
  176. package/dist/esm/{chunk-b07e3182.js → chunk-effa4d25.js} +21 -21
  177. package/dist/esm/{chunk-6019fd7a.js → chunk-f9eaeac4.js} +19 -3
  178. package/dist/esm/clockpicker.js +8 -8
  179. package/dist/esm/colorpicker.js +1748 -0
  180. package/dist/esm/config.js +1 -1
  181. package/dist/esm/datepicker.js +10 -10
  182. package/dist/esm/datetimepicker.js +29 -13
  183. package/dist/esm/dialog.js +4 -4
  184. package/dist/esm/dropdown.js +4 -4
  185. package/dist/esm/field.js +3 -3
  186. package/dist/esm/helpers.js +20 -2
  187. package/dist/esm/icon.js +3 -3
  188. package/dist/esm/image.js +3 -3
  189. package/dist/esm/index.js +94 -91
  190. package/dist/esm/input.js +5 -5
  191. package/dist/esm/loading.js +3 -3
  192. package/dist/esm/menu.js +2 -2
  193. package/dist/esm/message.js +3 -8
  194. package/dist/esm/modal.js +3 -3
  195. package/dist/esm/navbar.js +4 -1
  196. package/dist/esm/notification.js +5 -5
  197. package/dist/esm/numberinput.js +30 -21
  198. package/dist/esm/pagination.js +4 -4
  199. package/dist/esm/progress.js +3 -3
  200. package/dist/esm/rate.js +2 -2
  201. package/dist/esm/select.js +5 -5
  202. package/dist/esm/sidebar.js +1 -1
  203. package/dist/esm/slider.js +2 -2
  204. package/dist/esm/snackbar.js +4 -3
  205. package/dist/esm/steps.js +5 -5
  206. package/dist/esm/table.js +155 -144
  207. package/dist/esm/tabs.js +7 -7
  208. package/dist/esm/taginput.js +5 -5
  209. package/dist/esm/timepicker.js +11 -11
  210. package/dist/esm/toast.js +2 -2
  211. package/dist/esm/tooltip.js +3 -3
  212. package/dist/esm/upload.js +21 -7
  213. package/dist/vetur/attributes.json +96 -0
  214. package/dist/vetur/tags.json +30 -1
  215. package/package.json +1 -1
  216. package/src/components/autocomplete/Autocomplete.vue +10 -0
  217. package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.js.snap +1 -5
  218. package/src/components/carousel/__snapshots__/CarouselList.spec.js.snap +48 -48
  219. package/src/components/colorpicker/Colorpicker.spec.js +10 -0
  220. package/src/components/colorpicker/Colorpicker.vue +354 -0
  221. package/src/components/colorpicker/ColorpickerAlphaSlider.spec.js +14 -0
  222. package/src/components/colorpicker/ColorpickerAlphaSlider.vue +194 -0
  223. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.spec.js +22 -0
  224. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +366 -0
  225. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.spec.js +22 -0
  226. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +442 -0
  227. package/src/components/colorpicker/__snapshots__/ColorPickerHSLRepresentationSquare.spec.js.snap +12 -0
  228. package/src/components/colorpicker/__snapshots__/Colorpicker.spec.js.snap +32 -0
  229. package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.js.snap +11 -0
  230. package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationTriangle.spec.js.snap +36 -0
  231. package/src/components/colorpicker/index.js +17 -0
  232. package/src/components/datepicker/DatepickerTableRow.spec.js +26 -0
  233. package/src/components/datepicker/DatepickerTableRow.vue +4 -5
  234. package/src/components/datetimepicker/Datetimepicker.vue +17 -1
  235. package/src/components/dropdown/Dropdown.vue +13 -0
  236. package/src/components/field/Field.vue +271 -271
  237. package/src/components/index.js +2 -0
  238. package/src/components/message/Message.vue +0 -5
  239. package/src/components/navbar/NavbarDropdown.vue +4 -0
  240. package/src/components/notification/Notification.vue +1 -1
  241. package/src/components/numberinput/Numberinput.spec.js +62 -0
  242. package/src/components/numberinput/Numberinput.vue +22 -15
  243. package/src/components/pagination/Pagination.vue +141 -51
  244. package/src/components/progress/Progress.vue +1 -1
  245. package/src/components/snackbar/index.js +2 -1
  246. package/src/components/table/Table.spec.js +17 -3
  247. package/src/components/table/Table.vue +1436 -1409
  248. package/src/components/table/TablePagination.vue +10 -2
  249. package/src/components/tabs/Tabs.vue +2 -0
  250. package/src/components/timepicker/__snapshots__/Timepicker.spec.js.snap +18 -47
  251. package/src/components/tooltip/Tooltip.vue +2 -2
  252. package/src/components/upload/Upload.vue +19 -7
  253. package/src/scss/buefy.scss +1 -0
  254. package/src/scss/components/_colorpicker.scss +283 -0
  255. package/src/scss/components/_pagination.scss +38 -0
  256. package/src/utils/MessageMixin.js +2 -1
  257. package/src/utils/NoticeMixin.js +1 -5
  258. package/src/utils/color.js +441 -0
  259. package/src/utils/color.spec.js +52 -0
  260. package/src/utils/helpers.js +16 -0
  261. package/src/utils/icons.js +7 -1
  262. package/types/components.d.ts +7 -2
  263. package/types/helpers.d.ts +2 -1
  264. package/dist/cjs/chunk-92621ff7.js +0 -141
  265. package/dist/esm/chunk-2452e3d3.js +0 -134
@@ -0,0 +1,4318 @@
1
+ /*! Buefy v0.9.17 | MIT License | github.com/buefy/buefy */
2
+ (function (global, factory) {
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
4
+ typeof define === 'function' && define.amd ? define(['exports'], factory) :
5
+ (global = global || self, factory(global.Colorpicker = {}));
6
+ }(this, function (exports) { 'use strict';
7
+
8
+ function _typeof(obj) {
9
+ "@babel/helpers - typeof";
10
+
11
+ if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
12
+ _typeof = function (obj) {
13
+ return typeof obj;
14
+ };
15
+ } else {
16
+ _typeof = function (obj) {
17
+ return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
18
+ };
19
+ }
20
+
21
+ return _typeof(obj);
22
+ }
23
+
24
+ function _classCallCheck(instance, Constructor) {
25
+ if (!(instance instanceof Constructor)) {
26
+ throw new TypeError("Cannot call a class as a function");
27
+ }
28
+ }
29
+
30
+ function _defineProperties(target, props) {
31
+ for (var i = 0; i < props.length; i++) {
32
+ var descriptor = props[i];
33
+ descriptor.enumerable = descriptor.enumerable || false;
34
+ descriptor.configurable = true;
35
+ if ("value" in descriptor) descriptor.writable = true;
36
+ Object.defineProperty(target, descriptor.key, descriptor);
37
+ }
38
+ }
39
+
40
+ function _createClass(Constructor, protoProps, staticProps) {
41
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
42
+ if (staticProps) _defineProperties(Constructor, staticProps);
43
+ return Constructor;
44
+ }
45
+
46
+ function _defineProperty(obj, key, value) {
47
+ if (key in obj) {
48
+ Object.defineProperty(obj, key, {
49
+ value: value,
50
+ enumerable: true,
51
+ configurable: true,
52
+ writable: true
53
+ });
54
+ } else {
55
+ obj[key] = value;
56
+ }
57
+
58
+ return obj;
59
+ }
60
+
61
+ function ownKeys(object, enumerableOnly) {
62
+ var keys = Object.keys(object);
63
+
64
+ if (Object.getOwnPropertySymbols) {
65
+ var symbols = Object.getOwnPropertySymbols(object);
66
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
67
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
68
+ });
69
+ keys.push.apply(keys, symbols);
70
+ }
71
+
72
+ return keys;
73
+ }
74
+
75
+ function _objectSpread2(target) {
76
+ for (var i = 1; i < arguments.length; i++) {
77
+ var source = arguments[i] != null ? arguments[i] : {};
78
+
79
+ if (i % 2) {
80
+ ownKeys(Object(source), true).forEach(function (key) {
81
+ _defineProperty(target, key, source[key]);
82
+ });
83
+ } else if (Object.getOwnPropertyDescriptors) {
84
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
85
+ } else {
86
+ ownKeys(Object(source)).forEach(function (key) {
87
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
88
+ });
89
+ }
90
+ }
91
+
92
+ return target;
93
+ }
94
+
95
+ function _inherits(subClass, superClass) {
96
+ if (typeof superClass !== "function" && superClass !== null) {
97
+ throw new TypeError("Super expression must either be null or a function");
98
+ }
99
+
100
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
101
+ constructor: {
102
+ value: subClass,
103
+ writable: true,
104
+ configurable: true
105
+ }
106
+ });
107
+ if (superClass) _setPrototypeOf(subClass, superClass);
108
+ }
109
+
110
+ function _getPrototypeOf(o) {
111
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
112
+ return o.__proto__ || Object.getPrototypeOf(o);
113
+ };
114
+ return _getPrototypeOf(o);
115
+ }
116
+
117
+ function _setPrototypeOf(o, p) {
118
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
119
+ o.__proto__ = p;
120
+ return o;
121
+ };
122
+
123
+ return _setPrototypeOf(o, p);
124
+ }
125
+
126
+ function isNativeReflectConstruct() {
127
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
128
+ if (Reflect.construct.sham) return false;
129
+ if (typeof Proxy === "function") return true;
130
+
131
+ try {
132
+ Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
133
+ return true;
134
+ } catch (e) {
135
+ return false;
136
+ }
137
+ }
138
+
139
+ function _construct(Parent, args, Class) {
140
+ if (isNativeReflectConstruct()) {
141
+ _construct = Reflect.construct;
142
+ } else {
143
+ _construct = function _construct(Parent, args, Class) {
144
+ var a = [null];
145
+ a.push.apply(a, args);
146
+ var Constructor = Function.bind.apply(Parent, a);
147
+ var instance = new Constructor();
148
+ if (Class) _setPrototypeOf(instance, Class.prototype);
149
+ return instance;
150
+ };
151
+ }
152
+
153
+ return _construct.apply(null, arguments);
154
+ }
155
+
156
+ function _isNativeFunction(fn) {
157
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
158
+ }
159
+
160
+ function _wrapNativeSuper(Class) {
161
+ var _cache = typeof Map === "function" ? new Map() : undefined;
162
+
163
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
164
+ if (Class === null || !_isNativeFunction(Class)) return Class;
165
+
166
+ if (typeof Class !== "function") {
167
+ throw new TypeError("Super expression must either be null or a function");
168
+ }
169
+
170
+ if (typeof _cache !== "undefined") {
171
+ if (_cache.has(Class)) return _cache.get(Class);
172
+
173
+ _cache.set(Class, Wrapper);
174
+ }
175
+
176
+ function Wrapper() {
177
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
178
+ }
179
+
180
+ Wrapper.prototype = Object.create(Class.prototype, {
181
+ constructor: {
182
+ value: Wrapper,
183
+ enumerable: false,
184
+ writable: true,
185
+ configurable: true
186
+ }
187
+ });
188
+ return _setPrototypeOf(Wrapper, Class);
189
+ };
190
+
191
+ return _wrapNativeSuper(Class);
192
+ }
193
+
194
+ function _assertThisInitialized(self) {
195
+ if (self === void 0) {
196
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
197
+ }
198
+
199
+ return self;
200
+ }
201
+
202
+ function _possibleConstructorReturn(self, call) {
203
+ if (call && (typeof call === "object" || typeof call === "function")) {
204
+ return call;
205
+ }
206
+
207
+ return _assertThisInitialized(self);
208
+ }
209
+
210
+ function _taggedTemplateLiteral(strings, raw) {
211
+ if (!raw) {
212
+ raw = strings.slice(0);
213
+ }
214
+
215
+ return Object.freeze(Object.defineProperties(strings, {
216
+ raw: {
217
+ value: Object.freeze(raw)
218
+ }
219
+ }));
220
+ }
221
+
222
+ function _slicedToArray(arr, i) {
223
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
224
+ }
225
+
226
+ function _toArray(arr) {
227
+ return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest();
228
+ }
229
+
230
+ function _toConsumableArray(arr) {
231
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
232
+ }
233
+
234
+ function _arrayWithoutHoles(arr) {
235
+ if (Array.isArray(arr)) {
236
+ for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
237
+
238
+ return arr2;
239
+ }
240
+ }
241
+
242
+ function _arrayWithHoles(arr) {
243
+ if (Array.isArray(arr)) return arr;
244
+ }
245
+
246
+ function _iterableToArray(iter) {
247
+ if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
248
+ }
249
+
250
+ function _iterableToArrayLimit(arr, i) {
251
+ if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) {
252
+ return;
253
+ }
254
+
255
+ var _arr = [];
256
+ var _n = true;
257
+ var _d = false;
258
+ var _e = undefined;
259
+
260
+ try {
261
+ for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
262
+ _arr.push(_s.value);
263
+
264
+ if (i && _arr.length === i) break;
265
+ }
266
+ } catch (err) {
267
+ _d = true;
268
+ _e = err;
269
+ } finally {
270
+ try {
271
+ if (!_n && _i["return"] != null) _i["return"]();
272
+ } finally {
273
+ if (_d) throw _e;
274
+ }
275
+ }
276
+
277
+ return _arr;
278
+ }
279
+
280
+ function _nonIterableSpread() {
281
+ throw new TypeError("Invalid attempt to spread non-iterable instance");
282
+ }
283
+
284
+ function _nonIterableRest() {
285
+ throw new TypeError("Invalid attempt to destructure non-iterable instance");
286
+ }
287
+
288
+ var config = {
289
+ defaultContainerElement: null,
290
+ defaultIconPack: 'mdi',
291
+ defaultIconComponent: null,
292
+ defaultIconPrev: 'chevron-left',
293
+ defaultIconNext: 'chevron-right',
294
+ defaultLocale: undefined,
295
+ defaultDialogConfirmText: null,
296
+ defaultDialogCancelText: null,
297
+ defaultSnackbarDuration: 3500,
298
+ defaultSnackbarPosition: null,
299
+ defaultToastDuration: 2000,
300
+ defaultToastPosition: null,
301
+ defaultNotificationDuration: 2000,
302
+ defaultNotificationPosition: null,
303
+ defaultTooltipType: 'is-primary',
304
+ defaultTooltipDelay: null,
305
+ defaultSidebarDelay: null,
306
+ defaultInputAutocomplete: 'on',
307
+ defaultDateFormatter: null,
308
+ defaultDateParser: null,
309
+ defaultDateCreator: null,
310
+ defaultTimeCreator: null,
311
+ defaultDayNames: null,
312
+ defaultMonthNames: null,
313
+ defaultFirstDayOfWeek: null,
314
+ defaultUnselectableDaysOfWeek: null,
315
+ defaultTimeFormatter: null,
316
+ defaultTimeParser: null,
317
+ defaultModalCanCancel: ['escape', 'x', 'outside', 'button'],
318
+ defaultModalScroll: null,
319
+ defaultDatepickerMobileNative: true,
320
+ defaultTimepickerMobileNative: true,
321
+ defaultNoticeQueue: true,
322
+ defaultInputHasCounter: true,
323
+ defaultTaginputHasCounter: true,
324
+ defaultUseHtml5Validation: true,
325
+ defaultDropdownMobileModal: true,
326
+ defaultFieldLabelPosition: null,
327
+ defaultDatepickerYearsRange: [-100, 10],
328
+ defaultDatepickerNearbyMonthDays: true,
329
+ defaultDatepickerNearbySelectableMonthDays: false,
330
+ defaultDatepickerShowWeekNumber: false,
331
+ defaultDatepickerWeekNumberClickable: false,
332
+ defaultDatepickerMobileModal: true,
333
+ defaultTrapFocus: true,
334
+ defaultAutoFocus: true,
335
+ defaultButtonRounded: false,
336
+ defaultSwitchRounded: true,
337
+ defaultCarouselInterval: 3500,
338
+ defaultTabsExpanded: false,
339
+ defaultTabsAnimated: true,
340
+ defaultTabsType: null,
341
+ defaultStatusIcon: true,
342
+ defaultProgrammaticPromise: false,
343
+ defaultLinkTags: ['a', 'button', 'input', 'router-link', 'nuxt-link', 'n-link', 'RouterLink', 'NuxtLink', 'NLink'],
344
+ defaultImageWebpFallback: null,
345
+ defaultImageLazy: true,
346
+ defaultImageResponsive: true,
347
+ defaultImageRatio: null,
348
+ defaultImageSrcsetFormatter: null,
349
+ defaultBreadcrumbTag: 'a',
350
+ defaultBreadcrumbAlign: 'is-left',
351
+ defaultBreadcrumbSeparator: '',
352
+ defaultBreadcrumbSize: 'is-medium',
353
+ customIconPacks: null
354
+ };
355
+
356
+ /**
357
+ * Checks if the flag is set
358
+ * @param val
359
+ * @param flag
360
+ * @returns {boolean}
361
+ */
362
+
363
+ function hasFlag(val, flag) {
364
+ return (val & flag) === flag;
365
+ }
366
+ /**
367
+ * Merge function to replace Object.assign with deep merging possibility
368
+ */
369
+
370
+ var isObject = function isObject(item) {
371
+ return _typeof(item) === 'object' && !Array.isArray(item);
372
+ };
373
+
374
+ var mergeFn = function mergeFn(target, source) {
375
+ var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
376
+
377
+ if (deep || !Object.assign) {
378
+ var isDeep = function isDeep(prop) {
379
+ return isObject(source[prop]) && target !== null && target.hasOwnProperty(prop) && isObject(target[prop]);
380
+ };
381
+
382
+ var replaced = Object.getOwnPropertyNames(source).map(function (prop) {
383
+ return _defineProperty({}, prop, isDeep(prop) ? mergeFn(target[prop], source[prop], deep) : source[prop]);
384
+ }).reduce(function (a, b) {
385
+ return _objectSpread2({}, a, {}, b);
386
+ }, {});
387
+ return _objectSpread2({}, target, {}, replaced);
388
+ } else {
389
+ return Object.assign(target, source);
390
+ }
391
+ };
392
+
393
+ var merge = mergeFn;
394
+ /**
395
+ * Mobile detection
396
+ * https://www.abeautifulsite.net/detecting-mobile-devices-with-javascript
397
+ */
398
+
399
+ var isMobile = {
400
+ Android: function Android() {
401
+ return typeof window !== 'undefined' && window.navigator.userAgent.match(/Android/i);
402
+ },
403
+ BlackBerry: function BlackBerry() {
404
+ return typeof window !== 'undefined' && window.navigator.userAgent.match(/BlackBerry/i);
405
+ },
406
+ iOS: function iOS() {
407
+ return typeof window !== 'undefined' && (window.navigator.userAgent.match(/iPhone|iPad|iPod/i) || window.navigator.platform === 'MacIntel' && window.navigator.maxTouchPoints > 1);
408
+ },
409
+ Opera: function Opera() {
410
+ return typeof window !== 'undefined' && window.navigator.userAgent.match(/Opera Mini/i);
411
+ },
412
+ Windows: function Windows() {
413
+ return typeof window !== 'undefined' && window.navigator.userAgent.match(/IEMobile/i);
414
+ },
415
+ any: function any() {
416
+ return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
417
+ }
418
+ };
419
+ function removeElement(el) {
420
+ if (typeof el.remove !== 'undefined') {
421
+ el.remove();
422
+ } else if (typeof el.parentNode !== 'undefined' && el.parentNode !== null) {
423
+ el.parentNode.removeChild(el);
424
+ }
425
+ }
426
+ function createAbsoluteElement(el) {
427
+ var root = document.createElement('div');
428
+ root.style.position = 'absolute';
429
+ root.style.left = '0px';
430
+ root.style.top = '0px';
431
+ root.style.width = '100%';
432
+ var wrapper = document.createElement('div');
433
+ root.appendChild(wrapper);
434
+ wrapper.appendChild(el);
435
+ document.body.appendChild(root);
436
+ return root;
437
+ }
438
+ function isVueComponent(c) {
439
+ return c && c._isVue;
440
+ }
441
+ function toCssWidth(width) {
442
+ return width === undefined ? null : isNaN(width) ? width : width + 'px';
443
+ }
444
+ function isCustomElement(vm) {
445
+ return 'shadowRoot' in vm.$root.$options;
446
+ }
447
+
448
+ var FormElementMixin = {
449
+ props: {
450
+ size: String,
451
+ expanded: Boolean,
452
+ loading: Boolean,
453
+ rounded: Boolean,
454
+ icon: String,
455
+ iconPack: String,
456
+ // Native options to use in HTML5 validation
457
+ autocomplete: String,
458
+ maxlength: [Number, String],
459
+ useHtml5Validation: {
460
+ type: Boolean,
461
+ default: function _default() {
462
+ return config.defaultUseHtml5Validation;
463
+ }
464
+ },
465
+ validationMessage: String,
466
+ locale: {
467
+ type: [String, Array],
468
+ default: function _default() {
469
+ return config.defaultLocale;
470
+ }
471
+ },
472
+ statusIcon: {
473
+ type: Boolean,
474
+ default: function _default() {
475
+ return config.defaultStatusIcon;
476
+ }
477
+ }
478
+ },
479
+ data: function data() {
480
+ return {
481
+ isValid: true,
482
+ isFocused: false,
483
+ newIconPack: this.iconPack || config.defaultIconPack
484
+ };
485
+ },
486
+ computed: {
487
+ /**
488
+ * Find parent Field, max 3 levels deep.
489
+ */
490
+ parentField: function parentField() {
491
+ var parent = this.$parent;
492
+
493
+ for (var i = 0; i < 3; i++) {
494
+ if (parent && !parent.$data._isField) {
495
+ parent = parent.$parent;
496
+ }
497
+ }
498
+
499
+ return parent;
500
+ },
501
+
502
+ /**
503
+ * Get the type prop from parent if it's a Field.
504
+ */
505
+ statusType: function statusType() {
506
+ var _ref = this.parentField || {},
507
+ newType = _ref.newType;
508
+
509
+ if (!newType) return;
510
+
511
+ if (typeof newType === 'string') {
512
+ return newType;
513
+ } else {
514
+ for (var key in newType) {
515
+ if (newType[key]) {
516
+ return key;
517
+ }
518
+ }
519
+ }
520
+ },
521
+
522
+ /**
523
+ * Get the message prop from parent if it's a Field.
524
+ */
525
+ statusMessage: function statusMessage() {
526
+ if (!this.parentField) return;
527
+ return this.parentField.newMessage || this.parentField.$slots.message;
528
+ },
529
+
530
+ /**
531
+ * Fix icon size for inputs, large was too big
532
+ */
533
+ iconSize: function iconSize() {
534
+ switch (this.size) {
535
+ case 'is-small':
536
+ return this.size;
537
+
538
+ case 'is-medium':
539
+ return;
540
+
541
+ case 'is-large':
542
+ return this.newIconPack === 'mdi' ? 'is-medium' : '';
543
+ }
544
+ }
545
+ },
546
+ methods: {
547
+ /**
548
+ * Focus method that work dynamically depending on the component.
549
+ */
550
+ focus: function focus() {
551
+ var el = this.getElement();
552
+ if (el === undefined) return;
553
+ this.$nextTick(function () {
554
+ if (el) el.focus();
555
+ });
556
+ },
557
+ onBlur: function onBlur($event) {
558
+ this.isFocused = false;
559
+ this.$emit('blur', $event);
560
+ this.checkHtml5Validity();
561
+ },
562
+ onFocus: function onFocus($event) {
563
+ this.isFocused = true;
564
+ this.$emit('focus', $event);
565
+ this.checkHtml5Validity();
566
+ },
567
+ getElement: function getElement() {
568
+ var el = this.$refs[this.$data._elementRef];
569
+
570
+ while (isVueComponent(el)) {
571
+ el = el.$refs[el.$data._elementRef];
572
+ }
573
+
574
+ return el;
575
+ },
576
+ setInvalid: function setInvalid() {
577
+ var type = 'is-danger';
578
+ var message = this.validationMessage || this.getElement().validationMessage;
579
+ this.setValidity(type, message);
580
+ },
581
+ setValidity: function setValidity(type, message) {
582
+ var _this = this;
583
+
584
+ this.$nextTick(function () {
585
+ if (_this.parentField) {
586
+ // Set type only if not defined
587
+ if (!_this.parentField.type) {
588
+ _this.parentField.newType = type;
589
+ } // Set message only if not defined
590
+
591
+
592
+ if (!_this.parentField.message) {
593
+ _this.parentField.newMessage = message;
594
+ }
595
+ }
596
+ });
597
+ },
598
+
599
+ /**
600
+ * Check HTML5 validation, set isValid property.
601
+ * If validation fail, send 'is-danger' type,
602
+ * and error message to parent if it's a Field.
603
+ */
604
+ checkHtml5Validity: function checkHtml5Validity() {
605
+ if (!this.useHtml5Validation) return;
606
+ var el = this.getElement();
607
+ if (el === undefined) return;
608
+
609
+ if (!el.checkValidity()) {
610
+ this.setInvalid();
611
+ this.isValid = false;
612
+ } else {
613
+ this.setValidity(null, null);
614
+ this.isValid = true;
615
+ }
616
+
617
+ return this.isValid;
618
+ }
619
+ }
620
+ };
621
+
622
+ var colorChannels = ['red', 'green', 'blue', 'alpha'];
623
+ var colorsNammed = {
624
+ black: '#000000',
625
+ silver: '#c0c0c0',
626
+ gray: '#808080',
627
+ white: '#ffffff',
628
+ maroon: '#800000',
629
+ red: '#ff0000',
630
+ purple: '#800080',
631
+ fuchsia: '#ff00ff',
632
+ green: '#008000',
633
+ lime: '#00ff00',
634
+ olive: '#808000',
635
+ yellow: '#ffff00',
636
+ navy: '#000080',
637
+ blue: '#0000ff',
638
+ teal: '#008080',
639
+ aqua: '#00ffff',
640
+ orange: '#ffa500',
641
+ aliceblue: '#f0f8ff',
642
+ antiquewhite: '#faebd7',
643
+ aquamarine: '#7fffd4',
644
+ azure: '#f0ffff',
645
+ beige: '#f5f5dc',
646
+ bisque: '#ffe4c4',
647
+ blanchedalmond: '#ffebcd',
648
+ blueviolet: '#8a2be2',
649
+ brown: '#a52a2a',
650
+ burlywood: '#deb887',
651
+ cadetblue: '#5f9ea0',
652
+ chartreuse: '#7fff00',
653
+ chocolate: '#d2691e',
654
+ coral: '#ff7f50',
655
+ cornflowerblue: '#6495ed',
656
+ cornsilk: '#fff8dc',
657
+ crimson: '#dc143c',
658
+ cyan: '#00ffff',
659
+ darkblue: '#00008b',
660
+ darkcyan: '#008b8b',
661
+ darkgoldenrod: '#b8860b',
662
+ darkgray: '#a9a9a9',
663
+ darkgreen: '#006400',
664
+ darkgrey: '#a9a9a9',
665
+ darkkhaki: '#bdb76b',
666
+ darkmagenta: '#8b008b',
667
+ darkolivegreen: '#556b2f',
668
+ darkorange: '#ff8c00',
669
+ darkorchid: '#9932cc',
670
+ darkred: '#8b0000',
671
+ darksalmon: '#e9967a',
672
+ darkseagreen: '#8fbc8f',
673
+ darkslateblue: '#483d8b',
674
+ darkslategray: '#2f4f4f',
675
+ darkslategrey: '#2f4f4f',
676
+ darkturquoise: '#00ced1',
677
+ darkviolet: '#9400d3',
678
+ deeppink: '#ff1493',
679
+ deepskyblue: '#00bfff',
680
+ dimgray: '#696969',
681
+ dimgrey: '#696969',
682
+ dodgerblue: '#1e90ff',
683
+ firebrick: '#b22222',
684
+ floralwhite: '#fffaf0',
685
+ forestgreen: '#228b22',
686
+ gainsboro: '#dcdcdc',
687
+ ghostwhite: '#f8f8ff',
688
+ gold: '#ffd700',
689
+ goldenrod: '#daa520',
690
+ greenyellow: '#adff2f',
691
+ grey: '#808080',
692
+ honeydew: '#f0fff0',
693
+ hotpink: '#ff69b4',
694
+ indianred: '#cd5c5c',
695
+ indigo: '#4b0082',
696
+ ivory: '#fffff0',
697
+ khaki: '#f0e68c',
698
+ lavender: '#e6e6fa',
699
+ lavenderblush: '#fff0f5',
700
+ lawngreen: '#7cfc00',
701
+ lemonchiffon: '#fffacd',
702
+ lightblue: '#add8e6',
703
+ lightcoral: '#f08080',
704
+ lightcyan: '#e0ffff',
705
+ lightgoldenrodyellow: '#fafad2',
706
+ lightgray: '#d3d3d3',
707
+ lightgreen: '#90ee90',
708
+ lightgrey: '#d3d3d3',
709
+ lightpink: '#ffb6c1',
710
+ lightsalmon: '#ffa07a',
711
+ lightseagreen: '#20b2aa',
712
+ lightskyblue: '#87cefa',
713
+ lightslategray: '#778899',
714
+ lightslategrey: '#778899',
715
+ lightsteelblue: '#b0c4de',
716
+ lightyellow: '#ffffe0',
717
+ limegreen: '#32cd32',
718
+ linen: '#faf0e6',
719
+ magenta: '#ff00ff',
720
+ mediumaquamarine: '#66cdaa',
721
+ mediumblue: '#0000cd',
722
+ mediumorchid: '#ba55d3',
723
+ mediumpurple: '#9370db',
724
+ mediumseagreen: '#3cb371',
725
+ mediumslateblue: '#7b68ee',
726
+ mediumspringgreen: '#00fa9a',
727
+ mediumturquoise: '#48d1cc',
728
+ mediumvioletred: '#c71585',
729
+ midnightblue: '#191970',
730
+ mintcream: '#f5fffa',
731
+ mistyrose: '#ffe4e1',
732
+ moccasin: '#ffe4b5',
733
+ navajowhite: '#ffdead',
734
+ oldlace: '#fdf5e6',
735
+ olivedrab: '#6b8e23',
736
+ orangered: '#ff4500',
737
+ orchid: '#da70d6',
738
+ palegoldenrod: '#eee8aa',
739
+ palegreen: '#98fb98',
740
+ paleturquoise: '#afeeee',
741
+ palevioletred: '#db7093',
742
+ papayawhip: '#ffefd5',
743
+ peachpuff: '#ffdab9',
744
+ peru: '#cd853f',
745
+ pink: '#ffc0cb',
746
+ plum: '#dda0dd',
747
+ powderblue: '#b0e0e6',
748
+ rosybrown: '#bc8f8f',
749
+ royalblue: '#4169e1',
750
+ saddlebrown: '#8b4513',
751
+ salmon: '#fa8072',
752
+ sandybrown: '#f4a460',
753
+ seagreen: '#2e8b57',
754
+ seashell: '#fff5ee',
755
+ sienna: '#a0522d',
756
+ skyblue: '#87ceeb',
757
+ slateblue: '#6a5acd',
758
+ slategray: '#708090',
759
+ slategrey: '#708090',
760
+ snow: '#fffafa',
761
+ springgreen: '#00ff7f',
762
+ steelblue: '#4682b4',
763
+ tan: '#d2b48c',
764
+ thistle: '#d8bfd8',
765
+ tomato: '#ff6347',
766
+ turquoise: '#40e0d0',
767
+ violet: '#ee82ee',
768
+ wheat: '#f5deb3',
769
+ whitesmoke: '#f5f5f5',
770
+ yellowgreen: '#9acd32',
771
+ rebeccapurple: '#663399'
772
+ };
773
+ var ColorTypeError =
774
+ /*#__PURE__*/
775
+ function (_Error) {
776
+ _inherits(ColorTypeError, _Error);
777
+
778
+ function ColorTypeError() {
779
+ _classCallCheck(this, ColorTypeError);
780
+
781
+ return _possibleConstructorReturn(this, _getPrototypeOf(ColorTypeError).call(this, 'ColorTypeError: type must be hex(a), rgb(a) or hsl(a)'));
782
+ }
783
+
784
+ return ColorTypeError;
785
+ }(_wrapNativeSuper(Error));
786
+
787
+ var Color =
788
+ /*#__PURE__*/
789
+ function () {
790
+ function Color() {
791
+ var _this = this;
792
+
793
+ _classCallCheck(this, Color);
794
+
795
+ if (arguments.length > 0) {
796
+ return Color.parse.apply(Color, arguments);
797
+ }
798
+
799
+ this.$channels = new Uint8Array(colorChannels.length);
800
+ colorChannels.forEach(function (channel, index) {
801
+ Object.defineProperty(_this, channel, {
802
+ get: function get() {
803
+ return _this.$channels[index];
804
+ },
805
+ set: function set(byte) {
806
+ if (!Number.isNaN(byte / 1)) {
807
+ _this.$channels[index] = Math.min(255, Math.max(0, byte));
808
+ }
809
+ },
810
+ enumerable: true,
811
+ configurable: true
812
+ });
813
+ }) // Required for observability
814
+ ;
815
+ ['hue', 'saturation', 'lightness'].forEach(function (name) {
816
+ var capitalizedName = name.replace(/^./, function (m) {
817
+ return m.toUpperCase();
818
+ });
819
+ Object.defineProperty(_this, name, {
820
+ get: function get() {
821
+ return _this["get".concat(capitalizedName)]();
822
+ },
823
+ set: function set(value) {
824
+ if (!Number.isNaN(value / 1)) {
825
+ _this["set".concat(capitalizedName)](value);
826
+ }
827
+ },
828
+ enumerable: true,
829
+ configurable: true
830
+ });
831
+ });
832
+ }
833
+
834
+ _createClass(Color, [{
835
+ key: "getHue",
836
+ value: function getHue() {
837
+ var _Array$from$map = Array.from(this.$channels).map(function (c) {
838
+ return c / 255;
839
+ }),
840
+ _Array$from$map2 = _slicedToArray(_Array$from$map, 3),
841
+ red = _Array$from$map2[0],
842
+ green = _Array$from$map2[1],
843
+ blue = _Array$from$map2[2];
844
+
845
+ var _ref = [Math.min(red, green, blue), Math.max(red, green, blue)],
846
+ min = _ref[0],
847
+ max = _ref[1];
848
+ var delta = max - min;
849
+ var hue = 0;
850
+
851
+ if (delta === 0) {
852
+ return hue;
853
+ }
854
+
855
+ if (red === max) {
856
+ hue = (green - blue) / delta % 6;
857
+ } else if (green === max) {
858
+ hue = (blue - red) / delta + 2;
859
+ } else {
860
+ hue = (red - green) / delta + 4;
861
+ }
862
+
863
+ hue *= 60;
864
+
865
+ while (hue !== -Infinity && hue < 0) {
866
+ hue += 360;
867
+ }
868
+
869
+ return Math.round(hue % 360);
870
+ }
871
+ }, {
872
+ key: "setHue",
873
+ value: function setHue(value) {
874
+ var color = Color.fromHSL(value, this.saturation, this.lightness, this.alpha / 255);
875
+
876
+ for (var i = 0; i < this.$channels.length; i++) {
877
+ this.$channels[i] = Number(color.$channels[i]);
878
+ }
879
+ }
880
+ }, {
881
+ key: "getSaturation",
882
+ value: function getSaturation() {
883
+ var _Array$from$map3 = Array.from(this.$channels).map(function (c) {
884
+ return c / 255;
885
+ }),
886
+ _Array$from$map4 = _slicedToArray(_Array$from$map3, 3),
887
+ red = _Array$from$map4[0],
888
+ green = _Array$from$map4[1],
889
+ blue = _Array$from$map4[2];
890
+
891
+ var _ref2 = [Math.min(red, green, blue), Math.max(red, green, blue)],
892
+ min = _ref2[0],
893
+ max = _ref2[1];
894
+ var delta = max - min;
895
+ return delta !== 0 ? Math.round(delta / (1 - Math.abs(2 * this.lightness - 1)) * 100) / 100 : 0;
896
+ }
897
+ }, {
898
+ key: "setSaturation",
899
+ value: function setSaturation(value) {
900
+ var _this2 = this;
901
+
902
+ var color = Color.fromHSL(this.hue, value, this.lightness, this.alpha / 255);
903
+ colorChannels.forEach(function (_, i) {
904
+ return _this2.$channels[i] = color.$channels[i];
905
+ });
906
+ }
907
+ }, {
908
+ key: "getLightness",
909
+ value: function getLightness() {
910
+ var _Array$from$map5 = Array.from(this.$channels).map(function (c) {
911
+ return c / 255;
912
+ }),
913
+ _Array$from$map6 = _slicedToArray(_Array$from$map5, 3),
914
+ red = _Array$from$map6[0],
915
+ green = _Array$from$map6[1],
916
+ blue = _Array$from$map6[2];
917
+
918
+ var _ref3 = [Math.min(red, green, blue), Math.max(red, green, blue)],
919
+ min = _ref3[0],
920
+ max = _ref3[1];
921
+ return Math.round((max + min) / 2 * 100) / 100;
922
+ }
923
+ }, {
924
+ key: "setLightness",
925
+ value: function setLightness(value) {
926
+ var _this3 = this;
927
+
928
+ var color = Color.fromHSL(this.hue, this.lightness, value, this.alpha / 255);
929
+ colorChannels.forEach(function (_, i) {
930
+ return _this3.$channels[i] = color.$channels[i];
931
+ });
932
+ }
933
+ }, {
934
+ key: "clone",
935
+ value: function clone() {
936
+ var _this4 = this;
937
+
938
+ var color = new Color();
939
+ colorChannels.forEach(function (_, i) {
940
+ return color.$channels[i] = _this4.$channels[i];
941
+ });
942
+ return color;
943
+ }
944
+ }, {
945
+ key: "toString",
946
+ value: function toString() {
947
+ var _this5 = this;
948
+
949
+ var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'hex';
950
+
951
+ switch (String(type).toLowerCase()) {
952
+ case 'hex':
953
+ return '#' + colorChannels.slice(0, 3).map(function (channel) {
954
+ return _this5[channel].toString(16).padStart(2, '0');
955
+ }).join('');
956
+
957
+ case 'hexa':
958
+ return '#' + colorChannels.map(function (channel) {
959
+ return _this5[channel].toString(16).padStart(2, '0');
960
+ }).join('');
961
+
962
+ case 'rgb':
963
+ return "rgb(".concat(this.red, ", ").concat(this.green, ", ").concat(this.blue, ")");
964
+
965
+ case 'rgba':
966
+ return "rgba(".concat(this.red, ", ").concat(this.green, ", ").concat(this.blue, ", ").concat(Math.round(this.alpha / 2.55) / 100, ")");
967
+
968
+ case 'hsl':
969
+ return "hsl(".concat(Math.round(this.hue), "deg, ").concat(Math.round(this.saturation * 100), "%, ").concat(Math.round(this.lightness * 100), "%)");
970
+
971
+ case 'hsla':
972
+ return "hsla(".concat(Math.round(this.hue), "deg, ").concat(Math.round(this.saturation * 100), "%, ").concat(Math.round(this.lightness * 100), "%, ").concat(Math.round(this.alpha / 2.55) / 100, ")");
973
+
974
+ default:
975
+ throw new ColorTypeError();
976
+ }
977
+ }
978
+ }, {
979
+ key: Symbol.toString,
980
+ get: function get() {
981
+ return this.toString('hex');
982
+ }
983
+ }], [{
984
+ key: "parse",
985
+ value: function parse() {
986
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
987
+ args[_key] = arguments[_key];
988
+ }
989
+
990
+ if (_typeof(args[0]) === 'object') {
991
+ return Color.parseObject(args[0]);
992
+ } else if (args.every(function (arg) {
993
+ return !Number.isNaN(arg / 1);
994
+ })) {
995
+ var color = new Color();
996
+
997
+ if (args.length > 3) {
998
+ color.red = args[0];
999
+ color.green = args[1];
1000
+ color.blue = args[2];
1001
+
1002
+ if (args[3]) {
1003
+ color.alpha = args[3];
1004
+ }
1005
+ } else if (args.length === 1) {
1006
+ var index = Number(args[0]);
1007
+ return Color.parseIndex(index, index > Math.pow(2, 24) ? 3 : 4);
1008
+ }
1009
+ } else if (typeof args[0] === 'string') {
1010
+ var match = null;
1011
+
1012
+ if (typeof colorsNammed[args[0].toLowerCase()] === 'string') {
1013
+ return Color.parseHex(colorsNammed[args[0].toLowerCase()]);
1014
+ } else if ((match = args[0].match(/^(#|&h|0x)?(([a-f0-9]{3,4}){1,2})$/i)) !== null) {
1015
+ return Color.parseHex(match[2]);
1016
+ } else if ((match = args[0].match(/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(\s*,\s*(\d*\.?\d+))?\s*\)$/i)) !== null) {
1017
+ var channels = [match[1], match[2], match[3], typeof match[5] !== 'undefined' ? match[5] : 1];
1018
+ return Color.fromRGB.apply(Color, _toConsumableArray(channels.map(function (value) {
1019
+ return Number(value);
1020
+ })));
1021
+ } else if (match = args[0].match(/^(h(sl|wb)a?|lab|color|cmyk)\(/i)) {
1022
+ throw new Error('Color expression not implemented yet');
1023
+ }
1024
+ }
1025
+
1026
+ return new Color();
1027
+ }
1028
+ }, {
1029
+ key: "parseObject",
1030
+ value: function parseObject(object) {
1031
+ var color = new Color();
1032
+
1033
+ if (object === null || _typeof(object) !== 'object') {
1034
+ return color;
1035
+ }
1036
+
1037
+ if (Color.isColor(object)) {
1038
+ return object.clone();
1039
+ }
1040
+
1041
+ colorChannels.forEach(function (channel) {
1042
+ if (!Number.isNaN(object[channel])) {
1043
+ color[channel] = object[channel];
1044
+ }
1045
+ });
1046
+ return color;
1047
+ }
1048
+ }, {
1049
+ key: "parseHex",
1050
+ value: function parseHex(hex) {
1051
+ if (typeof hex !== 'string') {
1052
+ throw new Error('Hex expression must be a string');
1053
+ }
1054
+
1055
+ hex = hex.trim().replace(/^(0x|&h|#)/i, '');
1056
+
1057
+ if (hex.length === 3 || hex.length === 4) {
1058
+ hex = hex.split('').map(function (c) {
1059
+ return c.repeat(2);
1060
+ }).join('');
1061
+ }
1062
+
1063
+ if (!(hex.length === 6 || hex.length === 8)) {
1064
+ throw new Error('Incorrect Hex expression length');
1065
+ }
1066
+
1067
+ var chans = hex.split(/(..)/).filter(function (value) {
1068
+ return value;
1069
+ }).map(function (value) {
1070
+ return Number.parseInt(value, 16);
1071
+ });
1072
+
1073
+ if (typeof chans[3] === 'number') {
1074
+ chans[3] /= 255;
1075
+ }
1076
+
1077
+ return Color.fromRGB.apply(Color, _toConsumableArray(chans));
1078
+ }
1079
+ }, {
1080
+ key: "parseIndex",
1081
+ value: function parseIndex(value) {
1082
+ var channels = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 3;
1083
+ var color = new Color();
1084
+
1085
+ for (var i = 0; i < 4; i++) {
1086
+ color[colorChannels[i]] = value >> (channels - i) * 8 && 0xff;
1087
+ }
1088
+
1089
+ return color;
1090
+ }
1091
+ }, {
1092
+ key: "fromRGB",
1093
+ value: function fromRGB(red, green, blue) {
1094
+ var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
1095
+
1096
+ if ([red, green, blue, alpha].some(function (arg) {
1097
+ return Number.isNaN(arg / 1);
1098
+ })) {
1099
+ throw new Error('Invalid arguments');
1100
+ }
1101
+
1102
+ alpha *= 255;
1103
+ var color = new Color();
1104
+ [red, green, blue, alpha].forEach(function (value, index) {
1105
+ color[colorChannels[index]] = value;
1106
+ });
1107
+ return color;
1108
+ }
1109
+ }, {
1110
+ key: "fromHSL",
1111
+ value: function fromHSL(hue, saturation, lightness) {
1112
+ var alpha = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 1;
1113
+
1114
+ if ([hue, saturation, lightness, alpha].some(function (arg) {
1115
+ return Number.isNaN(arg);
1116
+ })) {
1117
+ throw new Error('Invalid arguments');
1118
+ }
1119
+
1120
+ while (hue < 0 && hue !== -Infinity) {
1121
+ hue += 360;
1122
+ }
1123
+
1124
+ hue = hue % 360;
1125
+ saturation = Math.max(0, Math.min(1, saturation));
1126
+ lightness = Math.max(0, Math.min(1, lightness));
1127
+ alpha = Math.max(0, Math.min(1, alpha));
1128
+ var c = (1 - Math.abs(2 * lightness - 1)) * saturation;
1129
+ var x = c * (1 - Math.abs(hue / 60 % 2 - 1));
1130
+ var m = lightness - c / 2;
1131
+
1132
+ var _ref4 = hue < 60 ? [c, x, 0] : hue < 120 ? [x, c, 0] : hue < 180 ? [0, c, x] : hue < 240 ? [0, x, c] : hue < 300 ? [x, 0, c] : [c, 0, x],
1133
+ _ref5 = _slicedToArray(_ref4, 3),
1134
+ r = _ref5[0],
1135
+ g = _ref5[1],
1136
+ b = _ref5[2];
1137
+
1138
+ return Color.fromRGB((r + m) * 255, (g + m) * 255, (b + m) * 255, alpha);
1139
+ }
1140
+ }, {
1141
+ key: "isColor",
1142
+ value: function isColor(arg) {
1143
+ return arg instanceof Color;
1144
+ }
1145
+ }]);
1146
+
1147
+ return Color;
1148
+ }();
1149
+
1150
+ var findFocusable = function findFocusable(element) {
1151
+ var programmatic = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1152
+
1153
+ if (!element) {
1154
+ return null;
1155
+ }
1156
+
1157
+ if (programmatic) {
1158
+ return element.querySelectorAll("*[tabindex=\"-1\"]");
1159
+ }
1160
+
1161
+ return element.querySelectorAll("a[href]:not([tabindex=\"-1\"]),\n area[href],\n input:not([disabled]),\n select:not([disabled]),\n textarea:not([disabled]),\n button:not([disabled]),\n iframe,\n object,\n embed,\n *[tabindex]:not([tabindex=\"-1\"]),\n *[contenteditable]");
1162
+ };
1163
+
1164
+ var onKeyDown;
1165
+
1166
+ var bind = function bind(el, _ref) {
1167
+ var _ref$value = _ref.value,
1168
+ value = _ref$value === void 0 ? true : _ref$value;
1169
+
1170
+ if (value) {
1171
+ var focusable = findFocusable(el);
1172
+ var focusableProg = findFocusable(el, true);
1173
+
1174
+ if (focusable && focusable.length > 0) {
1175
+ onKeyDown = function onKeyDown(event) {
1176
+ // Need to get focusable each time since it can change between key events
1177
+ // ex. changing month in a datepicker
1178
+ focusable = findFocusable(el);
1179
+ focusableProg = findFocusable(el, true);
1180
+ var firstFocusable = focusable[0];
1181
+ var lastFocusable = focusable[focusable.length - 1];
1182
+
1183
+ if (event.target === firstFocusable && event.shiftKey && event.key === 'Tab') {
1184
+ event.preventDefault();
1185
+ lastFocusable.focus();
1186
+ } else if ((event.target === lastFocusable || Array.from(focusableProg).indexOf(event.target) >= 0) && !event.shiftKey && event.key === 'Tab') {
1187
+ event.preventDefault();
1188
+ firstFocusable.focus();
1189
+ }
1190
+ };
1191
+
1192
+ el.addEventListener('keydown', onKeyDown);
1193
+ }
1194
+ }
1195
+ };
1196
+
1197
+ var unbind = function unbind(el) {
1198
+ el.removeEventListener('keydown', onKeyDown);
1199
+ };
1200
+
1201
+ var directive = {
1202
+ bind: bind,
1203
+ unbind: unbind
1204
+ };
1205
+
1206
+ var items = 1;
1207
+ var sorted = 3;
1208
+ var ProviderParentMixin = (function (itemName) {
1209
+ var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1210
+ var mixin = {
1211
+ provide: function provide() {
1212
+ return _defineProperty({}, 'b' + itemName, this);
1213
+ }
1214
+ };
1215
+
1216
+ if (hasFlag(flags, items)) {
1217
+ mixin.data = function () {
1218
+ return {
1219
+ childItems: []
1220
+ };
1221
+ };
1222
+
1223
+ mixin.methods = {
1224
+ _registerItem: function _registerItem(item) {
1225
+ this.childItems.push(item);
1226
+ },
1227
+ _unregisterItem: function _unregisterItem(item) {
1228
+ this.childItems = this.childItems.filter(function (i) {
1229
+ return i !== item;
1230
+ });
1231
+ }
1232
+ };
1233
+
1234
+ if (hasFlag(flags, sorted)) {
1235
+ mixin.watch = {
1236
+ /**
1237
+ * When items are added/removed deep search in the elements default's slot
1238
+ * And mark the items with their index
1239
+ */
1240
+ childItems: function childItems(items) {
1241
+ if (items.length > 0 && this.$scopedSlots.default) {
1242
+ var tag = items[0].$vnode.tag;
1243
+ var index = 0;
1244
+
1245
+ var deepSearch = function deepSearch(children) {
1246
+ var _iteratorNormalCompletion = true;
1247
+ var _didIteratorError = false;
1248
+ var _iteratorError = undefined;
1249
+
1250
+ try {
1251
+ var _loop = function _loop() {
1252
+ var child = _step.value;
1253
+
1254
+ if (child.tag === tag) {
1255
+ // An item with the same tag will for sure be found
1256
+ var it = items.find(function (i) {
1257
+ return i.$vnode === child;
1258
+ });
1259
+
1260
+ if (it) {
1261
+ it.index = index++;
1262
+ }
1263
+ } else if (child.tag) {
1264
+ var sub = child.componentInstance ? child.componentInstance.$scopedSlots.default ? child.componentInstance.$scopedSlots.default() : child.componentInstance.$children : child.children;
1265
+
1266
+ if (Array.isArray(sub) && sub.length > 0) {
1267
+ deepSearch(sub.map(function (e) {
1268
+ return e.$vnode;
1269
+ }));
1270
+ }
1271
+ }
1272
+ };
1273
+
1274
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1275
+ _loop();
1276
+ }
1277
+ } catch (err) {
1278
+ _didIteratorError = true;
1279
+ _iteratorError = err;
1280
+ } finally {
1281
+ try {
1282
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1283
+ _iterator.return();
1284
+ }
1285
+ } finally {
1286
+ if (_didIteratorError) {
1287
+ throw _iteratorError;
1288
+ }
1289
+ }
1290
+ }
1291
+
1292
+ return false;
1293
+ };
1294
+
1295
+ deepSearch(this.$scopedSlots.default());
1296
+ }
1297
+ }
1298
+ };
1299
+ mixin.computed = {
1300
+ /**
1301
+ * When items are added/removed sort them according to their position
1302
+ */
1303
+ sortedItems: function sortedItems() {
1304
+ return this.childItems.slice().sort(function (i1, i2) {
1305
+ return i1.index - i2.index;
1306
+ });
1307
+ }
1308
+ };
1309
+ }
1310
+ }
1311
+
1312
+ return mixin;
1313
+ });
1314
+
1315
+ var DEFAULT_CLOSE_OPTIONS = ['escape', 'outside'];
1316
+ var script = {
1317
+ name: 'BDropdown',
1318
+ directives: {
1319
+ trapFocus: directive
1320
+ },
1321
+ mixins: [ProviderParentMixin('dropdown')],
1322
+ props: {
1323
+ value: {
1324
+ type: [String, Number, Boolean, Object, Array, Function],
1325
+ default: null
1326
+ },
1327
+ disabled: Boolean,
1328
+ inline: Boolean,
1329
+ scrollable: Boolean,
1330
+ maxHeight: {
1331
+ type: [String, Number],
1332
+ default: 200
1333
+ },
1334
+ position: {
1335
+ type: String,
1336
+ validator: function validator(value) {
1337
+ return ['is-top-right', 'is-top-left', 'is-bottom-left', 'is-bottom-right'].indexOf(value) > -1;
1338
+ }
1339
+ },
1340
+ triggers: {
1341
+ type: Array,
1342
+ default: function _default() {
1343
+ return ['click'];
1344
+ }
1345
+ },
1346
+ mobileModal: {
1347
+ type: Boolean,
1348
+ default: function _default() {
1349
+ return config.defaultDropdownMobileModal;
1350
+ }
1351
+ },
1352
+ ariaRole: {
1353
+ type: String,
1354
+ validator: function validator(value) {
1355
+ return ['menu', 'list', 'dialog'].indexOf(value) > -1;
1356
+ },
1357
+ default: null
1358
+ },
1359
+ animation: {
1360
+ type: String,
1361
+ default: 'fade'
1362
+ },
1363
+ multiple: Boolean,
1364
+ trapFocus: {
1365
+ type: Boolean,
1366
+ default: function _default() {
1367
+ return config.defaultTrapFocus;
1368
+ }
1369
+ },
1370
+ closeOnClick: {
1371
+ type: Boolean,
1372
+ default: true
1373
+ },
1374
+ canClose: {
1375
+ type: [Array, Boolean],
1376
+ default: true
1377
+ },
1378
+ expanded: Boolean,
1379
+ appendToBody: Boolean,
1380
+ appendToBodyCopyParent: Boolean
1381
+ },
1382
+ data: function data() {
1383
+ return {
1384
+ selected: this.value,
1385
+ style: {},
1386
+ isActive: false,
1387
+ isHoverable: false,
1388
+ _bodyEl: undefined // Used to append to body
1389
+
1390
+ };
1391
+ },
1392
+ computed: {
1393
+ rootClasses: function rootClasses() {
1394
+ return [this.position, {
1395
+ 'is-disabled': this.disabled,
1396
+ 'is-hoverable': this.hoverable,
1397
+ 'is-inline': this.inline,
1398
+ 'is-active': this.isActive || this.inline,
1399
+ 'is-mobile-modal': this.isMobileModal,
1400
+ 'is-expanded': this.expanded
1401
+ }];
1402
+ },
1403
+ isMobileModal: function isMobileModal() {
1404
+ return this.mobileModal && !this.inline;
1405
+ },
1406
+ cancelOptions: function cancelOptions() {
1407
+ return typeof this.canClose === 'boolean' ? this.canClose ? DEFAULT_CLOSE_OPTIONS : [] : this.canClose;
1408
+ },
1409
+ contentStyle: function contentStyle() {
1410
+ return {
1411
+ maxHeight: this.scrollable ? toCssWidth(this.maxHeight) : null,
1412
+ overflow: this.scrollable ? 'auto' : null
1413
+ };
1414
+ },
1415
+ hoverable: function hoverable() {
1416
+ return this.triggers.indexOf('hover') >= 0;
1417
+ }
1418
+ },
1419
+ watch: {
1420
+ /**
1421
+ * When v-model is changed set the new selected item.
1422
+ */
1423
+ value: function value(_value) {
1424
+ this.selected = _value;
1425
+ },
1426
+
1427
+ /**
1428
+ * Emit event when isActive value is changed.
1429
+ */
1430
+ isActive: function isActive(value) {
1431
+ var _this = this;
1432
+
1433
+ this.$emit('active-change', value);
1434
+ this.handleScroll();
1435
+
1436
+ if (this.appendToBody) {
1437
+ this.$nextTick(function () {
1438
+ _this.updateAppendToBody();
1439
+ });
1440
+ }
1441
+ }
1442
+ },
1443
+ methods: {
1444
+ handleScroll: function handleScroll() {
1445
+ if (typeof window === 'undefined') return;
1446
+
1447
+ if (this.isMobileModal) {
1448
+ if (this.isActive) {
1449
+ document.documentElement.classList.add('is-clipped-touch');
1450
+ } else {
1451
+ document.documentElement.classList.remove('is-clipped-touch');
1452
+ }
1453
+ }
1454
+ },
1455
+
1456
+ /**
1457
+ * Click listener from DropdownItem.
1458
+ * 1. Set new selected item.
1459
+ * 2. Emit input event to update the user v-model.
1460
+ * 3. Close the dropdown.
1461
+ */
1462
+ selectItem: function selectItem(value) {
1463
+ if (this.multiple) {
1464
+ if (this.selected) {
1465
+ if (this.selected.indexOf(value) === -1) {
1466
+ // Add value
1467
+ this.selected = [].concat(_toConsumableArray(this.selected), [value]);
1468
+ } else {
1469
+ // Remove value
1470
+ this.selected = this.selected.filter(function (val) {
1471
+ return val !== value;
1472
+ });
1473
+ }
1474
+ } else {
1475
+ this.selected = [value];
1476
+ }
1477
+
1478
+ this.$emit('change', this.selected);
1479
+ } else {
1480
+ if (this.selected !== value) {
1481
+ this.selected = value;
1482
+ this.$emit('change', this.selected);
1483
+ }
1484
+ }
1485
+
1486
+ this.$emit('input', this.selected);
1487
+
1488
+ if (!this.multiple) {
1489
+ this.isActive = !this.closeOnClick;
1490
+
1491
+ if (this.hoverable && this.closeOnClick) {
1492
+ this.isHoverable = false;
1493
+ }
1494
+ }
1495
+ },
1496
+
1497
+ /**
1498
+ * White-listed items to not close when clicked.
1499
+ */
1500
+ isInWhiteList: function isInWhiteList(el) {
1501
+ if (el === this.$refs.dropdownMenu) return true;
1502
+ if (el === this.$refs.trigger) return true; // All chidren from dropdown
1503
+
1504
+ if (this.$refs.dropdownMenu !== undefined) {
1505
+ var children = this.$refs.dropdownMenu.querySelectorAll('*');
1506
+ var _iteratorNormalCompletion = true;
1507
+ var _didIteratorError = false;
1508
+ var _iteratorError = undefined;
1509
+
1510
+ try {
1511
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
1512
+ var child = _step.value;
1513
+
1514
+ if (el === child) {
1515
+ return true;
1516
+ }
1517
+ }
1518
+ } catch (err) {
1519
+ _didIteratorError = true;
1520
+ _iteratorError = err;
1521
+ } finally {
1522
+ try {
1523
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
1524
+ _iterator.return();
1525
+ }
1526
+ } finally {
1527
+ if (_didIteratorError) {
1528
+ throw _iteratorError;
1529
+ }
1530
+ }
1531
+ }
1532
+ } // All children from trigger
1533
+
1534
+
1535
+ if (this.$refs.trigger !== undefined) {
1536
+ var _children = this.$refs.trigger.querySelectorAll('*');
1537
+
1538
+ var _iteratorNormalCompletion2 = true;
1539
+ var _didIteratorError2 = false;
1540
+ var _iteratorError2 = undefined;
1541
+
1542
+ try {
1543
+ for (var _iterator2 = _children[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
1544
+ var _child = _step2.value;
1545
+
1546
+ if (el === _child) {
1547
+ return true;
1548
+ }
1549
+ }
1550
+ } catch (err) {
1551
+ _didIteratorError2 = true;
1552
+ _iteratorError2 = err;
1553
+ } finally {
1554
+ try {
1555
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
1556
+ _iterator2.return();
1557
+ }
1558
+ } finally {
1559
+ if (_didIteratorError2) {
1560
+ throw _iteratorError2;
1561
+ }
1562
+ }
1563
+ }
1564
+ }
1565
+
1566
+ return false;
1567
+ },
1568
+
1569
+ /**
1570
+ * Close dropdown if clicked outside.
1571
+ */
1572
+ clickedOutside: function clickedOutside(event) {
1573
+ if (this.cancelOptions.indexOf('outside') < 0) return;
1574
+ if (this.inline) return;
1575
+ var target = isCustomElement(this) ? event.composedPath()[0] : event.target;
1576
+ if (!this.isInWhiteList(target)) this.isActive = false;
1577
+ },
1578
+
1579
+ /**
1580
+ * Keypress event that is bound to the document
1581
+ */
1582
+ keyPress: function keyPress(_ref) {
1583
+ var key = _ref.key;
1584
+
1585
+ if (this.isActive && (key === 'Escape' || key === 'Esc')) {
1586
+ if (this.cancelOptions.indexOf('escape') < 0) return;
1587
+ this.isActive = false;
1588
+ }
1589
+ },
1590
+ onClick: function onClick() {
1591
+ if (this.triggers.indexOf('click') < 0) return;
1592
+ this.toggle();
1593
+ },
1594
+ onContextMenu: function onContextMenu() {
1595
+ if (this.triggers.indexOf('contextmenu') < 0) return;
1596
+ this.toggle();
1597
+ },
1598
+ onHover: function onHover() {
1599
+ if (this.triggers.indexOf('hover') < 0) return;
1600
+ this.isHoverable = true;
1601
+ },
1602
+ onFocus: function onFocus() {
1603
+ if (this.triggers.indexOf('focus') < 0) return;
1604
+ this.toggle();
1605
+ },
1606
+
1607
+ /**
1608
+ * Toggle dropdown if it's not disabled.
1609
+ */
1610
+ toggle: function toggle() {
1611
+ var _this2 = this;
1612
+
1613
+ if (this.disabled) return;
1614
+
1615
+ if (!this.isActive) {
1616
+ // if not active, toggle after clickOutside event
1617
+ // this fixes toggling programmatic
1618
+ this.$nextTick(function () {
1619
+ var value = !_this2.isActive;
1620
+ _this2.isActive = value; // Vue 2.6.x ???
1621
+
1622
+ setTimeout(function () {
1623
+ return _this2.isActive = value;
1624
+ });
1625
+ });
1626
+ } else {
1627
+ this.isActive = !this.isActive;
1628
+ }
1629
+ },
1630
+ updateAppendToBody: function updateAppendToBody() {
1631
+ var dropdown = this.$refs.dropdown;
1632
+ var dropdownMenu = this.$refs.dropdownMenu;
1633
+ var trigger = this.$refs.trigger;
1634
+
1635
+ if (dropdownMenu && trigger) {
1636
+ // update wrapper dropdown
1637
+ var dropdownWrapper = this.$data._bodyEl.children[0];
1638
+ dropdownWrapper.classList.forEach(function (item) {
1639
+ return dropdownWrapper.classList.remove(item);
1640
+ });
1641
+ dropdownWrapper.classList.add('dropdown');
1642
+ dropdownWrapper.classList.add('dropdown-menu-animation');
1643
+
1644
+ if (this.$vnode && this.$vnode.data && this.$vnode.data.staticClass) {
1645
+ dropdownWrapper.classList.add(this.$vnode.data.staticClass);
1646
+ }
1647
+
1648
+ this.rootClasses.forEach(function (item) {
1649
+ // skip position prop
1650
+ if (item && _typeof(item) === 'object') {
1651
+ for (var key in item) {
1652
+ if (item[key]) {
1653
+ dropdownWrapper.classList.add(key);
1654
+ }
1655
+ }
1656
+ }
1657
+ });
1658
+
1659
+ if (this.appendToBodyCopyParent) {
1660
+ var parentNode = this.$refs.dropdown.parentNode;
1661
+ var parent = this.$data._bodyEl;
1662
+ parent.classList.forEach(function (item) {
1663
+ return parent.classList.remove(item);
1664
+ });
1665
+ parentNode.classList.forEach(function (item) {
1666
+ parent.classList.add(item);
1667
+ });
1668
+ }
1669
+
1670
+ var rect = trigger.getBoundingClientRect();
1671
+ var top = rect.top + window.scrollY;
1672
+ var left = rect.left + window.scrollX;
1673
+
1674
+ if (!this.position || this.position.indexOf('bottom') >= 0) {
1675
+ top += trigger.clientHeight;
1676
+ } else {
1677
+ top -= dropdownMenu.clientHeight;
1678
+ }
1679
+
1680
+ if (this.position && this.position.indexOf('left') >= 0) {
1681
+ left -= dropdownMenu.clientWidth - trigger.clientWidth;
1682
+ }
1683
+
1684
+ this.style = {
1685
+ position: 'absolute',
1686
+ top: "".concat(top, "px"),
1687
+ left: "".concat(left, "px"),
1688
+ zIndex: '99',
1689
+ width: this.expanded ? "".concat(dropdown.offsetWidth, "px") : undefined
1690
+ };
1691
+ }
1692
+ }
1693
+ },
1694
+ mounted: function mounted() {
1695
+ if (this.appendToBody) {
1696
+ this.$data._bodyEl = createAbsoluteElement(this.$refs.dropdownMenu);
1697
+ this.updateAppendToBody();
1698
+ }
1699
+ },
1700
+ created: function created() {
1701
+ if (typeof window !== 'undefined') {
1702
+ document.addEventListener('click', this.clickedOutside);
1703
+ document.addEventListener('keyup', this.keyPress);
1704
+ }
1705
+ },
1706
+ beforeDestroy: function beforeDestroy() {
1707
+ if (typeof window !== 'undefined') {
1708
+ document.removeEventListener('click', this.clickedOutside);
1709
+ document.removeEventListener('keyup', this.keyPress);
1710
+ }
1711
+
1712
+ if (this.appendToBody) {
1713
+ removeElement(this.$data._bodyEl);
1714
+ }
1715
+ }
1716
+ };
1717
+
1718
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
1719
+ /* server only */
1720
+ , shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
1721
+ if (typeof shadowMode !== 'boolean') {
1722
+ createInjectorSSR = createInjector;
1723
+ createInjector = shadowMode;
1724
+ shadowMode = false;
1725
+ } // Vue.extend constructor export interop.
1726
+
1727
+
1728
+ var options = typeof script === 'function' ? script.options : script; // render functions
1729
+
1730
+ if (template && template.render) {
1731
+ options.render = template.render;
1732
+ options.staticRenderFns = template.staticRenderFns;
1733
+ options._compiled = true; // functional template
1734
+
1735
+ if (isFunctionalTemplate) {
1736
+ options.functional = true;
1737
+ }
1738
+ } // scopedId
1739
+
1740
+
1741
+ if (scopeId) {
1742
+ options._scopeId = scopeId;
1743
+ }
1744
+
1745
+ var hook;
1746
+
1747
+ if (moduleIdentifier) {
1748
+ // server build
1749
+ hook = function hook(context) {
1750
+ // 2.3 injection
1751
+ context = context || // cached call
1752
+ this.$vnode && this.$vnode.ssrContext || // stateful
1753
+ this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext; // functional
1754
+ // 2.2 with runInNewContext: true
1755
+
1756
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
1757
+ context = __VUE_SSR_CONTEXT__;
1758
+ } // inject component styles
1759
+
1760
+
1761
+ if (style) {
1762
+ style.call(this, createInjectorSSR(context));
1763
+ } // register component module identifier for async chunk inference
1764
+
1765
+
1766
+ if (context && context._registeredComponents) {
1767
+ context._registeredComponents.add(moduleIdentifier);
1768
+ }
1769
+ }; // used by ssr in case component is cached and beforeCreate
1770
+ // never gets called
1771
+
1772
+
1773
+ options._ssrRegister = hook;
1774
+ } else if (style) {
1775
+ hook = shadowMode ? function () {
1776
+ style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
1777
+ } : function (context) {
1778
+ style.call(this, createInjector(context));
1779
+ };
1780
+ }
1781
+
1782
+ if (hook) {
1783
+ if (options.functional) {
1784
+ // register for functional component in vue file
1785
+ var originalRender = options.render;
1786
+
1787
+ options.render = function renderWithStyleInjection(h, context) {
1788
+ hook.call(context);
1789
+ return originalRender(h, context);
1790
+ };
1791
+ } else {
1792
+ // inject component registration as beforeCreate hook
1793
+ var existing = options.beforeCreate;
1794
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
1795
+ }
1796
+ }
1797
+
1798
+ return script;
1799
+ }
1800
+
1801
+ var normalizeComponent_1 = normalizeComponent;
1802
+
1803
+ /* script */
1804
+ const __vue_script__ = script;
1805
+
1806
+ /* template */
1807
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"dropdown",staticClass:"dropdown dropdown-menu-animation",class:_vm.rootClasses},[(!_vm.inline)?_c('div',{ref:"trigger",staticClass:"dropdown-trigger",attrs:{"role":"button","tabindex":_vm.disabled ? false : 0,"aria-haspopup":"true"},on:{"click":_vm.onClick,"contextmenu":function($event){$event.preventDefault();return _vm.onContextMenu($event)},"mouseenter":_vm.onHover,"!focus":function($event){return _vm.onFocus($event)}}},[_vm._t("trigger",null,{"active":_vm.isActive})],2):_vm._e(),_c('transition',{attrs:{"name":_vm.animation}},[(_vm.isMobileModal)?_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive),expression:"isActive"}],staticClass:"background",attrs:{"aria-hidden":!_vm.isActive}}):_vm._e()]),_c('transition',{attrs:{"name":_vm.animation}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:((!_vm.disabled && (_vm.isActive || _vm.isHoverable)) || _vm.inline),expression:"(!disabled && (isActive || isHoverable)) || inline"},{name:"trap-focus",rawName:"v-trap-focus",value:(_vm.trapFocus),expression:"trapFocus"}],ref:"dropdownMenu",staticClass:"dropdown-menu",style:(_vm.style),attrs:{"aria-hidden":!_vm.isActive}},[_c('div',{staticClass:"dropdown-content",style:(_vm.contentStyle),attrs:{"role":_vm.ariaRole}},[_vm._t("default")],2)])])],1)};
1808
+ var __vue_staticRenderFns__ = [];
1809
+
1810
+ /* style */
1811
+ const __vue_inject_styles__ = undefined;
1812
+ /* scoped */
1813
+ const __vue_scope_id__ = undefined;
1814
+ /* module identifier */
1815
+ const __vue_module_identifier__ = undefined;
1816
+ /* functional template */
1817
+ const __vue_is_functional_template__ = false;
1818
+ /* style inject */
1819
+
1820
+ /* style inject SSR */
1821
+
1822
+
1823
+
1824
+ var Dropdown = normalizeComponent_1(
1825
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
1826
+ __vue_inject_styles__,
1827
+ __vue_script__,
1828
+ __vue_scope_id__,
1829
+ __vue_is_functional_template__,
1830
+ __vue_module_identifier__,
1831
+ undefined,
1832
+ undefined
1833
+ );
1834
+
1835
+ var sorted$1 = 1;
1836
+ var optional = 2;
1837
+ var InjectedChildMixin = (function (parentItemName) {
1838
+ var flags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
1839
+ var mixin = {
1840
+ inject: {
1841
+ parent: {
1842
+ from: 'b' + parentItemName,
1843
+ default: false
1844
+ }
1845
+ },
1846
+ created: function created() {
1847
+ if (!this.parent) {
1848
+ if (!hasFlag(flags, optional)) {
1849
+ this.$destroy();
1850
+ throw new Error('You should wrap ' + this.$options.name + ' in a ' + parentItemName);
1851
+ }
1852
+ } else if (this.parent._registerItem) {
1853
+ this.parent._registerItem(this);
1854
+ }
1855
+ },
1856
+ beforeDestroy: function beforeDestroy() {
1857
+ if (this.parent && this.parent._unregisterItem) {
1858
+ this.parent._unregisterItem(this);
1859
+ }
1860
+ }
1861
+ };
1862
+
1863
+ if (hasFlag(flags, sorted$1)) {
1864
+ mixin.data = function () {
1865
+ return {
1866
+ index: null
1867
+ };
1868
+ };
1869
+ }
1870
+
1871
+ return mixin;
1872
+ });
1873
+
1874
+ //
1875
+ var script$1 = {
1876
+ name: 'BDropdownItem',
1877
+ mixins: [InjectedChildMixin('dropdown')],
1878
+ props: {
1879
+ value: {
1880
+ type: [String, Number, Boolean, Object, Array, Function],
1881
+ default: null
1882
+ },
1883
+ separator: Boolean,
1884
+ disabled: Boolean,
1885
+ custom: Boolean,
1886
+ focusable: {
1887
+ type: Boolean,
1888
+ default: true
1889
+ },
1890
+ paddingless: Boolean,
1891
+ hasLink: Boolean,
1892
+ ariaRole: {
1893
+ type: String,
1894
+ default: ''
1895
+ }
1896
+ },
1897
+ computed: {
1898
+ anchorClasses: function anchorClasses() {
1899
+ return {
1900
+ 'is-disabled': this.parent.disabled || this.disabled,
1901
+ 'is-paddingless': this.paddingless,
1902
+ 'is-active': this.isActive
1903
+ };
1904
+ },
1905
+ itemClasses: function itemClasses() {
1906
+ return {
1907
+ 'dropdown-item': !this.hasLink,
1908
+ 'is-disabled': this.disabled,
1909
+ 'is-paddingless': this.paddingless,
1910
+ 'is-active': this.isActive,
1911
+ 'has-link': this.hasLink
1912
+ };
1913
+ },
1914
+ ariaRoleItem: function ariaRoleItem() {
1915
+ return this.ariaRole === 'menuitem' || this.ariaRole === 'listitem' ? this.ariaRole : null;
1916
+ },
1917
+ isClickable: function isClickable() {
1918
+ return !this.parent.disabled && !this.separator && !this.disabled && !this.custom;
1919
+ },
1920
+ isActive: function isActive() {
1921
+ if (this.parent.selected === null) return false;
1922
+ if (this.parent.multiple) return this.parent.selected.indexOf(this.value) >= 0;
1923
+ return this.value === this.parent.selected;
1924
+ },
1925
+ isFocusable: function isFocusable() {
1926
+ return this.hasLink ? false : this.focusable;
1927
+ }
1928
+ },
1929
+ methods: {
1930
+ /**
1931
+ * Click listener, select the item.
1932
+ */
1933
+ selectItem: function selectItem() {
1934
+ if (!this.isClickable) return;
1935
+ this.parent.selectItem(this.value);
1936
+ this.$emit('click');
1937
+ }
1938
+ }
1939
+ };
1940
+
1941
+ /* script */
1942
+ const __vue_script__$1 = script$1;
1943
+
1944
+ /* template */
1945
+ var __vue_render__$1 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.separator)?_c('hr',{staticClass:"dropdown-divider"}):(!_vm.custom && !_vm.hasLink)?_c('a',{staticClass:"dropdown-item",class:_vm.anchorClasses,attrs:{"role":_vm.ariaRoleItem,"tabindex":_vm.isFocusable ? 0 : null},on:{"click":_vm.selectItem}},[_vm._t("default")],2):_c('div',{class:_vm.itemClasses,attrs:{"role":_vm.ariaRoleItem,"tabindex":_vm.isFocusable ? 0 : null},on:{"click":_vm.selectItem}},[_vm._t("default")],2)};
1946
+ var __vue_staticRenderFns__$1 = [];
1947
+
1948
+ /* style */
1949
+ const __vue_inject_styles__$1 = undefined;
1950
+ /* scoped */
1951
+ const __vue_scope_id__$1 = undefined;
1952
+ /* module identifier */
1953
+ const __vue_module_identifier__$1 = undefined;
1954
+ /* functional template */
1955
+ const __vue_is_functional_template__$1 = false;
1956
+ /* style inject */
1957
+
1958
+ /* style inject SSR */
1959
+
1960
+
1961
+
1962
+ var DropdownItem = normalizeComponent_1(
1963
+ { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
1964
+ __vue_inject_styles__$1,
1965
+ __vue_script__$1,
1966
+ __vue_scope_id__$1,
1967
+ __vue_is_functional_template__$1,
1968
+ __vue_module_identifier__$1,
1969
+ undefined,
1970
+ undefined
1971
+ );
1972
+
1973
+ var mdiIcons = {
1974
+ sizes: {
1975
+ 'default': 'mdi-24px',
1976
+ 'is-small': null,
1977
+ 'is-medium': 'mdi-36px',
1978
+ 'is-large': 'mdi-48px'
1979
+ },
1980
+ iconPrefix: 'mdi-'
1981
+ };
1982
+
1983
+ var faIcons = function faIcons() {
1984
+ var faIconPrefix = config && config.defaultIconComponent ? '' : 'fa-';
1985
+ return {
1986
+ sizes: {
1987
+ 'default': null,
1988
+ 'is-small': null,
1989
+ 'is-medium': faIconPrefix + 'lg',
1990
+ 'is-large': faIconPrefix + '2x'
1991
+ },
1992
+ iconPrefix: faIconPrefix,
1993
+ internalIcons: {
1994
+ 'information': 'info-circle',
1995
+ 'alert': 'exclamation-triangle',
1996
+ 'alert-circle': 'exclamation-circle',
1997
+ 'chevron-right': 'angle-right',
1998
+ 'chevron-left': 'angle-left',
1999
+ 'chevron-down': 'angle-down',
2000
+ 'eye-off': 'eye-slash',
2001
+ 'menu-down': 'caret-down',
2002
+ 'menu-up': 'caret-up',
2003
+ 'close-circle': 'times-circle'
2004
+ }
2005
+ };
2006
+ };
2007
+
2008
+ var getIcons = function getIcons() {
2009
+ var icons = {
2010
+ mdi: mdiIcons,
2011
+ fa: faIcons(),
2012
+ fas: faIcons(),
2013
+ far: faIcons(),
2014
+ fad: faIcons(),
2015
+ fab: faIcons(),
2016
+ fal: faIcons(),
2017
+ 'fa-solid': faIcons(),
2018
+ 'fa-regular': faIcons(),
2019
+ 'fa-light': faIcons(),
2020
+ 'fa-thin': faIcons(),
2021
+ 'fa-duotone': faIcons(),
2022
+ 'fa-brands': faIcons()
2023
+ };
2024
+
2025
+ if (config && config.customIconPacks) {
2026
+ icons = merge(icons, config.customIconPacks, true);
2027
+ }
2028
+
2029
+ return icons;
2030
+ };
2031
+
2032
+ var script$2 = {
2033
+ name: 'BIcon',
2034
+ props: {
2035
+ type: [String, Object],
2036
+ component: String,
2037
+ pack: String,
2038
+ icon: String,
2039
+ size: String,
2040
+ customSize: String,
2041
+ customClass: String,
2042
+ both: Boolean // This is used internally to show both MDI and FA icon
2043
+
2044
+ },
2045
+ computed: {
2046
+ iconConfig: function iconConfig() {
2047
+ var allIcons = getIcons();
2048
+ return allIcons[this.newPack];
2049
+ },
2050
+ iconPrefix: function iconPrefix() {
2051
+ if (this.iconConfig && this.iconConfig.iconPrefix) {
2052
+ return this.iconConfig.iconPrefix;
2053
+ }
2054
+
2055
+ return '';
2056
+ },
2057
+
2058
+ /**
2059
+ * Internal icon name based on the pack.
2060
+ * If pack is 'fa', gets the equivalent FA icon name of the MDI,
2061
+ * internal icons are always MDI.
2062
+ */
2063
+ newIcon: function newIcon() {
2064
+ return "".concat(this.iconPrefix).concat(this.getEquivalentIconOf(this.icon));
2065
+ },
2066
+ newPack: function newPack() {
2067
+ return this.pack || config.defaultIconPack;
2068
+ },
2069
+ newType: function newType() {
2070
+ if (!this.type) return;
2071
+ var splitType = [];
2072
+
2073
+ if (typeof this.type === 'string') {
2074
+ splitType = this.type.split('-');
2075
+ } else {
2076
+ for (var key in this.type) {
2077
+ if (this.type[key]) {
2078
+ splitType = key.split('-');
2079
+ break;
2080
+ }
2081
+ }
2082
+ }
2083
+
2084
+ if (splitType.length <= 1) return;
2085
+
2086
+ var _splitType = splitType,
2087
+ _splitType2 = _toArray(_splitType),
2088
+ type = _splitType2.slice(1);
2089
+
2090
+ return "has-text-".concat(type.join('-'));
2091
+ },
2092
+ newCustomSize: function newCustomSize() {
2093
+ return this.customSize || this.customSizeByPack;
2094
+ },
2095
+ customSizeByPack: function customSizeByPack() {
2096
+ if (this.iconConfig && this.iconConfig.sizes) {
2097
+ if (this.size && this.iconConfig.sizes[this.size] !== undefined) {
2098
+ return this.iconConfig.sizes[this.size];
2099
+ } else if (this.iconConfig.sizes.default) {
2100
+ return this.iconConfig.sizes.default;
2101
+ }
2102
+ }
2103
+
2104
+ return null;
2105
+ },
2106
+ useIconComponent: function useIconComponent() {
2107
+ return this.component || config.defaultIconComponent;
2108
+ }
2109
+ },
2110
+ methods: {
2111
+ /**
2112
+ * Equivalent icon name of the MDI.
2113
+ */
2114
+ getEquivalentIconOf: function getEquivalentIconOf(value) {
2115
+ // Only transform the class if the both prop is set to true
2116
+ if (!this.both) {
2117
+ return value;
2118
+ }
2119
+
2120
+ if (this.iconConfig && this.iconConfig.internalIcons && this.iconConfig.internalIcons[value]) {
2121
+ return this.iconConfig.internalIcons[value];
2122
+ }
2123
+
2124
+ return value;
2125
+ }
2126
+ }
2127
+ };
2128
+
2129
+ /* script */
2130
+ const __vue_script__$2 = script$2;
2131
+
2132
+ /* template */
2133
+ var __vue_render__$2 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('span',{staticClass:"icon",class:[_vm.newType, _vm.size]},[(!_vm.useIconComponent)?_c('i',{class:[_vm.newPack, _vm.newIcon, _vm.newCustomSize, _vm.customClass]}):_c(_vm.useIconComponent,{tag:"component",class:[_vm.customClass],attrs:{"icon":[_vm.newPack, _vm.newIcon],"size":_vm.newCustomSize}})],1)};
2134
+ var __vue_staticRenderFns__$2 = [];
2135
+
2136
+ /* style */
2137
+ const __vue_inject_styles__$2 = undefined;
2138
+ /* scoped */
2139
+ const __vue_scope_id__$2 = undefined;
2140
+ /* module identifier */
2141
+ const __vue_module_identifier__$2 = undefined;
2142
+ /* functional template */
2143
+ const __vue_is_functional_template__$2 = false;
2144
+ /* style inject */
2145
+
2146
+ /* style inject SSR */
2147
+
2148
+
2149
+
2150
+ var Icon = normalizeComponent_1(
2151
+ { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
2152
+ __vue_inject_styles__$2,
2153
+ __vue_script__$2,
2154
+ __vue_scope_id__$2,
2155
+ __vue_is_functional_template__$2,
2156
+ __vue_module_identifier__$2,
2157
+ undefined,
2158
+ undefined
2159
+ );
2160
+
2161
+ var script$3 = {
2162
+ name: 'BInput',
2163
+ components: _defineProperty({}, Icon.name, Icon),
2164
+ mixins: [FormElementMixin],
2165
+ inheritAttrs: false,
2166
+ props: {
2167
+ value: [Number, String],
2168
+ type: {
2169
+ type: String,
2170
+ default: 'text'
2171
+ },
2172
+ lazy: {
2173
+ type: Boolean,
2174
+ default: false
2175
+ },
2176
+ passwordReveal: Boolean,
2177
+ iconClickable: Boolean,
2178
+ hasCounter: {
2179
+ type: Boolean,
2180
+ default: function _default() {
2181
+ return config.defaultInputHasCounter;
2182
+ }
2183
+ },
2184
+ customClass: {
2185
+ type: String,
2186
+ default: ''
2187
+ },
2188
+ iconRight: String,
2189
+ iconRightClickable: Boolean,
2190
+ iconRightType: String
2191
+ },
2192
+ data: function data() {
2193
+ return {
2194
+ newValue: this.value,
2195
+ newType: this.type,
2196
+ newAutocomplete: this.autocomplete || config.defaultInputAutocomplete,
2197
+ isPasswordVisible: false,
2198
+ _elementRef: this.type === 'textarea' ? 'textarea' : 'input'
2199
+ };
2200
+ },
2201
+ computed: {
2202
+ computedValue: {
2203
+ get: function get() {
2204
+ return this.newValue;
2205
+ },
2206
+ set: function set(value) {
2207
+ this.newValue = value;
2208
+ this.$emit('input', value);
2209
+ }
2210
+ },
2211
+ rootClasses: function rootClasses() {
2212
+ return [this.iconPosition, this.size, {
2213
+ 'is-expanded': this.expanded,
2214
+ 'is-loading': this.loading,
2215
+ 'is-clearfix': !this.hasMessage
2216
+ }];
2217
+ },
2218
+ inputClasses: function inputClasses() {
2219
+ return [this.statusType, this.size, {
2220
+ 'is-rounded': this.rounded
2221
+ }];
2222
+ },
2223
+ hasIconRight: function hasIconRight() {
2224
+ return this.passwordReveal || this.loading || this.statusIcon && this.statusTypeIcon || this.iconRight;
2225
+ },
2226
+ rightIcon: function rightIcon() {
2227
+ if (this.passwordReveal) {
2228
+ return this.passwordVisibleIcon;
2229
+ } else if (this.iconRight) {
2230
+ return this.iconRight;
2231
+ }
2232
+
2233
+ return this.statusTypeIcon;
2234
+ },
2235
+ rightIconType: function rightIconType() {
2236
+ if (this.passwordReveal) {
2237
+ return 'is-primary';
2238
+ } else if (this.iconRight) {
2239
+ return this.iconRightType || null;
2240
+ }
2241
+
2242
+ return this.statusType;
2243
+ },
2244
+
2245
+ /**
2246
+ * Position of the icon or if it's both sides.
2247
+ */
2248
+ iconPosition: function iconPosition() {
2249
+ var iconClasses = '';
2250
+
2251
+ if (this.icon) {
2252
+ iconClasses += 'has-icons-left ';
2253
+ }
2254
+
2255
+ if (this.hasIconRight) {
2256
+ iconClasses += 'has-icons-right';
2257
+ }
2258
+
2259
+ return iconClasses;
2260
+ },
2261
+
2262
+ /**
2263
+ * Icon name (MDI) based on the type.
2264
+ */
2265
+ statusTypeIcon: function statusTypeIcon() {
2266
+ switch (this.statusType) {
2267
+ case 'is-success':
2268
+ return 'check';
2269
+
2270
+ case 'is-danger':
2271
+ return 'alert-circle';
2272
+
2273
+ case 'is-info':
2274
+ return 'information';
2275
+
2276
+ case 'is-warning':
2277
+ return 'alert';
2278
+ }
2279
+ },
2280
+
2281
+ /**
2282
+ * Check if have any message prop from parent if it's a Field.
2283
+ */
2284
+ hasMessage: function hasMessage() {
2285
+ return !!this.statusMessage;
2286
+ },
2287
+
2288
+ /**
2289
+ * Current password-reveal icon name.
2290
+ */
2291
+ passwordVisibleIcon: function passwordVisibleIcon() {
2292
+ return !this.isPasswordVisible ? 'eye' : 'eye-off';
2293
+ },
2294
+
2295
+ /**
2296
+ * Get value length
2297
+ */
2298
+ valueLength: function valueLength() {
2299
+ if (typeof this.computedValue === 'string') {
2300
+ return this.computedValue.length;
2301
+ } else if (typeof this.computedValue === 'number') {
2302
+ return this.computedValue.toString().length;
2303
+ }
2304
+
2305
+ return 0;
2306
+ }
2307
+ },
2308
+ watch: {
2309
+ /**
2310
+ * When v-model is changed:
2311
+ * 1. Set internal value.
2312
+ */
2313
+ value: function value(_value) {
2314
+ this.newValue = _value;
2315
+ }
2316
+ },
2317
+ methods: {
2318
+ /**
2319
+ * Toggle the visibility of a password-reveal input
2320
+ * by changing the type and focus the input right away.
2321
+ */
2322
+ togglePasswordVisibility: function togglePasswordVisibility() {
2323
+ var _this = this;
2324
+
2325
+ this.isPasswordVisible = !this.isPasswordVisible;
2326
+ this.newType = this.isPasswordVisible ? 'text' : 'password';
2327
+ this.$nextTick(function () {
2328
+ _this.focus();
2329
+ });
2330
+ },
2331
+ iconClick: function iconClick(emit, event) {
2332
+ var _this2 = this;
2333
+
2334
+ this.$emit(emit, event);
2335
+ this.$nextTick(function () {
2336
+ _this2.focus();
2337
+ });
2338
+ },
2339
+ rightIconClick: function rightIconClick(event) {
2340
+ if (this.passwordReveal) {
2341
+ this.togglePasswordVisibility();
2342
+ } else if (this.iconRightClickable) {
2343
+ this.iconClick('icon-right-click', event);
2344
+ }
2345
+ },
2346
+ onInput: function onInput(event) {
2347
+ if (!this.lazy) {
2348
+ var value = event.target.value;
2349
+ this.updateValue(value);
2350
+ }
2351
+ },
2352
+ onChange: function onChange(event) {
2353
+ if (this.lazy) {
2354
+ var value = event.target.value;
2355
+ this.updateValue(value);
2356
+ }
2357
+ },
2358
+ updateValue: function updateValue(value) {
2359
+ this.computedValue = value;
2360
+ !this.isValid && this.checkHtml5Validity();
2361
+ }
2362
+ }
2363
+ };
2364
+
2365
+ /* script */
2366
+ const __vue_script__$3 = script$3;
2367
+
2368
+ /* template */
2369
+ var __vue_render__$3 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"control",class:_vm.rootClasses},[(_vm.type !== 'textarea')?_c('input',_vm._b({ref:"input",staticClass:"input",class:[_vm.inputClasses, _vm.customClass],attrs:{"type":_vm.newType,"autocomplete":_vm.newAutocomplete,"maxlength":_vm.maxlength},domProps:{"value":_vm.computedValue},on:{"input":_vm.onInput,"change":_vm.onChange,"blur":_vm.onBlur,"focus":_vm.onFocus}},'input',_vm.$attrs,false)):_c('textarea',_vm._b({ref:"textarea",staticClass:"textarea",class:[_vm.inputClasses, _vm.customClass],attrs:{"maxlength":_vm.maxlength},domProps:{"value":_vm.computedValue},on:{"input":_vm.onInput,"change":_vm.onChange,"blur":_vm.onBlur,"focus":_vm.onFocus}},'textarea',_vm.$attrs,false)),(_vm.icon)?_c('b-icon',{staticClass:"is-left",class:{'is-clickable': _vm.iconClickable},attrs:{"icon":_vm.icon,"pack":_vm.iconPack,"size":_vm.iconSize},nativeOn:{"click":function($event){return _vm.iconClick('icon-click', $event)}}}):_vm._e(),(!_vm.loading && _vm.hasIconRight)?_c('b-icon',{staticClass:"is-right",class:{ 'is-clickable': _vm.passwordReveal || _vm.iconRightClickable },attrs:{"icon":_vm.rightIcon,"pack":_vm.iconPack,"size":_vm.iconSize,"type":_vm.rightIconType,"both":""},nativeOn:{"click":function($event){return _vm.rightIconClick($event)}}}):_vm._e(),(_vm.maxlength && _vm.hasCounter && _vm.type !== 'number')?_c('small',{staticClass:"help counter",class:{ 'is-invisible': !_vm.isFocused }},[_vm._v(" "+_vm._s(_vm.valueLength)+" / "+_vm._s(_vm.maxlength)+" ")]):_vm._e()],1)};
2370
+ var __vue_staticRenderFns__$3 = [];
2371
+
2372
+ /* style */
2373
+ const __vue_inject_styles__$3 = undefined;
2374
+ /* scoped */
2375
+ const __vue_scope_id__$3 = undefined;
2376
+ /* module identifier */
2377
+ const __vue_module_identifier__$3 = undefined;
2378
+ /* functional template */
2379
+ const __vue_is_functional_template__$3 = false;
2380
+ /* style inject */
2381
+
2382
+ /* style inject SSR */
2383
+
2384
+
2385
+
2386
+ var Input = normalizeComponent_1(
2387
+ { render: __vue_render__$3, staticRenderFns: __vue_staticRenderFns__$3 },
2388
+ __vue_inject_styles__$3,
2389
+ __vue_script__$3,
2390
+ __vue_scope_id__$3,
2391
+ __vue_is_functional_template__$3,
2392
+ __vue_module_identifier__$3,
2393
+ undefined,
2394
+ undefined
2395
+ );
2396
+
2397
+ var script$4 = {
2398
+ name: 'BFieldBody',
2399
+ props: {
2400
+ message: {
2401
+ type: [String, Array]
2402
+ },
2403
+ type: {
2404
+ type: [String, Object]
2405
+ }
2406
+ },
2407
+ render: function render(createElement) {
2408
+ var _this = this;
2409
+
2410
+ var first = true;
2411
+ return createElement('div', {
2412
+ attrs: {
2413
+ 'class': 'field-body'
2414
+ }
2415
+ }, this.$slots.default.map(function (element) {
2416
+ // skip returns and comments
2417
+ if (!element.tag) {
2418
+ return element;
2419
+ }
2420
+
2421
+ var message;
2422
+
2423
+ if (first) {
2424
+ message = _this.message;
2425
+ first = false;
2426
+ }
2427
+
2428
+ return createElement('b-field', {
2429
+ attrs: {
2430
+ type: _this.type,
2431
+ message: message
2432
+ }
2433
+ }, [element]);
2434
+ }));
2435
+ }
2436
+ };
2437
+
2438
+ /* script */
2439
+ const __vue_script__$4 = script$4;
2440
+
2441
+ /* template */
2442
+
2443
+ /* style */
2444
+ const __vue_inject_styles__$4 = undefined;
2445
+ /* scoped */
2446
+ const __vue_scope_id__$4 = undefined;
2447
+ /* module identifier */
2448
+ const __vue_module_identifier__$4 = undefined;
2449
+ /* functional template */
2450
+ const __vue_is_functional_template__$4 = undefined;
2451
+ /* style inject */
2452
+
2453
+ /* style inject SSR */
2454
+
2455
+
2456
+
2457
+ var FieldBody = normalizeComponent_1(
2458
+ {},
2459
+ __vue_inject_styles__$4,
2460
+ __vue_script__$4,
2461
+ __vue_scope_id__$4,
2462
+ __vue_is_functional_template__$4,
2463
+ __vue_module_identifier__$4,
2464
+ undefined,
2465
+ undefined
2466
+ );
2467
+
2468
+ var script$5 = {
2469
+ name: 'BField',
2470
+ components: _defineProperty({}, FieldBody.name, FieldBody),
2471
+ provide: function provide() {
2472
+ return {
2473
+ 'BField': this
2474
+ };
2475
+ },
2476
+ inject: {
2477
+ parent: {
2478
+ from: 'BField',
2479
+ default: false
2480
+ }
2481
+ },
2482
+ // Used internally only when using Field in Field
2483
+ props: {
2484
+ type: [String, Object],
2485
+ label: String,
2486
+ labelFor: String,
2487
+ message: [String, Array, Object],
2488
+ grouped: Boolean,
2489
+ groupMultiline: Boolean,
2490
+ position: String,
2491
+ expanded: Boolean,
2492
+ horizontal: Boolean,
2493
+ addons: {
2494
+ type: Boolean,
2495
+ default: true
2496
+ },
2497
+ customClass: String,
2498
+ labelPosition: {
2499
+ type: String,
2500
+ default: function _default() {
2501
+ return config.defaultFieldLabelPosition;
2502
+ }
2503
+ }
2504
+ },
2505
+ data: function data() {
2506
+ return {
2507
+ newType: this.type,
2508
+ newMessage: this.message,
2509
+ fieldLabelSize: null,
2510
+ _isField: true // Used internally by Input and Select
2511
+
2512
+ };
2513
+ },
2514
+ computed: {
2515
+ rootClasses: function rootClasses() {
2516
+ return [{
2517
+ 'is-expanded': this.expanded,
2518
+ 'is-horizontal': this.horizontal,
2519
+ 'is-floating-in-label': this.hasLabel && !this.horizontal && this.labelPosition === 'inside',
2520
+ 'is-floating-label': this.hasLabel && !this.horizontal && this.labelPosition === 'on-border'
2521
+ }, this.numberInputClasses];
2522
+ },
2523
+ innerFieldClasses: function innerFieldClasses() {
2524
+ return [this.fieldType(), this.newPosition, {
2525
+ 'is-grouped-multiline': this.groupMultiline
2526
+ }];
2527
+ },
2528
+ hasInnerField: function hasInnerField() {
2529
+ return this.grouped || this.groupMultiline || this.hasAddons();
2530
+ },
2531
+
2532
+ /**
2533
+ * Correct Bulma class for the side of the addon or group.
2534
+ *
2535
+ * This is not kept like the others (is-small, etc.),
2536
+ * because since 'has-addons' is set automatically it
2537
+ * doesn't make sense to teach users what addons are exactly.
2538
+ */
2539
+ newPosition: function newPosition() {
2540
+ if (this.position === undefined) return;
2541
+ var position = this.position.split('-');
2542
+ if (position.length < 1) return;
2543
+ var prefix = this.grouped ? 'is-grouped-' : 'has-addons-';
2544
+ if (this.position) return prefix + position[1];
2545
+ },
2546
+
2547
+ /**
2548
+ * Formatted message in case it's an array
2549
+ * (each element is separated by <br> tag)
2550
+ */
2551
+ formattedMessage: function formattedMessage() {
2552
+ if (this.parent && this.parent.hasInnerField) {
2553
+ return ''; // Message will be displayed in parent field
2554
+ }
2555
+
2556
+ if (typeof this.newMessage === 'string') {
2557
+ return [this.newMessage];
2558
+ }
2559
+
2560
+ var messages = [];
2561
+
2562
+ if (Array.isArray(this.newMessage)) {
2563
+ this.newMessage.forEach(function (message) {
2564
+ if (typeof message === 'string') {
2565
+ messages.push(message);
2566
+ } else {
2567
+ for (var key in message) {
2568
+ if (message[key]) {
2569
+ messages.push(key);
2570
+ }
2571
+ }
2572
+ }
2573
+ });
2574
+ } else {
2575
+ for (var key in this.newMessage) {
2576
+ if (this.newMessage[key]) {
2577
+ messages.push(key);
2578
+ }
2579
+ }
2580
+ }
2581
+
2582
+ return messages.filter(function (m) {
2583
+ if (m) return m;
2584
+ });
2585
+ },
2586
+ hasLabel: function hasLabel() {
2587
+ return this.label || this.$slots.label;
2588
+ },
2589
+ hasMessage: function hasMessage() {
2590
+ return (!this.parent || !this.parent.hasInnerField) && this.newMessage || this.$slots.message;
2591
+ },
2592
+ numberInputClasses: function numberInputClasses() {
2593
+ if (this.$slots.default) {
2594
+ var numberinput = this.$slots.default.filter(function (node) {
2595
+ return node.tag && node.tag.toLowerCase().indexOf('numberinput') >= 0;
2596
+ })[0];
2597
+
2598
+ if (numberinput) {
2599
+ var classes = ['has-numberinput'];
2600
+ var controlsPosition = numberinput.componentOptions.propsData.controlsPosition;
2601
+ var size = numberinput.componentOptions.propsData.size;
2602
+
2603
+ if (controlsPosition) {
2604
+ classes.push("has-numberinput-".concat(controlsPosition));
2605
+ }
2606
+
2607
+ if (size) {
2608
+ classes.push("has-numberinput-".concat(size));
2609
+ }
2610
+
2611
+ return classes;
2612
+ }
2613
+ }
2614
+
2615
+ return null;
2616
+ }
2617
+ },
2618
+ watch: {
2619
+ /**
2620
+ * Set internal type when prop change.
2621
+ */
2622
+ type: function type(value) {
2623
+ this.newType = value;
2624
+ },
2625
+
2626
+ /**
2627
+ * Set internal message when prop change.
2628
+ */
2629
+ message: function message(value) {
2630
+ this.newMessage = value;
2631
+ },
2632
+
2633
+ /**
2634
+ * Set parent message if we use Field in Field.
2635
+ */
2636
+ newMessage: function newMessage(value) {
2637
+ if (this.parent && this.parent.hasInnerField) {
2638
+ if (!this.parent.type) {
2639
+ this.parent.newType = this.newType;
2640
+ }
2641
+
2642
+ if (!this.parent.message) {
2643
+ this.parent.newMessage = value;
2644
+ }
2645
+ }
2646
+ }
2647
+ },
2648
+ methods: {
2649
+ /**
2650
+ * Field has addons if there are more than one slot
2651
+ * (element / component) in the Field.
2652
+ * Or is grouped when prop is set.
2653
+ * Is a method to be called when component re-render.
2654
+ */
2655
+ fieldType: function fieldType() {
2656
+ if (this.grouped) return 'is-grouped';
2657
+ if (this.hasAddons()) return 'has-addons';
2658
+ },
2659
+ hasAddons: function hasAddons() {
2660
+ var renderedNode = 0;
2661
+
2662
+ if (this.$slots.default) {
2663
+ renderedNode = this.$slots.default.reduce(function (i, node) {
2664
+ return node.tag ? i + 1 : i;
2665
+ }, 0);
2666
+ }
2667
+
2668
+ return renderedNode > 1 && this.addons && !this.horizontal;
2669
+ }
2670
+ },
2671
+ mounted: function mounted() {
2672
+ if (this.horizontal) {
2673
+ // Bulma docs: .is-normal for any .input or .button
2674
+ var elements = this.$el.querySelectorAll('.input, .select, .button, .textarea, .b-slider');
2675
+
2676
+ if (elements.length > 0) {
2677
+ this.fieldLabelSize = 'is-normal';
2678
+ }
2679
+ }
2680
+ }
2681
+ };
2682
+
2683
+ /* script */
2684
+ const __vue_script__$5 = script$5;
2685
+
2686
+ /* template */
2687
+ var __vue_render__$4 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"field",class:_vm.rootClasses},[(_vm.horizontal)?_c('div',{staticClass:"field-label",class:[_vm.customClass, _vm.fieldLabelSize]},[(_vm.hasLabel)?_c('label',{staticClass:"label",class:_vm.customClass,attrs:{"for":_vm.labelFor}},[(_vm.$slots.label)?_vm._t("label"):[_vm._v(_vm._s(_vm.label))]],2):_vm._e()]):[(_vm.hasLabel)?_c('label',{staticClass:"label",class:_vm.customClass,attrs:{"for":_vm.labelFor}},[(_vm.$slots.label)?_vm._t("label"):[_vm._v(_vm._s(_vm.label))]],2):_vm._e()],(_vm.horizontal)?_c('b-field-body',{attrs:{"message":_vm.newMessage ? _vm.formattedMessage : '',"type":_vm.newType}},[_vm._t("default")],2):(_vm.hasInnerField)?_c('div',{staticClass:"field-body"},[_c('b-field',{class:_vm.innerFieldClasses,attrs:{"addons":false}},[_vm._t("default")],2)],1):[_vm._t("default")],(_vm.hasMessage && !_vm.horizontal)?_c('p',{staticClass:"help",class:_vm.newType},[(_vm.$slots.message)?_vm._t("message"):[_vm._l((_vm.formattedMessage),function(mess,i){return [_vm._v(" "+_vm._s(mess)+" "),((i + 1) < _vm.formattedMessage.length)?_c('br',{key:i}):_vm._e()]})]],2):_vm._e()],2)};
2688
+ var __vue_staticRenderFns__$4 = [];
2689
+
2690
+ /* style */
2691
+ const __vue_inject_styles__$5 = undefined;
2692
+ /* scoped */
2693
+ const __vue_scope_id__$5 = undefined;
2694
+ /* module identifier */
2695
+ const __vue_module_identifier__$5 = undefined;
2696
+ /* functional template */
2697
+ const __vue_is_functional_template__$5 = false;
2698
+ /* style inject */
2699
+
2700
+ /* style inject SSR */
2701
+
2702
+
2703
+
2704
+ var Field = normalizeComponent_1(
2705
+ { render: __vue_render__$4, staticRenderFns: __vue_staticRenderFns__$4 },
2706
+ __vue_inject_styles__$5,
2707
+ __vue_script__$5,
2708
+ __vue_scope_id__$5,
2709
+ __vue_is_functional_template__$5,
2710
+ __vue_module_identifier__$5,
2711
+ undefined,
2712
+ undefined
2713
+ );
2714
+
2715
+ var script$6 = {
2716
+ name: 'BSelect',
2717
+ components: _defineProperty({}, Icon.name, Icon),
2718
+ mixins: [FormElementMixin],
2719
+ inheritAttrs: false,
2720
+ props: {
2721
+ value: {
2722
+ type: [String, Number, Boolean, Object, Array, Function, Date],
2723
+ default: null
2724
+ },
2725
+ placeholder: String,
2726
+ multiple: Boolean,
2727
+ nativeSize: [String, Number]
2728
+ },
2729
+ data: function data() {
2730
+ return {
2731
+ selected: this.value,
2732
+ _elementRef: 'select'
2733
+ };
2734
+ },
2735
+ computed: {
2736
+ computedValue: {
2737
+ get: function get() {
2738
+ return this.selected;
2739
+ },
2740
+ set: function set(value) {
2741
+ this.selected = value;
2742
+ this.$emit('input', value);
2743
+ !this.isValid && this.checkHtml5Validity();
2744
+ }
2745
+ },
2746
+ spanClasses: function spanClasses() {
2747
+ return [this.size, this.statusType, {
2748
+ 'is-fullwidth': this.expanded,
2749
+ 'is-loading': this.loading,
2750
+ 'is-multiple': this.multiple,
2751
+ 'is-rounded': this.rounded,
2752
+ 'is-empty': this.selected === null
2753
+ }];
2754
+ }
2755
+ },
2756
+ watch: {
2757
+ /**
2758
+ * When v-model is changed:
2759
+ * 1. Set the selected option.
2760
+ * 2. If it's invalid, validate again.
2761
+ */
2762
+ value: function value(_value) {
2763
+ this.selected = _value;
2764
+ !this.isValid && this.checkHtml5Validity();
2765
+ }
2766
+ }
2767
+ };
2768
+
2769
+ /* script */
2770
+ const __vue_script__$6 = script$6;
2771
+
2772
+ /* template */
2773
+ var __vue_render__$5 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"control",class:{ 'is-expanded': _vm.expanded, 'has-icons-left': _vm.icon }},[_c('span',{staticClass:"select",class:_vm.spanClasses},[_c('select',_vm._b({directives:[{name:"model",rawName:"v-model",value:(_vm.computedValue),expression:"computedValue"}],ref:"select",attrs:{"multiple":_vm.multiple,"size":_vm.nativeSize},on:{"blur":function($event){_vm.$emit('blur', $event) && _vm.checkHtml5Validity();},"focus":function($event){return _vm.$emit('focus', $event)},"change":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = "_value" in o ? o._value : o.value;return val}); _vm.computedValue=$event.target.multiple ? $$selectedVal : $$selectedVal[0];}}},'select',_vm.$attrs,false),[(_vm.placeholder)?[(_vm.computedValue == null)?_c('option',{attrs:{"disabled":"","hidden":""},domProps:{"value":null}},[_vm._v(" "+_vm._s(_vm.placeholder)+" ")]):_vm._e()]:_vm._e(),_vm._t("default")],2)]),(_vm.icon)?_c('b-icon',{staticClass:"is-left",attrs:{"icon":_vm.icon,"pack":_vm.iconPack,"size":_vm.iconSize}}):_vm._e()],1)};
2774
+ var __vue_staticRenderFns__$5 = [];
2775
+
2776
+ /* style */
2777
+ const __vue_inject_styles__$6 = undefined;
2778
+ /* scoped */
2779
+ const __vue_scope_id__$6 = undefined;
2780
+ /* module identifier */
2781
+ const __vue_module_identifier__$6 = undefined;
2782
+ /* functional template */
2783
+ const __vue_is_functional_template__$6 = false;
2784
+ /* style inject */
2785
+
2786
+ /* style inject SSR */
2787
+
2788
+
2789
+
2790
+ var Select = normalizeComponent_1(
2791
+ { render: __vue_render__$5, staticRenderFns: __vue_staticRenderFns__$5 },
2792
+ __vue_inject_styles__$6,
2793
+ __vue_script__$6,
2794
+ __vue_scope_id__$6,
2795
+ __vue_is_functional_template__$6,
2796
+ __vue_module_identifier__$6,
2797
+ undefined,
2798
+ undefined
2799
+ );
2800
+
2801
+ //
2802
+ var cos30 = 0.86602540378;
2803
+ var sin30 = 0.5;
2804
+ var id = 0;
2805
+ var script$7 = {
2806
+ name: 'BColorpickerHSLRepresentationTriangle',
2807
+ props: {
2808
+ value: {
2809
+ type: Object,
2810
+ required: true,
2811
+ validator: function validator(value) {
2812
+ return typeof value.hue === 'number' && typeof value.saturation === 'number' && typeof value.lightness === 'number';
2813
+ }
2814
+ },
2815
+ size: {
2816
+ type: Number,
2817
+ default: 200
2818
+ },
2819
+ thickness: {
2820
+ type: Number,
2821
+ default: 20
2822
+ }
2823
+ },
2824
+ data: function data() {
2825
+ return {
2826
+ id: id++,
2827
+ hue: this.value.hue,
2828
+ saturation: this.value.saturation,
2829
+ lightness: this.value.lightness,
2830
+ captureMouse: false,
2831
+ captureType: 'hue',
2832
+ clientOffset: {
2833
+ cx: -1,
2834
+ cy: -1,
2835
+ width: 0,
2836
+ height: 0
2837
+ },
2838
+ cos30: cos30,
2839
+ sin30: sin30,
2840
+ debounce: 0
2841
+ };
2842
+ },
2843
+ computed: {
2844
+ viewBox: function viewBox() {
2845
+ var size = this.size;
2846
+ return "0 0 ".concat(size, " ").concat(size);
2847
+ },
2848
+ internalRadius: function internalRadius() {
2849
+ return this.size / 2 - this.thickness;
2850
+ },
2851
+ haloPath: function haloPath() {
2852
+ var size = this.size,
2853
+ thickness = this.thickness;
2854
+ var radius = size / 2 - 2; // 2px padding
2855
+
2856
+ var thicknessRadius = radius - thickness;
2857
+ var center = size / 2;
2858
+ return "M".concat(center - radius, " ").concat(center, "a").concat(radius, " ").concat(radius, " 0 1 1 ").concat(2 * radius, " 0") + "h".concat(-thickness) + "a".concat(-thicknessRadius, " ").concat(thicknessRadius, " 0 1 0 ").concat(-2 * thicknessRadius, " 0") + "a".concat(thicknessRadius, " ").concat(thicknessRadius, " 0 1 0 ").concat(2 * thicknessRadius, " 0") + "h".concat(thickness) + "a".concat(radius, " ").concat(radius, " 0 1 1 ").concat(-2 * radius, " 0z");
2859
+ },
2860
+ trianglePath: function trianglePath() {
2861
+ var size = this.size,
2862
+ thickness = this.thickness;
2863
+ var radius = size - 4;
2864
+ var thicknessRadius = (radius - 2 * thickness) / 2;
2865
+ return "M0 ".concat(-thicknessRadius) + "L".concat(cos30 * thicknessRadius, " ").concat(sin30 * thicknessRadius) + "H".concat(-cos30 * thicknessRadius, "z");
2866
+ }
2867
+ },
2868
+ watch: {
2869
+ captureMouse: function captureMouse(newValue, oldValue) {
2870
+ if (oldValue === false && newValue !== false) {
2871
+ var rect = this.$el.getBoundingClientRect(); // Caching offset
2872
+
2873
+ this.clientOffset.cx = rect.x + rect.width / 2;
2874
+ this.clientOffset.cy = rect.y + rect.height / 2;
2875
+ this.clientOffset.width = rect.width;
2876
+ this.clientOffset.height = rect.height;
2877
+ }
2878
+ },
2879
+ value: {
2880
+ deep: true,
2881
+ handler: function handler(newColor) {
2882
+ var _this = this;
2883
+
2884
+ var hue = newColor.hue,
2885
+ saturation = newColor.saturation,
2886
+ lightness = newColor.lightness;
2887
+ window.clearTimeout(this.debounce);
2888
+ this.debounce = window.setTimeout(function () {
2889
+ _this.hue = hue;
2890
+ _this.saturation = saturation;
2891
+ _this.lightness = lightness;
2892
+ }, 200);
2893
+ }
2894
+ }
2895
+ },
2896
+ methods: {
2897
+ increaseHue: function increaseHue() {
2898
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2899
+ this.hue = (this.hue + value) % 360;
2900
+ },
2901
+ decreaseHue: function decreaseHue() {
2902
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
2903
+ this.hue = (360 + this.hue - value) % 360;
2904
+ },
2905
+ increaseSaturation: function increaseSaturation() {
2906
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
2907
+ this.saturation = Math.min(1, Math.max(0, this.saturation + value));
2908
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness));
2909
+ },
2910
+ decreaseSaturation: function decreaseSaturation() {
2911
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
2912
+ this.saturation = Math.min(1, Math.max(0, this.saturation - value));
2913
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness));
2914
+ },
2915
+ increaseLightness: function increaseLightness() {
2916
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
2917
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness + value));
2918
+ },
2919
+ decreaseLightness: function decreaseLightness() {
2920
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
2921
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness - value));
2922
+ },
2923
+ hueKeyPress: function hueKeyPress(event) {
2924
+ var handled = false;
2925
+
2926
+ switch (event.key) {
2927
+ case 'ArrowRight':
2928
+ case 'ArrowUp':
2929
+ this.increaseHue();
2930
+ handled = true;
2931
+ break;
2932
+
2933
+ case 'ArrowLeft':
2934
+ case 'ArrowDown':
2935
+ this.decreaseHue();
2936
+ handled = true;
2937
+ break;
2938
+
2939
+ case 'Home':
2940
+ this.increaseHue(360 - this.hue);
2941
+ handled = true;
2942
+ break;
2943
+
2944
+ case 'End':
2945
+ this.decreaseHue(this.hue);
2946
+ handled = true;
2947
+ break;
2948
+
2949
+ case 'PageUp':
2950
+ this.increaseHue(60 - this.hue % 60);
2951
+ handled = true;
2952
+ break;
2953
+
2954
+ case 'PageDown':
2955
+ this.decreaseHue(60 + this.hue % 60);
2956
+ handled = true;
2957
+ break;
2958
+ }
2959
+
2960
+ if (handled) {
2961
+ event.preventDefault();
2962
+ event.stopPropagation();
2963
+ this.emitColor();
2964
+ }
2965
+ },
2966
+ slKeyPress: function slKeyPress(event) {
2967
+ var handled = false;
2968
+
2969
+ switch (event.key) {
2970
+ case 'ArrowRight':
2971
+ this.decreaseLightness();
2972
+ handled = true;
2973
+ break;
2974
+
2975
+ case 'ArrowUp':
2976
+ this.increaseSaturation();
2977
+ handled = true;
2978
+ break;
2979
+
2980
+ case 'ArrowLeft':
2981
+ this.increaseLightness();
2982
+ handled = true;
2983
+ break;
2984
+
2985
+ case 'ArrowDown':
2986
+ this.decreaseSaturation();
2987
+ handled = true;
2988
+ break;
2989
+
2990
+ case 'Home':
2991
+ this.increaseLightness(1 - this.lightness);
2992
+ handled = true;
2993
+ break;
2994
+
2995
+ case 'End':
2996
+ this.decreaseLightness(this.lightness);
2997
+ handled = true;
2998
+ break;
2999
+
3000
+ case 'PageUp':
3001
+ this.increaseSaturation(1 - this.saturation);
3002
+ handled = true;
3003
+ break;
3004
+
3005
+ case 'PageDown':
3006
+ this.decreaseSaturation(this.saturation);
3007
+ handled = true;
3008
+ break;
3009
+ }
3010
+
3011
+ if (handled) {
3012
+ event.preventDefault();
3013
+ event.stopPropagation();
3014
+ this.emitColor();
3015
+ }
3016
+ },
3017
+ clickHue: function clickHue(event) {
3018
+ this.startMouseCapture(event);
3019
+ this.trackMouse(event);
3020
+ this.stopMouseCapture(event);
3021
+ this.$refs.hueCursor.focus();
3022
+ },
3023
+ clickSL: function clickSL(event) {
3024
+ this.startMouseCapture(event);
3025
+ this.trackMouse(event);
3026
+ this.stopMouseCapture(event);
3027
+ this.$refs.slCursor.focus();
3028
+ },
3029
+ trackMouse: function trackMouse(event) {
3030
+ if (this.captureMouse === false) {
3031
+ return;
3032
+ }
3033
+
3034
+ event.preventDefault();
3035
+ event.stopPropagation();
3036
+ var mouseX = 0,
3037
+ mouseY = 0;
3038
+
3039
+ if (typeof event.touches !== 'undefined' && event.touches.length) {
3040
+ var _ref = [event.touches[0].clientX, event.touches[0].clientY];
3041
+ mouseX = _ref[0];
3042
+ mouseY = _ref[1];
3043
+ } else {
3044
+ var _ref2 = [event.clientX, event.clientY];
3045
+ mouseX = _ref2[0];
3046
+ mouseY = _ref2[1];
3047
+ }
3048
+
3049
+ var angle = Math.atan2(mouseY - this.clientOffset.cy, mouseX - this.clientOffset.cx);
3050
+
3051
+ if (this.captureType === 'sl') {
3052
+ var d = Math.sqrt(Math.pow(mouseX - this.clientOffset.cx, 2) + Math.pow(mouseY - this.clientOffset.cy, 2));
3053
+ var ratio = this.size / this.clientOffset.width;
3054
+ var dx = d * Math.cos(angle - this.hue / 180 * Math.PI) * ratio;
3055
+ var dy = d * Math.sin(angle - this.hue / 180 * Math.PI) * ratio;
3056
+ var radius = this.internalRadius;
3057
+ var saturation = 1 - (Math.min(radius * sin30, Math.max(-radius, dy)) + radius) / (radius + radius * sin30);
3058
+ var lightness = (Math.min(radius * cos30 * (1 - saturation), Math.max(-radius * cos30 * (1 - saturation), dx)) + radius * cos30) / (radius * 2 * cos30);
3059
+ this.saturation = Math.round(saturation * 1000) / 1000;
3060
+ this.lightness = 1 - Math.round(lightness * 1000) / 1000;
3061
+ } else {
3062
+ this.hue = Math.round(angle / Math.PI * 180 + 90) % 360;
3063
+ }
3064
+
3065
+ this.emitColor();
3066
+ },
3067
+ startMouseCapture: function startMouseCapture(event) {
3068
+ event.stopPropagation();
3069
+ this.captureMouse = true;
3070
+
3071
+ if (event.target.closest('.colorpicker-triangle-slider-sl') !== null) {
3072
+ this.captureType = 'sl';
3073
+ } else {
3074
+ this.captureType = 'hue';
3075
+ }
3076
+ },
3077
+ stopMouseCapture: function stopMouseCapture(event) {
3078
+ if (this.captureMouse !== false) {
3079
+ event.preventDefault();
3080
+ event.stopPropagation();
3081
+ this.$refs[this.captureType === 'sl' ? 'slCursor' : 'hueCursor'].focus();
3082
+ }
3083
+
3084
+ this.captureMouse = false;
3085
+ },
3086
+ emitColor: function emitColor() {
3087
+ var hue = this.hue,
3088
+ saturation = this.saturation,
3089
+ lightness = this.lightness;
3090
+ this.$emit('input', Color.fromHSL(hue, saturation, lightness));
3091
+ window.clearTimeout(this.debounce);
3092
+ }
3093
+ },
3094
+ mounted: function mounted() {
3095
+ window.addEventListener('mousemove', this.trackMouse);
3096
+ window.addEventListener('touchmove', this.trackMouse, {
3097
+ passive: false
3098
+ });
3099
+ window.addEventListener('mouseup', this.stopMouseCapture);
3100
+ window.addEventListener('touchend', this.stopMouseCapture);
3101
+ },
3102
+ beforeDestroy: function beforeDestroy() {
3103
+ window.removeEventListener('mousemove', this.trackMouse);
3104
+ window.removeEventListener('touchmove', this.trackMouse);
3105
+ window.removeEventListener('mouseup', this.stopMouseCapture);
3106
+ window.removeEventListener('touchend', this.stopMouseCapture);
3107
+ }
3108
+ };
3109
+
3110
+ /* script */
3111
+ const __vue_script__$7 = script$7;
3112
+
3113
+ /* template */
3114
+ var __vue_render__$6 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('svg',{staticClass:"b-colorpicker-triangle",attrs:{"viewBox":_vm.viewBox}},[_c('defs',[_c('linearGradient',{attrs:{"id":("cp-triangle-gradient-ligthness-" + _vm.id),"x1":"0","y1":"0","x2":"1","y2":"0"}},[_c('stop',{attrs:{"offset":"0%","stop-color":"#fff"}}),_c('stop',{attrs:{"offset":"100%","stop-color":"#000"}})],1),_c('linearGradient',{attrs:{"id":("cp-triangle-gradient-saturation-" + _vm.id),"x1":"0","y1":"0","x2":"0","y2":"1"}},[_c('stop',{attrs:{"offset":"0%","stop-color":("hsl(" + _vm.hue + "deg, 100%, 50%)"),"stop-opacity":"1"}}),_c('stop',{attrs:{"offset":"100%","stop-color":("hsl(" + _vm.hue + "deg, 100%, 50%)"),"stop-opacity":"0"}})],1),_c('clipPath',{attrs:{"id":("cp-triangle-clip-" + _vm.id)}},[_c('path',{attrs:{"d":_vm.haloPath}})])],1),_c('g',{staticClass:"colorpicker-triangle-slider-hue"},[_c('foreignObject',{attrs:{"x":0,"y":0,"width":_vm.size,"height":_vm.size,"clip-path":("url(#cp-triangle-clip-" + _vm.id + ")")}},[_c('div',{staticClass:"colorpicker-triangle-hue",on:{"click":_vm.clickHue,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}})]),_c('g',{style:(("transform: rotate(" + _vm.hue + "deg)"))},[_c('foreignObject',{attrs:{"x":_vm.size / 2 - 4,"y":0,"width":"8","height":_vm.thickness + 4}},[_c('div',{ref:"hueCursor",staticClass:"hue-range-thumb",style:(("background-color: hsl(" + _vm.hue + "deg, 100%, 50%)")),attrs:{"role":"slider","tabindex":"0","aria-label":"Hue","aria-valuemin":"0","aria-valuenow":_vm.hue,"aria-valuemax":"360"},on:{"click":_vm.clickHue,"keydown":_vm.hueKeyPress,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}})])],1)],1),_c('g',{staticClass:"colorpicker-triangle-slider-sl",style:(("transform: rotate(" + _vm.hue + "deg) translate(50%, 50%)")),attrs:{"role":"graphics-datagroup","aria-datascales":"lightness, saturation"}},[_c('path',{attrs:{"d":_vm.trianglePath,"fill":("url(#cp-triangle-gradient-ligthness-" + _vm.id + ")")}}),_c('path',{staticStyle:{"mix-blend-mode":"overlay"},attrs:{"d":_vm.trianglePath,"fill":("url(#cp-triangle-gradient-saturation-" + _vm.id + ")")},on:{"click":_vm.clickSL,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}}),_c('foreignObject',{attrs:{"x":((_vm.internalRadius - 3) * _vm.cos30) * (-_vm.lightness + 0.5) * 2 - 6,"y":-_vm.internalRadius + (1 - _vm.saturation) * (_vm.internalRadius - 3) * 1.5 - 3,"width":"12","height":"12"}},[_c('div',{ref:"slCursor",staticClass:"sl-range-thumb",style:({
3115
+ backgroundColor: ("hsl(" + _vm.hue + "deg, " + (_vm.saturation * 100) + "%, " + (_vm.lightness * 100) + "%)")
3116
+ }),attrs:{"tabindex":"0","aria-datavalues":((_vm.saturation * 100) + "%, " + (_vm.lightness * 100) + "%")},on:{"click":_vm.clickSL,"keydown":_vm.slKeyPress,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}})])],1)])};
3117
+ var __vue_staticRenderFns__$6 = [];
3118
+
3119
+ /* style */
3120
+ const __vue_inject_styles__$7 = undefined;
3121
+ /* scoped */
3122
+ const __vue_scope_id__$7 = undefined;
3123
+ /* module identifier */
3124
+ const __vue_module_identifier__$7 = undefined;
3125
+ /* functional template */
3126
+ const __vue_is_functional_template__$7 = false;
3127
+ /* style inject */
3128
+
3129
+ /* style inject SSR */
3130
+
3131
+
3132
+
3133
+ var ColorpickerHSLRepresentationTriangle = normalizeComponent_1(
3134
+ { render: __vue_render__$6, staticRenderFns: __vue_staticRenderFns__$6 },
3135
+ __vue_inject_styles__$7,
3136
+ __vue_script__$7,
3137
+ __vue_scope_id__$7,
3138
+ __vue_is_functional_template__$7,
3139
+ __vue_module_identifier__$7,
3140
+ undefined,
3141
+ undefined
3142
+ );
3143
+
3144
+ function _templateObject3() {
3145
+ var data = _taggedTemplateLiteral(["", "px"]);
3146
+
3147
+ _templateObject3 = function _templateObject3() {
3148
+ return data;
3149
+ };
3150
+
3151
+ return data;
3152
+ }
3153
+
3154
+ function _templateObject2() {
3155
+ var data = _taggedTemplateLiteral(["", "px"]);
3156
+
3157
+ _templateObject2 = function _templateObject2() {
3158
+ return data;
3159
+ };
3160
+
3161
+ return data;
3162
+ }
3163
+
3164
+ function _templateObject() {
3165
+ var data = _taggedTemplateLiteral(["", "px"]);
3166
+
3167
+ _templateObject = function _templateObject() {
3168
+ return data;
3169
+ };
3170
+
3171
+ return data;
3172
+ }
3173
+
3174
+ var precision = function precision(strs) {
3175
+ for (var _len = arguments.length, values = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
3176
+ values[_key - 1] = arguments[_key];
3177
+ }
3178
+
3179
+ var tmp = [];
3180
+ strs.forEach(function (str, i) {
3181
+ tmp.push(str);
3182
+
3183
+ if (values[i]) {
3184
+ tmp.push(Number.isNaN(values[i] / 1) ? values[i] : Math.round(values * 10) / 10);
3185
+ }
3186
+ });
3187
+ return tmp.join('');
3188
+ };
3189
+
3190
+ var script$8 = {
3191
+ name: 'BColorpickerHSLRepresentationSquare',
3192
+ props: {
3193
+ value: {
3194
+ type: Object,
3195
+ required: true,
3196
+ validator: function validator(value) {
3197
+ return typeof value.hue === 'number' && typeof value.saturation === 'number' && typeof value.lightness === 'number';
3198
+ }
3199
+ },
3200
+ size: {
3201
+ type: Number,
3202
+ default: 200
3203
+ },
3204
+ thickness: {
3205
+ type: Number,
3206
+ default: 20
3207
+ }
3208
+ },
3209
+ data: function data() {
3210
+ return {
3211
+ hue: this.value.hue,
3212
+ saturation: this.value.saturation,
3213
+ lightness: this.value.lightness,
3214
+ captureMouse: false,
3215
+ captureType: 'hue',
3216
+ clientOffset: {
3217
+ cx: -1,
3218
+ cy: -1,
3219
+ width: 0,
3220
+ height: 0
3221
+ },
3222
+ debounce: 0
3223
+ };
3224
+ },
3225
+ computed: {
3226
+ hueThumbStyle: function hueThumbStyle() {
3227
+ var hue = this.hue,
3228
+ size = this.size,
3229
+ thickness = this.thickness;
3230
+ var side = size - thickness;
3231
+ var offset = size / 2;
3232
+ var angle = (hue + 720 + 90) % 360 / 180 * Math.PI;
3233
+ var ciq = 1 / Math.cos(Math.PI / 4);
3234
+ var _x$y = {
3235
+ x: -Math.min(1, Math.max(-1, ciq * Math.cos(angle))) / 2 * side + offset,
3236
+ y: -Math.min(1, Math.max(-1, ciq * Math.sin(angle))) / 2 * side + offset
3237
+ },
3238
+ x = _x$y.x,
3239
+ y = _x$y.y;
3240
+ return {
3241
+ background: "hsl(".concat(hue, "deg, 100%, 50%)"),
3242
+ left: precision(_templateObject(), x),
3243
+ top: precision(_templateObject2(), y),
3244
+ width: precision(_templateObject3(), thickness - 2)
3245
+ };
3246
+ },
3247
+ slThumbStyle: function slThumbStyle() {
3248
+ var hue = this.hue,
3249
+ saturation = this.saturation,
3250
+ lightness = this.lightness;
3251
+ saturation = Math.max(0, Math.min(1, saturation));
3252
+ lightness = Math.max(0, Math.min(1, lightness));
3253
+ return {
3254
+ background: "hsl(".concat(hue, "deg, ").concat(saturation * 100, "%, ").concat(lightness * 100, "%)"),
3255
+ left: "".concat(saturation * 100, "%"),
3256
+ top: "".concat((1 - lightness) * 100, "%")
3257
+ };
3258
+ },
3259
+ SLBackground: function SLBackground() {
3260
+ var hue = this.hue;
3261
+ return "linear-gradient(90deg, hsl(".concat(hue, "deg, 0%, 50%), hsl(").concat(hue, "deg, 100%, 50%))");
3262
+ }
3263
+ },
3264
+ watch: {
3265
+ captureMouse: function captureMouse(newValue, oldValue) {
3266
+ if (oldValue === false && newValue !== false) {
3267
+ var rect = this.$el.getBoundingClientRect(); // Caching offset
3268
+
3269
+ this.clientOffset.cx = rect.x + rect.width / 2;
3270
+ this.clientOffset.cy = rect.y + rect.height / 2;
3271
+ this.clientOffset.width = rect.width;
3272
+ this.clientOffset.height = rect.height;
3273
+ }
3274
+ },
3275
+ value: {
3276
+ deep: true,
3277
+ handler: function handler(newColor) {
3278
+ var _this = this;
3279
+
3280
+ var hue = newColor.hue,
3281
+ saturation = newColor.saturation,
3282
+ lightness = newColor.lightness;
3283
+ window.clearTimeout(this.debounce);
3284
+ this.debounce = window.setTimeout(function () {
3285
+ _this.hue = hue;
3286
+ _this.saturation = saturation;
3287
+ _this.lightness = lightness;
3288
+ }, 200);
3289
+ }
3290
+ }
3291
+ },
3292
+ methods: {
3293
+ increaseHue: function increaseHue() {
3294
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
3295
+ this.hue = (this.hue + value) % 360;
3296
+ },
3297
+ decreaseHue: function decreaseHue() {
3298
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
3299
+ this.hue = (360 + this.hue - value) % 360;
3300
+ },
3301
+ increaseSaturation: function increaseSaturation() {
3302
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
3303
+ this.saturation = Math.min(1, Math.max(0, this.saturation + value));
3304
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness));
3305
+ },
3306
+ decreaseSaturation: function decreaseSaturation() {
3307
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
3308
+ this.saturation = Math.min(1, Math.max(0, this.saturation - value));
3309
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness));
3310
+ },
3311
+ increaseLightness: function increaseLightness() {
3312
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
3313
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness + value));
3314
+ },
3315
+ decreaseLightness: function decreaseLightness() {
3316
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
3317
+ this.lightness = Math.min(0.5 + (1 - this.saturation) * 0.5, Math.max(0.5 - (1 - this.saturation) * 0.5, this.lightness - value));
3318
+ },
3319
+ hueKeyPress: function hueKeyPress(event) {
3320
+ var handled = false;
3321
+
3322
+ switch (event.key) {
3323
+ case 'ArrowRight':
3324
+ case 'ArrowUp':
3325
+ this.increaseHue();
3326
+ handled = true;
3327
+ break;
3328
+
3329
+ case 'ArrowLeft':
3330
+ case 'ArrowDown':
3331
+ this.decreaseHue();
3332
+ handled = true;
3333
+ break;
3334
+
3335
+ case 'Home':
3336
+ this.increaseHue(360 - this.hue);
3337
+ handled = true;
3338
+ break;
3339
+
3340
+ case 'End':
3341
+ this.decreaseHue(this.hue);
3342
+ handled = true;
3343
+ break;
3344
+
3345
+ case 'PageUp':
3346
+ this.increaseHue(60 - this.hue % 60);
3347
+ handled = true;
3348
+ break;
3349
+
3350
+ case 'PageDown':
3351
+ this.decreaseHue(60 + this.hue % 60);
3352
+ handled = true;
3353
+ break;
3354
+ }
3355
+
3356
+ if (handled) {
3357
+ event.preventDefault();
3358
+ event.stopPropagation();
3359
+ this.emitColor();
3360
+ }
3361
+ },
3362
+ slKeyPress: function slKeyPress(event) {
3363
+ var handled = false;
3364
+
3365
+ switch (event.key) {
3366
+ case 'ArrowRight':
3367
+ this.increaseSaturation();
3368
+ handled = true;
3369
+ break;
3370
+
3371
+ case 'ArrowUp':
3372
+ this.increaseLightness();
3373
+ handled = true;
3374
+ break;
3375
+
3376
+ case 'ArrowLeft':
3377
+ this.decreaseSaturation();
3378
+ handled = true;
3379
+ break;
3380
+
3381
+ case 'ArrowDown':
3382
+ this.decreaseLightness();
3383
+ handled = true;
3384
+ break;
3385
+
3386
+ case 'Home':
3387
+ this.increaseLightness(1 - this.lightness);
3388
+ handled = true;
3389
+ break;
3390
+
3391
+ case 'End':
3392
+ this.decreaseLightness(this.lightness);
3393
+ handled = true;
3394
+ break;
3395
+
3396
+ case 'PageUp':
3397
+ this.increaseSaturation(1 - this.saturation);
3398
+ handled = true;
3399
+ break;
3400
+
3401
+ case 'PageDown':
3402
+ this.decreaseSaturation(this.saturation);
3403
+ handled = true;
3404
+ break;
3405
+ }
3406
+
3407
+ if (handled) {
3408
+ event.preventDefault();
3409
+ event.stopPropagation();
3410
+ this.emitColor();
3411
+ }
3412
+ },
3413
+ startMouseCapture: function startMouseCapture(event) {
3414
+ event.stopPropagation();
3415
+ this.captureMouse = true;
3416
+
3417
+ if (event.target.closest('.colorpicker-square-slider-sl') !== null) {
3418
+ this.captureType = 'sl';
3419
+ } else {
3420
+ this.captureType = 'hue';
3421
+ }
3422
+ },
3423
+ stopMouseCapture: function stopMouseCapture(event) {
3424
+ if (this.captureMouse !== false) {
3425
+ event.preventDefault();
3426
+ event.stopPropagation();
3427
+ this.$refs[this.captureType === 'sl' ? 'slCursor' : 'hueCursor'].focus();
3428
+ }
3429
+
3430
+ this.captureMouse = false;
3431
+ },
3432
+ clickHue: function clickHue(event) {
3433
+ this.startMouseCapture(event);
3434
+ this.trackMouse(event);
3435
+ this.stopMouseCapture(event);
3436
+ this.$refs.hueCursor.focus();
3437
+ },
3438
+ clickSL: function clickSL(event) {
3439
+ this.startMouseCapture(event);
3440
+ this.trackMouse(event);
3441
+ this.stopMouseCapture(event);
3442
+ this.$refs.slCursor.focus();
3443
+ },
3444
+ trackMouse: function trackMouse(event) {
3445
+ if (this.captureMouse === false) {
3446
+ return;
3447
+ }
3448
+
3449
+ event.preventDefault();
3450
+ event.stopPropagation();
3451
+ var mouseX = 0,
3452
+ mouseY = 0;
3453
+
3454
+ if (typeof event.touches !== 'undefined' && event.touches.length) {
3455
+ var _ref = [event.touches[0].clientX, event.touches[0].clientY];
3456
+ mouseX = _ref[0];
3457
+ mouseY = _ref[1];
3458
+ } else {
3459
+ var _ref2 = [event.clientX, event.clientY];
3460
+ mouseX = _ref2[0];
3461
+ mouseY = _ref2[1];
3462
+ }
3463
+
3464
+ var angle = Math.atan2(mouseY - this.clientOffset.cy, mouseX - this.clientOffset.cx);
3465
+
3466
+ if (this.captureType === 'sl') {
3467
+ var saturation = (mouseX - this.clientOffset.cx) / (this.clientOffset.width - this.thickness * 2) + 0.5;
3468
+ var lightness = (mouseY - this.clientOffset.cy) / (this.clientOffset.height - this.thickness * 2) + 0.5;
3469
+ this.saturation = Math.round(Math.min(1, Math.max(0, saturation)) * 1000) / 1000;
3470
+ this.lightness = 1 - Math.round(Math.min(1, Math.max(0, lightness)) * 1000) / 1000;
3471
+ } else {
3472
+ this.hue = Math.round(angle / Math.PI * 180 + 90) % 360;
3473
+ }
3474
+
3475
+ this.emitColor();
3476
+ },
3477
+ emitColor: function emitColor() {
3478
+ var hue = this.hue,
3479
+ saturation = this.saturation,
3480
+ lightness = this.lightness;
3481
+ this.$emit('input', Color.fromHSL(hue, saturation, lightness));
3482
+ window.clearTimeout(this.debounce);
3483
+ }
3484
+ },
3485
+ mounted: function mounted() {
3486
+ window.addEventListener('mousemove', this.trackMouse);
3487
+ window.addEventListener('touchmove', this.trackMouse, {
3488
+ passive: false
3489
+ });
3490
+ window.addEventListener('mouseup', this.stopMouseCapture);
3491
+ window.addEventListener('touchend', this.stopMouseCapture);
3492
+ },
3493
+ beforeDestroy: function beforeDestroy() {
3494
+ window.removeEventListener('mousemove', this.trackMouse);
3495
+ window.removeEventListener('touchmove', this.trackMouse);
3496
+ window.removeEventListener('mouseup', this.stopMouseCapture);
3497
+ window.removeEventListener('touchend', this.stopMouseCapture);
3498
+ }
3499
+ };
3500
+
3501
+ /* script */
3502
+ const __vue_script__$8 = script$8;
3503
+
3504
+ /* template */
3505
+ var __vue_render__$7 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-colorpicker-square",style:({ width: (_vm.size + "px") })},[_c('div',{staticClass:"colorpicker-square-slider-hue",on:{"click":_vm.clickHue,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}},[_c('div',{ref:"hueCursor",staticClass:"hue-range-thumb",style:(_vm.hueThumbStyle),attrs:{"role":"slider","tabindex":"0","aria-label":"Hue","aria-valuemin":"0","aria-valuemax":"359"}})]),_c('div',{staticClass:"colorpicker-square-slider-sl",style:({
3506
+ background: _vm.SLBackground,
3507
+ margin: (_vm.thickness + "px")
3508
+ }),attrs:{"aria-datascales":"lightness, saturation"},on:{"click":_vm.clickSL,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}},[_c('div',{ref:"slCursor",staticClass:"sl-range-thumb",style:(_vm.slThumbStyle),attrs:{"role":"slider","tabindex":"0","aria-datavalues":((_vm.saturation * 100) + "%, " + (_vm.lightness * 100) + "%")},on:{"click":_vm.clickSL,"keydown":_vm.slKeyPress,"mousedown":function($event){$event.preventDefault();return _vm.startMouseCapture($event)},"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}})])])};
3509
+ var __vue_staticRenderFns__$7 = [];
3510
+
3511
+ /* style */
3512
+ const __vue_inject_styles__$8 = undefined;
3513
+ /* scoped */
3514
+ const __vue_scope_id__$8 = undefined;
3515
+ /* module identifier */
3516
+ const __vue_module_identifier__$8 = undefined;
3517
+ /* functional template */
3518
+ const __vue_is_functional_template__$8 = false;
3519
+ /* style inject */
3520
+
3521
+ /* style inject SSR */
3522
+
3523
+
3524
+
3525
+ var ColorpickerHSLRepresentationSquare = normalizeComponent_1(
3526
+ { render: __vue_render__$7, staticRenderFns: __vue_staticRenderFns__$7 },
3527
+ __vue_inject_styles__$8,
3528
+ __vue_script__$8,
3529
+ __vue_scope_id__$8,
3530
+ __vue_is_functional_template__$8,
3531
+ __vue_module_identifier__$8,
3532
+ undefined,
3533
+ undefined
3534
+ );
3535
+
3536
+ var script$9 = {
3537
+ name: 'BTooltip',
3538
+ props: {
3539
+ active: {
3540
+ type: Boolean,
3541
+ default: true
3542
+ },
3543
+ type: {
3544
+ type: String,
3545
+ default: function _default() {
3546
+ return config.defaultTooltipType;
3547
+ }
3548
+ },
3549
+ label: String,
3550
+ delay: {
3551
+ type: Number,
3552
+ default: function _default() {
3553
+ return config.defaultTooltipDelay;
3554
+ }
3555
+ },
3556
+ position: {
3557
+ type: String,
3558
+ default: 'is-top',
3559
+ validator: function validator(value) {
3560
+ return ['is-top', 'is-bottom', 'is-left', 'is-right'].indexOf(value) > -1;
3561
+ }
3562
+ },
3563
+ triggers: {
3564
+ type: Array,
3565
+ default: function _default() {
3566
+ return ['hover'];
3567
+ }
3568
+ },
3569
+ always: Boolean,
3570
+ square: Boolean,
3571
+ dashed: Boolean,
3572
+ multilined: Boolean,
3573
+ size: {
3574
+ type: String,
3575
+ default: 'is-medium'
3576
+ },
3577
+ appendToBody: Boolean,
3578
+ animated: {
3579
+ type: Boolean,
3580
+ default: true
3581
+ },
3582
+ animation: {
3583
+ type: String,
3584
+ default: 'fade'
3585
+ },
3586
+ contentClass: String,
3587
+ autoClose: {
3588
+ type: [Array, Boolean],
3589
+ default: true
3590
+ }
3591
+ },
3592
+ data: function data() {
3593
+ return {
3594
+ isActive: false,
3595
+ triggerStyle: {},
3596
+ timer: null,
3597
+ _bodyEl: undefined // Used to append to body
3598
+
3599
+ };
3600
+ },
3601
+ computed: {
3602
+ rootClasses: function rootClasses() {
3603
+ return ['b-tooltip', this.type, this.position, this.size, {
3604
+ 'is-square': this.square,
3605
+ 'is-always': this.always,
3606
+ 'is-multiline': this.multilined,
3607
+ 'is-dashed': this.dashed
3608
+ }];
3609
+ },
3610
+ newAnimation: function newAnimation() {
3611
+ return this.animated ? this.animation : undefined;
3612
+ }
3613
+ },
3614
+ watch: {
3615
+ isActive: function isActive(value) {
3616
+ if (this.appendToBody) {
3617
+ this.updateAppendToBody();
3618
+ }
3619
+ }
3620
+ },
3621
+ methods: {
3622
+ updateAppendToBody: function updateAppendToBody() {
3623
+ var tooltip = this.$refs.tooltip;
3624
+ var trigger = this.$refs.trigger;
3625
+
3626
+ if (tooltip && trigger) {
3627
+ // update wrapper tooltip
3628
+ var tooltipEl = this.$data._bodyEl.children[0];
3629
+ tooltipEl.classList.forEach(function (item) {
3630
+ return tooltipEl.classList.remove(item);
3631
+ });
3632
+
3633
+ if (this.$vnode && this.$vnode.data && this.$vnode.data.staticClass) {
3634
+ tooltipEl.classList.add(this.$vnode.data.staticClass);
3635
+ }
3636
+
3637
+ this.rootClasses.forEach(function (item) {
3638
+ if (_typeof(item) === 'object') {
3639
+ for (var key in item) {
3640
+ if (item[key]) {
3641
+ tooltipEl.classList.add(key);
3642
+ }
3643
+ }
3644
+ } else {
3645
+ tooltipEl.classList.add(item);
3646
+ }
3647
+ });
3648
+ tooltipEl.style.width = "".concat(trigger.clientWidth, "px");
3649
+ tooltipEl.style.height = "".concat(trigger.clientHeight, "px");
3650
+ var rect = trigger.getBoundingClientRect();
3651
+ var top = rect.top + window.scrollY;
3652
+ var left = rect.left + window.scrollX;
3653
+ var wrapper = this.$data._bodyEl;
3654
+ wrapper.style.position = 'absolute';
3655
+ wrapper.style.top = "".concat(top, "px");
3656
+ wrapper.style.left = "".concat(left, "px");
3657
+ wrapper.style.zIndex = this.isActive || this.always ? '99' : '-1';
3658
+ this.triggerStyle = {
3659
+ zIndex: this.isActive || this.always ? '100' : undefined
3660
+ };
3661
+ }
3662
+ },
3663
+ onClick: function onClick() {
3664
+ var _this = this;
3665
+
3666
+ if (this.triggers.indexOf('click') < 0) return; // if not active, toggle after clickOutside event
3667
+ // this fixes toggling programmatic
3668
+
3669
+ this.$nextTick(function () {
3670
+ setTimeout(function () {
3671
+ return _this.open();
3672
+ });
3673
+ });
3674
+ },
3675
+ onHover: function onHover() {
3676
+ if (this.triggers.indexOf('hover') < 0) return;
3677
+ this.open();
3678
+ },
3679
+ onContextMenu: function onContextMenu(e) {
3680
+ if (this.triggers.indexOf('contextmenu') < 0) return;
3681
+ e.preventDefault();
3682
+ this.open();
3683
+ },
3684
+ onFocus: function onFocus() {
3685
+ if (this.triggers.indexOf('focus') < 0) return;
3686
+ this.open();
3687
+ },
3688
+ open: function open() {
3689
+ var _this2 = this;
3690
+
3691
+ if (this.delay) {
3692
+ this.timer = setTimeout(function () {
3693
+ _this2.isActive = true;
3694
+ _this2.timer = null;
3695
+ }, this.delay);
3696
+ } else {
3697
+ this.isActive = true;
3698
+ }
3699
+ },
3700
+ close: function close() {
3701
+ if (typeof this.autoClose === 'boolean') {
3702
+ this.isActive = !this.autoClose;
3703
+ if (this.autoClose && this.timer) clearTimeout(this.timer);
3704
+ }
3705
+ },
3706
+
3707
+ /**
3708
+ * Close tooltip if clicked outside.
3709
+ */
3710
+ clickedOutside: function clickedOutside(event) {
3711
+ if (this.isActive) {
3712
+ if (Array.isArray(this.autoClose)) {
3713
+ if (this.autoClose.includes('outside')) {
3714
+ if (!this.isInWhiteList(event.target)) {
3715
+ this.isActive = false;
3716
+ return;
3717
+ }
3718
+ }
3719
+
3720
+ if (this.autoClose.includes('inside')) {
3721
+ if (this.isInWhiteList(event.target)) this.isActive = false;
3722
+ }
3723
+ }
3724
+ }
3725
+ },
3726
+
3727
+ /**
3728
+ * Keypress event that is bound to the document
3729
+ */
3730
+ keyPress: function keyPress(_ref) {
3731
+ var key = _ref.key;
3732
+
3733
+ if (this.isActive && (key === 'Escape' || key === 'Esc')) {
3734
+ if (Array.isArray(this.autoClose)) {
3735
+ if (this.autoClose.indexOf('escape') >= 0) this.isActive = false;
3736
+ }
3737
+ }
3738
+ },
3739
+
3740
+ /**
3741
+ * White-listed items to not close when clicked.
3742
+ */
3743
+ isInWhiteList: function isInWhiteList(el) {
3744
+ if (el === this.$refs.content) return true; // All chidren from content
3745
+
3746
+ if (this.$refs.content !== undefined) {
3747
+ var children = this.$refs.content.querySelectorAll('*');
3748
+ var _iteratorNormalCompletion = true;
3749
+ var _didIteratorError = false;
3750
+ var _iteratorError = undefined;
3751
+
3752
+ try {
3753
+ for (var _iterator = children[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
3754
+ var child = _step.value;
3755
+
3756
+ if (el === child) {
3757
+ return true;
3758
+ }
3759
+ }
3760
+ } catch (err) {
3761
+ _didIteratorError = true;
3762
+ _iteratorError = err;
3763
+ } finally {
3764
+ try {
3765
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
3766
+ _iterator.return();
3767
+ }
3768
+ } finally {
3769
+ if (_didIteratorError) {
3770
+ throw _iteratorError;
3771
+ }
3772
+ }
3773
+ }
3774
+ }
3775
+
3776
+ return false;
3777
+ }
3778
+ },
3779
+ mounted: function mounted() {
3780
+ if (this.appendToBody && typeof window !== 'undefined') {
3781
+ this.$data._bodyEl = createAbsoluteElement(this.$refs.content);
3782
+ this.updateAppendToBody();
3783
+ }
3784
+ },
3785
+ created: function created() {
3786
+ if (typeof window !== 'undefined') {
3787
+ document.addEventListener('click', this.clickedOutside);
3788
+ document.addEventListener('keyup', this.keyPress);
3789
+ }
3790
+ },
3791
+ beforeDestroy: function beforeDestroy() {
3792
+ if (typeof window !== 'undefined') {
3793
+ document.removeEventListener('click', this.clickedOutside);
3794
+ document.removeEventListener('keyup', this.keyPress);
3795
+ }
3796
+
3797
+ if (this.appendToBody) {
3798
+ removeElement(this.$data._bodyEl);
3799
+ }
3800
+ }
3801
+ };
3802
+
3803
+ /* script */
3804
+ const __vue_script__$9 = script$9;
3805
+
3806
+ /* template */
3807
+ var __vue_render__$8 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{ref:"tooltip",class:_vm.rootClasses},[_c('transition',{attrs:{"name":_vm.newAnimation}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.active && (_vm.isActive || _vm.always)),expression:"active && (isActive || always)"}],ref:"content",class:['tooltip-content', _vm.contentClass]},[(_vm.label)?[_vm._v(_vm._s(_vm.label))]:(_vm.$slots.content)?[_vm._t("content")]:_vm._e()],2)]),_c('div',{ref:"trigger",staticClass:"tooltip-trigger",style:(_vm.triggerStyle),on:{"click":_vm.onClick,"contextmenu":_vm.onContextMenu,"mouseenter":_vm.onHover,"!focus":function($event){return _vm.onFocus($event)},"!blur":function($event){return _vm.close($event)},"mouseleave":_vm.close}},[_vm._t("default")],2)],1)};
3808
+ var __vue_staticRenderFns__$8 = [];
3809
+
3810
+ /* style */
3811
+ const __vue_inject_styles__$9 = undefined;
3812
+ /* scoped */
3813
+ const __vue_scope_id__$9 = undefined;
3814
+ /* module identifier */
3815
+ const __vue_module_identifier__$9 = undefined;
3816
+ /* functional template */
3817
+ const __vue_is_functional_template__$9 = false;
3818
+ /* style inject */
3819
+
3820
+ /* style inject SSR */
3821
+
3822
+
3823
+
3824
+ var Tooltip = normalizeComponent_1(
3825
+ { render: __vue_render__$8, staticRenderFns: __vue_staticRenderFns__$8 },
3826
+ __vue_inject_styles__$9,
3827
+ __vue_script__$9,
3828
+ __vue_scope_id__$9,
3829
+ __vue_is_functional_template__$9,
3830
+ __vue_module_identifier__$9,
3831
+ undefined,
3832
+ undefined
3833
+ );
3834
+
3835
+ var script$a = {
3836
+ name: 'BColorpickerAlphaSlider',
3837
+ components: _defineProperty({}, Tooltip.name, Tooltip),
3838
+ props: {
3839
+ value: {
3840
+ type: Number,
3841
+ validator: function validator(value) {
3842
+ return value >= 0 && value < 256;
3843
+ }
3844
+ },
3845
+ color: [String, Object]
3846
+ },
3847
+ data: function data() {
3848
+ var color = Color.parse(this.color);
3849
+ color.alpha = 0;
3850
+ return {
3851
+ startColor: color.toString('hex'),
3852
+ endColor: color.toString('hexa'),
3853
+ percent: Math.round((1 - this.value / 255) * 100),
3854
+ captureMouse: false,
3855
+ clientOffset: {
3856
+ cx: -1,
3857
+ cy: -1,
3858
+ width: 0,
3859
+ height: 0
3860
+ }
3861
+ };
3862
+ },
3863
+ computed: {
3864
+ style: function style() {
3865
+ return {
3866
+ backgroundImage: "linear-gradient(90deg, ".concat(this.startColor, " 0%, ").concat(this.endColor, " 100%),\n linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7),\n linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7)"),
3867
+ backgroundSize: '100% 100%, 1em 1em, 1em 1em',
3868
+ backgroundPosition: '0 0, .5em .5em, 0 0'
3869
+ };
3870
+ }
3871
+ },
3872
+ watch: {
3873
+ value: function value(newValue, oldValue) {
3874
+ if (newValue !== oldValue) {
3875
+ this.percent = Math.round((1 - newValue / 255) * 100);
3876
+ }
3877
+ },
3878
+ color: function color(newColor) {
3879
+ var color = Color.parse(newColor);
3880
+ color.alpha = 0;
3881
+ this.startColor = color.toString('hex');
3882
+ this.endColor = color.toString('hexa');
3883
+ },
3884
+ captureMouse: function captureMouse(newValue, oldValue) {
3885
+ if (oldValue === false && newValue !== false) {
3886
+ var rect = this.$el.getBoundingClientRect(); // Caching offset
3887
+
3888
+ this.clientOffset.cx = rect.x + rect.width / 2;
3889
+ this.clientOffset.cy = rect.y + rect.height / 2;
3890
+ this.clientOffset.width = rect.width;
3891
+ this.clientOffset.height = rect.height;
3892
+ }
3893
+ }
3894
+ },
3895
+ methods: {
3896
+ increaseAlpha: function increaseAlpha() {
3897
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
3898
+ this.percent = Math.max(0, Math.min(100, this.percent + value));
3899
+ },
3900
+ decreaseAlpha: function decreaseAlpha() {
3901
+ var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0.01;
3902
+ this.increaseAlpha(-value);
3903
+ },
3904
+ alphaKeyPress: function alphaKeyPress(event) {
3905
+ var handled = false;
3906
+
3907
+ switch (event.key) {
3908
+ case 'ArrowRight':
3909
+ case 'ArrowUp':
3910
+ this.increaseAlpha();
3911
+ handled = true;
3912
+ break;
3913
+
3914
+ case 'ArrowLeft':
3915
+ case 'ArrowDown':
3916
+ this.decreaseAlpha();
3917
+ handled = true;
3918
+ break;
3919
+
3920
+ case 'Home':
3921
+ this.decreaseAlpha(this.percent);
3922
+ handled = true;
3923
+ break;
3924
+
3925
+ case 'End':
3926
+ this.increaseAlpha(100 - this.percent);
3927
+ handled = true;
3928
+ break;
3929
+
3930
+ case 'PageUp':
3931
+ this.increaseAlpha(10 - this.percent % 10);
3932
+ handled = true;
3933
+ break;
3934
+
3935
+ case 'PageDown':
3936
+ this.decreaseAlpha(this.percent % 10);
3937
+ handled = true;
3938
+ break;
3939
+ }
3940
+
3941
+ if (handled) {
3942
+ event.preventDefault();
3943
+ event.stopPropagation();
3944
+ this.emitAlpha();
3945
+ }
3946
+ },
3947
+ clickAlpha: function clickAlpha(event) {
3948
+ this.startMouseCapture(event);
3949
+ this.trackMouse(event);
3950
+ this.stopMouseCapture(event);
3951
+ this.$refs.alphaCursor.focus();
3952
+ },
3953
+ startMouseCapture: function startMouseCapture(event) {
3954
+ event.stopPropagation();
3955
+ this.captureMouse = true;
3956
+ },
3957
+ trackMouse: function trackMouse(event) {
3958
+ if (this.captureMouse === false) {
3959
+ return;
3960
+ }
3961
+
3962
+ event.preventDefault();
3963
+ event.stopPropagation();
3964
+ var _ref = [0, 0],
3965
+ mouseX = _ref[0];
3966
+
3967
+ if (typeof event.touches !== 'undefined' && event.touches.length) {
3968
+ var _ref2 = [event.touches[0].clientX];
3969
+ mouseX = _ref2[0];
3970
+ } else {
3971
+ var _ref3 = [event.clientX];
3972
+ mouseX = _ref3[0];
3973
+ }
3974
+
3975
+ var ratio = 0.5 + (this.clientOffset.cx - mouseX) / this.clientOffset.width;
3976
+ this.percent = Math.round(100 - Math.max(0, Math.min(1, ratio)) * 100);
3977
+ this.emitAlpha();
3978
+ },
3979
+ stopMouseCapture: function stopMouseCapture(event) {
3980
+ if (this.captureMouse !== false) {
3981
+ event.preventDefault();
3982
+ event.stopPropagation();
3983
+ this.$refs.alphaCursor.focus();
3984
+ }
3985
+
3986
+ this.captureMouse = false;
3987
+ },
3988
+ emitAlpha: function emitAlpha() {
3989
+ this.$emit('input', (1 - this.percent / 100) * 255);
3990
+ }
3991
+ },
3992
+ mounted: function mounted() {
3993
+ window.addEventListener('mousemove', this.trackMouse);
3994
+ window.addEventListener('touchmove', this.trackMouse, {
3995
+ passive: false
3996
+ });
3997
+ window.addEventListener('mouseup', this.stopMouseCapture);
3998
+ window.addEventListener('touchend', this.stopMouseCapture);
3999
+ },
4000
+ beforeDestroy: function beforeDestroy() {
4001
+ window.removeEventListener('mousemove', this.trackMouse);
4002
+ window.removeEventListener('touchmove', this.trackMouse);
4003
+ window.removeEventListener('mouseup', this.stopMouseCapture);
4004
+ window.removeEventListener('touchend', this.stopMouseCapture);
4005
+ }
4006
+ };
4007
+
4008
+ /* script */
4009
+ const __vue_script__$a = script$a;
4010
+
4011
+ /* template */
4012
+ var __vue_render__$9 = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"b-colorpicker-alpha-slider",style:(_vm.style),on:{"click":_vm.clickAlpha,"keydown":_vm.alphaKeyPress,"mousedown":_vm.startMouseCapture,"touchstart":function($event){$event.preventDefault();return _vm.startMouseCapture($event)}}},[_c('div',{ref:"alphaCursor",staticClass:"alpha-range-thumb",style:({ left: (_vm.percent + "%") }),attrs:{"role":"slider","tabindex":"0","aria-label":"Tranparency","aria-valuemin":"0","aria-valuenow":_vm.percent,"aria-valuemax":"100"}},[_c('b-tooltip',{attrs:{"label":(_vm.percent + "%"),"always":_vm.captureMouse}})],1)])};
4013
+ var __vue_staticRenderFns__$9 = [];
4014
+
4015
+ /* style */
4016
+ const __vue_inject_styles__$a = undefined;
4017
+ /* scoped */
4018
+ const __vue_scope_id__$a = undefined;
4019
+ /* module identifier */
4020
+ const __vue_module_identifier__$a = undefined;
4021
+ /* functional template */
4022
+ const __vue_is_functional_template__$a = false;
4023
+ /* style inject */
4024
+
4025
+ /* style inject SSR */
4026
+
4027
+
4028
+
4029
+ var ColorpickerAlphaSlider = normalizeComponent_1(
4030
+ { render: __vue_render__$9, staticRenderFns: __vue_staticRenderFns__$9 },
4031
+ __vue_inject_styles__$a,
4032
+ __vue_script__$a,
4033
+ __vue_scope_id__$a,
4034
+ __vue_is_functional_template__$a,
4035
+ __vue_module_identifier__$a,
4036
+ undefined,
4037
+ undefined
4038
+ );
4039
+
4040
+ var _components;
4041
+
4042
+ var defaultColorFormatter = function defaultColorFormatter(color, vm) {
4043
+ if (color.alpha < 1) {
4044
+ return color.toString('hexa');
4045
+ } else {
4046
+ return color.toString('hex');
4047
+ }
4048
+ };
4049
+
4050
+ var defaultColorParser = function defaultColorParser(color, vm) {
4051
+ return Color.parse(color);
4052
+ };
4053
+
4054
+ var script$b = {
4055
+ name: 'BColorpicker',
4056
+ components: (_components = {}, _defineProperty(_components, ColorpickerHSLRepresentationTriangle.name, ColorpickerHSLRepresentationTriangle), _defineProperty(_components, ColorpickerHSLRepresentationSquare.name, ColorpickerHSLRepresentationSquare), _defineProperty(_components, ColorpickerAlphaSlider.name, ColorpickerAlphaSlider), _defineProperty(_components, Input.name, Input), _defineProperty(_components, Field.name, Field), _defineProperty(_components, Select.name, Select), _defineProperty(_components, Icon.name, Icon), _defineProperty(_components, Dropdown.name, Dropdown), _defineProperty(_components, DropdownItem.name, DropdownItem), _components),
4057
+ mixins: [FormElementMixin],
4058
+ inheritAttrs: false,
4059
+ provide: function provide() {
4060
+ return {
4061
+ $colorpicker: this
4062
+ };
4063
+ },
4064
+ props: {
4065
+ value: {
4066
+ type: [String, Object],
4067
+ validator: function validator(value) {
4068
+ return typeof value === 'string' || _typeof(value) === 'object' && typeof value.red === 'number' && typeof value.green === 'number' && typeof value.blue === 'number';
4069
+ }
4070
+ },
4071
+ representation: {
4072
+ type: String,
4073
+ default: 'triangle',
4074
+ value: function value(_value) {
4075
+ return ['triangle', 'square'].some(function (r) {
4076
+ return r === _value;
4077
+ });
4078
+ }
4079
+ },
4080
+ inline: Boolean,
4081
+ disabled: Boolean,
4082
+ horizontalColorPicker: {
4083
+ type: Boolean,
4084
+ default: false
4085
+ },
4086
+ colorFormatter: {
4087
+ type: Function,
4088
+ default: function _default(color, vm) {
4089
+ if (typeof config.defaultColorFormatter === 'function') {
4090
+ return config.defaultColorFormatter(color);
4091
+ } else {
4092
+ return defaultColorFormatter(color);
4093
+ }
4094
+ }
4095
+ },
4096
+ colorParser: {
4097
+ type: Function,
4098
+ default: function _default(color, vm) {
4099
+ if (typeof config.defaultColorParser === 'function') {
4100
+ return config.defaultColorParser(color);
4101
+ } else {
4102
+ return defaultColorParser(color);
4103
+ }
4104
+ }
4105
+ },
4106
+ alpha: {
4107
+ type: Boolean,
4108
+ default: false
4109
+ },
4110
+ expanded: Boolean,
4111
+ position: String,
4112
+ mobileModal: {
4113
+ type: Boolean,
4114
+ default: function _default() {
4115
+ return config.defaultDatepickerMobileModal;
4116
+ }
4117
+ },
4118
+ focusable: {
4119
+ type: Boolean,
4120
+ default: true
4121
+ },
4122
+ trapFocus: {
4123
+ type: Boolean,
4124
+ default: function _default() {
4125
+ return config.defaultTrapFocus;
4126
+ }
4127
+ },
4128
+ appendToBody: Boolean
4129
+ },
4130
+ data: function data() {
4131
+ var color = this.colorParser(this.value);
4132
+ return {
4133
+ colorSelected: color
4134
+ };
4135
+ },
4136
+ computed: {
4137
+ background: function background() {
4138
+ if (this.alpha) {
4139
+ return "linear-gradient(\n 45deg,\n ".concat(this.colorSelected.toString('hex'), " 50%,\n ").concat(this.colorSelected.toString('hexa'), " 50%\n )");
4140
+ } else {
4141
+ var hex = this.colorSelected.toString('hex');
4142
+ return "linear-gradient(\n 45deg,\n ".concat(hex, " 50%,\n ").concat(hex, " 50%\n )");
4143
+ }
4144
+ },
4145
+ triggerStyle: function triggerStyle() {
4146
+ var _this$colorSelected = this.colorSelected,
4147
+ red = _this$colorSelected.red,
4148
+ green = _this$colorSelected.green,
4149
+ blue = _this$colorSelected.blue;
4150
+ var light = red * 0.299 + green * 0.587 + blue * 0.114 > 186;
4151
+ return {
4152
+ backgroundColor: '#ffffff',
4153
+ backgroundImage: "\n ".concat(this.background, ",\n linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7),\n linear-gradient(45deg, #c7c7c7 25%, transparent 25%, transparent 75%, #c7c7c7 75%, #c7c7c7)\n "),
4154
+ backgroundSize: '100% 100%, 16px 16px, 16px 16px',
4155
+ backgroundPosition: '0 0, 8px 8px, 0 0',
4156
+ color: light ? '#000000' : '#FFFFFF',
4157
+ textShadow: "0 0 2px ".concat(light ? '#FFFFFFAA' : '#000000AA')
4158
+ };
4159
+ },
4160
+ isMobile: function isMobile$1() {
4161
+ return this.mobileNative && isMobile.any();
4162
+ },
4163
+ ariaRole: function ariaRole() {
4164
+ if (!this.inline) {
4165
+ return 'dialog';
4166
+ }
4167
+ }
4168
+ },
4169
+ watch: {
4170
+ value: function value(_value2) {
4171
+ this.colorSelected = new Color(_value2);
4172
+ }
4173
+ },
4174
+ methods: {
4175
+ updateColor: function updateColor(value) {
4176
+ value.alpha = this.colorSelected.alpha;
4177
+ this.colorSelected = value;
4178
+ this.$emit('change', value);
4179
+ },
4180
+
4181
+ /*
4182
+ * Format color into string
4183
+ */
4184
+ formatValue: function formatValue(value) {
4185
+ return value ? this.colorFormatter(value, this) : null;
4186
+ },
4187
+
4188
+ /*
4189
+ * Toggle datepicker
4190
+ */
4191
+ togglePicker: function togglePicker(active) {
4192
+ if (this.$refs.dropdown) {
4193
+ var isActive = typeof active === 'boolean' ? active : !this.$refs.dropdown.isActive;
4194
+
4195
+ if (isActive) {
4196
+ this.$refs.dropdown.isActive = isActive;
4197
+ } else if (this.closeOnClick) {
4198
+ this.$refs.dropdown.isActive = isActive;
4199
+ }
4200
+ }
4201
+ },
4202
+
4203
+ /*
4204
+ * Call default onFocus method and show datepicker
4205
+ */
4206
+ handleOnFocus: function handleOnFocus(event) {
4207
+ this.onFocus(event);
4208
+
4209
+ if (this.openOnFocus) {
4210
+ this.togglePicker(true);
4211
+ }
4212
+ },
4213
+
4214
+ /*
4215
+ * Toggle dropdown
4216
+ */
4217
+ toggle: function toggle() {
4218
+ if (this.mobileNative && this.isMobile) {
4219
+ var input = this.$refs.input.$refs.input;
4220
+ input.focus();
4221
+ input.click();
4222
+ return;
4223
+ }
4224
+
4225
+ this.$refs.dropdown.toggle();
4226
+ },
4227
+
4228
+ /*
4229
+ * Avoid dropdown toggle when is already visible
4230
+ */
4231
+ onInputClick: function onInputClick(event) {
4232
+ if (this.$refs.dropdown.isActive) {
4233
+ event.stopPropagation();
4234
+ }
4235
+ },
4236
+
4237
+ /**
4238
+ * Keypress event that is bound to the document.
4239
+ */
4240
+ keyPress: function keyPress(_ref) {
4241
+ var key = _ref.key;
4242
+
4243
+ if (this.$refs.dropdown && this.$refs.dropdown.isActive && (key === 'Escape' || key === 'Esc')) {
4244
+ this.togglePicker(false);
4245
+ }
4246
+ },
4247
+
4248
+ /**
4249
+ * Emit 'blur' event on dropdown is not active (closed)
4250
+ */
4251
+ onActiveChange: function onActiveChange(value) {
4252
+ if (!value) {
4253
+ this.onBlur();
4254
+ }
4255
+ /*
4256
+ * Emit 'active-change' when on dropdown active state change
4257
+ */
4258
+
4259
+
4260
+ this.$emit('active-change', value);
4261
+ }
4262
+ }
4263
+ };
4264
+
4265
+ /* script */
4266
+ const __vue_script__$b = script$b;
4267
+
4268
+ /* template */
4269
+ var __vue_render__$a = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"colorpicker control",class:[_vm.size, {'is-expanded': _vm.expanded}]},[(!_vm.isMobile || _vm.inline)?_c('b-dropdown',{ref:"dropdown",attrs:{"position":_vm.position,"expanded":_vm.expanded,"disabled":_vm.disabled,"inline":_vm.inline,"mobile-modal":_vm.mobileModal,"trap-focus":_vm.trapFocus,"aria-role":_vm.ariaRole,"aria-modal":!_vm.inline,"append-to-body":_vm.appendToBody,"append-to-body-copy-parent":""},on:{"active-change":_vm.onActiveChange},scopedSlots:_vm._u([(!_vm.inline)?{key:"trigger",fn:function(){return [_vm._t("trigger",[_c('b-button',{style:(_vm.triggerStyle),attrs:{"expanded":_vm.expanded,"disabled":_vm.disabled}},[_c('span',{staticClass:"color-name"},[_vm._v(_vm._s(_vm.colorFormatter(_vm.colorSelected)))])])])]},proxy:true}:null],null,true)},[_c('b-dropdown-item',{class:{'dropdown-horizonal-colorpicker': _vm.horizontalColorPicker},attrs:{"disabled":_vm.disabled,"focusable":_vm.focusable,"custom":""}},[_c('div',[_c('header',{staticClass:"colorpicker-header"},[(_vm.$slots.header !== undefined && _vm.$slots.header.length)?[_vm._t("header")]:_vm._e()],2),_c('div',{staticClass:"colorpicker-content"},[(_vm.representation === 'square')?_c('b-colorpicker-h-s-l-representation-square',{attrs:{"value":_vm.colorSelected},on:{"input":_vm.updateColor}}):_c('b-colorpicker-h-s-l-representation-triangle',{attrs:{"value":_vm.colorSelected},on:{"input":_vm.updateColor}})],1)]),_c('footer',{staticClass:"colorpicker-footer"},[(_vm.alpha)?_c('b-colorpicker-alpha-slider',{attrs:{"color":_vm.colorSelected},model:{value:(_vm.colorSelected.alpha),callback:function ($$v) {_vm.$set(_vm.colorSelected, "alpha", $$v);},expression:"colorSelected.alpha"}}):_vm._e(),_vm._t("footer",[_c('b-field',{staticClass:"colorpicker-fields",attrs:{"grouped":""}},[_c('b-field',{attrs:{"horizontal":"","label":"R"}},[_c('b-input',{attrs:{"type":"number","size":"is-small","aria-label":"Red"},model:{value:(_vm.colorSelected.red),callback:function ($$v) {_vm.$set(_vm.colorSelected, "red", _vm._n($$v));},expression:"colorSelected.red"}})],1),_c('b-field',{attrs:{"horizontal":"","label":"G"}},[_c('b-input',{attrs:{"type":"number","size":"is-small","aria-label":"Green"},model:{value:(_vm.colorSelected.green),callback:function ($$v) {_vm.$set(_vm.colorSelected, "green", _vm._n($$v));},expression:"colorSelected.green"}})],1),_c('b-field',{attrs:{"horizontal":"","label":"B"}},[_c('b-input',{attrs:{"type":"number","size":"is-small","aria-label":"Blue"},model:{value:(_vm.colorSelected.blue),callback:function ($$v) {_vm.$set(_vm.colorSelected, "blue", _vm._n($$v));},expression:"colorSelected.blue"}})],1)],1)],{"color":_vm.colorSelected})],2)])],1):_vm._e()],1)};
4270
+ var __vue_staticRenderFns__$a = [];
4271
+
4272
+ /* style */
4273
+ const __vue_inject_styles__$b = undefined;
4274
+ /* scoped */
4275
+ const __vue_scope_id__$b = undefined;
4276
+ /* module identifier */
4277
+ const __vue_module_identifier__$b = undefined;
4278
+ /* functional template */
4279
+ const __vue_is_functional_template__$b = false;
4280
+ /* style inject */
4281
+
4282
+ /* style inject SSR */
4283
+
4284
+
4285
+
4286
+ var Colorpicker = normalizeComponent_1(
4287
+ { render: __vue_render__$a, staticRenderFns: __vue_staticRenderFns__$a },
4288
+ __vue_inject_styles__$b,
4289
+ __vue_script__$b,
4290
+ __vue_scope_id__$b,
4291
+ __vue_is_functional_template__$b,
4292
+ __vue_module_identifier__$b,
4293
+ undefined,
4294
+ undefined
4295
+ );
4296
+
4297
+ var use = function use(plugin) {
4298
+ if (typeof window !== 'undefined' && window.Vue) {
4299
+ window.Vue.use(plugin);
4300
+ }
4301
+ };
4302
+ var registerComponent = function registerComponent(Vue, component) {
4303
+ Vue.component(component.name, component);
4304
+ };
4305
+
4306
+ var Plugin = {
4307
+ install: function install(Vue) {
4308
+ registerComponent(Vue, Colorpicker);
4309
+ }
4310
+ };
4311
+ use(Plugin);
4312
+
4313
+ exports.BColorpicker = Colorpicker;
4314
+ exports.default = Plugin;
4315
+
4316
+ Object.defineProperty(exports, '__esModule', { value: true });
4317
+
4318
+ }));