buefy 0.9.29 → 1.0.1
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.
- package/{LICENSE → LICENSE.md} +1 -1
- package/README.md +114 -27
- package/dist/buefy.css +472 -472
- package/dist/buefy.d.ts +11713 -0
- package/dist/buefy.esm.js +14181 -11095
- package/dist/buefy.esm.min.js +2 -2
- package/dist/buefy.js +19891 -16744
- package/dist/buefy.min.css +1 -1
- package/dist/buefy.min.js +2 -2
- package/dist/cjs/Autocomplete-bK5HLaUH.js +771 -0
- package/dist/cjs/Button-Cq7yqI8p.js +118 -0
- package/dist/cjs/CheckRadioMixin-CDu0SN3g.js +58 -0
- package/dist/cjs/Checkbox-GPzAMQqM.js +85 -0
- package/dist/cjs/CompatFallthroughMixin-hhK0Gkhr.js +48 -0
- package/dist/cjs/Datepicker-B-9ReBe6.js +2120 -0
- package/dist/cjs/Dropdown-DtpKU9qf.js +470 -0
- package/dist/cjs/DropdownItem-IMOKyRGV.js +110 -0
- package/dist/cjs/Field-19ZCJFF8.js +405 -0
- package/dist/cjs/{FormElementMixin-193a88b8.js → FormElementMixin-DavX4iOv.js} +69 -62
- package/dist/cjs/Icon-lsDKE2wQ.js +184 -0
- package/dist/cjs/Image-CocPwU3n.js +356 -0
- package/dist/cjs/InjectedChildMixin-CUKn09dB.js +150 -0
- package/dist/cjs/Input-BcloGeZ3.js +350 -0
- package/dist/cjs/Loading-GqqqjipO.js +145 -0
- package/dist/cjs/MessageMixin-bGuuzfev.js +136 -0
- package/dist/cjs/Modal-CYpSQe2Q.js +315 -0
- package/dist/cjs/NoticeMixin--3RjH43z.js +163 -0
- package/dist/cjs/Pagination-D1MVdiLp.js +547 -0
- package/dist/cjs/Progress-DT9Qc8Id.js +177 -0
- package/dist/cjs/Select-DayPKwCY.js +147 -0
- package/dist/cjs/SlotComponent-BruGdRW3.js +41 -0
- package/dist/cjs/TabbedChildMixin-B3JUUwcf.js +211 -0
- package/dist/cjs/Tag-BprnwJJ1.js +167 -0
- package/dist/cjs/Timepicker-CDZ3V-2J.js +283 -0
- package/dist/cjs/{TimepickerMixin-6c1a4ab4.js → TimepickerMixin-C9WVvcUL.js} +237 -232
- package/dist/cjs/Tooltip-Cgighv0j.js +393 -0
- package/dist/cjs/_plugin-vue_export-helper-Die8u8yB.js +11 -0
- package/dist/cjs/autocomplete.js +14 -13
- package/dist/cjs/breadcrumb.js +64 -96
- package/dist/cjs/button.js +11 -11
- package/dist/cjs/carousel.js +457 -294
- package/dist/cjs/checkbox.js +57 -55
- package/dist/cjs/clockpicker.js +462 -266
- package/dist/cjs/collapse.js +60 -89
- package/dist/cjs/colorpicker.js +16 -14
- package/dist/cjs/{config-8cfb5a4a.js → config-DR826Ki2.js} +42 -20
- package/dist/cjs/config.js +5 -5
- package/dist/cjs/datepicker.js +19 -18
- package/dist/cjs/datetimepicker.js +278 -172
- package/dist/cjs/dialog.js +386 -188
- package/dist/cjs/dropdown.js +14 -14
- package/dist/cjs/field.js +9 -8
- package/dist/cjs/helpers.js +146 -245
- package/dist/cjs/icon.js +10 -10
- package/dist/cjs/image.js +8 -8
- package/dist/cjs/index-DiQy3SCb.js +1942 -0
- package/dist/cjs/index.js +190 -132
- package/dist/cjs/input.js +13 -12
- package/dist/cjs/loading.js +75 -26
- package/dist/cjs/menu.js +240 -204
- package/dist/cjs/message.js +102 -50
- package/dist/cjs/modal.js +80 -36
- package/dist/cjs/navbar.js +344 -451
- package/dist/cjs/notification.js +236 -136
- package/dist/cjs/numberinput.js +250 -142
- package/dist/cjs/pagination.js +11 -11
- package/dist/cjs/plugins-DbyYGVpp.js +16 -0
- package/dist/cjs/progress.js +62 -210
- package/dist/cjs/radio.js +106 -99
- package/dist/cjs/rate.js +120 -79
- package/dist/cjs/select.js +13 -12
- package/dist/cjs/sidebar.js +161 -155
- package/dist/cjs/skeleton.js +64 -97
- package/dist/cjs/slider.js +408 -312
- package/dist/cjs/snackbar.js +179 -87
- package/dist/cjs/ssr-DVRFTu_P.js +8 -0
- package/dist/cjs/steps.js +221 -152
- package/dist/cjs/switch.js +93 -71
- package/dist/cjs/table.js +1606 -910
- package/dist/cjs/tabs.js +196 -152
- package/dist/cjs/tag.js +30 -56
- package/dist/cjs/taginput.js +262 -168
- package/dist/cjs/timepicker.js +18 -17
- package/dist/cjs/toast.js +136 -80
- package/dist/cjs/tooltip.js +8 -8
- package/dist/cjs/trapFocus-BlX6xykt.js +53 -0
- package/dist/cjs/upload.js +102 -112
- package/dist/components/autocomplete/index.js +1446 -1512
- package/dist/components/autocomplete/index.min.js +2 -2
- package/dist/components/breadcrumb/index.js +125 -249
- package/dist/components/breadcrumb/index.min.js +2 -2
- package/dist/components/button/index.js +303 -538
- package/dist/components/button/index.min.js +2 -2
- package/dist/components/carousel/index.js +1427 -1522
- package/dist/components/carousel/index.min.js +2 -2
- package/dist/components/checkbox/index.js +148 -191
- package/dist/components/checkbox/index.min.js +2 -2
- package/dist/components/clockpicker/index.js +2467 -2980
- package/dist/components/clockpicker/index.min.js +2 -2
- package/dist/components/collapse/index.js +68 -174
- package/dist/components/collapse/index.min.js +2 -2
- package/dist/components/colorpicker/index.js +3927 -3934
- package/dist/components/colorpicker/index.min.js +2 -2
- package/dist/components/datepicker/index.js +3839 -3581
- package/dist/components/datepicker/index.min.js +2 -2
- package/dist/components/datetimepicker/index.js +5115 -4545
- package/dist/components/datetimepicker/index.min.js +2 -2
- package/dist/components/dialog/index.js +1119 -1085
- package/dist/components/dialog/index.min.js +2 -2
- package/dist/components/dropdown/index.js +608 -971
- package/dist/components/dropdown/index.min.js +2 -2
- package/dist/components/field/index.js +400 -479
- package/dist/components/field/index.min.js +2 -2
- package/dist/components/icon/index.js +187 -438
- package/dist/components/icon/index.min.js +2 -2
- package/dist/components/image/index.js +363 -480
- package/dist/components/image/index.min.js +2 -2
- package/dist/components/input/index.js +713 -811
- package/dist/components/input/index.min.js +2 -2
- package/dist/components/loading/index.js +253 -339
- package/dist/components/loading/index.min.js +2 -2
- package/dist/components/menu/index.js +412 -574
- package/dist/components/menu/index.min.js +2 -2
- package/dist/components/message/index.js +568 -607
- package/dist/components/message/index.min.js +2 -2
- package/dist/components/modal/index.js +322 -430
- package/dist/components/modal/index.min.js +2 -2
- package/dist/components/navbar/index.js +582 -753
- package/dist/components/navbar/index.min.js +2 -2
- package/dist/components/notification/index.js +910 -857
- package/dist/components/notification/index.min.js +2 -2
- package/dist/components/numberinput/index.js +1060 -1051
- package/dist/components/numberinput/index.min.js +2 -2
- package/dist/components/pagination/index.js +717 -821
- package/dist/components/pagination/index.min.js +2 -2
- package/dist/components/progress/index.js +244 -585
- package/dist/components/progress/index.min.js +2 -2
- package/dist/components/radio/index.js +140 -192
- package/dist/components/radio/index.min.js +2 -2
- package/dist/components/rate/index.js +354 -563
- package/dist/components/rate/index.min.js +2 -2
- package/dist/components/select/index.js +508 -663
- package/dist/components/select/index.min.js +2 -2
- package/dist/components/sidebar/index.js +177 -307
- package/dist/components/sidebar/index.min.js +2 -2
- package/dist/components/skeleton/index.js +70 -183
- package/dist/components/skeleton/index.min.js +2 -2
- package/dist/components/slider/index.js +1082 -1177
- package/dist/components/slider/index.min.js +2 -2
- package/dist/components/snackbar/index.js +291 -379
- package/dist/components/snackbar/index.min.js +2 -2
- package/dist/components/steps/index.js +762 -1017
- package/dist/components/steps/index.min.js +2 -2
- package/dist/components/switch/index.js +107 -222
- package/dist/components/switch/index.min.js +2 -2
- package/dist/components/table/index.js +4005 -3277
- package/dist/components/table/index.min.js +2 -2
- package/dist/components/tabs/index.js +660 -939
- package/dist/components/tabs/index.min.js +2 -2
- package/dist/components/tag/index.js +338 -249
- package/dist/components/tag/index.min.js +2 -2
- package/dist/components/taginput/index.js +2002 -1990
- package/dist/components/taginput/index.min.js +2 -2
- package/dist/components/timepicker/index.js +2737 -2681
- package/dist/components/timepicker/index.min.js +2 -2
- package/dist/components/toast/index.js +249 -373
- package/dist/components/toast/index.min.js +2 -2
- package/dist/components/tooltip/index.js +401 -588
- package/dist/components/tooltip/index.min.js +2 -2
- package/dist/components/upload/index.js +227 -326
- package/dist/components/upload/index.min.js +2 -2
- package/dist/esm/Autocomplete-DyPAHhWD.js +769 -0
- package/dist/esm/Button-DyUYShTZ.js +116 -0
- package/dist/esm/CheckRadioMixin-DSD_rjC8.js +56 -0
- package/dist/esm/Checkbox-KUMz0sfA.js +83 -0
- package/dist/esm/CompatFallthroughMixin-C8LPuwDr.js +46 -0
- package/dist/esm/Datepicker-Bl8Wfdkn.js +2118 -0
- package/dist/esm/Dropdown-CGTYVyoL.js +467 -0
- package/dist/esm/DropdownItem-Cn3nM0A3.js +108 -0
- package/dist/esm/Field-B7bX_uUg.js +403 -0
- package/dist/esm/FormElementMixin-Dd_wkBN5.js +168 -0
- package/dist/esm/Icon-DPyGDeRK.js +182 -0
- package/dist/esm/Image-DhX-4hlV.js +354 -0
- package/dist/esm/InjectedChildMixin-D2K-FwuO.js +145 -0
- package/dist/esm/Input-C4L520az.js +348 -0
- package/dist/esm/Loading-tuQoo6TU.js +143 -0
- package/dist/esm/MessageMixin-CQ7LIdvq.js +134 -0
- package/dist/esm/Modal-tfvyhxw_.js +313 -0
- package/dist/esm/NoticeMixin-ByNlva3T.js +161 -0
- package/dist/esm/Pagination-B-LAJQay.js +543 -0
- package/dist/esm/Progress-BPGTVZgr.js +174 -0
- package/dist/esm/Select-bl4qUzij.js +145 -0
- package/dist/esm/SlotComponent-BwNpVnfH.js +39 -0
- package/dist/esm/TabbedChildMixin-C4i6WP9j.js +208 -0
- package/dist/esm/Tag-jS5Bcj6N.js +165 -0
- package/dist/esm/Timepicker-DnkqnOBT.js +281 -0
- package/dist/esm/{TimepickerMixin-d736b0a9.js → TimepickerMixin-Bikh6_Fg.js} +237 -232
- package/dist/esm/Tooltip-CtDSXAqa.js +391 -0
- package/dist/esm/_plugin-vue_export-helper-OJRSZE6i.js +9 -0
- package/dist/esm/autocomplete.js +13 -13
- package/dist/esm/breadcrumb.js +61 -93
- package/dist/esm/button.js +10 -11
- package/dist/esm/carousel.js +456 -293
- package/dist/esm/checkbox.js +56 -55
- package/dist/esm/clockpicker.js +461 -265
- package/dist/esm/collapse.js +59 -88
- package/dist/esm/colorpicker.js +15 -13
- package/dist/esm/{config-e7d4b9c2.js → config-CKuo-p6e.js} +43 -21
- package/dist/esm/config.js +4 -4
- package/dist/esm/datepicker.js +18 -18
- package/dist/esm/datetimepicker.js +278 -172
- package/dist/esm/dialog.js +386 -188
- package/dist/esm/dropdown.js +12 -13
- package/dist/esm/field.js +9 -9
- package/dist/esm/helpers.js +144 -245
- package/dist/esm/icon.js +9 -10
- package/dist/esm/image.js +8 -9
- package/dist/esm/index-CQegEsxK.js +1938 -0
- package/dist/esm/index.js +116 -134
- package/dist/esm/input.js +12 -12
- package/dist/esm/loading.js +75 -27
- package/dist/esm/menu.js +239 -203
- package/dist/esm/message.js +101 -49
- package/dist/esm/modal.js +81 -38
- package/dist/esm/navbar.js +339 -446
- package/dist/esm/notification.js +236 -136
- package/dist/esm/numberinput.js +249 -141
- package/dist/esm/pagination.js +10 -11
- package/dist/esm/plugins-B172kuKE.js +13 -0
- package/dist/esm/progress.js +57 -205
- package/dist/esm/radio.js +102 -95
- package/dist/esm/rate.js +119 -78
- package/dist/esm/select.js +12 -12
- package/dist/esm/sidebar.js +160 -154
- package/dist/esm/skeleton.js +63 -96
- package/dist/esm/slider.js +407 -311
- package/dist/esm/snackbar.js +179 -87
- package/dist/esm/ssr-C7yEpGLm.js +5 -0
- package/dist/esm/steps.js +220 -151
- package/dist/esm/switch.js +92 -70
- package/dist/esm/table.js +1607 -911
- package/dist/esm/tabs.js +195 -151
- package/dist/esm/tag.js +29 -56
- package/dist/esm/taginput.js +261 -167
- package/dist/esm/timepicker.js +18 -18
- package/dist/esm/toast.js +136 -80
- package/dist/esm/tooltip.js +8 -9
- package/dist/esm/trapFocus-KHP_kCNE.js +51 -0
- package/dist/esm/upload.js +101 -111
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +48 -137
- package/src/components/autocomplete/{Autocomplete.spec.js → Autocomplete.spec.ts} +162 -125
- package/src/components/autocomplete/Autocomplete.vue +177 -115
- package/src/components/autocomplete/__snapshots__/Autocomplete.spec.ts.snap +21 -0
- package/src/components/autocomplete/{index.js → index.ts} +3 -4
- package/src/components/breadcrumb/{Breadcrumb.spec.js → Breadcrumb.spec.ts} +10 -8
- package/src/components/breadcrumb/Breadcrumb.vue +4 -3
- package/src/components/breadcrumb/BreadcrumbItem.spec.ts +74 -0
- package/src/components/breadcrumb/BreadcrumbItem.vue +12 -8
- package/src/components/breadcrumb/__snapshots__/Breadcrumb.spec.ts.snap +7 -0
- package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.ts.snap +3 -0
- package/src/components/breadcrumb/{index.js → index.ts} +3 -4
- package/src/components/button/{Button.spec.js → Button.spec.ts} +30 -28
- package/src/components/button/Button.vue +25 -19
- package/src/components/button/__snapshots__/Button.spec.ts.snap +9 -0
- package/src/components/button/{index.js → index.ts} +3 -4
- package/src/components/carousel/{Carousel.spec.js → Carousel.spec.ts} +73 -73
- package/src/components/carousel/Carousel.vue +90 -51
- package/src/components/carousel/CarouselItem.spec.ts +105 -0
- package/src/components/carousel/CarouselItem.vue +11 -6
- package/src/components/carousel/{CarouselList.spec.js → CarouselList.spec.ts} +28 -29
- package/src/components/carousel/CarouselList.vue +99 -48
- package/src/components/carousel/__snapshots__/Carousel.spec.ts.snap +19 -0
- package/src/components/carousel/__snapshots__/CarouselItem.spec.ts.snap +7 -0
- package/src/components/carousel/__snapshots__/CarouselList.spec.ts.snap +36 -0
- package/src/components/carousel/{index.js → index.ts} +4 -4
- package/src/components/carousel/types.ts +17 -0
- package/src/components/checkbox/Checkbox.spec.ts +40 -0
- package/src/components/checkbox/Checkbox.vue +13 -10
- package/src/components/checkbox/CheckboxButton.spec.ts +46 -0
- package/src/components/checkbox/CheckboxButton.vue +12 -9
- package/src/components/checkbox/__snapshots__/Checkbox.spec.ts.snap +9 -0
- package/src/components/checkbox/__snapshots__/CheckboxButton.spec.ts.snap +3 -0
- package/src/components/checkbox/{index.js → index.ts} +4 -4
- package/src/components/clockpicker/Clockpicker.spec.ts +161 -0
- package/src/components/clockpicker/Clockpicker.vue +85 -55
- package/src/components/clockpicker/{ClockpickerFace.spec.js → ClockpickerFace.spec.ts} +24 -22
- package/src/components/clockpicker/ClockpickerFace.vue +272 -250
- package/src/components/clockpicker/__snapshots__/Clockpicker.spec.ts.snap +36 -0
- package/src/components/clockpicker/__snapshots__/{ClockpickerFace.spec.js.snap → ClockpickerFace.spec.ts.snap} +4 -4
- package/src/components/clockpicker/{index.js → index.ts} +3 -4
- package/src/components/collapse/{Collapse.spec.js → Collapse.spec.ts} +24 -35
- package/src/components/collapse/Collapse.vue +62 -38
- package/src/components/collapse/__snapshots__/Collapse.spec.ts.snap +10 -0
- package/src/components/collapse/{index.js → index.ts} +3 -4
- package/src/components/colorpicker/Colorpicker.spec.ts +22 -0
- package/src/components/colorpicker/Colorpicker.vue +97 -58
- package/src/components/colorpicker/{ColorpickerAlphaSlider.spec.js → ColorpickerAlphaSlider.spec.ts} +3 -2
- package/src/components/colorpicker/ColorpickerAlphaSlider.vue +32 -21
- package/src/components/colorpicker/{ColorpickerHSLRepresentationSquare.spec.js → ColorpickerHSLRepresentationSquare.spec.ts} +4 -3
- package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +41 -29
- package/src/components/colorpicker/{ColorpickerHSLRepresentationTriangle.spec.js → ColorpickerHSLRepresentationTriangle.spec.ts} +4 -3
- package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +35 -25
- package/src/components/colorpicker/__snapshots__/Colorpicker.spec.ts.snap +77 -0
- package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.ts.snap +9 -0
- package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationSquare.spec.ts.snap +12 -0
- package/src/components/colorpicker/__snapshots__/{ColorpickerHSLRepresentationTriangle.spec.js.snap → ColorpickerHSLRepresentationTriangle.spec.ts.snap} +7 -7
- package/src/components/colorpicker/{index.js → index.ts} +3 -4
- package/src/components/datepicker/{Datepicker.spec.js → Datepicker.spec.ts} +163 -83
- package/src/components/datepicker/Datepicker.vue +197 -132
- package/src/components/datepicker/{DatepickerMonth.spec.js → DatepickerMonth.spec.ts} +98 -52
- package/src/components/datepicker/DatepickerMonth.vue +106 -72
- package/src/components/datepicker/{DatepickerTable.spec.js → DatepickerTable.spec.ts} +61 -65
- package/src/components/datepicker/DatepickerTable.vue +94 -72
- package/src/components/datepicker/{DatepickerTableRow.spec.js → DatepickerTableRow.spec.ts} +90 -52
- package/src/components/datepicker/DatepickerTableRow.vue +94 -57
- package/src/components/datepicker/__snapshots__/Datepicker.spec.ts.snap +54 -0
- package/src/components/datepicker/__snapshots__/DatepickerMonth.spec.ts.snap +33 -0
- package/src/components/datepicker/__snapshots__/{DatepickerTable.spec.js.snap → DatepickerTable.spec.ts.snap} +4 -4
- package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.ts.snap +23 -0
- package/src/components/datepicker/{index.js → index.ts} +4 -4
- package/src/components/datepicker/types.ts +41 -0
- package/src/components/datetimepicker/{Datetimepicker.spec.js → Datetimepicker.spec.ts} +33 -45
- package/src/components/datetimepicker/Datetimepicker.vue +107 -69
- package/src/components/datetimepicker/{index.js → index.ts} +3 -4
- package/src/components/dialog/{Dialog.spec.js → Dialog.spec.ts} +32 -31
- package/src/components/dialog/Dialog.vue +84 -58
- package/src/components/dialog/index.ts +169 -0
- package/src/components/dropdown/Dropdown.spec.ts +229 -0
- package/src/components/dropdown/Dropdown.vue +95 -60
- package/src/components/dropdown/DropdownItem.spec.ts +78 -0
- package/src/components/dropdown/DropdownItem.vue +39 -18
- package/src/components/dropdown/__snapshots__/Dropdown.spec.ts.snap +15 -0
- package/src/components/dropdown/__snapshots__/DropdownItem.spec.ts.snap +3 -0
- package/src/components/dropdown/{index.js → index.ts} +4 -4
- package/src/components/field/{Field.spec.js → Field.spec.ts} +89 -64
- package/src/components/field/Field.vue +92 -59
- package/src/components/field/{FieldBody.spec.js → FieldBody.spec.ts} +31 -16
- package/src/components/field/FieldBody.vue +61 -15
- package/src/components/field/__snapshots__/Field.spec.ts.snap +8 -0
- package/src/components/field/__snapshots__/FieldBody.spec.ts.snap +3 -0
- package/src/components/field/{index.js → index.ts} +3 -4
- package/src/components/icon/{Icon.spec.js → Icon.spec.ts} +38 -32
- package/src/components/icon/Icon.vue +28 -17
- package/src/components/icon/__snapshots__/Icon.spec.ts.snap +3 -0
- package/src/components/icon/{index.js → index.ts} +4 -4
- package/src/components/image/{Image.spec.js → Image.spec.ts} +60 -39
- package/src/components/image/Image.vue +85 -36
- package/src/components/image/__snapshots__/Image.spec.ts.snap +37 -0
- package/src/components/image/{index.js → index.ts} +3 -4
- package/src/components/{index.js → index.ts} +92 -0
- package/src/components/input/Input.spec.ts +396 -0
- package/src/components/input/Input.vue +116 -64
- package/src/components/input/__snapshots__/Input.spec.ts.snap +9 -0
- package/src/components/input/{index.js → index.ts} +4 -4
- package/src/components/loading/Loading.spec.ts +151 -0
- package/src/components/loading/Loading.vue +42 -28
- package/src/components/loading/__snapshots__/Loading.spec.ts.snap +10 -0
- package/src/components/loading/index.ts +91 -0
- package/src/components/menu/Menu.spec.ts +21 -0
- package/src/components/menu/Menu.vue +8 -3
- package/src/components/menu/MenuItem.spec.ts +92 -0
- package/src/components/menu/MenuItem.vue +63 -32
- package/src/components/menu/MenuItemContainerMixin.ts +72 -0
- package/src/components/menu/MenuList.spec.ts +35 -0
- package/src/components/menu/MenuList.vue +32 -26
- package/src/components/menu/__snapshots__/Menu.spec.ts.snap +3 -0
- package/src/components/menu/__snapshots__/MenuItem.spec.ts.snap +9 -0
- package/src/components/menu/__snapshots__/MenuList.spec.ts.snap +8 -0
- package/src/components/menu/{index.js → index.ts} +7 -5
- package/src/components/message/{Message.spec.js → Message.spec.ts} +6 -4
- package/src/components/message/Message.vue +26 -9
- package/src/components/message/__snapshots__/Message.spec.ts.snap +11 -0
- package/src/components/message/{index.js → index.ts} +3 -5
- package/src/components/modal/Modal.spec.ts +167 -0
- package/src/components/modal/Modal.vue +86 -61
- package/src/components/modal/__snapshots__/Modal.spec.ts.snap +10 -0
- package/src/components/modal/index.ts +107 -0
- package/src/components/navbar/{NavBar.spec.js → NavBar.spec.ts} +22 -19
- package/src/components/navbar/{NavBarBurger.spec.js → NavBarBurger.spec.ts} +9 -7
- package/src/components/navbar/NavBarItem.spec.ts +92 -0
- package/src/components/navbar/Navbar.vue +92 -69
- package/src/components/navbar/NavbarBurger.vue +10 -8
- package/src/components/navbar/NavbarDropdown.spec.ts +84 -0
- package/src/components/navbar/NavbarDropdown.vue +18 -9
- package/src/components/navbar/NavbarItem.vue +42 -19
- package/src/components/navbar/__snapshots__/NavBar.spec.ts.snap +11 -0
- package/src/components/navbar/__snapshots__/NavBarBurger.spec.ts.snap +3 -0
- package/src/components/navbar/__snapshots__/NavBarItem.spec.ts.snap +3 -0
- package/src/components/navbar/__snapshots__/NavbarDropdown.spec.ts.snap +7 -0
- package/src/components/navbar/{index.js → index.ts} +3 -4
- package/src/components/notification/{Notification.spec.js → Notification.spec.ts} +6 -4
- package/src/components/notification/Notification.vue +23 -6
- package/src/components/notification/NotificationNotice.vue +44 -10
- package/src/components/notification/__snapshots__/Notification.spec.ts.snap +10 -0
- package/src/components/notification/index.ts +121 -0
- package/src/components/numberinput/{Numberinput.spec.js → Numberinput.spec.ts} +146 -91
- package/src/components/numberinput/Numberinput.vue +105 -54
- package/src/components/numberinput/{index.js → index.ts} +3 -4
- package/src/components/pagination/Pagination.spec.ts +94 -0
- package/src/components/pagination/Pagination.vue +98 -82
- package/src/components/pagination/{PaginationButton.spec.js → PaginationButton.spec.ts} +13 -10
- package/src/components/pagination/PaginationButton.vue +17 -8
- package/src/components/pagination/__snapshots__/Pagination.spec.ts.snap +22 -0
- package/src/components/pagination/__snapshots__/PaginationButton.spec.ts.snap +3 -0
- package/src/components/pagination/{index.js → index.ts} +3 -4
- package/src/components/pagination/types.ts +11 -0
- package/src/components/progress/{Progress.spec.js → Progress.spec.ts} +9 -10
- package/src/components/progress/Progress.vue +44 -19
- package/src/components/progress/ProgressBar.spec.ts +45 -0
- package/src/components/progress/ProgressBar.vue +30 -13
- package/src/components/progress/__snapshots__/Progress.spec.ts.snap +7 -0
- package/src/components/progress/__snapshots__/ProgressBar.spec.ts.snap +7 -0
- package/src/components/progress/{index.js → index.ts} +3 -5
- package/src/components/radio/Radio.spec.ts +40 -0
- package/src/components/radio/Radio.vue +14 -9
- package/src/components/radio/RadioButton.spec.ts +40 -0
- package/src/components/radio/RadioButton.vue +17 -9
- package/src/components/radio/__snapshots__/Radio.spec.ts.snap +3 -0
- package/src/components/radio/__snapshots__/RadioButton.spec.ts.snap +3 -0
- package/src/components/radio/{index.js → index.ts} +3 -5
- package/src/components/rate/{Rate.spec.js → Rate.spec.ts} +24 -22
- package/src/components/rate/Rate.vue +42 -26
- package/src/components/rate/{index.js → index.ts} +3 -5
- package/src/components/select/Select.spec.ts +74 -0
- package/src/components/select/Select.vue +40 -21
- package/src/components/select/__snapshots__/Select.spec.ts.snap +7 -0
- package/src/components/select/{index.js → index.ts} +3 -4
- package/src/components/sidebar/{Sidebar.spec.js → Sidebar.spec.ts} +30 -28
- package/src/components/sidebar/Sidebar.vue +71 -56
- package/src/components/sidebar/__snapshots__/Sidebar.spec.ts.snap +25 -0
- package/src/components/sidebar/{index.js → index.ts} +3 -4
- package/src/components/skeleton/{Skeleton.spec.js → Skeleton.spec.ts} +4 -2
- package/src/components/skeleton/Skeleton.vue +92 -57
- package/src/components/skeleton/__snapshots__/Skeleton.spec.ts.snap +7 -0
- package/src/components/skeleton/index.ts +18 -0
- package/src/components/slider/Slider.spec.ts +115 -0
- package/src/components/slider/Slider.vue +122 -66
- package/src/components/slider/SliderThumb.spec.ts +176 -0
- package/src/components/slider/SliderThumb.vue +71 -55
- package/src/components/slider/SliderTick.spec.ts +33 -0
- package/src/components/slider/SliderTick.vue +19 -12
- package/src/components/slider/__snapshots__/Slider.spec.ts.snap +12 -0
- package/src/components/slider/__snapshots__/SliderThumb.spec.ts.snap +16 -0
- package/src/components/slider/__snapshots__/SliderTick.spec.ts.snap +7 -0
- package/src/components/slider/{index.js → index.ts} +3 -4
- package/src/components/slider/types.ts +34 -0
- package/src/components/snackbar/Snackbar.spec.ts +35 -0
- package/src/components/snackbar/Snackbar.vue +28 -12
- package/src/components/snackbar/__snapshots__/Snackbar.spec.ts.snap +12 -0
- package/src/components/snackbar/index.ts +118 -0
- package/src/components/steps/StepItem.spec.ts +114 -0
- package/src/components/steps/StepItem.vue +10 -5
- package/src/components/steps/Steps.spec.ts +125 -0
- package/src/components/steps/Steps.vue +69 -50
- package/src/components/steps/__snapshots__/StepItem.spec.ts.snap +7 -0
- package/src/components/steps/__snapshots__/Steps.spec.ts.snap +40 -0
- package/src/components/steps/{index.js → index.ts} +3 -4
- package/src/components/switch/Switch.spec.ts +74 -0
- package/src/components/switch/Switch.vue +39 -19
- package/src/components/switch/__snapshots__/Switch.spec.ts.snap +3 -0
- package/src/components/switch/{index.js → index.ts} +3 -4
- package/src/components/table/{Table.spec.js → Table.spec.ts} +184 -90
- package/src/components/table/Table.vue +387 -287
- package/src/components/table/{TableColumn.spec.js → TableColumn.spec.ts} +23 -16
- package/src/components/table/TableColumn.vue +26 -17
- package/src/components/table/TableMobileSort.spec.ts +47 -0
- package/src/components/table/TableMobileSort.vue +86 -39
- package/src/components/table/TablePagination.vue +17 -9
- package/src/components/table/__snapshots__/Table.spec.ts.snap +24 -0
- package/src/components/table/__snapshots__/TableMobileSort.spec.ts.snap +12 -0
- package/src/components/table/{index.js → index.ts} +11 -4
- package/src/components/table/mockTableColumn.ts +110 -0
- package/src/components/table/types.ts +110 -0
- package/src/components/tabs/TabItem.spec.ts +203 -0
- package/src/components/tabs/TabItem.vue +6 -4
- package/src/components/tabs/{Tabs.spec.js → Tabs.spec.ts} +34 -33
- package/src/components/tabs/Tabs.vue +62 -40
- package/src/components/tabs/__snapshots__/TabItem.spec.ts.snap +7 -0
- package/src/components/tabs/__snapshots__/Tabs.spec.ts.snap +33 -0
- package/src/components/tabs/{index.js → index.ts} +3 -4
- package/src/components/tag/Tag.spec.ts +32 -0
- package/src/components/tag/Tag.vue +40 -18
- package/src/components/tag/Taglist.spec.ts +21 -0
- package/src/components/tag/Taglist.vue +6 -4
- package/src/components/tag/__snapshots__/Tag.spec.ts.snap +6 -0
- package/src/components/tag/__snapshots__/Taglist.spec.ts.snap +3 -0
- package/src/components/tag/{index.js → index.ts} +3 -4
- package/src/components/taginput/Taginput.spec.ts +132 -0
- package/src/components/taginput/Taginput.vue +106 -73
- package/src/components/taginput/__snapshots__/Taginput.spec.ts.snap +10 -0
- package/src/components/taginput/{index.js → index.ts} +3 -4
- package/src/components/timepicker/Timepicker.spec.ts +108 -0
- package/src/components/timepicker/Timepicker.vue +72 -52
- package/src/components/timepicker/__snapshots__/Timepicker.spec.ts.snap +41 -0
- package/src/components/timepicker/{index.js → index.ts} +4 -4
- package/src/components/toast/Toast.spec.ts +74 -0
- package/src/components/toast/Toast.vue +15 -5
- package/src/components/toast/__snapshots__/Toast.spec.ts.snap +10 -0
- package/src/components/toast/index.ts +120 -0
- package/src/components/tooltip/Tooltip.spec.ts +64 -0
- package/src/components/tooltip/Tooltip.vue +97 -45
- package/src/components/tooltip/__snapshots__/Tooltip.spec.ts.snap +12 -0
- package/src/components/tooltip/{index.js → index.ts} +3 -4
- package/src/components/upload/Upload.spec.ts +62 -0
- package/src/components/upload/Upload.vue +51 -46
- package/src/components/upload/__snapshots__/Upload.spec.ts.snap +3 -0
- package/src/components/upload/{index.js → index.ts} +3 -5
- package/src/directives/{clickOutside.js → clickOutside.ts} +50 -18
- package/src/directives/{trapFocus.js → trapFocus.ts} +16 -14
- package/src/{index.js → index.ts} +12 -10
- package/src/scss/buefy-build.scss +3 -3
- package/src/scss/components/_carousel.scss +0 -0
- package/src/scss/utils/_animations.scss +9 -9
- package/src/utils/CheckRadioMixin.spec.ts +28 -0
- package/src/utils/CheckRadioMixin.ts +61 -0
- package/src/utils/CompatFallthroughMixin.ts +34 -0
- package/src/utils/{ConfigComponent.js → ConfigComponent.ts} +2 -1
- package/src/utils/FormElementMixin.spec.ts +41 -0
- package/src/utils/{FormElementMixin.js → FormElementMixin.ts} +65 -29
- package/src/utils/InjectedChildMixin.ts +139 -0
- package/src/utils/MessageMixin.spec.ts +51 -0
- package/src/utils/{MessageMixin.js → MessageMixin.ts} +35 -36
- package/src/utils/NoticeMixin.spec.ts +55 -0
- package/src/utils/{NoticeMixin.js → NoticeMixin.ts} +33 -23
- package/src/utils/ProvideInjectTypes.ts +20 -0
- package/src/utils/ProviderParentMixin.ts +105 -0
- package/src/utils/SlotComponent.spec.ts +55 -0
- package/src/utils/SlotComponent.ts +38 -0
- package/src/utils/TabbedChildMixin.ts +96 -0
- package/src/utils/TabbedMixin.ts +166 -0
- package/src/utils/TabbedTypes.ts +33 -0
- package/src/utils/TimepickerMixin.spec.ts +75 -0
- package/src/utils/{TimepickerMixin.js → TimepickerMixin.ts} +129 -84
- package/src/utils/{color.spec.js → color.spec.ts} +1 -0
- package/src/utils/{color.js → color.ts} +119 -54
- package/src/utils/{config.spec.js → config.spec.ts} +2 -1
- package/src/utils/config.ts +619 -0
- package/src/utils/{debounce.spec.js → debounce.spec.ts} +14 -14
- package/src/utils/debounce.ts +20 -0
- package/src/utils/helpers.spec.ts +257 -0
- package/src/utils/helpers.ts +527 -0
- package/src/utils/{icons.js → icons.ts} +20 -10
- package/src/utils/plugins.ts +20 -0
- package/src/utils/vue-augmentation.ts +35 -0
- package/dist/cjs/Autocomplete-7a39c5ce.js +0 -673
- package/dist/cjs/Button-01827709.js +0 -114
- package/dist/cjs/CheckRadioMixin-c910f2ed.js +0 -45
- package/dist/cjs/Checkbox-43f54cc7.js +0 -70
- package/dist/cjs/Datepicker-abdb3610.js +0 -1679
- package/dist/cjs/DropdownItem-422f8c34.js +0 -559
- package/dist/cjs/Field-ed10a252.js +0 -322
- package/dist/cjs/Icon-78961800.js +0 -189
- package/dist/cjs/Image-c4bcd9b3.js +0 -299
- package/dist/cjs/InjectedChildMixin-d6bf7f91.js +0 -135
- package/dist/cjs/Input-e5a72d97.js +0 -248
- package/dist/cjs/Loading-6f2c7075.js +0 -150
- package/dist/cjs/MessageMixin-8d959514.js +0 -146
- package/dist/cjs/Modal-4cf07210.js +0 -278
- package/dist/cjs/NoticeMixin-01121bd2.js +0 -154
- package/dist/cjs/Pagination-d6b3fb85.js +0 -413
- package/dist/cjs/Select-2b3879bc.js +0 -100
- package/dist/cjs/SlotComponent-4fb48389.js +0 -53
- package/dist/cjs/TabbedChildMixin-907cad32.js +0 -222
- package/dist/cjs/Tag-437f65fb.js +0 -154
- package/dist/cjs/Timepicker-99784633.js +0 -67
- package/dist/cjs/Tooltip-54c708e5.js +0 -372
- package/dist/cjs/_rollupPluginBabelHelpers-8b2e54ad.js +0 -365
- package/dist/cjs/index-98143f23.js +0 -1633
- package/dist/cjs/plugins-7f41b028.js +0 -94
- package/dist/cjs/ssr-20dba236.js +0 -10
- package/dist/cjs/trapFocus-261420b0.js +0 -49
- package/dist/esm/Autocomplete-1a6e8770.js +0 -671
- package/dist/esm/Button-521f6efc.js +0 -112
- package/dist/esm/CheckRadioMixin-e726a83c.js +0 -43
- package/dist/esm/Checkbox-1d02686e.js +0 -68
- package/dist/esm/Datepicker-153e1b03.js +0 -1677
- package/dist/esm/DropdownItem-55682322.js +0 -556
- package/dist/esm/Field-3cb24eff.js +0 -320
- package/dist/esm/FormElementMixin-b223d3c7.js +0 -161
- package/dist/esm/Icon-60d47b31.js +0 -187
- package/dist/esm/Image-75808acb.js +0 -297
- package/dist/esm/InjectedChildMixin-b4220787.js +0 -130
- package/dist/esm/Input-20612b63.js +0 -246
- package/dist/esm/Loading-ae028ea5.js +0 -148
- package/dist/esm/MessageMixin-d577a9f5.js +0 -144
- package/dist/esm/Modal-7da7641f.js +0 -276
- package/dist/esm/NoticeMixin-bd6f61d9.js +0 -152
- package/dist/esm/Pagination-68f12c1e.js +0 -409
- package/dist/esm/Select-97781d4e.js +0 -98
- package/dist/esm/SlotComponent-8871a20f.js +0 -51
- package/dist/esm/TabbedChildMixin-bcb13767.js +0 -219
- package/dist/esm/Tag-6365aa46.js +0 -152
- package/dist/esm/Timepicker-c1e2bbf4.js +0 -65
- package/dist/esm/Tooltip-c67e7511.js +0 -370
- package/dist/esm/_rollupPluginBabelHelpers-df313029.js +0 -350
- package/dist/esm/index-0698ec02.js +0 -1629
- package/dist/esm/plugins-218aea86.js +0 -89
- package/dist/esm/ssr-b847d137.js +0 -7
- package/dist/esm/trapFocus-f0736873.js +0 -47
- package/dist/vetur/attributes.json +0 -3238
- package/dist/vetur/tags.json +0 -1183
- package/src/components/autocomplete/__snapshots__/Autocomplete.spec.js.snap +0 -10
- package/src/components/breadcrumb/BreadcrumbItem.spec.js +0 -25
- package/src/components/breadcrumb/__snapshots__/Breadcrumb.spec.js.snap +0 -7
- package/src/components/breadcrumb/__snapshots__/BreadcrumbItem.spec.js.snap +0 -3
- package/src/components/button/__snapshots__/Button.spec.js.snap +0 -3
- package/src/components/carousel/CarouselItem.spec.js +0 -57
- package/src/components/carousel/__snapshots__/Carousel.spec.js.snap +0 -12
- package/src/components/carousel/__snapshots__/CarouselItem.spec.js.snap +0 -3
- package/src/components/carousel/__snapshots__/CarouselList.spec.js.snap +0 -137
- package/src/components/checkbox/Checkbox.spec.js +0 -40
- package/src/components/checkbox/CheckboxButton.spec.js +0 -46
- package/src/components/checkbox/__snapshots__/Checkbox.spec.js.snap +0 -3
- package/src/components/checkbox/__snapshots__/CheckboxButton.spec.js.snap +0 -3
- package/src/components/clockpicker/Clockpicker.spec.js +0 -97
- package/src/components/clockpicker/__snapshots__/Clockpicker.spec.js.snap +0 -19
- package/src/components/collapse/__snapshots__/Collapse.spec.js.snap +0 -8
- package/src/components/colorpicker/Colorpicker.spec.js +0 -10
- package/src/components/colorpicker/__snapshots__/Colorpicker.spec.js.snap +0 -11
- package/src/components/colorpicker/__snapshots__/ColorpickerAlphaSlider.spec.js.snap +0 -9
- package/src/components/colorpicker/__snapshots__/ColorpickerHSLRepresentationSquare.spec.js.snap +0 -12
- package/src/components/datepicker/__snapshots__/Datepicker.spec.js.snap +0 -385
- package/src/components/datepicker/__snapshots__/DatepickerMonth.spec.js.snap +0 -33
- package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.js.snap +0 -3
- package/src/components/dialog/index.js +0 -77
- package/src/components/dropdown/Dropdown.spec.js +0 -218
- package/src/components/dropdown/DropdownItem.spec.js +0 -73
- package/src/components/dropdown/__snapshots__/Dropdown.spec.js.snap +0 -11
- package/src/components/dropdown/__snapshots__/DropdownItem.spec.js.snap +0 -3
- package/src/components/field/__snapshots__/Field.spec.js.snap +0 -3
- package/src/components/field/__snapshots__/FieldBody.spec.js.snap +0 -3
- package/src/components/icon/__snapshots__/Icon.spec.js.snap +0 -3
- package/src/components/image/__snapshots__/Image.spec.js.snap +0 -21
- package/src/components/input/Input.spec.js +0 -284
- package/src/components/input/__snapshots__/Input.spec.js.snap +0 -3
- package/src/components/loading/Loading.spec.js +0 -126
- package/src/components/loading/__snapshots__/Loading.spec.js.snap +0 -10
- package/src/components/loading/index.js +0 -40
- package/src/components/menu/Menu.spec.js +0 -19
- package/src/components/menu/MenuItem.spec.js +0 -43
- package/src/components/menu/MenuList.spec.js +0 -31
- package/src/components/menu/__snapshots__/Menu.spec.js.snap +0 -3
- package/src/components/menu/__snapshots__/MenuItem.spec.js.snap +0 -3
- package/src/components/menu/__snapshots__/MenuList.spec.js.snap +0 -8
- package/src/components/message/__snapshots__/Message.spec.js.snap +0 -3
- package/src/components/modal/Modal.spec.js +0 -134
- package/src/components/modal/__snapshots__/Modal.spec.js.snap +0 -10
- package/src/components/modal/index.js +0 -61
- package/src/components/navbar/NavBarItem.spec.js +0 -81
- package/src/components/navbar/NavbarDropdown.spec.js +0 -35
- package/src/components/navbar/__snapshots__/NavBar.spec.js.snap +0 -11
- package/src/components/navbar/__snapshots__/NavBarBurger.spec.js.snap +0 -3
- package/src/components/navbar/__snapshots__/NavBarItem.spec.js.snap +0 -3
- package/src/components/navbar/__snapshots__/NavbarDropdown.spec.js.snap +0 -7
- package/src/components/notification/__snapshots__/Notification.spec.js.snap +0 -3
- package/src/components/notification/index.js +0 -66
- package/src/components/pagination/Pagination.spec.js +0 -86
- package/src/components/pagination/__snapshots__/Pagination.spec.js.snap +0 -8
- package/src/components/pagination/__snapshots__/PaginationButton.spec.js.snap +0 -3
- package/src/components/progress/ProgressBar.spec.js +0 -26
- package/src/components/progress/__snapshots__/Progress.spec.js.snap +0 -3
- package/src/components/progress/__snapshots__/ProgressBar.spec.js.snap +0 -3
- package/src/components/radio/Radio.spec.js +0 -40
- package/src/components/radio/RadioButton.spec.js +0 -40
- package/src/components/radio/__snapshots__/Radio.spec.js.snap +0 -3
- package/src/components/radio/__snapshots__/RadioButton.spec.js.snap +0 -3
- package/src/components/select/Select.spec.js +0 -31
- package/src/components/select/__snapshots__/Select.spec.js.snap +0 -3
- package/src/components/sidebar/__snapshots__/Sidebar.spec.js.snap +0 -17
- package/src/components/skeleton/__snapshots__/Skeleton.spec.js.snap +0 -7
- package/src/components/skeleton/index.js +0 -17
- package/src/components/slider/Slider.spec.js +0 -106
- package/src/components/slider/SliderThumb.spec.js +0 -99
- package/src/components/slider/SliderTick.spec.js +0 -29
- package/src/components/slider/__snapshots__/Slider.spec.js.snap +0 -9
- package/src/components/slider/__snapshots__/SliderThumb.spec.js.snap +0 -7
- package/src/components/slider/__snapshots__/SliderTick.spec.js.snap +0 -3
- package/src/components/snackbar/Snackbar.spec.js +0 -35
- package/src/components/snackbar/__snapshots__/Snackbar.spec.js.snap +0 -8
- package/src/components/snackbar/index.js +0 -62
- package/src/components/steps/StepItem.spec.js +0 -72
- package/src/components/steps/Steps.spec.js +0 -134
- package/src/components/steps/__snapshots__/StepItem.spec.js.snap +0 -3
- package/src/components/steps/__snapshots__/Steps.spec.js.snap +0 -28
- package/src/components/switch/Switch.spec.js +0 -74
- package/src/components/switch/__snapshots__/Switch.spec.js.snap +0 -3
- package/src/components/table/TableMobileSort.spec.js +0 -40
- package/src/components/table/__snapshots__/Table.spec.js.snap +0 -16
- package/src/components/table/__snapshots__/TableMobileSort.spec.js.snap +0 -9
- package/src/components/tabs/TabItem.spec.js +0 -143
- package/src/components/tabs/__snapshots__/TabItem.spec.js.snap +0 -3
- package/src/components/tabs/__snapshots__/Tabs.spec.js.snap +0 -25
- package/src/components/tag/Tag.spec.js +0 -32
- package/src/components/tag/Taglist.spec.js +0 -19
- package/src/components/tag/__snapshots__/Tag.spec.js.snap +0 -3
- package/src/components/tag/__snapshots__/Taglist.spec.js.snap +0 -3
- package/src/components/taginput/Taginput.spec.js +0 -92
- package/src/components/taginput/__snapshots__/Taginput.spec.js.snap +0 -7
- package/src/components/timepicker/Timepicker.spec.js +0 -40
- package/src/components/timepicker/__snapshots__/Timepicker.spec.js.snap +0 -259
- package/src/components/toast/Toast.spec.js +0 -20
- package/src/components/toast/__snapshots__/Toast.spec.js.snap +0 -7
- package/src/components/toast/index.js +0 -60
- package/src/components/tooltip/Tooltip.spec.js +0 -54
- package/src/components/tooltip/__snapshots__/Tooltip.spec.js.snap +0 -8
- package/src/components/upload/Upload.spec.js +0 -19
- package/src/components/upload/__snapshots__/Upload.spec.js.snap +0 -3
- package/src/utils/CheckRadioMixin.js +0 -41
- package/src/utils/CheckRadioMixin.spec.js +0 -24
- package/src/utils/FormElementMixin.spec.js +0 -41
- package/src/utils/InjectedChildMixin.js +0 -36
- package/src/utils/MessageMixin.spec.js +0 -52
- package/src/utils/NoticeMixin.spec.js +0 -51
- package/src/utils/ProviderParentMixin.js +0 -83
- package/src/utils/SlotComponent.js +0 -51
- package/src/utils/SlotComponent.spec.js +0 -136
- package/src/utils/TabbedChildMixin.js +0 -88
- package/src/utils/TabbedMixin.js +0 -145
- package/src/utils/TimepickerMixin.spec.js +0 -82
- package/src/utils/config.js +0 -87
- package/src/utils/debounce.js +0 -15
- package/src/utils/helpers.js +0 -354
- package/src/utils/helpers.spec.js +0 -146
- package/src/utils/plugins.js +0 -15
- package/types/components.d.ts +0 -443
- package/types/helpers.d.ts +0 -5
- package/types/index.d.ts +0 -44
- /package/src/utils/{ssr.js → ssr.ts} +0 -0
|
@@ -6,26 +6,32 @@
|
|
|
6
6
|
:class="dialogClass"
|
|
7
7
|
v-trap-focus="trapFocus"
|
|
8
8
|
:role="ariaRole"
|
|
9
|
-
:aria-modal="ariaModal"
|
|
10
|
-
|
|
9
|
+
:aria-modal="ariaModal"
|
|
10
|
+
>
|
|
11
|
+
<div class="modal-background" @click="cancel('outside')" />
|
|
11
12
|
<div class="modal-card animation-content">
|
|
12
13
|
<header class="modal-card-head" v-if="title">
|
|
13
|
-
<p class="modal-card-title">
|
|
14
|
+
<p class="modal-card-title">
|
|
15
|
+
{{ title }}
|
|
16
|
+
</p>
|
|
14
17
|
</header>
|
|
15
18
|
|
|
16
19
|
<section
|
|
17
20
|
class="modal-card-body"
|
|
18
|
-
:class="{ 'is-titleless': !title, 'is-flex': hasIcon }"
|
|
21
|
+
:class="{ 'is-titleless': !title, 'is-flex': hasIcon }"
|
|
22
|
+
>
|
|
19
23
|
<div class="media">
|
|
20
24
|
<div
|
|
21
25
|
class="media-left"
|
|
22
|
-
v-if="hasIcon && (icon || iconByType)"
|
|
26
|
+
v-if="hasIcon && (icon || iconByType)"
|
|
27
|
+
>
|
|
23
28
|
<b-icon
|
|
24
|
-
:icon="icon ? icon : iconByType"
|
|
29
|
+
:icon="icon ? icon : iconByType!"
|
|
25
30
|
:pack="iconPack"
|
|
26
31
|
:type="type"
|
|
27
32
|
:both="!icon"
|
|
28
|
-
size="is-large"
|
|
33
|
+
size="is-large"
|
|
34
|
+
/>
|
|
29
35
|
</div>
|
|
30
36
|
<div class="media-content">
|
|
31
37
|
<p>
|
|
@@ -33,6 +39,7 @@
|
|
|
33
39
|
<slot />
|
|
34
40
|
</template>
|
|
35
41
|
<template v-else>
|
|
42
|
+
<!-- eslint-disable-next-line vue/no-v-html -->
|
|
36
43
|
<div v-html="message" />
|
|
37
44
|
</template>
|
|
38
45
|
</p>
|
|
@@ -44,12 +51,15 @@
|
|
|
44
51
|
class="input"
|
|
45
52
|
ref="input"
|
|
46
53
|
:class="{ 'is-danger': validationMessage }"
|
|
47
|
-
v-bind="
|
|
54
|
+
v-bind="safeInputAttrs"
|
|
48
55
|
@compositionstart="isCompositing = true"
|
|
49
56
|
@compositionend="isCompositing = false"
|
|
50
|
-
@keydown.enter="confirm"
|
|
57
|
+
@keydown.enter="confirm"
|
|
58
|
+
>
|
|
51
59
|
</div>
|
|
52
|
-
<p class="help is-danger">
|
|
60
|
+
<p class="help is-danger">
|
|
61
|
+
{{ validationMessage }}
|
|
62
|
+
</p>
|
|
53
63
|
</div>
|
|
54
64
|
</div>
|
|
55
65
|
</div>
|
|
@@ -60,31 +70,43 @@
|
|
|
60
70
|
v-if="showCancel"
|
|
61
71
|
ref="cancelButton"
|
|
62
72
|
:disabled="isLoading"
|
|
63
|
-
@click="cancel('button')"
|
|
73
|
+
@click="cancel('button')"
|
|
74
|
+
>
|
|
75
|
+
{{ cancelText }}
|
|
76
|
+
</b-button>
|
|
64
77
|
<b-button
|
|
65
78
|
:type="type"
|
|
66
79
|
ref="confirmButton"
|
|
67
80
|
:loading="isLoading"
|
|
68
|
-
@click="confirm"
|
|
81
|
+
@click="confirm"
|
|
82
|
+
>
|
|
83
|
+
{{ confirmText }}
|
|
84
|
+
</b-button>
|
|
69
85
|
</footer>
|
|
70
86
|
</div>
|
|
71
87
|
</div>
|
|
72
88
|
</transition>
|
|
73
89
|
</template>
|
|
74
90
|
|
|
75
|
-
<script>
|
|
91
|
+
<script lang="ts">
|
|
92
|
+
import { defineComponent } from 'vue'
|
|
93
|
+
import type { PropType } from 'vue'
|
|
94
|
+
|
|
76
95
|
import trapFocus from '../../directives/trapFocus'
|
|
77
|
-
import
|
|
96
|
+
import BIcon from '../icon/Icon.vue'
|
|
78
97
|
import Modal from '../modal/Modal.vue'
|
|
79
|
-
import
|
|
98
|
+
import BButton from '../button/Button.vue'
|
|
80
99
|
import config from '../../utils/config'
|
|
81
100
|
import { removeElement } from '../../utils/helpers'
|
|
101
|
+
import type { ExtractComponentProps } from '../../utils/helpers'
|
|
102
|
+
|
|
103
|
+
type BButtonInstance = InstanceType<typeof BButton>
|
|
82
104
|
|
|
83
|
-
|
|
105
|
+
const Dialog = defineComponent({
|
|
84
106
|
name: 'BDialog',
|
|
85
107
|
components: {
|
|
86
|
-
|
|
87
|
-
|
|
108
|
+
BIcon,
|
|
109
|
+
BButton
|
|
88
110
|
},
|
|
89
111
|
directives: {
|
|
90
112
|
trapFocus
|
|
@@ -122,8 +144,10 @@ export default {
|
|
|
122
144
|
type: Object,
|
|
123
145
|
default: () => ({})
|
|
124
146
|
},
|
|
125
|
-
|
|
126
|
-
type
|
|
147
|
+
confirmCallback: {
|
|
148
|
+
// I was not able to figure out how to specify the "self" type here
|
|
149
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
150
|
+
type: Function as PropType<(value: string, dialog: any) => void>,
|
|
127
151
|
default: () => {}
|
|
128
152
|
},
|
|
129
153
|
closeOnConfirm: {
|
|
@@ -139,23 +163,14 @@ export default {
|
|
|
139
163
|
focusOn: {
|
|
140
164
|
type: String,
|
|
141
165
|
default: 'confirm'
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
type: String,
|
|
151
|
-
validator: (value) => {
|
|
152
|
-
return [
|
|
153
|
-
'dialog',
|
|
154
|
-
'alertdialog'
|
|
155
|
-
].indexOf(value) >= 0
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
ariaModal: Boolean
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
emits: {
|
|
169
|
+
/* eslint-disable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|
|
170
|
+
// second parameter is the dialog instance but typed any
|
|
171
|
+
// because I was not able to figure out how to specify the "self" type here
|
|
172
|
+
confirm: (value: string, dialog: any) => true
|
|
173
|
+
/* eslint-enable @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any */
|
|
159
174
|
},
|
|
160
175
|
data() {
|
|
161
176
|
const prompt = this.hasInput
|
|
@@ -171,12 +186,23 @@ export default {
|
|
|
171
186
|
}
|
|
172
187
|
},
|
|
173
188
|
computed: {
|
|
189
|
+
// `safeInputAttrs` is a shallow copy of `inputAttrs` except for `value`
|
|
190
|
+
// `value` should not be specified to `v-bind` of the input element
|
|
191
|
+
// because it inhibits `v-model` of the input on Vue 3
|
|
192
|
+
safeInputAttrs() {
|
|
193
|
+
const attrs = { ...this.inputAttrs }
|
|
194
|
+
delete attrs.value
|
|
195
|
+
if (typeof attrs.required === 'undefined') {
|
|
196
|
+
attrs.required = true
|
|
197
|
+
}
|
|
198
|
+
return attrs
|
|
199
|
+
},
|
|
174
200
|
dialogClass() {
|
|
175
201
|
return [this.size, {
|
|
176
202
|
'has-custom-container': this.container !== null
|
|
177
203
|
}]
|
|
178
204
|
},
|
|
179
|
-
|
|
205
|
+
/*
|
|
180
206
|
* Icon name (MDI) based on the type.
|
|
181
207
|
*/
|
|
182
208
|
iconByType() {
|
|
@@ -198,25 +224,26 @@ export default {
|
|
|
198
224
|
}
|
|
199
225
|
},
|
|
200
226
|
methods: {
|
|
201
|
-
|
|
227
|
+
/*
|
|
202
228
|
* If it's a prompt Dialog, validate the input.
|
|
203
|
-
* Call the
|
|
229
|
+
* Call the confirmCallback prop (function) and close the Dialog.
|
|
204
230
|
*/
|
|
205
231
|
confirm() {
|
|
206
|
-
|
|
232
|
+
const input = this.$refs.input as HTMLInputElement
|
|
233
|
+
if (input != null) {
|
|
207
234
|
if (this.isCompositing) return
|
|
208
|
-
if (!
|
|
209
|
-
this.validationMessage =
|
|
210
|
-
this.$nextTick(() =>
|
|
235
|
+
if (!input.checkValidity()) {
|
|
236
|
+
this.validationMessage = input.validationMessage
|
|
237
|
+
this.$nextTick(() => input.select())
|
|
211
238
|
return
|
|
212
239
|
}
|
|
213
240
|
}
|
|
214
|
-
this.$emit('confirm', this.prompt)
|
|
215
|
-
this.
|
|
241
|
+
this.$emit('confirm', this.prompt, this)
|
|
242
|
+
this.confirmCallback(this.prompt, this)
|
|
216
243
|
if (this.closeOnConfirm) this.close()
|
|
217
244
|
},
|
|
218
245
|
|
|
219
|
-
|
|
246
|
+
/*
|
|
220
247
|
* Close the Dialog.
|
|
221
248
|
*/
|
|
222
249
|
close() {
|
|
@@ -224,19 +251,18 @@ export default {
|
|
|
224
251
|
this.isLoading = false
|
|
225
252
|
// Timeout for the animation complete before destroying
|
|
226
253
|
setTimeout(() => {
|
|
227
|
-
this.$destroy()
|
|
228
254
|
removeElement(this.$el)
|
|
229
255
|
}, 150)
|
|
230
256
|
},
|
|
231
257
|
|
|
232
|
-
|
|
258
|
+
/*
|
|
233
259
|
* Start the Loading.
|
|
234
260
|
*/
|
|
235
261
|
startLoading() {
|
|
236
262
|
this.isLoading = true
|
|
237
263
|
},
|
|
238
264
|
|
|
239
|
-
|
|
265
|
+
/*
|
|
240
266
|
* Cancel the Loading.
|
|
241
267
|
*/
|
|
242
268
|
cancelLoading() {
|
|
@@ -255,20 +281,20 @@ export default {
|
|
|
255
281
|
mounted() {
|
|
256
282
|
this.isActive = true
|
|
257
283
|
|
|
258
|
-
if (typeof this.inputAttrs.required === 'undefined') {
|
|
259
|
-
this.$set(this.inputAttrs, 'required', true)
|
|
260
|
-
}
|
|
261
|
-
|
|
262
284
|
this.$nextTick(() => {
|
|
263
285
|
// Handle which element receives focus
|
|
264
286
|
if (this.hasInput) {
|
|
265
|
-
this.$refs.input.focus()
|
|
287
|
+
(this.$refs.input as HTMLInputElement).focus()
|
|
266
288
|
} else if (this.focusOn === 'cancel' && this.showCancel) {
|
|
267
|
-
this.$refs.cancelButton.$el.focus()
|
|
289
|
+
(this.$refs.cancelButton as BButtonInstance).$el.focus()
|
|
268
290
|
} else {
|
|
269
|
-
this.$refs.confirmButton.$el.focus()
|
|
291
|
+
(this.$refs.confirmButton as BButtonInstance).$el.focus()
|
|
270
292
|
}
|
|
271
293
|
})
|
|
272
294
|
}
|
|
273
|
-
}
|
|
295
|
+
})
|
|
296
|
+
|
|
297
|
+
export type DialogProps = ExtractComponentProps<typeof Dialog>
|
|
298
|
+
|
|
299
|
+
export default Dialog
|
|
274
300
|
</script>
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { createApp, h as createElement } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance } from 'vue'
|
|
3
|
+
|
|
4
|
+
import Dialog from './Dialog.vue'
|
|
5
|
+
import type { DialogProps } from './Dialog.vue'
|
|
6
|
+
|
|
7
|
+
import config from '../../utils/config'
|
|
8
|
+
import type { ModalCancellableOption } from '../../utils/config'
|
|
9
|
+
import { copyAppContext, getComponentFromVNode } from '../../utils/helpers'
|
|
10
|
+
import { registerComponent, registerComponentProgrammatic } from '../../utils/plugins'
|
|
11
|
+
|
|
12
|
+
type DialogInstance = InstanceType<typeof Dialog>
|
|
13
|
+
|
|
14
|
+
export type DialogOpenParams = Omit<
|
|
15
|
+
DialogProps,
|
|
16
|
+
'programmatic' | 'cancelCallback' | 'confirmCallback'
|
|
17
|
+
> & {
|
|
18
|
+
onConfirm?: (value: string, dialog: DialogInstance) => void
|
|
19
|
+
onCancel?: (method: ModalCancellableOption) => void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Minimal definition of a programmatically opened dialog.
|
|
23
|
+
//
|
|
24
|
+
// ESLint does not like `{}` as a type but allowed here to make them look
|
|
25
|
+
// similar to Vue's definition.
|
|
26
|
+
/* eslint-disable @typescript-eslint/ban-types */
|
|
27
|
+
type DialogProgrammaticInstance = ComponentPublicInstance<
|
|
28
|
+
{}, // P
|
|
29
|
+
{}, // B
|
|
30
|
+
{}, // D
|
|
31
|
+
{}, // C
|
|
32
|
+
{ close: () => void } // M
|
|
33
|
+
>
|
|
34
|
+
|
|
35
|
+
function open(propsData: DialogProps, app?: App) {
|
|
36
|
+
let slot: DialogProps['message']
|
|
37
|
+
if (Array.isArray(propsData.message)) {
|
|
38
|
+
slot = propsData.message
|
|
39
|
+
delete propsData.message
|
|
40
|
+
}
|
|
41
|
+
function createDialog(
|
|
42
|
+
onConfirm?: (value: string) => void,
|
|
43
|
+
onCancel?: (method: ModalCancellableOption) => void
|
|
44
|
+
) {
|
|
45
|
+
const container = document.createElement('div')
|
|
46
|
+
// Vue 3 requires a new app to mount another component
|
|
47
|
+
const vueInstance = createApp({
|
|
48
|
+
data() {
|
|
49
|
+
return {
|
|
50
|
+
dialogVNode: null
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
methods: {
|
|
54
|
+
close() {
|
|
55
|
+
const dialog = getComponentFromVNode(this.dialogVNode)
|
|
56
|
+
if (dialog) {
|
|
57
|
+
(dialog as DialogInstance).close()
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
startLoading() {
|
|
61
|
+
const dialog = getComponentFromVNode(this.dialogVNode)
|
|
62
|
+
if (dialog) {
|
|
63
|
+
(dialog as DialogInstance).startLoading()
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
cancelLoading() {
|
|
67
|
+
const dialog = getComponentFromVNode(this.dialogVNode)
|
|
68
|
+
if (dialog) {
|
|
69
|
+
(dialog as DialogInstance).cancelLoading()
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
render() {
|
|
74
|
+
this.dialogVNode = createElement(
|
|
75
|
+
Dialog,
|
|
76
|
+
{
|
|
77
|
+
...propsData,
|
|
78
|
+
// intentionally overrides propsData.onConfirm
|
|
79
|
+
// to prevent propsData.onConfirm from receiving a "confirm" event
|
|
80
|
+
onConfirm: (value: string) => {
|
|
81
|
+
if (onConfirm != null) {
|
|
82
|
+
onConfirm(value)
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
// intentionally override propsData.onCancel
|
|
86
|
+
// to prevent propsData.onCancel from receiving a "cancel" event
|
|
87
|
+
onCancel: (method: ModalCancellableOption) => {
|
|
88
|
+
if (onCancel != null) {
|
|
89
|
+
onCancel(method)
|
|
90
|
+
}
|
|
91
|
+
vueInstance.unmount()
|
|
92
|
+
},
|
|
93
|
+
confirmCallback: (value: string, dialog: DialogInstance) => {
|
|
94
|
+
if (propsData.onConfirm != null) {
|
|
95
|
+
propsData.onConfirm(value, dialog)
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
cancelCallback: (method: ModalCancellableOption) => {
|
|
99
|
+
if (propsData.onCancel != null) {
|
|
100
|
+
propsData.onCancel(method)
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
slot ? { default: () => slot } : undefined
|
|
105
|
+
)
|
|
106
|
+
return this.dialogVNode
|
|
107
|
+
}
|
|
108
|
+
})
|
|
109
|
+
if (app) {
|
|
110
|
+
copyAppContext(app, vueInstance)
|
|
111
|
+
}
|
|
112
|
+
return vueInstance.mount(container) as DialogProgrammaticInstance
|
|
113
|
+
}
|
|
114
|
+
if (!config.defaultProgrammaticPromise) {
|
|
115
|
+
return createDialog()
|
|
116
|
+
} else {
|
|
117
|
+
return new Promise((resolve) => {
|
|
118
|
+
const dialog = createDialog(
|
|
119
|
+
(event) => resolve({ result: event || true, dialog }),
|
|
120
|
+
() => resolve({ result: false, dialog }))
|
|
121
|
+
})
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
class DialogProgrammatic {
|
|
126
|
+
private app: App | undefined
|
|
127
|
+
|
|
128
|
+
constructor(app?: App) {
|
|
129
|
+
this.app = app // may be undefined in the testing environment
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
alert(params: string | DialogOpenParams) {
|
|
133
|
+
let newParams: DialogOpenParams
|
|
134
|
+
if (typeof params === 'string') {
|
|
135
|
+
newParams = {
|
|
136
|
+
message: params
|
|
137
|
+
}
|
|
138
|
+
} else {
|
|
139
|
+
newParams = params
|
|
140
|
+
}
|
|
141
|
+
newParams = {
|
|
142
|
+
canCancel: false,
|
|
143
|
+
...newParams
|
|
144
|
+
}
|
|
145
|
+
return open(newParams, this.app)
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
confirm(params: DialogOpenParams) {
|
|
149
|
+
return open(params, this.app)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
prompt(params: DialogOpenParams) {
|
|
153
|
+
return open({ hasInput: true, ...params }, this.app)
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const Plugin = {
|
|
158
|
+
install(Vue: App) {
|
|
159
|
+
registerComponent(Vue, Dialog)
|
|
160
|
+
registerComponentProgrammatic(Vue, 'dialog', new DialogProgrammatic(Vue))
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export default Plugin
|
|
165
|
+
|
|
166
|
+
export {
|
|
167
|
+
DialogProgrammatic,
|
|
168
|
+
Dialog as BDialog
|
|
169
|
+
}
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
2
|
+
import { shallowMount } from '@vue/test-utils'
|
|
3
|
+
import type { VueWrapper } from '@vue/test-utils'
|
|
4
|
+
import BDropdown from '@components/dropdown/Dropdown.vue'
|
|
5
|
+
|
|
6
|
+
describe('BDropdown', () => {
|
|
7
|
+
const val1 = 'val1'
|
|
8
|
+
const val2 = 'val2'
|
|
9
|
+
let wrapper: VueWrapper<InstanceType<typeof BDropdown>>
|
|
10
|
+
|
|
11
|
+
beforeEach(() => {
|
|
12
|
+
wrapper = shallowMount(BDropdown, {
|
|
13
|
+
slots: {
|
|
14
|
+
trigger: '<button class="trigger">trigger</button>'
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('is called', () => {
|
|
20
|
+
expect(wrapper.vm).toBeTruthy()
|
|
21
|
+
expect(wrapper.vm.$options.name).toBe('BDropdown')
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
it('render correctly', () => {
|
|
25
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('manage props validator', () => {
|
|
29
|
+
const position = wrapper.vm.$options.props.position
|
|
30
|
+
|
|
31
|
+
expect(position.type).toBe(String)
|
|
32
|
+
expect(position.validator && position.validator('is-top')).toBeFalsy()
|
|
33
|
+
expect(position.validator && position.validator('is-top-left')).toBeTruthy()
|
|
34
|
+
expect(position.validator && position.validator('is-top-right')).toBeTruthy()
|
|
35
|
+
expect(position.validator && position.validator('is-bottom-left')).toBeTruthy()
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
it('react accordingly when changing v-model', async () => {
|
|
39
|
+
const value = 'value'
|
|
40
|
+
await wrapper.setProps({ modelValue: value })
|
|
41
|
+
expect(wrapper.vm.selected).toBe(value)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
it('emit activity when it changes', async () => {
|
|
45
|
+
wrapper.vm.updateAppendToBody = vi.fn(() => wrapper.vm.updateAppendToBody)
|
|
46
|
+
await wrapper.setProps({ appendToBody: true })
|
|
47
|
+
|
|
48
|
+
await wrapper.setData({ isActive: true })
|
|
49
|
+
expect(wrapper.emitted()['active-change']).toBeTruthy()
|
|
50
|
+
|
|
51
|
+
await wrapper.vm.$nextTick()
|
|
52
|
+
expect(wrapper.vm.updateAppendToBody).toHaveBeenCalled()
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
it('react accordingly on mouse over', async () => {
|
|
56
|
+
const trigger = wrapper.find({ ref: 'trigger' })
|
|
57
|
+
trigger.trigger('mouseenter')
|
|
58
|
+
expect(wrapper.vm.isHoverable).toBeFalsy()
|
|
59
|
+
|
|
60
|
+
await wrapper.setProps({ triggers: ['hover'] })
|
|
61
|
+
trigger.trigger('mouseenter')
|
|
62
|
+
expect(wrapper.vm.isHoverable).toBeTruthy()
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
it('react accordingly when new item is selected', async () => {
|
|
66
|
+
wrapper.vm.selectItem(val1)
|
|
67
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
|
|
68
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([val1])
|
|
69
|
+
expect(wrapper.emitted().change).toHaveLength(1)
|
|
70
|
+
expect(wrapper.emitted().change[0]).toEqual([val1])
|
|
71
|
+
|
|
72
|
+
await wrapper.setProps({
|
|
73
|
+
triggers: ['hover'],
|
|
74
|
+
closeOnClick: true
|
|
75
|
+
})
|
|
76
|
+
|
|
77
|
+
wrapper.vm.selectItem(val2)
|
|
78
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(2)
|
|
79
|
+
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([val2])
|
|
80
|
+
expect(wrapper.emitted().change).toHaveLength(2)
|
|
81
|
+
expect(wrapper.emitted().change[1]).toEqual([val2])
|
|
82
|
+
|
|
83
|
+
expect(wrapper.vm.isHoverable).toBeFalsy()
|
|
84
|
+
})
|
|
85
|
+
|
|
86
|
+
it('react accordingly when same item is selected', async () => {
|
|
87
|
+
// will emit only input event
|
|
88
|
+
await wrapper.setProps({ modelValue: val1 })
|
|
89
|
+
wrapper.vm.selectItem(val1)
|
|
90
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
|
|
91
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([val1])
|
|
92
|
+
expect(wrapper.emitted().change).toBeUndefined()
|
|
93
|
+
})
|
|
94
|
+
|
|
95
|
+
it('react accordingly when an item is selected with multiple prop', async () => {
|
|
96
|
+
await wrapper.setProps({
|
|
97
|
+
multiple: true
|
|
98
|
+
})
|
|
99
|
+
await wrapper.setData({
|
|
100
|
+
selected: null
|
|
101
|
+
})
|
|
102
|
+
|
|
103
|
+
// no initial value, will return an array with the only selected option
|
|
104
|
+
wrapper.vm.selectItem(val1)
|
|
105
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(1)
|
|
106
|
+
expect(wrapper.emitted()['update:modelValue'][0]).toEqual([[val1]])
|
|
107
|
+
expect(wrapper.emitted().change).toHaveLength(1)
|
|
108
|
+
expect(wrapper.emitted().change[0]).toEqual([[val1]])
|
|
109
|
+
|
|
110
|
+
// will return an array with the new value appended
|
|
111
|
+
await wrapper.setProps({ modelValue: [val1] })
|
|
112
|
+
wrapper.vm.selectItem(val2)
|
|
113
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(2)
|
|
114
|
+
expect(wrapper.emitted()['update:modelValue'][1]).toEqual([[val1, val2]])
|
|
115
|
+
expect(wrapper.emitted().change).toHaveLength(2)
|
|
116
|
+
expect(wrapper.emitted().change[1]).toEqual([[val1, val2]])
|
|
117
|
+
|
|
118
|
+
// will remove the last selection since it was part of the list
|
|
119
|
+
await wrapper.setProps({ modelValue: [val1, val2] })
|
|
120
|
+
wrapper.vm.selectItem(val2)
|
|
121
|
+
expect(wrapper.emitted()['update:modelValue']).toHaveLength(3)
|
|
122
|
+
expect(wrapper.emitted()['update:modelValue'][2]).toEqual([[val1]])
|
|
123
|
+
expect(wrapper.emitted().change).toHaveLength(3)
|
|
124
|
+
expect(wrapper.emitted().change[2]).toEqual([[val1]])
|
|
125
|
+
})
|
|
126
|
+
|
|
127
|
+
it('manage the whitelisted items accordingly', () => {
|
|
128
|
+
let el = wrapper.vm.$refs.dropdownMenu as Element
|
|
129
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
|
|
130
|
+
|
|
131
|
+
el = (wrapper.vm.$refs.dropdownMenu as Element).querySelector('.dropdown-content')!
|
|
132
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
|
|
133
|
+
|
|
134
|
+
el = wrapper.vm.$refs.trigger as Element
|
|
135
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
|
|
136
|
+
|
|
137
|
+
el = (wrapper.vm.$refs.trigger as Element).querySelector('.trigger')!
|
|
138
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeTruthy()
|
|
139
|
+
|
|
140
|
+
el = document.createElement('div')
|
|
141
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeFalsy()
|
|
142
|
+
})
|
|
143
|
+
|
|
144
|
+
it('manage the whitelisted items accordingly without trigger (inline)', async () => {
|
|
145
|
+
const trigger = wrapper.vm.$refs.trigger as Element
|
|
146
|
+
expect(trigger).toBeTruthy()
|
|
147
|
+
const triggerEl = trigger.querySelector('.trigger')
|
|
148
|
+
expect(triggerEl).toBeTruthy()
|
|
149
|
+
|
|
150
|
+
await wrapper.setProps({ inline: true })
|
|
151
|
+
expect(wrapper.vm.$refs.trigger).toBeFalsy()
|
|
152
|
+
|
|
153
|
+
expect(wrapper.vm.isInWhiteList(trigger)).toBeFalsy()
|
|
154
|
+
expect(wrapper.vm.isInWhiteList(triggerEl)).toBeFalsy()
|
|
155
|
+
|
|
156
|
+
const el = document.createElement('div')
|
|
157
|
+
expect(wrapper.vm.isInWhiteList(el)).toBeFalsy()
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
it('manage clicking outside accordingly', async () => {
|
|
161
|
+
const el = document.createElement('div')
|
|
162
|
+
const event = new Event('click')
|
|
163
|
+
vi.spyOn(event, 'target', 'get').mockReturnValue(el)
|
|
164
|
+
|
|
165
|
+
await wrapper.setData({ isActive: true })
|
|
166
|
+
wrapper.vm.clickedOutside(event)
|
|
167
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
168
|
+
|
|
169
|
+
await wrapper.setData({ isActive: true })
|
|
170
|
+
const event2 = new Event('click')
|
|
171
|
+
vi.spyOn(event2, 'target', 'get').mockReturnValue(wrapper.vm.$refs.trigger as Element)
|
|
172
|
+
wrapper.vm.clickedOutside(event2)
|
|
173
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
174
|
+
|
|
175
|
+
await wrapper.setData({ isActive: true })
|
|
176
|
+
await wrapper.setProps({ inline: true })
|
|
177
|
+
wrapper.vm.clickedOutside(event)
|
|
178
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
179
|
+
|
|
180
|
+
await wrapper.setData({ isActive: true })
|
|
181
|
+
await wrapper.setProps({ canClose: false })
|
|
182
|
+
wrapper.vm.clickedOutside(event)
|
|
183
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
184
|
+
})
|
|
185
|
+
|
|
186
|
+
it('close on escape', async () => {
|
|
187
|
+
await wrapper.setData({ isActive: true })
|
|
188
|
+
const event = new KeyboardEvent('keyup', { key: 'Escape' })
|
|
189
|
+
wrapper.vm.keyPress({})
|
|
190
|
+
wrapper.vm.keyPress(event)
|
|
191
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
192
|
+
|
|
193
|
+
await wrapper.setData({ isActive: true })
|
|
194
|
+
await wrapper.setProps({ canClose: ['click'] })
|
|
195
|
+
wrapper.vm.keyPress(event)
|
|
196
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
197
|
+
})
|
|
198
|
+
|
|
199
|
+
it('manage toggle function accordingly', async () => {
|
|
200
|
+
await wrapper.setData({ isActive: true })
|
|
201
|
+
await wrapper.setProps({ disabled: true })
|
|
202
|
+
wrapper.vm.toggle()
|
|
203
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
204
|
+
|
|
205
|
+
await wrapper.setProps({ disabled: false })
|
|
206
|
+
wrapper.vm.toggle()
|
|
207
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
208
|
+
|
|
209
|
+
vi.useFakeTimers()
|
|
210
|
+
vi.spyOn(global, 'setTimeout')
|
|
211
|
+
await wrapper.setData({ isActive: false })
|
|
212
|
+
wrapper.vm.toggle()
|
|
213
|
+
await wrapper.vm.$nextTick()
|
|
214
|
+
expect(setTimeout).toHaveBeenCalled()
|
|
215
|
+
expect(wrapper.vm.isActive).toBeFalsy()
|
|
216
|
+
vi.advanceTimersByTime(1)
|
|
217
|
+
expect(wrapper.vm.isActive).toBeTruthy()
|
|
218
|
+
vi.useRealTimers()
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
it('reset events before destroy', () => {
|
|
222
|
+
document.removeEventListener = vi.fn()
|
|
223
|
+
|
|
224
|
+
wrapper.unmount()
|
|
225
|
+
|
|
226
|
+
expect(document.removeEventListener).toBeCalledWith('click', expect.any(Function))
|
|
227
|
+
expect(document.removeEventListener).toBeCalledWith('keyup', expect.any(Function))
|
|
228
|
+
})
|
|
229
|
+
})
|