buefy 0.9.26 → 0.9.28

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 (259) hide show
  1. package/README.md +3 -1
  2. package/dist/buefy.css +15904 -0
  3. package/dist/buefy.esm.js +17883 -0
  4. package/dist/buefy.esm.min.js +2 -0
  5. package/dist/buefy.js +17967 -0
  6. package/dist/buefy.min.css +1 -0
  7. package/dist/buefy.min.js +2 -0
  8. package/dist/cjs/Autocomplete-7a39c5ce.js +673 -0
  9. package/dist/cjs/Button-01827709.js +114 -0
  10. package/dist/cjs/CheckRadioMixin-c910f2ed.js +45 -0
  11. package/dist/cjs/Checkbox-43f54cc7.js +70 -0
  12. package/dist/cjs/Datepicker-680659bc.js +1679 -0
  13. package/dist/cjs/DropdownItem-422f8c34.js +559 -0
  14. package/dist/cjs/Field-4557b10c.js +315 -0
  15. package/dist/cjs/FormElementMixin-193a88b8.js +163 -0
  16. package/dist/cjs/Icon-78961800.js +189 -0
  17. package/dist/cjs/Image-c4bcd9b3.js +299 -0
  18. package/dist/cjs/InjectedChildMixin-d6bf7f91.js +135 -0
  19. package/dist/cjs/Input-e5a72d97.js +248 -0
  20. package/dist/cjs/Loading-6f2c7075.js +150 -0
  21. package/dist/cjs/MessageMixin-8d959514.js +146 -0
  22. package/dist/cjs/Modal-4cf07210.js +278 -0
  23. package/dist/cjs/NoticeMixin-01121bd2.js +154 -0
  24. package/dist/cjs/Pagination-d6b3fb85.js +413 -0
  25. package/dist/cjs/Select-2b3879bc.js +100 -0
  26. package/dist/cjs/SlotComponent-4fb48389.js +53 -0
  27. package/dist/cjs/TabbedChildMixin-907cad32.js +222 -0
  28. package/dist/cjs/Tag-437f65fb.js +154 -0
  29. package/dist/cjs/Timepicker-498fa02b.js +67 -0
  30. package/dist/cjs/TimepickerMixin-6c1a4ab4.js +661 -0
  31. package/dist/cjs/Tooltip-c1df7ee3.js +370 -0
  32. package/dist/cjs/_rollupPluginBabelHelpers-8b2e54ad.js +365 -0
  33. package/dist/cjs/autocomplete.js +22 -0
  34. package/dist/cjs/breadcrumb.js +139 -0
  35. package/dist/cjs/button.js +20 -0
  36. package/dist/cjs/carousel.js +662 -0
  37. package/dist/cjs/checkbox.js +86 -0
  38. package/dist/cjs/clockpicker.js +461 -0
  39. package/dist/cjs/collapse.js +128 -0
  40. package/dist/cjs/colorpicker.js +23 -0
  41. package/dist/cjs/config-8cfb5a4a.js +81 -0
  42. package/dist/cjs/config.js +18 -0
  43. package/dist/cjs/datepicker.js +27 -0
  44. package/dist/cjs/datetimepicker.js +377 -0
  45. package/dist/cjs/dialog.js +308 -0
  46. package/dist/cjs/dropdown.js +23 -0
  47. package/dist/cjs/field.js +18 -0
  48. package/dist/cjs/helpers.js +375 -0
  49. package/dist/cjs/icon.js +19 -0
  50. package/dist/cjs/image.js +19 -0
  51. package/dist/cjs/index-99d1c930.js +1633 -0
  52. package/dist/cjs/index.js +216 -0
  53. package/dist/cjs/input.js +21 -0
  54. package/dist/cjs/loading.js +38 -0
  55. package/dist/cjs/menu.js +304 -0
  56. package/dist/cjs/message.js +67 -0
  57. package/dist/cjs/modal.js +59 -0
  58. package/dist/cjs/navbar.js +679 -0
  59. package/dist/cjs/notification.js +181 -0
  60. package/dist/cjs/numberinput.js +278 -0
  61. package/dist/cjs/pagination.js +22 -0
  62. package/dist/cjs/plugins-7f41b028.js +94 -0
  63. package/dist/cjs/progress.js +239 -0
  64. package/dist/cjs/radio.js +130 -0
  65. package/dist/cjs/rate.js +156 -0
  66. package/dist/cjs/select.js +21 -0
  67. package/dist/cjs/sidebar.js +303 -0
  68. package/dist/cjs/skeleton.js +111 -0
  69. package/dist/cjs/slider.js +603 -0
  70. package/dist/cjs/snackbar.js +132 -0
  71. package/dist/cjs/ssr-20dba236.js +10 -0
  72. package/dist/cjs/steps.js +278 -0
  73. package/dist/cjs/switch.js +139 -0
  74. package/dist/cjs/table.js +1695 -0
  75. package/dist/cjs/tabs.js +214 -0
  76. package/dist/cjs/tag.js +70 -0
  77. package/dist/cjs/taginput.js +331 -0
  78. package/dist/cjs/timepicker.js +28 -0
  79. package/dist/cjs/toast.js +106 -0
  80. package/dist/cjs/tooltip.js +19 -0
  81. package/dist/cjs/trapFocus-261420b0.js +49 -0
  82. package/dist/cjs/upload.js +205 -0
  83. package/dist/components/autocomplete/index.js +1620 -0
  84. package/dist/components/autocomplete/index.min.js +2 -0
  85. package/dist/components/breadcrumb/index.js +297 -0
  86. package/dist/components/breadcrumb/index.min.js +2 -0
  87. package/dist/components/button/index.js +569 -0
  88. package/dist/components/button/index.min.js +2 -0
  89. package/dist/components/carousel/index.js +1629 -0
  90. package/dist/components/carousel/index.min.js +2 -0
  91. package/dist/components/checkbox/index.js +279 -0
  92. package/dist/components/checkbox/index.min.js +2 -0
  93. package/dist/components/clockpicker/index.js +3131 -0
  94. package/dist/components/clockpicker/index.min.js +2 -0
  95. package/dist/components/collapse/index.js +217 -0
  96. package/dist/components/collapse/index.min.js +2 -0
  97. package/dist/components/colorpicker/index.js +4249 -0
  98. package/dist/components/colorpicker/index.min.js +2 -0
  99. package/dist/components/datepicker/index.js +3845 -0
  100. package/dist/components/datepicker/index.min.js +2 -0
  101. package/dist/components/datetimepicker/index.js +4902 -0
  102. package/dist/components/datetimepicker/index.min.js +2 -0
  103. package/dist/components/dialog/index.js +1168 -0
  104. package/dist/components/dialog/index.min.js +2 -0
  105. package/dist/components/dropdown/index.js +1043 -0
  106. package/dist/components/dropdown/index.min.js +2 -0
  107. package/dist/components/field/index.js +511 -0
  108. package/dist/components/field/index.min.js +2 -0
  109. package/dist/components/icon/index.js +463 -0
  110. package/dist/components/icon/index.min.js +2 -0
  111. package/dist/components/image/index.js +513 -0
  112. package/dist/components/image/index.min.js +2 -0
  113. package/dist/components/input/index.js +862 -0
  114. package/dist/components/input/index.min.js +2 -0
  115. package/dist/components/loading/index.js +366 -0
  116. package/dist/components/loading/index.min.js +2 -0
  117. package/dist/components/menu/index.js +748 -0
  118. package/dist/components/menu/index.min.js +2 -0
  119. package/dist/components/message/index.js +650 -0
  120. package/dist/components/message/index.min.js +2 -0
  121. package/dist/components/modal/index.js +624 -0
  122. package/dist/components/modal/index.min.js +2 -0
  123. package/dist/components/navbar/index.js +805 -0
  124. package/dist/components/navbar/index.min.js +2 -0
  125. package/dist/components/notification/index.js +923 -0
  126. package/dist/components/notification/index.min.js +2 -0
  127. package/dist/components/numberinput/index.js +1119 -0
  128. package/dist/components/numberinput/index.min.js +2 -0
  129. package/dist/components/pagination/index.js +868 -0
  130. package/dist/components/pagination/index.min.js +2 -0
  131. package/dist/components/progress/index.js +621 -0
  132. package/dist/components/progress/index.min.js +2 -0
  133. package/dist/components/radio/index.js +260 -0
  134. package/dist/components/radio/index.min.js +2 -0
  135. package/dist/components/rate/index.js +600 -0
  136. package/dist/components/rate/index.min.js +2 -0
  137. package/dist/components/select/index.js +715 -0
  138. package/dist/components/select/index.min.js +2 -0
  139. package/dist/components/sidebar/index.js +467 -0
  140. package/dist/components/sidebar/index.min.js +2 -0
  141. package/dist/components/skeleton/index.js +200 -0
  142. package/dist/components/skeleton/index.min.js +2 -0
  143. package/dist/components/slider/index.js +1264 -0
  144. package/dist/components/slider/index.min.js +2 -0
  145. package/dist/components/snackbar/index.js +527 -0
  146. package/dist/components/snackbar/index.min.js +2 -0
  147. package/dist/components/steps/index.js +1180 -0
  148. package/dist/components/steps/index.min.js +2 -0
  149. package/dist/components/switch/index.js +297 -0
  150. package/dist/components/switch/index.min.js +2 -0
  151. package/dist/components/table/index.js +3480 -0
  152. package/dist/components/table/index.min.js +2 -0
  153. package/dist/components/tabs/index.js +1116 -0
  154. package/dist/components/tabs/index.min.js +2 -0
  155. package/dist/components/tag/index.js +307 -0
  156. package/dist/components/tag/index.min.js +2 -0
  157. package/dist/components/taginput/index.js +2104 -0
  158. package/dist/components/taginput/index.min.js +2 -0
  159. package/dist/components/timepicker/index.js +2843 -0
  160. package/dist/components/timepicker/index.min.js +2 -0
  161. package/dist/components/toast/index.js +501 -0
  162. package/dist/components/toast/index.min.js +2 -0
  163. package/dist/components/tooltip/index.js +630 -0
  164. package/dist/components/tooltip/index.min.js +2 -0
  165. package/dist/components/upload/index.js +525 -0
  166. package/dist/components/upload/index.min.js +2 -0
  167. package/dist/esm/Autocomplete-1a6e8770.js +671 -0
  168. package/dist/esm/Button-521f6efc.js +112 -0
  169. package/dist/esm/CheckRadioMixin-e726a83c.js +43 -0
  170. package/dist/esm/Checkbox-1d02686e.js +68 -0
  171. package/dist/esm/Datepicker-0ae1e826.js +1677 -0
  172. package/dist/esm/DropdownItem-55682322.js +556 -0
  173. package/dist/esm/Field-3ceba31e.js +313 -0
  174. package/dist/esm/FormElementMixin-b223d3c7.js +161 -0
  175. package/dist/esm/Icon-60d47b31.js +187 -0
  176. package/dist/esm/Image-75808acb.js +297 -0
  177. package/dist/esm/InjectedChildMixin-b4220787.js +130 -0
  178. package/dist/esm/Input-20612b63.js +246 -0
  179. package/dist/esm/Loading-ae028ea5.js +148 -0
  180. package/dist/esm/MessageMixin-d577a9f5.js +144 -0
  181. package/dist/esm/Modal-7da7641f.js +276 -0
  182. package/dist/esm/NoticeMixin-bd6f61d9.js +152 -0
  183. package/dist/esm/Pagination-68f12c1e.js +409 -0
  184. package/dist/esm/Select-97781d4e.js +98 -0
  185. package/dist/esm/SlotComponent-8871a20f.js +51 -0
  186. package/dist/esm/TabbedChildMixin-bcb13767.js +219 -0
  187. package/dist/esm/Tag-6365aa46.js +152 -0
  188. package/dist/esm/Timepicker-38480bbc.js +65 -0
  189. package/dist/esm/TimepickerMixin-d736b0a9.js +659 -0
  190. package/dist/esm/Tooltip-d98a769c.js +368 -0
  191. package/dist/esm/_rollupPluginBabelHelpers-df313029.js +350 -0
  192. package/dist/esm/autocomplete.js +18 -0
  193. package/dist/esm/breadcrumb.js +133 -0
  194. package/dist/esm/button.js +16 -0
  195. package/dist/esm/carousel.js +655 -0
  196. package/dist/esm/checkbox.js +81 -0
  197. package/dist/esm/clockpicker.js +456 -0
  198. package/dist/esm/collapse.js +123 -0
  199. package/dist/esm/colorpicker.js +14 -0
  200. package/dist/esm/config-e7d4b9c2.js +78 -0
  201. package/dist/esm/config.js +14 -0
  202. package/dist/esm/datepicker.js +23 -0
  203. package/dist/esm/datetimepicker.js +372 -0
  204. package/dist/esm/dialog.js +302 -0
  205. package/dist/esm/dropdown.js +18 -0
  206. package/dist/esm/field.js +14 -0
  207. package/dist/esm/helpers.js +348 -0
  208. package/dist/esm/icon.js +15 -0
  209. package/dist/esm/image.js +15 -0
  210. package/dist/esm/index-903f63ea.js +1629 -0
  211. package/dist/esm/index.js +182 -0
  212. package/dist/esm/input.js +17 -0
  213. package/dist/esm/loading.js +33 -0
  214. package/dist/esm/menu.js +297 -0
  215. package/dist/esm/message.js +62 -0
  216. package/dist/esm/modal.js +54 -0
  217. package/dist/esm/navbar.js +672 -0
  218. package/dist/esm/notification.js +175 -0
  219. package/dist/esm/numberinput.js +273 -0
  220. package/dist/esm/pagination.js +17 -0
  221. package/dist/esm/plugins-218aea86.js +89 -0
  222. package/dist/esm/progress.js +233 -0
  223. package/dist/esm/radio.js +124 -0
  224. package/dist/esm/rate.js +151 -0
  225. package/dist/esm/select.js +17 -0
  226. package/dist/esm/sidebar.js +298 -0
  227. package/dist/esm/skeleton.js +106 -0
  228. package/dist/esm/slider.js +597 -0
  229. package/dist/esm/snackbar.js +126 -0
  230. package/dist/esm/ssr-b847d137.js +7 -0
  231. package/dist/esm/steps.js +272 -0
  232. package/dist/esm/switch.js +134 -0
  233. package/dist/esm/table.js +1689 -0
  234. package/dist/esm/tabs.js +208 -0
  235. package/dist/esm/tag.js +65 -0
  236. package/dist/esm/taginput.js +326 -0
  237. package/dist/esm/timepicker.js +24 -0
  238. package/dist/esm/toast.js +100 -0
  239. package/dist/esm/tooltip.js +15 -0
  240. package/dist/esm/trapFocus-f0736873.js +47 -0
  241. package/dist/esm/upload.js +200 -0
  242. package/dist/vetur/attributes.json +3238 -0
  243. package/dist/vetur/tags.json +1183 -0
  244. package/package.json +3 -3
  245. package/src/components/autocomplete/Autocomplete.spec.js +16 -0
  246. package/src/components/autocomplete/Autocomplete.vue +9 -3
  247. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +2 -0
  248. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +2 -0
  249. package/src/components/dropdown/Dropdown.vue +51 -3
  250. package/src/components/numberinput/Numberinput.vue +4 -0
  251. package/src/components/sidebar/Sidebar.vue +1 -0
  252. package/src/components/slider/Slider.vue +7 -2
  253. package/src/components/slider/SliderThumb.vue +8 -0
  254. package/src/components/table/Table.vue +4 -1
  255. package/src/components/table/TableColumn.spec.js +51 -0
  256. package/src/components/table/TableColumn.vue +8 -1
  257. package/src/components/taginput/Taginput.vue +7 -2
  258. package/src/components/tooltip/Tooltip.vue +10 -3
  259. package/src/scss/components/_dropdown.scss +4 -2
