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,4110 @@
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.Datepicker = {}, global.Vue));
6
+ })(this, (function (exports, vue) { 'use strict';
7
+
8
+ let config = {
9
+ defaultIconPack: "mdi",
10
+ defaultIconComponent: null,
11
+ defaultIconPrev: "chevron-left",
12
+ defaultIconNext: "chevron-right",
13
+ defaultLocale: void 0,
14
+ defaultInputAutocomplete: "on",
15
+ defaultDayNames: null,
16
+ defaultMonthNames: null,
17
+ defaultUnselectableDaysOfWeek: null,
18
+ defaultDatepickerMobileNative: true,
19
+ defaultInputHasCounter: true,
20
+ defaultCompatFallthrough: true,
21
+ defaultUseHtml5Validation: true,
22
+ defaultDropdownMobileModal: true,
23
+ defaultFieldLabelPosition: null,
24
+ defaultDatepickerYearsRange: [-100, 10],
25
+ defaultDatepickerNearbyMonthDays: true,
26
+ defaultDatepickerNearbySelectableMonthDays: false,
27
+ defaultDatepickerShowWeekNumber: false,
28
+ defaultDatepickerWeekNumberClickable: false,
29
+ defaultDatepickerMobileModal: true,
30
+ defaultTrapFocus: true,
31
+ defaultStatusIcon: true};
32
+
33
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
34
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
35
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
36
+ var __objRest = (source, exclude) => {
37
+ var target = {};
38
+ for (var prop in source)
39
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
40
+ target[prop] = source[prop];
41
+ if (source != null && __getOwnPropSymbols)
42
+ for (var prop of __getOwnPropSymbols(source)) {
43
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
44
+ target[prop] = source[prop];
45
+ }
46
+ return target;
47
+ };
48
+ var CompatFallthroughMixin = vue.defineComponent({
49
+ inheritAttrs: false,
50
+ props: {
51
+ compatFallthrough: {
52
+ type: Boolean,
53
+ default: () => config.defaultCompatFallthrough
54
+ }
55
+ },
56
+ computed: {
57
+ rootAttrs() {
58
+ return this.compatFallthrough ? {
59
+ class: this.$attrs.class,
60
+ style: this.$attrs.style,
61
+ id: this.$attrs.id
62
+ } : {};
63
+ },
64
+ fallthroughAttrs() {
65
+ if (this.compatFallthrough) {
66
+ const _a = this.$attrs, { style: _1, class: _2, id: _3 } = _a, rest = __objRest(_a, ["style", "class", "id"]);
67
+ return rest;
68
+ } else {
69
+ return this.$attrs;
70
+ }
71
+ }
72
+ }
73
+ });
74
+
75
+ const isMobile = {
76
+ Android: function() {
77
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/Android/i);
78
+ },
79
+ BlackBerry: function() {
80
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/BlackBerry/i);
81
+ },
82
+ iOS: function() {
83
+ return typeof window !== "undefined" && (window.navigator.userAgent.match(/iPhone|iPad|iPod/i) || window.navigator.platform === "MacIntel" && window.navigator.maxTouchPoints > 1);
84
+ },
85
+ Opera: function() {
86
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/Opera Mini/i);
87
+ },
88
+ Windows: function() {
89
+ return typeof window !== "undefined" && window.navigator.userAgent.match(/IEMobile/i);
90
+ },
91
+ any: function() {
92
+ return isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Opera() || isMobile.Windows();
93
+ }
94
+ };
95
+ function removeElement(el) {
96
+ if (typeof el.remove !== "undefined") {
97
+ el.remove();
98
+ } else if (typeof el.parentNode !== "undefined" && el.parentNode !== null) {
99
+ el.parentNode.removeChild(el);
100
+ }
101
+ }
102
+ function createAbsoluteElement(el) {
103
+ const root = document.createElement("div");
104
+ root.style.position = "absolute";
105
+ root.style.left = "0px";
106
+ root.style.top = "0px";
107
+ root.style.width = "100%";
108
+ const wrapper = document.createElement("div");
109
+ root.appendChild(wrapper);
110
+ wrapper.appendChild(el);
111
+ document.body.appendChild(root);
112
+ return root;
113
+ }
114
+ function toCssWidth(width) {
115
+ return width === void 0 ? null : isNaN(+width) ? `${width}` : width + "px";
116
+ }
117
+ function getMonthNames(locale, format = "long") {
118
+ const dates = [];
119
+ for (let i = 0; i < 12; i++) {
120
+ dates.push(new Date(2e3, i, 15));
121
+ }
122
+ const dtf = new Intl.DateTimeFormat(locale, {
123
+ month: format
124
+ });
125
+ return dates.map((d) => dtf.format(d));
126
+ }
127
+ function getWeekdayNames(locale, format = "narrow") {
128
+ const dates = [];
129
+ for (let i = 0; i < 7; i++) {
130
+ const dt = new Date(2e3, 0, i + 1);
131
+ dates[dt.getDay()] = dt;
132
+ }
133
+ const dtf = new Intl.DateTimeFormat(locale, { weekday: format });
134
+ return dates.map((d) => dtf.format(d));
135
+ }
136
+ function matchWithGroups(pattern, str) {
137
+ const matches = str.match(pattern);
138
+ const groupNames = pattern.toString().match(/<(.+?)>/g);
139
+ if (groupNames == null) {
140
+ throw new RangeError("pattern must contain at least one group");
141
+ }
142
+ return groupNames.map((group) => {
143
+ const groupMatches = group.match(/<(.+)>/);
144
+ return groupMatches[1];
145
+ }).reduce((acc, curr, index) => {
146
+ if (matches && matches.length > index) {
147
+ acc[curr] = matches[index + 1];
148
+ } else {
149
+ acc[curr] = null;
150
+ }
151
+ return acc;
152
+ }, {});
153
+ }
154
+ function isCustomElement(vm) {
155
+ return vm.$root != null && "shadowRoot" in vm.$root.$options;
156
+ }
157
+ const isDefined = (d) => d !== void 0;
158
+ function isTag(vnode) {
159
+ return vnode.type !== vue.Comment && vnode.type !== vue.Text && vnode.type !== vue.Static;
160
+ }
161
+
162
+ var _sfc_main$9 = vue.defineComponent({
163
+ name: "BFieldBody",
164
+ inject: {
165
+ parent: {
166
+ from: "BField",
167
+ default: null
168
+ }
169
+ },
170
+ props: {
171
+ message: {
172
+ type: [String, Array]
173
+ },
174
+ type: {
175
+ type: [String, Object]
176
+ }
177
+ },
178
+ render() {
179
+ let first = true;
180
+ let children = typeof this.$slots.default === "function" ? this.$slots.default() : this.$slots.default;
181
+ if (children != null && children.length === 1 && children[0].type === vue.Fragment) {
182
+ children = children[0].children;
183
+ }
184
+ return vue.h(
185
+ "div",
186
+ { class: "field-body" },
187
+ {
188
+ default: () => {
189
+ return children != null && children.map((element) => {
190
+ if (element.type === vue.Comment || element.type === vue.Text) {
191
+ return element;
192
+ }
193
+ let message;
194
+ if (first) {
195
+ message = this.message;
196
+ first = false;
197
+ }
198
+ const parentField = this.parent;
199
+ return vue.h(
200
+ // parentField.$.type is supposed to be BField
201
+ // it falls back to `resolveComponent('b-field')`
202
+ // but won't work unless `BField` is globally registered
203
+ // should not be a problem as long as `BFieldBody` is properly used
204
+ parentField ? parentField.$.type : vue.resolveComponent("b-field"),
205
+ {
206
+ type: this.type,
207
+ message
208
+ },
209
+ () => element
210
+ );
211
+ });
212
+ }
213
+ }
214
+ );
215
+ }
216
+ });
217
+
218
+ const Field = vue.defineComponent({
219
+ name: "BField",
220
+ components: { BFieldBody: _sfc_main$9 },
221
+ provide() {
222
+ return {
223
+ BField: this
224
+ };
225
+ },
226
+ inject: {
227
+ parent: {
228
+ from: "BField",
229
+ default: false
230
+ }
231
+ },
232
+ // Used internally only when using Field in Field
233
+ props: {
234
+ type: {
235
+ type: [String, Object],
236
+ default: void 0
237
+ },
238
+ label: String,
239
+ labelFor: String,
240
+ message: {
241
+ type: [String, Array, Object],
242
+ default: void 0
243
+ },
244
+ grouped: Boolean,
245
+ groupMultiline: Boolean,
246
+ position: String,
247
+ expanded: Boolean,
248
+ horizontal: Boolean,
249
+ addons: {
250
+ type: Boolean,
251
+ default: true
252
+ },
253
+ customClass: String,
254
+ labelPosition: {
255
+ type: String,
256
+ default: () => {
257
+ return config.defaultFieldLabelPosition;
258
+ }
259
+ }
260
+ },
261
+ data() {
262
+ return {
263
+ newType: this.type,
264
+ newMessage: this.message,
265
+ fieldLabelSize: null,
266
+ numberInputClasses: [],
267
+ _isField: true
268
+ // Used internally by Input and Select
269
+ };
270
+ },
271
+ computed: {
272
+ rootClasses() {
273
+ return [
274
+ {
275
+ "is-expanded": this.expanded,
276
+ "is-horizontal": this.horizontal,
277
+ "is-floating-in-label": this.hasLabel && !this.horizontal && this.labelPosition === "inside",
278
+ "is-floating-label": this.hasLabel && !this.horizontal && this.labelPosition === "on-border"
279
+ },
280
+ this.numberInputClasses
281
+ ];
282
+ },
283
+ innerFieldClasses() {
284
+ return [
285
+ this.fieldType(),
286
+ this.newPosition,
287
+ {
288
+ "is-grouped-multiline": this.groupMultiline
289
+ }
290
+ ];
291
+ },
292
+ hasInnerField() {
293
+ return this.grouped || this.groupMultiline || this.hasAddons();
294
+ },
295
+ /*
296
+ * Correct Bulma class for the side of the addon or group.
297
+ *
298
+ * This is not kept like the others (is-small, etc.),
299
+ * because since 'has-addons' is set automatically it
300
+ * doesn't make sense to teach users what addons are exactly.
301
+ */
302
+ newPosition() {
303
+ if (this.position === void 0) return;
304
+ const position = this.position.split("-");
305
+ if (position.length < 1) return;
306
+ const prefix = this.grouped ? "is-grouped-" : "has-addons-";
307
+ if (this.position) return prefix + position[1];
308
+ return void 0;
309
+ },
310
+ /*
311
+ * Formatted message in case it's an array
312
+ * (each element is separated by <br> tag)
313
+ */
314
+ formattedMessage() {
315
+ const parentField = this.parent;
316
+ if (parentField && parentField.hasInnerField) {
317
+ return "";
318
+ }
319
+ if (typeof this.newMessage === "string") {
320
+ return [this.newMessage];
321
+ }
322
+ const messages = [];
323
+ if (Array.isArray(this.newMessage)) {
324
+ this.newMessage.forEach((message) => {
325
+ if (typeof message === "string") {
326
+ messages.push(message);
327
+ } else {
328
+ for (const key in message) {
329
+ if (message[key]) {
330
+ messages.push(key);
331
+ }
332
+ }
333
+ }
334
+ });
335
+ } else {
336
+ for (const key in this.newMessage) {
337
+ if (this.newMessage[key]) {
338
+ messages.push(key);
339
+ }
340
+ }
341
+ }
342
+ return messages.filter((m) => !!m);
343
+ },
344
+ hasLabel() {
345
+ return this.label || this.$slots.label;
346
+ },
347
+ hasMessage() {
348
+ const parentField = this.parent;
349
+ return (!parentField || !parentField.hasInnerField) && this.newMessage || this.$slots.message;
350
+ }
351
+ },
352
+ watch: {
353
+ /*
354
+ * Set internal type when prop change.
355
+ */
356
+ type(value) {
357
+ this.newType = value;
358
+ },
359
+ /*
360
+ * Set internal message when prop change.
361
+ */
362
+ message(value) {
363
+ if (JSON.stringify(value) !== JSON.stringify(this.newMessage)) {
364
+ this.newMessage = value;
365
+ }
366
+ },
367
+ /*
368
+ * Set parent message if we use Field in Field.
369
+ */
370
+ newMessage(value) {
371
+ const parentField = this.parent;
372
+ if (parentField && parentField.hasInnerField) {
373
+ if (!parentField.type) {
374
+ parentField.newType = this.newType;
375
+ }
376
+ if (!parentField.message) {
377
+ parentField.newMessage = value;
378
+ }
379
+ }
380
+ }
381
+ },
382
+ methods: {
383
+ /*
384
+ * Field has addons if there are more than one slot
385
+ * (element / component) in the Field.
386
+ * Or is grouped when prop is set.
387
+ * Is a method to be called when component re-render.
388
+ */
389
+ fieldType() {
390
+ if (this.grouped) return "is-grouped";
391
+ if (this.hasAddons()) return "has-addons";
392
+ },
393
+ hasAddons() {
394
+ let renderedNode = 0;
395
+ if (this.$slots.default) {
396
+ renderedNode = this.$slots.default().reduce((i, node) => isTag(node) ? i + 1 : i, 0);
397
+ }
398
+ return renderedNode > 1 && this.addons && !this.horizontal;
399
+ },
400
+ // called by a number input if it is a direct child.
401
+ wrapNumberinput({ controlsPosition, size }) {
402
+ const classes = ["has-numberinput"];
403
+ if (controlsPosition) {
404
+ classes.push(`has-numberinput-${controlsPosition}`);
405
+ }
406
+ if (size) {
407
+ classes.push(`has-numberinput-${size}`);
408
+ }
409
+ this.numberInputClasses = classes;
410
+ }
411
+ },
412
+ mounted() {
413
+ if (this.horizontal) {
414
+ const elements = this.$el.querySelectorAll(".input, .select, .button, .textarea, .b-slider");
415
+ if (elements.length > 0) {
416
+ this.fieldLabelSize = "is-normal";
417
+ }
418
+ }
419
+ }
420
+ });
421
+
422
+ var _export_sfc = (sfc, props) => {
423
+ const target = sfc.__vccOpts || sfc;
424
+ for (const [key, val] of props) {
425
+ target[key] = val;
426
+ }
427
+ return target;
428
+ };
429
+
430
+ const _hoisted_1$8 = ["for"];
431
+ const _hoisted_2$8 = ["for"];
432
+ const _hoisted_3$6 = {
433
+ key: 3,
434
+ class: "field-body"
435
+ };
436
+ function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
437
+ const _component_b_field_body = vue.resolveComponent("b-field-body");
438
+ const _component_b_field = vue.resolveComponent("b-field");
439
+ return vue.openBlock(), vue.createElementBlock(
440
+ "div",
441
+ {
442
+ class: vue.normalizeClass(["field", _ctx.rootClasses])
443
+ },
444
+ [
445
+ _ctx.horizontal ? (vue.openBlock(), vue.createElementBlock(
446
+ "div",
447
+ {
448
+ key: 0,
449
+ class: vue.normalizeClass(["field-label", [_ctx.customClass, _ctx.fieldLabelSize]])
450
+ },
451
+ [
452
+ _ctx.hasLabel ? (vue.openBlock(), vue.createElementBlock("label", {
453
+ key: 0,
454
+ for: _ctx.labelFor,
455
+ class: vue.normalizeClass([_ctx.customClass, "label"])
456
+ }, [
457
+ _ctx.$slots.label ? vue.renderSlot(_ctx.$slots, "label", { key: 0 }) : (vue.openBlock(), vue.createElementBlock(
458
+ vue.Fragment,
459
+ { key: 1 },
460
+ [
461
+ vue.createTextVNode(
462
+ vue.toDisplayString(_ctx.label),
463
+ 1
464
+ /* TEXT */
465
+ )
466
+ ],
467
+ 64
468
+ /* STABLE_FRAGMENT */
469
+ ))
470
+ ], 10, _hoisted_1$8)) : vue.createCommentVNode("v-if", true)
471
+ ],
472
+ 2
473
+ /* CLASS */
474
+ )) : (vue.openBlock(), vue.createElementBlock(
475
+ vue.Fragment,
476
+ { key: 1 },
477
+ [
478
+ _ctx.hasLabel ? (vue.openBlock(), vue.createElementBlock("label", {
479
+ key: 0,
480
+ for: _ctx.labelFor,
481
+ class: vue.normalizeClass([_ctx.customClass, "label"])
482
+ }, [
483
+ _ctx.$slots.label ? vue.renderSlot(_ctx.$slots, "label", { key: 0 }) : (vue.openBlock(), vue.createElementBlock(
484
+ vue.Fragment,
485
+ { key: 1 },
486
+ [
487
+ vue.createTextVNode(
488
+ vue.toDisplayString(_ctx.label),
489
+ 1
490
+ /* TEXT */
491
+ )
492
+ ],
493
+ 64
494
+ /* STABLE_FRAGMENT */
495
+ ))
496
+ ], 10, _hoisted_2$8)) : vue.createCommentVNode("v-if", true)
497
+ ],
498
+ 64
499
+ /* STABLE_FRAGMENT */
500
+ )),
501
+ _ctx.horizontal ? (vue.openBlock(), vue.createBlock(_component_b_field_body, {
502
+ key: 2,
503
+ message: _ctx.newMessage ? _ctx.formattedMessage : "",
504
+ type: _ctx.newType
505
+ }, {
506
+ default: vue.withCtx(() => [
507
+ vue.renderSlot(_ctx.$slots, "default")
508
+ ]),
509
+ _: 3
510
+ /* FORWARDED */
511
+ }, 8, ["message", "type"])) : _ctx.hasInnerField ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$6, [
512
+ vue.createVNode(_component_b_field, {
513
+ addons: false,
514
+ type: _ctx.type,
515
+ class: vue.normalizeClass(_ctx.innerFieldClasses)
516
+ }, {
517
+ default: vue.withCtx(() => [
518
+ vue.renderSlot(_ctx.$slots, "default")
519
+ ]),
520
+ _: 3
521
+ /* FORWARDED */
522
+ }, 8, ["type", "class"])
523
+ ])) : vue.renderSlot(_ctx.$slots, "default", { key: 4 }),
524
+ _ctx.hasMessage && !_ctx.horizontal ? (vue.openBlock(), vue.createElementBlock(
525
+ "p",
526
+ {
527
+ key: 5,
528
+ class: vue.normalizeClass(["help", _ctx.newType])
529
+ },
530
+ [
531
+ _ctx.$slots.message ? vue.renderSlot(_ctx.$slots, "message", {
532
+ key: 0,
533
+ messages: _ctx.formattedMessage
534
+ }) : (vue.openBlock(true), vue.createElementBlock(
535
+ vue.Fragment,
536
+ { key: 1 },
537
+ vue.renderList(_ctx.formattedMessage, (mess, i) => {
538
+ return vue.openBlock(), vue.createElementBlock(
539
+ vue.Fragment,
540
+ null,
541
+ [
542
+ vue.createTextVNode(
543
+ vue.toDisplayString(mess) + " ",
544
+ 1
545
+ /* TEXT */
546
+ ),
547
+ i + 1 < _ctx.formattedMessage.length ? (vue.openBlock(), vue.createElementBlock("br", { key: i })) : vue.createCommentVNode("v-if", true)
548
+ ],
549
+ 64
550
+ /* STABLE_FRAGMENT */
551
+ );
552
+ }),
553
+ 256
554
+ /* UNKEYED_FRAGMENT */
555
+ ))
556
+ ],
557
+ 2
558
+ /* CLASS */
559
+ )) : vue.createCommentVNode("v-if", true)
560
+ ],
561
+ 2
562
+ /* CLASS */
563
+ );
564
+ }
565
+ var BField = /* @__PURE__ */ _export_sfc(Field, [["render", _sfc_render$9]]);
566
+
567
+ const FormElementMixin = vue.defineComponent({
568
+ props: {
569
+ size: String,
570
+ expanded: Boolean,
571
+ loading: Boolean,
572
+ rounded: Boolean,
573
+ icon: String,
574
+ iconPack: String,
575
+ maxlength: [Number, String],
576
+ useHtml5Validation: {
577
+ type: Boolean,
578
+ default: () => config.defaultUseHtml5Validation
579
+ },
580
+ validationMessage: String,
581
+ locale: {
582
+ type: [String, Array],
583
+ default: () => {
584
+ return config.defaultLocale;
585
+ }
586
+ },
587
+ statusIcon: {
588
+ type: Boolean,
589
+ default: () => {
590
+ return config.defaultStatusIcon;
591
+ }
592
+ }
593
+ },
594
+ emits: {
595
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
596
+ blur: (event) => true,
597
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
598
+ focus: (event) => true
599
+ },
600
+ data() {
601
+ return {
602
+ isValid: true,
603
+ isFocused: false,
604
+ newIconPack: this.iconPack || config.defaultIconPack,
605
+ // host component must override this
606
+ _elementRef: ""
607
+ };
608
+ },
609
+ computed: {
610
+ /*
611
+ * Find parent Field, max 3 levels deep.
612
+ */
613
+ parentField() {
614
+ let parent = this.$parent;
615
+ for (let i = 0; i < 3; i++) {
616
+ if (parent && !parent.$data._isField) {
617
+ parent = parent.$parent;
618
+ }
619
+ }
620
+ return parent;
621
+ },
622
+ /*
623
+ * Get the type prop from parent if it's a Field.
624
+ */
625
+ statusType() {
626
+ const { newType } = this.parentField || {};
627
+ if (!newType) return;
628
+ if (typeof newType === "string") {
629
+ return newType;
630
+ } else {
631
+ for (const key in newType) {
632
+ if (newType[key]) {
633
+ return key;
634
+ }
635
+ }
636
+ }
637
+ return void 0;
638
+ },
639
+ /*
640
+ * Get the message prop from parent if it's a Field.
641
+ */
642
+ statusMessage() {
643
+ if (!this.parentField) return;
644
+ return this.parentField.newMessage || this.parentField.$slots.message;
645
+ },
646
+ /*
647
+ * Fix icon size for inputs, large was too big
648
+ */
649
+ iconSize() {
650
+ switch (this.size) {
651
+ case "is-small":
652
+ return this.size;
653
+ case "is-medium":
654
+ return;
655
+ case "is-large":
656
+ return this.newIconPack === "mdi" ? "is-medium" : "";
657
+ }
658
+ return void 0;
659
+ }
660
+ },
661
+ methods: {
662
+ /*
663
+ * Focus method that work dynamically depending on the component.
664
+ */
665
+ focus() {
666
+ const el = this.getElement();
667
+ if (el === void 0) return;
668
+ this.$nextTick(() => {
669
+ if (el) el.focus();
670
+ });
671
+ },
672
+ onBlur($event) {
673
+ this.isFocused = false;
674
+ this.$emit("blur", $event);
675
+ this.checkHtml5Validity();
676
+ },
677
+ onFocus($event) {
678
+ this.isFocused = true;
679
+ this.$emit("focus", $event);
680
+ },
681
+ getElement() {
682
+ let el = this.$refs[this.$data._elementRef];
683
+ while (el != null && typeof el === "object" && "$refs" in el) {
684
+ const form = el;
685
+ el = form.$refs[form.$data._elementRef];
686
+ }
687
+ return el;
688
+ },
689
+ setInvalid() {
690
+ const type = "is-danger";
691
+ const message = this.validationMessage || this.getElement().validationMessage;
692
+ this.setValidity(type, message);
693
+ },
694
+ setValidity(type, message) {
695
+ this.$nextTick(() => {
696
+ if (this.parentField) {
697
+ if (!this.parentField.type) {
698
+ this.parentField.newType = type;
699
+ }
700
+ if (!this.parentField.message) {
701
+ this.parentField.newMessage = message;
702
+ }
703
+ }
704
+ });
705
+ },
706
+ /*
707
+ * Check HTML5 validation, set isValid property.
708
+ * If validation fail, send 'is-danger' type,
709
+ * and error message to parent if it's a Field.
710
+ */
711
+ checkHtml5Validity() {
712
+ if (!this.useHtml5Validation) {
713
+ return false;
714
+ }
715
+ const el = this.getElement();
716
+ if (el == null) {
717
+ return false;
718
+ }
719
+ if (!el.checkValidity()) {
720
+ this.setInvalid();
721
+ this.isValid = false;
722
+ } else {
723
+ this.setValidity(null, null);
724
+ this.isValid = true;
725
+ }
726
+ return this.isValid;
727
+ }
728
+ }
729
+ });
730
+
731
+ const findFocusable = (element, programmatic = false) => {
732
+ if (!element) {
733
+ return null;
734
+ }
735
+ if (programmatic) {
736
+ return element.querySelectorAll('*[tabindex="-1"]');
737
+ }
738
+ return element.querySelectorAll(`a[href]:not([tabindex="-1"]),
739
+ area[href],
740
+ input:not([disabled]),
741
+ select:not([disabled]),
742
+ textarea:not([disabled]),
743
+ button:not([disabled]),
744
+ iframe,
745
+ object,
746
+ embed,
747
+ *[tabindex]:not([tabindex="-1"]),
748
+ *[contenteditable]`);
749
+ };
750
+ let onKeyDown;
751
+ const beforeMount = (el, { value = true }) => {
752
+ if (value) {
753
+ let focusable = findFocusable(el);
754
+ let focusableProg = findFocusable(el, true);
755
+ if (focusable && focusable.length > 0) {
756
+ onKeyDown = (event) => {
757
+ focusable = findFocusable(el);
758
+ focusableProg = findFocusable(el, true);
759
+ const firstFocusable = focusable[0];
760
+ const lastFocusable = focusable[focusable.length - 1];
761
+ if (event.target === firstFocusable && event.shiftKey && event.key === "Tab") {
762
+ event.preventDefault();
763
+ lastFocusable.focus();
764
+ } else if ((event.target === lastFocusable || Array.from(focusableProg).indexOf(event.target) >= 0) && !event.shiftKey && event.key === "Tab") {
765
+ event.preventDefault();
766
+ firstFocusable.focus();
767
+ }
768
+ };
769
+ el.addEventListener("keydown", onKeyDown);
770
+ }
771
+ }
772
+ };
773
+ const unmounted = (el) => {
774
+ el.removeEventListener("keydown", onKeyDown);
775
+ };
776
+ const directive = {
777
+ beforeMount,
778
+ unmounted
779
+ };
780
+
781
+ const DEFAULT_CLOSE_OPTIONS = ["escape", "outside"];
782
+ const DROPDOWN_INJECTION_KEY = Symbol("bdropdown");
783
+ var _sfc_main$8 = vue.defineComponent({
784
+ name: "BDropdown",
785
+ directives: {
786
+ trapFocus: directive
787
+ },
788
+ provide() {
789
+ return {
790
+ [DROPDOWN_INJECTION_KEY]: this
791
+ };
792
+ },
793
+ props: {
794
+ modelValue: {
795
+ type: [
796
+ String,
797
+ Number,
798
+ Boolean,
799
+ Object,
800
+ Array,
801
+ Function
802
+ ],
803
+ default: null
804
+ },
805
+ disabled: Boolean,
806
+ inline: Boolean,
807
+ scrollable: Boolean,
808
+ maxHeight: {
809
+ type: [String, Number],
810
+ default: 200
811
+ },
812
+ position: {
813
+ type: String,
814
+ validator(value) {
815
+ return [
816
+ "is-top-right",
817
+ "is-top-left",
818
+ "is-bottom-left",
819
+ "is-bottom-right"
820
+ ].indexOf(value) > -1;
821
+ }
822
+ },
823
+ triggers: {
824
+ type: Array,
825
+ default: () => ["click"]
826
+ },
827
+ mobileModal: {
828
+ type: Boolean,
829
+ default: () => {
830
+ return config.defaultDropdownMobileModal;
831
+ }
832
+ },
833
+ ariaRole: {
834
+ type: String,
835
+ validator(value) {
836
+ return [
837
+ "menu",
838
+ "list",
839
+ "dialog"
840
+ ].indexOf(value) > -1;
841
+ },
842
+ default: null
843
+ },
844
+ animation: {
845
+ type: String,
846
+ default: "fade"
847
+ },
848
+ multiple: Boolean,
849
+ trapFocus: {
850
+ type: Boolean,
851
+ default: () => {
852
+ return config.defaultTrapFocus;
853
+ }
854
+ },
855
+ closeOnClick: {
856
+ type: Boolean,
857
+ default: true
858
+ },
859
+ canClose: {
860
+ type: [Array, Boolean],
861
+ default: true
862
+ },
863
+ expanded: Boolean,
864
+ appendToBody: Boolean,
865
+ appendToBodyCopyParent: Boolean,
866
+ triggerTabindex: {
867
+ type: Number,
868
+ default: 0
869
+ }
870
+ },
871
+ emits: {
872
+ /* eslint-disable @typescript-eslint/no-unused-vars */
873
+ "active-change": (_isActive) => true,
874
+ change: (_selected) => true,
875
+ "update:modelValue": (_value) => true
876
+ /* eslint-enable @typescript-eslint/no-unused-vars */
877
+ },
878
+ data() {
879
+ return {
880
+ selected: this.modelValue,
881
+ style: {},
882
+ isActive: false,
883
+ isHoverable: false,
884
+ maybeTap: false,
885
+ isTouchEnabled: false,
886
+ _bodyEl: void 0,
887
+ // Used to append to body
888
+ timeOutID: void 0,
889
+ timeOutID2: void 0
890
+ };
891
+ },
892
+ computed: {
893
+ rootClasses() {
894
+ return [this.position, {
895
+ "is-disabled": this.disabled,
896
+ "is-hoverable": this.hoverable,
897
+ "is-inline": this.inline,
898
+ "is-active": this.isActive || this.inline,
899
+ "is-mobile-modal": this.isMobileModal,
900
+ "is-expanded": this.expanded,
901
+ "is-touch-enabled": this.isTouchEnabled
902
+ }];
903
+ },
904
+ isMobileModal() {
905
+ return this.mobileModal && !this.inline;
906
+ },
907
+ cancelOptions() {
908
+ return typeof this.canClose === "boolean" ? this.canClose ? DEFAULT_CLOSE_OPTIONS : [] : this.canClose;
909
+ },
910
+ contentStyle() {
911
+ var _a;
912
+ return {
913
+ maxHeight: this.scrollable ? (_a = toCssWidth(this.maxHeight)) != null ? _a : void 0 : void 0,
914
+ overflow: this.scrollable ? "auto" : void 0
915
+ };
916
+ },
917
+ hoverable() {
918
+ return this.triggers.indexOf("hover") >= 0;
919
+ }
920
+ },
921
+ watch: {
922
+ /*
923
+ * When v-model is changed set the new selected item.
924
+ */
925
+ modelValue(value) {
926
+ this.selected = value;
927
+ },
928
+ /*
929
+ * Emit event when isActive value is changed.
930
+ *
931
+ * Also resets `isTouchEnabled` when it turns inactive.
932
+ */
933
+ isActive(value) {
934
+ this.$emit("active-change", value);
935
+ if (!value) {
936
+ this.timeOutID = setTimeout(() => {
937
+ if (!this.isActive) {
938
+ this.isTouchEnabled = false;
939
+ }
940
+ }, 250);
941
+ }
942
+ this.handleScroll();
943
+ if (this.appendToBody) {
944
+ this.$nextTick(() => {
945
+ this.updateAppendToBody();
946
+ });
947
+ }
948
+ },
949
+ isHoverable(value) {
950
+ if (this.hoverable) {
951
+ this.$emit("active-change", value);
952
+ }
953
+ }
954
+ },
955
+ methods: {
956
+ handleScroll() {
957
+ if (typeof window === "undefined") return;
958
+ if (this.isMobileModal) {
959
+ if (this.isActive) {
960
+ document.documentElement.classList.add("is-clipped-touch");
961
+ } else {
962
+ document.documentElement.classList.remove("is-clipped-touch");
963
+ }
964
+ }
965
+ },
966
+ /*
967
+ * Click listener from DropdownItem.
968
+ * 1. Set new selected item.
969
+ * 2. Emit input event to update the user v-model.
970
+ * 3. Close the dropdown.
971
+ */
972
+ selectItem(value) {
973
+ if (this.multiple) {
974
+ if (this.selected) {
975
+ const selected = this.selected;
976
+ if (selected.indexOf(value) === -1) {
977
+ this.selected = [...selected, value];
978
+ } else {
979
+ this.selected = selected.filter((val) => val !== value);
980
+ }
981
+ } else {
982
+ this.selected = [value];
983
+ }
984
+ this.$emit("change", this.selected);
985
+ } else {
986
+ if (this.selected !== value) {
987
+ this.selected = value;
988
+ this.$emit("change", this.selected);
989
+ }
990
+ }
991
+ this.$emit("update:modelValue", this.selected);
992
+ if (!this.multiple) {
993
+ this.isActive = !this.closeOnClick;
994
+ if (this.hoverable && this.closeOnClick) {
995
+ this.isHoverable = false;
996
+ }
997
+ }
998
+ },
999
+ /*
1000
+ * White-listed items to not close when clicked.
1001
+ */
1002
+ isInWhiteList(el) {
1003
+ if (el === this.$refs.dropdownMenu) return true;
1004
+ if (el === this.$refs.trigger) return true;
1005
+ if (this.$refs.dropdownMenu != null) {
1006
+ const children = this.$refs.dropdownMenu.querySelectorAll("*");
1007
+ for (const child of children) {
1008
+ if (el === child) {
1009
+ return true;
1010
+ }
1011
+ }
1012
+ }
1013
+ if (this.$refs.trigger != null) {
1014
+ const children = this.$refs.trigger.querySelectorAll("*");
1015
+ for (const child of children) {
1016
+ if (el === child) {
1017
+ return true;
1018
+ }
1019
+ }
1020
+ }
1021
+ return false;
1022
+ },
1023
+ /*
1024
+ * Close dropdown if clicked outside.
1025
+ */
1026
+ clickedOutside(event) {
1027
+ if (this.cancelOptions.indexOf("outside") < 0) return;
1028
+ if (this.inline) return;
1029
+ const target = isCustomElement(this) ? event.composedPath()[0] : event.target;
1030
+ if (!this.isInWhiteList(target)) this.isActive = false;
1031
+ },
1032
+ /*
1033
+ * Keypress event that is bound to the document
1034
+ */
1035
+ keyPress({ key }) {
1036
+ if (this.isActive && (key === "Escape" || key === "Esc")) {
1037
+ if (this.cancelOptions.indexOf("escape") < 0) return;
1038
+ this.isActive = false;
1039
+ }
1040
+ },
1041
+ onClick() {
1042
+ if (this.triggers.indexOf("hover") !== -1) return;
1043
+ if (this.triggers.indexOf("click") < 0) return;
1044
+ this.toggle();
1045
+ },
1046
+ onContextMenu() {
1047
+ if (this.triggers.indexOf("contextmenu") < 0) return;
1048
+ this.toggle();
1049
+ },
1050
+ onHover() {
1051
+ if (this.triggers.indexOf("hover") < 0) return;
1052
+ if (this.isTouchEnabled) return;
1053
+ this.isHoverable = true;
1054
+ },
1055
+ // takes care of touch-enabled devices
1056
+ // - does nothing if hover trigger is disabled
1057
+ // - suppresses hover trigger by setting isTouchEnabled
1058
+ // - handles only a tap; i.e., touchstart on the trigger immediately
1059
+ // folowed by touchend
1060
+ onTouchStart() {
1061
+ this.maybeTap = true;
1062
+ },
1063
+ onTouchMove() {
1064
+ this.maybeTap = false;
1065
+ },
1066
+ onTouchEnd(e) {
1067
+ if (this.triggers.indexOf("hover") === -1) return;
1068
+ if (!this.maybeTap) return;
1069
+ e.preventDefault();
1070
+ this.maybeTap = false;
1071
+ this.isTouchEnabled = true;
1072
+ this.toggle();
1073
+ },
1074
+ onFocus() {
1075
+ if (this.triggers.indexOf("focus") < 0) return;
1076
+ this.toggle();
1077
+ },
1078
+ /*
1079
+ * Toggle dropdown if it's not disabled.
1080
+ */
1081
+ toggle() {
1082
+ if (this.disabled) return;
1083
+ if (!this.isActive) {
1084
+ this.timeOutID2 = setTimeout(() => {
1085
+ const value = !this.isActive;
1086
+ this.isActive = value;
1087
+ });
1088
+ } else {
1089
+ this.isActive = !this.isActive;
1090
+ }
1091
+ },
1092
+ updateAppendToBody() {
1093
+ const dropdown = this.$refs.dropdown;
1094
+ const dropdownMenu = this.$refs.dropdownMenu;
1095
+ const trigger = this.$refs.trigger;
1096
+ if (dropdownMenu && trigger) {
1097
+ const dropdownWrapper = this.$data._bodyEl.children[0];
1098
+ dropdownWrapper.classList.forEach((item) => dropdownWrapper.classList.remove(item));
1099
+ dropdownWrapper.classList.add("dropdown");
1100
+ dropdownWrapper.classList.add("dropdown-menu-animation");
1101
+ this.rootClasses.forEach((item) => {
1102
+ if (item && typeof item === "object") {
1103
+ for (const key in item) {
1104
+ if (item[key]) {
1105
+ dropdownWrapper.classList.add(key);
1106
+ }
1107
+ }
1108
+ }
1109
+ });
1110
+ if (this.appendToBodyCopyParent) {
1111
+ const parentNode = this.$refs.dropdown.parentNode;
1112
+ const parent = this.$data._bodyEl;
1113
+ parent.classList.forEach((item) => parent.classList.remove(item));
1114
+ parentNode.classList.forEach((item) => {
1115
+ parent.classList.add(item);
1116
+ });
1117
+ }
1118
+ const rect = trigger.getBoundingClientRect();
1119
+ let top = rect.top + window.scrollY;
1120
+ let left = rect.left + window.scrollX;
1121
+ if (!this.position || this.position.indexOf("bottom") >= 0) {
1122
+ top += trigger.clientHeight;
1123
+ } else {
1124
+ top -= dropdownMenu.clientHeight;
1125
+ }
1126
+ if (this.position && this.position.indexOf("left") >= 0) {
1127
+ left -= dropdownMenu.clientWidth - trigger.clientWidth;
1128
+ }
1129
+ this.style = {
1130
+ position: "absolute",
1131
+ top: `${top}px`,
1132
+ left: `${left}px`,
1133
+ zIndex: "99",
1134
+ width: this.expanded ? `${dropdown.offsetWidth}px` : void 0
1135
+ };
1136
+ }
1137
+ }
1138
+ },
1139
+ mounted() {
1140
+ if (this.appendToBody) {
1141
+ this.$data._bodyEl = createAbsoluteElement(this.$refs.dropdownMenu);
1142
+ this.updateAppendToBody();
1143
+ }
1144
+ },
1145
+ created() {
1146
+ if (typeof window !== "undefined") {
1147
+ document.addEventListener("click", this.clickedOutside);
1148
+ document.addEventListener("keyup", this.keyPress);
1149
+ }
1150
+ },
1151
+ beforeUnmount() {
1152
+ if (typeof window !== "undefined") {
1153
+ document.removeEventListener("click", this.clickedOutside);
1154
+ document.removeEventListener("keyup", this.keyPress);
1155
+ }
1156
+ if (this.appendToBody) {
1157
+ removeElement(this.$data._bodyEl);
1158
+ }
1159
+ clearTimeout(this.timeOutID);
1160
+ clearTimeout(this.timeOutID2);
1161
+ }
1162
+ });
1163
+
1164
+ const _hoisted_1$7 = ["tabindex"];
1165
+ const _hoisted_2$7 = ["aria-hidden"];
1166
+ const _hoisted_3$5 = ["aria-hidden"];
1167
+ const _hoisted_4$4 = ["role", "aria-modal"];
1168
+ function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
1169
+ const _directive_trap_focus = vue.resolveDirective("trap-focus");
1170
+ return vue.openBlock(), vue.createElementBlock(
1171
+ "div",
1172
+ {
1173
+ class: vue.normalizeClass(["dropdown dropdown-menu-animation", _ctx.rootClasses]),
1174
+ ref: "dropdown",
1175
+ onMouseleave: _cache[7] || (_cache[7] = ($event) => _ctx.isHoverable = false)
1176
+ },
1177
+ [
1178
+ !_ctx.inline ? (vue.openBlock(), vue.createElementBlock("div", {
1179
+ key: 0,
1180
+ tabindex: _ctx.disabled ? void 0 : _ctx.triggerTabindex,
1181
+ ref: "trigger",
1182
+ class: "dropdown-trigger",
1183
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.onClick && _ctx.onClick(...args)),
1184
+ onContextmenu: _cache[1] || (_cache[1] = vue.withModifiers((...args) => _ctx.onContextMenu && _ctx.onContextMenu(...args), ["prevent"])),
1185
+ onMouseenter: _cache[2] || (_cache[2] = (...args) => _ctx.onHover && _ctx.onHover(...args)),
1186
+ onFocusCapture: _cache[3] || (_cache[3] = (...args) => _ctx.onFocus && _ctx.onFocus(...args)),
1187
+ onTouchstart: _cache[4] || (_cache[4] = (...args) => _ctx.onTouchStart && _ctx.onTouchStart(...args)),
1188
+ onTouchmove: _cache[5] || (_cache[5] = (...args) => _ctx.onTouchMove && _ctx.onTouchMove(...args)),
1189
+ onTouchend: _cache[6] || (_cache[6] = (...args) => _ctx.onTouchEnd && _ctx.onTouchEnd(...args)),
1190
+ "aria-haspopup": "true"
1191
+ }, [
1192
+ vue.renderSlot(_ctx.$slots, "trigger", { active: _ctx.isActive })
1193
+ ], 40, _hoisted_1$7)) : vue.createCommentVNode("v-if", true),
1194
+ vue.createVNode(vue.Transition, { name: _ctx.animation }, {
1195
+ default: vue.withCtx(() => [
1196
+ _ctx.isMobileModal ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
1197
+ key: 0,
1198
+ class: "background",
1199
+ "aria-hidden": !_ctx.isActive
1200
+ }, null, 8, _hoisted_2$7)), [
1201
+ [vue.vShow, _ctx.isActive]
1202
+ ]) : vue.createCommentVNode("v-if", true)
1203
+ ]),
1204
+ _: 1
1205
+ /* STABLE */
1206
+ }, 8, ["name"]),
1207
+ vue.createVNode(vue.Transition, {
1208
+ name: _ctx.animation,
1209
+ persisted: ""
1210
+ }, {
1211
+ default: vue.withCtx(() => [
1212
+ vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
1213
+ ref: "dropdownMenu",
1214
+ class: "dropdown-menu",
1215
+ style: vue.normalizeStyle(_ctx.style),
1216
+ "aria-hidden": !_ctx.isActive
1217
+ }, [
1218
+ vue.createElementVNode("div", {
1219
+ class: "dropdown-content",
1220
+ role: _ctx.ariaRole,
1221
+ "aria-modal": !_ctx.inline,
1222
+ style: vue.normalizeStyle(_ctx.contentStyle)
1223
+ }, [
1224
+ vue.renderSlot(_ctx.$slots, "default")
1225
+ ], 12, _hoisted_4$4)
1226
+ ], 12, _hoisted_3$5)), [
1227
+ [vue.vShow, !_ctx.disabled && (_ctx.isActive || _ctx.isHoverable) || _ctx.inline],
1228
+ [_directive_trap_focus, _ctx.trapFocus]
1229
+ ])
1230
+ ]),
1231
+ _: 3
1232
+ /* FORWARDED */
1233
+ }, 8, ["name"])
1234
+ ],
1235
+ 34
1236
+ /* CLASS, NEED_HYDRATION */
1237
+ );
1238
+ }
1239
+ var BDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
1240
+
1241
+ var _sfc_main$7 = vue.defineComponent({
1242
+ name: "BDropdownItem",
1243
+ inject: {
1244
+ parent: {
1245
+ from: DROPDOWN_INJECTION_KEY,
1246
+ default: void 0
1247
+ }
1248
+ },
1249
+ props: {
1250
+ value: {
1251
+ type: [String, Number, Boolean, Object, Array, Function],
1252
+ default: null
1253
+ },
1254
+ separator: Boolean,
1255
+ disabled: Boolean,
1256
+ custom: Boolean,
1257
+ focusable: {
1258
+ type: Boolean,
1259
+ default: true
1260
+ },
1261
+ paddingless: Boolean,
1262
+ hasLink: Boolean,
1263
+ ariaRole: {
1264
+ type: String,
1265
+ default: ""
1266
+ }
1267
+ },
1268
+ emits: {
1269
+ click: () => true
1270
+ },
1271
+ computed: {
1272
+ anchorClasses() {
1273
+ return {
1274
+ "is-disabled": this.parent.disabled || this.disabled,
1275
+ "is-paddingless": this.paddingless,
1276
+ "is-active": this.isActive
1277
+ };
1278
+ },
1279
+ itemClasses() {
1280
+ return {
1281
+ "dropdown-item": !this.hasLink,
1282
+ "is-disabled": this.disabled,
1283
+ "is-paddingless": this.paddingless,
1284
+ "is-active": this.isActive,
1285
+ "has-link": this.hasLink
1286
+ };
1287
+ },
1288
+ ariaRoleItem() {
1289
+ return this.ariaRole === "menuitem" || this.ariaRole === "listitem" ? this.ariaRole : void 0;
1290
+ },
1291
+ isClickable() {
1292
+ return !this.parent.disabled && !this.separator && !this.disabled && !this.custom;
1293
+ },
1294
+ isActive() {
1295
+ if (this.parent.selected === null) return false;
1296
+ if (this.parent.multiple) {
1297
+ return this.parent.selected.indexOf(this.value) >= 0;
1298
+ }
1299
+ return this.value === this.parent.selected;
1300
+ },
1301
+ isFocusable() {
1302
+ return this.hasLink ? false : this.focusable;
1303
+ }
1304
+ },
1305
+ methods: {
1306
+ /*
1307
+ * Click listener, select the item.
1308
+ */
1309
+ selectItem() {
1310
+ if (!this.isClickable) return;
1311
+ this.parent.selectItem(this.value);
1312
+ this.$emit("click");
1313
+ }
1314
+ }
1315
+ });
1316
+
1317
+ const _hoisted_1$6 = {
1318
+ key: 0,
1319
+ class: "dropdown-divider"
1320
+ };
1321
+ const _hoisted_2$6 = ["role", "tabindex"];
1322
+ const _hoisted_3$4 = ["role", "tabindex"];
1323
+ function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
1324
+ return _ctx.separator ? (vue.openBlock(), vue.createElementBlock("hr", _hoisted_1$6)) : !_ctx.custom && !_ctx.hasLink ? (vue.openBlock(), vue.createElementBlock("a", {
1325
+ key: 1,
1326
+ class: vue.normalizeClass(["dropdown-item", _ctx.anchorClasses]),
1327
+ onClick: _cache[0] || (_cache[0] = (...args) => _ctx.selectItem && _ctx.selectItem(...args)),
1328
+ role: _ctx.ariaRoleItem,
1329
+ tabindex: _ctx.isFocusable ? 0 : void 0
1330
+ }, [
1331
+ vue.renderSlot(_ctx.$slots, "default")
1332
+ ], 10, _hoisted_2$6)) : (vue.openBlock(), vue.createElementBlock("div", {
1333
+ key: 2,
1334
+ class: vue.normalizeClass(_ctx.itemClasses),
1335
+ onClick: _cache[1] || (_cache[1] = (...args) => _ctx.selectItem && _ctx.selectItem(...args)),
1336
+ role: _ctx.ariaRoleItem,
1337
+ tabindex: _ctx.isFocusable ? 0 : void 0
1338
+ }, [
1339
+ vue.renderSlot(_ctx.$slots, "default")
1340
+ ], 10, _hoisted_3$4));
1341
+ }
1342
+ var BDropdownItem = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
1343
+
1344
+ const mdiIcons = {
1345
+ sizes: {
1346
+ default: "mdi-24px",
1347
+ "is-small": null,
1348
+ "is-medium": "mdi-36px",
1349
+ "is-large": "mdi-48px"
1350
+ },
1351
+ iconPrefix: "mdi-"
1352
+ };
1353
+ const faIcons = () => {
1354
+ const faIconPrefix = "fa-";
1355
+ return {
1356
+ sizes: {
1357
+ default: null,
1358
+ "is-small": null,
1359
+ "is-medium": faIconPrefix + "lg",
1360
+ "is-large": faIconPrefix + "2x"
1361
+ },
1362
+ iconPrefix: faIconPrefix,
1363
+ internalIcons: {
1364
+ information: "info-circle",
1365
+ alert: "exclamation-triangle",
1366
+ "alert-circle": "exclamation-circle",
1367
+ "chevron-right": "angle-right",
1368
+ "chevron-left": "angle-left",
1369
+ "chevron-down": "angle-down",
1370
+ "eye-off": "eye-slash",
1371
+ "menu-down": "caret-down",
1372
+ "menu-up": "caret-up",
1373
+ "close-circle": "times-circle"
1374
+ }
1375
+ };
1376
+ };
1377
+ const getIcons = () => {
1378
+ let icons = {
1379
+ mdi: mdiIcons,
1380
+ fa: faIcons(),
1381
+ fas: faIcons(),
1382
+ far: faIcons(),
1383
+ fad: faIcons(),
1384
+ fab: faIcons(),
1385
+ fal: faIcons(),
1386
+ "fa-solid": faIcons(),
1387
+ "fa-regular": faIcons(),
1388
+ "fa-light": faIcons(),
1389
+ "fa-thin": faIcons(),
1390
+ "fa-duotone": faIcons(),
1391
+ "fa-brands": faIcons()
1392
+ };
1393
+ return icons;
1394
+ };
1395
+
1396
+ var _sfc_main$6 = vue.defineComponent({
1397
+ name: "BIcon",
1398
+ props: {
1399
+ type: [String, Object],
1400
+ component: String,
1401
+ pack: String,
1402
+ icon: {
1403
+ type: String,
1404
+ required: true
1405
+ },
1406
+ size: String,
1407
+ customSize: String,
1408
+ customClass: String,
1409
+ both: Boolean
1410
+ // This is used internally to show both MDI and FA icon
1411
+ },
1412
+ computed: {
1413
+ iconConfig() {
1414
+ const allIcons = getIcons();
1415
+ return allIcons[this.newPack];
1416
+ },
1417
+ iconPrefix() {
1418
+ if (this.iconConfig && this.iconConfig.iconPrefix) {
1419
+ return this.iconConfig.iconPrefix;
1420
+ }
1421
+ return "";
1422
+ },
1423
+ /*
1424
+ * Internal icon name based on the pack.
1425
+ * If pack is 'fa', gets the equivalent FA icon name of the MDI,
1426
+ * internal icons are always MDI.
1427
+ */
1428
+ newIcon() {
1429
+ return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;
1430
+ },
1431
+ newPack() {
1432
+ return this.pack || config.defaultIconPack;
1433
+ },
1434
+ newType() {
1435
+ if (!this.type) return;
1436
+ let splitType = [];
1437
+ if (typeof this.type === "string") {
1438
+ splitType = this.type.split("-");
1439
+ } else {
1440
+ for (const key in this.type) {
1441
+ if (this.type[key]) {
1442
+ splitType = key.split("-");
1443
+ break;
1444
+ }
1445
+ }
1446
+ }
1447
+ if (splitType.length <= 1) return;
1448
+ const [, ...type] = splitType;
1449
+ return `has-text-${type.join("-")}`;
1450
+ },
1451
+ newCustomSize() {
1452
+ return this.customSize || this.customSizeByPack;
1453
+ },
1454
+ customSizeByPack() {
1455
+ if (this.iconConfig && this.iconConfig.sizes) {
1456
+ if (this.size && this.iconConfig.sizes[this.size] !== void 0) {
1457
+ return this.iconConfig.sizes[this.size];
1458
+ } else if (this.iconConfig.sizes.default) {
1459
+ return this.iconConfig.sizes.default;
1460
+ }
1461
+ }
1462
+ return null;
1463
+ },
1464
+ useIconComponent() {
1465
+ return this.component || config.defaultIconComponent;
1466
+ }
1467
+ },
1468
+ methods: {
1469
+ /*
1470
+ * Equivalent icon name of the MDI.
1471
+ */
1472
+ getEquivalentIconOf(value) {
1473
+ if (!this.both) {
1474
+ return value;
1475
+ }
1476
+ if (this.iconConfig == null) {
1477
+ return value;
1478
+ }
1479
+ const maybeInternal = this.iconConfig;
1480
+ if (maybeInternal && maybeInternal.internalIcons && maybeInternal.internalIcons[value]) {
1481
+ return maybeInternal.internalIcons[value];
1482
+ }
1483
+ return value;
1484
+ }
1485
+ }
1486
+ });
1487
+
1488
+ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
1489
+ return vue.openBlock(), vue.createElementBlock(
1490
+ "span",
1491
+ {
1492
+ class: vue.normalizeClass(["icon", [_ctx.newType, _ctx.size]])
1493
+ },
1494
+ [
1495
+ !_ctx.useIconComponent ? (vue.openBlock(), vue.createElementBlock(
1496
+ "i",
1497
+ {
1498
+ key: 0,
1499
+ class: vue.normalizeClass([_ctx.newPack, _ctx.newIcon, _ctx.newCustomSize, _ctx.customClass])
1500
+ },
1501
+ null,
1502
+ 2
1503
+ /* CLASS */
1504
+ )) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.useIconComponent), {
1505
+ key: 1,
1506
+ icon: [_ctx.newPack, _ctx.newIcon],
1507
+ size: _ctx.newCustomSize,
1508
+ class: vue.normalizeClass([_ctx.customClass])
1509
+ }, null, 8, ["icon", "size", "class"]))
1510
+ ],
1511
+ 2
1512
+ /* CLASS */
1513
+ );
1514
+ }
1515
+ var BIcon = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$6]]);
1516
+
1517
+ var _sfc_main$5 = vue.defineComponent({
1518
+ name: "BInput",
1519
+ components: { BIcon },
1520
+ mixins: [CompatFallthroughMixin, FormElementMixin],
1521
+ props: {
1522
+ modelValue: {
1523
+ type: [Number, String]
1524
+ },
1525
+ type: {
1526
+ type: String,
1527
+ default: "text"
1528
+ },
1529
+ lazy: {
1530
+ type: Boolean,
1531
+ default: false
1532
+ },
1533
+ passwordReveal: Boolean,
1534
+ iconClickable: Boolean,
1535
+ hasCounter: {
1536
+ type: Boolean,
1537
+ default: () => config.defaultInputHasCounter
1538
+ },
1539
+ customClass: {
1540
+ type: String,
1541
+ default: ""
1542
+ },
1543
+ iconRight: String,
1544
+ iconRightClickable: Boolean,
1545
+ iconRightType: String,
1546
+ // Native options to use in HTML5 validation
1547
+ autocomplete: String
1548
+ },
1549
+ emits: {
1550
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1551
+ "icon-click": (event) => true,
1552
+ "icon-right-click": (event) => true,
1553
+ "update:modelValue": (value) => true
1554
+ /* eslint-enable @typescript-eslint/no-unused-vars */
1555
+ },
1556
+ data() {
1557
+ return {
1558
+ newValue: this.modelValue,
1559
+ newType: this.type,
1560
+ newAutocomplete: this.autocomplete || config.defaultInputAutocomplete,
1561
+ isPasswordVisible: false,
1562
+ _elementRef: this.type === "textarea" ? "textarea" : "input"
1563
+ };
1564
+ },
1565
+ computed: {
1566
+ computedValue: {
1567
+ get() {
1568
+ return this.newValue;
1569
+ },
1570
+ set(value) {
1571
+ this.newValue = value;
1572
+ this.$emit("update:modelValue", value);
1573
+ }
1574
+ },
1575
+ rootClasses() {
1576
+ return [
1577
+ this.iconPosition,
1578
+ this.size,
1579
+ {
1580
+ "is-expanded": this.expanded,
1581
+ "is-loading": this.loading,
1582
+ "is-clearfix": !this.hasMessage
1583
+ }
1584
+ ];
1585
+ },
1586
+ inputClasses() {
1587
+ return [
1588
+ this.statusType,
1589
+ this.size,
1590
+ { "is-rounded": this.rounded }
1591
+ ];
1592
+ },
1593
+ hasIconRight() {
1594
+ return this.passwordReveal || this.loading || this.statusIcon && this.statusTypeIcon || this.iconRight;
1595
+ },
1596
+ rightIcon() {
1597
+ if (this.passwordReveal) {
1598
+ return this.passwordVisibleIcon;
1599
+ } else if (this.iconRight) {
1600
+ return this.iconRight;
1601
+ }
1602
+ return this.statusTypeIcon;
1603
+ },
1604
+ rightIconType() {
1605
+ if (this.passwordReveal) {
1606
+ return "is-primary";
1607
+ } else if (this.iconRight) {
1608
+ return this.iconRightType || void 0;
1609
+ }
1610
+ return this.statusType;
1611
+ },
1612
+ /*
1613
+ * Position of the icon or if it's both sides.
1614
+ */
1615
+ iconPosition() {
1616
+ let iconClasses = "";
1617
+ if (this.icon) {
1618
+ iconClasses += "has-icons-left ";
1619
+ }
1620
+ if (this.hasIconRight) {
1621
+ iconClasses += "has-icons-right";
1622
+ }
1623
+ return iconClasses;
1624
+ },
1625
+ /*
1626
+ * Icon name (MDI) based on the type.
1627
+ */
1628
+ statusTypeIcon() {
1629
+ switch (this.statusType) {
1630
+ case "is-success":
1631
+ return "check";
1632
+ case "is-danger":
1633
+ return "alert-circle";
1634
+ case "is-info":
1635
+ return "information";
1636
+ case "is-warning":
1637
+ return "alert";
1638
+ default:
1639
+ return void 0;
1640
+ }
1641
+ },
1642
+ /*
1643
+ * Check if have any message prop from parent if it's a Field.
1644
+ */
1645
+ hasMessage() {
1646
+ return !!this.statusMessage;
1647
+ },
1648
+ /*
1649
+ * Current password-reveal icon name.
1650
+ */
1651
+ passwordVisibleIcon() {
1652
+ return !this.isPasswordVisible ? "eye" : "eye-off";
1653
+ },
1654
+ /*
1655
+ * Get value length
1656
+ */
1657
+ valueLength() {
1658
+ if (typeof this.computedValue === "string") {
1659
+ return Array.from(this.computedValue).length;
1660
+ } else if (typeof this.computedValue === "number") {
1661
+ return this.computedValue.toString().length;
1662
+ }
1663
+ return 0;
1664
+ }
1665
+ },
1666
+ watch: {
1667
+ /*
1668
+ * When v-model is changed:
1669
+ * 1. Set internal value.
1670
+ * 2. Validate it if the value came from outside;
1671
+ * i.e., not equal to computedValue
1672
+ */
1673
+ modelValue(value) {
1674
+ const fromOutside = this.computedValue != value;
1675
+ this.newValue = value;
1676
+ if (fromOutside) {
1677
+ this.$nextTick(() => {
1678
+ !this.isValid && this.checkHtml5Validity();
1679
+ });
1680
+ }
1681
+ },
1682
+ type(type) {
1683
+ this.newType = type;
1684
+ }
1685
+ },
1686
+ methods: {
1687
+ /*
1688
+ * Toggle the visibility of a password-reveal input
1689
+ * by changing the type and focus the input right away.
1690
+ */
1691
+ togglePasswordVisibility() {
1692
+ this.isPasswordVisible = !this.isPasswordVisible;
1693
+ this.newType = this.isPasswordVisible ? "text" : "password";
1694
+ this.$nextTick(() => {
1695
+ this.focus();
1696
+ });
1697
+ },
1698
+ iconClick(emit, event) {
1699
+ this.$emit(emit, event);
1700
+ this.$nextTick(() => {
1701
+ this.focus();
1702
+ });
1703
+ },
1704
+ rightIconClick(event) {
1705
+ if (this.passwordReveal) {
1706
+ this.togglePasswordVisibility();
1707
+ } else if (this.iconRightClickable) {
1708
+ this.iconClick("icon-right-click", event);
1709
+ }
1710
+ },
1711
+ onInput() {
1712
+ if (!this.lazy) {
1713
+ this.revalidate();
1714
+ }
1715
+ },
1716
+ onChange() {
1717
+ if (this.lazy) {
1718
+ this.revalidate();
1719
+ }
1720
+ },
1721
+ revalidate() {
1722
+ !this.isValid && this.checkHtml5Validity();
1723
+ }
1724
+ }
1725
+ });
1726
+
1727
+ const _hoisted_1$5 = ["type", "autocomplete", "maxlength"];
1728
+ const _hoisted_2$5 = ["maxlength"];
1729
+ const _hoisted_3$3 = ["type", "autocomplete", "maxlength"];
1730
+ const _hoisted_4$3 = ["maxlength"];
1731
+ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
1732
+ const _component_b_icon = vue.resolveComponent("b-icon");
1733
+ return vue.openBlock(), vue.createElementBlock(
1734
+ "div",
1735
+ vue.mergeProps({
1736
+ class: ["control", _ctx.rootClasses]
1737
+ }, _ctx.rootAttrs),
1738
+ [
1739
+ _ctx.lazy ? (vue.openBlock(), vue.createElementBlock(
1740
+ vue.Fragment,
1741
+ { key: 0 },
1742
+ [
1743
+ _ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
1744
+ key: 0,
1745
+ ref: "input",
1746
+ class: ["input", [_ctx.inputClasses, _ctx.customClass]],
1747
+ type: _ctx.newType,
1748
+ autocomplete: _ctx.newAutocomplete,
1749
+ maxlength: _ctx.maxlength,
1750
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event)
1751
+ }, _ctx.fallthroughAttrs, {
1752
+ onInput: _cache[1] || (_cache[1] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1753
+ onChange: _cache[2] || (_cache[2] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1754
+ onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1755
+ onFocus: _cache[4] || (_cache[4] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1756
+ }), null, 16, _hoisted_1$5)), [
1757
+ [
1758
+ vue.vModelDynamic,
1759
+ _ctx.computedValue,
1760
+ void 0,
1761
+ { lazy: true }
1762
+ ]
1763
+ ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
1764
+ key: 1,
1765
+ ref: "textarea",
1766
+ class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
1767
+ maxlength: _ctx.maxlength,
1768
+ "onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.computedValue = $event)
1769
+ }, _ctx.fallthroughAttrs, {
1770
+ onInput: _cache[6] || (_cache[6] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1771
+ onChange: _cache[7] || (_cache[7] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1772
+ onBlur: _cache[8] || (_cache[8] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1773
+ onFocus: _cache[9] || (_cache[9] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1774
+ }), null, 16, _hoisted_2$5)), [
1775
+ [
1776
+ vue.vModelText,
1777
+ _ctx.computedValue,
1778
+ void 0,
1779
+ { lazy: true }
1780
+ ]
1781
+ ])
1782
+ ],
1783
+ 64
1784
+ /* STABLE_FRAGMENT */
1785
+ )) : (vue.openBlock(), vue.createElementBlock(
1786
+ vue.Fragment,
1787
+ { key: 1 },
1788
+ [
1789
+ _ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
1790
+ key: 0,
1791
+ ref: "input",
1792
+ class: ["input", [_ctx.inputClasses, _ctx.customClass]],
1793
+ type: _ctx.newType,
1794
+ autocomplete: _ctx.newAutocomplete,
1795
+ maxlength: _ctx.maxlength,
1796
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.computedValue = $event)
1797
+ }, _ctx.fallthroughAttrs, {
1798
+ onInput: _cache[11] || (_cache[11] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1799
+ onChange: _cache[12] || (_cache[12] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1800
+ onBlur: _cache[13] || (_cache[13] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1801
+ onFocus: _cache[14] || (_cache[14] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1802
+ }), null, 16, _hoisted_3$3)), [
1803
+ [vue.vModelDynamic, _ctx.computedValue]
1804
+ ]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
1805
+ key: 1,
1806
+ ref: "textarea",
1807
+ class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
1808
+ maxlength: _ctx.maxlength,
1809
+ "onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.computedValue = $event)
1810
+ }, _ctx.fallthroughAttrs, {
1811
+ onInput: _cache[16] || (_cache[16] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
1812
+ onChange: _cache[17] || (_cache[17] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
1813
+ onBlur: _cache[18] || (_cache[18] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1814
+ onFocus: _cache[19] || (_cache[19] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
1815
+ }), null, 16, _hoisted_4$3)), [
1816
+ [vue.vModelText, _ctx.computedValue]
1817
+ ])
1818
+ ],
1819
+ 64
1820
+ /* STABLE_FRAGMENT */
1821
+ )),
1822
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
1823
+ key: 2,
1824
+ class: vue.normalizeClass(["is-left", { "is-clickable": _ctx.iconClickable }]),
1825
+ icon: _ctx.icon,
1826
+ pack: _ctx.iconPack,
1827
+ size: _ctx.iconSize,
1828
+ onClick: _cache[20] || (_cache[20] = ($event) => _ctx.iconClick("icon-click", $event))
1829
+ }, null, 8, ["class", "icon", "pack", "size"])) : vue.createCommentVNode("v-if", true),
1830
+ !_ctx.loading && _ctx.hasIconRight && _ctx.rightIcon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
1831
+ key: 3,
1832
+ class: vue.normalizeClass(["is-right", { "is-clickable": _ctx.passwordReveal || _ctx.iconRightClickable }]),
1833
+ icon: _ctx.rightIcon,
1834
+ pack: _ctx.iconPack,
1835
+ size: _ctx.iconSize,
1836
+ type: _ctx.rightIconType,
1837
+ both: "",
1838
+ onClick: _ctx.rightIconClick
1839
+ }, null, 8, ["class", "icon", "pack", "size", "type", "onClick"])) : vue.createCommentVNode("v-if", true),
1840
+ _ctx.maxlength && _ctx.hasCounter && _ctx.type !== "number" ? (vue.openBlock(), vue.createElementBlock(
1841
+ "small",
1842
+ {
1843
+ key: 4,
1844
+ class: vue.normalizeClass(["help counter", { "is-invisible": !_ctx.isFocused }])
1845
+ },
1846
+ vue.toDisplayString(_ctx.valueLength) + " / " + vue.toDisplayString(_ctx.maxlength),
1847
+ 3
1848
+ /* TEXT, CLASS */
1849
+ )) : vue.createCommentVNode("v-if", true)
1850
+ ],
1851
+ 16
1852
+ /* FULL_PROPS */
1853
+ );
1854
+ }
1855
+ var BInput = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$5]]);
1856
+
1857
+ var _sfc_main$4 = vue.defineComponent({
1858
+ name: "BSelect",
1859
+ components: {
1860
+ BIcon
1861
+ },
1862
+ mixins: [CompatFallthroughMixin, FormElementMixin],
1863
+ props: {
1864
+ modelValue: {
1865
+ type: [
1866
+ String,
1867
+ Number,
1868
+ Boolean,
1869
+ Object,
1870
+ Array,
1871
+ Function,
1872
+ Date,
1873
+ null
1874
+ ],
1875
+ default: null
1876
+ },
1877
+ placeholder: String,
1878
+ multiple: Boolean,
1879
+ nativeSize: [String, Number]
1880
+ },
1881
+ emits: {
1882
+ /* eslint-disable @typescript-eslint/no-unused-vars */
1883
+ blur: (_event) => true,
1884
+ focus: (_event) => true,
1885
+ "update:modelValue": (_value) => true
1886
+ /* eslint-enable @typescript-eslint/no-unused-vars */
1887
+ },
1888
+ data() {
1889
+ return {
1890
+ selected: this.modelValue,
1891
+ _elementRef: "select"
1892
+ };
1893
+ },
1894
+ computed: {
1895
+ computedValue: {
1896
+ get() {
1897
+ return this.selected;
1898
+ },
1899
+ set(value) {
1900
+ this.selected = value;
1901
+ this.$emit("update:modelValue", value);
1902
+ !this.isValid && this.checkHtml5Validity();
1903
+ }
1904
+ },
1905
+ spanClasses() {
1906
+ return [this.size, this.statusType, {
1907
+ "is-fullwidth": this.expanded,
1908
+ "is-loading": this.loading,
1909
+ "is-multiple": this.multiple,
1910
+ "is-rounded": this.rounded,
1911
+ "is-empty": this.selected === null
1912
+ }];
1913
+ }
1914
+ },
1915
+ watch: {
1916
+ /*
1917
+ * When v-model is changed:
1918
+ * 1. Set the selected option.
1919
+ * 2. If it's invalid, validate again.
1920
+ */
1921
+ modelValue(value) {
1922
+ this.selected = value;
1923
+ !this.isValid && this.checkHtml5Validity();
1924
+ }
1925
+ }
1926
+ });
1927
+
1928
+ const _hoisted_1$4 = ["multiple", "size"];
1929
+ const _hoisted_2$4 = {
1930
+ key: 0,
1931
+ value: null,
1932
+ disabled: "",
1933
+ hidden: ""
1934
+ };
1935
+ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
1936
+ const _component_b_icon = vue.resolveComponent("b-icon");
1937
+ return vue.openBlock(), vue.createElementBlock(
1938
+ "div",
1939
+ vue.mergeProps({
1940
+ class: ["control", { "is-expanded": _ctx.expanded, "has-icons-left": _ctx.icon }]
1941
+ }, _ctx.rootAttrs),
1942
+ [
1943
+ vue.createElementVNode(
1944
+ "span",
1945
+ {
1946
+ class: vue.normalizeClass(["select", _ctx.spanClasses])
1947
+ },
1948
+ [
1949
+ vue.withDirectives(vue.createElementVNode("select", vue.mergeProps({
1950
+ "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event),
1951
+ ref: "select",
1952
+ multiple: _ctx.multiple,
1953
+ size: _ctx.nativeSize
1954
+ }, _ctx.fallthroughAttrs, {
1955
+ onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
1956
+ onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("focus", $event))
1957
+ }), [
1958
+ _ctx.placeholder ? (vue.openBlock(), vue.createElementBlock(
1959
+ vue.Fragment,
1960
+ { key: 0 },
1961
+ [
1962
+ _ctx.computedValue == null ? (vue.openBlock(), vue.createElementBlock(
1963
+ "option",
1964
+ _hoisted_2$4,
1965
+ vue.toDisplayString(_ctx.placeholder),
1966
+ 1
1967
+ /* TEXT */
1968
+ )) : vue.createCommentVNode("v-if", true)
1969
+ ],
1970
+ 64
1971
+ /* STABLE_FRAGMENT */
1972
+ )) : vue.createCommentVNode("v-if", true),
1973
+ vue.renderSlot(_ctx.$slots, "default")
1974
+ ], 16, _hoisted_1$4), [
1975
+ [vue.vModelSelect, _ctx.computedValue]
1976
+ ])
1977
+ ],
1978
+ 2
1979
+ /* CLASS */
1980
+ ),
1981
+ _ctx.icon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
1982
+ key: 0,
1983
+ class: "is-left",
1984
+ icon: _ctx.icon,
1985
+ pack: _ctx.iconPack,
1986
+ size: _ctx.iconSize
1987
+ }, null, 8, ["icon", "pack", "size"])) : vue.createCommentVNode("v-if", true)
1988
+ ],
1989
+ 16
1990
+ /* FULL_PROPS */
1991
+ );
1992
+ }
1993
+ var BSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$4]]);
1994
+
1995
+ var _sfc_main$3 = vue.defineComponent({
1996
+ name: "BDatepickerTableRow",
1997
+ inject: {
1998
+ $datepicker: { name: "$datepicker", default: false }
1999
+ },
2000
+ props: {
2001
+ selectedDate: {
2002
+ type: [Date, Array]
2003
+ },
2004
+ hoveredDateRange: Array,
2005
+ day: {
2006
+ type: Number
2007
+ },
2008
+ week: {
2009
+ type: Array,
2010
+ required: true
2011
+ },
2012
+ month: {
2013
+ type: Number,
2014
+ required: true
2015
+ },
2016
+ minDate: [Date, null],
2017
+ maxDate: [Date, null],
2018
+ disabled: Boolean,
2019
+ unselectableDates: [Array, Function, null],
2020
+ unselectableDaysOfWeek: [Array, null],
2021
+ selectableDates: [Array, Function, null],
2022
+ events: Array,
2023
+ indicators: String,
2024
+ dateCreator: Function,
2025
+ nearbyMonthDays: Boolean,
2026
+ nearbySelectableMonthDays: Boolean,
2027
+ showWeekNumber: Boolean,
2028
+ weekNumberClickable: Boolean,
2029
+ range: Boolean,
2030
+ multiple: Boolean,
2031
+ rulesForFirstWeek: Number,
2032
+ firstDayOfWeek: [Number, null]
2033
+ },
2034
+ emits: {
2035
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2036
+ "change-focus": (_day) => true,
2037
+ rangeHoverEndDate: (_day) => true,
2038
+ select: (_day) => true
2039
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2040
+ },
2041
+ watch: {
2042
+ day(day) {
2043
+ const refName = `day-${this.month}-${day}`;
2044
+ this.$nextTick(() => {
2045
+ let cell;
2046
+ if (Array.isArray(this.$refs[refName])) {
2047
+ cell = this.$refs[refName][0];
2048
+ } else {
2049
+ cell = this.$refs[refName];
2050
+ }
2051
+ if (cell) {
2052
+ cell.focus();
2053
+ }
2054
+ });
2055
+ }
2056
+ },
2057
+ methods: {
2058
+ firstWeekOffset(year, dow, doy) {
2059
+ const fwd = 7 + dow - doy;
2060
+ const firstJanuary = new Date(year, 0, fwd);
2061
+ const fwdlw = (7 + firstJanuary.getDay() - dow) % 7;
2062
+ return -fwdlw + fwd - 1;
2063
+ },
2064
+ daysInYear(year) {
2065
+ return this.isLeapYear(year) ? 366 : 365;
2066
+ },
2067
+ isLeapYear(year) {
2068
+ return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;
2069
+ },
2070
+ getSetDayOfYear(input) {
2071
+ return Math.round((+input - +new Date(input.getFullYear(), 0, 1)) / 864e5) + 1;
2072
+ },
2073
+ weeksInYear(year, dow, doy) {
2074
+ const weekOffset = this.firstWeekOffset(year, dow, doy);
2075
+ const weekOffsetNext = this.firstWeekOffset(year + 1, dow, doy);
2076
+ return (this.daysInYear(year) - weekOffset + weekOffsetNext) / 7;
2077
+ },
2078
+ getWeekNumber(mom) {
2079
+ const dow = this.firstDayOfWeek;
2080
+ const doy = this.rulesForFirstWeek;
2081
+ const weekOffset = this.firstWeekOffset(mom.getFullYear(), dow, doy);
2082
+ const week = Math.floor((this.getSetDayOfYear(mom) - weekOffset - 1) / 7) + 1;
2083
+ let resWeek;
2084
+ let resYear;
2085
+ if (week < 1) {
2086
+ resYear = mom.getFullYear() - 1;
2087
+ resWeek = week + this.weeksInYear(resYear, dow, doy);
2088
+ } else if (week > this.weeksInYear(mom.getFullYear(), dow, doy)) {
2089
+ resWeek = week - this.weeksInYear(mom.getFullYear(), dow, doy);
2090
+ resYear = mom.getFullYear() + 1;
2091
+ } else {
2092
+ resYear = mom.getFullYear();
2093
+ resWeek = week;
2094
+ }
2095
+ return { week: resWeek, year: resYear };
2096
+ },
2097
+ clickWeekNumber(weekData) {
2098
+ if (this.weekNumberClickable) {
2099
+ this.$datepicker.$emit("week-number-click", weekData.week, weekData.year);
2100
+ }
2101
+ },
2102
+ /*
2103
+ * Check that selected day is within earliest/latest params and
2104
+ * is within this month
2105
+ */
2106
+ selectableDate(day) {
2107
+ const validity = [];
2108
+ if (this.minDate) {
2109
+ validity.push(day >= this.minDate);
2110
+ }
2111
+ if (this.maxDate) {
2112
+ validity.push(day <= this.maxDate);
2113
+ }
2114
+ if (this.nearbyMonthDays && !this.nearbySelectableMonthDays) {
2115
+ validity.push(day.getMonth() === this.month);
2116
+ }
2117
+ if (this.selectableDates) {
2118
+ if (typeof this.selectableDates === "function") {
2119
+ if (this.selectableDates(day)) {
2120
+ return true;
2121
+ } else {
2122
+ validity.push(false);
2123
+ }
2124
+ } else {
2125
+ for (let i = 0; i < this.selectableDates.length; i++) {
2126
+ const enabledDate = this.selectableDates[i];
2127
+ if (day.getDate() === enabledDate.getDate() && day.getFullYear() === enabledDate.getFullYear() && day.getMonth() === enabledDate.getMonth()) {
2128
+ return true;
2129
+ } else {
2130
+ validity.push(false);
2131
+ }
2132
+ }
2133
+ }
2134
+ }
2135
+ if (this.unselectableDates) {
2136
+ if (typeof this.unselectableDates === "function") {
2137
+ validity.push(!this.unselectableDates(day));
2138
+ } else {
2139
+ for (let i = 0; i < this.unselectableDates.length; i++) {
2140
+ const disabledDate = this.unselectableDates[i];
2141
+ validity.push(
2142
+ day.getDate() !== disabledDate.getDate() || day.getFullYear() !== disabledDate.getFullYear() || day.getMonth() !== disabledDate.getMonth()
2143
+ );
2144
+ }
2145
+ }
2146
+ }
2147
+ if (this.unselectableDaysOfWeek) {
2148
+ for (let i = 0; i < this.unselectableDaysOfWeek.length; i++) {
2149
+ const dayOfWeek = this.unselectableDaysOfWeek[i];
2150
+ validity.push(day.getDay() !== dayOfWeek);
2151
+ }
2152
+ }
2153
+ return validity.indexOf(false) < 0;
2154
+ },
2155
+ /*
2156
+ * Emit select event with chosen date as payload
2157
+ */
2158
+ emitChosenDate(day) {
2159
+ if (this.disabled) return;
2160
+ if (this.selectableDate(day)) {
2161
+ this.$emit("select", day);
2162
+ }
2163
+ },
2164
+ // TODO: return undefined instead of boolean if no events
2165
+ eventsDateMatch(day) {
2166
+ if (!this.events || !this.events.length) return false;
2167
+ const dayEvents = [];
2168
+ for (let i = 0; i < this.events.length; i++) {
2169
+ if (this.events[i].date.getDay() === day.getDay()) {
2170
+ dayEvents.push(this.events[i]);
2171
+ }
2172
+ }
2173
+ if (!dayEvents.length) {
2174
+ return false;
2175
+ }
2176
+ return dayEvents;
2177
+ },
2178
+ /*
2179
+ * Build classObject for cell using validations
2180
+ */
2181
+ classObject(day) {
2182
+ function dateMatch(dateOne, dateTwo, multiple) {
2183
+ if (!dateOne || !dateTwo || multiple) {
2184
+ return false;
2185
+ }
2186
+ if (Array.isArray(dateTwo)) {
2187
+ return dateTwo.some((date) => dateOne.getDate() === date.getDate() && dateOne.getFullYear() === date.getFullYear() && dateOne.getMonth() === date.getMonth());
2188
+ }
2189
+ return dateOne.getDate() === dateTwo.getDate() && dateOne.getFullYear() === dateTwo.getFullYear() && dateOne.getMonth() === dateTwo.getMonth();
2190
+ }
2191
+ function dateWithin(dateOne, dates, multiple) {
2192
+ if (!Array.isArray(dates) || multiple) {
2193
+ return false;
2194
+ }
2195
+ return dateOne > dates[0] && dateOne < dates[1];
2196
+ }
2197
+ return {
2198
+ "is-selected": dateMatch(day, this.selectedDate) || dateWithin(day, this.selectedDate, this.multiple),
2199
+ "is-first-selected": dateMatch(
2200
+ day,
2201
+ Array.isArray(this.selectedDate) ? this.selectedDate[0] : void 0,
2202
+ this.multiple
2203
+ ),
2204
+ "is-within-selected": dateWithin(day, this.selectedDate, this.multiple),
2205
+ "is-last-selected": dateMatch(
2206
+ day,
2207
+ Array.isArray(this.selectedDate) ? this.selectedDate[1] : void 0,
2208
+ this.multiple
2209
+ ),
2210
+ "is-within-hovered-range": this.hoveredDateRange && this.hoveredDateRange.length === 2 && (dateMatch(day, this.hoveredDateRange) || dateWithin(day, this.hoveredDateRange)),
2211
+ "is-first-hovered": dateMatch(
2212
+ day,
2213
+ Array.isArray(this.hoveredDateRange) ? this.hoveredDateRange[0] : void 0
2214
+ ),
2215
+ "is-within-hovered": dateWithin(day, this.hoveredDateRange),
2216
+ "is-last-hovered": dateMatch(
2217
+ day,
2218
+ Array.isArray(this.hoveredDateRange) ? this.hoveredDateRange[1] : void 0
2219
+ ),
2220
+ "is-today": dateMatch(day, this.dateCreator()),
2221
+ "is-selectable": this.selectableDate(day) && !this.disabled,
2222
+ "is-unselectable": !this.selectableDate(day) || this.disabled,
2223
+ "is-invisible": !this.nearbyMonthDays && day.getMonth() !== this.month,
2224
+ "is-nearby": this.nearbySelectableMonthDays && day.getMonth() !== this.month,
2225
+ "has-event": this.eventsDateMatch(day),
2226
+ [this.indicators]: this.eventsDateMatch(day)
2227
+ };
2228
+ },
2229
+ setRangeHoverEndDate(day) {
2230
+ if (this.range) {
2231
+ this.$emit("rangeHoverEndDate", day);
2232
+ }
2233
+ },
2234
+ manageKeydown(event, weekDay) {
2235
+ const { key } = event;
2236
+ let preventDefault = true;
2237
+ switch (key) {
2238
+ case "Tab": {
2239
+ preventDefault = false;
2240
+ break;
2241
+ }
2242
+ case " ":
2243
+ case "Space":
2244
+ case "Spacebar":
2245
+ case "Enter": {
2246
+ this.emitChosenDate(weekDay);
2247
+ break;
2248
+ }
2249
+ case "ArrowLeft":
2250
+ case "Left": {
2251
+ this.changeFocus(weekDay, -1);
2252
+ break;
2253
+ }
2254
+ case "ArrowRight":
2255
+ case "Right": {
2256
+ this.changeFocus(weekDay, 1);
2257
+ break;
2258
+ }
2259
+ case "ArrowUp":
2260
+ case "Up": {
2261
+ this.changeFocus(weekDay, -7);
2262
+ break;
2263
+ }
2264
+ case "ArrowDown":
2265
+ case "Down": {
2266
+ this.changeFocus(weekDay, 7);
2267
+ break;
2268
+ }
2269
+ }
2270
+ if (preventDefault) {
2271
+ event.preventDefault();
2272
+ }
2273
+ },
2274
+ changeFocus(day, inc) {
2275
+ const nextDay = new Date(day.getTime());
2276
+ nextDay.setDate(day.getDate() + inc);
2277
+ while ((!this.minDate || nextDay > this.minDate) && (!this.maxDate || nextDay < this.maxDate) && !this.selectableDate(nextDay)) {
2278
+ nextDay.setDate(nextDay.getDate() + Math.sign(inc));
2279
+ }
2280
+ this.setRangeHoverEndDate(nextDay);
2281
+ this.$emit("change-focus", nextDay);
2282
+ }
2283
+ }
2284
+ });
2285
+
2286
+ const _hoisted_1$3 = { class: "datepicker-row" };
2287
+ const _hoisted_2$3 = ["disabled", "onClick", "onMouseenter", "onKeydown", "tabindex"];
2288
+ const _hoisted_3$2 = {
2289
+ key: 0,
2290
+ class: "events"
2291
+ };
2292
+ const _hoisted_4$2 = {
2293
+ key: 0,
2294
+ class: "events"
2295
+ };
2296
+ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
2297
+ return vue.openBlock(), vue.createElementBlock(
2298
+ vue.Fragment,
2299
+ null,
2300
+ [
2301
+ vue.createCommentVNode(" eslint-disable max-len "),
2302
+ vue.createElementVNode("div", _hoisted_1$3, [
2303
+ _ctx.showWeekNumber ? (vue.openBlock(), vue.createElementBlock(
2304
+ "a",
2305
+ {
2306
+ key: 0,
2307
+ class: vue.normalizeClass(["datepicker-cell is-week-number", { "is-clickable": _ctx.weekNumberClickable }]),
2308
+ onClick: _cache[0] || (_cache[0] = vue.withModifiers(($event) => _ctx.clickWeekNumber(_ctx.getWeekNumber(_ctx.week[6])), ["prevent"]))
2309
+ },
2310
+ [
2311
+ vue.createElementVNode(
2312
+ "span",
2313
+ null,
2314
+ vue.toDisplayString(_ctx.getWeekNumber(_ctx.week[6]).week),
2315
+ 1
2316
+ /* TEXT */
2317
+ )
2318
+ ],
2319
+ 2
2320
+ /* CLASS */
2321
+ )) : vue.createCommentVNode("v-if", true),
2322
+ (vue.openBlock(true), vue.createElementBlock(
2323
+ vue.Fragment,
2324
+ null,
2325
+ vue.renderList(_ctx.week, (weekDay, index) => {
2326
+ return vue.openBlock(), vue.createElementBlock(
2327
+ vue.Fragment,
2328
+ { key: index },
2329
+ [
2330
+ _ctx.selectableDate(weekDay) && !_ctx.disabled ? (vue.openBlock(), vue.createElementBlock("a", {
2331
+ key: 0,
2332
+ ref_for: true,
2333
+ ref: `day-${weekDay.getMonth()}-${weekDay.getDate()}`,
2334
+ class: vue.normalizeClass([_ctx.classObject(weekDay), "datepicker-cell"]),
2335
+ role: "button",
2336
+ href: "#",
2337
+ disabled: _ctx.disabled || void 0,
2338
+ onClick: vue.withModifiers(($event) => _ctx.emitChosenDate(weekDay), ["prevent"]),
2339
+ onMouseenter: ($event) => _ctx.setRangeHoverEndDate(weekDay),
2340
+ onKeydown: ($event) => _ctx.manageKeydown($event, weekDay),
2341
+ tabindex: _ctx.day === weekDay.getDate() && _ctx.month === weekDay.getMonth() ? void 0 : -1
2342
+ }, [
2343
+ vue.createElementVNode(
2344
+ "span",
2345
+ null,
2346
+ vue.toDisplayString(weekDay.getDate()),
2347
+ 1
2348
+ /* TEXT */
2349
+ ),
2350
+ _ctx.eventsDateMatch(weekDay) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
2351
+ (vue.openBlock(true), vue.createElementBlock(
2352
+ vue.Fragment,
2353
+ null,
2354
+ vue.renderList(_ctx.eventsDateMatch(weekDay), (event, evIdx) => {
2355
+ return vue.openBlock(), vue.createElementBlock(
2356
+ "div",
2357
+ {
2358
+ class: vue.normalizeClass(["event", event.type]),
2359
+ key: evIdx
2360
+ },
2361
+ null,
2362
+ 2
2363
+ /* CLASS */
2364
+ );
2365
+ }),
2366
+ 128
2367
+ /* KEYED_FRAGMENT */
2368
+ ))
2369
+ ])) : vue.createCommentVNode("v-if", true)
2370
+ ], 42, _hoisted_2$3)) : (vue.openBlock(), vue.createElementBlock(
2371
+ "div",
2372
+ {
2373
+ key: 1,
2374
+ class: vue.normalizeClass([_ctx.classObject(weekDay), "datepicker-cell"])
2375
+ },
2376
+ [
2377
+ vue.createElementVNode(
2378
+ "span",
2379
+ null,
2380
+ vue.toDisplayString(weekDay.getDate()),
2381
+ 1
2382
+ /* TEXT */
2383
+ ),
2384
+ _ctx.eventsDateMatch(weekDay) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$2, [
2385
+ (vue.openBlock(true), vue.createElementBlock(
2386
+ vue.Fragment,
2387
+ null,
2388
+ vue.renderList(_ctx.eventsDateMatch(weekDay), (event, evIdx) => {
2389
+ return vue.openBlock(), vue.createElementBlock(
2390
+ "div",
2391
+ {
2392
+ class: vue.normalizeClass(["event", event.type]),
2393
+ key: evIdx
2394
+ },
2395
+ null,
2396
+ 2
2397
+ /* CLASS */
2398
+ );
2399
+ }),
2400
+ 128
2401
+ /* KEYED_FRAGMENT */
2402
+ ))
2403
+ ])) : vue.createCommentVNode("v-if", true)
2404
+ ],
2405
+ 2
2406
+ /* CLASS */
2407
+ ))
2408
+ ],
2409
+ 64
2410
+ /* STABLE_FRAGMENT */
2411
+ );
2412
+ }),
2413
+ 128
2414
+ /* KEYED_FRAGMENT */
2415
+ ))
2416
+ ]),
2417
+ vue.createCommentVNode(" eslint-enable max-len ")
2418
+ ],
2419
+ 2112
2420
+ /* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
2421
+ );
2422
+ }
2423
+ var BDatepickerTableRow = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$3]]);
2424
+
2425
+ var _sfc_main$2 = vue.defineComponent({
2426
+ name: "BDatepickerTable",
2427
+ components: {
2428
+ BDatepickerTableRow
2429
+ },
2430
+ props: {
2431
+ modelValue: {
2432
+ type: [Date, Array, null]
2433
+ },
2434
+ dayNames: [Array, null],
2435
+ monthNames: [Array, null],
2436
+ firstDayOfWeek: [Number, null],
2437
+ events: Array,
2438
+ indicators: String,
2439
+ minDate: [Date, null],
2440
+ maxDate: [Date, null],
2441
+ focused: Object,
2442
+ disabled: Boolean,
2443
+ dateCreator: Function,
2444
+ unselectableDates: [Array, Function, null],
2445
+ unselectableDaysOfWeek: [Array, null],
2446
+ selectableDates: [Array, Function, null],
2447
+ nearbyMonthDays: Boolean,
2448
+ nearbySelectableMonthDays: Boolean,
2449
+ showWeekNumber: Boolean,
2450
+ weekNumberClickable: Boolean,
2451
+ rulesForFirstWeek: Number,
2452
+ range: Boolean,
2453
+ multiple: Boolean
2454
+ },
2455
+ emits: {
2456
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2457
+ "range-end": (_date) => true,
2458
+ "range-start": (_date) => true,
2459
+ "update:focused": (_focused) => true,
2460
+ "update:modelValue": (_value) => true
2461
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2462
+ },
2463
+ data() {
2464
+ return {
2465
+ selectedBeginDate: void 0,
2466
+ selectedEndDate: void 0,
2467
+ hoveredEndDate: void 0
2468
+ };
2469
+ },
2470
+ computed: {
2471
+ multipleSelectedDates: {
2472
+ get() {
2473
+ return this.multiple && this.modelValue ? this.modelValue : [];
2474
+ },
2475
+ set(value) {
2476
+ this.$emit("update:modelValue", value);
2477
+ }
2478
+ },
2479
+ visibleDayNames() {
2480
+ const visibleDayNames = [];
2481
+ let index = this.firstDayOfWeek;
2482
+ while (visibleDayNames.length < this.dayNames.length) {
2483
+ const currentDayName = this.dayNames[index % this.dayNames.length];
2484
+ visibleDayNames.push(currentDayName);
2485
+ index++;
2486
+ }
2487
+ if (this.showWeekNumber) visibleDayNames.unshift("");
2488
+ return visibleDayNames;
2489
+ },
2490
+ hasEvents() {
2491
+ return this.events && this.events.length;
2492
+ },
2493
+ /*
2494
+ * Return array of all events in the specified month
2495
+ */
2496
+ eventsInThisMonth() {
2497
+ if (!this.events) return [];
2498
+ const monthEvents = [];
2499
+ for (let i = 0; i < this.events.length; i++) {
2500
+ let event = this.events[i];
2501
+ if (!Object.prototype.hasOwnProperty.call(event, "date")) {
2502
+ event = { date: event, type: "is-primary" };
2503
+ }
2504
+ if (!Object.prototype.hasOwnProperty.call(event, "type")) {
2505
+ event.type = "is-primary";
2506
+ }
2507
+ if (event.date.getMonth() === this.focused.month && event.date.getFullYear() === this.focused.year) {
2508
+ monthEvents.push(event);
2509
+ }
2510
+ }
2511
+ return monthEvents;
2512
+ },
2513
+ /*
2514
+ * Return array of all weeks in the specified month
2515
+ */
2516
+ weeksInThisMonth() {
2517
+ this.validateFocusedDay();
2518
+ const month = this.focused.month;
2519
+ const year = this.focused.year;
2520
+ const weeksInThisMonth = [];
2521
+ let startingDay = 1;
2522
+ while (weeksInThisMonth.length < 6) {
2523
+ const newWeek = this.weekBuilder(startingDay, month, year);
2524
+ weeksInThisMonth.push(newWeek);
2525
+ startingDay += 7;
2526
+ }
2527
+ return weeksInThisMonth;
2528
+ },
2529
+ hoveredDateRange() {
2530
+ var _a, _b;
2531
+ if (!this.range) {
2532
+ return [];
2533
+ }
2534
+ if (!isNaN((_b = (_a = this.selectedEndDate) == null ? void 0 : _a.valueOf()) != null ? _b : NaN)) {
2535
+ return [];
2536
+ }
2537
+ if (this.hoveredEndDate < this.selectedBeginDate) {
2538
+ return [this.hoveredEndDate, this.selectedBeginDate].filter(isDefined);
2539
+ }
2540
+ return [this.selectedBeginDate, this.hoveredEndDate].filter(isDefined);
2541
+ },
2542
+ disabledOrUndefined() {
2543
+ return this.disabled || void 0;
2544
+ }
2545
+ },
2546
+ methods: {
2547
+ /*
2548
+ * Emit input event with selected date as payload for v-model in parent
2549
+ */
2550
+ updateSelectedDate(date) {
2551
+ if (!this.range && !this.multiple) {
2552
+ this.$emit("update:modelValue", date);
2553
+ } else if (this.range) {
2554
+ this.handleSelectRangeDate(date);
2555
+ } else if (this.multiple) {
2556
+ this.handleSelectMultipleDates(date);
2557
+ }
2558
+ },
2559
+ /*
2560
+ * If both begin and end dates are set, reset the end date and set the begin date.
2561
+ * If only begin date is selected, emit an array of the begin date and the new date.
2562
+ * If not set, only set the begin date.
2563
+ */
2564
+ handleSelectRangeDate(date) {
2565
+ if (this.selectedBeginDate && this.selectedEndDate) {
2566
+ this.selectedBeginDate = date;
2567
+ this.selectedEndDate = void 0;
2568
+ this.$emit("range-start", date);
2569
+ } else if (this.selectedBeginDate && !this.selectedEndDate) {
2570
+ if (this.selectedBeginDate > date) {
2571
+ this.selectedEndDate = this.selectedBeginDate;
2572
+ this.selectedBeginDate = date;
2573
+ } else {
2574
+ this.selectedEndDate = date;
2575
+ }
2576
+ this.$emit("range-end", date);
2577
+ this.$emit("update:modelValue", [this.selectedBeginDate, this.selectedEndDate]);
2578
+ } else {
2579
+ this.selectedBeginDate = date;
2580
+ this.$emit("range-start", date);
2581
+ }
2582
+ },
2583
+ /*
2584
+ * If selected date already exists list of selected dates, remove it from the list
2585
+ * Otherwise, add date to list of selected dates
2586
+ */
2587
+ handleSelectMultipleDates(date) {
2588
+ const multipleSelect = this.multipleSelectedDates.filter(
2589
+ (selectedDate) => selectedDate.getDate() === date.getDate() && selectedDate.getFullYear() === date.getFullYear() && selectedDate.getMonth() === date.getMonth()
2590
+ );
2591
+ if (multipleSelect.length) {
2592
+ this.multipleSelectedDates = this.multipleSelectedDates.filter(
2593
+ (selectedDate) => selectedDate.getDate() !== date.getDate() || selectedDate.getFullYear() !== date.getFullYear() || selectedDate.getMonth() !== date.getMonth()
2594
+ );
2595
+ } else {
2596
+ this.multipleSelectedDates = [...this.multipleSelectedDates, date];
2597
+ }
2598
+ },
2599
+ /*
2600
+ * Return array of all days in the week that the startingDate is within
2601
+ */
2602
+ weekBuilder(startingDate, month, year) {
2603
+ const thisMonth = new Date(year, month);
2604
+ const thisWeek = [];
2605
+ const dayOfWeek = new Date(year, month, startingDate).getDay();
2606
+ const end = dayOfWeek >= this.firstDayOfWeek ? dayOfWeek - this.firstDayOfWeek : 7 - this.firstDayOfWeek + dayOfWeek;
2607
+ let daysAgo = 1;
2608
+ for (let i = 0; i < end; i++) {
2609
+ thisWeek.unshift(
2610
+ new Date(
2611
+ thisMonth.getFullYear(),
2612
+ thisMonth.getMonth(),
2613
+ startingDate - daysAgo
2614
+ )
2615
+ );
2616
+ daysAgo++;
2617
+ }
2618
+ thisWeek.push(new Date(year, month, startingDate));
2619
+ let daysForward = 1;
2620
+ while (thisWeek.length < 7) {
2621
+ thisWeek.push(new Date(year, month, startingDate + daysForward));
2622
+ daysForward++;
2623
+ }
2624
+ return thisWeek;
2625
+ },
2626
+ validateFocusedDay() {
2627
+ const focusedDate = new Date(this.focused.year, this.focused.month, this.focused.day);
2628
+ if (this.selectableDate(focusedDate)) return;
2629
+ let day = 0;
2630
+ const monthDays = new Date(this.focused.year, this.focused.month + 1, 0).getDate();
2631
+ let firstFocusable = null;
2632
+ while (!firstFocusable && ++day < monthDays) {
2633
+ const date = new Date(this.focused.year, this.focused.month, day);
2634
+ if (this.selectableDate(date)) {
2635
+ firstFocusable = focusedDate;
2636
+ const focused = {
2637
+ day: date.getDate(),
2638
+ month: date.getMonth(),
2639
+ year: date.getFullYear()
2640
+ };
2641
+ this.$emit("update:focused", focused);
2642
+ }
2643
+ }
2644
+ },
2645
+ /*
2646
+ * Check that selected day is within earliest/latest params and
2647
+ * is within this month
2648
+ */
2649
+ selectableDate(day) {
2650
+ const validity = [];
2651
+ if (this.minDate) {
2652
+ validity.push(day >= this.minDate);
2653
+ }
2654
+ if (this.maxDate) {
2655
+ validity.push(day <= this.maxDate);
2656
+ }
2657
+ if (this.nearbyMonthDays && !this.nearbySelectableMonthDays) {
2658
+ validity.push(day.getMonth() === this.focused.month);
2659
+ }
2660
+ if (this.selectableDates) {
2661
+ if (typeof this.selectableDates === "function") {
2662
+ if (this.selectableDates(day)) {
2663
+ return true;
2664
+ } else {
2665
+ validity.push(false);
2666
+ }
2667
+ } else {
2668
+ for (let i = 0; i < this.selectableDates.length; i++) {
2669
+ const enabledDate = this.selectableDates[i];
2670
+ if (day.getDate() === enabledDate.getDate() && day.getFullYear() === enabledDate.getFullYear() && day.getMonth() === enabledDate.getMonth()) {
2671
+ return true;
2672
+ } else {
2673
+ validity.push(false);
2674
+ }
2675
+ }
2676
+ }
2677
+ }
2678
+ if (this.unselectableDates) {
2679
+ if (typeof this.unselectableDates === "function") {
2680
+ validity.push(!this.unselectableDates(day));
2681
+ } else {
2682
+ for (let i = 0; i < this.unselectableDates.length; i++) {
2683
+ const disabledDate = this.unselectableDates[i];
2684
+ validity.push(
2685
+ day.getDate() !== disabledDate.getDate() || day.getFullYear() !== disabledDate.getFullYear() || day.getMonth() !== disabledDate.getMonth()
2686
+ );
2687
+ }
2688
+ }
2689
+ }
2690
+ if (this.unselectableDaysOfWeek) {
2691
+ for (let i = 0; i < this.unselectableDaysOfWeek.length; i++) {
2692
+ const dayOfWeek = this.unselectableDaysOfWeek[i];
2693
+ validity.push(day.getDay() !== dayOfWeek);
2694
+ }
2695
+ }
2696
+ return validity.indexOf(false) < 0;
2697
+ },
2698
+ eventsInThisWeek(week) {
2699
+ return this.eventsInThisMonth.filter((event) => {
2700
+ const stripped = new Date(Date.parse(event.date + ""));
2701
+ stripped.setHours(0, 0, 0, 0);
2702
+ const timed = stripped.getTime();
2703
+ return week.some((weekDate) => weekDate.getTime() === timed);
2704
+ });
2705
+ },
2706
+ setRangeHoverEndDate(day) {
2707
+ this.hoveredEndDate = day;
2708
+ },
2709
+ changeFocus(day) {
2710
+ const focused = {
2711
+ day: day.getDate(),
2712
+ month: day.getMonth(),
2713
+ year: day.getFullYear()
2714
+ };
2715
+ this.$emit("update:focused", focused);
2716
+ }
2717
+ }
2718
+ });
2719
+
2720
+ const _hoisted_1$2 = { class: "datepicker-table" };
2721
+ const _hoisted_2$2 = { class: "datepicker-header" };
2722
+ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
2723
+ const _component_b_datepicker_table_row = vue.resolveComponent("b-datepicker-table-row");
2724
+ return vue.openBlock(), vue.createElementBlock("section", _hoisted_1$2, [
2725
+ vue.createElementVNode("header", _hoisted_2$2, [
2726
+ (vue.openBlock(true), vue.createElementBlock(
2727
+ vue.Fragment,
2728
+ null,
2729
+ vue.renderList(_ctx.visibleDayNames, (day, index) => {
2730
+ return vue.openBlock(), vue.createElementBlock("div", {
2731
+ key: index,
2732
+ class: "datepicker-cell"
2733
+ }, [
2734
+ vue.createElementVNode(
2735
+ "span",
2736
+ null,
2737
+ vue.toDisplayString(day),
2738
+ 1
2739
+ /* TEXT */
2740
+ )
2741
+ ]);
2742
+ }),
2743
+ 128
2744
+ /* KEYED_FRAGMENT */
2745
+ ))
2746
+ ]),
2747
+ vue.createElementVNode(
2748
+ "div",
2749
+ {
2750
+ class: vue.normalizeClass(["datepicker-body", { "has-events": _ctx.hasEvents }])
2751
+ },
2752
+ [
2753
+ (vue.openBlock(true), vue.createElementBlock(
2754
+ vue.Fragment,
2755
+ null,
2756
+ vue.renderList(_ctx.weeksInThisMonth, (week, index) => {
2757
+ return vue.openBlock(), vue.createBlock(_component_b_datepicker_table_row, {
2758
+ key: index,
2759
+ "selected-date": _ctx.modelValue ?? void 0,
2760
+ day: _ctx.focused.day,
2761
+ week,
2762
+ month: _ctx.focused.month,
2763
+ "min-date": _ctx.minDate,
2764
+ "max-date": _ctx.maxDate,
2765
+ disabled: _ctx.disabledOrUndefined,
2766
+ "unselectable-dates": _ctx.unselectableDates,
2767
+ "unselectable-days-of-week": _ctx.unselectableDaysOfWeek,
2768
+ "selectable-dates": _ctx.selectableDates,
2769
+ events: _ctx.eventsInThisWeek(week),
2770
+ indicators: _ctx.indicators,
2771
+ "date-creator": _ctx.dateCreator,
2772
+ "nearby-month-days": _ctx.nearbyMonthDays,
2773
+ "nearby-selectable-month-days": _ctx.nearbySelectableMonthDays,
2774
+ "show-week-number": _ctx.showWeekNumber,
2775
+ "week-number-clickable": _ctx.weekNumberClickable,
2776
+ "first-day-of-week": _ctx.firstDayOfWeek,
2777
+ "rules-for-first-week": _ctx.rulesForFirstWeek,
2778
+ range: _ctx.range,
2779
+ "hovered-date-range": _ctx.hoveredDateRange,
2780
+ onSelect: _ctx.updateSelectedDate,
2781
+ onRangeHoverEndDate: _ctx.setRangeHoverEndDate,
2782
+ multiple: _ctx.multiple,
2783
+ onChangeFocus: _ctx.changeFocus
2784
+ }, null, 8, ["selected-date", "day", "week", "month", "min-date", "max-date", "disabled", "unselectable-dates", "unselectable-days-of-week", "selectable-dates", "events", "indicators", "date-creator", "nearby-month-days", "nearby-selectable-month-days", "show-week-number", "week-number-clickable", "first-day-of-week", "rules-for-first-week", "range", "hovered-date-range", "onSelect", "onRangeHoverEndDate", "multiple", "onChangeFocus"]);
2785
+ }),
2786
+ 128
2787
+ /* KEYED_FRAGMENT */
2788
+ ))
2789
+ ],
2790
+ 2
2791
+ /* CLASS */
2792
+ )
2793
+ ]);
2794
+ }
2795
+ var BDatepickerTable = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$2]]);
2796
+
2797
+ var _sfc_main$1 = vue.defineComponent({
2798
+ name: "BDatepickerMonth",
2799
+ props: {
2800
+ modelValue: {
2801
+ type: [Date, Array, null]
2802
+ },
2803
+ monthNames: [Array, null],
2804
+ events: Array,
2805
+ indicators: String,
2806
+ minDate: [Date, null],
2807
+ maxDate: [Date, null],
2808
+ focused: Object,
2809
+ disabled: Boolean,
2810
+ dateCreator: Function,
2811
+ unselectableDates: [Array, Function, null],
2812
+ unselectableDaysOfWeek: [Array, null],
2813
+ selectableDates: [Array, Function, null],
2814
+ range: Boolean,
2815
+ multiple: Boolean
2816
+ },
2817
+ emits: {
2818
+ /* eslint-disable @typescript-eslint/no-unused-vars */
2819
+ "change-focus": (_date) => true,
2820
+ "range-end": (_date) => true,
2821
+ "range-start": (_date) => true,
2822
+ "update:modelValue": (_date) => true
2823
+ /* eslint-enable @typescript-eslint/no-unused-vars */
2824
+ },
2825
+ data() {
2826
+ return {
2827
+ selectedBeginDate: void 0,
2828
+ selectedEndDate: void 0,
2829
+ hoveredEndDate: void 0,
2830
+ multipleSelectedDates: this.multiple && this.modelValue ? this.modelValue : []
2831
+ };
2832
+ },
2833
+ computed: {
2834
+ hasEvents() {
2835
+ return this.events && this.events.length;
2836
+ },
2837
+ /*
2838
+ * Return array of all events in the specified month
2839
+ */
2840
+ eventsInThisYear() {
2841
+ if (!this.events) return [];
2842
+ const yearEvents = [];
2843
+ for (let i = 0; i < this.events.length; i++) {
2844
+ let event = this.events[i];
2845
+ if (!Object.prototype.hasOwnProperty.call(event, "date")) {
2846
+ event = { date: event, type: "is-primary" };
2847
+ }
2848
+ if (!Object.prototype.hasOwnProperty.call(event, "type")) {
2849
+ event.type = "is-primary";
2850
+ }
2851
+ if (event.date.getFullYear() === this.focused.year) {
2852
+ yearEvents.push(event);
2853
+ }
2854
+ }
2855
+ return yearEvents;
2856
+ },
2857
+ monthDates() {
2858
+ const year = this.focused.year;
2859
+ const months = [];
2860
+ for (let i = 0; i < 12; i++) {
2861
+ const d = new Date(year, i, 1);
2862
+ d.setHours(0, 0, 0, 0);
2863
+ months.push(d);
2864
+ }
2865
+ return months;
2866
+ },
2867
+ focusedMonth() {
2868
+ return this.focused.month;
2869
+ },
2870
+ hoveredDateRange() {
2871
+ var _a, _b;
2872
+ if (!this.range) {
2873
+ return [];
2874
+ }
2875
+ if (!isNaN((_b = (_a = this.selectedEndDate) == null ? void 0 : _a.valueOf()) != null ? _b : NaN)) {
2876
+ return [];
2877
+ }
2878
+ if (this.hoveredEndDate < this.selectedBeginDate) {
2879
+ return [this.hoveredEndDate, this.selectedBeginDate].filter(isDefined);
2880
+ }
2881
+ return [this.selectedBeginDate, this.hoveredEndDate].filter(isDefined);
2882
+ },
2883
+ disabledOrUndefined() {
2884
+ return this.disabled || void 0;
2885
+ }
2886
+ },
2887
+ watch: {
2888
+ focusedMonth(month) {
2889
+ const refName = `month-${month}`;
2890
+ this.$nextTick(() => {
2891
+ let cell;
2892
+ if (Array.isArray(this.$refs[refName])) {
2893
+ cell = this.$refs[refName][0];
2894
+ } else {
2895
+ cell = this.$refs[refName];
2896
+ }
2897
+ if (cell) {
2898
+ cell.focus();
2899
+ }
2900
+ });
2901
+ }
2902
+ },
2903
+ methods: {
2904
+ selectMultipleDates(date) {
2905
+ const multipleSelect = this.multipleSelectedDates.filter(
2906
+ (selectedDate) => selectedDate.getDate() === date.getDate() && selectedDate.getFullYear() === date.getFullYear() && selectedDate.getMonth() === date.getMonth()
2907
+ );
2908
+ if (multipleSelect.length) {
2909
+ this.multipleSelectedDates = this.multipleSelectedDates.filter(
2910
+ (selectedDate) => selectedDate.getDate() !== date.getDate() || selectedDate.getFullYear() !== date.getFullYear() || selectedDate.getMonth() !== date.getMonth()
2911
+ );
2912
+ } else {
2913
+ this.multipleSelectedDates.push(date);
2914
+ }
2915
+ this.$emit("update:modelValue", this.multipleSelectedDates);
2916
+ },
2917
+ selectableDate(day) {
2918
+ const validity = [];
2919
+ if (this.minDate) {
2920
+ validity.push(day >= this.minDate);
2921
+ }
2922
+ if (this.maxDate) {
2923
+ validity.push(day <= this.maxDate);
2924
+ }
2925
+ validity.push(day.getFullYear() === this.focused.year);
2926
+ if (this.selectableDates) {
2927
+ if (typeof this.selectableDates === "function") {
2928
+ if (this.selectableDates(day)) {
2929
+ return true;
2930
+ } else {
2931
+ validity.push(false);
2932
+ }
2933
+ } else {
2934
+ for (let i = 0; i < this.selectableDates.length; i++) {
2935
+ const enabledDate = this.selectableDates[i];
2936
+ if (day.getFullYear() === enabledDate.getFullYear() && day.getMonth() === enabledDate.getMonth()) {
2937
+ return true;
2938
+ } else {
2939
+ validity.push(false);
2940
+ }
2941
+ }
2942
+ }
2943
+ }
2944
+ if (this.unselectableDates) {
2945
+ if (typeof this.unselectableDates === "function") {
2946
+ validity.push(!this.unselectableDates(day));
2947
+ } else {
2948
+ for (let i = 0; i < this.unselectableDates.length; i++) {
2949
+ const disabledDate = this.unselectableDates[i];
2950
+ validity.push(
2951
+ day.getFullYear() !== disabledDate.getFullYear() || day.getMonth() !== disabledDate.getMonth()
2952
+ );
2953
+ }
2954
+ }
2955
+ }
2956
+ if (this.unselectableDaysOfWeek) {
2957
+ for (let i = 0; i < this.unselectableDaysOfWeek.length; i++) {
2958
+ const dayOfWeek = this.unselectableDaysOfWeek[i];
2959
+ validity.push(day.getDay() !== dayOfWeek);
2960
+ }
2961
+ }
2962
+ return validity.indexOf(false) < 0;
2963
+ },
2964
+ // TODO: return undefined instead of false if no events
2965
+ eventsDateMatch(day) {
2966
+ if (!this.eventsInThisYear.length) return false;
2967
+ const monthEvents = [];
2968
+ for (let i = 0; i < this.eventsInThisYear.length; i++) {
2969
+ if (this.eventsInThisYear[i].date.getMonth() === day.getMonth()) {
2970
+ monthEvents.push(this.events[i]);
2971
+ }
2972
+ }
2973
+ if (!monthEvents.length) {
2974
+ return false;
2975
+ }
2976
+ return monthEvents;
2977
+ },
2978
+ /*
2979
+ * Build classObject for cell using validations
2980
+ */
2981
+ classObject(day) {
2982
+ function dateMatch(dateOne, dateTwo, multiple) {
2983
+ if (!dateOne || !dateTwo || multiple) {
2984
+ return false;
2985
+ }
2986
+ if (Array.isArray(dateTwo)) {
2987
+ return dateTwo.some((date) => dateOne.getFullYear() === date.getFullYear() && dateOne.getMonth() === date.getMonth());
2988
+ }
2989
+ return dateOne.getFullYear() === dateTwo.getFullYear() && dateOne.getMonth() === dateTwo.getMonth();
2990
+ }
2991
+ function dateWithin(dateOne, dates, multiple) {
2992
+ if (!Array.isArray(dates) || multiple) {
2993
+ return false;
2994
+ }
2995
+ return dateOne > dates[0] && dateOne < dates[1];
2996
+ }
2997
+ function dateMultipleSelected(dateOne, dates, multiple) {
2998
+ if (!Array.isArray(dates) || !multiple) {
2999
+ return false;
3000
+ }
3001
+ return dates.some((date) => dateOne.getDate() === date.getDate() && dateOne.getFullYear() === date.getFullYear() && dateOne.getMonth() === date.getMonth());
3002
+ }
3003
+ return {
3004
+ "is-selected": dateMatch(day, this.modelValue, this.multiple) || dateWithin(day, this.modelValue, this.multiple) || dateMultipleSelected(day, this.multipleSelectedDates, this.multiple),
3005
+ "is-first-selected": dateMatch(
3006
+ day,
3007
+ Array.isArray(this.modelValue) ? this.modelValue[0] : void 0,
3008
+ this.multiple
3009
+ ),
3010
+ "is-within-selected": dateWithin(day, this.modelValue, this.multiple),
3011
+ "is-last-selected": dateMatch(
3012
+ day,
3013
+ Array.isArray(this.modelValue) ? this.modelValue[1] : void 0,
3014
+ this.multiple
3015
+ ),
3016
+ "is-within-hovered-range": this.hoveredDateRange && this.hoveredDateRange.length === 2 && (dateMatch(day, this.hoveredDateRange) || dateWithin(day, this.hoveredDateRange)),
3017
+ "is-first-hovered": dateMatch(
3018
+ day,
3019
+ Array.isArray(this.hoveredDateRange) ? this.hoveredDateRange[0] : void 0
3020
+ ),
3021
+ "is-within-hovered": dateWithin(day, this.hoveredDateRange),
3022
+ "is-last-hovered": dateMatch(
3023
+ day,
3024
+ Array.isArray(this.hoveredDateRange) ? this.hoveredDateRange[1] : void 0
3025
+ ),
3026
+ "is-today": dateMatch(day, this.dateCreator()),
3027
+ "is-selectable": this.selectableDate(day) && !this.disabled,
3028
+ "is-unselectable": !this.selectableDate(day) || this.disabled
3029
+ };
3030
+ },
3031
+ manageKeydown({ key }, date) {
3032
+ switch (key) {
3033
+ case " ":
3034
+ case "Space":
3035
+ case "Spacebar":
3036
+ case "Enter": {
3037
+ this.updateSelectedDate(date);
3038
+ break;
3039
+ }
3040
+ case "ArrowLeft":
3041
+ case "Left": {
3042
+ this.changeFocus(date, -1);
3043
+ break;
3044
+ }
3045
+ case "ArrowRight":
3046
+ case "Right": {
3047
+ this.changeFocus(date, 1);
3048
+ break;
3049
+ }
3050
+ case "ArrowUp":
3051
+ case "Up": {
3052
+ this.changeFocus(date, -3);
3053
+ break;
3054
+ }
3055
+ case "ArrowDown":
3056
+ case "Down": {
3057
+ this.changeFocus(date, 3);
3058
+ break;
3059
+ }
3060
+ }
3061
+ },
3062
+ /*
3063
+ * Emit input event with selected date as payload for v-model in parent
3064
+ */
3065
+ updateSelectedDate(date) {
3066
+ if (!this.range && !this.multiple) {
3067
+ this.emitChosenDate(date);
3068
+ } else if (this.range) {
3069
+ this.handleSelectRangeDate(date);
3070
+ } else if (this.multiple) {
3071
+ this.selectMultipleDates(date);
3072
+ }
3073
+ },
3074
+ /*
3075
+ * Emit select event with chosen date as payload
3076
+ */
3077
+ emitChosenDate(day) {
3078
+ if (this.disabled) return;
3079
+ if (!this.multiple) {
3080
+ if (this.selectableDate(day)) {
3081
+ this.$emit("update:modelValue", day);
3082
+ }
3083
+ } else {
3084
+ this.selectMultipleDates(day);
3085
+ }
3086
+ },
3087
+ /*
3088
+ * If both begin and end dates are set, reset the end date and set the begin date.
3089
+ * If only begin date is selected, emit an array of the begin date and the new date.
3090
+ * If not set, only set the begin date.
3091
+ */
3092
+ handleSelectRangeDate(date) {
3093
+ if (this.disabled) return;
3094
+ if (this.selectedBeginDate && this.selectedEndDate) {
3095
+ this.selectedBeginDate = date;
3096
+ this.selectedEndDate = void 0;
3097
+ this.$emit("range-start", date);
3098
+ } else if (this.selectedBeginDate && !this.selectedEndDate) {
3099
+ if (this.selectedBeginDate > date) {
3100
+ this.selectedEndDate = this.selectedBeginDate;
3101
+ this.selectedBeginDate = date;
3102
+ } else {
3103
+ this.selectedEndDate = date;
3104
+ }
3105
+ this.$emit("range-end", date);
3106
+ this.$emit("update:modelValue", [this.selectedBeginDate, this.selectedEndDate]);
3107
+ } else {
3108
+ this.selectedBeginDate = date;
3109
+ this.$emit("range-start", date);
3110
+ }
3111
+ },
3112
+ setRangeHoverEndDate(day) {
3113
+ if (this.range) {
3114
+ this.hoveredEndDate = day;
3115
+ }
3116
+ },
3117
+ changeFocus(month, inc) {
3118
+ const nextMonth = month;
3119
+ nextMonth.setMonth(month.getMonth() + inc);
3120
+ this.$emit("change-focus", nextMonth);
3121
+ }
3122
+ }
3123
+ });
3124
+
3125
+ const _hoisted_1$1 = { class: "datepicker-table" };
3126
+ const _hoisted_2$1 = { class: "datepicker-months" };
3127
+ const _hoisted_3$1 = ["disabled", "onClick", "onMouseenter", "onKeydown", "tabindex"];
3128
+ const _hoisted_4$1 = {
3129
+ key: 0,
3130
+ class: "events"
3131
+ };
3132
+ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
3133
+ return vue.openBlock(), vue.createElementBlock("section", _hoisted_1$1, [
3134
+ vue.createElementVNode(
3135
+ "div",
3136
+ {
3137
+ class: vue.normalizeClass(["datepicker-body", { "has-events": _ctx.hasEvents }])
3138
+ },
3139
+ [
3140
+ vue.createElementVNode("div", _hoisted_2$1, [
3141
+ (vue.openBlock(true), vue.createElementBlock(
3142
+ vue.Fragment,
3143
+ null,
3144
+ vue.renderList(_ctx.monthDates, (date, index) => {
3145
+ return vue.openBlock(), vue.createElementBlock(
3146
+ vue.Fragment,
3147
+ { key: index },
3148
+ [
3149
+ _ctx.selectableDate(date) && !_ctx.disabled ? (vue.openBlock(), vue.createElementBlock("a", {
3150
+ key: 0,
3151
+ ref_for: true,
3152
+ ref: `month-${date.getMonth()}`,
3153
+ class: vue.normalizeClass([[
3154
+ _ctx.classObject(date),
3155
+ { "has-event": _ctx.eventsDateMatch(date) },
3156
+ _ctx.indicators
3157
+ ], "datepicker-cell"]),
3158
+ role: "button",
3159
+ href: "#",
3160
+ disabled: _ctx.disabledOrUndefined,
3161
+ onClick: vue.withModifiers(($event) => _ctx.updateSelectedDate(date), ["prevent"]),
3162
+ onMouseenter: ($event) => _ctx.setRangeHoverEndDate(date),
3163
+ onKeydown: vue.withModifiers(($event) => _ctx.manageKeydown($event, date), ["prevent"]),
3164
+ tabindex: _ctx.focused.month === date.getMonth() ? void 0 : -1
3165
+ }, [
3166
+ vue.createTextVNode(
3167
+ vue.toDisplayString(_ctx.monthNames[date.getMonth()]) + " ",
3168
+ 1
3169
+ /* TEXT */
3170
+ ),
3171
+ _ctx.eventsDateMatch(date) ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
3172
+ (vue.openBlock(true), vue.createElementBlock(
3173
+ vue.Fragment,
3174
+ null,
3175
+ vue.renderList(_ctx.eventsDateMatch(date), (event, evIdx) => {
3176
+ return vue.openBlock(), vue.createElementBlock(
3177
+ "div",
3178
+ {
3179
+ class: vue.normalizeClass(["event", event.type]),
3180
+ key: evIdx
3181
+ },
3182
+ null,
3183
+ 2
3184
+ /* CLASS */
3185
+ );
3186
+ }),
3187
+ 128
3188
+ /* KEYED_FRAGMENT */
3189
+ ))
3190
+ ])) : vue.createCommentVNode("v-if", true)
3191
+ ], 42, _hoisted_3$1)) : (vue.openBlock(), vue.createElementBlock(
3192
+ "div",
3193
+ {
3194
+ key: 1,
3195
+ class: vue.normalizeClass([_ctx.classObject(date), "datepicker-cell"])
3196
+ },
3197
+ vue.toDisplayString(_ctx.monthNames[date.getMonth()]),
3198
+ 3
3199
+ /* TEXT, CLASS */
3200
+ ))
3201
+ ],
3202
+ 64
3203
+ /* STABLE_FRAGMENT */
3204
+ );
3205
+ }),
3206
+ 128
3207
+ /* KEYED_FRAGMENT */
3208
+ ))
3209
+ ])
3210
+ ],
3211
+ 2
3212
+ /* CLASS */
3213
+ )
3214
+ ]);
3215
+ }
3216
+ var BDatepickerMonth = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render$1]]);
3217
+
3218
+ const defaultDateFormatter = (date, vm) => {
3219
+ const targetDates = Array.isArray(date) ? date : [date];
3220
+ const dates = targetDates.map((date2) => {
3221
+ const d = new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), 12);
3222
+ return !vm.isTypeMonth ? vm.dtf.format(d) : vm.dtfMonth.format(d);
3223
+ });
3224
+ return !vm.multiple ? dates.join(" - ") : dates.join(", ");
3225
+ };
3226
+ const defaultDateParser = (date, vm) => {
3227
+ if (vm.dtf.formatToParts && typeof vm.dtf.formatToParts === "function") {
3228
+ const formatRegex = (vm.isTypeMonth ? vm.dtfMonth : vm.dtf).formatToParts(new Date(2e3, 11, 25)).map((part) => {
3229
+ if (part.type === "literal") {
3230
+ return part.value;
3231
+ }
3232
+ return `((?!=<${part.type}>)\\d+)`;
3233
+ }).join("");
3234
+ const dateGroups = matchWithGroups(formatRegex, date);
3235
+ if (dateGroups.year && dateGroups.year.length === 4 && dateGroups.month && +dateGroups.month <= 12) {
3236
+ if (vm.isTypeMonth) return new Date(+dateGroups.year, +dateGroups.month - 1);
3237
+ else if (dateGroups.day && +dateGroups.day <= 31) {
3238
+ return new Date(+dateGroups.year, +dateGroups.month - 1, +dateGroups.day, 12);
3239
+ }
3240
+ }
3241
+ }
3242
+ if (!vm.isTypeMonth) return new Date(Date.parse(date));
3243
+ if (date) {
3244
+ const s = date.split("/");
3245
+ const year = s[0].length === 4 ? s[0] : s[1];
3246
+ const month = s[0].length === 2 ? s[0] : s[1];
3247
+ if (year && month) {
3248
+ return new Date(parseInt(year, 10), parseInt(month, 10) - 1, 1, 0, 0, 0, 0);
3249
+ }
3250
+ }
3251
+ return null;
3252
+ };
3253
+ var _sfc_main = vue.defineComponent({
3254
+ name: "BDatepicker",
3255
+ components: {
3256
+ BDatepickerTable,
3257
+ BDatepickerMonth,
3258
+ BInput,
3259
+ BField,
3260
+ BSelect,
3261
+ BIcon,
3262
+ BDropdown,
3263
+ BDropdownItem
3264
+ },
3265
+ mixins: [CompatFallthroughMixin, FormElementMixin],
3266
+ provide() {
3267
+ return {
3268
+ $datepicker: this
3269
+ };
3270
+ },
3271
+ props: {
3272
+ modelValue: {
3273
+ type: [Date, Array, null]
3274
+ },
3275
+ dayNames: {
3276
+ type: [Array, null],
3277
+ default: () => {
3278
+ if (!Array.isArray(config.defaultDayNames)) {
3279
+ return void 0;
3280
+ }
3281
+ return config.defaultDayNames;
3282
+ }
3283
+ },
3284
+ monthNames: {
3285
+ type: [Array, null],
3286
+ default: () => {
3287
+ if (!Array.isArray(config.defaultMonthNames)) {
3288
+ return void 0;
3289
+ }
3290
+ return config.defaultMonthNames;
3291
+ }
3292
+ },
3293
+ firstDayOfWeek: {
3294
+ type: Number,
3295
+ default: () => {
3296
+ {
3297
+ return 0;
3298
+ }
3299
+ }
3300
+ },
3301
+ inline: Boolean,
3302
+ minDate: [Date, null],
3303
+ maxDate: [Date, null],
3304
+ focusedDate: Date,
3305
+ placeholder: String,
3306
+ editable: Boolean,
3307
+ disabled: Boolean,
3308
+ horizontalTimePicker: Boolean,
3309
+ unselectableDates: [Array, Function],
3310
+ unselectableDaysOfWeek: {
3311
+ type: [Array, null],
3312
+ default: () => config.defaultUnselectableDaysOfWeek
3313
+ },
3314
+ selectableDates: [Array, Function],
3315
+ dateFormatter: {
3316
+ type: Function,
3317
+ default: (date, vm) => {
3318
+ {
3319
+ return defaultDateFormatter(date, vm);
3320
+ }
3321
+ }
3322
+ },
3323
+ dateParser: {
3324
+ type: Function,
3325
+ default: (date, vm) => {
3326
+ {
3327
+ return defaultDateParser(date, vm);
3328
+ }
3329
+ }
3330
+ },
3331
+ dateCreator: {
3332
+ type: Function,
3333
+ default: () => {
3334
+ {
3335
+ return /* @__PURE__ */ new Date();
3336
+ }
3337
+ }
3338
+ },
3339
+ mobileNative: {
3340
+ type: Boolean,
3341
+ default: () => config.defaultDatepickerMobileNative
3342
+ },
3343
+ position: String,
3344
+ iconRight: String,
3345
+ iconRightClickable: Boolean,
3346
+ events: Array,
3347
+ indicators: {
3348
+ type: String,
3349
+ default: "dots"
3350
+ },
3351
+ openOnFocus: Boolean,
3352
+ iconPrev: {
3353
+ type: String,
3354
+ default: () => config.defaultIconPrev
3355
+ },
3356
+ iconNext: {
3357
+ type: String,
3358
+ default: () => config.defaultIconNext
3359
+ },
3360
+ yearsRange: {
3361
+ type: Array,
3362
+ default: () => config.defaultDatepickerYearsRange
3363
+ },
3364
+ type: {
3365
+ type: String,
3366
+ validator: (value) => {
3367
+ return [
3368
+ "month"
3369
+ ].indexOf(value) >= 0;
3370
+ }
3371
+ },
3372
+ nearbyMonthDays: {
3373
+ type: Boolean,
3374
+ default: () => config.defaultDatepickerNearbyMonthDays
3375
+ },
3376
+ nearbySelectableMonthDays: {
3377
+ type: Boolean,
3378
+ default: () => config.defaultDatepickerNearbySelectableMonthDays
3379
+ },
3380
+ showWeekNumber: {
3381
+ type: Boolean,
3382
+ default: () => config.defaultDatepickerShowWeekNumber
3383
+ },
3384
+ weekNumberClickable: {
3385
+ type: Boolean,
3386
+ default: () => config.defaultDatepickerWeekNumberClickable
3387
+ },
3388
+ rulesForFirstWeek: {
3389
+ type: Number,
3390
+ default: () => 4
3391
+ },
3392
+ range: {
3393
+ type: Boolean,
3394
+ default: false
3395
+ },
3396
+ closeOnClick: {
3397
+ type: Boolean,
3398
+ default: true
3399
+ },
3400
+ multiple: {
3401
+ type: Boolean,
3402
+ default: false
3403
+ },
3404
+ mobileModal: {
3405
+ type: Boolean,
3406
+ default: () => config.defaultDatepickerMobileModal
3407
+ },
3408
+ focusable: {
3409
+ type: Boolean,
3410
+ default: true
3411
+ },
3412
+ trapFocus: {
3413
+ type: Boolean,
3414
+ default: () => config.defaultTrapFocus
3415
+ },
3416
+ appendToBody: Boolean,
3417
+ ariaNextLabel: String,
3418
+ ariaPreviousLabel: String
3419
+ },
3420
+ emits: {
3421
+ /* eslint-disable @typescript-eslint/no-unused-vars */
3422
+ "active-change": (_active) => true,
3423
+ "change-month": (_month) => true,
3424
+ "change-year": (_year) => true,
3425
+ "icon-right-click": (_event) => true,
3426
+ "range-end": (_date) => true,
3427
+ "range-start": (_date) => true,
3428
+ "update:modelValue": (_value) => true,
3429
+ "week-number-click": (_week, _year) => true
3430
+ // emitted by `DatepickerTableRow`
3431
+ /* eslint-enable @typescript-eslint/no-unused-vars */
3432
+ },
3433
+ data() {
3434
+ const focusedDate = (Array.isArray(this.modelValue) ? this.modelValue[0] : this.modelValue) || this.focusedDate || this.dateCreator();
3435
+ if (!this.modelValue && this.maxDate && this.maxDate.getFullYear() < focusedDate.getFullYear()) {
3436
+ focusedDate.setFullYear(this.maxDate.getFullYear());
3437
+ }
3438
+ return {
3439
+ dateSelected: this.modelValue,
3440
+ focusedDateData: {
3441
+ day: focusedDate.getDate(),
3442
+ month: focusedDate.getMonth(),
3443
+ year: focusedDate.getFullYear()
3444
+ },
3445
+ _elementRef: "input",
3446
+ _isDatepicker: true
3447
+ };
3448
+ },
3449
+ computed: {
3450
+ computedValue: {
3451
+ get() {
3452
+ return this.dateSelected;
3453
+ },
3454
+ set(value) {
3455
+ this.updateInternalState(value);
3456
+ if (!this.multiple) this.togglePicker(false);
3457
+ this.$emit("update:modelValue", value);
3458
+ if (this.useHtml5Validation) {
3459
+ this.$nextTick(() => {
3460
+ this.checkHtml5Validity();
3461
+ });
3462
+ }
3463
+ }
3464
+ },
3465
+ formattedValue() {
3466
+ return this.formatValue(this.computedValue);
3467
+ },
3468
+ localeOptions() {
3469
+ return new Intl.DateTimeFormat(this.locale, {
3470
+ year: "numeric",
3471
+ month: "numeric"
3472
+ }).resolvedOptions();
3473
+ },
3474
+ dtf() {
3475
+ return new Intl.DateTimeFormat(this.locale);
3476
+ },
3477
+ dtfMonth() {
3478
+ return new Intl.DateTimeFormat(this.locale, {
3479
+ year: this.localeOptions.year || "numeric",
3480
+ month: this.localeOptions.month || "2-digit"
3481
+ });
3482
+ },
3483
+ newMonthNames() {
3484
+ if (Array.isArray(this.monthNames)) {
3485
+ return this.monthNames;
3486
+ }
3487
+ return getMonthNames(this.locale);
3488
+ },
3489
+ newDayNames() {
3490
+ if (Array.isArray(this.dayNames)) {
3491
+ return this.dayNames;
3492
+ }
3493
+ return getWeekdayNames(this.locale);
3494
+ },
3495
+ listOfMonths() {
3496
+ let minMonth = 0;
3497
+ let maxMonth = 12;
3498
+ if (this.minDate && this.focusedDateData.year === this.minDate.getFullYear()) {
3499
+ minMonth = this.minDate.getMonth();
3500
+ }
3501
+ if (this.maxDate && this.focusedDateData.year === this.maxDate.getFullYear()) {
3502
+ maxMonth = this.maxDate.getMonth();
3503
+ }
3504
+ return this.newMonthNames.map((name, index) => {
3505
+ return {
3506
+ name,
3507
+ index,
3508
+ disabled: index < minMonth || index > maxMonth
3509
+ };
3510
+ });
3511
+ },
3512
+ /*
3513
+ * Returns an array of years for the year dropdown. If earliest/latest
3514
+ * dates are set by props, range of years will fall within those dates.
3515
+ */
3516
+ listOfYears() {
3517
+ let latestYear = this.focusedDateData.year + this.yearsRange[1];
3518
+ if (this.maxDate && this.maxDate.getFullYear() < latestYear) {
3519
+ latestYear = Math.max(this.maxDate.getFullYear(), this.focusedDateData.year);
3520
+ }
3521
+ let earliestYear = this.focusedDateData.year + this.yearsRange[0];
3522
+ if (this.minDate && this.minDate.getFullYear() > earliestYear) {
3523
+ earliestYear = Math.min(this.minDate.getFullYear(), this.focusedDateData.year);
3524
+ }
3525
+ const arrayOfYears = [];
3526
+ for (let i = earliestYear; i <= latestYear; i++) {
3527
+ arrayOfYears.push(i);
3528
+ }
3529
+ return arrayOfYears.reverse();
3530
+ },
3531
+ showPrev() {
3532
+ if (!this.minDate) return false;
3533
+ if (this.isTypeMonth) {
3534
+ return this.focusedDateData.year <= this.minDate.getFullYear();
3535
+ }
3536
+ const dateToCheck = new Date(this.focusedDateData.year, this.focusedDateData.month);
3537
+ const date = new Date(this.minDate.getFullYear(), this.minDate.getMonth());
3538
+ return dateToCheck <= date;
3539
+ },
3540
+ showNext() {
3541
+ if (!this.maxDate) return false;
3542
+ if (this.isTypeMonth) {
3543
+ return this.focusedDateData.year >= this.maxDate.getFullYear();
3544
+ }
3545
+ const dateToCheck = new Date(this.focusedDateData.year, this.focusedDateData.month);
3546
+ const date = new Date(this.maxDate.getFullYear(), this.maxDate.getMonth());
3547
+ return dateToCheck >= date;
3548
+ },
3549
+ isMobile() {
3550
+ return this.mobileNative && isMobile.any();
3551
+ },
3552
+ isTypeMonth() {
3553
+ return this.type === "month";
3554
+ },
3555
+ ariaRole() {
3556
+ if (!this.inline) {
3557
+ return "dialog";
3558
+ } else {
3559
+ return void 0;
3560
+ }
3561
+ },
3562
+ disabledOrUndefined() {
3563
+ return this.disabled || void 0;
3564
+ }
3565
+ },
3566
+ watch: {
3567
+ /*
3568
+ * When v-model is changed:
3569
+ * 1. Update internal value.
3570
+ * 2. If it's invalid, validate again.
3571
+ */
3572
+ modelValue(value) {
3573
+ this.updateInternalState(value);
3574
+ if (!this.multiple) this.togglePicker(false);
3575
+ },
3576
+ focusedDate(value) {
3577
+ if (value) {
3578
+ this.focusedDateData = {
3579
+ day: value.getDate(),
3580
+ month: value.getMonth(),
3581
+ year: value.getFullYear()
3582
+ };
3583
+ }
3584
+ },
3585
+ /*
3586
+ * Emit input event on month and/or year change
3587
+ */
3588
+ "focusedDateData.month"(value) {
3589
+ this.$emit("change-month", value);
3590
+ },
3591
+ "focusedDateData.year"(value) {
3592
+ this.$emit("change-year", value);
3593
+ }
3594
+ },
3595
+ methods: {
3596
+ /*
3597
+ * Parse string into date
3598
+ */
3599
+ onChange(value) {
3600
+ const date = this.dateParser(value, this);
3601
+ if (date && (!isNaN(date.valueOf()) || Array.isArray(date) && date.length === 2 && !isNaN(date[0]) && !isNaN(date[1]))) {
3602
+ this.computedValue = date;
3603
+ } else {
3604
+ this.computedValue = null;
3605
+ if (this.$refs.input) {
3606
+ this.$refs.input.newValue = this.computedValue;
3607
+ }
3608
+ }
3609
+ },
3610
+ /*
3611
+ * Format date into string
3612
+ */
3613
+ formatValue(value) {
3614
+ if (Array.isArray(value)) {
3615
+ const isArrayWithValidDates = Array.isArray(value) && value.every((v) => {
3616
+ var _a;
3617
+ return !isNaN((_a = v == null ? void 0 : v.valueOf()) != null ? _a : NaN);
3618
+ });
3619
+ return isArrayWithValidDates ? this.dateFormatter([...value], this) : null;
3620
+ }
3621
+ return value && !isNaN(value.valueOf()) ? this.dateFormatter(value, this) : null;
3622
+ },
3623
+ /*
3624
+ * Either decrement month by 1 if not January or decrement year by 1
3625
+ * and set month to 11 (December) or decrement year when 'month'
3626
+ */
3627
+ prev() {
3628
+ if (this.disabled) return;
3629
+ if (this.isTypeMonth) {
3630
+ this.focusedDateData.year -= 1;
3631
+ } else {
3632
+ if (this.focusedDateData.month > 0) {
3633
+ this.focusedDateData.month -= 1;
3634
+ } else {
3635
+ this.focusedDateData.month = 11;
3636
+ this.focusedDateData.year -= 1;
3637
+ }
3638
+ }
3639
+ },
3640
+ /*
3641
+ * Either increment month by 1 if not December or increment year by 1
3642
+ * and set month to 0 (January) or increment year when 'month'
3643
+ */
3644
+ next() {
3645
+ if (this.disabled) return;
3646
+ if (this.isTypeMonth) {
3647
+ this.focusedDateData.year += 1;
3648
+ } else {
3649
+ if (this.focusedDateData.month < 11) {
3650
+ this.focusedDateData.month += 1;
3651
+ } else {
3652
+ this.focusedDateData.month = 0;
3653
+ this.focusedDateData.year += 1;
3654
+ }
3655
+ }
3656
+ },
3657
+ formatNative(value) {
3658
+ return this.isTypeMonth ? this.formatYYYYMM(value) : this.formatYYYYMMDD(value);
3659
+ },
3660
+ /*
3661
+ * Format date into string 'YYYY-MM-DD'
3662
+ */
3663
+ formatYYYYMMDD(value) {
3664
+ const date = new Date(value);
3665
+ if (value && !isNaN(date.valueOf())) {
3666
+ const year = date.getFullYear();
3667
+ const month = date.getMonth() + 1;
3668
+ const day = date.getDate();
3669
+ return year + "-" + ((month < 10 ? "0" : "") + month) + "-" + ((day < 10 ? "0" : "") + day);
3670
+ }
3671
+ return "";
3672
+ },
3673
+ /*
3674
+ * Format date into string 'YYYY-MM'
3675
+ */
3676
+ formatYYYYMM(value) {
3677
+ const date = new Date(value);
3678
+ if (value && !isNaN(date.valueOf())) {
3679
+ const year = date.getFullYear();
3680
+ const month = date.getMonth() + 1;
3681
+ return year + "-" + ((month < 10 ? "0" : "") + month);
3682
+ }
3683
+ return "";
3684
+ },
3685
+ /*
3686
+ * Parse date from string
3687
+ */
3688
+ onChangeNativePicker(event) {
3689
+ const date = event.target.value;
3690
+ const s = date ? date.split("-") : [];
3691
+ if (s.length === 3) {
3692
+ const year = parseInt(s[0], 10);
3693
+ const month = parseInt(s[1]) - 1;
3694
+ const day = parseInt(s[2]);
3695
+ this.computedValue = new Date(year, month, day);
3696
+ } else {
3697
+ this.computedValue = null;
3698
+ }
3699
+ },
3700
+ updateInternalState(value) {
3701
+ if (this.dateSelected === value) return;
3702
+ const isArray = Array.isArray(value);
3703
+ const currentDate = isArray ? !value.length ? this.dateCreator() : value[value.length - 1] : !value ? this.dateCreator() : value;
3704
+ if (!isArray || this.dateSelected && value.length > this.dateSelected.length) {
3705
+ this.focusedDateData = {
3706
+ day: currentDate.getDate(),
3707
+ month: currentDate.getMonth(),
3708
+ year: currentDate.getFullYear()
3709
+ };
3710
+ }
3711
+ this.dateSelected = value;
3712
+ },
3713
+ /*
3714
+ * Toggle datepicker
3715
+ */
3716
+ togglePicker(active) {
3717
+ if (this.$refs.dropdown) {
3718
+ const isActive = typeof active === "boolean" ? active : !this.$refs.dropdown.isActive;
3719
+ if (isActive) {
3720
+ this.$refs.dropdown.isActive = isActive;
3721
+ } else if (this.closeOnClick) {
3722
+ this.$refs.dropdown.isActive = isActive;
3723
+ }
3724
+ }
3725
+ },
3726
+ /*
3727
+ * Call default onFocus method and show datepicker
3728
+ */
3729
+ handleOnFocus(event) {
3730
+ this.onFocus(event);
3731
+ if (this.openOnFocus) {
3732
+ this.togglePicker(true);
3733
+ }
3734
+ },
3735
+ /*
3736
+ * Toggle dropdown
3737
+ */
3738
+ toggle() {
3739
+ if (this.mobileNative && this.isMobile) {
3740
+ const input = this.$refs.input.$refs.input;
3741
+ input.focus();
3742
+ input.click();
3743
+ return;
3744
+ }
3745
+ this.$refs.dropdown.toggle();
3746
+ },
3747
+ /*
3748
+ * Avoid dropdown toggle when is already visible
3749
+ */
3750
+ onInputClick(event) {
3751
+ if (this.$refs.dropdown.isActive) {
3752
+ event.stopPropagation();
3753
+ }
3754
+ },
3755
+ /*
3756
+ * Keypress event that is bound to the document.
3757
+ */
3758
+ keyPress({ key }) {
3759
+ if (this.$refs.dropdown && this.$refs.dropdown.isActive && (key === "Escape" || key === "Esc")) {
3760
+ this.togglePicker(false);
3761
+ }
3762
+ },
3763
+ /*
3764
+ * Emit 'blur' event on dropdown is not active (closed)
3765
+ */
3766
+ onActiveChange(value) {
3767
+ if (!value) {
3768
+ this.onBlur();
3769
+ }
3770
+ this.$emit("active-change", value);
3771
+ },
3772
+ changeFocus(day) {
3773
+ this.focusedDateData = {
3774
+ day: day.getDate(),
3775
+ month: day.getMonth(),
3776
+ year: day.getFullYear()
3777
+ };
3778
+ }
3779
+ },
3780
+ created() {
3781
+ if (typeof window !== "undefined") {
3782
+ document.addEventListener("keyup", this.keyPress);
3783
+ }
3784
+ },
3785
+ beforeUnmount() {
3786
+ if (typeof window !== "undefined") {
3787
+ document.removeEventListener("keyup", this.keyPress);
3788
+ }
3789
+ }
3790
+ });
3791
+
3792
+ const _hoisted_1 = { class: "datepicker-header" };
3793
+ const _hoisted_2 = ["disabled", "aria-label"];
3794
+ const _hoisted_3 = ["disabled", "aria-label"];
3795
+ const _hoisted_4 = { class: "pagination-list" };
3796
+ const _hoisted_5 = ["value", "disabled"];
3797
+ const _hoisted_6 = ["value"];
3798
+ const _hoisted_7 = { key: 1 };
3799
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
3800
+ const _component_b_input = vue.resolveComponent("b-input");
3801
+ const _component_b_icon = vue.resolveComponent("b-icon");
3802
+ const _component_b_select = vue.resolveComponent("b-select");
3803
+ const _component_b_field = vue.resolveComponent("b-field");
3804
+ const _component_b_datepicker_table = vue.resolveComponent("b-datepicker-table");
3805
+ const _component_b_datepicker_month = vue.resolveComponent("b-datepicker-month");
3806
+ const _component_b_dropdown_item = vue.resolveComponent("b-dropdown-item");
3807
+ const _component_b_dropdown = vue.resolveComponent("b-dropdown");
3808
+ return vue.openBlock(), vue.createElementBlock(
3809
+ "div",
3810
+ vue.mergeProps({
3811
+ class: ["datepicker control", [_ctx.size, { "is-expanded": _ctx.expanded }]]
3812
+ }, _ctx.rootAttrs),
3813
+ [
3814
+ !_ctx.isMobile || _ctx.inline ? (vue.openBlock(), vue.createBlock(_component_b_dropdown, {
3815
+ key: 0,
3816
+ ref: "dropdown",
3817
+ position: _ctx.position,
3818
+ disabled: _ctx.disabledOrUndefined,
3819
+ inline: _ctx.inline,
3820
+ "mobile-modal": _ctx.mobileModal,
3821
+ "trap-focus": _ctx.trapFocus,
3822
+ "aria-role": _ctx.ariaRole,
3823
+ "append-to-body": _ctx.appendToBody,
3824
+ "append-to-body-copy-parent": "",
3825
+ onActiveChange: _ctx.onActiveChange,
3826
+ "trigger-tabindex": -1
3827
+ }, vue.createSlots({
3828
+ default: vue.withCtx(() => [
3829
+ vue.createVNode(_component_b_dropdown_item, {
3830
+ disabled: _ctx.disabledOrUndefined,
3831
+ focusable: _ctx.focusable,
3832
+ custom: "",
3833
+ class: vue.normalizeClass({ "dropdown-horizontal-timepicker": _ctx.horizontalTimePicker })
3834
+ }, {
3835
+ default: vue.withCtx(() => [
3836
+ vue.createElementVNode("div", null, [
3837
+ vue.createElementVNode("header", _hoisted_1, [
3838
+ _ctx.$slots.header !== void 0 && _ctx.$slots.header([]).length ? vue.renderSlot(_ctx.$slots, "header", { key: 0 }) : (vue.openBlock(), vue.createElementBlock(
3839
+ "div",
3840
+ {
3841
+ key: 1,
3842
+ class: vue.normalizeClass(["pagination field is-centered", _ctx.size])
3843
+ },
3844
+ [
3845
+ vue.withDirectives(vue.createElementVNode("a", {
3846
+ class: "pagination-previous",
3847
+ role: "button",
3848
+ href: "#",
3849
+ disabled: _ctx.disabledOrUndefined,
3850
+ "aria-label": _ctx.ariaPreviousLabel,
3851
+ onClick: _cache[3] || (_cache[3] = vue.withModifiers((...args) => _ctx.prev && _ctx.prev(...args), ["prevent"])),
3852
+ onKeydown: [
3853
+ _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers((...args) => _ctx.prev && _ctx.prev(...args), ["prevent"]), ["enter"])),
3854
+ _cache[5] || (_cache[5] = vue.withKeys(vue.withModifiers((...args) => _ctx.prev && _ctx.prev(...args), ["prevent"]), ["space"]))
3855
+ ]
3856
+ }, [
3857
+ vue.createVNode(_component_b_icon, {
3858
+ icon: _ctx.iconPrev,
3859
+ pack: _ctx.iconPack,
3860
+ both: "",
3861
+ type: "is-primary is-clickable"
3862
+ }, null, 8, ["icon", "pack"])
3863
+ ], 40, _hoisted_2), [
3864
+ [vue.vShow, !_ctx.showPrev && !_ctx.disabled]
3865
+ ]),
3866
+ vue.withDirectives(vue.createElementVNode("a", {
3867
+ class: "pagination-next",
3868
+ role: "button",
3869
+ href: "#",
3870
+ disabled: _ctx.disabledOrUndefined,
3871
+ "aria-label": _ctx.ariaNextLabel,
3872
+ onClick: _cache[6] || (_cache[6] = vue.withModifiers((...args) => _ctx.next && _ctx.next(...args), ["prevent"])),
3873
+ onKeydown: [
3874
+ _cache[7] || (_cache[7] = vue.withKeys(vue.withModifiers((...args) => _ctx.next && _ctx.next(...args), ["prevent"]), ["enter"])),
3875
+ _cache[8] || (_cache[8] = vue.withKeys(vue.withModifiers((...args) => _ctx.next && _ctx.next(...args), ["prevent"]), ["space"]))
3876
+ ]
3877
+ }, [
3878
+ vue.createVNode(_component_b_icon, {
3879
+ icon: _ctx.iconNext,
3880
+ pack: _ctx.iconPack,
3881
+ both: "",
3882
+ type: "is-primary is-clickable"
3883
+ }, null, 8, ["icon", "pack"])
3884
+ ], 40, _hoisted_3), [
3885
+ [vue.vShow, !_ctx.showNext && !_ctx.disabled]
3886
+ ]),
3887
+ vue.createElementVNode("div", _hoisted_4, [
3888
+ vue.createVNode(_component_b_field, null, {
3889
+ default: vue.withCtx(() => [
3890
+ !_ctx.isTypeMonth ? (vue.openBlock(), vue.createBlock(_component_b_select, {
3891
+ key: 0,
3892
+ modelValue: _ctx.focusedDateData.month,
3893
+ "onUpdate:modelValue": _cache[9] || (_cache[9] = ($event) => _ctx.focusedDateData.month = $event),
3894
+ disabled: _ctx.disabledOrUndefined,
3895
+ size: _ctx.size
3896
+ }, {
3897
+ default: vue.withCtx(() => [
3898
+ (vue.openBlock(true), vue.createElementBlock(
3899
+ vue.Fragment,
3900
+ null,
3901
+ vue.renderList(_ctx.listOfMonths, (month) => {
3902
+ return vue.openBlock(), vue.createElementBlock("option", {
3903
+ value: month.index,
3904
+ key: month.name,
3905
+ disabled: month.disabled || void 0
3906
+ }, vue.toDisplayString(month.name), 9, _hoisted_5);
3907
+ }),
3908
+ 128
3909
+ /* KEYED_FRAGMENT */
3910
+ ))
3911
+ ]),
3912
+ _: 1
3913
+ /* STABLE */
3914
+ }, 8, ["modelValue", "disabled", "size"])) : vue.createCommentVNode("v-if", true),
3915
+ vue.createVNode(_component_b_select, {
3916
+ modelValue: _ctx.focusedDateData.year,
3917
+ "onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.focusedDateData.year = $event),
3918
+ disabled: _ctx.disabledOrUndefined,
3919
+ size: _ctx.size
3920
+ }, {
3921
+ default: vue.withCtx(() => [
3922
+ (vue.openBlock(true), vue.createElementBlock(
3923
+ vue.Fragment,
3924
+ null,
3925
+ vue.renderList(_ctx.listOfYears, (year) => {
3926
+ return vue.openBlock(), vue.createElementBlock("option", {
3927
+ value: year,
3928
+ key: year
3929
+ }, vue.toDisplayString(year), 9, _hoisted_6);
3930
+ }),
3931
+ 128
3932
+ /* KEYED_FRAGMENT */
3933
+ ))
3934
+ ]),
3935
+ _: 1
3936
+ /* STABLE */
3937
+ }, 8, ["modelValue", "disabled", "size"])
3938
+ ]),
3939
+ _: 1
3940
+ /* STABLE */
3941
+ })
3942
+ ])
3943
+ ],
3944
+ 2
3945
+ /* CLASS */
3946
+ ))
3947
+ ]),
3948
+ !_ctx.isTypeMonth ? (vue.openBlock(), vue.createElementBlock(
3949
+ "div",
3950
+ {
3951
+ key: 0,
3952
+ class: vue.normalizeClass(["datepicker-content", { "content-horizontal-timepicker": _ctx.horizontalTimePicker }])
3953
+ },
3954
+ [
3955
+ vue.createVNode(_component_b_datepicker_table, {
3956
+ modelValue: _ctx.computedValue,
3957
+ "onUpdate:modelValue": _cache[11] || (_cache[11] = ($event) => _ctx.computedValue = $event),
3958
+ "day-names": _ctx.newDayNames,
3959
+ "month-names": _ctx.newMonthNames,
3960
+ "first-day-of-week": _ctx.firstDayOfWeek,
3961
+ "rules-for-first-week": _ctx.rulesForFirstWeek,
3962
+ "min-date": _ctx.minDate,
3963
+ "max-date": _ctx.maxDate,
3964
+ focused: _ctx.focusedDateData,
3965
+ disabled: _ctx.disabledOrUndefined,
3966
+ "unselectable-dates": _ctx.unselectableDates,
3967
+ "unselectable-days-of-week": _ctx.unselectableDaysOfWeek,
3968
+ "selectable-dates": _ctx.selectableDates,
3969
+ events: _ctx.events,
3970
+ indicators: _ctx.indicators,
3971
+ "date-creator": _ctx.dateCreator,
3972
+ "type-month": _ctx.isTypeMonth,
3973
+ "nearby-month-days": _ctx.nearbyMonthDays,
3974
+ "nearby-selectable-month-days": _ctx.nearbySelectableMonthDays,
3975
+ "show-week-number": _ctx.showWeekNumber,
3976
+ "week-number-clickable": _ctx.weekNumberClickable,
3977
+ range: _ctx.range,
3978
+ multiple: _ctx.multiple,
3979
+ onRangeStart: _cache[12] || (_cache[12] = (date) => _ctx.$emit("range-start", date)),
3980
+ onRangeEnd: _cache[13] || (_cache[13] = (date) => _ctx.$emit("range-end", date)),
3981
+ onClose: _cache[14] || (_cache[14] = ($event) => _ctx.togglePicker(false)),
3982
+ "onUpdate:focused": _cache[15] || (_cache[15] = ($event) => _ctx.focusedDateData = $event)
3983
+ }, null, 8, ["modelValue", "day-names", "month-names", "first-day-of-week", "rules-for-first-week", "min-date", "max-date", "focused", "disabled", "unselectable-dates", "unselectable-days-of-week", "selectable-dates", "events", "indicators", "date-creator", "type-month", "nearby-month-days", "nearby-selectable-month-days", "show-week-number", "week-number-clickable", "range", "multiple"])
3984
+ ],
3985
+ 2
3986
+ /* CLASS */
3987
+ )) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
3988
+ vue.createVNode(_component_b_datepicker_month, {
3989
+ modelValue: _ctx.computedValue,
3990
+ "onUpdate:modelValue": _cache[16] || (_cache[16] = ($event) => _ctx.computedValue = $event),
3991
+ "month-names": _ctx.newMonthNames,
3992
+ "min-date": _ctx.minDate,
3993
+ "max-date": _ctx.maxDate,
3994
+ focused: _ctx.focusedDateData,
3995
+ disabled: _ctx.disabledOrUndefined,
3996
+ "unselectable-dates": _ctx.unselectableDates,
3997
+ "unselectable-days-of-week": _ctx.unselectableDaysOfWeek,
3998
+ "selectable-dates": _ctx.selectableDates,
3999
+ events: _ctx.events,
4000
+ indicators: _ctx.indicators,
4001
+ "date-creator": _ctx.dateCreator,
4002
+ range: _ctx.range,
4003
+ multiple: _ctx.multiple,
4004
+ onRangeStart: _cache[17] || (_cache[17] = (date) => _ctx.$emit("range-start", date)),
4005
+ onRangeEnd: _cache[18] || (_cache[18] = (date) => _ctx.$emit("range-end", date)),
4006
+ onClose: _cache[19] || (_cache[19] = ($event) => _ctx.togglePicker(false)),
4007
+ onChangeFocus: _ctx.changeFocus,
4008
+ "onUpdate:focused": _cache[20] || (_cache[20] = ($event) => _ctx.focusedDateData = $event)
4009
+ }, null, 8, ["modelValue", "month-names", "min-date", "max-date", "focused", "disabled", "unselectable-dates", "unselectable-days-of-week", "selectable-dates", "events", "indicators", "date-creator", "range", "multiple", "onChangeFocus"])
4010
+ ]))
4011
+ ]),
4012
+ _ctx.$slots.default !== void 0 && _ctx.$slots.default([]).length ? (vue.openBlock(), vue.createElementBlock(
4013
+ "footer",
4014
+ {
4015
+ key: 0,
4016
+ class: vue.normalizeClass(["datepicker-footer", { "footer-horizontal-timepicker": _ctx.horizontalTimePicker }])
4017
+ },
4018
+ [
4019
+ vue.renderSlot(_ctx.$slots, "default")
4020
+ ],
4021
+ 2
4022
+ /* CLASS */
4023
+ )) : vue.createCommentVNode("v-if", true)
4024
+ ]),
4025
+ _: 3
4026
+ /* FORWARDED */
4027
+ }, 8, ["disabled", "focusable", "class"])
4028
+ ]),
4029
+ _: 2
4030
+ /* DYNAMIC */
4031
+ }, [
4032
+ !_ctx.inline ? {
4033
+ name: "trigger",
4034
+ fn: vue.withCtx((props) => [
4035
+ vue.renderSlot(_ctx.$slots, "trigger", vue.normalizeProps(vue.guardReactiveProps(props)), () => [
4036
+ vue.createVNode(_component_b_input, vue.mergeProps({
4037
+ ref: "input",
4038
+ autocomplete: "off",
4039
+ "model-value": _ctx.formattedValue,
4040
+ placeholder: _ctx.placeholder,
4041
+ size: _ctx.size,
4042
+ icon: _ctx.icon,
4043
+ "icon-right": _ctx.iconRight,
4044
+ "icon-right-clickable": _ctx.iconRightClickable,
4045
+ "icon-pack": _ctx.iconPack,
4046
+ rounded: _ctx.rounded,
4047
+ loading: _ctx.loading,
4048
+ disabled: _ctx.disabledOrUndefined,
4049
+ readonly: !_ctx.editable
4050
+ }, _ctx.fallthroughAttrs, {
4051
+ "use-html5-validation": false,
4052
+ onClick: _ctx.onInputClick,
4053
+ onIconRightClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("icon-right-click", $event)),
4054
+ onKeyup: _cache[1] || (_cache[1] = vue.withKeys(($event) => _ctx.togglePicker(true), ["enter"])),
4055
+ onChange: _cache[2] || (_cache[2] = ($event) => _ctx.onChange($event.target.value)),
4056
+ onFocus: _ctx.handleOnFocus
4057
+ }), null, 16, ["model-value", "placeholder", "size", "icon", "icon-right", "icon-right-clickable", "icon-pack", "rounded", "loading", "disabled", "readonly", "onClick", "onFocus"])
4058
+ ])
4059
+ ]),
4060
+ key: "0"
4061
+ } : void 0
4062
+ ]), 1032, ["position", "disabled", "inline", "mobile-modal", "trap-focus", "aria-role", "append-to-body", "onActiveChange"])) : (vue.openBlock(), vue.createBlock(_component_b_input, vue.mergeProps({
4063
+ key: 1,
4064
+ ref: "input",
4065
+ type: !_ctx.isTypeMonth ? "date" : "month",
4066
+ autocomplete: "off",
4067
+ "model-value": _ctx.formatNative(_ctx.computedValue),
4068
+ placeholder: _ctx.placeholder,
4069
+ size: _ctx.size,
4070
+ icon: _ctx.icon,
4071
+ "icon-pack": _ctx.iconPack,
4072
+ rounded: _ctx.rounded,
4073
+ loading: _ctx.loading,
4074
+ max: _ctx.formatNative(_ctx.maxDate),
4075
+ min: _ctx.formatNative(_ctx.minDate),
4076
+ disabled: _ctx.disabledOrUndefined,
4077
+ readonly: false
4078
+ }, _ctx.fallthroughAttrs, {
4079
+ "use-html5-validation": false,
4080
+ onChange: _ctx.onChangeNativePicker,
4081
+ onFocus: _ctx.onFocus,
4082
+ onBlur: _ctx.onBlur
4083
+ }), null, 16, ["type", "model-value", "placeholder", "size", "icon", "icon-pack", "rounded", "loading", "max", "min", "disabled", "onChange", "onFocus", "onBlur"]))
4084
+ ],
4085
+ 16
4086
+ /* FULL_PROPS */
4087
+ );
4088
+ }
4089
+ var Datepicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
4090
+
4091
+ const registerComponent = (Vue, component, name) => {
4092
+ const componentName = component.name;
4093
+ if (componentName == null) {
4094
+ throw new Error("Buefy.registerComponent: missing component name");
4095
+ }
4096
+ Vue.component(componentName, component);
4097
+ };
4098
+
4099
+ const Plugin = {
4100
+ install(Vue) {
4101
+ registerComponent(Vue, Datepicker);
4102
+ }
4103
+ };
4104
+
4105
+ exports.BDatepicker = Datepicker;
4106
+ exports.default = Plugin;
4107
+
4108
+ Object.defineProperty(exports, '__esModule', { value: true });
4109
+
4110
+ }));