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.
- package/LICENSE.md +21 -0
- package/README.md +242 -0
- package/dist/buefy.css +15895 -0
- package/dist/buefy.d.ts +11706 -0
- package/dist/buefy.esm.js +21082 -0
- package/dist/buefy.esm.min.js +2 -0
- package/dist/buefy.js +21227 -0
- package/dist/buefy.min.css +1 -0
- package/dist/buefy.min.js +2 -0
- package/dist/cjs/Autocomplete-BMmOsPiK.js +864 -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-DavX4iOv.js +170 -0
- 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-C9WVvcUL.js +666 -0
- package/dist/cjs/Tooltip-Cgighv0j.js +393 -0
- package/dist/cjs/_plugin-vue_export-helper-Die8u8yB.js +11 -0
- package/dist/cjs/autocomplete.js +23 -0
- package/dist/cjs/breadcrumb.js +107 -0
- package/dist/cjs/button.js +20 -0
- package/dist/cjs/carousel.js +825 -0
- package/dist/cjs/checkbox.js +88 -0
- package/dist/cjs/clockpicker.js +668 -0
- package/dist/cjs/collapse.js +99 -0
- package/dist/cjs/colorpicker.js +25 -0
- package/dist/cjs/config-DR826Ki2.js +103 -0
- package/dist/cjs/config.js +18 -0
- package/dist/cjs/datepicker.js +28 -0
- package/dist/cjs/datetimepicker.js +483 -0
- package/dist/cjs/dialog.js +506 -0
- package/dist/cjs/dropdown.js +23 -0
- package/dist/cjs/field.js +19 -0
- package/dist/cjs/helpers.js +276 -0
- package/dist/cjs/icon.js +19 -0
- package/dist/cjs/image.js +19 -0
- package/dist/cjs/index-DiQy3SCb.js +1942 -0
- package/dist/cjs/index.js +274 -0
- package/dist/cjs/input.js +22 -0
- package/dist/cjs/loading.js +87 -0
- package/dist/cjs/menu.js +340 -0
- package/dist/cjs/message.js +119 -0
- package/dist/cjs/modal.js +103 -0
- package/dist/cjs/navbar.js +572 -0
- package/dist/cjs/notification.js +281 -0
- package/dist/cjs/numberinput.js +386 -0
- package/dist/cjs/pagination.js +22 -0
- package/dist/cjs/plugins-DbyYGVpp.js +16 -0
- package/dist/cjs/progress.js +91 -0
- package/dist/cjs/radio.js +137 -0
- package/dist/cjs/rate.js +197 -0
- package/dist/cjs/select.js +22 -0
- package/dist/cjs/sidebar.js +309 -0
- package/dist/cjs/skeleton.js +78 -0
- package/dist/cjs/slider.js +699 -0
- package/dist/cjs/snackbar.js +224 -0
- package/dist/cjs/ssr-DVRFTu_P.js +8 -0
- package/dist/cjs/steps.js +347 -0
- package/dist/cjs/switch.js +161 -0
- package/dist/cjs/table.js +2391 -0
- package/dist/cjs/tabs.js +258 -0
- package/dist/cjs/tag.js +44 -0
- package/dist/cjs/taginput.js +425 -0
- package/dist/cjs/timepicker.js +29 -0
- package/dist/cjs/toast.js +162 -0
- package/dist/cjs/tooltip.js +19 -0
- package/dist/cjs/trapFocus-BlX6xykt.js +53 -0
- package/dist/cjs/upload.js +195 -0
- package/dist/components/autocomplete/index.js +1647 -0
- package/dist/components/autocomplete/index.min.js +2 -0
- package/dist/components/breadcrumb/index.js +173 -0
- package/dist/components/breadcrumb/index.min.js +2 -0
- package/dist/components/button/index.js +334 -0
- package/dist/components/button/index.min.js +2 -0
- package/dist/components/carousel/index.js +1534 -0
- package/dist/components/carousel/index.min.js +2 -0
- package/dist/components/checkbox/index.js +236 -0
- package/dist/components/checkbox/index.min.js +2 -0
- package/dist/components/clockpicker/index.js +2636 -0
- package/dist/components/clockpicker/index.min.js +2 -0
- package/dist/components/collapse/index.js +111 -0
- package/dist/components/collapse/index.min.js +2 -0
- package/dist/components/colorpicker/index.js +4251 -0
- package/dist/components/colorpicker/index.min.js +2 -0
- package/dist/components/datepicker/index.js +4110 -0
- package/dist/components/datepicker/index.min.js +2 -0
- package/dist/components/datetimepicker/index.js +5479 -0
- package/dist/components/datetimepicker/index.min.js +2 -0
- package/dist/components/dialog/index.js +1202 -0
- package/dist/components/dialog/index.min.js +2 -0
- package/dist/components/dropdown/index.js +680 -0
- package/dist/components/dropdown/index.min.js +2 -0
- package/dist/components/field/index.js +439 -0
- package/dist/components/field/index.min.js +2 -0
- package/dist/components/icon/index.js +212 -0
- package/dist/components/icon/index.min.js +2 -0
- package/dist/components/image/index.js +396 -0
- package/dist/components/image/index.min.js +2 -0
- package/dist/components/input/index.js +764 -0
- package/dist/components/input/index.min.js +2 -0
- package/dist/components/loading/index.js +280 -0
- package/dist/components/loading/index.min.js +2 -0
- package/dist/components/menu/index.js +586 -0
- package/dist/components/menu/index.min.js +2 -0
- package/dist/components/message/index.js +611 -0
- package/dist/components/message/index.min.js +2 -0
- package/dist/components/modal/index.js +516 -0
- package/dist/components/modal/index.min.js +2 -0
- package/dist/components/navbar/index.js +634 -0
- package/dist/components/navbar/index.min.js +2 -0
- package/dist/components/notification/index.js +976 -0
- package/dist/components/notification/index.min.js +2 -0
- package/dist/components/numberinput/index.js +1128 -0
- package/dist/components/numberinput/index.min.js +2 -0
- package/dist/components/pagination/index.js +764 -0
- package/dist/components/pagination/index.min.js +2 -0
- package/dist/components/progress/index.js +280 -0
- package/dist/components/progress/index.min.js +2 -0
- package/dist/components/radio/index.js +208 -0
- package/dist/components/radio/index.min.js +2 -0
- package/dist/components/rate/index.js +391 -0
- package/dist/components/rate/index.min.js +2 -0
- package/dist/components/select/index.js +560 -0
- package/dist/components/select/index.min.js +2 -0
- package/dist/components/sidebar/index.js +337 -0
- package/dist/components/sidebar/index.min.js +2 -0
- package/dist/components/skeleton/index.js +87 -0
- package/dist/components/skeleton/index.min.js +2 -0
- package/dist/components/slider/index.js +1171 -0
- package/dist/components/slider/index.min.js +2 -0
- package/dist/components/snackbar/index.js +439 -0
- package/dist/components/snackbar/index.min.js +2 -0
- package/dist/components/steps/index.js +925 -0
- package/dist/components/steps/index.min.js +2 -0
- package/dist/components/switch/index.js +182 -0
- package/dist/components/switch/index.min.js +2 -0
- package/dist/components/table/index.js +4208 -0
- package/dist/components/table/index.min.js +2 -0
- package/dist/components/tabs/index.js +837 -0
- package/dist/components/tabs/index.min.js +2 -0
- package/dist/components/tag/index.js +396 -0
- package/dist/components/tag/index.min.js +2 -0
- package/dist/components/taginput/index.js +2209 -0
- package/dist/components/taginput/index.min.js +2 -0
- package/dist/components/timepicker/index.js +2906 -0
- package/dist/components/timepicker/index.min.js +2 -0
- package/dist/components/toast/index.js +377 -0
- package/dist/components/toast/index.min.js +2 -0
- package/dist/components/tooltip/index.js +445 -0
- package/dist/components/tooltip/index.min.js +2 -0
- package/dist/components/upload/index.js +426 -0
- package/dist/components/upload/index.min.js +2 -0
- package/dist/esm/Autocomplete-CjbTh9D8.js +862 -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-Bikh6_Fg.js +664 -0
- package/dist/esm/Tooltip-CtDSXAqa.js +391 -0
- package/dist/esm/_plugin-vue_export-helper-OJRSZE6i.js +9 -0
- package/dist/esm/autocomplete.js +18 -0
- package/dist/esm/breadcrumb.js +101 -0
- package/dist/esm/button.js +15 -0
- package/dist/esm/carousel.js +818 -0
- package/dist/esm/checkbox.js +82 -0
- package/dist/esm/clockpicker.js +663 -0
- package/dist/esm/collapse.js +94 -0
- package/dist/esm/colorpicker.js +16 -0
- package/dist/esm/config-CKuo-p6e.js +100 -0
- package/dist/esm/config.js +14 -0
- package/dist/esm/datepicker.js +23 -0
- package/dist/esm/datetimepicker.js +478 -0
- package/dist/esm/dialog.js +500 -0
- package/dist/esm/dropdown.js +17 -0
- package/dist/esm/field.js +14 -0
- package/dist/esm/helpers.js +247 -0
- package/dist/esm/icon.js +14 -0
- package/dist/esm/image.js +14 -0
- package/dist/esm/index-CQegEsxK.js +1938 -0
- package/dist/esm/index.js +164 -0
- package/dist/esm/input.js +17 -0
- package/dist/esm/loading.js +81 -0
- package/dist/esm/menu.js +333 -0
- package/dist/esm/message.js +114 -0
- package/dist/esm/modal.js +97 -0
- package/dist/esm/navbar.js +565 -0
- package/dist/esm/notification.js +275 -0
- package/dist/esm/numberinput.js +381 -0
- package/dist/esm/pagination.js +16 -0
- package/dist/esm/plugins-B172kuKE.js +13 -0
- package/dist/esm/progress.js +85 -0
- package/dist/esm/radio.js +131 -0
- package/dist/esm/rate.js +192 -0
- package/dist/esm/select.js +17 -0
- package/dist/esm/sidebar.js +304 -0
- package/dist/esm/skeleton.js +73 -0
- package/dist/esm/slider.js +693 -0
- package/dist/esm/snackbar.js +218 -0
- package/dist/esm/ssr-C7yEpGLm.js +5 -0
- package/dist/esm/steps.js +341 -0
- package/dist/esm/switch.js +156 -0
- package/dist/esm/table.js +2385 -0
- package/dist/esm/tabs.js +252 -0
- package/dist/esm/tag.js +38 -0
- package/dist/esm/taginput.js +420 -0
- package/dist/esm/timepicker.js +24 -0
- package/dist/esm/toast.js +156 -0
- package/dist/esm/tooltip.js +14 -0
- package/dist/esm/trapFocus-KHP_kCNE.js +51 -0
- package/dist/esm/upload.js +190 -0
- package/dist/tsdoc-metadata.json +11 -0
- package/package.json +73 -6
- package/src/components/autocomplete/Autocomplete.spec.ts +783 -0
- package/src/components/autocomplete/Autocomplete.vue +966 -0
- package/src/components/autocomplete/__snapshots__/Autocomplete.spec.ts.snap +21 -0
- package/src/components/autocomplete/index.ts +16 -0
- package/src/components/breadcrumb/Breadcrumb.spec.ts +65 -0
- package/src/components/breadcrumb/Breadcrumb.vue +42 -0
- package/src/components/breadcrumb/BreadcrumbItem.spec.ts +74 -0
- package/src/components/breadcrumb/BreadcrumbItem.vue +34 -0
- 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.ts +19 -0
- package/src/components/button/Button.spec.ts +117 -0
- package/src/components/button/Button.vue +112 -0
- package/src/components/button/__snapshots__/Button.spec.ts.snap +9 -0
- package/src/components/button/index.ts +16 -0
- package/src/components/carousel/Carousel.spec.ts +304 -0
- package/src/components/carousel/Carousel.vue +389 -0
- package/src/components/carousel/CarouselItem.spec.ts +105 -0
- package/src/components/carousel/CarouselItem.vue +38 -0
- package/src/components/carousel/CarouselList.spec.ts +172 -0
- package/src/components/carousel/CarouselList.vue +364 -0
- 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.ts +23 -0
- package/src/components/carousel/types.ts +17 -0
- package/src/components/checkbox/Checkbox.spec.ts +40 -0
- package/src/components/checkbox/Checkbox.vue +63 -0
- package/src/components/checkbox/CheckboxButton.spec.ts +46 -0
- package/src/components/checkbox/CheckboxButton.vue +59 -0
- 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.ts +20 -0
- package/src/components/clockpicker/Clockpicker.spec.ts +161 -0
- package/src/components/clockpicker/Clockpicker.vue +311 -0
- package/src/components/clockpicker/ClockpickerFace.spec.ts +99 -0
- package/src/components/clockpicker/ClockpickerFace.vue +272 -0
- package/src/components/clockpicker/__snapshots__/Clockpicker.spec.ts.snap +36 -0
- package/src/components/clockpicker/__snapshots__/ClockpickerFace.spec.ts.snap +9 -0
- package/src/components/clockpicker/index.ts +16 -0
- package/src/components/collapse/Collapse.spec.ts +106 -0
- package/src/components/collapse/Collapse.vue +98 -0
- package/src/components/collapse/__snapshots__/Collapse.spec.ts.snap +10 -0
- package/src/components/collapse/index.ts +16 -0
- package/src/components/colorpicker/Colorpicker.spec.ts +22 -0
- package/src/components/colorpicker/Colorpicker.vue +416 -0
- package/src/components/colorpicker/ColorpickerAlphaSlider.spec.ts +17 -0
- package/src/components/colorpicker/ColorpickerAlphaSlider.vue +205 -0
- package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.spec.ts +23 -0
- package/src/components/colorpicker/ColorpickerHSLRepresentationSquare.vue +380 -0
- package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.spec.ts +23 -0
- package/src/components/colorpicker/ColorpickerHSLRepresentationTriangle.vue +456 -0
- 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.ts.snap +36 -0
- package/src/components/colorpicker/index.ts +16 -0
- package/src/components/datepicker/Datepicker.spec.ts +482 -0
- package/src/components/datepicker/Datepicker.vue +908 -0
- package/src/components/datepicker/DatepickerMonth.spec.ts +346 -0
- package/src/components/datepicker/DatepickerMonth.vue +444 -0
- package/src/components/datepicker/DatepickerTable.spec.ts +290 -0
- package/src/components/datepicker/DatepickerTable.vue +398 -0
- package/src/components/datepicker/DatepickerTableRow.spec.ts +300 -0
- package/src/components/datepicker/DatepickerTableRow.vue +416 -0
- 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.ts.snap +16 -0
- package/src/components/datepicker/__snapshots__/DatepickerTableRow.spec.ts.snap +23 -0
- package/src/components/datepicker/index.ts +17 -0
- package/src/components/datepicker/types.ts +41 -0
- package/src/components/datetimepicker/Datetimepicker.spec.ts +132 -0
- package/src/components/datetimepicker/Datetimepicker.vue +491 -0
- package/src/components/datetimepicker/index.ts +16 -0
- package/src/components/dialog/Dialog.spec.ts +108 -0
- package/src/components/dialog/Dialog.vue +300 -0
- package/src/components/dialog/index.ts +169 -0
- package/src/components/dropdown/Dropdown.spec.ts +229 -0
- package/src/components/dropdown/Dropdown.vue +491 -0
- package/src/components/dropdown/DropdownItem.spec.ts +78 -0
- package/src/components/dropdown/DropdownItem.vue +112 -0
- 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.ts +20 -0
- package/src/components/field/Field.spec.ts +324 -0
- package/src/components/field/Field.vue +316 -0
- package/src/components/field/FieldBody.spec.ts +96 -0
- package/src/components/field/FieldBody.vue +74 -0
- 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.ts +16 -0
- package/src/components/icon/Icon.spec.ts +142 -0
- package/src/components/icon/Icon.vue +120 -0
- package/src/components/icon/__snapshots__/Icon.spec.ts.snap +3 -0
- package/src/components/icon/index.ts +17 -0
- package/src/components/image/Image.spec.ts +218 -0
- package/src/components/image/Image.vue +358 -0
- package/src/components/image/__snapshots__/Image.spec.ts.snap +37 -0
- package/src/components/image/index.ts +16 -0
- package/src/components/index.ts +179 -0
- package/src/components/input/Input.spec.ts +396 -0
- package/src/components/input/Input.vue +335 -0
- package/src/components/input/__snapshots__/Input.spec.ts.snap +9 -0
- package/src/components/input/index.ts +17 -0
- package/src/components/loading/Loading.spec.ts +151 -0
- package/src/components/loading/Loading.vue +135 -0
- 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 +31 -0
- package/src/components/menu/MenuItem.spec.ts +92 -0
- package/src/components/menu/MenuItem.vue +168 -0
- package/src/components/menu/MenuItemContainerMixin.ts +72 -0
- package/src/components/menu/MenuList.spec.ts +35 -0
- package/src/components/menu/MenuList.vue +47 -0
- 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.ts +25 -0
- package/src/components/message/Message.spec.ts +30 -0
- package/src/components/message/Message.vue +73 -0
- package/src/components/message/__snapshots__/Message.spec.ts.snap +11 -0
- package/src/components/message/index.ts +15 -0
- package/src/components/modal/Modal.spec.ts +167 -0
- package/src/components/modal/Modal.vue +335 -0
- 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.ts +78 -0
- package/src/components/navbar/NavBarBurger.spec.ts +30 -0
- package/src/components/navbar/NavBarItem.spec.ts +92 -0
- package/src/components/navbar/Navbar.vue +274 -0
- package/src/components/navbar/NavbarBurger.vue +29 -0
- package/src/components/navbar/NavbarDropdown.spec.ts +84 -0
- package/src/components/navbar/NavbarDropdown.vue +115 -0
- package/src/components/navbar/NavbarItem.vue +97 -0
- 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.ts +22 -0
- package/src/components/notification/Notification.spec.ts +21 -0
- package/src/components/notification/Notification.vue +77 -0
- package/src/components/notification/NotificationNotice.vue +76 -0
- 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.ts +445 -0
- package/src/components/numberinput/Numberinput.vue +372 -0
- package/src/components/numberinput/index.ts +16 -0
- package/src/components/pagination/Pagination.spec.ts +94 -0
- package/src/components/pagination/Pagination.vue +434 -0
- package/src/components/pagination/PaginationButton.spec.ts +42 -0
- package/src/components/pagination/PaginationButton.vue +59 -0
- 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.ts +19 -0
- package/src/components/pagination/types.ts +11 -0
- package/src/components/progress/Progress.spec.ts +81 -0
- package/src/components/progress/Progress.vue +168 -0
- package/src/components/progress/ProgressBar.spec.ts +45 -0
- package/src/components/progress/ProgressBar.vue +74 -0
- 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.ts +18 -0
- package/src/components/radio/Radio.spec.ts +40 -0
- package/src/components/radio/Radio.vue +35 -0
- package/src/components/radio/RadioButton.spec.ts +40 -0
- package/src/components/radio/RadioButton.vue +69 -0
- 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.ts +18 -0
- package/src/components/rate/Rate.spec.ts +90 -0
- package/src/components/rate/Rate.vue +158 -0
- package/src/components/rate/index.ts +15 -0
- package/src/components/select/Select.spec.ts +74 -0
- package/src/components/select/Select.vue +118 -0
- package/src/components/select/__snapshots__/Select.spec.ts.snap +7 -0
- package/src/components/select/index.ts +16 -0
- package/src/components/sidebar/Sidebar.spec.ts +107 -0
- package/src/components/sidebar/Sidebar.vue +316 -0
- package/src/components/sidebar/__snapshots__/Sidebar.spec.ts.snap +25 -0
- package/src/components/sidebar/index.ts +16 -0
- package/src/components/skeleton/Skeleton.spec.ts +16 -0
- package/src/components/skeleton/Skeleton.vue +98 -0
- 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 +374 -0
- package/src/components/slider/SliderThumb.spec.ts +176 -0
- package/src/components/slider/SliderThumb.vue +251 -0
- package/src/components/slider/SliderTick.spec.ts +33 -0
- package/src/components/slider/SliderTick.vue +50 -0
- 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.ts +19 -0
- package/src/components/slider/types.ts +34 -0
- package/src/components/snackbar/Snackbar.spec.ts +35 -0
- package/src/components/snackbar/Snackbar.vue +88 -0
- 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 +26 -0
- package/src/components/steps/Steps.spec.ts +125 -0
- package/src/components/steps/Steps.vue +273 -0
- 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.ts +19 -0
- package/src/components/switch/Switch.spec.ts +74 -0
- package/src/components/switch/Switch.vue +146 -0
- package/src/components/switch/__snapshots__/Switch.spec.ts.snap +3 -0
- package/src/components/switch/index.ts +16 -0
- package/src/components/table/Table.spec.ts +622 -0
- package/src/components/table/Table.vue +1770 -0
- package/src/components/table/TableColumn.spec.ts +85 -0
- package/src/components/table/TableColumn.vue +140 -0
- package/src/components/table/TableMobileSort.spec.ts +47 -0
- package/src/components/table/TableMobileSort.vue +236 -0
- package/src/components/table/TablePagination.vue +86 -0
- 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.ts +32 -0
- 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 +19 -0
- package/src/components/tabs/Tabs.spec.ts +122 -0
- package/src/components/tabs/Tabs.vue +204 -0
- 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.ts +19 -0
- package/src/components/tag/Tag.spec.ts +32 -0
- package/src/components/tag/Tag.vue +132 -0
- package/src/components/tag/Taglist.spec.ts +21 -0
- package/src/components/tag/Taglist.vue +16 -0
- 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.ts +19 -0
- package/src/components/taginput/Taginput.spec.ts +132 -0
- package/src/components/taginput/Taginput.vue +415 -0
- package/src/components/taginput/__snapshots__/Taginput.spec.ts.snap +10 -0
- package/src/components/taginput/index.ts +16 -0
- package/src/components/timepicker/Timepicker.spec.ts +108 -0
- package/src/components/timepicker/Timepicker.vue +183 -0
- package/src/components/timepicker/__snapshots__/Timepicker.spec.ts.snap +41 -0
- package/src/components/timepicker/index.ts +17 -0
- package/src/components/toast/Toast.spec.ts +74 -0
- package/src/components/toast/Toast.vue +46 -0
- 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 +393 -0
- package/src/components/tooltip/__snapshots__/Tooltip.spec.ts.snap +12 -0
- package/src/components/tooltip/index.ts +16 -0
- package/src/components/upload/Upload.spec.ts +62 -0
- package/src/components/upload/Upload.vue +188 -0
- package/src/components/upload/__snapshots__/Upload.spec.ts.snap +3 -0
- package/src/components/upload/index.ts +15 -0
- package/src/directives/clickOutside.ts +113 -0
- package/src/directives/trapFocus.ts +61 -0
- package/src/index.ts +43 -0
- package/src/scss/buefy-build.scss +6 -0
- package/src/scss/buefy.scss +39 -0
- package/src/scss/components/_autocomplete.scss +39 -0
- package/src/scss/components/_carousel.scss +204 -0
- package/src/scss/components/_checkbox.scss +106 -0
- package/src/scss/components/_clockpicker.scss +283 -0
- package/src/scss/components/_collapse.scss +9 -0
- package/src/scss/components/_colorpicker.scss +283 -0
- package/src/scss/components/_datepicker.scss +220 -0
- package/src/scss/components/_dialog.scss +54 -0
- package/src/scss/components/_dropdown.scss +143 -0
- package/src/scss/components/_form.scss +309 -0
- package/src/scss/components/_icon.scss +16 -0
- package/src/scss/components/_image.scss +20 -0
- package/src/scss/components/_loading.scss +45 -0
- package/src/scss/components/_menu.scss +11 -0
- package/src/scss/components/_message.scss +16 -0
- package/src/scss/components/_modal.scss +37 -0
- package/src/scss/components/_navbar.scss +22 -0
- package/src/scss/components/_notices.scss +144 -0
- package/src/scss/components/_notification.scss +8 -0
- package/src/scss/components/_numberinput.scss +33 -0
- package/src/scss/components/_pagination.scss +63 -0
- package/src/scss/components/_progress.scss +105 -0
- package/src/scss/components/_radio.scss +123 -0
- package/src/scss/components/_rate.scss +72 -0
- package/src/scss/components/_select.scss +38 -0
- package/src/scss/components/_sidebar.scss +107 -0
- package/src/scss/components/_skeleton.scss +66 -0
- package/src/scss/components/_slider.scss +162 -0
- package/src/scss/components/_steps.scss +491 -0
- package/src/scss/components/_switch.scss +214 -0
- package/src/scss/components/_table.scss +322 -0
- package/src/scss/components/_tabs.scss +197 -0
- package/src/scss/components/_tag.scss +36 -0
- package/src/scss/components/_taginput.scss +73 -0
- package/src/scss/components/_timepicker.scss +73 -0
- package/src/scss/components/_tooltip.scss +192 -0
- package/src/scss/components/_upload.scss +62 -0
- package/src/scss/utils/_all.scss +4 -0
- package/src/scss/utils/_animations.scss +183 -0
- package/src/scss/utils/_functions.scss +49 -0
- package/src/scss/utils/_helpers.scss +6 -0
- package/src/scss/utils/_variables-ext.scss +2 -0
- package/src/scss/utils/_variables.scss +16 -0
- 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.ts +12 -0
- package/src/utils/FormElementMixin.spec.ts +41 -0
- package/src/utils/FormElementMixin.ts +206 -0
- package/src/utils/InjectedChildMixin.ts +139 -0
- package/src/utils/MessageMixin.spec.ts +51 -0
- package/src/utils/MessageMixin.ts +138 -0
- package/src/utils/NoticeMixin.spec.ts +55 -0
- package/src/utils/NoticeMixin.ts +181 -0
- 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.ts +767 -0
- package/src/utils/color.spec.ts +55 -0
- package/src/utils/color.ts +507 -0
- package/src/utils/config.spec.ts +11 -0
- package/src/utils/config.ts +619 -0
- package/src/utils/debounce.spec.ts +52 -0
- 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.ts +73 -0
- package/src/utils/plugins.ts +20 -0
- package/src/utils/ssr.ts +6 -0
- package/src/utils/vue-augmentation.ts +35 -0
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="b-clockpicker control"
|
|
4
|
+
:class="[size, type, {'is-expanded': expanded}]"
|
|
5
|
+
v-bind="rootAttrs"
|
|
6
|
+
>
|
|
7
|
+
<b-dropdown
|
|
8
|
+
v-if="!isMobile || inline"
|
|
9
|
+
ref="dropdown"
|
|
10
|
+
:position="position"
|
|
11
|
+
:disabled="disabledOrUndefined"
|
|
12
|
+
:inline="inline"
|
|
13
|
+
:mobile-modal="mobileModal"
|
|
14
|
+
:append-to-body="appendToBody"
|
|
15
|
+
append-to-body-copy-parent
|
|
16
|
+
@active-change="onActiveChange"
|
|
17
|
+
>
|
|
18
|
+
<template #trigger v-if="!inline">
|
|
19
|
+
<slot name="trigger">
|
|
20
|
+
<b-input
|
|
21
|
+
ref="input"
|
|
22
|
+
autocomplete="off"
|
|
23
|
+
:model-value="formatValue(computedValue)"
|
|
24
|
+
:placeholder="placeholder"
|
|
25
|
+
:size="size"
|
|
26
|
+
:icon="icon"
|
|
27
|
+
:icon-pack="iconPack"
|
|
28
|
+
:loading="loading"
|
|
29
|
+
:disabled="disabledOrUndefined"
|
|
30
|
+
:readonly="!editable"
|
|
31
|
+
:rounded="rounded"
|
|
32
|
+
v-bind="fallthroughAttrs"
|
|
33
|
+
:use-html5-validation="useHtml5Validation"
|
|
34
|
+
@click="onInputClick"
|
|
35
|
+
@keyup.enter="toggle(true)"
|
|
36
|
+
@change="onChange($event.target.value)"
|
|
37
|
+
@focus="handleOnFocus"
|
|
38
|
+
@blur="checkHtml5Validity()"
|
|
39
|
+
/>
|
|
40
|
+
</slot>
|
|
41
|
+
</template>
|
|
42
|
+
<div
|
|
43
|
+
class="card"
|
|
44
|
+
:disabled="disabledOrUndefined"
|
|
45
|
+
custom
|
|
46
|
+
>
|
|
47
|
+
<header v-if="inline" class="card-header">
|
|
48
|
+
<div class="b-clockpicker-header card-header-title">
|
|
49
|
+
<div class="b-clockpicker-time">
|
|
50
|
+
<span
|
|
51
|
+
class="b-clockpicker-btn"
|
|
52
|
+
:class="{ active: isSelectingHour }"
|
|
53
|
+
@click="isSelectingHour = true"
|
|
54
|
+
>{{ hoursDisplay }}</span>
|
|
55
|
+
<span>{{ hourLiteral }}</span>
|
|
56
|
+
<span
|
|
57
|
+
class="b-clockpicker-btn"
|
|
58
|
+
:class="{ active: !isSelectingHour }"
|
|
59
|
+
@click="isSelectingHour = false"
|
|
60
|
+
>{{ minutesDisplay }}</span>
|
|
61
|
+
</div>
|
|
62
|
+
<div v-if="!isHourFormat24" class="b-clockpicker-period">
|
|
63
|
+
<div
|
|
64
|
+
class="b-clockpicker-btn"
|
|
65
|
+
:class="{
|
|
66
|
+
active: meridienSelected === amString || meridienSelected === AM
|
|
67
|
+
}"
|
|
68
|
+
@click="onMeridienClick(amString)"
|
|
69
|
+
>
|
|
70
|
+
{{ amString }}
|
|
71
|
+
</div>
|
|
72
|
+
<div
|
|
73
|
+
class="b-clockpicker-btn"
|
|
74
|
+
:class="{
|
|
75
|
+
active: meridienSelected === pmString || meridienSelected === PM
|
|
76
|
+
}"
|
|
77
|
+
@click="onMeridienClick(pmString)"
|
|
78
|
+
>
|
|
79
|
+
{{ pmString }}
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
</header>
|
|
84
|
+
<div class="card-content">
|
|
85
|
+
<div
|
|
86
|
+
class="b-clockpicker-body"
|
|
87
|
+
:style="{ width: faceSize + 'px', height: faceSize + 'px' }"
|
|
88
|
+
>
|
|
89
|
+
<div v-if="!inline" class="b-clockpicker-time">
|
|
90
|
+
<div
|
|
91
|
+
class="b-clockpicker-btn"
|
|
92
|
+
:class="{ active: isSelectingHour }"
|
|
93
|
+
@click="isSelectingHour = true"
|
|
94
|
+
>
|
|
95
|
+
{{ hoursLabel }}
|
|
96
|
+
</div>
|
|
97
|
+
<span
|
|
98
|
+
class="b-clockpicker-btn"
|
|
99
|
+
:class="{ active: !isSelectingHour }"
|
|
100
|
+
@click="isSelectingHour = false"
|
|
101
|
+
>{{ minutesLabel }}</span>
|
|
102
|
+
</div>
|
|
103
|
+
<div v-if="!isHourFormat24 && !inline" class="b-clockpicker-period">
|
|
104
|
+
<div
|
|
105
|
+
class="b-clockpicker-btn"
|
|
106
|
+
:class="{
|
|
107
|
+
active: meridienSelected === amString || meridienSelected === AM
|
|
108
|
+
}"
|
|
109
|
+
@click="onMeridienClick(amString)"
|
|
110
|
+
>
|
|
111
|
+
{{ amString }}
|
|
112
|
+
</div>
|
|
113
|
+
<div
|
|
114
|
+
class="b-clockpicker-btn"
|
|
115
|
+
:class="{
|
|
116
|
+
active: meridienSelected === pmString || meridienSelected === PM
|
|
117
|
+
}"
|
|
118
|
+
@click="onMeridienClick(pmString)"
|
|
119
|
+
>
|
|
120
|
+
{{ pmString }}
|
|
121
|
+
</div>
|
|
122
|
+
</div>
|
|
123
|
+
<b-clockpicker-face
|
|
124
|
+
ref="clockpickerFace"
|
|
125
|
+
:picker-size="faceSize"
|
|
126
|
+
:min="minFaceValue"
|
|
127
|
+
:max="maxFaceValue"
|
|
128
|
+
:face-numbers="isSelectingHour ? hours : minutes"
|
|
129
|
+
:disabled-values="faceDisabledValues"
|
|
130
|
+
:double="isSelectingHour && isHourFormat24"
|
|
131
|
+
:value="isSelectingHour
|
|
132
|
+
? hoursSelected ?? undefined
|
|
133
|
+
: minutesSelected ?? undefined"
|
|
134
|
+
@input="onClockInput"
|
|
135
|
+
@change="onClockChange"
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
</div>
|
|
139
|
+
<footer
|
|
140
|
+
v-if="$slots.default !== undefined && $slots.default([]).length"
|
|
141
|
+
class="b-clockpicker-footer card-footer"
|
|
142
|
+
>
|
|
143
|
+
<slot />
|
|
144
|
+
</footer>
|
|
145
|
+
</div>
|
|
146
|
+
</b-dropdown>
|
|
147
|
+
<b-input
|
|
148
|
+
v-else
|
|
149
|
+
ref="input"
|
|
150
|
+
type="time"
|
|
151
|
+
autocomplete="off"
|
|
152
|
+
:model-value="formatHHMMSS(computedValue)"
|
|
153
|
+
:placeholder="placeholder"
|
|
154
|
+
:size="size"
|
|
155
|
+
:icon="icon"
|
|
156
|
+
:icon-pack="iconPack"
|
|
157
|
+
:loading="loading"
|
|
158
|
+
:max="formatHHMMSS(maxTime)"
|
|
159
|
+
:min="formatHHMMSS(minTime)"
|
|
160
|
+
:disabled="disabledOrUndefined"
|
|
161
|
+
:readonly="false"
|
|
162
|
+
v-bind="fallthroughAttrs"
|
|
163
|
+
:use-html5-validation="useHtml5Validation"
|
|
164
|
+
@click.stop="toggle(true)"
|
|
165
|
+
@keyup.enter="toggle(true)"
|
|
166
|
+
@change="onChangeNativePicker"
|
|
167
|
+
@focus="handleOnFocus"
|
|
168
|
+
@blur="onBlur() && checkHtml5Validity()"
|
|
169
|
+
/>
|
|
170
|
+
</div>
|
|
171
|
+
</template>
|
|
172
|
+
|
|
173
|
+
<script lang="ts">
|
|
174
|
+
import { defineComponent } from 'vue'
|
|
175
|
+
|
|
176
|
+
import TimepickerMixin from '../../utils/TimepickerMixin'
|
|
177
|
+
import config from '../../utils/config'
|
|
178
|
+
|
|
179
|
+
import BDropdown from '../dropdown/Dropdown.vue'
|
|
180
|
+
import BInput from '../input/Input.vue'
|
|
181
|
+
|
|
182
|
+
import BClockpickerFace from './ClockpickerFace.vue'
|
|
183
|
+
|
|
184
|
+
type BDropdownInstance = InstanceType<typeof BDropdown>
|
|
185
|
+
|
|
186
|
+
const outerPadding = 12
|
|
187
|
+
|
|
188
|
+
export default defineComponent({
|
|
189
|
+
name: 'BClockpicker',
|
|
190
|
+
components: {
|
|
191
|
+
BClockpickerFace,
|
|
192
|
+
BInput,
|
|
193
|
+
BDropdown
|
|
194
|
+
},
|
|
195
|
+
mixins: [TimepickerMixin],
|
|
196
|
+
props: {
|
|
197
|
+
pickerSize: {
|
|
198
|
+
type: Number,
|
|
199
|
+
default: 290
|
|
200
|
+
},
|
|
201
|
+
incrementMinutes: {
|
|
202
|
+
type: Number,
|
|
203
|
+
default: 5
|
|
204
|
+
},
|
|
205
|
+
type: {
|
|
206
|
+
type: String,
|
|
207
|
+
default: 'is-primary'
|
|
208
|
+
},
|
|
209
|
+
hoursLabel: {
|
|
210
|
+
type: String,
|
|
211
|
+
default: () => config.defaultClockpickerHoursLabel || 'Hours'
|
|
212
|
+
},
|
|
213
|
+
minutesLabel: {
|
|
214
|
+
type: String,
|
|
215
|
+
default: () => config.defaultClockpickerMinutesLabel || 'Min'
|
|
216
|
+
}
|
|
217
|
+
},
|
|
218
|
+
data() {
|
|
219
|
+
return {
|
|
220
|
+
isSelectingHour: true,
|
|
221
|
+
isDragging: false,
|
|
222
|
+
_isClockpicker: true
|
|
223
|
+
}
|
|
224
|
+
},
|
|
225
|
+
computed: {
|
|
226
|
+
hoursDisplay() {
|
|
227
|
+
if (this.hoursSelected == null) return '--'
|
|
228
|
+
if (this.isHourFormat24) return this.pad(this.hoursSelected)
|
|
229
|
+
|
|
230
|
+
let display = this.hoursSelected
|
|
231
|
+
if (this.meridienSelected === this.pmString) {
|
|
232
|
+
display -= 12
|
|
233
|
+
}
|
|
234
|
+
if (display === 0) display = 12
|
|
235
|
+
return display
|
|
236
|
+
},
|
|
237
|
+
minutesDisplay() {
|
|
238
|
+
return this.minutesSelected == null ? '--' : this.pad(this.minutesSelected)
|
|
239
|
+
},
|
|
240
|
+
minFaceValue() {
|
|
241
|
+
return this.isSelectingHour &&
|
|
242
|
+
!this.isHourFormat24 &&
|
|
243
|
+
this.meridienSelected === this.pmString
|
|
244
|
+
? 12
|
|
245
|
+
: 0
|
|
246
|
+
},
|
|
247
|
+
maxFaceValue() {
|
|
248
|
+
return this.isSelectingHour
|
|
249
|
+
? (
|
|
250
|
+
!this.isHourFormat24 &&
|
|
251
|
+
this.meridienSelected === this.amString
|
|
252
|
+
? 11
|
|
253
|
+
: 23
|
|
254
|
+
)
|
|
255
|
+
: 59
|
|
256
|
+
},
|
|
257
|
+
faceSize() {
|
|
258
|
+
return this.pickerSize - (outerPadding * 2)
|
|
259
|
+
},
|
|
260
|
+
faceDisabledValues() {
|
|
261
|
+
return this.isSelectingHour ? this.isHourDisabled : this.isMinuteDisabled
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
methods: {
|
|
265
|
+
onClockInput(value: number) {
|
|
266
|
+
if (this.isSelectingHour) {
|
|
267
|
+
this.hoursSelected = value
|
|
268
|
+
this.onHoursChange(value)
|
|
269
|
+
} else {
|
|
270
|
+
this.minutesSelected = value
|
|
271
|
+
this.onMinutesChange(value)
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
onClockChange() {
|
|
275
|
+
if (this.isSelectingHour) {
|
|
276
|
+
this.isSelectingHour = !this.isSelectingHour
|
|
277
|
+
} else {
|
|
278
|
+
// Minutes selected, let's close the clockpicker
|
|
279
|
+
this.toggle(false)
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
/*
|
|
283
|
+
* Toggle clockpicker
|
|
284
|
+
*/
|
|
285
|
+
toggle(active: boolean) {
|
|
286
|
+
if (this.$refs.dropdown) {
|
|
287
|
+
const dropdown = this.$refs.dropdown as BDropdownInstance
|
|
288
|
+
dropdown.isActive = active ?? !dropdown.isActive
|
|
289
|
+
if (dropdown.isActive) {
|
|
290
|
+
// When opening the clockpicker, we always select the hour first
|
|
291
|
+
this.isSelectingHour = true
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
},
|
|
295
|
+
onMeridienClick(value: string) {
|
|
296
|
+
if (this.meridienSelected !== value) {
|
|
297
|
+
this.meridienSelected = value
|
|
298
|
+
this.onMeridienChange(value)
|
|
299
|
+
}
|
|
300
|
+
},
|
|
301
|
+
/*
|
|
302
|
+
* Avoid dropdown toggle when is already visible
|
|
303
|
+
*/
|
|
304
|
+
onInputClick(event: MouseEvent) {
|
|
305
|
+
if ((this.$refs.dropdown as BDropdownInstance).isActive) {
|
|
306
|
+
event.stopPropagation()
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
})
|
|
311
|
+
</script>
|
|
@@ -0,0 +1,99 @@
|
|
|
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 BClockpickerFace from '@components/clockpicker/ClockpickerFace.vue'
|
|
5
|
+
|
|
6
|
+
let wrapper: VueWrapper<InstanceType<typeof BClockpickerFace>>
|
|
7
|
+
const indicatorSize = 40
|
|
8
|
+
const paddingInner = 5
|
|
9
|
+
const pickerSize = 500
|
|
10
|
+
|
|
11
|
+
describe('BClockpickerFace', () => {
|
|
12
|
+
beforeEach(() => {
|
|
13
|
+
wrapper = shallowMount(BClockpickerFace, {
|
|
14
|
+
props: {
|
|
15
|
+
pickerSize,
|
|
16
|
+
min: 0,
|
|
17
|
+
max: 23
|
|
18
|
+
}
|
|
19
|
+
})
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('is called', () => {
|
|
23
|
+
expect(wrapper.vm).toBeTruthy()
|
|
24
|
+
expect(wrapper.vm.$options.name).toBe('BClockpickerFace')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('render correctly', () => {
|
|
28
|
+
expect(wrapper.html()).toMatchSnapshot()
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
it('returns countPerRing correctly', async () => {
|
|
32
|
+
const count = wrapper.vm.max! - wrapper.vm.min! + 1
|
|
33
|
+
expect(wrapper.vm.countPerRing).toEqual(count)
|
|
34
|
+
|
|
35
|
+
await wrapper.setProps({ double: true })
|
|
36
|
+
expect(wrapper.vm.countPerRing).toEqual(count / 2)
|
|
37
|
+
})
|
|
38
|
+
|
|
39
|
+
it('returns radius correctly', () => {
|
|
40
|
+
expect(wrapper.vm.radius).toEqual(pickerSize / 2)
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
it('returns outerRadius correctly', () => {
|
|
44
|
+
expect(wrapper.vm.outerRadius).toEqual((pickerSize / 2) -
|
|
45
|
+
paddingInner -
|
|
46
|
+
indicatorSize / 2)
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
it('returns innerRadius correctly', () => {
|
|
50
|
+
expect(wrapper.vm.innerRadius).toEqual(Math.max(wrapper.vm.outerRadius * 0.6,
|
|
51
|
+
wrapper.vm.outerRadius - paddingInner - indicatorSize))
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
it('returns degrees correctly', () => {
|
|
55
|
+
expect(wrapper.vm.degrees).toEqual(wrapper.vm.degreesPerUnit * Math.PI / 180)
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
it('set inputValue when value changed', async () => {
|
|
59
|
+
await wrapper.setData({ inputValue: 2 })
|
|
60
|
+
await wrapper.setProps({ value: 2 })
|
|
61
|
+
expect(wrapper.vm.inputValue).toEqual(2)
|
|
62
|
+
|
|
63
|
+
await wrapper.setProps({ value: 3 })
|
|
64
|
+
expect(wrapper.vm.inputValue).toEqual(3)
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
it('calls disabledValues function when isDisabled is called', async () => {
|
|
68
|
+
await wrapper.setProps({ disabledValues: vi.fn() })
|
|
69
|
+
wrapper.vm.isDisabled(2)
|
|
70
|
+
expect(wrapper.vm.disabledValues).toHaveBeenCalled()
|
|
71
|
+
})
|
|
72
|
+
|
|
73
|
+
it('manage onMouseDown', () => {
|
|
74
|
+
const e = {
|
|
75
|
+
preventDefault: vi.fn()
|
|
76
|
+
}
|
|
77
|
+
wrapper.vm.onDragMove = vi.fn()
|
|
78
|
+
wrapper.vm.onMouseDown(e as unknown as MouseEvent)
|
|
79
|
+
expect(e.preventDefault).toHaveBeenCalled()
|
|
80
|
+
expect(wrapper.vm.isDragging).toBeTruthy()
|
|
81
|
+
expect(wrapper.vm.onDragMove).toHaveBeenCalled()
|
|
82
|
+
})
|
|
83
|
+
|
|
84
|
+
it('manage onMouseUp', () => {
|
|
85
|
+
wrapper.vm.onMouseUp()
|
|
86
|
+
expect(wrapper.vm.isDragging).toBeFalsy()
|
|
87
|
+
})
|
|
88
|
+
|
|
89
|
+
it('manage onDragMove', async () => {
|
|
90
|
+
const e = {
|
|
91
|
+
preventDefault: vi.fn()
|
|
92
|
+
}
|
|
93
|
+
await wrapper.setData({ isDragging: true })
|
|
94
|
+
wrapper.vm.update = vi.fn()
|
|
95
|
+
wrapper.vm.onDragMove(e as unknown as MouseEvent)
|
|
96
|
+
expect(e.preventDefault).toHaveBeenCalled()
|
|
97
|
+
expect(wrapper.vm.update).toHaveBeenCalled()
|
|
98
|
+
})
|
|
99
|
+
})
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="b-clockpicker-face"
|
|
4
|
+
@mousedown="onMouseDown"
|
|
5
|
+
@mouseup="onMouseUp"
|
|
6
|
+
@mousemove="onDragMove"
|
|
7
|
+
@touchstart="onMouseDown"
|
|
8
|
+
@touchend="onMouseUp"
|
|
9
|
+
@touchmove="onDragMove"
|
|
10
|
+
>
|
|
11
|
+
<div
|
|
12
|
+
class="b-clockpicker-face-outer-ring"
|
|
13
|
+
ref="clock"
|
|
14
|
+
>
|
|
15
|
+
<div
|
|
16
|
+
class="b-clockpicker-face-hand"
|
|
17
|
+
:style="handStyle"
|
|
18
|
+
/>
|
|
19
|
+
<span
|
|
20
|
+
v-for="(num, index) of faceNumbers"
|
|
21
|
+
:key="index"
|
|
22
|
+
class="b-clockpicker-face-number"
|
|
23
|
+
:class="getFaceNumberClasses(num)"
|
|
24
|
+
:style="{ transform: getNumberTranslate(num.value) }"
|
|
25
|
+
>
|
|
26
|
+
<span>{{ num.label }}</span>
|
|
27
|
+
</span>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<script lang="ts">
|
|
33
|
+
import { defineComponent } from 'vue'
|
|
34
|
+
|
|
35
|
+
// These should match the variables in clockpicker.scss
|
|
36
|
+
const indicatorSize = 40
|
|
37
|
+
const paddingInner = 5
|
|
38
|
+
|
|
39
|
+
export interface FaceNumber {
|
|
40
|
+
value: number
|
|
41
|
+
label: string
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
interface Point {
|
|
45
|
+
x: number
|
|
46
|
+
y: number
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export default defineComponent({
|
|
50
|
+
name: 'BClockpickerFace',
|
|
51
|
+
props: {
|
|
52
|
+
pickerSize: Number,
|
|
53
|
+
min: Number,
|
|
54
|
+
max: Number,
|
|
55
|
+
double: Boolean,
|
|
56
|
+
value: Number,
|
|
57
|
+
faceNumbers: Array<FaceNumber>,
|
|
58
|
+
disabledValues: Function
|
|
59
|
+
},
|
|
60
|
+
emits: {
|
|
61
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
62
|
+
change: (_value: number | undefined) => true,
|
|
63
|
+
input: (_value: number) => true
|
|
64
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
65
|
+
},
|
|
66
|
+
data() {
|
|
67
|
+
return {
|
|
68
|
+
isDragging: false,
|
|
69
|
+
inputValue: this.value,
|
|
70
|
+
prevAngle: 720
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
computed: {
|
|
74
|
+
/*
|
|
75
|
+
* How many number indicators are shown on the face
|
|
76
|
+
*/
|
|
77
|
+
count() {
|
|
78
|
+
return this.max! - this.min! + 1
|
|
79
|
+
},
|
|
80
|
+
/*
|
|
81
|
+
* How many number indicators are shown per ring on the face
|
|
82
|
+
*/
|
|
83
|
+
countPerRing() {
|
|
84
|
+
return this.double ? (this.count / 2) : this.count
|
|
85
|
+
},
|
|
86
|
+
/*
|
|
87
|
+
* Radius of the clock face
|
|
88
|
+
*/
|
|
89
|
+
radius() {
|
|
90
|
+
return this.pickerSize! / 2
|
|
91
|
+
},
|
|
92
|
+
/*
|
|
93
|
+
* Radius of the outer ring of number indicators
|
|
94
|
+
*/
|
|
95
|
+
outerRadius() {
|
|
96
|
+
return this.radius -
|
|
97
|
+
paddingInner -
|
|
98
|
+
indicatorSize / 2
|
|
99
|
+
},
|
|
100
|
+
/*
|
|
101
|
+
* Radius of the inner ring of number indicators
|
|
102
|
+
*/
|
|
103
|
+
innerRadius() {
|
|
104
|
+
return Math.max(this.outerRadius * 0.6,
|
|
105
|
+
this.outerRadius - paddingInner - indicatorSize)
|
|
106
|
+
// 48px gives enough room for the outer ring of numbers
|
|
107
|
+
},
|
|
108
|
+
/*
|
|
109
|
+
* The angle for each selectable value
|
|
110
|
+
* For hours this ends up being 30 degrees, for minutes 6 degrees
|
|
111
|
+
*/
|
|
112
|
+
degreesPerUnit() {
|
|
113
|
+
return 360 / this.countPerRing
|
|
114
|
+
},
|
|
115
|
+
/*
|
|
116
|
+
* Used for calculating x/y grid location based on degrees
|
|
117
|
+
*/
|
|
118
|
+
degrees() {
|
|
119
|
+
return this.degreesPerUnit * Math.PI / 180
|
|
120
|
+
},
|
|
121
|
+
/*
|
|
122
|
+
* Calculates the angle the clock hand should be rotated for the
|
|
123
|
+
* selected value
|
|
124
|
+
*/
|
|
125
|
+
handRotateAngle() {
|
|
126
|
+
let currentAngle = this.prevAngle
|
|
127
|
+
while (currentAngle < 0) currentAngle += 360
|
|
128
|
+
const targetAngle = this.calcHandAngle(this.displayedValue)
|
|
129
|
+
const degreesDiff = this.shortestDistanceDegrees(currentAngle, targetAngle)
|
|
130
|
+
const angle = this.prevAngle + degreesDiff
|
|
131
|
+
return angle
|
|
132
|
+
},
|
|
133
|
+
/*
|
|
134
|
+
* Determines how long the selector hand is based on if the
|
|
135
|
+
* selected value is located along the outer or inner ring
|
|
136
|
+
*/
|
|
137
|
+
handScale() {
|
|
138
|
+
return this.calcHandScale(this.displayedValue)
|
|
139
|
+
},
|
|
140
|
+
handStyle() {
|
|
141
|
+
return {
|
|
142
|
+
transform: `rotate(${this.handRotateAngle}deg) scaleY(${this.handScale})`,
|
|
143
|
+
transition: '.3s cubic-bezier(.25,.8,.50,1)'
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
/*
|
|
147
|
+
* The value the hand should be pointing at
|
|
148
|
+
*/
|
|
149
|
+
displayedValue() {
|
|
150
|
+
return this.inputValue == null ? this.min! : this.inputValue
|
|
151
|
+
}
|
|
152
|
+
},
|
|
153
|
+
watch: {
|
|
154
|
+
value(value) {
|
|
155
|
+
if (value !== this.inputValue) {
|
|
156
|
+
this.prevAngle = this.handRotateAngle
|
|
157
|
+
}
|
|
158
|
+
this.inputValue = value
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
methods: {
|
|
162
|
+
isDisabled(value: number) {
|
|
163
|
+
return this.disabledValues && this.disabledValues(value)
|
|
164
|
+
},
|
|
165
|
+
/*
|
|
166
|
+
* Calculates the distance between two points
|
|
167
|
+
*/
|
|
168
|
+
euclidean(p0: Point, p1: Point) {
|
|
169
|
+
const dx = p1.x - p0.x
|
|
170
|
+
const dy = p1.y - p0.y
|
|
171
|
+
|
|
172
|
+
return Math.sqrt(dx * dx + dy * dy)
|
|
173
|
+
},
|
|
174
|
+
shortestDistanceDegrees(start: number, stop: number) {
|
|
175
|
+
const modDiff = (stop - start) % 360
|
|
176
|
+
const shortestDistance = 180 - Math.abs(Math.abs(modDiff) - 180)
|
|
177
|
+
return (modDiff + 360) % 360 < 180 ? shortestDistance * 1 : shortestDistance * -1
|
|
178
|
+
},
|
|
179
|
+
/*
|
|
180
|
+
* Calculates the angle of the line from the center point
|
|
181
|
+
* to the given point.
|
|
182
|
+
*/
|
|
183
|
+
coordToAngle(center: Point, p1: Point) {
|
|
184
|
+
const value = 2 *
|
|
185
|
+
Math.atan2(p1.y - center.y - this.euclidean(center, p1), p1.x - center.x)
|
|
186
|
+
return Math.abs(value * 180 / Math.PI)
|
|
187
|
+
},
|
|
188
|
+
/*
|
|
189
|
+
* Generates the inline style translate() property for a
|
|
190
|
+
* number indicator, which determines it's location on the
|
|
191
|
+
* clock face
|
|
192
|
+
*/
|
|
193
|
+
getNumberTranslate(value: number) {
|
|
194
|
+
const { x, y } = this.getNumberCoords(value)
|
|
195
|
+
return `translate(${x}px, ${y}px)`
|
|
196
|
+
},
|
|
197
|
+
/*
|
|
198
|
+
* Calculates the coordinates on the clock face for a number
|
|
199
|
+
* indicator value
|
|
200
|
+
*/
|
|
201
|
+
getNumberCoords(value: number) {
|
|
202
|
+
const radius = this.isInnerRing(value) ? this.innerRadius : this.outerRadius
|
|
203
|
+
return {
|
|
204
|
+
x: Math.round(radius * Math.sin((value - this.min!) * this.degrees)),
|
|
205
|
+
y: Math.round(-radius * Math.cos((value - this.min!) * this.degrees))
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
getFaceNumberClasses(num: FaceNumber) {
|
|
209
|
+
return {
|
|
210
|
+
active: num.value === this.displayedValue,
|
|
211
|
+
disabled: this.isDisabled(num.value)
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
/*
|
|
215
|
+
* Determines if a value resides on the inner ring
|
|
216
|
+
*/
|
|
217
|
+
isInnerRing(value: number) {
|
|
218
|
+
return this.double && (value - this.min! >= this.countPerRing)
|
|
219
|
+
},
|
|
220
|
+
calcHandAngle(value: number) {
|
|
221
|
+
let angle = this.degreesPerUnit * (value - this.min!)
|
|
222
|
+
if (this.isInnerRing(value)) angle -= 360
|
|
223
|
+
return angle
|
|
224
|
+
},
|
|
225
|
+
calcHandScale(value: number) {
|
|
226
|
+
return this.isInnerRing(value)
|
|
227
|
+
? ((this.innerRadius) / this.outerRadius)
|
|
228
|
+
: 1
|
|
229
|
+
},
|
|
230
|
+
onMouseDown(e: MouseEvent | TouchEvent) {
|
|
231
|
+
e.preventDefault()
|
|
232
|
+
this.isDragging = true
|
|
233
|
+
this.onDragMove(e)
|
|
234
|
+
},
|
|
235
|
+
onMouseUp() {
|
|
236
|
+
this.isDragging = false
|
|
237
|
+
if (!this.isDisabled(this.inputValue!)) {
|
|
238
|
+
this.$emit('change', this.inputValue)
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
onDragMove(e: MouseEvent | TouchEvent) {
|
|
242
|
+
e.preventDefault()
|
|
243
|
+
if (!this.isDragging && e.type !== 'click') return
|
|
244
|
+
|
|
245
|
+
const { width, top, left } = (this.$refs.clock as HTMLElement).getBoundingClientRect()
|
|
246
|
+
const { clientX, clientY } = 'touches' in e ? e.touches[0] : e
|
|
247
|
+
const center = { x: width / 2, y: -width / 2 }
|
|
248
|
+
const coords = { x: clientX - left, y: top - clientY }
|
|
249
|
+
const handAngle = Math.round(this.coordToAngle(center, coords) + 360) % 360
|
|
250
|
+
const insideClick = this.double && this.euclidean(center, coords) <
|
|
251
|
+
(this.outerRadius + this.innerRadius) / 2 - 16
|
|
252
|
+
|
|
253
|
+
let value = Math.round(handAngle / this.degreesPerUnit) +
|
|
254
|
+
this.min! +
|
|
255
|
+
(insideClick ? this.countPerRing : 0)
|
|
256
|
+
|
|
257
|
+
// Necessary to fix edge case when selecting left part of max value
|
|
258
|
+
if (handAngle >= (360 - this.degreesPerUnit / 2)) {
|
|
259
|
+
value = insideClick ? this.max! : this.min!
|
|
260
|
+
}
|
|
261
|
+
this.update(value)
|
|
262
|
+
},
|
|
263
|
+
update(value: number) {
|
|
264
|
+
if (this.inputValue !== value && !this.isDisabled(value)) {
|
|
265
|
+
this.prevAngle = this.handRotateAngle
|
|
266
|
+
this.inputValue = value
|
|
267
|
+
this.$emit('input', value)
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
})
|
|
272
|
+
</script>
|