@@ -0,0 +1,1620 @@
1
+ /*! Buefy v0.9.28 | 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 = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Autocomplete = {}));
6
+ })(this, (function (exports) { 'use strict';
7
+
8
+ function ownKeys(e, r) {
9
+ var t = Object.keys(e);
10
+ if (Object.getOwnPropertySymbols) {
11
+ var o = Object.getOwnPropertySymbols(e);
12
+ r && (o = o.filter(function (r) {
13
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
14
+ })), t.push.apply(t, o);
15
+ }
16
+ return t;
17
+ }
18
+ function _objectSpread2(e) {
19
+ for (var r = 1; r < arguments.length; r++) {
20
+ var t = null != arguments[r] ? arguments[r] : {};
21
+ r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
22
+ _defineProperty(e, r, t[r]);
23
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
24
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
25
+ });
26
+ }
27
+ return e;
28
+ }
29
+ function _toPrimitive(t, r) {
30
+ if ("object" != typeof t || !t) return t;
31
+ var e = t[Symbol.toPrimitive];
32
+ if (void 0 !== e) {
33
+ var i = e.call(t, r || "default");
34
+ if ("object" != typeof i) return i;
35
+ throw new TypeError("@@toPrimitive must return a primitive value.");
36
+ }
37
+ return ("string" === r ? String : Number)(t);
38
+ }
39
+ function _toPropertyKey(t) {
40
+ var i = _toPrimitive(t, "string");
41
+ return "symbol" == typeof i ? i : String(i);
42
+ }
43
+ function _typeof(o) {
44
+ "@babel/helpers - typeof";
45
+
46
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
47
+ return typeof o;
48
+ } : function (o) {
49
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
50
+ }, _typeof(o);
51
+ }
52
+ function _defineProperty(obj, key, value) {
53
+ key = _toPropertyKey(key);
54
+ if (key in obj) {
55
+ Object.defineProperty(obj, key, {
56
+ value: value,
57
+ enumerable: true,
58
+ configurable: true,
59
+ writable: true
60
+ });
61
+ } else {
62
+ obj[key] = value;
63
+ }
64
+ return obj;
65
+ }
66
+ function _toArray(arr) {
67
+ return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest();
68
+ }
69
+ function _toConsumableArray(arr) {
70
+ return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
71
+ }
72
+ function _arrayWithoutHoles(arr) {
73
+ if (Array.isArray(arr)) return _arrayLikeToArray(arr);
74
+ }
75
+ function _arrayWithHoles(arr) {
76
+ if (Array.isArray(arr)) return arr;
77
+ }
78
+ function _iterableToArray(iter) {
79
+ if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
80
+ }
81
+ function _unsupportedIterableToArray(o, minLen) {
82
+ if (!o) return;
83
+ if (typeof o === "string") return _arrayLikeToArray(o, minLen);
84
+ var n = Object.prototype.toString.call(o).slice(8, -1);
85
+ if (n === "Object" && o.constructor) n = o.constructor.name;
86
+ if (n === "Map" || n === "Set") return Array.from(o);
87
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
88
+ }
89
+ function _arrayLikeToArray(arr, len) {
90
+ if (len == null || len > arr.length) len = arr.length;
91
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
92
+ return arr2;
93
+ }
94
+ function _nonIterableSpread() {
95
+ throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
96
+ }
97
+ function _nonIterableRest() {
98
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
99
+ }
100
+ function _createForOfIteratorHelper(o, allowArrayLike) {
101
+ var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
102
+ if (!it) {
103
+ if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
104
+ if (it) o = it;
105
+ var i = 0;
106
+ var F = function () {};
107
+ return {
108
+ s: F,
109
+ n: function () {
110
+ if (i >= o.length) return {
111
+ done: true
112
+ };
113
+ return {
114
+ done: false,
115
+ value: o[i++]
116
+ };
117
+ },
118
+ e: function (e) {
119
+ throw e;
120
+ },
121
+ f: F
122
+ };
123
+ }
124
+ throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
125
+ }
126
+ var normalCompletion = true,
127
+ didErr = false,
128
+ err;
129
+ return {
130
+ s: function () {
131
+ it = it.call(o);
132
+ },
133
+ n: function () {
134
+ var step = it.next();
135
+ normalCompletion = step.done;
136
+ return step;
137
+ },
138
+ e: function (e) {
139
+ didErr = true;
140
+ err = e;
141
+ },
142
+ f: function () {
143
+ try {
144
+ if (!normalCompletion && it.return != null) it.return();
145
+ } finally {
146
+ if (didErr) throw err;
147
+ }
148
+ }
149
+ };
150
+ }
151
+
152
+ /**
153
+ * Get value of an object property/path even if it's nested
154
+ */
155
+ function getValueByPath(obj, path) {
156
+ return path.split('.').reduce(function (o, i) {
157
+ return o ? o[i] : null;
158
+ }, obj);
159
+ }
160
+
161
+ /**
162
+ * Merge function to replace Object.assign with deep merging possibility
163
+ */
164
+ var isObject = function isObject(item) {
165
+ return _typeof(item) === 'object' && !Array.isArray(item);
166
+ };
167
+ var mergeFn = function mergeFn(target, source) {
168
+ var deep = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
169
+ if (deep || !Object.assign) {
170
+ var isDeep = function isDeep(prop) {
171
+ return isObject(source[prop]) && target !== null && target.hasOwnProperty(prop) && isObject(target[prop]);
172
+ };
173
+ var replaced = Object.getOwnPropertyNames(source).map(function (prop) {
174
+ return _defineProperty({}, prop, isDeep(prop) ? mergeFn(target[prop], source[prop], deep) : source[prop]);
175
+ }).reduce(function (a, b) {
176
+ return _objectSpread2(_objectSpread2({}, a), b);
177
+ }, {});
178
+ return _objectSpread2(_objectSpread2({}, target), replaced);
179
+ } else {
180
+ return Object.assign(target, source);
181
+ }
182
+ };
183
+ var merge = mergeFn;
184
+ function removeElement(el) {
185
+ if (typeof el.remove !== 'undefined') {
186
+ el.remove();
187
+ } else if (typeof el.parentNode !== 'undefined' && el.parentNode !== null) {
188
+ el.parentNode.removeChild(el);
189
+ }
190
+ }
191
+ function createAbsoluteElement(el) {
192
+ var root = document.createElement('div');
193
+ root.style.position = 'absolute';
194
+ root.style.left = '0px';
195
+ root.style.top = '0px';
196
+ root.style.width = '100%';
197
+ var wrapper = document.createElement('div');
198
+ root.appendChild(wrapper);
199
+ wrapper.appendChild(el);
200
+ document.body.appendChild(root);
201
+ return root;
202
+ }
203
+ function isVueComponent(c) {
204
+ return c && c._isVue;
205
+ }
206
+ function toCssWidth(width) {
207
+ return width === undefined ? null : isNaN(width) ? width : width + 'px';
208
+ }
209
+ function isCustomElement(vm) {
210
+ return 'shadowRoot' in vm.$root.$options;
211
+ }
212
+
213
+ var config = {
214
+ defaultContainerElement: null,
215
+ defaultIconPack: 'mdi',
216
+ defaultIconComponent: null,
217
+ defaultIconPrev: 'chevron-left',
218
+ defaultIconNext: 'chevron-right',
219
+ defaultLocale: undefined,
220
+ defaultDialogConfirmText: null,
221
+ defaultDialogCancelText: null,
222
+ defaultSnackbarDuration: 3500,
223
+ defaultSnackbarPosition: null,
224
+ defaultToastDuration: 2000,
225
+ defaultToastPosition: null,
226
+ defaultNotificationDuration: 2000,
227
+ defaultNotificationPosition: null,
228
+ defaultTooltipType: 'is-primary',
229
+ defaultTooltipDelay: null,
230
+ defaultTooltipCloseDelay: null,
231
+ defaultSidebarDelay: null,
232
+ defaultInputAutocomplete: 'on',
233
+ defaultDateFormatter: null,
234
+ defaultDateParser: null,
235
+ defaultDateCreator: null,
236
+ defaultTimeCreator: null,
237
+ defaultDayNames: null,
238
+ defaultMonthNames: null,
239
+ defaultFirstDayOfWeek: null,
240
+ defaultUnselectableDaysOfWeek: null,
241
+ defaultTimeFormatter: null,
242
+ defaultTimeParser: null,
243
+ defaultModalCanCancel: ['escape', 'x', 'outside', 'button'],
244
+ defaultModalScroll: null,
245
+ defaultDatepickerMobileNative: true,
246
+ defaultTimepickerMobileNative: true,
247
+ defaultTimepickerMobileModal: true,
248
+ defaultNoticeQueue: true,
249
+ defaultInputHasCounter: true,
250
+ defaultTaginputHasCounter: true,
251
+ defaultUseHtml5Validation: true,
252
+ defaultDropdownMobileModal: true,
253
+ defaultFieldLabelPosition: null,
254
+ defaultDatepickerYearsRange: [-100, 10],
255
+ defaultDatepickerNearbyMonthDays: true,
256
+ defaultDatepickerNearbySelectableMonthDays: false,
257
+ defaultDatepickerShowWeekNumber: false,
258
+ defaultDatepickerWeekNumberClickable: false,
259
+ defaultDatepickerMobileModal: true,
260
+ defaultTrapFocus: true,
261
+ defaultAutoFocus: true,
262
+ defaultButtonRounded: false,
263
+ defaultSwitchRounded: true,
264
+ defaultCarouselInterval: 3500,
265
+ defaultTabsExpanded: false,
266
+ defaultTabsAnimated: true,
267
+ defaultTabsType: null,
268
+ defaultStatusIcon: true,
269
+ defaultProgrammaticPromise: false,
270
+ defaultLinkTags: ['a', 'button', 'input', 'router-link', 'nuxt-link', 'n-link', 'RouterLink', 'NuxtLink', 'NLink'],
271
+ defaultImageWebpFallback: null,
272
+ defaultImageLazy: true,
273
+ defaultImageResponsive: true,
274
+ defaultImageRatio: null,
275
+ defaultImageSrcsetFormatter: null,
276
+ defaultBreadcrumbTag: 'a',
277
+ defaultBreadcrumbAlign: 'is-left',
278
+ defaultBreadcrumbSeparator: '',
279
+ defaultBreadcrumbSize: 'is-medium',
280
+ customIconPacks: null
281
+ };
282
+
283
+ var FormElementMixin = {
284
+ props: {
285
+ size: String,
286
+ expanded: Boolean,
287
+ loading: Boolean,
288
+ rounded: Boolean,
289
+ icon: String,
290
+ iconPack: String,
291
+ // Native options to use in HTML5 validation
292
+ autocomplete: String,
293
+ maxlength: [Number, String],
294
+ useHtml5Validation: {
295
+ type: Boolean,
296
+ default: function _default() {
297
+ return config.defaultUseHtml5Validation;
298
+ }
299
+ },
300
+ validationMessage: String,
301
+ locale: {
302
+ type: [String, Array],
303
+ default: function _default() {
304
+ return config.defaultLocale;
305
+ }
306
+ },
307
+ statusIcon: {
308
+ type: Boolean,
309
+ default: function _default() {
310
+ return config.defaultStatusIcon;
311
+ }
312
+ }
313
+ },
314
+ data: function data() {
315
+ return {
316
+ isValid: true,
317
+ isFocused: false,
318
+ newIconPack: this.iconPack || config.defaultIconPack
319
+ };
320
+ },
321
+ computed: {
322
+ /**
323
+ * Find parent Field, max 3 levels deep.
324
+ */
325
+ parentField: function parentField() {
326
+ var parent = this.$parent;
327
+ for (var i = 0; i < 3; i++) {
328
+ if (parent && !parent.$data._isField) {
329
+ parent = parent.$parent;
330
+ }
331
+ }
332
+ return parent;
333
+ },
334
+ /**
335
+ * Get the type prop from parent if it's a Field.
336
+ */
337
+ statusType: function statusType() {
338
+ var _ref = this.parentField || {},
339
+ newType = _ref.newType;
340
+ if (!newType) return;
341
+ if (typeof newType === 'string') {
342
+ return newType;
343
+ } else {
344
+ for (var key in newType) {
345
+ if (newType[key]) {
346
+ return key;
347
+ }
348
+ }
349
+ }
350
+ },
351
+ /**
352
+ * Get the message prop from parent if it's a Field.
353
+ */
354
+ statusMessage: function statusMessage() {
355
+ if (!this.parentField) return;
356
+ return this.parentField.newMessage || this.parentField.$slots.message;
357
+ },
358
+ /**
359
+ * Fix icon size for inputs, large was too big
360
+ */
361
+ iconSize: function iconSize() {
362
+ switch (this.size) {
363
+ case 'is-small':
364
+ return this.size;
365
+ case 'is-medium':
366
+ return;
367
+ case 'is-large':
368
+ return this.newIconPack === 'mdi' ? 'is-medium' : '';
369
+ }
370
+ }
371
+ },
372
+ methods: {
373
+ /**
374
+ * Focus method that work dynamically depending on the component.
375
+ */
376
+ focus: function focus() {
377
+ var el = this.getElement();
378
+ if (el === undefined) return;
379
+ this.$nextTick(function () {
380
+ if (el) el.focus();
381
+ });
382
+ },
383
+ onBlur: function onBlur($event) {
384
+ this.isFocused = false;
385
+ this.$emit('blur', $event);
386
+ this.checkHtml5Validity();
387
+ },
388
+ onFocus: function onFocus($event) {
389
+ this.isFocused = true;
390
+ this.$emit('focus', $event);
391
+ },
392
+ getElement: function getElement() {
393
+ var el = this.$refs[this.$data._elementRef];
394
+ while (isVueComponent(el)) {
395
+ el = el.$refs[el.$data._elementRef];
396
+ }
397
+ return el;
398
+ },
399
+ setInvalid: function setInvalid() {
400
+ var type = 'is-danger';
401
+ var message = this.validationMessage || this.getElement().validationMessage;
402
+ this.setValidity(type, message);
403
+ },
404
+ setValidity: function setValidity(type, message) {
405
+ var _this = this;
406
+ this.$nextTick(function () {
407
+ if (_this.parentField) {
408
+ // Set type only if not defined
409
+ if (!_this.parentField.type) {
410
+ _this.parentField.newType = type;
411
+ }
412
+ // Set message only if not defined
413
+ if (!_this.parentField.message) {
414
+ _this.parentField.newMessage = message;
415
+ }
416
+ }
417
+ });
418
+ },
419
+ /**
420
+ * Check HTML5 validation, set isValid property.
421
+ * If validation fail, send 'is-danger' type,
422
+ * and error message to parent if it's a Field.
423
+ */
424
+ checkHtml5Validity: function checkHtml5Validity() {
425
+ if (!this.useHtml5Validation) return;
426
+ var el = this.getElement();
427
+ if (el === undefined) return;
428
+ if (!el.checkValidity()) {
429
+ this.setInvalid();
430
+ this.isValid = false;
431
+ } else {
432
+ this.setValidity(null, null);
433
+ this.isValid = true;
434
+ }
435
+ return this.isValid;
436
+ }
437
+ }
438
+ };
439
+
440
+ var mdiIcons = {
441
+ sizes: {
442
+ 'default': 'mdi-24px',
443
+ 'is-small': null,
444
+ 'is-medium': 'mdi-36px',
445
+ 'is-large': 'mdi-48px'
446
+ },
447
+ iconPrefix: 'mdi-'
448
+ };
449
+ var faIcons = function faIcons() {
450
+ var faIconPrefix = config && config.defaultIconComponent ? '' : 'fa-';
451
+ return {
452
+ sizes: {
453
+ 'default': null,
454
+ 'is-small': null,
455
+ 'is-medium': faIconPrefix + 'lg',
456
+ 'is-large': faIconPrefix + '2x'
457
+ },
458
+ iconPrefix: faIconPrefix,
459
+ internalIcons: {
460
+ 'information': 'info-circle',
461
+ 'alert': 'exclamation-triangle',
462
+ 'alert-circle': 'exclamation-circle',
463
+ 'chevron-right': 'angle-right',
464
+ 'chevron-left': 'angle-left',
465
+ 'chevron-down': 'angle-down',
466
+ 'eye-off': 'eye-slash',
467
+ 'menu-down': 'caret-down',
468
+ 'menu-up': 'caret-up',
469
+ 'close-circle': 'times-circle'
470
+ }
471
+ };
472
+ };
473
+ var getIcons = function getIcons() {
474
+ var icons = {
475
+ mdi: mdiIcons,
476
+ fa: faIcons(),
477
+ fas: faIcons(),
478
+ far: faIcons(),
479
+ fad: faIcons(),
480
+ fab: faIcons(),
481
+ fal: faIcons(),
482
+ 'fa-solid': faIcons(),
483
+ 'fa-regular': faIcons(),
484
+ 'fa-light': faIcons(),
485
+ 'fa-thin': faIcons(),
486
+ 'fa-duotone': faIcons(),
487
+ 'fa-brands': faIcons()
488
+ };
489
+ if (config && config.customIconPacks) {
490
+ icons = merge(icons, config.customIconPacks, true);
491
+ }
492
+ return icons;
493
+ };
494
+ var getIcons$1 = getIcons;
495
+
496
+ var script$2 = {
497
+ name: 'BIcon',
498
+ props: {
499
+ type: [String, Object],
500
+ component: String,
501
+ pack: String,
502
+ icon: String,
503
+ size: String,
504
+ customSize: String,
505
+ customClass: String,
506
+ both: Boolean // This is used internally to show both MDI and FA icon
507
+ },
508
+ computed: {
509
+ iconConfig: function iconConfig() {
510
+ var allIcons = getIcons$1();
511
+ return allIcons[this.newPack];
512
+ },
513
+ iconPrefix: function iconPrefix() {
514
+ if (this.iconConfig && this.iconConfig.iconPrefix) {
515
+ return this.iconConfig.iconPrefix;
516
+ }
517
+ return '';
518
+ },
519
+ /**
520
+ * Internal icon name based on the pack.
521
+ * If pack is 'fa', gets the equivalent FA icon name of the MDI,
522
+ * internal icons are always MDI.
523
+ */
524
+ newIcon: function newIcon() {
525
+ return "".concat(this.iconPrefix).concat(this.getEquivalentIconOf(this.icon));
526
+ },
527
+ newPack: function newPack() {
528
+ return this.pack || config.defaultIconPack;
529
+ },
530
+ newType: function newType() {
531
+ if (!this.type) return;
532
+ var splitType = [];
533
+ if (typeof this.type === 'string') {
534
+ splitType = this.type.split('-');
535
+ } else {
536
+ for (var key in this.type) {
537
+ if (this.type[key]) {
538
+ splitType = key.split('-');
539
+ break;
540
+ }
541
+ }
542
+ }
543
+ if (splitType.length <= 1) return;
544
+ var _splitType = splitType,
545
+ _splitType2 = _toArray(_splitType),
546
+ type = _splitType2.slice(1);
547
+ return "has-text-".concat(type.join('-'));
548
+ },
549
+ newCustomSize: function newCustomSize() {
550
+ return this.customSize || this.customSizeByPack;
551
+ },
552
+ customSizeByPack: function customSizeByPack() {
553
+ if (this.iconConfig && this.iconConfig.sizes) {
554
+ if (this.size && this.iconConfig.sizes[this.size] !== undefined) {
555
+ return this.iconConfig.sizes[this.size];
556
+ } else if (this.iconConfig.sizes.default) {
557
+ return this.iconConfig.sizes.default;
558
+ }
559
+ }
560
+ return null;
561
+ },
562
+ useIconComponent: function useIconComponent() {
563
+ return this.component || config.defaultIconComponent;
564
+ }
565
+ },
566
+ methods: {
567
+ /**
568
+ * Equivalent icon name of the MDI.
569
+ */
570
+ getEquivalentIconOf: function getEquivalentIconOf(value) {
571
+ // Only transform the class if the both prop is set to true
572
+ if (!this.both) {
573
+ return value;
574
+ }
575
+ if (this.iconConfig && this.iconConfig.internalIcons && this.iconConfig.internalIcons[value]) {
576
+ return this.iconConfig.internalIcons[value];
577
+ }
578
+ return value;
579
+ }
580
+ }
581
+ };
582
+
583
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
584
+ if (typeof shadowMode !== 'boolean') {
585
+ createInjectorSSR = createInjector;
586
+ createInjector = shadowMode;
587
+ shadowMode = false;
588
+ }
589
+ // Vue.extend constructor export interop.
590
+ const options = typeof script === 'function' ? script.options : script;
591
+ // render functions
592
+ if (template && template.render) {
593
+ options.render = template.render;
594
+ options.staticRenderFns = template.staticRenderFns;
595
+ options._compiled = true;
596
+ // functional template
597
+ if (isFunctionalTemplate) {
598
+ options.functional = true;
599
+ }
600
+ }
601
+ // scopedId
602
+ if (scopeId) {
603
+ options._scopeId = scopeId;
604
+ }
605
+ let hook;
606
+ if (moduleIdentifier) {
607
+ // server build
608
+ hook = function (context) {
609
+ // 2.3 injection
610
+ context =
611
+ context || // cached call
612
+ (this.$vnode && this.$vnode.ssrContext) || // stateful
613
+ (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext); // functional
614
+ // 2.2 with runInNewContext: true
615
+ if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {
616
+ context = __VUE_SSR_CONTEXT__;
617
+ }
618
+ // inject component styles
619
+ if (style) {
620
+ style.call(this, createInjectorSSR(context));
621
+ }
622
+ // register component module identifier for async chunk inference
623
+ if (context && context._registeredComponents) {
624
+ context._registeredComponents.add(moduleIdentifier);
625
+ }
626
+ };
627
+ // used by ssr in case component is cached and beforeCreate
628
+ // never gets called
629
+ options._ssrRegister = hook;
630
+ }
631
+ else if (style) {
632
+ hook = shadowMode
633
+ ? function (context) {
634
+ style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
635
+ }
636
+ : function (context) {
637
+ style.call(this, createInjector(context));
638
+ };
639
+ }
640
+ if (hook) {
641
+ if (options.functional) {
642
+ // register for functional component in vue file
643
+ const originalRender = options.render;
644
+ options.render = function renderWithStyleInjection(h, context) {
645
+ hook.call(context);
646
+ return originalRender(h, context);
647
+ };
648
+ }
649
+ else {
650
+ // inject component registration as beforeCreate hook
651
+ const existing = options.beforeCreate;
652
+ options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
653
+ }
654
+ }
655
+ return script;
656
+ }
657
+
658
+ /* script */
659
+ const __vue_script__$2 = script$2;
660
+
661
+ /* template */
662
+ 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)};
663
+ var __vue_staticRenderFns__$2 = [];
664
+
665
+ /* style */
666
+ const __vue_inject_styles__$2 = undefined;
667
+ /* scoped */
668
+ const __vue_scope_id__$2 = undefined;
669
+ /* module identifier */
670
+ const __vue_module_identifier__$2 = undefined;
671
+ /* functional template */
672
+ const __vue_is_functional_template__$2 = false;
673
+ /* style inject */
674
+
675
+ /* style inject SSR */
676
+
677
+ /* style inject shadow dom */
678
+
679
+
680
+
681
+ const __vue_component__$2 = /*#__PURE__*/normalizeComponent(
682
+ { render: __vue_render__$2, staticRenderFns: __vue_staticRenderFns__$2 },
683
+ __vue_inject_styles__$2,
684
+ __vue_script__$2,
685
+ __vue_scope_id__$2,
686
+ __vue_is_functional_template__$2,
687
+ __vue_module_identifier__$2,
688
+ false,
689
+ undefined,
690
+ undefined,
691
+ undefined
692
+ );
693
+
694
+ var Icon = __vue_component__$2;
695
+
696
+ var script$1 = {
697
+ name: 'BInput',
698
+ components: _defineProperty({}, Icon.name, Icon),
699
+ mixins: [FormElementMixin],
700
+ inheritAttrs: false,
701
+ props: {
702
+ value: [Number, String],
703
+ type: {
704
+ type: String,
705
+ default: 'text'
706
+ },
707
+ lazy: {
708
+ type: Boolean,
709
+ default: false
710
+ },
711
+ passwordReveal: Boolean,
712
+ iconClickable: Boolean,
713
+ hasCounter: {
714
+ type: Boolean,
715
+ default: function _default() {
716
+ return config.defaultInputHasCounter;
717
+ }
718
+ },
719
+ customClass: {
720
+ type: String,
721
+ default: ''
722
+ },
723
+ iconRight: String,
724
+ iconRightClickable: Boolean,
725
+ iconRightType: String
726
+ },
727
+ data: function data() {
728
+ return {
729
+ newValue: this.value,
730
+ newType: this.type,
731
+ newAutocomplete: this.autocomplete || config.defaultInputAutocomplete,
732
+ isPasswordVisible: false,
733
+ _elementRef: this.type === 'textarea' ? 'textarea' : 'input'
734
+ };
735
+ },
736
+ computed: {
737
+ computedValue: {
738
+ get: function get() {
739
+ return this.newValue;
740
+ },
741
+ set: function set(value) {
742
+ this.newValue = value;
743
+ this.$emit('input', value);
744
+ }
745
+ },
746
+ rootClasses: function rootClasses() {
747
+ return [this.iconPosition, this.size, {
748
+ 'is-expanded': this.expanded,
749
+ 'is-loading': this.loading,
750
+ 'is-clearfix': !this.hasMessage
751
+ }];
752
+ },
753
+ inputClasses: function inputClasses() {
754
+ return [this.statusType, this.size, {
755
+ 'is-rounded': this.rounded
756
+ }];
757
+ },
758
+ hasIconRight: function hasIconRight() {
759
+ return this.passwordReveal || this.loading || this.statusIcon && this.statusTypeIcon || this.iconRight;
760
+ },
761
+ rightIcon: function rightIcon() {
762
+ if (this.passwordReveal) {
763
+ return this.passwordVisibleIcon;
764
+ } else if (this.iconRight) {
765
+ return this.iconRight;
766
+ }
767
+ return this.statusTypeIcon;
768
+ },
769
+ rightIconType: function rightIconType() {
770
+ if (this.passwordReveal) {
771
+ return 'is-primary';
772
+ } else if (this.iconRight) {
773
+ return this.iconRightType || null;
774
+ }
775
+ return this.statusType;
776
+ },
777
+ /**
778
+ * Position of the icon or if it's both sides.
779
+ */
780
+ iconPosition: function iconPosition() {
781
+ var iconClasses = '';
782
+ if (this.icon) {
783
+ iconClasses += 'has-icons-left ';
784
+ }
785
+ if (this.hasIconRight) {
786
+ iconClasses += 'has-icons-right';
787
+ }
788
+ return iconClasses;
789
+ },
790
+ /**
791
+ * Icon name (MDI) based on the type.
792
+ */
793
+ statusTypeIcon: function statusTypeIcon() {
794
+ switch (this.statusType) {
795
+ case 'is-success':
796
+ return 'check';
797
+ case 'is-danger':
798
+ return 'alert-circle';
799
+ case 'is-info':
800
+ return 'information';
801
+ case 'is-warning':
802
+ return 'alert';
803
+ }
804
+ },
805
+ /**
806
+ * Check if have any message prop from parent if it's a Field.
807
+ */
808
+ hasMessage: function hasMessage() {
809
+ return !!this.statusMessage;
810
+ },
811
+ /**
812
+ * Current password-reveal icon name.
813
+ */
814
+ passwordVisibleIcon: function passwordVisibleIcon() {
815
+ return !this.isPasswordVisible ? 'eye' : 'eye-off';
816
+ },
817
+ /**
818
+ * Get value length
819
+ */
820
+ valueLength: function valueLength() {
821
+ if (typeof this.computedValue === 'string') {
822
+ return Array.from(this.computedValue).length;
823
+ } else if (typeof this.computedValue === 'number') {
824
+ return this.computedValue.toString().length;
825
+ }
826
+ return 0;
827
+ }
828
+ },
829
+ watch: {
830
+ /**
831
+ * When v-model is changed:
832
+ * 1. Set internal value.
833
+ * 2. Validate it if the value came from outside;
834
+ * i.e., not equal to computedValue
835
+ */
836
+ value: function value(_value) {
837
+ var _this = this;
838
+ var fromOutside = this.computedValue != _value; // eslint-disable-line eqeqeq
839
+ this.newValue = _value;
840
+ if (fromOutside) {
841
+ // validation must wait for DOM updated
842
+ this.$nextTick(function () {
843
+ !_this.isValid && _this.checkHtml5Validity();
844
+ });
845
+ }
846
+ },
847
+ type: function type(_type) {
848
+ this.newType = _type;
849
+ }
850
+ },
851
+ methods: {
852
+ /**
853
+ * Toggle the visibility of a password-reveal input
854
+ * by changing the type and focus the input right away.
855
+ */
856
+ togglePasswordVisibility: function togglePasswordVisibility() {
857
+ var _this2 = this;
858
+ this.isPasswordVisible = !this.isPasswordVisible;
859
+ this.newType = this.isPasswordVisible ? 'text' : 'password';
860
+ this.$nextTick(function () {
861
+ _this2.focus();
862
+ });
863
+ },
864
+ iconClick: function iconClick(emit, event) {
865
+ var _this3 = this;
866
+ this.$emit(emit, event);
867
+ this.$nextTick(function () {
868
+ _this3.focus();
869
+ });
870
+ },
871
+ rightIconClick: function rightIconClick(event) {
872
+ if (this.passwordReveal) {
873
+ this.togglePasswordVisibility();
874
+ } else if (this.iconRightClickable) {
875
+ this.iconClick('icon-right-click', event);
876
+ }
877
+ },
878
+ onInput: function onInput(event) {
879
+ if (!this.lazy) {
880
+ var value = event.target.value;
881
+ this.updateValue(value);
882
+ }
883
+ },
884
+ onChange: function onChange(event) {
885
+ if (this.lazy) {
886
+ var value = event.target.value;
887
+ this.updateValue(value);
888
+ }
889
+ },
890
+ updateValue: function updateValue(value) {
891
+ this.computedValue = value;
892
+ !this.isValid && this.checkHtml5Validity();
893
+ }
894
+ }
895
+ };
896
+
897
+ /* script */
898
+ const __vue_script__$1 = script$1;
899
+
900
+ /* template */
901
+ var __vue_render__$1 = 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)};
902
+ var __vue_staticRenderFns__$1 = [];
903
+
904
+ /* style */
905
+ const __vue_inject_styles__$1 = undefined;
906
+ /* scoped */
907
+ const __vue_scope_id__$1 = undefined;
908
+ /* module identifier */
909
+ const __vue_module_identifier__$1 = undefined;
910
+ /* functional template */
911
+ const __vue_is_functional_template__$1 = false;
912
+ /* style inject */
913
+
914
+ /* style inject SSR */
915
+
916
+ /* style inject shadow dom */
917
+
918
+
919
+
920
+ const __vue_component__$1 = /*#__PURE__*/normalizeComponent(
921
+ { render: __vue_render__$1, staticRenderFns: __vue_staticRenderFns__$1 },
922
+ __vue_inject_styles__$1,
923
+ __vue_script__$1,
924
+ __vue_scope_id__$1,
925
+ __vue_is_functional_template__$1,
926
+ __vue_module_identifier__$1,
927
+ false,
928
+ undefined,
929
+ undefined,
930
+ undefined
931
+ );
932
+
933
+ var Input = __vue_component__$1;
934
+
935
+ var script = {
936
+ name: 'BAutocomplete',
937
+ components: _defineProperty({}, Input.name, Input),
938
+ mixins: [FormElementMixin],
939
+ inheritAttrs: false,
940
+ props: {
941
+ value: [Number, String],
942
+ data: {
943
+ type: Array,
944
+ default: function _default() {
945
+ return [];
946
+ }
947
+ },
948
+ field: {
949
+ type: String,
950
+ default: 'value'
951
+ },
952
+ keepFirst: Boolean,
953
+ clearOnSelect: Boolean,
954
+ openOnFocus: Boolean,
955
+ customFormatter: Function,
956
+ checkInfiniteScroll: Boolean,
957
+ keepOpen: Boolean,
958
+ selectOnClickOutside: Boolean,
959
+ clearable: Boolean,
960
+ maxHeight: [String, Number],
961
+ dropdownPosition: {
962
+ type: String,
963
+ default: 'auto'
964
+ },
965
+ groupField: String,
966
+ groupOptions: String,
967
+ iconRight: String,
968
+ iconRightClickable: Boolean,
969
+ appendToBody: Boolean,
970
+ type: {
971
+ type: String,
972
+ default: 'text'
973
+ },
974
+ confirmKeys: {
975
+ type: Array,
976
+ default: function _default() {
977
+ return ['Tab', 'Enter'];
978
+ }
979
+ },
980
+ selectableHeader: Boolean,
981
+ selectableFooter: Boolean
982
+ },
983
+ data: function data() {
984
+ return {
985
+ selected: null,
986
+ hovered: null,
987
+ headerHovered: null,
988
+ footerHovered: null,
989
+ isActive: false,
990
+ newValue: this.value,
991
+ newAutocomplete: this.autocomplete || 'off',
992
+ ariaAutocomplete: this.keepFirst ? 'both' : 'list',
993
+ isListInViewportVertically: true,
994
+ hasFocus: false,
995
+ style: {},
996
+ _isAutocomplete: true,
997
+ _elementRef: 'input',
998
+ _bodyEl: undefined,
999
+ // Used to append to body
1000
+ timeOutID: null
1001
+ };
1002
+ },
1003
+ computed: {
1004
+ computedData: function computedData() {
1005
+ var _this = this;
1006
+ if (this.groupField) {
1007
+ if (this.groupOptions) {
1008
+ var newData = [];
1009
+ this.data.forEach(function (option) {
1010
+ var group = getValueByPath(option, _this.groupField);
1011
+ var items = getValueByPath(option, _this.groupOptions);
1012
+ newData.push({
1013
+ group: group,
1014
+ items: items
1015
+ });
1016
+ });
1017
+ return newData;
1018
+ } else {
1019
+ var tmp = {};
1020
+ this.data.forEach(function (option) {
1021
+ var group = getValueByPath(option, _this.groupField);
1022
+ if (!tmp[group]) tmp[group] = [];
1023
+ tmp[group].push(option);
1024
+ });
1025
+ var _newData = [];
1026
+ Object.keys(tmp).forEach(function (group) {
1027
+ _newData.push({
1028
+ group: group,
1029
+ items: tmp[group]
1030
+ });
1031
+ });
1032
+ return _newData;
1033
+ }
1034
+ }
1035
+ return [{
1036
+ items: this.data
1037
+ }];
1038
+ },
1039
+ isEmpty: function isEmpty() {
1040
+ if (!this.computedData) return true;
1041
+ return !this.computedData.some(function (element) {
1042
+ return element.items && element.items.length;
1043
+ });
1044
+ },
1045
+ /**
1046
+ * White-listed items to not close when clicked.
1047
+ * Add input, dropdown and all children.
1048
+ */
1049
+ whiteList: function whiteList() {
1050
+ var whiteList = [];
1051
+ whiteList.push(this.$refs.input.$el.querySelector('input'));
1052
+ whiteList.push(this.$refs.dropdown);
1053
+ // Add all children from dropdown
1054
+ if (this.$refs.dropdown !== undefined) {
1055
+ var children = this.$refs.dropdown.querySelectorAll('*');
1056
+ var _iterator = _createForOfIteratorHelper(children),
1057
+ _step;
1058
+ try {
1059
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
1060
+ var child = _step.value;
1061
+ whiteList.push(child);
1062
+ }
1063
+ } catch (err) {
1064
+ _iterator.e(err);
1065
+ } finally {
1066
+ _iterator.f();
1067
+ }
1068
+ }
1069
+ if (this.$parent.$data._isTaginput) {
1070
+ // Add taginput container
1071
+ whiteList.push(this.$parent.$el);
1072
+ // Add .tag and .delete
1073
+ var tagInputChildren = this.$parent.$el.querySelectorAll('*');
1074
+ var _iterator2 = _createForOfIteratorHelper(tagInputChildren),
1075
+ _step2;
1076
+ try {
1077
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
1078
+ var tagInputChild = _step2.value;
1079
+ whiteList.push(tagInputChild);
1080
+ }
1081
+ } catch (err) {
1082
+ _iterator2.e(err);
1083
+ } finally {
1084
+ _iterator2.f();
1085
+ }
1086
+ }
1087
+ return whiteList;
1088
+ },
1089
+ /**
1090
+ * Check if exists default slot
1091
+ */
1092
+ hasDefaultSlot: function hasDefaultSlot() {
1093
+ return !!this.$scopedSlots.default;
1094
+ },
1095
+ /**
1096
+ * Check if exists group slot
1097
+ */
1098
+ hasGroupSlot: function hasGroupSlot() {
1099
+ return !!this.$scopedSlots.group;
1100
+ },
1101
+ /**
1102
+ * Check if exists "empty" slot
1103
+ */
1104
+ hasEmptySlot: function hasEmptySlot() {
1105
+ return !!this.$slots.empty;
1106
+ },
1107
+ /**
1108
+ * Check if exists "header" slot
1109
+ */
1110
+ hasHeaderSlot: function hasHeaderSlot() {
1111
+ return !!this.$slots.header;
1112
+ },
1113
+ /**
1114
+ * Check if exists "footer" slot
1115
+ */
1116
+ hasFooterSlot: function hasFooterSlot() {
1117
+ return !!this.$slots.footer;
1118
+ },
1119
+ /**
1120
+ * Apply dropdownPosition property
1121
+ */
1122
+ isOpenedTop: function isOpenedTop() {
1123
+ return this.dropdownPosition === 'top' || this.dropdownPosition === 'auto' && !this.isListInViewportVertically;
1124
+ },
1125
+ newIconRight: function newIconRight() {
1126
+ if (this.clearable && this.newValue) {
1127
+ return 'close-circle';
1128
+ }
1129
+ return this.iconRight;
1130
+ },
1131
+ newIconRightClickable: function newIconRightClickable() {
1132
+ if (this.clearable) {
1133
+ return true;
1134
+ }
1135
+ return this.iconRightClickable;
1136
+ },
1137
+ contentStyle: function contentStyle() {
1138
+ return {
1139
+ maxHeight: toCssWidth(this.maxHeight)
1140
+ };
1141
+ }
1142
+ },
1143
+ watch: {
1144
+ /**
1145
+ * When dropdown is toggled, check the visibility to know when
1146
+ * to open upwards.
1147
+ */
1148
+ isActive: function isActive(active) {
1149
+ var _this2 = this;
1150
+ if (this.dropdownPosition === 'auto') {
1151
+ if (active) {
1152
+ this.calcDropdownInViewportVertical();
1153
+ } else {
1154
+ // Timeout to wait for the animation to finish before recalculating
1155
+ this.timeOutID = setTimeout(function () {
1156
+ _this2.calcDropdownInViewportVertical();
1157
+ }, 100);
1158
+ }
1159
+ }
1160
+ this.$nextTick(function () {
1161
+ _this2.$emit('active', active);
1162
+ });
1163
+ },
1164
+ /**
1165
+ * When checkInfiniteScroll property changes scroll event should be removed or added
1166
+ */
1167
+ checkInfiniteScroll: function checkInfiniteScroll(_checkInfiniteScroll) {
1168
+ if ((this.$refs.dropdown && this.$refs.dropdown.querySelector('.dropdown-content')) === false) return;
1169
+ var list = this.$refs.dropdown.querySelector('.dropdown-content');
1170
+ if (_checkInfiniteScroll === true) {
1171
+ list.addEventListener('scroll', this.checkIfReachedTheEndOfScroll);
1172
+ return;
1173
+ }
1174
+ list.removeEventListener('scroll', this.checkIfReachedTheEndOfScroll);
1175
+ },
1176
+ /**
1177
+ * When updating input's value
1178
+ * 1. Emit changes
1179
+ * 2. If value isn't the same as selected, set null
1180
+ * 3. Close dropdown if value is clear or else open it
1181
+ */
1182
+ newValue: function newValue(value) {
1183
+ this.$emit('input', value);
1184
+ // Check if selected is invalid
1185
+ var currentValue = this.getValue(this.selected);
1186
+ if (currentValue && currentValue !== value) {
1187
+ this.setSelected(null, false);
1188
+ }
1189
+ // Close dropdown if input is clear or else open it
1190
+ if (this.hasFocus && (!this.openOnFocus || value)) {
1191
+ this.isActive = !!value;
1192
+ }
1193
+ },
1194
+ /**
1195
+ * When v-model is changed:
1196
+ * 1. Update internal value.
1197
+ * 2. If it's invalid, validate again.
1198
+ */
1199
+ value: function value(_value) {
1200
+ this.newValue = _value;
1201
+ },
1202
+ /**
1203
+ * Select first option if "keep-first
1204
+ */
1205
+ data: function data() {
1206
+ var _this3 = this;
1207
+ // Keep first option always pre-selected
1208
+ if (this.keepFirst) {
1209
+ this.$nextTick(function () {
1210
+ if (_this3.isActive) {
1211
+ _this3.selectFirstOption(_this3.computedData);
1212
+ } else {
1213
+ _this3.setHovered(null);
1214
+ }
1215
+ });
1216
+ } else {
1217
+ if (this.hovered) {
1218
+ // reset hovered if list doesn't contain it
1219
+ var hoveredValue = this.getValue(this.hovered);
1220
+ var data = this.computedData.map(function (d) {
1221
+ return d.items;
1222
+ }).reduce(function (a, b) {
1223
+ return [].concat(_toConsumableArray(a), _toConsumableArray(b));
1224
+ }, []);
1225
+ if (!data.some(function (d) {
1226
+ return _this3.getValue(d) === hoveredValue;
1227
+ })) {
1228
+ this.setHovered(null);
1229
+ }
1230
+ }
1231
+ }
1232
+ }
1233
+ },
1234
+ methods: {
1235
+ /**
1236
+ * Set which option is currently hovered.
1237
+ */
1238
+ setHovered: function setHovered(option) {
1239
+ if (option === undefined) return;
1240
+ this.hovered = option;
1241
+ },
1242
+ /**
1243
+ * Set which option is currently selected, update v-model,
1244
+ * update input value and close dropdown.
1245
+ */
1246
+ setSelected: function setSelected(option) {
1247
+ var _this4 = this;
1248
+ var closeDropdown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1249
+ var event = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
1250
+ if (option === undefined) return;
1251
+ this.selected = option;
1252
+ this.$emit('select', this.selected, event);
1253
+ if (this.selected !== null) {
1254
+ if (this.clearOnSelect) {
1255
+ var input = this.$refs.input;
1256
+ input.newValue = '';
1257
+ input.$refs.input.value = '';
1258
+ } else {
1259
+ this.newValue = this.getValue(this.selected);
1260
+ }
1261
+ this.setHovered(null);
1262
+ }
1263
+ closeDropdown && this.$nextTick(function () {
1264
+ _this4.isActive = false;
1265
+ });
1266
+ this.checkValidity();
1267
+ },
1268
+ /**
1269
+ * Select first option
1270
+ */
1271
+ selectFirstOption: function selectFirstOption(computedData) {
1272
+ var _this5 = this;
1273
+ this.$nextTick(function () {
1274
+ var nonEmptyElements = computedData.filter(function (element) {
1275
+ return element.items && element.items.length;
1276
+ });
1277
+ if (nonEmptyElements.length) {
1278
+ var option = nonEmptyElements[0].items[0];
1279
+ _this5.setHovered(option);
1280
+ } else {
1281
+ _this5.setHovered(null);
1282
+ }
1283
+ });
1284
+ },
1285
+ keydown: function keydown(event) {
1286
+ var key = event.key; // cannot destructure preventDefault (https://stackoverflow.com/a/49616808/2774496)
1287
+ // prevent emit submit event
1288
+ if (key === 'Enter') event.preventDefault();
1289
+ // Close dropdown on Tab & no hovered
1290
+ if (key === 'Escape' || key === 'Tab') {
1291
+ this.isActive = false;
1292
+ }
1293
+ if (this.confirmKeys.indexOf(key) >= 0) {
1294
+ // If adding by comma, don't add the comma to the input
1295
+ if (key === ',') event.preventDefault();
1296
+ // Close dropdown on select by Tab
1297
+ var closeDropdown = !this.keepOpen || key === 'Tab';
1298
+ if (this.hovered === null) {
1299
+ // header and footer uses headerHovered && footerHovered. If header or footer
1300
+ // was selected then fire event otherwise just return so a value isn't selected
1301
+ this.checkIfHeaderOrFooterSelected(event, null, closeDropdown);
1302
+ return;
1303
+ }
1304
+ this.setSelected(this.hovered, closeDropdown, event);
1305
+ }
1306
+ },
1307
+ selectHeaderOrFoterByClick: function selectHeaderOrFoterByClick(event, origin) {
1308
+ this.checkIfHeaderOrFooterSelected(event, {
1309
+ origin: origin
1310
+ });
1311
+ },
1312
+ /**
1313
+ * Check if header or footer was selected.
1314
+ */
1315
+ checkIfHeaderOrFooterSelected: function checkIfHeaderOrFooterSelected(event, triggerClick) {
1316
+ var closeDropdown = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
1317
+ if (this.selectableHeader && (this.headerHovered || triggerClick && triggerClick.origin === 'header')) {
1318
+ this.$emit('select-header', event);
1319
+ this.headerHovered = false;
1320
+ if (triggerClick) this.setHovered(null);
1321
+ if (closeDropdown) this.isActive = false;
1322
+ }
1323
+ if (this.selectableFooter && (this.footerHovered || triggerClick && triggerClick.origin === 'footer')) {
1324
+ this.$emit('select-footer', event);
1325
+ this.footerHovered = false;
1326
+ if (triggerClick) this.setHovered(null);
1327
+ if (closeDropdown) this.isActive = false;
1328
+ }
1329
+ },
1330
+ /**
1331
+ * Close dropdown if clicked outside.
1332
+ */
1333
+ clickedOutside: function clickedOutside(event) {
1334
+ var target = isCustomElement(this) ? event.composedPath()[0] : event.target;
1335
+ if (!this.hasFocus && this.whiteList.indexOf(target) < 0) {
1336
+ if (this.keepFirst && this.hovered && this.selectOnClickOutside) {
1337
+ this.setSelected(this.hovered, true);
1338
+ } else {
1339
+ this.isActive = false;
1340
+ }
1341
+ }
1342
+ },
1343
+ /**
1344
+ * Return display text for the input.
1345
+ * If object, get value from path, or else just the value.
1346
+ */
1347
+ getValue: function getValue(option) {
1348
+ if (option === null) return;
1349
+ if (typeof this.customFormatter !== 'undefined') {
1350
+ return this.customFormatter(option);
1351
+ }
1352
+ return _typeof(option) === 'object' ? getValueByPath(option, this.field) : option;
1353
+ },
1354
+ /**
1355
+ * Check if the scroll list inside the dropdown
1356
+ * reached it's end.
1357
+ */
1358
+ checkIfReachedTheEndOfScroll: function checkIfReachedTheEndOfScroll() {
1359
+ var list = this.$refs.dropdown.querySelector('.dropdown-content');
1360
+ var footerHeight = this.hasFooterSlot ? list.querySelectorAll('div.dropdown-footer')[0].clientHeight : 0;
1361
+ if (list.clientHeight !== list.scrollHeight && list.scrollTop + list.parentElement.clientHeight + footerHeight >= list.scrollHeight) {
1362
+ this.$emit('infinite-scroll');
1363
+ }
1364
+ },
1365
+ /**
1366
+ * Calculate if the dropdown is vertically visible when activated,
1367
+ * otherwise it is openened upwards.
1368
+ */
1369
+ calcDropdownInViewportVertical: function calcDropdownInViewportVertical() {
1370
+ var _this6 = this;
1371
+ this.$nextTick(function () {
1372
+ /**
1373
+ * this.$refs.dropdown may be undefined
1374
+ * when Autocomplete is conditional rendered
1375
+ */
1376
+ if (_this6.$refs.dropdown === undefined) return;
1377
+ var rect = _this6.$refs.dropdown.getBoundingClientRect();
1378
+ _this6.isListInViewportVertically = rect.top >= 0 && rect.bottom <= (window.innerHeight || document.documentElement.clientHeight);
1379
+ if (_this6.appendToBody) {
1380
+ _this6.updateAppendToBody();
1381
+ }
1382
+ });
1383
+ },
1384
+ /**
1385
+ * Arrows keys listener.
1386
+ * If dropdown is active, set hovered option, or else just open.
1387
+ */
1388
+ keyArrows: function keyArrows(direction) {
1389
+ var sum = direction === 'down' ? 1 : -1;
1390
+ if (this.isActive) {
1391
+ var data = this.computedData.map(function (d) {
1392
+ return d.items;
1393
+ }).reduce(function (a, b) {
1394
+ return [].concat(_toConsumableArray(a), _toConsumableArray(b));
1395
+ }, []);
1396
+ if (this.hasHeaderSlot && this.selectableHeader) {
1397
+ data.unshift(undefined);
1398
+ }
1399
+ if (this.hasFooterSlot && this.selectableFooter) {
1400
+ data.push(undefined);
1401
+ }
1402
+ var index;
1403
+ if (this.headerHovered) {
1404
+ index = 0 + sum;
1405
+ } else if (this.footerHovered) {
1406
+ index = data.length - 1 + sum;
1407
+ } else {
1408
+ index = data.indexOf(this.hovered) + sum;
1409
+ }
1410
+ index = index > data.length - 1 ? data.length - 1 : index;
1411
+ index = index < 0 ? 0 : index;
1412
+ this.footerHovered = false;
1413
+ this.headerHovered = false;
1414
+ this.setHovered(data[index] !== undefined ? data[index] : null);
1415
+ if (this.hasFooterSlot && this.selectableFooter && index === data.length - 1) {
1416
+ this.footerHovered = true;
1417
+ }
1418
+ if (this.hasHeaderSlot && this.selectableHeader && index === 0) {
1419
+ this.headerHovered = true;
1420
+ }
1421
+ var list = this.$refs.dropdown.querySelector('.dropdown-content');
1422
+ var querySelectorText = 'a.dropdown-item:not(.is-disabled)';
1423
+ if (this.hasHeaderSlot && this.selectableHeader) {
1424
+ querySelectorText += ',div.dropdown-header';
1425
+ }
1426
+ if (this.hasFooterSlot && this.selectableFooter) {
1427
+ querySelectorText += ',div.dropdown-footer';
1428
+ }
1429
+ var element = list.querySelectorAll(querySelectorText)[index];
1430
+ if (!element) return;
1431
+ var visMin = list.scrollTop;
1432
+ var visMax = list.scrollTop + list.clientHeight - element.clientHeight;
1433
+ if (element.offsetTop < visMin) {
1434
+ list.scrollTop = element.offsetTop;
1435
+ } else if (element.offsetTop >= visMax) {
1436
+ list.scrollTop = element.offsetTop - list.clientHeight + element.clientHeight;
1437
+ }
1438
+ } else {
1439
+ this.isActive = true;
1440
+ }
1441
+ },
1442
+ /**
1443
+ * Focus listener.
1444
+ * If value is the same as selected, select all text.
1445
+ */
1446
+ focused: function focused(event) {
1447
+ if (this.getValue(this.selected) === this.newValue) {
1448
+ this.$el.querySelector('input').select();
1449
+ }
1450
+ if (this.openOnFocus) {
1451
+ this.isActive = true;
1452
+ if (this.keepFirst) {
1453
+ // If open on focus, update the hovered
1454
+ this.selectFirstOption(this.computedData);
1455
+ }
1456
+ }
1457
+ this.hasFocus = true;
1458
+ this.$emit('focus', event);
1459
+ },
1460
+ /**
1461
+ * Blur listener.
1462
+ */
1463
+ onBlur: function onBlur(event) {
1464
+ this.hasFocus = false;
1465
+ this.$emit('blur', event);
1466
+ },
1467
+ onInput: function onInput() {
1468
+ var currentValue = this.getValue(this.selected);
1469
+ if (currentValue && currentValue === this.newValue) return;
1470
+ this.$emit('typing', this.newValue);
1471
+ this.checkValidity();
1472
+ },
1473
+ rightIconClick: function rightIconClick(event) {
1474
+ if (this.clearable) {
1475
+ this.newValue = '';
1476
+ this.setSelected(null, false);
1477
+ if (this.openOnFocus) {
1478
+ this.$refs.input.$el.focus();
1479
+ }
1480
+ } else {
1481
+ this.$emit('icon-right-click', event);
1482
+ }
1483
+ },
1484
+ checkValidity: function checkValidity() {
1485
+ var _this7 = this;
1486
+ if (this.useHtml5Validation) {
1487
+ this.$nextTick(function () {
1488
+ _this7.checkHtml5Validity();
1489
+ });
1490
+ }
1491
+ },
1492
+ updateAppendToBody: function updateAppendToBody() {
1493
+ var dropdownMenu = this.$refs.dropdown;
1494
+ var trigger = this.$parent.$data._isTaginput ? this.$parent.$el : this.$refs.input.$el;
1495
+ if (dropdownMenu && trigger) {
1496
+ // update wrapper dropdown
1497
+ var root = this.$data._bodyEl;
1498
+ root.classList.forEach(function (item) {
1499
+ return root.classList.remove(item);
1500
+ });
1501
+ root.classList.add('autocomplete');
1502
+ root.classList.add('control');
1503
+ if (this.expandend) {
1504
+ root.classList.add('is-expandend');
1505
+ }
1506
+ var rect = trigger.getBoundingClientRect();
1507
+ var top = rect.top + window.scrollY;
1508
+ var left = rect.left + window.scrollX;
1509
+ if (!this.isOpenedTop) {
1510
+ top += trigger.clientHeight;
1511
+ } else {
1512
+ top -= dropdownMenu.clientHeight;
1513
+ }
1514
+ this.style = {
1515
+ position: 'absolute',
1516
+ top: "".concat(top, "px"),
1517
+ left: "".concat(left, "px"),
1518
+ width: "".concat(trigger.clientWidth, "px"),
1519
+ maxWidth: "".concat(trigger.clientWidth, "px"),
1520
+ zIndex: '99'
1521
+ };
1522
+ }
1523
+ }
1524
+ },
1525
+ created: function created() {
1526
+ if (typeof window !== 'undefined') {
1527
+ document.addEventListener('click', this.clickedOutside);
1528
+ if (this.dropdownPosition === 'auto') {
1529
+ window.addEventListener('resize', this.calcDropdownInViewportVertical);
1530
+ }
1531
+ }
1532
+ },
1533
+ mounted: function mounted() {
1534
+ if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector('.dropdown-content')) {
1535
+ var list = this.$refs.dropdown.querySelector('.dropdown-content');
1536
+ list.addEventListener('scroll', this.checkIfReachedTheEndOfScroll);
1537
+ }
1538
+ if (this.appendToBody) {
1539
+ this.$data._bodyEl = createAbsoluteElement(this.$refs.dropdown);
1540
+ this.updateAppendToBody();
1541
+ }
1542
+ },
1543
+ beforeDestroy: function beforeDestroy() {
1544
+ if (typeof window !== 'undefined') {
1545
+ document.removeEventListener('click', this.clickedOutside);
1546
+ if (this.dropdownPosition === 'auto') {
1547
+ window.removeEventListener('resize', this.calcDropdownInViewportVertical);
1548
+ }
1549
+ }
1550
+ if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector('.dropdown-content')) {
1551
+ var list = this.$refs.dropdown.querySelector('.dropdown-content');
1552
+ list.removeEventListener('scroll', this.checkIfReachedTheEndOfScroll);
1553
+ }
1554
+ if (this.appendToBody) {
1555
+ removeElement(this.$data._bodyEl);
1556
+ }
1557
+ clearTimeout(this.timeOutID);
1558
+ }
1559
+ };
1560
+
1561
+ /* script */
1562
+ const __vue_script__ = script;
1563
+
1564
+ /* template */
1565
+ var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:"autocomplete control",class:{ 'is-expanded': _vm.expanded }},[_c('b-input',_vm._b({ref:"input",attrs:{"type":_vm.type,"size":_vm.size,"loading":_vm.loading,"rounded":_vm.rounded,"icon":_vm.icon,"icon-right":_vm.newIconRight,"icon-right-clickable":_vm.newIconRightClickable,"icon-pack":_vm.iconPack,"maxlength":_vm.maxlength,"autocomplete":_vm.newAutocomplete,"use-html5-validation":false,"aria-autocomplete":_vm.ariaAutocomplete},on:{"input":_vm.onInput,"focus":_vm.focused,"blur":_vm.onBlur,"icon-right-click":_vm.rightIconClick,"icon-click":function (event) { return _vm.$emit('icon-click', event); }},nativeOn:{"keydown":[function($event){return _vm.keydown($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"up",38,$event.key,["Up","ArrowUp"])){ return null; }$event.preventDefault();return _vm.keyArrows('up')},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"down",40,$event.key,["Down","ArrowDown"])){ return null; }$event.preventDefault();return _vm.keyArrows('down')}]},model:{value:(_vm.newValue),callback:function ($$v) {_vm.newValue=$$v;},expression:"newValue"}},'b-input',_vm.$attrs,false)),_c('transition',{attrs:{"name":"fade"}},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive && (!_vm.isEmpty || _vm.hasEmptySlot || _vm.hasHeaderSlot || _vm.hasFooterSlot)),expression:"isActive && (!isEmpty || hasEmptySlot || hasHeaderSlot || hasFooterSlot)"}],ref:"dropdown",staticClass:"dropdown-menu",class:{ 'is-opened-top': _vm.isOpenedTop && !_vm.appendToBody },style:(_vm.style)},[_c('div',{directives:[{name:"show",rawName:"v-show",value:(_vm.isActive),expression:"isActive"}],staticClass:"dropdown-content",style:(_vm.contentStyle)},[(_vm.hasHeaderSlot)?_c('div',{staticClass:"dropdown-item dropdown-header",class:{ 'is-hovered': _vm.headerHovered },attrs:{"role":"button","tabindex":"0"},on:{"click":function($event){return _vm.selectHeaderOrFoterByClick($event, 'header')}}},[_vm._t("header")],2):_vm._e(),_vm._l((_vm.computedData),function(element,groupindex){return [(element.group)?_c('div',{key:groupindex + 'group',staticClass:"dropdown-item"},[(_vm.hasGroupSlot)?_vm._t("group",null,{"group":element.group,"index":groupindex}):_c('span',{staticClass:"has-text-weight-bold"},[_vm._v(" "+_vm._s(element.group)+" ")])],2):_vm._e(),_vm._l((element.items),function(option,index){return _c('a',{key:groupindex + ':' + index,staticClass:"dropdown-item",class:{ 'is-hovered': option === _vm.hovered },attrs:{"role":"button","tabindex":"0"},on:{"click":function($event){$event.stopPropagation();return _vm.setSelected(option, !_vm.keepOpen, $event)}}},[(_vm.hasDefaultSlot)?_vm._t("default",null,{"option":option,"index":index}):_c('span',[_vm._v(" "+_vm._s(_vm.getValue(option, true))+" ")])],2)})]}),(_vm.isEmpty && _vm.hasEmptySlot)?_c('div',{staticClass:"dropdown-item is-disabled"},[_vm._t("empty")],2):_vm._e(),(_vm.hasFooterSlot)?_c('div',{staticClass:"dropdown-item dropdown-footer",class:{ 'is-hovered': _vm.footerHovered },attrs:{"role":"button","tabindex":"0"},on:{"click":function($event){return _vm.selectHeaderOrFoterByClick($event, 'footer')}}},[_vm._t("footer")],2):_vm._e()],2)])])],1)};
1566
+ var __vue_staticRenderFns__ = [];
1567
+
1568
+ /* style */
1569
+ const __vue_inject_styles__ = undefined;
1570
+ /* scoped */
1571
+ const __vue_scope_id__ = undefined;
1572
+ /* module identifier */
1573
+ const __vue_module_identifier__ = undefined;
1574
+ /* functional template */
1575
+ const __vue_is_functional_template__ = false;
1576
+ /* style inject */
1577
+
1578
+ /* style inject SSR */
1579
+
1580
+ /* style inject shadow dom */
1581
+
1582
+
1583
+
1584
+ const __vue_component__ = /*#__PURE__*/normalizeComponent(
1585
+ { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
1586
+ __vue_inject_styles__,
1587
+ __vue_script__,
1588
+ __vue_scope_id__,
1589
+ __vue_is_functional_template__,
1590
+ __vue_module_identifier__,
1591
+ false,
1592
+ undefined,
1593
+ undefined,
1594
+ undefined
1595
+ );
1596
+
1597
+ var Autocomplete = __vue_component__;
1598
+
1599
+ var use = function use(plugin) {
1600
+ if (typeof window !== 'undefined' && window.Vue) {
1601
+ window.Vue.use(plugin);
1602
+ }
1603
+ };
1604
+ var registerComponent = function registerComponent(Vue, component) {
1605
+ Vue.component(component.name, component);
1606
+ };
1607
+
1608
+ var Plugin = {
1609
+ install: function install(Vue) {
1610
+ registerComponent(Vue, Autocomplete);
1611
+ }
1612
+ };
1613
+ use(Plugin);
1614
+
1615
+ exports.BAutocomplete = Autocomplete;
1616
+ exports["default"] = Plugin;
1617
+
1618
+ Object.defineProperty(exports, '__esModule', { value: true });
1619
+
1620
+ }));