buefy 1.0.0 → 1.0.2

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 (588) hide show
  1. package/LICENSE.md +21 -0
  2. package/README.md +242 -0
  3. package/dist/buefy.css +15895 -0
  4. package/dist/buefy.d.ts +11706 -0
  5. package/dist/buefy.esm.js +21082 -0
  6. package/dist/buefy.esm.min.js +2 -0
  7. package/dist/buefy.js +21227 -0
  8. package/dist/buefy.min.css +1 -0
  9. package/dist/buefy.min.js +2 -0
  10. package/dist/cjs/Autocomplete-BMmOsPiK.js +864 -0
  11. package/dist/cjs/Button-Cq7yqI8p.js +118 -0
  12. package/dist/cjs/CheckRadioMixin-CDu0SN3g.js +58 -0
  13. package/dist/cjs/Checkbox-GPzAMQqM.js +85 -0
  14. package/dist/cjs/CompatFallthroughMixin-hhK0Gkhr.js +48 -0
  15. package/dist/cjs/Datepicker-B-9ReBe6.js +2120 -0
  16. package/dist/cjs/Dropdown-DtpKU9qf.js +470 -0
  17. package/dist/cjs/DropdownItem-IMOKyRGV.js +110 -0
  18. package/dist/cjs/Field-19ZCJFF8.js +405 -0
  19. package/dist/cjs/FormElementMixin-DavX4iOv.js +170 -0
  20. package/dist/cjs/Icon-lsDKE2wQ.js +184 -0
  21. package/dist/cjs/Image-CocPwU3n.js +356 -0
  22. package/dist/cjs/InjectedChildMixin-CUKn09dB.js +150 -0
  23. package/dist/cjs/Input-BcloGeZ3.js +350 -0
  24. package/dist/cjs/Loading-GqqqjipO.js +145 -0
  25. package/dist/cjs/MessageMixin-bGuuzfev.js +136 -0
  26. package/dist/cjs/Modal-CYpSQe2Q.js +315 -0
  27. package/dist/cjs/NoticeMixin--3RjH43z.js +163 -0
  28. package/dist/cjs/Pagination-D1MVdiLp.js +547 -0
  29. package/dist/cjs/Progress-DT9Qc8Id.js +177 -0
  30. package/dist/cjs/Select-DayPKwCY.js +147 -0
  31. package/dist/cjs/SlotComponent-BruGdRW3.js +41 -0
  32. package/dist/cjs/TabbedChildMixin-B3JUUwcf.js +211 -0
  33. package/dist/cjs/Tag-BprnwJJ1.js +167 -0
  34. package/dist/cjs/Timepicker-CDZ3V-2J.js +283 -0
  35. package/dist/cjs/TimepickerMixin-C9WVvcUL.js +666 -0
  36. package/dist/cjs/Tooltip-Cgighv0j.js +393 -0
  37. package/dist/cjs/_plugin-vue_export-helper-Die8u8yB.js +11 -0
  38. package/dist/cjs/autocomplete.js +23 -0
  39. package/dist/cjs/breadcrumb.js +107 -0
  40. package/dist/cjs/button.js +20 -0
  41. package/dist/cjs/carousel.js +825 -0
  42. package/dist/cjs/checkbox.js +88 -0
  43. package/dist/cjs/clockpicker.js +668 -0
  44. package/dist/cjs/collapse.js +99 -0
  45. package/dist/cjs/colorpicker.js +25 -0
  46. package/dist/cjs/config-DR826Ki2.js +103 -0
  47. package/dist/cjs/config.js +18 -0
  48. package/dist/cjs/datepicker.js +28 -0
  49. package/dist/cjs/datetimepicker.js +483 -0
  50. package/dist/cjs/dialog.js +506 -0
  51. package/dist/cjs/dropdown.js +23 -0
  52. package/dist/cjs/field.js +19 -0
  53. package/dist/cjs/helpers.js +276 -0
  54. package/dist/cjs/icon.js +19 -0
  55. package/dist/cjs/image.js +19 -0
  56. package/dist/cjs/index-DiQy3SCb.js +1942 -0
  57. package/dist/cjs/index.js +274 -0
  58. package/dist/cjs/input.js +22 -0
  59. package/dist/cjs/loading.js +87 -0
  60. package/dist/cjs/menu.js +340 -0
  61. package/dist/cjs/message.js +119 -0
  62. package/dist/cjs/modal.js +103 -0
  63. package/dist/cjs/navbar.js +572 -0
  64. package/dist/cjs/notification.js +281 -0
  65. package/dist/cjs/numberinput.js +386 -0
  66. package/dist/cjs/pagination.js +22 -0
  67. package/dist/cjs/plugins-DbyYGVpp.js +16 -0
  68. package/dist/cjs/progress.js +91 -0
  69. package/dist/cjs/radio.js +137 -0
  70. package/dist/cjs/rate.js +197 -0
  71. package/dist/cjs/select.js +22 -0
  72. package/dist/cjs/sidebar.js +309 -0
  73. package/dist/cjs/skeleton.js +78 -0
  74. package/dist/cjs/slider.js +699 -0
  75. package/dist/cjs/snackbar.js +224 -0
  76. package/dist/cjs/ssr-DVRFTu_P.js +8 -0
  77. package/dist/cjs/steps.js +347 -0
  78. package/dist/cjs/switch.js +161 -0
  79. package/dist/cjs/table.js +2391 -0
  80. package/dist/cjs/tabs.js +258 -0
  81. package/dist/cjs/tag.js +44 -0
  82. package/dist/cjs/taginput.js +425 -0
  83. package/dist/cjs/timepicker.js +29 -0
  84. package/dist/cjs/toast.js +162 -0
  85. package/dist/cjs/tooltip.js +19 -0
  86. package/dist/cjs/trapFocus-BlX6xykt.js +53 -0
  87. package/dist/cjs/upload.js +195 -0
  88. package/dist/components/autocomplete/index.js +1647 -0
  89. package/dist/components/autocomplete/index.min.js +2 -0
  90. package/dist/components/breadcrumb/index.js +173 -0
  91. package/dist/components/breadcrumb/index.min.js +2 -0
  92. package/dist/components/button/index.js +334 -0
  93. package/dist/components/button/index.min.js +2 -0
  94. package/dist/components/carousel/index.js +1534 -0
  95. package/dist/components/carousel/index.min.js +2 -0
  96. package/dist/components/checkbox/index.js +236 -0
  97. package/dist/components/checkbox/index.min.js +2 -0
  98. package/dist/components/clockpicker/index.js +2636 -0
  99. package/dist/components/clockpicker/index.min.js +2 -0
  100. package/dist/components/collapse/index.js +111 -0
  101. package/dist/components/collapse/index.min.js +2 -0
  102. package/dist/components/colorpicker/index.js +4251 -0
  103. package/dist/components/colorpicker/index.min.js +2 -0
  104. package/dist/components/datepicker/index.js +4110 -0
  105. package/dist/components/datepicker/index.min.js +2 -0
  106. package/dist/components/datetimepicker/index.js +5479 -0
  107. package/dist/components/datetimepicker/index.min.js +2 -0
  108. package/dist/components/dialog/index.js +1202 -0
  109. package/dist/components/dialog/index.min.js +2 -0
  110. package/dist/components/dropdown/index.js +680 -0
  111. package/dist/components/dropdown/index.min.js +2 -0
  112. package/dist/components/field/index.js +439 -0
  113. package/dist/components/field/index.min.js +2 -0
  114. package/dist/components/icon/index.js +212 -0
  115. package/dist/components/icon/index.min.js +2 -0
  116. package/dist/components/image/index.js +396 -0
  117. package/dist/components/image/index.min.js +2 -0
  118. package/dist/components/input/index.js +764 -0
  119. package/dist/components/input/index.min.js +2 -0
  120. package/dist/components/loading/index.js +280 -0
  121. package/dist/components/loading/index.min.js +2 -0
  122. package/dist/components/menu/index.js +586 -0
  123. package/dist/components/menu/index.min.js +2 -0
  124. package/dist/components/message/index.js +611 -0
  125. package/dist/components/message/index.min.js +2 -0
  126. package/dist/components/modal/index.js +516 -0
  127. package/dist/components/modal/index.min.js +2 -0
  128. package/dist/components/navbar/index.js +634 -0
  129. package/dist/components/navbar/index.min.js +2 -0
  130. package/dist/components/notification/index.js +976 -0
  131. package/dist/components/notification/index.min.js +2 -0
  132. package/dist/components/numberinput/index.js +1128 -0
  133. package/dist/components/numberinput/index.min.js +2 -0
  134. package/dist/components/pagination/index.js +764 -0
  135. package/dist/components/pagination/index.min.js +2 -0
  136. package/dist/components/progress/index.js +280 -0
  137. package/dist/components/progress/index.min.js +2 -0
  138. package/dist/components/radio/index.js +208 -0
  139. package/dist/components/radio/index.min.js +2 -0
  140. package/dist/components/rate/index.js +391 -0
  141. package/dist/components/rate/index.min.js +2 -0
  142. package/dist/components/select/index.js +560 -0
  143. package/dist/components/select/index.min.js +2 -0
  144. package/dist/components/sidebar/index.js +337 -0
  145. package/dist/components/sidebar/index.min.js +2 -0
  146. package/dist/components/skeleton/index.js +87 -0
  147. package/dist/components/skeleton/index.min.js +2 -0
  148. package/dist/components/slider/index.js +1171 -0
  149. package/dist/components/slider/index.min.js +2 -0
  150. package/dist/components/snackbar/index.js +439 -0
  151. package/dist/components/snackbar/index.min.js +2 -0
  152. package/dist/components/steps/index.js +925 -0
  153. package/dist/components/steps/index.min.js +2 -0
  154. package/dist/components/switch/index.js +182 -0
  155. package/dist/components/switch/index.min.js +2 -0
  156. package/dist/components/table/index.js +4208 -0
  157. package/dist/components/table/index.min.js +2 -0
  158. package/dist/components/tabs/index.js +837 -0
  159. package/dist/components/tabs/index.min.js +2 -0
  160. package/dist/components/tag/index.js +396 -0
  161. package/dist/components/tag/index.min.js +2 -0
  162. package/dist/components/taginput/index.js +2209 -0
  163. package/dist/components/taginput/index.min.js +2 -0
  164. package/dist/components/timepicker/index.js +2906 -0
  165. package/dist/components/timepicker/index.min.js +2 -0
  166. package/dist/components/toast/index.js +377 -0
  167. package/dist/components/toast/index.min.js +2 -0
  168. package/dist/components/tooltip/index.js +445 -0
  169. package/dist/components/tooltip/index.min.js +2 -0
  170. package/dist/components/upload/index.js +426 -0
  171. package/dist/components/upload/index.min.js +2 -0
  172. package/dist/esm/Autocomplete-CjbTh9D8.js +862 -0
  173. package/dist/esm/Button-DyUYShTZ.js +116 -0
  174. package/dist/esm/CheckRadioMixin-DSD_rjC8.js +56 -0
  175. package/dist/esm/Checkbox-KUMz0sfA.js +83 -0
  176. package/dist/esm/CompatFallthroughMixin-C8LPuwDr.js +46 -0
  177. package/dist/esm/Datepicker-Bl8Wfdkn.js +2118 -0
  178. package/dist/esm/Dropdown-CGTYVyoL.js +467 -0
  179. package/dist/esm/DropdownItem-Cn3nM0A3.js +108 -0
  180. package/dist/esm/Field-B7bX_uUg.js +403 -0
  181. package/dist/esm/FormElementMixin-Dd_wkBN5.js +168 -0
  182. package/dist/esm/Icon-DPyGDeRK.js +182 -0
  183. package/dist/esm/Image-DhX-4hlV.js +354 -0
  184. package/dist/esm/InjectedChildMixin-D2K-FwuO.js +145 -0
  185. package/dist/esm/Input-C4L520az.js +348 -0
  186. package/dist/esm/Loading-tuQoo6TU.js +143 -0
  187. package/dist/esm/MessageMixin-CQ7LIdvq.js +134 -0
  188. package/dist/esm/Modal-tfvyhxw_.js +313 -0
  189. package/dist/esm/NoticeMixin-ByNlva3T.js +161 -0
  190. package/dist/esm/Pagination-B-LAJQay.js +543 -0
  191. package/dist/esm/Progress-BPGTVZgr.js +174 -0
  192. package/dist/esm/Select-bl4qUzij.js +145 -0
  193. package/dist/esm/SlotComponent-BwNpVnfH.js +39 -0
  194. package/dist/esm/TabbedChildMixin-C4i6WP9j.js +208 -0
  195. package/dist/esm/Tag-jS5Bcj6N.js +165 -0
  196. package/dist/esm/Timepicker-DnkqnOBT.js +281 -0
  197. package/dist/esm/TimepickerMixin-Bikh6_Fg.js +664 -0
  198. package/dist/esm/Tooltip-CtDSXAqa.js +391 -0
  199. package/dist/esm/_plugin-vue_export-helper-OJRSZE6i.js +9 -0
  200. package/dist/esm/autocomplete.js +18 -0
  201. package/dist/esm/breadcrumb.js +101 -0
  202. package/dist/esm/button.js +15 -0
  203. package/dist/esm/carousel.js +818 -0
  204. package/dist/esm/checkbox.js +82 -0
  205. package/dist/esm/clockpicker.js +663 -0
  206. package/dist/esm/collapse.js +94 -0
  207. package/dist/esm/colorpicker.js +16 -0
  208. package/dist/esm/config-CKuo-p6e.js +100 -0
  209. package/dist/esm/config.js +14 -0
  210. package/dist/esm/datepicker.js +23 -0
  211. package/dist/esm/datetimepicker.js +478 -0
  212. package/dist/esm/dialog.js +500 -0
  213. package/dist/esm/dropdown.js +17 -0
  214. package/dist/esm/field.js +14 -0
  215. package/dist/esm/helpers.js +247 -0
  216. package/dist/esm/icon.js +14 -0
  217. package/dist/esm/image.js +14 -0
  218. package/dist/esm/index-CQegEsxK.js +1938 -0
  219. package/dist/esm/index.js +164 -0
  220. package/dist/esm/input.js +17 -0
  221. package/dist/esm/loading.js +81 -0
  222. package/dist/esm/menu.js +333 -0
  223. package/dist/esm/message.js +114 -0
  224. package/dist/esm/modal.js +97 -0
  225. package/dist/esm/navbar.js +565 -0
  226. package/dist/esm/notification.js +275 -0
  227. package/dist/esm/numberinput.js +381 -0
  228. package/dist/esm/pagination.js +16 -0
  229. package/dist/esm/plugins-B172kuKE.js +13 -0
  230. package/dist/esm/progress.js +85 -0
  231. package/dist/esm/radio.js +131 -0
  232. package/dist/esm/rate.js +192 -0
  233. package/dist/esm/select.js +17 -0
  234. package/dist/esm/sidebar.js +304 -0
  235. package/dist/esm/skeleton.js +73 -0
  236. package/dist/esm/slider.js +693 -0
  237. package/dist/esm/snackbar.js +218 -0
  238. package/dist/esm/ssr-C7yEpGLm.js +5 -0
  239. package/dist/esm/steps.js +341 -0
  240. package/dist/esm/switch.js +156 -0
  241. package/dist/esm/table.js +2385 -0
  242. package/dist/esm/tabs.js +252 -0
  243. package/dist/esm/tag.js +38 -0
  244. package/dist/esm/taginput.js +420 -0
  245. package/dist/esm/timepicker.js +24 -0
  246. package/dist/esm/toast.js +156 -0
  247. package/dist/esm/tooltip.js +14 -0
  248. package/dist/esm/trapFocus-KHP_kCNE.js +51 -0
  249. package/dist/esm/upload.js +190 -0
  250. package/dist/tsdoc-metadata.json +11 -0
  251. package/package.json +73 -6
  252. package/src/components/autocomplete/Autocomplete.spec.ts +783 -0
  253. package/src/components/autocomplete/Autocomplete.vue +966 -0
  254. package/src/components/autocomplete/__snapshots__/Autocomplete.spec.ts.snap +21 -0
  255. package/src/components/autocomplete/index.ts +16 -0
  256. package/src/components/breadcrumb/Breadcrumb.spec.ts +65 -0
  257. package/src/components/breadcrumb/Breadcrumb.vue +42 -0
  258. package/src/components/breadcrumb/BreadcrumbItem.spec.ts +74 -0
  259. package/src/components/breadcrumb/BreadcrumbItem.vue +34 -0
  260. package/src/components/breadcrumb/__snapshots__/Breadcrumb.spec.ts.snap +7 -0
  261. package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.ts.snap +3 -0
  262. package/src/components/breadcrumb/index.ts +19 -0
  263. package/src/components/button/Button.spec.ts +117 -0
  264. package/src/components/button/Button.vue +112 -0
  265. package/src/components/button/__snapshots__/Button.spec.ts.snap +9 -0
  266. package/src/components/button/index.ts +16 -0
  267. package/src/components/carousel/Carousel.spec.ts +304 -0
  268. package/src/components/carousel/Carousel.vue +389 -0
  269. package/src/components/carousel/CarouselItem.spec.ts +105 -0
  270. package/src/components/carousel/CarouselItem.vue +38 -0
  271. package/src/components/carousel/CarouselList.spec.ts +172 -0
  272. package/src/components/carousel/CarouselList.vue +364 -0
  273. package/src/components/carousel/__snapshots__/Carousel.spec.ts.snap +19 -0
  274. package/src/components/carousel/__snapshots__/CarouselItem.spec.ts.snap +7 -0
  275. package/src/components/carousel/__snapshots__/CarouselList.spec.ts.snap +36 -0
  276. package/src/components/carousel/index.ts +23 -0
  277. package/src/components/carousel/types.ts +17 -0
  278. package/src/components/checkbox/Checkbox.spec.ts +40 -0
  279. package/src/components/checkbox/Checkbox.vue +63 -0
  280. package/src/components/checkbox/CheckboxButton.spec.ts +46 -0
  281. package/src/components/checkbox/CheckboxButton.vue +59 -0
  282. package/src/components/checkbox/__snapshots__/Checkbox.spec.ts.snap +9 -0
  283. package/src/components/checkbox/__snapshots__/CheckboxButton.spec.ts.snap +3 -0
  284. package/src/components/checkbox/index.ts +20 -0
  285. package/src/components/clockpicker/Clockpicker.spec.ts +161 -0
  286. package/src/components/clockpicker/Clockpicker.vue +311 -0
  287. package/src/components/clockpicker/ClockpickerFace.spec.ts +99 -0
  288. package/src/components/clockpicker/ClockpickerFace.vue +272 -0
  289. package/src/components/clockpicker/__snapshots__/Clockpicker.spec.ts.snap +36 -0
  290. package/src/components/clockpicker/__snapshots__/ClockpickerFace.spec.ts.snap +9 -0
  291. package/src/components/clockpicker/index.ts +16 -0
  292. package/src/components/collapse/Collapse.spec.ts +106 -0
  293. package/src/components/collapse/Collapse.vue +98 -0
  294. package/src/components/collapse/__snapshots__/Collapse.spec.ts.snap +10 -0
  295. package/src/components/collapse/index.ts +16 -0
  296. package/src/components/colorpicker/Colorpicker.spec.ts +22 -0
  297. package/src/components/colorpicker/Colorpicker.vue +416 -0
  298. package/src/components/colorpicker/ColorpickerAlphaSlider.spec.ts +17 -0
  299. package/src/components/colorpicker/ColorpickerAlphaSlider.vue +205 -0
  300. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.spec.ts +23 -0
  301. package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +380 -0
  302. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.spec.ts +23 -0
  303. package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +456 -0
  304. package/src/components/colorpicker/__snapshots__/Colorpicker.spec.ts.snap +77 -0
  305. package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.ts.snap +9 -0
  306. package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationSquare.spec.ts.snap +12 -0
  307. package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationTriangle.spec.ts.snap +36 -0
  308. package/src/components/colorpicker/index.ts +16 -0
  309. package/src/components/datepicker/Datepicker.spec.ts +482 -0
  310. package/src/components/datepicker/Datepicker.vue +908 -0
  311. package/src/components/datepicker/DatepickerMonth.spec.ts +346 -0
  312. package/src/components/datepicker/DatepickerMonth.vue +444 -0
  313. package/src/components/datepicker/DatepickerTable.spec.ts +290 -0
  314. package/src/components/datepicker/DatepickerTable.vue +398 -0
  315. package/src/components/datepicker/DatepickerTableRow.spec.ts +300 -0
  316. package/src/components/datepicker/DatepickerTableRow.vue +416 -0
  317. package/src/components/datepicker/__snapshots__/Datepicker.spec.ts.snap +54 -0
  318. package/src/components/datepicker/__snapshots__/DatepickerMonth.spec.ts.snap +33 -0
  319. package/src/components/datepicker/__snapshots__/DatepickerTable.spec.ts.snap +16 -0
  320. package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.ts.snap +23 -0
  321. package/src/components/datepicker/index.ts +17 -0
  322. package/src/components/datepicker/types.ts +41 -0
  323. package/src/components/datetimepicker/Datetimepicker.spec.ts +132 -0
  324. package/src/components/datetimepicker/Datetimepicker.vue +491 -0
  325. package/src/components/datetimepicker/index.ts +16 -0
  326. package/src/components/dialog/Dialog.spec.ts +108 -0
  327. package/src/components/dialog/Dialog.vue +300 -0
  328. package/src/components/dialog/index.ts +169 -0
  329. package/src/components/dropdown/Dropdown.spec.ts +229 -0
  330. package/src/components/dropdown/Dropdown.vue +491 -0
  331. package/src/components/dropdown/DropdownItem.spec.ts +78 -0
  332. package/src/components/dropdown/DropdownItem.vue +112 -0
  333. package/src/components/dropdown/__snapshots__/Dropdown.spec.ts.snap +15 -0
  334. package/src/components/dropdown/__snapshots__/DropdownItem.spec.ts.snap +3 -0
  335. package/src/components/dropdown/index.ts +20 -0
  336. package/src/components/field/Field.spec.ts +324 -0
  337. package/src/components/field/Field.vue +316 -0
  338. package/src/components/field/FieldBody.spec.ts +96 -0
  339. package/src/components/field/FieldBody.vue +74 -0
  340. package/src/components/field/__snapshots__/Field.spec.ts.snap +8 -0
  341. package/src/components/field/__snapshots__/FieldBody.spec.ts.snap +3 -0
  342. package/src/components/field/index.ts +16 -0
  343. package/src/components/icon/Icon.spec.ts +142 -0
  344. package/src/components/icon/Icon.vue +120 -0
  345. package/src/components/icon/__snapshots__/Icon.spec.ts.snap +3 -0
  346. package/src/components/icon/index.ts +17 -0
  347. package/src/components/image/Image.spec.ts +218 -0
  348. package/src/components/image/Image.vue +358 -0
  349. package/src/components/image/__snapshots__/Image.spec.ts.snap +37 -0
  350. package/src/components/image/index.ts +16 -0
  351. package/src/components/index.ts +179 -0
  352. package/src/components/input/Input.spec.ts +396 -0
  353. package/src/components/input/Input.vue +335 -0
  354. package/src/components/input/__snapshots__/Input.spec.ts.snap +9 -0
  355. package/src/components/input/index.ts +17 -0
  356. package/src/components/loading/Loading.spec.ts +151 -0
  357. package/src/components/loading/Loading.vue +135 -0
  358. package/src/components/loading/__snapshots__/Loading.spec.ts.snap +10 -0
  359. package/src/components/loading/index.ts +91 -0
  360. package/src/components/menu/Menu.spec.ts +21 -0
  361. package/src/components/menu/Menu.vue +31 -0
  362. package/src/components/menu/MenuItem.spec.ts +92 -0
  363. package/src/components/menu/MenuItem.vue +168 -0
  364. package/src/components/menu/MenuItemContainerMixin.ts +72 -0
  365. package/src/components/menu/MenuList.spec.ts +35 -0
  366. package/src/components/menu/MenuList.vue +47 -0
  367. package/src/components/menu/__snapshots__/Menu.spec.ts.snap +3 -0
  368. package/src/components/menu/__snapshots__/MenuItem.spec.ts.snap +9 -0
  369. package/src/components/menu/__snapshots__/MenuList.spec.ts.snap +8 -0
  370. package/src/components/menu/index.ts +25 -0
  371. package/src/components/message/Message.spec.ts +30 -0
  372. package/src/components/message/Message.vue +73 -0
  373. package/src/components/message/__snapshots__/Message.spec.ts.snap +11 -0
  374. package/src/components/message/index.ts +15 -0
  375. package/src/components/modal/Modal.spec.ts +167 -0
  376. package/src/components/modal/Modal.vue +335 -0
  377. package/src/components/modal/__snapshots__/Modal.spec.ts.snap +10 -0
  378. package/src/components/modal/index.ts +107 -0
  379. package/src/components/navbar/NavBar.spec.ts +78 -0
  380. package/src/components/navbar/NavBarBurger.spec.ts +30 -0
  381. package/src/components/navbar/NavBarItem.spec.ts +92 -0
  382. package/src/components/navbar/Navbar.vue +274 -0
  383. package/src/components/navbar/NavbarBurger.vue +29 -0
  384. package/src/components/navbar/NavbarDropdown.spec.ts +84 -0
  385. package/src/components/navbar/NavbarDropdown.vue +115 -0
  386. package/src/components/navbar/NavbarItem.vue +97 -0
  387. package/src/components/navbar/__snapshots__/NavBar.spec.ts.snap +11 -0
  388. package/src/components/navbar/__snapshots__/NavBarBurger.spec.ts.snap +3 -0
  389. package/src/components/navbar/__snapshots__/NavBarItem.spec.ts.snap +3 -0
  390. package/src/components/navbar/__snapshots__/NavbarDropdown.spec.ts.snap +7 -0
  391. package/src/components/navbar/index.ts +22 -0
  392. package/src/components/notification/Notification.spec.ts +21 -0
  393. package/src/components/notification/Notification.vue +77 -0
  394. package/src/components/notification/NotificationNotice.vue +76 -0
  395. package/src/components/notification/__snapshots__/Notification.spec.ts.snap +10 -0
  396. package/src/components/notification/index.ts +121 -0
  397. package/src/components/numberinput/Numberinput.spec.ts +445 -0
  398. package/src/components/numberinput/Numberinput.vue +372 -0
  399. package/src/components/numberinput/index.ts +16 -0
  400. package/src/components/pagination/Pagination.spec.ts +94 -0
  401. package/src/components/pagination/Pagination.vue +434 -0
  402. package/src/components/pagination/PaginationButton.spec.ts +42 -0
  403. package/src/components/pagination/PaginationButton.vue +59 -0
  404. package/src/components/pagination/__snapshots__/Pagination.spec.ts.snap +22 -0
  405. package/src/components/pagination/__snapshots__/PaginationButton.spec.ts.snap +3 -0
  406. package/src/components/pagination/index.ts +19 -0
  407. package/src/components/pagination/types.ts +11 -0
  408. package/src/components/progress/Progress.spec.ts +81 -0
  409. package/src/components/progress/Progress.vue +168 -0
  410. package/src/components/progress/ProgressBar.spec.ts +45 -0
  411. package/src/components/progress/ProgressBar.vue +74 -0
  412. package/src/components/progress/__snapshots__/Progress.spec.ts.snap +7 -0
  413. package/src/components/progress/__snapshots__/ProgressBar.spec.ts.snap +7 -0
  414. package/src/components/progress/index.ts +18 -0
  415. package/src/components/radio/Radio.spec.ts +40 -0
  416. package/src/components/radio/Radio.vue +35 -0
  417. package/src/components/radio/RadioButton.spec.ts +40 -0
  418. package/src/components/radio/RadioButton.vue +69 -0
  419. package/src/components/radio/__snapshots__/Radio.spec.ts.snap +3 -0
  420. package/src/components/radio/__snapshots__/RadioButton.spec.ts.snap +3 -0
  421. package/src/components/radio/index.ts +18 -0
  422. package/src/components/rate/Rate.spec.ts +90 -0
  423. package/src/components/rate/Rate.vue +158 -0
  424. package/src/components/rate/index.ts +15 -0
  425. package/src/components/select/Select.spec.ts +74 -0
  426. package/src/components/select/Select.vue +118 -0
  427. package/src/components/select/__snapshots__/Select.spec.ts.snap +7 -0
  428. package/src/components/select/index.ts +16 -0
  429. package/src/components/sidebar/Sidebar.spec.ts +107 -0
  430. package/src/components/sidebar/Sidebar.vue +316 -0
  431. package/src/components/sidebar/__snapshots__/Sidebar.spec.ts.snap +25 -0
  432. package/src/components/sidebar/index.ts +16 -0
  433. package/src/components/skeleton/Skeleton.spec.ts +16 -0
  434. package/src/components/skeleton/Skeleton.vue +98 -0
  435. package/src/components/skeleton/__snapshots__/Skeleton.spec.ts.snap +7 -0
  436. package/src/components/skeleton/index.ts +18 -0
  437. package/src/components/slider/Slider.spec.ts +115 -0
  438. package/src/components/slider/Slider.vue +374 -0
  439. package/src/components/slider/SliderThumb.spec.ts +176 -0
  440. package/src/components/slider/SliderThumb.vue +251 -0
  441. package/src/components/slider/SliderTick.spec.ts +33 -0
  442. package/src/components/slider/SliderTick.vue +50 -0
  443. package/src/components/slider/__snapshots__/Slider.spec.ts.snap +12 -0
  444. package/src/components/slider/__snapshots__/SliderThumb.spec.ts.snap +16 -0
  445. package/src/components/slider/__snapshots__/SliderTick.spec.ts.snap +7 -0
  446. package/src/components/slider/index.ts +19 -0
  447. package/src/components/slider/types.ts +34 -0
  448. package/src/components/snackbar/Snackbar.spec.ts +35 -0
  449. package/src/components/snackbar/Snackbar.vue +88 -0
  450. package/src/components/snackbar/__snapshots__/Snackbar.spec.ts.snap +12 -0
  451. package/src/components/snackbar/index.ts +118 -0
  452. package/src/components/steps/StepItem.spec.ts +114 -0
  453. package/src/components/steps/StepItem.vue +26 -0
  454. package/src/components/steps/Steps.spec.ts +125 -0
  455. package/src/components/steps/Steps.vue +273 -0
  456. package/src/components/steps/__snapshots__/StepItem.spec.ts.snap +7 -0
  457. package/src/components/steps/__snapshots__/Steps.spec.ts.snap +40 -0
  458. package/src/components/steps/index.ts +19 -0
  459. package/src/components/switch/Switch.spec.ts +74 -0
  460. package/src/components/switch/Switch.vue +146 -0
  461. package/src/components/switch/__snapshots__/Switch.spec.ts.snap +3 -0
  462. package/src/components/switch/index.ts +16 -0
  463. package/src/components/table/Table.spec.ts +622 -0
  464. package/src/components/table/Table.vue +1770 -0
  465. package/src/components/table/TableColumn.spec.ts +85 -0
  466. package/src/components/table/TableColumn.vue +140 -0
  467. package/src/components/table/TableMobileSort.spec.ts +47 -0
  468. package/src/components/table/TableMobileSort.vue +236 -0
  469. package/src/components/table/TablePagination.vue +86 -0
  470. package/src/components/table/__snapshots__/Table.spec.ts.snap +24 -0
  471. package/src/components/table/__snapshots__/TableMobileSort.spec.ts.snap +12 -0
  472. package/src/components/table/index.ts +32 -0
  473. package/src/components/table/mockTableColumn.ts +110 -0
  474. package/src/components/table/types.ts +110 -0
  475. package/src/components/tabs/TabItem.spec.ts +203 -0
  476. package/src/components/tabs/TabItem.vue +19 -0
  477. package/src/components/tabs/Tabs.spec.ts +122 -0
  478. package/src/components/tabs/Tabs.vue +204 -0
  479. package/src/components/tabs/__snapshots__/TabItem.spec.ts.snap +7 -0
  480. package/src/components/tabs/__snapshots__/Tabs.spec.ts.snap +33 -0
  481. package/src/components/tabs/index.ts +19 -0
  482. package/src/components/tag/Tag.spec.ts +32 -0
  483. package/src/components/tag/Tag.vue +132 -0
  484. package/src/components/tag/Taglist.spec.ts +21 -0
  485. package/src/components/tag/Taglist.vue +16 -0
  486. package/src/components/tag/__snapshots__/Tag.spec.ts.snap +6 -0
  487. package/src/components/tag/__snapshots__/Taglist.spec.ts.snap +3 -0
  488. package/src/components/tag/index.ts +19 -0
  489. package/src/components/taginput/Taginput.spec.ts +132 -0
  490. package/src/components/taginput/Taginput.vue +415 -0
  491. package/src/components/taginput/__snapshots__/Taginput.spec.ts.snap +10 -0
  492. package/src/components/taginput/index.ts +16 -0
  493. package/src/components/timepicker/Timepicker.spec.ts +108 -0
  494. package/src/components/timepicker/Timepicker.vue +183 -0
  495. package/src/components/timepicker/__snapshots__/Timepicker.spec.ts.snap +41 -0
  496. package/src/components/timepicker/index.ts +17 -0
  497. package/src/components/toast/Toast.spec.ts +74 -0
  498. package/src/components/toast/Toast.vue +46 -0
  499. package/src/components/toast/__snapshots__/Toast.spec.ts.snap +10 -0
  500. package/src/components/toast/index.ts +120 -0
  501. package/src/components/tooltip/Tooltip.spec.ts +64 -0
  502. package/src/components/tooltip/Tooltip.vue +393 -0
  503. package/src/components/tooltip/__snapshots__/Tooltip.spec.ts.snap +12 -0
  504. package/src/components/tooltip/index.ts +16 -0
  505. package/src/components/upload/Upload.spec.ts +62 -0
  506. package/src/components/upload/Upload.vue +188 -0
  507. package/src/components/upload/__snapshots__/Upload.spec.ts.snap +3 -0
  508. package/src/components/upload/index.ts +15 -0
  509. package/src/directives/clickOutside.ts +113 -0
  510. package/src/directives/trapFocus.ts +61 -0
  511. package/src/index.ts +43 -0
  512. package/src/scss/buefy-build.scss +6 -0
  513. package/src/scss/buefy.scss +39 -0
  514. package/src/scss/components/_autocomplete.scss +39 -0
  515. package/src/scss/components/_carousel.scss +204 -0
  516. package/src/scss/components/_checkbox.scss +106 -0
  517. package/src/scss/components/_clockpicker.scss +283 -0
  518. package/src/scss/components/_collapse.scss +9 -0
  519. package/src/scss/components/_colorpicker.scss +283 -0
  520. package/src/scss/components/_datepicker.scss +220 -0
  521. package/src/scss/components/_dialog.scss +54 -0
  522. package/src/scss/components/_dropdown.scss +143 -0
  523. package/src/scss/components/_form.scss +309 -0
  524. package/src/scss/components/_icon.scss +16 -0
  525. package/src/scss/components/_image.scss +20 -0
  526. package/src/scss/components/_loading.scss +45 -0
  527. package/src/scss/components/_menu.scss +11 -0
  528. package/src/scss/components/_message.scss +16 -0
  529. package/src/scss/components/_modal.scss +37 -0
  530. package/src/scss/components/_navbar.scss +22 -0
  531. package/src/scss/components/_notices.scss +144 -0
  532. package/src/scss/components/_notification.scss +8 -0
  533. package/src/scss/components/_numberinput.scss +33 -0
  534. package/src/scss/components/_pagination.scss +63 -0
  535. package/src/scss/components/_progress.scss +105 -0
  536. package/src/scss/components/_radio.scss +123 -0
  537. package/src/scss/components/_rate.scss +72 -0
  538. package/src/scss/components/_select.scss +38 -0
  539. package/src/scss/components/_sidebar.scss +107 -0
  540. package/src/scss/components/_skeleton.scss +66 -0
  541. package/src/scss/components/_slider.scss +162 -0
  542. package/src/scss/components/_steps.scss +491 -0
  543. package/src/scss/components/_switch.scss +214 -0
  544. package/src/scss/components/_table.scss +322 -0
  545. package/src/scss/components/_tabs.scss +197 -0
  546. package/src/scss/components/_tag.scss +36 -0
  547. package/src/scss/components/_taginput.scss +73 -0
  548. package/src/scss/components/_timepicker.scss +73 -0
  549. package/src/scss/components/_tooltip.scss +192 -0
  550. package/src/scss/components/_upload.scss +62 -0
  551. package/src/scss/utils/_all.scss +4 -0
  552. package/src/scss/utils/_animations.scss +183 -0
  553. package/src/scss/utils/_functions.scss +49 -0
  554. package/src/scss/utils/_helpers.scss +6 -0
  555. package/src/scss/utils/_variables-ext.scss +2 -0
  556. package/src/scss/utils/_variables.scss +16 -0
  557. package/src/utils/CheckRadioMixin.spec.ts +28 -0
  558. package/src/utils/CheckRadioMixin.ts +61 -0
  559. package/src/utils/CompatFallthroughMixin.ts +34 -0
  560. package/src/utils/ConfigComponent.ts +12 -0
  561. package/src/utils/FormElementMixin.spec.ts +41 -0
  562. package/src/utils/FormElementMixin.ts +206 -0
  563. package/src/utils/InjectedChildMixin.ts +139 -0
  564. package/src/utils/MessageMixin.spec.ts +51 -0
  565. package/src/utils/MessageMixin.ts +138 -0
  566. package/src/utils/NoticeMixin.spec.ts +55 -0
  567. package/src/utils/NoticeMixin.ts +181 -0
  568. package/src/utils/ProvideInjectTypes.ts +20 -0
  569. package/src/utils/ProviderParentMixin.ts +105 -0
  570. package/src/utils/SlotComponent.spec.ts +55 -0
  571. package/src/utils/SlotComponent.ts +38 -0
  572. package/src/utils/TabbedChildMixin.ts +96 -0
  573. package/src/utils/TabbedMixin.ts +166 -0
  574. package/src/utils/TabbedTypes.ts +33 -0
  575. package/src/utils/TimepickerMixin.spec.ts +75 -0
  576. package/src/utils/TimepickerMixin.ts +767 -0
  577. package/src/utils/color.spec.ts +55 -0
  578. package/src/utils/color.ts +507 -0
  579. package/src/utils/config.spec.ts +11 -0
  580. package/src/utils/config.ts +619 -0
  581. package/src/utils/debounce.spec.ts +52 -0
  582. package/src/utils/debounce.ts +20 -0
  583. package/src/utils/helpers.spec.ts +257 -0
  584. package/src/utils/helpers.ts +527 -0
  585. package/src/utils/icons.ts +73 -0
  586. package/src/utils/plugins.ts +20 -0
  587. package/src/utils/ssr.ts +6 -0
  588. package/src/utils/vue-augmentation.ts +35 -0
@@ -0,0 +1,2636 @@
1
+ /*! Buefy v1.0.2 | MIT License | github.com/buefy/buefy */
2
+ (function (global, factory) {
3
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
4
+ typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
5
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Clockpicker = {}, global.Vue));
6
+ })(this, (function (exports, vue) { 'use strict';
7
+
8
+ let config = {
9
+ defaultIconPack: "mdi",
10
+ defaultIconComponent: null,
11
+ defaultLocale: void 0,
12
+ defaultInputAutocomplete: "on",
13
+ defaultTimepickerMobileNative: true,
14
+ defaultTimepickerMobileModal: true,
15
+ defaultInputHasCounter: true,
16
+ defaultCompatFallthrough: true,
17
+ defaultUseHtml5Validation: true,
18
+ defaultDropdownMobileModal: true,
19
+ defaultTrapFocus: true,
20
+ defaultStatusIcon: true};
21
+
22
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
23
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
24
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
25
+ var __objRest = (source, exclude) => {
26
+ var target = {};
27
+ for (var prop in source)
28
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
+ target[prop] = source[prop];
30
+ if (source != null && __getOwnPropSymbols)
31
+ for (var prop of __getOwnPropSymbols(source)) {
32
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
+ target[prop] = source[prop];
34
+ }
35
+ return target;
36
+ };
37
+ var CompatFallthroughMixin = vue.defineComponent({
38
+ inheritAttrs: false,
39
+ props: {
40
+ compatFallthrough: {
41
+ type: Boolean,
42
+ default: () => config.defaultCompatFallthrough
43
+ }
44
+ },
45
+ computed: {
46
+ rootAttrs() {
47
+ return this.compatFallthrough ? {
48
+ class: this.$attrs.class,
49
+ style: this.$attrs.style,
50
+ id: this.$attrs.id
51
+ } : {};
52
+ },
53
+ fallthroughAttrs() {
54
+ if (this.compatFallthrough) {
55
+ const _a = this.$attrs, { style: _1, class: _2, id: _3 } = _a, rest = __objRest(_a, ["style", "class", "id"]);
56
+ return rest;
57
+ } else {
58
+ return this.$attrs;
59
+ }
60
+ }
61
+ }
62
+ });
63
+
64
+ const isMobile = {
65
+ Android: function() {
66
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/Android/i);
67
+ },
68
+ BlackBerry: function() {
69
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/BlackBerry/i);
70
+ },
71
+ iOS: function() {
72
+ return typeof window !== "undefined" && (window.navigator.userAgent.match(/iPhone|iPad|iPod/i) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1);
73
+ },
74
+ Opera: function() {
75
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/Opera Mini/i);
76
+ },
77
+ Windows: function() {
78
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/IEMobile/i);
79
+ },
80
+ any: function() {
81
+ return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
82
+ }
83
+ };
84
+ function removeElement(el) {
85
+ if (typeof el.remove !== "undefined") {
86
+ el.remove();
87
+ } else if (typeof el.parentNode !== "undefined" && el.parentNode !== null) {
88
+ el.parentNode.removeChild(el);
89
+ }
90
+ }
91
+ function createAbsoluteElement(el) {
92
+ const root = document.createElement("div");
93
+ root.style.position = "absolute";
94
+ root.style.left = "0px";
95
+ root.style.top = "0px";
96
+ root.style.width = "100%";
97
+ const wrapper = document.createElement("div");
98
+ root.appendChild(wrapper);
99
+ wrapper.appendChild(el);
100
+ document.body.appendChild(root);
101
+ return root;
102
+ }
103
+ function toCssWidth(width) {
104
+ return width === void 0 ? null : isNaN(+width) ? `${width}` : width + "px";
105
+ }
106
+ function matchWithGroups(pattern, str) {
107
+ const matches = str.match(pattern);
108
+ const groupNames = pattern.toString().match(/<(.+?)>/g);
109
+ if (groupNames == null) {
110
+ throw new RangeError("pattern must contain at least one group");
111
+ }
112
+ return groupNames.map((group) => {
113
+ const groupMatches = group.match(/<(.+)>/);
114
+ return groupMatches[1];
115
+ }).reduce((acc, curr, index) => {
116
+ if (matches && matches.length > index) {
117
+ acc[curr] = matches[index + 1];
118
+ } else {
119
+ acc[curr] = null;
120
+ }
121
+ return acc;
122
+ }, {});
123
+ }
124
+ function isCustomElement(vm) {
125
+ return vm.$root != null && "shadowRoot" in vm.$root.$options;
126
+ }
127
+
128
+ var _export_sfc = (sfc, props) => {
129
+ const target = sfc.__vccOpts || sfc;
130
+ for (const [key, val] of props) {
131
+ target[key] = val;
132
+ }
133
+ return target;
134
+ };
135
+
136
+ const FormElementMixin = vue.defineComponent({
137
+ props: {
138
+ size: String,
139
+ expanded: Boolean,
140
+ loading: Boolean,
141
+ rounded: Boolean,
142
+ icon: String,
143
+ iconPack: String,
144
+ maxlength: [Number, String],
145
+ useHtml5Validation: {
146
+ type: Boolean,
147
+ default: () => config.defaultUseHtml5Validation
148
+ },
149
+ validationMessage: String,
150
+ locale: {
151
+ type: [String, Array],
152
+ default: () => {
153
+ return config.defaultLocale;
154
+ }
155
+ },
156
+ statusIcon: {
157
+ type: Boolean,
158
+ default: () => {
159
+ return config.defaultStatusIcon;
160
+ }
161
+ }
162
+ },
163
+ emits: {
164
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
165
+ blur: (event) => true,
166
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
167
+ focus: (event) => true
168
+ },
169
+ data() {
170
+ return {
171
+ isValid: true,
172
+ isFocused: false,
173
+ newIconPack: this.iconPack || config.defaultIconPack,
174
+ // host component must override this
175
+ _elementRef: ""
176
+ };
177
+ },
178
+ computed: {
179
+ /*
180
+ * Find parent Field, max 3 levels deep.
181
+ */
182
+ parentField() {
183
+ let parent = this.$parent;
184
+ for (let i = 0; i < 3; i++) {
185
+ if (parent && !parent.$data._isField) {
186
+ parent = parent.$parent;
187
+ }
188
+ }
189
+ return parent;
190
+ },
191
+ /*
192
+ * Get the type prop from parent if it's a Field.
193
+ */
194
+ statusType() {
195
+ const { newType } = this.parentField || {};
196
+ if (!newType) return;
197
+ if (typeof newType === "string") {
198
+ return newType;
199
+ } else {
200
+ for (const key in newType) {
201
+ if (newType[key]) {
202
+ return key;
203
+ }
204
+ }
205
+ }
206
+ return void 0;
207
+ },
208
+ /*
209
+ * Get the message prop from parent if it's a Field.
210
+ */
211
+ statusMessage() {
212
+ if (!this.parentField) return;
213
+ return this.parentField.newMessage || this.parentField.$slots.message;
214
+ },
215
+ /*
216
+ * Fix icon size for inputs, large was too big
217
+ */
218
+ iconSize() {
219
+ switch (this.size) {
220
+ case "is-small":
221
+ return this.size;
222
+ case "is-medium":
223
+ return;
224
+ case "is-large":
225
+ return this.newIconPack === "mdi" ? "is-medium" : "";
226
+ }
227
+ return void 0;
228
+ }
229
+ },
230
+ methods: {
231
+ /*
232
+ * Focus method that work dynamically depending on the component.
233
+ */
234
+ focus() {
235
+ const el = this.getElement();
236
+ if (el === void 0) return;
237
+ this.$nextTick(() => {
238
+ if (el) el.focus();
239
+ });
240
+ },
241
+ onBlur($event) {
242
+ this.isFocused = false;
243
+ this.$emit("blur", $event);
244
+ this.checkHtml5Validity();
245
+ },
246
+ onFocus($event) {
247
+ this.isFocused = true;
248
+ this.$emit("focus", $event);
249
+ },
250
+ getElement() {
251
+ let el = this.$refs[this.$data._elementRef];
252
+ while (el != null && typeof el === "object" && "$refs" in el) {
253
+ const form = el;
254
+ el = form.$refs[form.$data._elementRef];
255
+ }
256
+ return el;
257
+ },
258
+ setInvalid() {
259
+ const type = "is-danger";
260
+ const message = this.validationMessage || this.getElement().validationMessage;
261
+ this.setValidity(type, message);
262
+ },
263
+ setValidity(type, message) {
264
+ this.$nextTick(() => {
265
+ if (this.parentField) {
266
+ if (!this.parentField.type) {
267
+ this.parentField.newType = type;
268
+ }
269
+ if (!this.parentField.message) {
270
+ this.parentField.newMessage = message;
271
+ }
272
+ }
273
+ });
274
+ },
275
+ /*
276
+ * Check HTML5 validation, set isValid property.
277
+ * If validation fail, send 'is-danger' type,
278
+ * and error message to parent if it's a Field.
279
+ */
280
+ checkHtml5Validity() {
281
+ if (!this.useHtml5Validation) {
282
+ return false;
283
+ }
284
+ const el = this.getElement();
285
+ if (el == null) {
286
+ return false;
287
+ }
288
+ if (!el.checkValidity()) {
289
+ this.setInvalid();
290
+ this.isValid = false;
291
+ } else {
292
+ this.setValidity(null, null);
293
+ this.isValid = true;
294
+ }
295
+ return this.isValid;
296
+ }
297
+ }
298
+ });
299
+
300
+ const findFocusable = (element, programmatic = false) => {
301
+ if (!element) {
302
+ return null;
303
+ }
304
+ if (programmatic) {
305
+ return element.querySelectorAll('*[tabindex="-1"]');
306
+ }
307
+ return element.querySelectorAll(`a[href]:not([tabindex="-1"]),
308
+ area[href],
309
+ input:not([disabled]),
310
+ select:not([disabled]),
311
+ textarea:not([disabled]),
312
+ button:not([disabled]),
313
+ iframe,
314
+ object,
315
+ embed,
316
+ *[tabindex]:not([tabindex="-1"]),
317
+ *[contenteditable]`);
318
+ };
319
+ let onKeyDown;
320
+ const beforeMount = (el, { value = true }) => {
321
+ if (value) {
322
+ let focusable = findFocusable(el);
323
+ let focusableProg = findFocusable(el, true);
324
+ if (focusable && focusable.length > 0) {
325
+ onKeyDown = (event) => {
326
+ focusable = findFocusable(el);
327
+ focusableProg = findFocusable(el, true);
328
+ const firstFocusable = focusable[0];
329
+ const lastFocusable = focusable[focusable.length - 1];
330
+ if (event.target === firstFocusable && event.shiftKey && event.key === "Tab") {
331
+ event.preventDefault();
332
+ lastFocusable.focus();
333
+ } else if ((event.target === lastFocusable || Array.from(focusableProg).indexOf(event.target) >= 0) && !event.shiftKey && event.key === "Tab") {
334
+ event.preventDefault();
335
+ firstFocusable.focus();
336
+ }
337
+ };
338
+ el.addEventListener("keydown", onKeyDown);
339
+ }
340
+ }
341
+ };
342
+ const unmounted = (el) => {
343
+ el.removeEventListener("keydown", onKeyDown);
344
+ };
345
+ const directive = {
346
+ beforeMount,
347
+ unmounted
348
+ };
349
+
350
+ const DEFAULT_CLOSE_OPTIONS = ["escape", "outside"];
351
+ const DROPDOWN_INJECTION_KEY = Symbol("bdropdown");
352
+ var _sfc_main$4 = vue.defineComponent({
353
+ name: "BDropdown",
354
+ directives: {
355
+ trapFocus: directive
356
+ },
357
+ provide() {
358
+ return {
359
+ [DROPDOWN_INJECTION_KEY]: this
360
+ };
361
+ },
362
+ props: {
363
+ modelValue: {
364
+ type: [
365
+ String,
366
+ Number,
367
+ Boolean,
368
+ Object,
369
+ Array,
370
+ Function
371
+ ],
372
+ default: null
373
+ },
374
+ disabled: Boolean,
375
+ inline: Boolean,
376
+ scrollable: Boolean,
377
+ maxHeight: {
378
+ type: [String, Number],
379
+ default: 200
380
+ },
381
+ position: {
382
+ type: String,
383
+ validator(value) {
384
+ return [
385
+ "is-top-right",
386
+ "is-top-left",
387
+ "is-bottom-left",
388
+ "is-bottom-right"
389
+ ].indexOf(value) > -1;
390
+ }
391
+ },
392
+ triggers: {
393
+ type: Array,
394
+ default: () => ["click"]
395
+ },
396
+ mobileModal: {
397
+ type: Boolean,
398
+ default: () => {
399
+ return config.defaultDropdownMobileModal;
400
+ }
401
+ },
402
+ ariaRole: {
403
+ type: String,
404
+ validator(value) {
405
+ return [
406
+ "menu",
407
+ "list",
408
+ "dialog"
409
+ ].indexOf(value) > -1;
410
+ },
411
+ default: null
412
+ },
413
+ animation: {
414
+ type: String,
415
+ default: "fade"
416
+ },
417
+ multiple: Boolean,
418
+ trapFocus: {
419
+ type: Boolean,
420
+ default: () => {
421
+ return config.defaultTrapFocus;
422
+ }
423
+ },
424
+ closeOnClick: {
425
+ type: Boolean,
426
+ default: true
427
+ },
428
+ canClose: {
429
+ type: [Array, Boolean],
430
+ default: true
431
+ },
432
+ expanded: Boolean,
433
+ appendToBody: Boolean,
434
+ appendToBodyCopyParent: Boolean,
435
+ triggerTabindex: {
436
+ type: Number,
437
+ default: 0
438
+ }
439
+ },
440
+ emits: {
441
+ /* eslint-disable @typescript-eslint/no-unused-vars */
442
+ "active-change": (_isActive) => true,
443
+ change: (_selected) => true,
444
+ "update:modelValue": (_value) => true
445
+ /* eslint-enable @typescript-eslint/no-unused-vars */
446
+ },
447
+ data() {
448
+ return {
449
+ selected: this.modelValue,
450
+ style: {},
451
+ isActive: false,
452
+ isHoverable: false,
453
+ maybeTap: false,
454
+ isTouchEnabled: false,
455
+ _bodyEl: void 0,
456
+ // Used to append to body
457
+ timeOutID: void 0,
458
+ timeOutID2: void 0
459
+ };
460
+ },
461
+ computed: {
462
+ rootClasses() {
463
+ return [this.position, {
464
+ "is-disabled": this.disabled,
465
+ "is-hoverable": this.hoverable,
466
+ "is-inline": this.inline,
467
+ "is-active": this.isActive || this.inline,
468
+ "is-mobile-modal": this.isMobileModal,
469
+ "is-expanded": this.expanded,
470
+ "is-touch-enabled": this.isTouchEnabled
471
+ }];
472
+ },
473
+ isMobileModal() {
474
+ return this.mobileModal && !this.inline;
475
+ },
476
+ cancelOptions() {
477
+ return typeof this.canClose === "boolean" ? this.canClose ? DEFAULT_CLOSE_OPTIONS : [] : this.canClose;
478
+ },
479
+ contentStyle() {
480
+ var _a;
481
+ return {
482
+ maxHeight: this.scrollable ? (_a = toCssWidth(this.maxHeight)) != null ? _a : void 0 : void 0,
483
+ overflow: this.scrollable ? "auto" : void 0
484
+ };
485
+ },
486
+ hoverable() {
487
+ return this.triggers.indexOf("hover") >= 0;
488
+ }
489
+ },
490
+ watch: {
491
+ /*
492
+ * When v-model is changed set the new selected item.
493
+ */
494
+ modelValue(value) {
495
+ this.selected = value;
496
+ },
497
+ /*
498
+ * Emit event when isActive value is changed.
499
+ *
500
+ * Also resets `isTouchEnabled` when it turns inactive.
501
+ */
502
+ isActive(value) {
503
+ this.$emit("active-change", value);
504
+ if (!value) {
505
+ this.timeOutID = setTimeout(() => {
506
+ if (!this.isActive) {
507
+ this.isTouchEnabled = false;
508
+ }
509
+ }, 250);
510
+ }
511
+ this.handleScroll();
512
+ if (this.appendToBody) {
513
+ this.$nextTick(() => {
514
+ this.updateAppendToBody();
515
+ });
516
+ }
517
+ },
518
+ isHoverable(value) {
519
+ if (this.hoverable) {
520
+ this.$emit("active-change", value);
521
+ }
522
+ }
523
+ },
524
+ methods: {
525
+ handleScroll() {
526
+ if (typeof window === "undefined") return;
527
+ if (this.isMobileModal) {
528
+ if (this.isActive) {
529
+ document.documentElement.classList.add("is-clipped-touch");
530
+ } else {
531
+ document.documentElement.classList.remove("is-clipped-touch");
532
+ }
533
+ }
534
+ },
535
+ /*
536
+ * Click listener from DropdownItem.
537
+ * 1. Set new selected item.
538
+ * 2. Emit input event to update the user v-model.
539
+ * 3. Close the dropdown.
540
+ */
541
+ selectItem(value) {
542
+ if (this.multiple) {
543
+ if (this.selected) {
544
+ const selected = this.selected;
545
+ if (selected.indexOf(value) === -1) {
546
+ this.selected = [...selected, value];
547
+ } else {
548
+ this.selected = selected.filter((val) => val !== value);
549
+ }
550
+ } else {
551
+ this.selected = [value];
552
+ }
553
+ this.$emit("change", this.selected);
554
+ } else {
555
+ if (this.selected !== value) {
556
+ this.selected = value;
557
+ this.$emit("change", this.selected);
558
+ }
559
+ }
560
+ this.$emit("update:modelValue", this.selected);
561
+ if (!this.multiple) {
562
+ this.isActive = !this.closeOnClick;
563
+ if (this.hoverable && this.closeOnClick) {
564
+ this.isHoverable = false;
565
+ }
566
+ }
567
+ },
568
+ /*
569
+ * White-listed items to not close when clicked.
570
+ */
571
+ isInWhiteList(el) {
572
+ if (el === this.$refs.dropdownMenu) return true;
573
+ if (el === this.$refs.trigger) return true;
574
+ if (this.$refs.dropdownMenu != null) {
575
+ const children = this.$refs.dropdownMenu.querySelectorAll("*");
576
+ for (const child of children) {
577
+ if (el === child) {
578
+ return true;
579
+ }
580
+ }
581
+ }
582
+ if (this.$refs.trigger != null) {
583
+ const children = this.$refs.trigger.querySelectorAll("*");
584
+ for (const child of children) {
585
+ if (el === child) {
586
+ return true;
587
+ }
588
+ }
589
+ }
590
+ return false;
591
+ },
592
+ /*
593
+ * Close dropdown if clicked outside.
594
+ */
595
+ clickedOutside(event) {
596
+ if (this.cancelOptions.indexOf("outside") < 0) return;
597
+ if (this.inline) return;
598
+ const target = isCustomElement(this) ? event.composedPath()[0] : event.target;
599
+ if (!this.isInWhiteList(target)) this.isActive = false;
600
+ },
601
+ /*
602
+ * Keypress event that is bound to the document
603
+ */
604
+ keyPress({ key }) {
605
+ if (this.isActive && (key === "Escape" || key === "Esc")) {
606
+ if (this.cancelOptions.indexOf("escape") < 0) return;
607
+ this.isActive = false;
608
+ }
609
+ },
610
+ onClick() {
611
+ if (this.triggers.indexOf("hover") !== -1) return;
612
+ if (this.triggers.indexOf("click") < 0) return;
613
+ this.toggle();
614
+ },
615
+ onContextMenu() {
616
+ if (this.triggers.indexOf("contextmenu") < 0) return;
617
+ this.toggle();
618
+ },
619
+ onHover() {
620
+ if (this.triggers.indexOf("hover") < 0) return;
621
+ if (this.isTouchEnabled) return;
622
+ this.isHoverable = true;
623
+ },
624
+ // takes care of touch-enabled devices
625
+ // - does nothing if hover trigger is disabled
626
+ // - suppresses hover trigger by setting isTouchEnabled
627
+ // - handles only a tap; i.e., touchstart on the trigger immediately
628
+ // folowed by touchend
629
+ onTouchStart() {
630
+ this.maybeTap = true;
631
+ },
632
+ onTouchMove() {
633
+ this.maybeTap = false;
634
+ },
635
+ onTouchEnd(e) {
636
+ if (this.triggers.indexOf("hover") === -1) return;
637
+ if (!this.maybeTap) return;
638
+ e.preventDefault();
639
+ this.maybeTap = false;
640
+ this.isTouchEnabled = true;
641
+ this.toggle();
642
+ },
643
+ onFocus() {
644
+ if (this.triggers.indexOf("focus") < 0) return;
645
+ this.toggle();
646
+ },
647
+ /*
648
+ * Toggle dropdown if it's not disabled.
649
+ */
650
+ toggle() {
651
+ if (this.disabled) return;
652
+ if (!this.isActive) {
653
+ this.timeOutID2 = setTimeout(() => {
654
+ const value = !this.isActive;
655
+ this.isActive = value;
656
+ });
657
+ } else {
658
+ this.isActive = !this.isActive;
659
+ }
660
+ },
661
+ updateAppendToBody() {
662
+ const dropdown = this.$refs.dropdown;
663
+ const dropdownMenu = this.$refs.dropdownMenu;
664
+ const trigger = this.$refs.trigger;
665
+ if (dropdownMenu && trigger) {
666
+ const dropdownWrapper = this.$data._bodyEl.children[0];
667
+ dropdownWrapper.classList.forEach((item) => dropdownWrapper.classList.remove(item));
668
+ dropdownWrapper.classList.add("dropdown");
669
+ dropdownWrapper.classList.add("dropdown-menu-animation");
670
+ this.rootClasses.forEach((item) => {
671
+ if (item && typeof item === "object") {
672
+ for (const key in item) {
673
+ if (item[key]) {
674
+ dropdownWrapper.classList.add(key);
675
+ }
676
+ }
677
+ }
678
+ });
679
+ if (this.appendToBodyCopyParent) {
680
+ const parentNode = this.$refs.dropdown.parentNode;
681
+ const parent = this.$data._bodyEl;
682
+ parent.classList.forEach((item) => parent.classList.remove(item));
683
+ parentNode.classList.forEach((item) => {
684
+ parent.classList.add(item);
685
+ });
686
+ }
687
+ const rect = trigger.getBoundingClientRect();
688
+ let top = rect.top + window.scrollY;
689
+ let left = rect.left + window.scrollX;
690
+ if (!this.position || this.position.indexOf("bottom") >= 0) {
691
+ top += trigger.clientHeight;
692
+ } else {
693
+ top -= dropdownMenu.clientHeight;
694
+ }
695
+ if (this.position && this.position.indexOf("left") >= 0) {
696
+ left -= dropdownMenu.clientWidth - trigger.clientWidth;
697
+ }
698
+ this.style = {
699
+ position: "absolute",
700
+ top: `${top}px`,
701
+ left: `${left}px`,
702
+ zIndex: "99",
703
+ width: this.expanded ? `${dropdown.offsetWidth}px` : void 0
704
+ };
705
+ }
706
+ }
707
+ },
708
+ mounted() {
709
+ if (this.appendToBody) {
710
+ this.$data._bodyEl = createAbsoluteElement(this.$refs.dropdownMenu);
711
+ this.updateAppendToBody();
712
+ }
713
+ },
714
+ created() {
715
+ if (typeof window !== "undefined") {
716
+ document.addEventListener("click", this.clickedOutside);
717
+ document.addEventListener("keyup", this.keyPress);
718
+ }
719
+ },
720
+ beforeUnmount() {
721
+ if (typeof window !== "undefined") {
722
+ document.removeEventListener("click", this.clickedOutside);
723
+ document.removeEventListener("keyup", this.keyPress);
724
+ }
725
+ if (this.appendToBody) {
726
+ removeElement(this.$data._bodyEl);
727
+ }
728
+ clearTimeout(this.timeOutID);
729
+ clearTimeout(this.timeOutID2);
730
+ }
731
+ });
732
+
733
+ const _hoisted_1$3 = ["tabindex"];
734
+ const _hoisted_2$2 = ["aria-hidden"];
735
+ const _hoisted_3$2 = ["aria-hidden"];
736
+ const _hoisted_4$2 = ["role", "aria-modal"];
737
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
738
+ const _directive_trap_focus = vue.resolveDirective("trap-focus");
739
+ return vue.openBlock(), vue.createElementBlock(
740
+ "div",
741
+ {
742
+ class: vue.normalizeClass(["dropdown dropdown-menu-animation", _ctx.rootClasses]),
743
+ ref: "dropdown",
744
+ onMouseleave: _cache[7] || (_cache[7] = ($event) => _ctx.isHoverable = false)
745
+ },
746
+ [
747
+ !_ctx.inline ? (vue.openBlock(), vue.createElementBlock("div", {
748
+ key: 0,
749
+ tabindex: _ctx.disabled ? void 0 : _ctx.triggerTabindex,
750
+ ref: "trigger",
751
+ class: "dropdown-trigger",
752
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
753
+ onContextmenu: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.onContextMenu && _ctx.onContextMenu(...args), ["prevent"])),
754
+ onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.onHover && _ctx.onHover(...args)),
755
+ onFocusCapture: _cache[3] || (_cache[3] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
756
+ onTouchstart: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
757
+ onTouchmove: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
758
+ onTouchend: _cache[6] || (_cache[6] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
759
+ "aria-haspopup": "true"
760
+ }, [
761
+ vue.renderSlot(_ctx.$slots, "trigger", { active: _ctx.isActive })
762
+ ], 40, _hoisted_1$3)) : vue.createCommentVNode("v-if", true),
763
+ vue.createVNode(vue.Transition, { name: _ctx.animation }, {
764
+ default: vue.withCtx(() => [
765
+ _ctx.isMobileModal ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
766
+ key: 0,
767
+ class: "background",
768
+ "aria-hidden": !_ctx.isActive
769
+ }, null, 8, _hoisted_2$2)), [
770
+ [vue.vShow, _ctx.isActive]
771
+ ]) : vue.createCommentVNode("v-if", true)
772
+ ]),
773
+ _: 1
774
+ /* STABLE */
775
+ }, 8, ["name"]),
776
+ vue.createVNode(vue.Transition, {
777
+ name: _ctx.animation,
778
+ persisted: ""
779
+ }, {
780
+ default: vue.withCtx(() => [
781
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
782
+ ref: "dropdownMenu",
783
+ class: "dropdown-menu",
784
+ style: vue.normalizeStyle(_ctx.style),
785
+ "aria-hidden": !_ctx.isActive
786
+ }, [
787
+ vue.createElementVNode("div", {
788
+ class: "dropdown-content",
789
+ role: _ctx.ariaRole,
790
+ "aria-modal": !_ctx.inline,
791
+ style: vue.normalizeStyle(_ctx.contentStyle)
792
+ }, [
793
+ vue.renderSlot(_ctx.$slots, "default")
794
+ ], 12, _hoisted_4$2)
795
+ ], 12, _hoisted_3$2)), [
796
+ [vue.vShow, !_ctx.disabled && (_ctx.isActive || _ctx.isHoverable) || _ctx.inline],
797
+ [_directive_trap_focus, _ctx.trapFocus]
798
+ ])
799
+ ]),
800
+ _: 3
801
+ /* FORWARDED */
802
+ }, 8, ["name"])
803
+ ],
804
+ 34
805
+ /* CLASS, NEED_HYDRATION */
806
+ );
807
+ }
808
+ var BDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
809
+
810
+ const registerComponent = (Vue, component, name) => {
811
+ const componentName = component.name;
812
+ if (componentName == null) {
813
+ throw new Error("Buefy.registerComponent: missing component name");
814
+ }
815
+ Vue.component(componentName, component);
816
+ };
817
+
818
+ const mdiIcons = {
819
+ sizes: {
820
+ default: "mdi-24px",
821
+ "is-small": null,
822
+ "is-medium": "mdi-36px",
823
+ "is-large": "mdi-48px"
824
+ },
825
+ iconPrefix: "mdi-"
826
+ };
827
+ const faIcons = () => {
828
+ const faIconPrefix = "fa-";
829
+ return {
830
+ sizes: {
831
+ default: null,
832
+ "is-small": null,
833
+ "is-medium": faIconPrefix + "lg",
834
+ "is-large": faIconPrefix + "2x"
835
+ },
836
+ iconPrefix: faIconPrefix,
837
+ internalIcons: {
838
+ information: "info-circle",
839
+ alert: "exclamation-triangle",
840
+ "alert-circle": "exclamation-circle",
841
+ "chevron-right": "angle-right",
842
+ "chevron-left": "angle-left",
843
+ "chevron-down": "angle-down",
844
+ "eye-off": "eye-slash",
845
+ "menu-down": "caret-down",
846
+ "menu-up": "caret-up",
847
+ "close-circle": "times-circle"
848
+ }
849
+ };
850
+ };
851
+ const getIcons = () => {
852
+ let icons = {
853
+ mdi: mdiIcons,
854
+ fa: faIcons(),
855
+ fas: faIcons(),
856
+ far: faIcons(),
857
+ fad: faIcons(),
858
+ fab: faIcons(),
859
+ fal: faIcons(),
860
+ "fa-solid": faIcons(),
861
+ "fa-regular": faIcons(),
862
+ "fa-light": faIcons(),
863
+ "fa-thin": faIcons(),
864
+ "fa-duotone": faIcons(),
865
+ "fa-brands": faIcons()
866
+ };
867
+ return icons;
868
+ };
869
+
870
+ var _sfc_main$3 = vue.defineComponent({
871
+ name: "BIcon",
872
+ props: {
873
+ type: [String, Object],
874
+ component: String,
875
+ pack: String,
876
+ icon: {
877
+ type: String,
878
+ required: true
879
+ },
880
+ size: String,
881
+ customSize: String,
882
+ customClass: String,
883
+ both: Boolean
884
+ // This is used internally to show both MDI and FA icon
885
+ },
886
+ computed: {
887
+ iconConfig() {
888
+ const allIcons = getIcons();
889
+ return allIcons[this.newPack];
890
+ },
891
+ iconPrefix() {
892
+ if (this.iconConfig && this.iconConfig.iconPrefix) {
893
+ return this.iconConfig.iconPrefix;
894
+ }
895
+ return "";
896
+ },
897
+ /*
898
+ * Internal icon name based on the pack.
899
+ * If pack is 'fa', gets the equivalent FA icon name of the MDI,
900
+ * internal icons are always MDI.
901
+ */
902
+ newIcon() {
903
+ return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;
904
+ },
905
+ newPack() {
906
+ return this.pack || config.defaultIconPack;
907
+ },
908
+ newType() {
909
+ if (!this.type) return;
910
+ let splitType = [];
911
+ if (typeof this.type === "string") {
912
+ splitType = this.type.split("-");
913
+ } else {
914
+ for (const key in this.type) {
915
+ if (this.type[key]) {
916
+ splitType = key.split("-");
917
+ break;
918
+ }
919
+ }
920
+ }
921
+ if (splitType.length <= 1) return;
922
+ const [, ...type] = splitType;
923
+ return `has-text-${type.join("-")}`;
924
+ },
925
+ newCustomSize() {
926
+ return this.customSize || this.customSizeByPack;
927
+ },
928
+ customSizeByPack() {
929
+ if (this.iconConfig && this.iconConfig.sizes) {
930
+ if (this.size && this.iconConfig.sizes[this.size] !== void 0) {
931
+ return this.iconConfig.sizes[this.size];
932
+ } else if (this.iconConfig.sizes.default) {
933
+ return this.iconConfig.sizes.default;
934
+ }
935
+ }
936
+ return null;
937
+ },
938
+ useIconComponent() {
939
+ return this.component || config.defaultIconComponent;
940
+ }
941
+ },
942
+ methods: {
943
+ /*
944
+ * Equivalent icon name of the MDI.
945
+ */
946
+ getEquivalentIconOf(value) {
947
+ if (!this.both) {
948
+ return value;
949
+ }
950
+ if (this.iconConfig == null) {
951
+ return value;
952
+ }
953
+ const maybeInternal = this.iconConfig;
954
+ if (maybeInternal && maybeInternal.internalIcons && maybeInternal.internalIcons[value]) {
955
+ return maybeInternal.internalIcons[value];
956
+ }
957
+ return value;
958
+ }
959
+ }
960
+ });
961
+
962
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
963
+ return vue.openBlock(), vue.createElementBlock(
964
+ "span",
965
+ {
966
+ class: vue.normalizeClass(["icon", [_ctx.newType, _ctx.size]])
967
+ },
968
+ [
969
+ !_ctx.useIconComponent ? (vue.openBlock(), vue.createElementBlock(
970
+ "i",
971
+ {
972
+ key: 0,
973
+ class: vue.normalizeClass([_ctx.newPack, _ctx.newIcon, _ctx.newCustomSize, _ctx.customClass])
974
+ },
975
+ null,
976
+ 2
977
+ /* CLASS */
978
+ )) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.useIconComponent), {
979
+ key: 1,
980
+ icon: [_ctx.newPack, _ctx.newIcon],
981
+ size: _ctx.newCustomSize,
982
+ class: vue.normalizeClass([_ctx.customClass])
983
+ }, null, 8, ["icon", "size", "class"]))
984
+ ],
985
+ 2
986
+ /* CLASS */
987
+ );
988
+ }
989
+ var BIcon = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
990
+
991
+ var _sfc_main$2 = vue.defineComponent({
992
+ name: "BInput",
993
+ components: { BIcon },
994
+ mixins: [CompatFallthroughMixin, FormElementMixin],
995
+ props: {
996
+ modelValue: {
997
+ type: [Number, String]
998
+ },
999
+ type: {
1000
+ type: String,
1001
+ default: "text"
1002
+ },
1003
+ lazy: {
1004
+ type: Boolean,
1005
+ default: false
1006
+ },
1007
+ passwordReveal: Boolean,
1008
+ iconClickable: Boolean,
1009
+ hasCounter: {
1010
+ type: Boolean,
1011
+ default: () => config.defaultInputHasCounter
1012
+ },
1013
+ customClass: {
1014
+ type: String,
1015
+ default: ""
1016
+ },
1017
+ iconRight: String,
1018
+ iconRightClickable: Boolean,
1019
+ iconRightType: String,
1020
+ // Native options to use in HTML5 validation
1021
+ autocomplete: String
1022
+ },
1023
+ emits: {
1024
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1025
+ "icon-click": (event) => true,
1026
+ "icon-right-click": (event) => true,
1027
+ "update:modelValue": (value) => true
1028
+ /* eslint-enable @typescript-eslint/no-unused-vars */
1029
+ },
1030
+ data() {
1031
+ return {
1032
+ newValue: this.modelValue,
1033
+ newType: this.type,
1034
+ newAutocomplete: this.autocomplete || config.defaultInputAutocomplete,
1035
+ isPasswordVisible: false,
1036
+ _elementRef: this.type === "textarea" ? "textarea" : "input"
1037
+ };
1038
+ },
1039
+ computed: {
1040
+ computedValue: {
1041
+ get() {
1042
+ return this.newValue;
1043
+ },
1044
+ set(value) {
1045
+ this.newValue = value;
1046
+ this.$emit("update:modelValue", value);
1047
+ }
1048
+ },
1049
+ rootClasses() {
1050
+ return [
1051
+ this.iconPosition,
1052
+ this.size,
1053
+ {
1054
+ "is-expanded": this.expanded,
1055
+ "is-loading": this.loading,
1056
+ "is-clearfix": !this.hasMessage
1057
+ }
1058
+ ];
1059
+ },
1060
+ inputClasses() {
1061
+ return [
1062
+ this.statusType,
1063
+ this.size,
1064
+ { "is-rounded": this.rounded }
1065
+ ];
1066
+ },
1067
+ hasIconRight() {
1068
+ return this.passwordReveal || this.loading || this.statusIcon && this.statusTypeIcon || this.iconRight;
1069
+ },
1070
+ rightIcon() {
1071
+ if (this.passwordReveal) {
1072
+ return this.passwordVisibleIcon;
1073
+ } else if (this.iconRight) {
1074
+ return this.iconRight;
1075
+ }
1076
+ return this.statusTypeIcon;
1077
+ },
1078
+ rightIconType() {
1079
+ if (this.passwordReveal) {
1080
+ return "is-primary";
1081
+ } else if (this.iconRight) {
1082
+ return this.iconRightType || void 0;
1083
+ }
1084
+ return this.statusType;
1085
+ },
1086
+ /*
1087
+ * Position of the icon or if it's both sides.
1088
+ */
1089
+ iconPosition() {
1090
+ let iconClasses = "";
1091
+ if (this.icon) {
1092
+ iconClasses += "has-icons-left ";
1093
+ }
1094
+ if (this.hasIconRight) {
1095
+ iconClasses += "has-icons-right";
1096
+ }
1097
+ return iconClasses;
1098
+ },
1099
+ /*
1100
+ * Icon name (MDI) based on the type.
1101
+ */
1102
+ statusTypeIcon() {
1103
+ switch (this.statusType) {
1104
+ case "is-success":
1105
+ return "check";
1106
+ case "is-danger":
1107
+ return "alert-circle";
1108
+ case "is-info":
1109
+ return "information";
1110
+ case "is-warning":
1111
+ return "alert";
1112
+ default:
1113
+ return void 0;
1114
+ }
1115
+ },
1116
+ /*
1117
+ * Check if have any message prop from parent if it's a Field.
1118
+ */
1119
+ hasMessage() {
1120
+ return !!this.statusMessage;
1121
+ },
1122
+ /*
1123
+ * Current password-reveal icon name.
1124
+ */
1125
+ passwordVisibleIcon() {
1126
+ return !this.isPasswordVisible ? "eye" : "eye-off";
1127
+ },
1128
+ /*
1129
+ * Get value length
1130
+ */
1131
+ valueLength() {
1132
+ if (typeof this.computedValue === "string") {
1133
+ return Array.from(this.computedValue).length;
1134
+ } else if (typeof this.computedValue === "number") {
1135
+ return this.computedValue.toString().length;
1136
+ }
1137
+ return 0;
1138
+ }
1139
+ },
1140
+ watch: {
1141
+ /*
1142
+ * When v-model is changed:
1143
+ * 1. Set internal value.
1144
+ * 2. Validate it if the value came from outside;
1145
+ * i.e., not equal to computedValue
1146
+ */
1147
+ modelValue(value) {
1148
+ const fromOutside = this.computedValue != value;
1149
+ this.newValue = value;
1150
+ if (fromOutside) {
1151
+ this.$nextTick(() => {
1152
+ !this.isValid && this.checkHtml5Validity();
1153
+ });
1154
+ }
1155
+ },
1156
+ type(type) {
1157
+ this.newType = type;
1158
+ }
1159
+ },
1160
+ methods: {
1161
+ /*
1162
+ * Toggle the visibility of a password-reveal input
1163
+ * by changing the type and focus the input right away.
1164
+ */
1165
+ togglePasswordVisibility() {
1166
+ this.isPasswordVisible = !this.isPasswordVisible;
1167
+ this.newType = this.isPasswordVisible ? "text" : "password";
1168
+ this.$nextTick(() => {
1169
+ this.focus();
1170
+ });
1171
+ },
1172
+ iconClick(emit, event) {
1173
+ this.$emit(emit, event);
1174
+ this.$nextTick(() => {
1175
+ this.focus();
1176
+ });
1177
+ },
1178
+ rightIconClick(event) {
1179
+ if (this.passwordReveal) {
1180
+ this.togglePasswordVisibility();
1181
+ } else if (this.iconRightClickable) {
1182
+ this.iconClick("icon-right-click", event);
1183
+ }
1184
+ },
1185
+ onInput() {
1186
+ if (!this.lazy) {
1187
+ this.revalidate();
1188
+ }
1189
+ },
1190
+ onChange() {
1191
+ if (this.lazy) {
1192
+ this.revalidate();
1193
+ }
1194
+ },
1195
+ revalidate() {
1196
+ !this.isValid && this.checkHtml5Validity();
1197
+ }
1198
+ }
1199
+ });
1200
+
1201
+ const _hoisted_1$2 = ["type", "autocomplete", "maxlength"];
1202
+ const _hoisted_2$1 = ["maxlength"];
1203
+ const _hoisted_3$1 = ["type", "autocomplete", "maxlength"];
1204
+ const _hoisted_4$1 = ["maxlength"];
1205
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
1206
+ const _component_b_icon = vue.resolveComponent("b-icon");
1207
+ return vue.openBlock(), vue.createElementBlock(
1208
+ "div",
1209
+ vue.mergeProps({
1210
+ class: ["control", _ctx.rootClasses]
1211
+ }, _ctx.rootAttrs),
1212
+ [
1213
+ _ctx.lazy ? (vue.openBlock(), vue.createElementBlock(
1214
+ vue.Fragment,
1215
+ { key: 0 },
1216
+ [
1217
+ _ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
1218
+ key: 0,
1219
+ ref: "input",
1220
+ class: ["input", [_ctx.inputClasses, _ctx.customClass]],
1221
+ type: _ctx.newType,
1222
+ autocomplete: _ctx.newAutocomplete,
1223
+ maxlength: _ctx.maxlength,
1224
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event)
1225
+ }, _ctx.fallthroughAttrs, {
1226
+ onInput: _cache[1] || (_cache[1] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1227
+ onChange: _cache[2] || (_cache[2] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1228
+ onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1229
+ onFocus: _cache[4] || (_cache[4] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1230
+ }), null, 16, _hoisted_1$2)), [
1231
+ [
1232
+ vue.vModelDynamic,
1233
+ _ctx.computedValue,
1234
+ void 0,
1235
+ { lazy: true }
1236
+ ]
1237
+ ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
1238
+ key: 1,
1239
+ ref: "textarea",
1240
+ class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
1241
+ maxlength: _ctx.maxlength,
1242
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.computedValue = $event)
1243
+ }, _ctx.fallthroughAttrs, {
1244
+ onInput: _cache[6] || (_cache[6] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1245
+ onChange: _cache[7] || (_cache[7] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1246
+ onBlur: _cache[8] || (_cache[8] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1247
+ onFocus: _cache[9] || (_cache[9] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1248
+ }), null, 16, _hoisted_2$1)), [
1249
+ [
1250
+ vue.vModelText,
1251
+ _ctx.computedValue,
1252
+ void 0,
1253
+ { lazy: true }
1254
+ ]
1255
+ ])
1256
+ ],
1257
+ 64
1258
+ /* STABLE_FRAGMENT */
1259
+ )) : (vue.openBlock(), vue.createElementBlock(
1260
+ vue.Fragment,
1261
+ { key: 1 },
1262
+ [
1263
+ _ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
1264
+ key: 0,
1265
+ ref: "input",
1266
+ class: ["input", [_ctx.inputClasses, _ctx.customClass]],
1267
+ type: _ctx.newType,
1268
+ autocomplete: _ctx.newAutocomplete,
1269
+ maxlength: _ctx.maxlength,
1270
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.computedValue = $event)
1271
+ }, _ctx.fallthroughAttrs, {
1272
+ onInput: _cache[11] || (_cache[11] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1273
+ onChange: _cache[12] || (_cache[12] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1274
+ onBlur: _cache[13] || (_cache[13] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1275
+ onFocus: _cache[14] || (_cache[14] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1276
+ }), null, 16, _hoisted_3$1)), [
1277
+ [vue.vModelDynamic, _ctx.computedValue]
1278
+ ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
1279
+ key: 1,
1280
+ ref: "textarea",
1281
+ class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
1282
+ maxlength: _ctx.maxlength,
1283
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.computedValue = $event)
1284
+ }, _ctx.fallthroughAttrs, {
1285
+ onInput: _cache[16] || (_cache[16] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1286
+ onChange: _cache[17] || (_cache[17] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1287
+ onBlur: _cache[18] || (_cache[18] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1288
+ onFocus: _cache[19] || (_cache[19] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1289
+ }), null, 16, _hoisted_4$1)), [
1290
+ [vue.vModelText, _ctx.computedValue]
1291
+ ])
1292
+ ],
1293
+ 64
1294
+ /* STABLE_FRAGMENT */
1295
+ )),
1296
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
1297
+ key: 2,
1298
+ class: vue.normalizeClass(["is-left", { "is-clickable": _ctx.iconClickable }]),
1299
+ icon: _ctx.icon,
1300
+ pack: _ctx.iconPack,
1301
+ size: _ctx.iconSize,
1302
+ onClick: _cache[20] || (_cache[20] = ($event) => _ctx.iconClick("icon-click", $event))
1303
+ }, null, 8, ["class", "icon", "pack", "size"])) : vue.createCommentVNode("v-if", true),
1304
+ !_ctx.loading && _ctx.hasIconRight && _ctx.rightIcon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
1305
+ key: 3,
1306
+ class: vue.normalizeClass(["is-right", { "is-clickable": _ctx.passwordReveal || _ctx.iconRightClickable }]),
1307
+ icon: _ctx.rightIcon,
1308
+ pack: _ctx.iconPack,
1309
+ size: _ctx.iconSize,
1310
+ type: _ctx.rightIconType,
1311
+ both: "",
1312
+ onClick: _ctx.rightIconClick
1313
+ }, null, 8, ["class", "icon", "pack", "size", "type", "onClick"])) : vue.createCommentVNode("v-if", true),
1314
+ _ctx.maxlength && _ctx.hasCounter && _ctx.type !== "number" ? (vue.openBlock(), vue.createElementBlock(
1315
+ "small",
1316
+ {
1317
+ key: 4,
1318
+ class: vue.normalizeClass(["help counter", { "is-invisible": !_ctx.isFocused }])
1319
+ },
1320
+ vue.toDisplayString(_ctx.valueLength) + " / " + vue.toDisplayString(_ctx.maxlength),
1321
+ 3
1322
+ /* TEXT, CLASS */
1323
+ )) : vue.createCommentVNode("v-if", true)
1324
+ ],
1325
+ 16
1326
+ /* FULL_PROPS */
1327
+ );
1328
+ }
1329
+ var BInput = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
1330
+
1331
+ const AM = "AM";
1332
+ const PM = "PM";
1333
+ const HOUR_FORMAT_24 = "24";
1334
+ const HOUR_FORMAT_12 = "12";
1335
+ const defaultTimeFormatter = (date, vm) => {
1336
+ return vm.dtf.format(date);
1337
+ };
1338
+ const defaultTimeParser = (timeString, vm) => {
1339
+ if (timeString) {
1340
+ let d = null;
1341
+ if (vm.computedValue && !isNaN(vm.computedValue.valueOf())) {
1342
+ d = new Date(vm.computedValue);
1343
+ } else {
1344
+ d = vm.timeCreator();
1345
+ d.setMilliseconds(0);
1346
+ }
1347
+ if (vm.dtf.formatToParts && typeof vm.dtf.formatToParts === "function") {
1348
+ const formatRegex = vm.dtf.formatToParts(d).map((part) => {
1349
+ if (part.type === "literal") {
1350
+ return part.value.replace(/ /g, "\\s?");
1351
+ } else if (part.type === "dayPeriod") {
1352
+ return `((?!=<${part.type}>)(${vm.amString}|${vm.pmString}|${AM}|${PM}|${AM.toLowerCase()}|${PM.toLowerCase()})?)`;
1353
+ }
1354
+ return `((?!=<${part.type}>)\\d+)`;
1355
+ }).join("");
1356
+ const timeGroups = matchWithGroups(formatRegex, timeString);
1357
+ timeGroups.hour = timeGroups.hour ? parseInt(timeGroups.hour + "", 10) : null;
1358
+ timeGroups.minute = timeGroups.minute ? parseInt(timeGroups.minute + "", 10) : null;
1359
+ timeGroups.second = timeGroups.second ? parseInt(timeGroups.second + "", 10) : null;
1360
+ if (timeGroups.hour && timeGroups.hour >= 0 && timeGroups.hour < 24 && timeGroups.minute && timeGroups.minute >= 0 && timeGroups.minute < 59) {
1361
+ const dayPeriod = timeGroups.dayPeriod;
1362
+ if (dayPeriod && (dayPeriod.toLowerCase() === vm.pmString.toLowerCase() || dayPeriod.toLowerCase() === PM.toLowerCase()) && timeGroups.hour < 12) {
1363
+ timeGroups.hour += 12;
1364
+ }
1365
+ d.setHours(timeGroups.hour);
1366
+ d.setMinutes(timeGroups.minute);
1367
+ d.setSeconds(timeGroups.second || 0);
1368
+ return d;
1369
+ }
1370
+ }
1371
+ let am = false;
1372
+ if (vm.hourFormat === HOUR_FORMAT_12) {
1373
+ const dateString12 = timeString.split(" ");
1374
+ timeString = dateString12[0];
1375
+ am = dateString12[1] === vm.amString || dateString12[1] === AM;
1376
+ }
1377
+ const time = timeString.split(":");
1378
+ let hours = parseInt(time[0], 10);
1379
+ const minutes = parseInt(time[1], 10);
1380
+ const seconds = vm.enableSeconds ? parseInt(time[2], 10) : 0;
1381
+ if (isNaN(hours) || hours < 0 || hours > 23 || vm.hourFormat === HOUR_FORMAT_12 && (hours < 1 || hours > 12) || isNaN(minutes) || minutes < 0 || minutes > 59) {
1382
+ return null;
1383
+ }
1384
+ d.setSeconds(seconds);
1385
+ d.setMinutes(minutes);
1386
+ if (vm.hourFormat === HOUR_FORMAT_12) {
1387
+ if (am && hours === 12) {
1388
+ hours = 0;
1389
+ } else if (!am && hours !== 12) {
1390
+ hours += 12;
1391
+ }
1392
+ }
1393
+ d.setHours(hours);
1394
+ return new Date(d.getTime());
1395
+ }
1396
+ return null;
1397
+ };
1398
+ var TimepickerMixin = vue.defineComponent({
1399
+ mixins: [CompatFallthroughMixin, FormElementMixin],
1400
+ props: {
1401
+ modelValue: [Date, null],
1402
+ inline: Boolean,
1403
+ minTime: [Date, null],
1404
+ maxTime: [Date, null],
1405
+ placeholder: String,
1406
+ editable: Boolean,
1407
+ disabled: Boolean,
1408
+ hourFormat: {
1409
+ type: String,
1410
+ validator: (value) => {
1411
+ return value === HOUR_FORMAT_24 || value === HOUR_FORMAT_12;
1412
+ }
1413
+ },
1414
+ incrementHours: {
1415
+ type: Number,
1416
+ default: 1
1417
+ },
1418
+ incrementMinutes: {
1419
+ type: Number,
1420
+ default: 1
1421
+ },
1422
+ incrementSeconds: {
1423
+ type: Number,
1424
+ default: 1
1425
+ },
1426
+ timeFormatter: {
1427
+ type: Function,
1428
+ default: (date, vm) => {
1429
+ {
1430
+ return defaultTimeFormatter(date, vm);
1431
+ }
1432
+ }
1433
+ },
1434
+ timeParser: {
1435
+ type: Function,
1436
+ default: (date, vm) => {
1437
+ {
1438
+ return defaultTimeParser(date, vm);
1439
+ }
1440
+ }
1441
+ },
1442
+ mobileNative: {
1443
+ type: Boolean,
1444
+ default: () => config.defaultTimepickerMobileNative
1445
+ },
1446
+ mobileModal: {
1447
+ type: Boolean,
1448
+ default: () => config.defaultTimepickerMobileModal
1449
+ },
1450
+ timeCreator: {
1451
+ type: Function,
1452
+ default: () => {
1453
+ {
1454
+ return /* @__PURE__ */ new Date();
1455
+ }
1456
+ }
1457
+ },
1458
+ position: String,
1459
+ unselectableTimes: Array,
1460
+ openOnFocus: Boolean,
1461
+ enableSeconds: Boolean,
1462
+ defaultMinutes: Number,
1463
+ defaultSeconds: Number,
1464
+ focusable: {
1465
+ type: Boolean,
1466
+ default: true
1467
+ },
1468
+ tzOffset: {
1469
+ type: Number,
1470
+ default: 0
1471
+ },
1472
+ appendToBody: Boolean,
1473
+ resetOnMeridianChange: {
1474
+ type: Boolean,
1475
+ default: false
1476
+ }
1477
+ },
1478
+ emits: {
1479
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1480
+ "update:modelValue": (_value) => true
1481
+ },
1482
+ data() {
1483
+ return {
1484
+ dateSelected: this.modelValue,
1485
+ hoursSelected: null,
1486
+ minutesSelected: null,
1487
+ secondsSelected: null,
1488
+ meridienSelected: null,
1489
+ _elementRef: "input",
1490
+ AM,
1491
+ PM,
1492
+ HOUR_FORMAT_24,
1493
+ HOUR_FORMAT_12
1494
+ };
1495
+ },
1496
+ computed: {
1497
+ computedValue: {
1498
+ get() {
1499
+ return this.dateSelected;
1500
+ },
1501
+ set(value) {
1502
+ this.dateSelected = value;
1503
+ this.$emit("update:modelValue", this.dateSelected);
1504
+ }
1505
+ },
1506
+ localeOptions() {
1507
+ return new Intl.DateTimeFormat(this.locale, {
1508
+ hour: "numeric",
1509
+ minute: "numeric",
1510
+ second: this.enableSeconds ? "numeric" : void 0
1511
+ }).resolvedOptions();
1512
+ },
1513
+ dtf() {
1514
+ return new Intl.DateTimeFormat(this.locale, {
1515
+ hour: this.localeOptions.hour || "numeric",
1516
+ minute: this.localeOptions.minute || "numeric",
1517
+ second: this.enableSeconds ? this.localeOptions.second || "numeric" : void 0,
1518
+ // Fixes 12 hour display github.com/buefy/buefy/issues/3418
1519
+ hourCycle: !this.isHourFormat24 ? "h12" : "h23"
1520
+ });
1521
+ },
1522
+ newHourFormat() {
1523
+ return this.hourFormat || (this.localeOptions.hour12 ? HOUR_FORMAT_12 : HOUR_FORMAT_24);
1524
+ },
1525
+ sampleTime() {
1526
+ const d = this.timeCreator();
1527
+ d.setHours(10);
1528
+ d.setSeconds(0);
1529
+ d.setMinutes(0);
1530
+ d.setMilliseconds(0);
1531
+ return d;
1532
+ },
1533
+ hourLiteral() {
1534
+ if (this.dtf.formatToParts && typeof this.dtf.formatToParts === "function") {
1535
+ const d = this.sampleTime;
1536
+ const parts = this.dtf.formatToParts(d);
1537
+ const literal = parts.find((part, idx) => idx > 0 && parts[idx - 1].type === "hour");
1538
+ if (literal) {
1539
+ return literal.value;
1540
+ }
1541
+ }
1542
+ return ":";
1543
+ },
1544
+ minuteLiteral() {
1545
+ if (this.dtf.formatToParts && typeof this.dtf.formatToParts === "function") {
1546
+ const d = this.sampleTime;
1547
+ const parts = this.dtf.formatToParts(d);
1548
+ const literal = parts.find((part, idx) => idx > 0 && parts[idx - 1].type === "minute");
1549
+ if (literal) {
1550
+ return literal.value;
1551
+ }
1552
+ }
1553
+ return ":";
1554
+ },
1555
+ secondLiteral() {
1556
+ if (this.dtf.formatToParts && typeof this.dtf.formatToParts === "function") {
1557
+ const d = this.sampleTime;
1558
+ const parts = this.dtf.formatToParts(d);
1559
+ const literal = parts.find((part, idx) => idx > 0 && parts[idx - 1].type === "second");
1560
+ if (literal) {
1561
+ return literal.value;
1562
+ }
1563
+ }
1564
+ return void 0;
1565
+ },
1566
+ amString() {
1567
+ if (this.dtf.formatToParts && typeof this.dtf.formatToParts === "function") {
1568
+ const d = this.sampleTime;
1569
+ d.setHours(10);
1570
+ const dayPeriod = this.dtf.formatToParts(d).find((part) => part.type === "dayPeriod");
1571
+ if (dayPeriod) {
1572
+ return dayPeriod.value;
1573
+ }
1574
+ }
1575
+ return AM;
1576
+ },
1577
+ pmString() {
1578
+ if (this.dtf.formatToParts && typeof this.dtf.formatToParts === "function") {
1579
+ const d = this.sampleTime;
1580
+ d.setHours(20);
1581
+ const dayPeriod = this.dtf.formatToParts(d).find((part) => part.type === "dayPeriod");
1582
+ if (dayPeriod) {
1583
+ return dayPeriod.value;
1584
+ }
1585
+ }
1586
+ return PM;
1587
+ },
1588
+ hours() {
1589
+ if (!this.incrementHours || this.incrementHours < 1) throw new Error("Hour increment cannot be null or less than 1.");
1590
+ const hours = [];
1591
+ const numberOfHours = this.isHourFormat24 ? 24 : 12;
1592
+ for (let i = 0; i < numberOfHours; i += this.incrementHours) {
1593
+ let value = i;
1594
+ let label = value;
1595
+ if (!this.isHourFormat24) {
1596
+ value = i + 1;
1597
+ label = value;
1598
+ if (this.meridienSelected === this.amString) {
1599
+ if (value === 12) {
1600
+ value = 0;
1601
+ }
1602
+ } else if (this.meridienSelected === this.pmString) {
1603
+ if (value !== 12) {
1604
+ value += 12;
1605
+ }
1606
+ }
1607
+ }
1608
+ hours.push({
1609
+ label: this.formatNumber(label),
1610
+ value
1611
+ });
1612
+ }
1613
+ return hours;
1614
+ },
1615
+ minutes() {
1616
+ if (!this.incrementMinutes || this.incrementMinutes < 1) throw new Error("Minute increment cannot be null or less than 1.");
1617
+ const minutes = [];
1618
+ for (let i = 0; i < 60; i += this.incrementMinutes) {
1619
+ minutes.push({
1620
+ label: this.formatNumber(i, true),
1621
+ value: i
1622
+ });
1623
+ }
1624
+ return minutes;
1625
+ },
1626
+ seconds() {
1627
+ if (!this.incrementSeconds || this.incrementSeconds < 1) throw new Error("Second increment cannot be null or less than 1.");
1628
+ const seconds = [];
1629
+ for (let i = 0; i < 60; i += this.incrementSeconds) {
1630
+ seconds.push({
1631
+ label: this.formatNumber(i, true),
1632
+ value: i
1633
+ });
1634
+ }
1635
+ return seconds;
1636
+ },
1637
+ meridiens() {
1638
+ return [this.amString, this.pmString];
1639
+ },
1640
+ isMobile() {
1641
+ return this.mobileNative && isMobile.any();
1642
+ },
1643
+ isHourFormat24() {
1644
+ return this.newHourFormat === HOUR_FORMAT_24;
1645
+ },
1646
+ disabledOrUndefined() {
1647
+ return this.disabled || void 0;
1648
+ }
1649
+ },
1650
+ watch: {
1651
+ hourFormat() {
1652
+ if (this.hoursSelected !== null) {
1653
+ this.meridienSelected = this.hoursSelected >= 12 ? this.pmString : this.amString;
1654
+ }
1655
+ },
1656
+ locale() {
1657
+ if (!this.modelValue) {
1658
+ this.meridienSelected = this.amString;
1659
+ }
1660
+ },
1661
+ /*
1662
+ * When v-model is changed:
1663
+ * 1. Update internal value.
1664
+ * 2. If it's invalid, validate again.
1665
+ */
1666
+ modelValue: {
1667
+ handler(value) {
1668
+ this.updateInternalState(value);
1669
+ !this.isValid && this.$refs.input.checkHtml5Validity();
1670
+ },
1671
+ immediate: true
1672
+ }
1673
+ },
1674
+ methods: {
1675
+ onMeridienChange(value) {
1676
+ if (this.hoursSelected !== null && this.resetOnMeridianChange) {
1677
+ this.hoursSelected = null;
1678
+ this.minutesSelected = null;
1679
+ this.secondsSelected = null;
1680
+ this.computedValue = null;
1681
+ } else if (this.hoursSelected !== null) {
1682
+ if (value === this.pmString) {
1683
+ this.hoursSelected += 12;
1684
+ } else if (value === this.amString) {
1685
+ this.hoursSelected -= 12;
1686
+ }
1687
+ }
1688
+ this.updateDateSelected(
1689
+ this.hoursSelected,
1690
+ this.minutesSelected,
1691
+ this.enableSeconds ? this.secondsSelected : 0,
1692
+ value
1693
+ );
1694
+ },
1695
+ onHoursChange(value) {
1696
+ if (!this.minutesSelected && typeof this.defaultMinutes !== "undefined") {
1697
+ this.minutesSelected = this.defaultMinutes;
1698
+ }
1699
+ if (!this.secondsSelected && typeof this.defaultSeconds !== "undefined") {
1700
+ this.secondsSelected = this.defaultSeconds;
1701
+ }
1702
+ this.updateDateSelected(
1703
+ parseInt(`${value}`, 10),
1704
+ this.minutesSelected,
1705
+ this.enableSeconds ? this.secondsSelected : 0,
1706
+ this.meridienSelected
1707
+ );
1708
+ },
1709
+ onMinutesChange(value) {
1710
+ if (!this.secondsSelected && this.defaultSeconds) {
1711
+ this.secondsSelected = this.defaultSeconds;
1712
+ }
1713
+ this.updateDateSelected(
1714
+ this.hoursSelected,
1715
+ parseInt(`${value}`, 10),
1716
+ this.enableSeconds ? this.secondsSelected : 0,
1717
+ this.meridienSelected
1718
+ );
1719
+ },
1720
+ onSecondsChange(value) {
1721
+ this.updateDateSelected(
1722
+ this.hoursSelected,
1723
+ this.minutesSelected,
1724
+ parseInt(`${value}`, 10),
1725
+ this.meridienSelected
1726
+ );
1727
+ },
1728
+ updateDateSelected(hours, minutes, seconds, meridiens) {
1729
+ if (hours != null && minutes != null && (!this.isHourFormat24 && meridiens !== null || this.isHourFormat24)) {
1730
+ let time = null;
1731
+ if (this.computedValue && !isNaN(this.computedValue.valueOf())) {
1732
+ time = new Date(this.computedValue);
1733
+ } else {
1734
+ time = this.timeCreator();
1735
+ time.setMilliseconds(0);
1736
+ }
1737
+ time.setHours(hours);
1738
+ time.setMinutes(minutes);
1739
+ time.setSeconds(seconds);
1740
+ if (!isNaN(time.getTime())) this.computedValue = new Date(time.getTime());
1741
+ }
1742
+ },
1743
+ updateInternalState(value) {
1744
+ if (value) {
1745
+ this.hoursSelected = value.getHours();
1746
+ this.minutesSelected = value.getMinutes();
1747
+ this.secondsSelected = value.getSeconds();
1748
+ this.meridienSelected = value.getHours() >= 12 ? this.pmString : this.amString;
1749
+ } else {
1750
+ this.hoursSelected = null;
1751
+ this.minutesSelected = null;
1752
+ this.secondsSelected = null;
1753
+ this.meridienSelected = this.amString;
1754
+ }
1755
+ this.dateSelected = value;
1756
+ },
1757
+ isHourDisabled(hour) {
1758
+ let disabled = false;
1759
+ if (this.minTime) {
1760
+ const minHours = this.minTime.getHours();
1761
+ const noMinutesAvailable = this.minutes.every((minute) => {
1762
+ return this.isMinuteDisabledForHour(hour, minute.value);
1763
+ });
1764
+ disabled = hour < minHours || noMinutesAvailable;
1765
+ }
1766
+ if (this.maxTime) {
1767
+ if (!disabled) {
1768
+ const maxHours = this.maxTime.getHours();
1769
+ disabled = hour > maxHours;
1770
+ }
1771
+ }
1772
+ if (this.unselectableTimes) {
1773
+ if (!disabled) {
1774
+ const unselectable = this.unselectableTimes.filter((time) => {
1775
+ if (this.enableSeconds && this.secondsSelected !== null) {
1776
+ return time.getHours() === hour && time.getMinutes() === this.minutesSelected && time.getSeconds() === this.secondsSelected;
1777
+ } else if (this.minutesSelected !== null) {
1778
+ return time.getHours() === hour && time.getMinutes() === this.minutesSelected;
1779
+ }
1780
+ return false;
1781
+ });
1782
+ if (unselectable.length > 0) {
1783
+ disabled = true;
1784
+ } else {
1785
+ disabled = this.minutes.every((minute) => {
1786
+ return this.unselectableTimes.filter((time) => {
1787
+ return time.getHours() === hour && time.getMinutes() === minute.value;
1788
+ }).length > 0;
1789
+ });
1790
+ }
1791
+ }
1792
+ }
1793
+ return disabled;
1794
+ },
1795
+ isMinuteDisabledForHour(hour, minute) {
1796
+ let disabled = false;
1797
+ if (this.minTime) {
1798
+ const minHours = this.minTime.getHours();
1799
+ const minMinutes = this.minTime.getMinutes();
1800
+ disabled = hour === minHours && minute < minMinutes;
1801
+ }
1802
+ if (this.maxTime) {
1803
+ if (!disabled) {
1804
+ const maxHours = this.maxTime.getHours();
1805
+ const maxMinutes = this.maxTime.getMinutes();
1806
+ disabled = hour === maxHours && minute > maxMinutes;
1807
+ }
1808
+ }
1809
+ return disabled;
1810
+ },
1811
+ isMinuteDisabled(minute) {
1812
+ let disabled = false;
1813
+ if (this.hoursSelected !== null) {
1814
+ if (this.isHourDisabled(this.hoursSelected)) {
1815
+ disabled = true;
1816
+ } else {
1817
+ disabled = this.isMinuteDisabledForHour(this.hoursSelected, minute);
1818
+ }
1819
+ if (this.unselectableTimes) {
1820
+ if (!disabled) {
1821
+ const unselectable = this.unselectableTimes.filter((time) => {
1822
+ if (this.enableSeconds && this.secondsSelected !== null) {
1823
+ return time.getHours() === this.hoursSelected && time.getMinutes() === minute && time.getSeconds() === this.secondsSelected;
1824
+ } else {
1825
+ return time.getHours() === this.hoursSelected && time.getMinutes() === minute;
1826
+ }
1827
+ });
1828
+ disabled = unselectable.length > 0;
1829
+ }
1830
+ }
1831
+ }
1832
+ return disabled;
1833
+ },
1834
+ isSecondDisabled(second) {
1835
+ let disabled = false;
1836
+ if (this.minutesSelected !== null) {
1837
+ if (this.isMinuteDisabled(this.minutesSelected)) {
1838
+ disabled = true;
1839
+ } else {
1840
+ if (this.minTime) {
1841
+ const minHours = this.minTime.getHours();
1842
+ const minMinutes = this.minTime.getMinutes();
1843
+ const minSeconds = this.minTime.getSeconds();
1844
+ disabled = this.hoursSelected === minHours && this.minutesSelected === minMinutes && second < minSeconds;
1845
+ }
1846
+ if (this.maxTime) {
1847
+ if (!disabled) {
1848
+ const maxHours = this.maxTime.getHours();
1849
+ const maxMinutes = this.maxTime.getMinutes();
1850
+ const maxSeconds = this.maxTime.getSeconds();
1851
+ disabled = this.hoursSelected === maxHours && this.minutesSelected === maxMinutes && second > maxSeconds;
1852
+ }
1853
+ }
1854
+ }
1855
+ if (this.unselectableTimes) {
1856
+ if (!disabled) {
1857
+ const unselectable = this.unselectableTimes.filter((time) => {
1858
+ return time.getHours() === this.hoursSelected && time.getMinutes() === this.minutesSelected && time.getSeconds() === second;
1859
+ });
1860
+ disabled = unselectable.length > 0;
1861
+ }
1862
+ }
1863
+ }
1864
+ return disabled;
1865
+ },
1866
+ /*
1867
+ * Parse string into date
1868
+ */
1869
+ onChange(value) {
1870
+ const date = this.timeParser(value, this);
1871
+ this.updateInternalState(date);
1872
+ if (date && !isNaN(date.valueOf())) {
1873
+ this.computedValue = date;
1874
+ } else {
1875
+ this.computedValue = null;
1876
+ this.$refs.input.newValue = this.computedValue;
1877
+ }
1878
+ },
1879
+ /*
1880
+ * Toggle timepicker
1881
+ */
1882
+ toggle(active) {
1883
+ if (this.$refs.dropdown) {
1884
+ this.$refs.dropdown.isActive = typeof active === "boolean" ? active : !this.$refs.dropdown.isActive;
1885
+ }
1886
+ },
1887
+ /*
1888
+ * Close timepicker
1889
+ */
1890
+ close() {
1891
+ this.toggle(false);
1892
+ },
1893
+ /*
1894
+ * Call default onFocus method and show timepicker
1895
+ */
1896
+ handleOnFocus() {
1897
+ this.onFocus();
1898
+ if (this.openOnFocus) {
1899
+ this.toggle(true);
1900
+ }
1901
+ },
1902
+ /*
1903
+ * Format date into string 'HH-MM-SS'
1904
+ */
1905
+ formatHHMMSS(value) {
1906
+ const date = new Date(value);
1907
+ if (value && !isNaN(date.valueOf())) {
1908
+ const hours = date.getHours();
1909
+ const minutes = date.getMinutes();
1910
+ const seconds = date.getSeconds();
1911
+ return this.formatNumber(hours, true) + ":" + this.formatNumber(minutes, true) + ":" + this.formatNumber(seconds, true);
1912
+ }
1913
+ return "";
1914
+ },
1915
+ /*
1916
+ * Parse time from string
1917
+ */
1918
+ onChangeNativePicker(event) {
1919
+ const date = event.target.value;
1920
+ if (date) {
1921
+ let time = null;
1922
+ if (this.computedValue && !isNaN(this.computedValue.valueOf())) {
1923
+ time = new Date(this.computedValue);
1924
+ } else {
1925
+ time = /* @__PURE__ */ new Date();
1926
+ time.setMilliseconds(0);
1927
+ }
1928
+ const t = date.split(":");
1929
+ time.setHours(parseInt(t[0], 10));
1930
+ time.setMinutes(parseInt(t[1], 10));
1931
+ time.setSeconds(t[2] ? parseInt(t[2], 10) : 0);
1932
+ this.computedValue = new Date(time.getTime());
1933
+ } else {
1934
+ this.computedValue = null;
1935
+ }
1936
+ },
1937
+ formatNumber(value, prependZero) {
1938
+ return this.isHourFormat24 || prependZero ? this.pad(value) : `${value}`;
1939
+ },
1940
+ pad(value) {
1941
+ return (value < 10 ? "0" : "") + value;
1942
+ },
1943
+ /*
1944
+ * Format date into string
1945
+ */
1946
+ formatValue(date) {
1947
+ if (date && !isNaN(date.valueOf())) {
1948
+ return this.timeFormatter(date, this);
1949
+ } else {
1950
+ return null;
1951
+ }
1952
+ },
1953
+ /*
1954
+ * Keypress event that is bound to the document.
1955
+ */
1956
+ keyPress({ key }) {
1957
+ if (this.$refs.dropdown && this.$refs.dropdown.isActive && (key === "Escape" || key === "Esc")) {
1958
+ this.toggle(false);
1959
+ }
1960
+ },
1961
+ /*
1962
+ * Emit 'blur' event on dropdown is not active (closed)
1963
+ */
1964
+ onActiveChange(value) {
1965
+ if (!value) {
1966
+ this.onBlur();
1967
+ }
1968
+ }
1969
+ },
1970
+ created() {
1971
+ if (typeof window !== "undefined") {
1972
+ document.addEventListener("keyup", this.keyPress);
1973
+ }
1974
+ },
1975
+ beforeUnmounted() {
1976
+ if (typeof window !== "undefined") {
1977
+ document.removeEventListener("keyup", this.keyPress);
1978
+ }
1979
+ }
1980
+ });
1981
+
1982
+ const indicatorSize = 40;
1983
+ const paddingInner = 5;
1984
+ var _sfc_main$1 = vue.defineComponent({
1985
+ name: "BClockpickerFace",
1986
+ props: {
1987
+ pickerSize: Number,
1988
+ min: Number,
1989
+ max: Number,
1990
+ double: Boolean,
1991
+ value: Number,
1992
+ faceNumbers: Array,
1993
+ disabledValues: Function
1994
+ },
1995
+ emits: {
1996
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1997
+ change: (_value) => true,
1998
+ input: (_value) => true
1999
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2000
+ },
2001
+ data() {
2002
+ return {
2003
+ isDragging: false,
2004
+ inputValue: this.value,
2005
+ prevAngle: 720
2006
+ };
2007
+ },
2008
+ computed: {
2009
+ /*
2010
+ * How many number indicators are shown on the face
2011
+ */
2012
+ count() {
2013
+ return this.max - this.min + 1;
2014
+ },
2015
+ /*
2016
+ * How many number indicators are shown per ring on the face
2017
+ */
2018
+ countPerRing() {
2019
+ return this.double ? this.count / 2 : this.count;
2020
+ },
2021
+ /*
2022
+ * Radius of the clock face
2023
+ */
2024
+ radius() {
2025
+ return this.pickerSize / 2;
2026
+ },
2027
+ /*
2028
+ * Radius of the outer ring of number indicators
2029
+ */
2030
+ outerRadius() {
2031
+ return this.radius - paddingInner - indicatorSize / 2;
2032
+ },
2033
+ /*
2034
+ * Radius of the inner ring of number indicators
2035
+ */
2036
+ innerRadius() {
2037
+ return Math.max(
2038
+ this.outerRadius * 0.6,
2039
+ this.outerRadius - paddingInner - indicatorSize
2040
+ );
2041
+ },
2042
+ /*
2043
+ * The angle for each selectable value
2044
+ * For hours this ends up being 30 degrees, for minutes 6 degrees
2045
+ */
2046
+ degreesPerUnit() {
2047
+ return 360 / this.countPerRing;
2048
+ },
2049
+ /*
2050
+ * Used for calculating x/y grid location based on degrees
2051
+ */
2052
+ degrees() {
2053
+ return this.degreesPerUnit * Math.PI / 180;
2054
+ },
2055
+ /*
2056
+ * Calculates the angle the clock hand should be rotated for the
2057
+ * selected value
2058
+ */
2059
+ handRotateAngle() {
2060
+ let currentAngle = this.prevAngle;
2061
+ while (currentAngle < 0) currentAngle += 360;
2062
+ const targetAngle = this.calcHandAngle(this.displayedValue);
2063
+ const degreesDiff = this.shortestDistanceDegrees(currentAngle, targetAngle);
2064
+ const angle = this.prevAngle + degreesDiff;
2065
+ return angle;
2066
+ },
2067
+ /*
2068
+ * Determines how long the selector hand is based on if the
2069
+ * selected value is located along the outer or inner ring
2070
+ */
2071
+ handScale() {
2072
+ return this.calcHandScale(this.displayedValue);
2073
+ },
2074
+ handStyle() {
2075
+ return {
2076
+ transform: `rotate(${this.handRotateAngle}deg) scaleY(${this.handScale})`,
2077
+ transition: ".3s cubic-bezier(.25,.8,.50,1)"
2078
+ };
2079
+ },
2080
+ /*
2081
+ * The value the hand should be pointing at
2082
+ */
2083
+ displayedValue() {
2084
+ return this.inputValue == null ? this.min : this.inputValue;
2085
+ }
2086
+ },
2087
+ watch: {
2088
+ value(value) {
2089
+ if (value !== this.inputValue) {
2090
+ this.prevAngle = this.handRotateAngle;
2091
+ }
2092
+ this.inputValue = value;
2093
+ }
2094
+ },
2095
+ methods: {
2096
+ isDisabled(value) {
2097
+ return this.disabledValues && this.disabledValues(value);
2098
+ },
2099
+ /*
2100
+ * Calculates the distance between two points
2101
+ */
2102
+ euclidean(p0, p1) {
2103
+ const dx = p1.x - p0.x;
2104
+ const dy = p1.y - p0.y;
2105
+ return Math.sqrt(dx * dx + dy * dy);
2106
+ },
2107
+ shortestDistanceDegrees(start, stop) {
2108
+ const modDiff = (stop - start) % 360;
2109
+ const shortestDistance = 180 - Math.abs(Math.abs(modDiff) - 180);
2110
+ return (modDiff + 360) % 360 < 180 ? shortestDistance * 1 : shortestDistance * -1;
2111
+ },
2112
+ /*
2113
+ * Calculates the angle of the line from the center point
2114
+ * to the given point.
2115
+ */
2116
+ coordToAngle(center, p1) {
2117
+ const value = 2 * Math.atan2(p1.y - center.y - this.euclidean(center, p1), p1.x - center.x);
2118
+ return Math.abs(value * 180 / Math.PI);
2119
+ },
2120
+ /*
2121
+ * Generates the inline style translate() property for a
2122
+ * number indicator, which determines it's location on the
2123
+ * clock face
2124
+ */
2125
+ getNumberTranslate(value) {
2126
+ const { x, y } = this.getNumberCoords(value);
2127
+ return `translate(${x}px, ${y}px)`;
2128
+ },
2129
+ /*
2130
+ * Calculates the coordinates on the clock face for a number
2131
+ * indicator value
2132
+ */
2133
+ getNumberCoords(value) {
2134
+ const radius = this.isInnerRing(value) ? this.innerRadius : this.outerRadius;
2135
+ return {
2136
+ x: Math.round(radius * Math.sin((value - this.min) * this.degrees)),
2137
+ y: Math.round(-radius * Math.cos((value - this.min) * this.degrees))
2138
+ };
2139
+ },
2140
+ getFaceNumberClasses(num) {
2141
+ return {
2142
+ active: num.value === this.displayedValue,
2143
+ disabled: this.isDisabled(num.value)
2144
+ };
2145
+ },
2146
+ /*
2147
+ * Determines if a value resides on the inner ring
2148
+ */
2149
+ isInnerRing(value) {
2150
+ return this.double && value - this.min >= this.countPerRing;
2151
+ },
2152
+ calcHandAngle(value) {
2153
+ let angle = this.degreesPerUnit * (value - this.min);
2154
+ if (this.isInnerRing(value)) angle -= 360;
2155
+ return angle;
2156
+ },
2157
+ calcHandScale(value) {
2158
+ return this.isInnerRing(value) ? this.innerRadius / this.outerRadius : 1;
2159
+ },
2160
+ onMouseDown(e) {
2161
+ e.preventDefault();
2162
+ this.isDragging = true;
2163
+ this.onDragMove(e);
2164
+ },
2165
+ onMouseUp() {
2166
+ this.isDragging = false;
2167
+ if (!this.isDisabled(this.inputValue)) {
2168
+ this.$emit("change", this.inputValue);
2169
+ }
2170
+ },
2171
+ onDragMove(e) {
2172
+ e.preventDefault();
2173
+ if (!this.isDragging && e.type !== "click") return;
2174
+ const { width, top, left } = this.$refs.clock.getBoundingClientRect();
2175
+ const { clientX, clientY } = "touches" in e ? e.touches[0] : e;
2176
+ const center = { x: width / 2, y: -width / 2 };
2177
+ const coords = { x: clientX - left, y: top - clientY };
2178
+ const handAngle = Math.round(this.coordToAngle(center, coords) + 360) % 360;
2179
+ const insideClick = this.double && this.euclidean(center, coords) < (this.outerRadius + this.innerRadius) / 2 - 16;
2180
+ let value = Math.round(handAngle / this.degreesPerUnit) + this.min + (insideClick ? this.countPerRing : 0);
2181
+ if (handAngle >= 360 - this.degreesPerUnit / 2) {
2182
+ value = insideClick ? this.max : this.min;
2183
+ }
2184
+ this.update(value);
2185
+ },
2186
+ update(value) {
2187
+ if (this.inputValue !== value && !this.isDisabled(value)) {
2188
+ this.prevAngle = this.handRotateAngle;
2189
+ this.inputValue = value;
2190
+ this.$emit("input", value);
2191
+ }
2192
+ }
2193
+ }
2194
+ });
2195
+
2196
+ const _hoisted_1$1 = {
2197
+ class: "b-clockpicker-face-outer-ring",
2198
+ ref: "clock"
2199
+ };
2200
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
2201
+ return vue.openBlock(), vue.createElementBlock(
2202
+ "div",
2203
+ {
2204
+ class: "b-clockpicker-face",
2205
+ onMousedown: _cache[0] || (_cache[0] = (...args) => _ctx.onMouseDown && _ctx.onMouseDown(...args)),
2206
+ onMouseup: _cache[1] || (_cache[1] = (...args) => _ctx.onMouseUp && _ctx.onMouseUp(...args)),
2207
+ onMousemove: _cache[2] || (_cache[2] = (...args) => _ctx.onDragMove && _ctx.onDragMove(...args)),
2208
+ onTouchstart: _cache[3] || (_cache[3] = (...args) => _ctx.onMouseDown && _ctx.onMouseDown(...args)),
2209
+ onTouchend: _cache[4] || (_cache[4] = (...args) => _ctx.onMouseUp && _ctx.onMouseUp(...args)),
2210
+ onTouchmove: _cache[5] || (_cache[5] = (...args) => _ctx.onDragMove && _ctx.onDragMove(...args))
2211
+ },
2212
+ [
2213
+ vue.createElementVNode(
2214
+ "div",
2215
+ _hoisted_1$1,
2216
+ [
2217
+ vue.createElementVNode(
2218
+ "div",
2219
+ {
2220
+ class: "b-clockpicker-face-hand",
2221
+ style: vue.normalizeStyle(_ctx.handStyle)
2222
+ },
2223
+ null,
2224
+ 4
2225
+ /* STYLE */
2226
+ ),
2227
+ (vue.openBlock(true), vue.createElementBlock(
2228
+ vue.Fragment,
2229
+ null,
2230
+ vue.renderList(_ctx.faceNumbers, (num, index) => {
2231
+ return vue.openBlock(), vue.createElementBlock(
2232
+ "span",
2233
+ {
2234
+ key: index,
2235
+ class: vue.normalizeClass(["b-clockpicker-face-number", _ctx.getFaceNumberClasses(num)]),
2236
+ style: vue.normalizeStyle({ transform: _ctx.getNumberTranslate(num.value) })
2237
+ },
2238
+ [
2239
+ vue.createElementVNode(
2240
+ "span",
2241
+ null,
2242
+ vue.toDisplayString(num.label),
2243
+ 1
2244
+ /* TEXT */
2245
+ )
2246
+ ],
2247
+ 6
2248
+ /* CLASS, STYLE */
2249
+ );
2250
+ }),
2251
+ 128
2252
+ /* KEYED_FRAGMENT */
2253
+ ))
2254
+ ],
2255
+ 512
2256
+ /* NEED_PATCH */
2257
+ )
2258
+ ],
2259
+ 32
2260
+ /* NEED_HYDRATION */
2261
+ );
2262
+ }
2263
+ var BClockpickerFace = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
2264
+
2265
+ const outerPadding = 12;
2266
+ var _sfc_main = vue.defineComponent({
2267
+ name: "BClockpicker",
2268
+ components: {
2269
+ BClockpickerFace,
2270
+ BInput,
2271
+ BDropdown
2272
+ },
2273
+ mixins: [TimepickerMixin],
2274
+ props: {
2275
+ pickerSize: {
2276
+ type: Number,
2277
+ default: 290
2278
+ },
2279
+ incrementMinutes: {
2280
+ type: Number,
2281
+ default: 5
2282
+ },
2283
+ type: {
2284
+ type: String,
2285
+ default: "is-primary"
2286
+ },
2287
+ hoursLabel: {
2288
+ type: String,
2289
+ default: () => "Hours"
2290
+ },
2291
+ minutesLabel: {
2292
+ type: String,
2293
+ default: () => "Min"
2294
+ }
2295
+ },
2296
+ data() {
2297
+ return {
2298
+ isSelectingHour: true,
2299
+ isDragging: false,
2300
+ _isClockpicker: true
2301
+ };
2302
+ },
2303
+ computed: {
2304
+ hoursDisplay() {
2305
+ if (this.hoursSelected == null) return "--";
2306
+ if (this.isHourFormat24) return this.pad(this.hoursSelected);
2307
+ let display = this.hoursSelected;
2308
+ if (this.meridienSelected === this.pmString) {
2309
+ display -= 12;
2310
+ }
2311
+ if (display === 0) display = 12;
2312
+ return display;
2313
+ },
2314
+ minutesDisplay() {
2315
+ return this.minutesSelected == null ? "--" : this.pad(this.minutesSelected);
2316
+ },
2317
+ minFaceValue() {
2318
+ return this.isSelectingHour && !this.isHourFormat24 && this.meridienSelected === this.pmString ? 12 : 0;
2319
+ },
2320
+ maxFaceValue() {
2321
+ return this.isSelectingHour ? !this.isHourFormat24 && this.meridienSelected === this.amString ? 11 : 23 : 59;
2322
+ },
2323
+ faceSize() {
2324
+ return this.pickerSize - outerPadding * 2;
2325
+ },
2326
+ faceDisabledValues() {
2327
+ return this.isSelectingHour ? this.isHourDisabled : this.isMinuteDisabled;
2328
+ }
2329
+ },
2330
+ methods: {
2331
+ onClockInput(value) {
2332
+ if (this.isSelectingHour) {
2333
+ this.hoursSelected = value;
2334
+ this.onHoursChange(value);
2335
+ } else {
2336
+ this.minutesSelected = value;
2337
+ this.onMinutesChange(value);
2338
+ }
2339
+ },
2340
+ onClockChange() {
2341
+ if (this.isSelectingHour) {
2342
+ this.isSelectingHour = !this.isSelectingHour;
2343
+ } else {
2344
+ this.toggle(false);
2345
+ }
2346
+ },
2347
+ /*
2348
+ * Toggle clockpicker
2349
+ */
2350
+ toggle(active) {
2351
+ if (this.$refs.dropdown) {
2352
+ const dropdown = this.$refs.dropdown;
2353
+ dropdown.isActive = active != null ? active : !dropdown.isActive;
2354
+ if (dropdown.isActive) {
2355
+ this.isSelectingHour = true;
2356
+ }
2357
+ }
2358
+ },
2359
+ onMeridienClick(value) {
2360
+ if (this.meridienSelected !== value) {
2361
+ this.meridienSelected = value;
2362
+ this.onMeridienChange(value);
2363
+ }
2364
+ },
2365
+ /*
2366
+ * Avoid dropdown toggle when is already visible
2367
+ */
2368
+ onInputClick(event) {
2369
+ if (this.$refs.dropdown.isActive) {
2370
+ event.stopPropagation();
2371
+ }
2372
+ }
2373
+ }
2374
+ });
2375
+
2376
+ const _hoisted_1 = ["disabled"];
2377
+ const _hoisted_2 = {
2378
+ key: 0,
2379
+ class: "card-header"
2380
+ };
2381
+ const _hoisted_3 = { class: "b-clockpicker-header card-header-title" };
2382
+ const _hoisted_4 = { class: "b-clockpicker-time" };
2383
+ const _hoisted_5 = {
2384
+ key: 0,
2385
+ class: "b-clockpicker-period"
2386
+ };
2387
+ const _hoisted_6 = { class: "card-content" };
2388
+ const _hoisted_7 = {
2389
+ key: 0,
2390
+ class: "b-clockpicker-time"
2391
+ };
2392
+ const _hoisted_8 = {
2393
+ key: 1,
2394
+ class: "b-clockpicker-period"
2395
+ };
2396
+ const _hoisted_9 = {
2397
+ key: 1,
2398
+ class: "b-clockpicker-footer card-footer"
2399
+ };
2400
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
2401
+ const _component_b_input = vue.resolveComponent("b-input");
2402
+ const _component_b_clockpicker_face = vue.resolveComponent("b-clockpicker-face");
2403
+ const _component_b_dropdown = vue.resolveComponent("b-dropdown");
2404
+ return vue.openBlock(), vue.createElementBlock(
2405
+ "div",
2406
+ vue.mergeProps({
2407
+ class: ["b-clockpicker control", [_ctx.size, _ctx.type, { "is-expanded": _ctx.expanded }]]
2408
+ }, _ctx.rootAttrs),
2409
+ [
2410
+ !_ctx.isMobile || _ctx.inline ? (vue.openBlock(), vue.createBlock(_component_b_dropdown, {
2411
+ key: 0,
2412
+ ref: "dropdown",
2413
+ position: _ctx.position,
2414
+ disabled: _ctx.disabledOrUndefined,
2415
+ inline: _ctx.inline,
2416
+ "mobile-modal": _ctx.mobileModal,
2417
+ "append-to-body": _ctx.appendToBody,
2418
+ "append-to-body-copy-parent": "",
2419
+ onActiveChange: _ctx.onActiveChange
2420
+ }, vue.createSlots({
2421
+ default: vue.withCtx(() => [
2422
+ vue.createElementVNode("div", {
2423
+ class: "card",
2424
+ disabled: _ctx.disabledOrUndefined,
2425
+ custom: ""
2426
+ }, [
2427
+ _ctx.inline ? (vue.openBlock(), vue.createElementBlock("header", _hoisted_2, [
2428
+ vue.createElementVNode("div", _hoisted_3, [
2429
+ vue.createElementVNode("div", _hoisted_4, [
2430
+ vue.createElementVNode(
2431
+ "span",
2432
+ {
2433
+ class: vue.normalizeClass(["b-clockpicker-btn", { active: _ctx.isSelectingHour }]),
2434
+ onClick: _cache[3] || (_cache[3] = ($event) => _ctx.isSelectingHour = true)
2435
+ },
2436
+ vue.toDisplayString(_ctx.hoursDisplay),
2437
+ 3
2438
+ /* TEXT, CLASS */
2439
+ ),
2440
+ vue.createElementVNode(
2441
+ "span",
2442
+ null,
2443
+ vue.toDisplayString(_ctx.hourLiteral),
2444
+ 1
2445
+ /* TEXT */
2446
+ ),
2447
+ vue.createElementVNode(
2448
+ "span",
2449
+ {
2450
+ class: vue.normalizeClass(["b-clockpicker-btn", { active: !_ctx.isSelectingHour }]),
2451
+ onClick: _cache[4] || (_cache[4] = ($event) => _ctx.isSelectingHour = false)
2452
+ },
2453
+ vue.toDisplayString(_ctx.minutesDisplay),
2454
+ 3
2455
+ /* TEXT, CLASS */
2456
+ )
2457
+ ]),
2458
+ !_ctx.isHourFormat24 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [
2459
+ vue.createElementVNode(
2460
+ "div",
2461
+ {
2462
+ class: vue.normalizeClass(["b-clockpicker-btn", {
2463
+ active: _ctx.meridienSelected === _ctx.amString || _ctx.meridienSelected === _ctx.AM
2464
+ }]),
2465
+ onClick: _cache[5] || (_cache[5] = ($event) => _ctx.onMeridienClick(_ctx.amString))
2466
+ },
2467
+ vue.toDisplayString(_ctx.amString),
2468
+ 3
2469
+ /* TEXT, CLASS */
2470
+ ),
2471
+ vue.createElementVNode(
2472
+ "div",
2473
+ {
2474
+ class: vue.normalizeClass(["b-clockpicker-btn", {
2475
+ active: _ctx.meridienSelected === _ctx.pmString || _ctx.meridienSelected === _ctx.PM
2476
+ }]),
2477
+ onClick: _cache[6] || (_cache[6] = ($event) => _ctx.onMeridienClick(_ctx.pmString))
2478
+ },
2479
+ vue.toDisplayString(_ctx.pmString),
2480
+ 3
2481
+ /* TEXT, CLASS */
2482
+ )
2483
+ ])) : vue.createCommentVNode("v-if", true)
2484
+ ])
2485
+ ])) : vue.createCommentVNode("v-if", true),
2486
+ vue.createElementVNode("div", _hoisted_6, [
2487
+ vue.createElementVNode(
2488
+ "div",
2489
+ {
2490
+ class: "b-clockpicker-body",
2491
+ style: vue.normalizeStyle({ width: _ctx.faceSize + "px", height: _ctx.faceSize + "px" })
2492
+ },
2493
+ [
2494
+ !_ctx.inline ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
2495
+ vue.createElementVNode(
2496
+ "div",
2497
+ {
2498
+ class: vue.normalizeClass(["b-clockpicker-btn", { active: _ctx.isSelectingHour }]),
2499
+ onClick: _cache[7] || (_cache[7] = ($event) => _ctx.isSelectingHour = true)
2500
+ },
2501
+ vue.toDisplayString(_ctx.hoursLabel),
2502
+ 3
2503
+ /* TEXT, CLASS */
2504
+ ),
2505
+ vue.createElementVNode(
2506
+ "span",
2507
+ {
2508
+ class: vue.normalizeClass(["b-clockpicker-btn", { active: !_ctx.isSelectingHour }]),
2509
+ onClick: _cache[8] || (_cache[8] = ($event) => _ctx.isSelectingHour = false)
2510
+ },
2511
+ vue.toDisplayString(_ctx.minutesLabel),
2512
+ 3
2513
+ /* TEXT, CLASS */
2514
+ )
2515
+ ])) : vue.createCommentVNode("v-if", true),
2516
+ !_ctx.isHourFormat24 && !_ctx.inline ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_8, [
2517
+ vue.createElementVNode(
2518
+ "div",
2519
+ {
2520
+ class: vue.normalizeClass(["b-clockpicker-btn", {
2521
+ active: _ctx.meridienSelected === _ctx.amString || _ctx.meridienSelected === _ctx.AM
2522
+ }]),
2523
+ onClick: _cache[9] || (_cache[9] = ($event) => _ctx.onMeridienClick(_ctx.amString))
2524
+ },
2525
+ vue.toDisplayString(_ctx.amString),
2526
+ 3
2527
+ /* TEXT, CLASS */
2528
+ ),
2529
+ vue.createElementVNode(
2530
+ "div",
2531
+ {
2532
+ class: vue.normalizeClass(["b-clockpicker-btn", {
2533
+ active: _ctx.meridienSelected === _ctx.pmString || _ctx.meridienSelected === _ctx.PM
2534
+ }]),
2535
+ onClick: _cache[10] || (_cache[10] = ($event) => _ctx.onMeridienClick(_ctx.pmString))
2536
+ },
2537
+ vue.toDisplayString(_ctx.pmString),
2538
+ 3
2539
+ /* TEXT, CLASS */
2540
+ )
2541
+ ])) : vue.createCommentVNode("v-if", true),
2542
+ vue.createVNode(_component_b_clockpicker_face, {
2543
+ ref: "clockpickerFace",
2544
+ "picker-size": _ctx.faceSize,
2545
+ min: _ctx.minFaceValue,
2546
+ max: _ctx.maxFaceValue,
2547
+ "face-numbers": _ctx.isSelectingHour ? _ctx.hours : _ctx.minutes,
2548
+ "disabled-values": _ctx.faceDisabledValues,
2549
+ double: _ctx.isSelectingHour && _ctx.isHourFormat24,
2550
+ value: _ctx.isSelectingHour ? _ctx.hoursSelected ?? void 0 : _ctx.minutesSelected ?? void 0,
2551
+ onInput: _ctx.onClockInput,
2552
+ onChange: _ctx.onClockChange
2553
+ }, null, 8, ["picker-size", "min", "max", "face-numbers", "disabled-values", "double", "value", "onInput", "onChange"])
2554
+ ],
2555
+ 4
2556
+ /* STYLE */
2557
+ )
2558
+ ]),
2559
+ _ctx.$slots.default !== void 0 && _ctx.$slots.default([]).length ? (vue.openBlock(), vue.createElementBlock("footer", _hoisted_9, [
2560
+ vue.renderSlot(_ctx.$slots, "default")
2561
+ ])) : vue.createCommentVNode("v-if", true)
2562
+ ], 8, _hoisted_1)
2563
+ ]),
2564
+ _: 2
2565
+ /* DYNAMIC */
2566
+ }, [
2567
+ !_ctx.inline ? {
2568
+ name: "trigger",
2569
+ fn: vue.withCtx(() => [
2570
+ vue.renderSlot(_ctx.$slots, "trigger", {}, () => [
2571
+ vue.createVNode(_component_b_input, vue.mergeProps({
2572
+ ref: "input",
2573
+ autocomplete: "off",
2574
+ "model-value": _ctx.formatValue(_ctx.computedValue),
2575
+ placeholder: _ctx.placeholder,
2576
+ size: _ctx.size,
2577
+ icon: _ctx.icon,
2578
+ "icon-pack": _ctx.iconPack,
2579
+ loading: _ctx.loading,
2580
+ disabled: _ctx.disabledOrUndefined,
2581
+ readonly: !_ctx.editable,
2582
+ rounded: _ctx.rounded
2583
+ }, _ctx.fallthroughAttrs, {
2584
+ "use-html5-validation": _ctx.useHtml5Validation,
2585
+ onClick: _ctx.onInputClick,
2586
+ onKeyup: _cache[0] || (_cache[0] = vue.withKeys(($event) => _ctx.toggle(true), ["enter"])),
2587
+ onChange: _cache[1] || (_cache[1] = ($event) => _ctx.onChange($event.target.value)),
2588
+ onFocus: _ctx.handleOnFocus,
2589
+ onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.checkHtml5Validity())
2590
+ }), null, 16, ["model-value", "placeholder", "size", "icon", "icon-pack", "loading", "disabled", "readonly", "rounded", "use-html5-validation", "onClick", "onFocus"])
2591
+ ])
2592
+ ]),
2593
+ key: "0"
2594
+ } : void 0
2595
+ ]), 1032, ["position", "disabled", "inline", "mobile-modal", "append-to-body", "onActiveChange"])) : (vue.openBlock(), vue.createBlock(_component_b_input, vue.mergeProps({
2596
+ key: 1,
2597
+ ref: "input",
2598
+ type: "time",
2599
+ autocomplete: "off",
2600
+ "model-value": _ctx.formatHHMMSS(_ctx.computedValue),
2601
+ placeholder: _ctx.placeholder,
2602
+ size: _ctx.size,
2603
+ icon: _ctx.icon,
2604
+ "icon-pack": _ctx.iconPack,
2605
+ loading: _ctx.loading,
2606
+ max: _ctx.formatHHMMSS(_ctx.maxTime),
2607
+ min: _ctx.formatHHMMSS(_ctx.minTime),
2608
+ disabled: _ctx.disabledOrUndefined,
2609
+ readonly: false
2610
+ }, _ctx.fallthroughAttrs, {
2611
+ "use-html5-validation": _ctx.useHtml5Validation,
2612
+ onClick: _cache[11] || (_cache[11] = vue.withModifiers(($event) => _ctx.toggle(true), ["stop"])),
2613
+ onKeyup: _cache[12] || (_cache[12] = vue.withKeys(($event) => _ctx.toggle(true), ["enter"])),
2614
+ onChange: _ctx.onChangeNativePicker,
2615
+ onFocus: _ctx.handleOnFocus,
2616
+ onBlur: _cache[13] || (_cache[13] = ($event) => _ctx.onBlur() && _ctx.checkHtml5Validity())
2617
+ }), null, 16, ["model-value", "placeholder", "size", "icon", "icon-pack", "loading", "max", "min", "disabled", "use-html5-validation", "onChange", "onFocus"]))
2618
+ ],
2619
+ 16
2620
+ /* FULL_PROPS */
2621
+ );
2622
+ }
2623
+ var Clockpicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
2624
+
2625
+ const Plugin = {
2626
+ install(Vue) {
2627
+ registerComponent(Vue, Clockpicker);
2628
+ }
2629
+ };
2630
+
2631
+ exports.BClockpicker = Clockpicker;
2632
+ exports.default = Plugin;
2633
+
2634
+ Object.defineProperty(exports, '__esModule', { value: true });
2635
+
2636
+ }));