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,527 @@
|
|
|
1
|
+
import { Comment, Fragment, Static, Text } from 'vue'
|
|
2
|
+
import type { App, ComponentPublicInstance, VNode } from 'vue'
|
|
3
|
+
|
|
4
|
+
// augments Vue App to deal with plugins
|
|
5
|
+
declare module '@vue/runtime-core' {
|
|
6
|
+
interface App {
|
|
7
|
+
// introduced by vue-i18n
|
|
8
|
+
__VUE_I18N_SYMBOL__?: symbol
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
// Type utility that extracts props type from a component constructor.
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
14
|
+
export type ExtractComponentProps<T> = T extends { new (...args: any[]): infer U }
|
|
15
|
+
// I thought `U extends ComponentPublicInstance<infer P>` would work,
|
|
16
|
+
// but it didn't
|
|
17
|
+
? U extends { $props: infer P }
|
|
18
|
+
// makes fields of `$props` mutable and optional
|
|
19
|
+
? { -readonly [Key in keyof P]?: P[Key] }
|
|
20
|
+
: Record<string, never>
|
|
21
|
+
: Record<string, never>
|
|
22
|
+
|
|
23
|
+
// Type utility that extracts data type from a component constructor.
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
25
|
+
export type ExtractComponentData<T> = T extends { new (...args: any[]): infer U }
|
|
26
|
+
// I thought `U extends ComponentPublicInstance<infer D>` would work,
|
|
27
|
+
// but it didn't
|
|
28
|
+
? U extends { $data: infer D }
|
|
29
|
+
// makes fields of `$data` optional
|
|
30
|
+
? { [Key in keyof D]?: D[Key] }
|
|
31
|
+
: Record<string, never>
|
|
32
|
+
: Record<string, never>
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* +/- function to native math sign
|
|
36
|
+
*
|
|
37
|
+
* @internal
|
|
38
|
+
*/
|
|
39
|
+
function signPoly(value: number): number {
|
|
40
|
+
if (value < 0) return -1
|
|
41
|
+
return value > 0 ? 1 : 0
|
|
42
|
+
}
|
|
43
|
+
export const sign = Math.sign || signPoly
|
|
44
|
+
|
|
45
|
+
/*
|
|
46
|
+
* Checks if the flag is set
|
|
47
|
+
* @param val
|
|
48
|
+
* @param flag
|
|
49
|
+
* @returns {boolean}
|
|
50
|
+
*
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export function hasFlag(val: number, flag: number): boolean {
|
|
54
|
+
return (val & flag) === flag
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/*
|
|
58
|
+
* Native modulo bug with negative numbers
|
|
59
|
+
* @param n
|
|
60
|
+
* @param mod
|
|
61
|
+
* @returns {number}
|
|
62
|
+
*
|
|
63
|
+
* @internal
|
|
64
|
+
*/
|
|
65
|
+
export function mod(n: number, mod: number): number {
|
|
66
|
+
return ((n % mod) + mod) % mod
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/*
|
|
70
|
+
* Asserts a value is beetween min and max
|
|
71
|
+
* @param val
|
|
72
|
+
* @param min
|
|
73
|
+
* @param max
|
|
74
|
+
* @returns {number}
|
|
75
|
+
*
|
|
76
|
+
* @internal
|
|
77
|
+
*/
|
|
78
|
+
export function bound(val: number, min: number, max: number): number {
|
|
79
|
+
return Math.max(min, Math.min(max, val))
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/*
|
|
83
|
+
* Get value of an object property/path even if it's nested
|
|
84
|
+
*/
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
86
|
+
export function getValueByPath(obj: any, path: string): any {
|
|
87
|
+
return path.split('.').reduce((o, i) => o ? o[i] : null, obj)
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* Extension of indexOf method by equality function if specified
|
|
92
|
+
*
|
|
93
|
+
* @internal
|
|
94
|
+
*/
|
|
95
|
+
export function indexOf<T>(
|
|
96
|
+
array: T[] | null | undefined,
|
|
97
|
+
obj: T,
|
|
98
|
+
fn?: (a: T, b: T) => boolean
|
|
99
|
+
): number {
|
|
100
|
+
if (!array) return -1
|
|
101
|
+
|
|
102
|
+
if (!fn || typeof fn !== 'function') return array.indexOf(obj)
|
|
103
|
+
|
|
104
|
+
for (let i = 0; i < array.length; i++) {
|
|
105
|
+
if (fn(array[i], obj)) {
|
|
106
|
+
return i
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
return -1
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Deep partial type.
|
|
114
|
+
//
|
|
115
|
+
// There are some edge cases where this type is not sufficient in general,
|
|
116
|
+
// but it works for this library.
|
|
117
|
+
// https://stackoverflow.com/questions/61132262/typescript-deep-partial
|
|
118
|
+
type DeepPartial<T> = { [K in keyof T]?: DeepPartial<T[K]> }
|
|
119
|
+
|
|
120
|
+
/*
|
|
121
|
+
* Merge function to replace Object.assign with deep merging possibility
|
|
122
|
+
*
|
|
123
|
+
* @internal
|
|
124
|
+
*/
|
|
125
|
+
const isObject = (item: unknown) => typeof item === 'object' && !Array.isArray(item)
|
|
126
|
+
const mergeFn = <T>(
|
|
127
|
+
target: { [K in keyof T]: T[K] },
|
|
128
|
+
source: DeepPartial<T>,
|
|
129
|
+
deep = false
|
|
130
|
+
): { [K in keyof T]: T[K] } => {
|
|
131
|
+
if (deep || !Object.assign) {
|
|
132
|
+
const isDeep = (prop: keyof T) =>
|
|
133
|
+
isObject(source[prop]) &&
|
|
134
|
+
target !== null &&
|
|
135
|
+
Object.prototype.hasOwnProperty.call(target, prop) &&
|
|
136
|
+
isObject(target[prop])
|
|
137
|
+
const replaced = (Object.getOwnPropertyNames(source) as (keyof T)[])
|
|
138
|
+
.map((prop) => ({
|
|
139
|
+
[prop]: isDeep(prop)
|
|
140
|
+
? mergeFn<T[keyof T]>(target[prop], source[prop] || {}, deep)
|
|
141
|
+
: source[prop]
|
|
142
|
+
}))
|
|
143
|
+
.reduce(
|
|
144
|
+
(a, b) => ({ ...a, ...b }),
|
|
145
|
+
// eslint-disable-next-line no-use-before-define
|
|
146
|
+
{}
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
return {
|
|
150
|
+
...target,
|
|
151
|
+
...replaced
|
|
152
|
+
}
|
|
153
|
+
} else {
|
|
154
|
+
return Object.assign(target, source)
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
export const merge = mergeFn
|
|
158
|
+
|
|
159
|
+
/*
|
|
160
|
+
* Mobile detection
|
|
161
|
+
* https://www.abeautifulsite.net/detecting-mobile-devices-with-javascript
|
|
162
|
+
*
|
|
163
|
+
* @internal
|
|
164
|
+
*/
|
|
165
|
+
export const isMobile = {
|
|
166
|
+
Android: function () {
|
|
167
|
+
return (
|
|
168
|
+
typeof window !== 'undefined' &&
|
|
169
|
+
window.navigator.userAgent.match(/Android/i)
|
|
170
|
+
)
|
|
171
|
+
},
|
|
172
|
+
BlackBerry: function () {
|
|
173
|
+
return (
|
|
174
|
+
typeof window !== 'undefined' &&
|
|
175
|
+
window.navigator.userAgent.match(/BlackBerry/i)
|
|
176
|
+
)
|
|
177
|
+
},
|
|
178
|
+
iOS: function () {
|
|
179
|
+
return (
|
|
180
|
+
typeof window !== 'undefined' &&
|
|
181
|
+
(window.navigator.userAgent.match(/iPhone|iPad|iPod/i) ||
|
|
182
|
+
(window.navigator.platform === 'MacIntel' &&
|
|
183
|
+
window.navigator.maxTouchPoints > 1))
|
|
184
|
+
)
|
|
185
|
+
},
|
|
186
|
+
Opera: function () {
|
|
187
|
+
return (
|
|
188
|
+
typeof window !== 'undefined' &&
|
|
189
|
+
window.navigator.userAgent.match(/Opera Mini/i)
|
|
190
|
+
)
|
|
191
|
+
},
|
|
192
|
+
Windows: function () {
|
|
193
|
+
return (
|
|
194
|
+
typeof window !== 'undefined' &&
|
|
195
|
+
window.navigator.userAgent.match(/IEMobile/i)
|
|
196
|
+
)
|
|
197
|
+
},
|
|
198
|
+
any: function () {
|
|
199
|
+
return (
|
|
200
|
+
isMobile.Android() ||
|
|
201
|
+
isMobile.BlackBerry() ||
|
|
202
|
+
isMobile.iOS() ||
|
|
203
|
+
isMobile.Opera() ||
|
|
204
|
+
isMobile.Windows()
|
|
205
|
+
)
|
|
206
|
+
}
|
|
207
|
+
} as const
|
|
208
|
+
|
|
209
|
+
export function removeElement(el: Element) {
|
|
210
|
+
if (typeof el.remove !== 'undefined') {
|
|
211
|
+
el.remove()
|
|
212
|
+
} else if (typeof el.parentNode !== 'undefined' && el.parentNode !== null) {
|
|
213
|
+
el.parentNode.removeChild(el)
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function createAbsoluteElement(el: Element): HTMLElement {
|
|
218
|
+
const root = document.createElement('div')
|
|
219
|
+
root.style.position = 'absolute'
|
|
220
|
+
root.style.left = '0px'
|
|
221
|
+
root.style.top = '0px'
|
|
222
|
+
root.style.width = '100%'
|
|
223
|
+
const wrapper = document.createElement('div')
|
|
224
|
+
root.appendChild(wrapper)
|
|
225
|
+
wrapper.appendChild(el)
|
|
226
|
+
document.body.appendChild(root)
|
|
227
|
+
return root
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
export function isVueComponent(c: unknown): c is ComponentPublicInstance {
|
|
231
|
+
return c != null &&
|
|
232
|
+
(c as ComponentPublicInstance).$ != null &&
|
|
233
|
+
(c as ComponentPublicInstance).$.vnode != null
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
/*
|
|
237
|
+
* Escape regex characters
|
|
238
|
+
* http://stackoverflow.com/a/6969486
|
|
239
|
+
*
|
|
240
|
+
* @internal
|
|
241
|
+
*/
|
|
242
|
+
export function escapeRegExpChars(value: string | null | undefined): string | null | undefined {
|
|
243
|
+
if (!value) return value
|
|
244
|
+
|
|
245
|
+
// eslint-disable-next-line
|
|
246
|
+
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&')
|
|
247
|
+
}
|
|
248
|
+
/*
|
|
249
|
+
* Remove accents/diacritics in a string in JavaScript
|
|
250
|
+
* https://stackoverflow.com/a/37511463
|
|
251
|
+
*
|
|
252
|
+
* @internal
|
|
253
|
+
*/
|
|
254
|
+
export function removeDiacriticsFromString(value: string): string {
|
|
255
|
+
if (!value) return value
|
|
256
|
+
|
|
257
|
+
return value.normalize('NFD').replace(/[\u0300-\u036f]/g, '')
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface MultiColumnSortPriority<T> {
|
|
261
|
+
field?: string
|
|
262
|
+
order: 'asc' | 'desc'
|
|
263
|
+
customSort?: (a: Record<string, T>, b: Record<string, T>, isAscending: boolean) => number
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export function multiColumnSort<T>(
|
|
267
|
+
inputArray: Record<string, T>[],
|
|
268
|
+
sortingPriority: MultiColumnSortPriority<T>[]
|
|
269
|
+
): Record<string, T>[] {
|
|
270
|
+
// NOTE: this function is intended to be used by BTable
|
|
271
|
+
// clone it to prevent the any watchers from triggering every sorting iteration
|
|
272
|
+
const array: Record<string, T>[] = JSON.parse(JSON.stringify(inputArray))
|
|
273
|
+
const fieldSorter = (fields: MultiColumnSortPriority<T>[]) => (
|
|
274
|
+
a: Record<string, T>,
|
|
275
|
+
b: Record<string, T>
|
|
276
|
+
) => fields.map((o) => {
|
|
277
|
+
const { field, order, customSort } = o
|
|
278
|
+
if (typeof customSort === 'function') {
|
|
279
|
+
return customSort(a, b, order !== 'desc')
|
|
280
|
+
} else {
|
|
281
|
+
const aValue = getValueByPath(a, field!)
|
|
282
|
+
const bValue = getValueByPath(b, field!)
|
|
283
|
+
const ord = aValue > bValue ? 1 : aValue < bValue ? -1 : 0
|
|
284
|
+
return order === 'desc' ? -ord : ord
|
|
285
|
+
}
|
|
286
|
+
}).reduce((p, n) => p || n, 0)
|
|
287
|
+
|
|
288
|
+
return array.sort(fieldSorter(sortingPriority))
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
export function createNewEvent(eventName: string): Event {
|
|
292
|
+
let event
|
|
293
|
+
if (typeof Event === 'function') {
|
|
294
|
+
event = new Event(eventName)
|
|
295
|
+
} else {
|
|
296
|
+
event = document.createEvent('Event')
|
|
297
|
+
event.initEvent(eventName, true, true)
|
|
298
|
+
}
|
|
299
|
+
return event
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function toCssWidth(width: number | string | undefined): string | null {
|
|
303
|
+
return width === undefined ? null : (isNaN(+width) ? `${width}` : width + 'px')
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/*
|
|
307
|
+
* Return month names according to a specified locale
|
|
308
|
+
* @param {String} locale A bcp47 localerouter. undefined will use the user browser locale
|
|
309
|
+
* @param {String} format long (ex. March), short (ex. Mar) or narrow (M)
|
|
310
|
+
* @return {Array<String>} An array of month names
|
|
311
|
+
*
|
|
312
|
+
* @internal
|
|
313
|
+
*/
|
|
314
|
+
export function getMonthNames(locale?: string | string[], format: Intl.DateTimeFormatOptions['month'] = 'long'): string[] {
|
|
315
|
+
const dates = []
|
|
316
|
+
for (let i = 0; i < 12; i++) {
|
|
317
|
+
dates.push(new Date(2000, i, 15))
|
|
318
|
+
}
|
|
319
|
+
const dtf = new Intl.DateTimeFormat(locale, {
|
|
320
|
+
month: format
|
|
321
|
+
})
|
|
322
|
+
return dates.map((d) => dtf.format(d))
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/*
|
|
326
|
+
* Return weekday names according to a specified locale
|
|
327
|
+
* @param {String} locale A bcp47 localerouter. undefined will use the user browser locale
|
|
328
|
+
* @param {String} format long (ex. Thursday), short (ex. Thu) or narrow (T)
|
|
329
|
+
* @return {Array<String>} An array of weekday names
|
|
330
|
+
*
|
|
331
|
+
* @internal
|
|
332
|
+
*/
|
|
333
|
+
export function getWeekdayNames(locale?: string | string[], format: Intl.DateTimeFormatOptions['weekday'] = 'narrow'): string[] {
|
|
334
|
+
const dates = []
|
|
335
|
+
for (let i = 0; i < 7; i++) {
|
|
336
|
+
const dt = new Date(2000, 0, i + 1)
|
|
337
|
+
dates[dt.getDay()] = dt
|
|
338
|
+
}
|
|
339
|
+
const dtf = new Intl.DateTimeFormat(locale, { weekday: format })
|
|
340
|
+
return dates.map((d) => dtf.format(d))
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/*
|
|
344
|
+
* Accept a regex with group names and return an object
|
|
345
|
+
* ex. matchWithGroups(/((?!=<year>)\d+)\/((?!=<month>)\d+)\/((?!=<day>)\d+)/, '2000/12/25')
|
|
346
|
+
* will return { year: 2000, month: 12, day: 25 }
|
|
347
|
+
* @param {String} includes injections of (?!={groupname}) for each group
|
|
348
|
+
* @param {String} the string to run regex
|
|
349
|
+
* @return {Object} an object with a property for each group having the group's match as the value
|
|
350
|
+
* @throws {RangeError} if `pattern` does not contain any group.
|
|
351
|
+
*
|
|
352
|
+
* @internal
|
|
353
|
+
*/
|
|
354
|
+
export function matchWithGroups(pattern: string, str: string): Record<string, string | null> {
|
|
355
|
+
const matches = str.match(pattern)
|
|
356
|
+
const groupNames = pattern.toString().match(/<(.+?)>/g)
|
|
357
|
+
if (groupNames == null) {
|
|
358
|
+
throw new RangeError('pattern must contain at least one group')
|
|
359
|
+
}
|
|
360
|
+
return groupNames
|
|
361
|
+
// remove the braces
|
|
362
|
+
.map((group) => {
|
|
363
|
+
const groupMatches = group.match(/<(.+)>/)
|
|
364
|
+
// @ts-expect-error - groupMatches should never be null
|
|
365
|
+
return groupMatches[1]
|
|
366
|
+
})
|
|
367
|
+
// create an object with a property for each group having the group's match as the value
|
|
368
|
+
.reduce((acc, curr, index) => {
|
|
369
|
+
if (matches && matches.length > index) {
|
|
370
|
+
acc[curr] = matches[index + 1]
|
|
371
|
+
} else {
|
|
372
|
+
acc[curr] = null
|
|
373
|
+
}
|
|
374
|
+
return acc
|
|
375
|
+
}, {} as Record<string, string | null>)
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
/*
|
|
379
|
+
* Based on
|
|
380
|
+
* https://github.com/fregante/supports-webp
|
|
381
|
+
*
|
|
382
|
+
* @internal
|
|
383
|
+
*/
|
|
384
|
+
export function isWebpSupported(): Promise<boolean> {
|
|
385
|
+
return new Promise<boolean>((resolve) => {
|
|
386
|
+
const image = new Image()
|
|
387
|
+
image.onerror = () => resolve(false)
|
|
388
|
+
image.onload = () => resolve(image.width === 1)
|
|
389
|
+
image.src = 'data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoBAAEAAwA0JaQAA3AA/vuUAAA='
|
|
390
|
+
}).catch(() => false)
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
// only `$root` of a component instance is our concern.
|
|
394
|
+
// we may face type errors if we use `ComponentPublicInstance` directly.
|
|
395
|
+
export function isCustomElement(vm: Pick<ComponentPublicInstance, '$root'>) {
|
|
396
|
+
return vm.$root != null && 'shadowRoot' in vm.$root.$options
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export const isDefined = <T>(d: T | undefined): d is T => d !== undefined
|
|
400
|
+
|
|
401
|
+
/*
|
|
402
|
+
* Checks if a value is null or undefined.
|
|
403
|
+
* Based on
|
|
404
|
+
* https://github.com/lodash/lodash/blob/master/isNil.js
|
|
405
|
+
*
|
|
406
|
+
* @internal
|
|
407
|
+
*/
|
|
408
|
+
export const isNil = (value: unknown) => value === null || value === undefined
|
|
409
|
+
|
|
410
|
+
export function isFragment(vnode: VNode): boolean {
|
|
411
|
+
return vnode.type === Fragment
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
// TODO: replacement of vnode.tag test
|
|
415
|
+
export function isTag(vnode: VNode): boolean {
|
|
416
|
+
return vnode.type !== Comment &&
|
|
417
|
+
vnode.type !== Text &&
|
|
418
|
+
vnode.type !== Static
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
// references
|
|
422
|
+
// - https://github.com/vuejs/core/blob/1c525f75a3d17a6356d5f66765623c0ae7c0ebcc/packages/runtime-core/src/apiCreateApp.ts#L361
|
|
423
|
+
// - https://github.com/vuejs/core/blob/1c525f75a3d17a6356d5f66765623c0ae7c0ebcc/packages/runtime-core/src/component.ts#L1036-L1054
|
|
424
|
+
//
|
|
425
|
+
// we cannot access getExposeProxy since it is not exported from `vue`, though,
|
|
426
|
+
// its purpose seems to be one-time initialization of component.exposeProxy,
|
|
427
|
+
// which should have been done by this function call
|
|
428
|
+
export function getComponentFromVNode(
|
|
429
|
+
vnode: VNode
|
|
430
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
431
|
+
): ComponentPublicInstance | Record<string, any> | null | undefined {
|
|
432
|
+
if (!vnode) {
|
|
433
|
+
return undefined
|
|
434
|
+
}
|
|
435
|
+
const { component } = vnode
|
|
436
|
+
if (!component) {
|
|
437
|
+
return undefined
|
|
438
|
+
}
|
|
439
|
+
return (component.exposed && component.exposeProxy) || component.proxy
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
// Copies the context from a given app to another app.
|
|
443
|
+
//
|
|
444
|
+
// This function is necessary to programmatically mount a component; e.g.,
|
|
445
|
+
// Modal.
|
|
446
|
+
// Since Vue 3's app can mount only one component, we have to create a new app
|
|
447
|
+
// to mount another new component.
|
|
448
|
+
// If we create a new app with `createApp` API, no context (e.g., installed
|
|
449
|
+
// components, directives) is available on the new app.
|
|
450
|
+
// This function can copy the context from the host app to the new app.
|
|
451
|
+
//
|
|
452
|
+
// Depends on what Vue internally does: https://github.com/vuejs/core/blob/b775b71c788499ec7ee58bc2cf4cd04ed388e072/packages/runtime-core/src/apiCreateApp.ts#L170-L190
|
|
453
|
+
//
|
|
454
|
+
// This function also should take care of compatiblity with other plugins.
|
|
455
|
+
// We need a generic solution, though, it fixes compatiblity issues of
|
|
456
|
+
// individual plugins for now.
|
|
457
|
+
export function copyAppContext(src: App, dest: App) {
|
|
458
|
+
// replacing _context won't work because methods of app bypasses app._context
|
|
459
|
+
const { _context: srcContext } = src
|
|
460
|
+
const { _context: destContext } = dest
|
|
461
|
+
destContext.config = srcContext.config
|
|
462
|
+
destContext.mixins = srcContext.mixins
|
|
463
|
+
destContext.components = srcContext.components
|
|
464
|
+
destContext.directives = srcContext.directives
|
|
465
|
+
destContext.provides = srcContext.provides
|
|
466
|
+
// @ts-expect-error - optionsCache is internal field
|
|
467
|
+
destContext.optionsCache = srcContext.optionsCache
|
|
468
|
+
// @ts-expect-error - propsCache is internal field
|
|
469
|
+
destContext.propsCache = srcContext.propsCache
|
|
470
|
+
// @ts-expect-error - emitsCache is internal field
|
|
471
|
+
destContext.emitsCache = srcContext.emitsCache
|
|
472
|
+
// vue-i18n support: https://github.com/ntohq/buefy-next/issues/153
|
|
473
|
+
if ('__VUE_I18N_SYMBOL__' in src) {
|
|
474
|
+
dest.__VUE_I18N_SYMBOL__ = src.__VUE_I18N_SYMBOL__
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/* Options for `translateTouchAsDragEvent`. */
|
|
479
|
+
export interface TranslateTouchAsDragEventOptions {
|
|
480
|
+
type: 'dragstart' | 'dragend' | 'drop' | 'dragover' | 'dragleave'
|
|
481
|
+
target?: Element
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/*
|
|
485
|
+
* Translates a touch event as a drag event.
|
|
486
|
+
*
|
|
487
|
+
* `event` must be a touch event.
|
|
488
|
+
*
|
|
489
|
+
* `options` must be an object with the following properties:
|
|
490
|
+
* - `type`: new event type (required). must be one of the following:
|
|
491
|
+
* - `"dragstart"`
|
|
492
|
+
* - `"dragend"`
|
|
493
|
+
* - `"drop"`
|
|
494
|
+
* - `"dragover"`
|
|
495
|
+
* - `"dragleave"`
|
|
496
|
+
* - `target`: new target element (optional). `clientX` and `clientY` will be
|
|
497
|
+
* translated if `target` is different from `event.target`.
|
|
498
|
+
*
|
|
499
|
+
* This function only works with single-touch events for now.
|
|
500
|
+
*/
|
|
501
|
+
export const translateTouchAsDragEvent = (
|
|
502
|
+
event: TouchEvent,
|
|
503
|
+
options: TranslateTouchAsDragEventOptions
|
|
504
|
+
) => {
|
|
505
|
+
const { type, target } = options
|
|
506
|
+
let translateX = 0
|
|
507
|
+
let translateY = 0
|
|
508
|
+
if (target != null && target !== event.target) {
|
|
509
|
+
const baseRect = (event.target! as HTMLElement).getBoundingClientRect()
|
|
510
|
+
const targetRect = target.getBoundingClientRect()
|
|
511
|
+
translateX = targetRect.left - baseRect.left
|
|
512
|
+
translateY = targetRect.top - baseRect.top
|
|
513
|
+
}
|
|
514
|
+
const touch = event.touches[0] || event.changedTouches[0]
|
|
515
|
+
return new DragEvent(type, {
|
|
516
|
+
dataTransfer: new DataTransfer(),
|
|
517
|
+
bubbles: true,
|
|
518
|
+
screenX: touch.screenX,
|
|
519
|
+
screenY: touch.screenY,
|
|
520
|
+
clientX: touch.clientX + translateX,
|
|
521
|
+
clientY: touch.clientY + translateY,
|
|
522
|
+
ctrlKey: event.ctrlKey,
|
|
523
|
+
shiftKey: event.shiftKey,
|
|
524
|
+
altKey: event.altKey,
|
|
525
|
+
metaKey: event.metaKey
|
|
526
|
+
})
|
|
527
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import config, { type IconPack } from '../utils/config'
|
|
2
|
+
import { merge } from '../utils/helpers'
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Internally used {@link IconPack} type.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type InternalIconPack = IconPack & {
|
|
10
|
+
/* Maps icon names to equivalent ones in MDI. */
|
|
11
|
+
internalIcons: Record<string, string>
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const mdiIcons: IconPack = {
|
|
15
|
+
sizes: {
|
|
16
|
+
default: 'mdi-24px',
|
|
17
|
+
'is-small': null,
|
|
18
|
+
'is-medium': 'mdi-36px',
|
|
19
|
+
'is-large': 'mdi-48px'
|
|
20
|
+
},
|
|
21
|
+
iconPrefix: 'mdi-'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const faIcons: () => InternalIconPack = () => {
|
|
25
|
+
const faIconPrefix = config && config.defaultIconComponent ? '' : 'fa-'
|
|
26
|
+
return {
|
|
27
|
+
sizes: {
|
|
28
|
+
default: null,
|
|
29
|
+
'is-small': null,
|
|
30
|
+
'is-medium': faIconPrefix + 'lg',
|
|
31
|
+
'is-large': faIconPrefix + '2x'
|
|
32
|
+
},
|
|
33
|
+
iconPrefix: faIconPrefix,
|
|
34
|
+
internalIcons: {
|
|
35
|
+
information: 'info-circle',
|
|
36
|
+
alert: 'exclamation-triangle',
|
|
37
|
+
'alert-circle': 'exclamation-circle',
|
|
38
|
+
'chevron-right': 'angle-right',
|
|
39
|
+
'chevron-left': 'angle-left',
|
|
40
|
+
'chevron-down': 'angle-down',
|
|
41
|
+
'eye-off': 'eye-slash',
|
|
42
|
+
'menu-down': 'caret-down',
|
|
43
|
+
'menu-up': 'caret-up',
|
|
44
|
+
'close-circle': 'times-circle'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const getIcons: () => Record<string, IconPack> = () => {
|
|
50
|
+
let icons: Record<string, IconPack> = {
|
|
51
|
+
mdi: mdiIcons,
|
|
52
|
+
fa: faIcons(),
|
|
53
|
+
fas: faIcons(),
|
|
54
|
+
far: faIcons(),
|
|
55
|
+
fad: faIcons(),
|
|
56
|
+
fab: faIcons(),
|
|
57
|
+
fal: faIcons(),
|
|
58
|
+
'fa-solid': faIcons(),
|
|
59
|
+
'fa-regular': faIcons(),
|
|
60
|
+
'fa-light': faIcons(),
|
|
61
|
+
'fa-thin': faIcons(),
|
|
62
|
+
'fa-duotone': faIcons(),
|
|
63
|
+
'fa-brands': faIcons()
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (config && config.customIconPacks) {
|
|
67
|
+
icons = merge<Record<string, IconPack>>(icons, config.customIconPacks, true)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return icons
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export default getIcons
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { App, Component } from 'vue'
|
|
2
|
+
|
|
3
|
+
// use `name` to register a Functional Component which will become unresolvable
|
|
4
|
+
// in production build due to name mangling.
|
|
5
|
+
export const registerComponent = (Vue: App, component: Component, name?: string) => {
|
|
6
|
+
const componentName = name || component.name
|
|
7
|
+
if (componentName == null) {
|
|
8
|
+
throw new Error('Buefy.registerComponent: missing component name')
|
|
9
|
+
}
|
|
10
|
+
Vue.component(componentName, component)
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const registerComponentProgrammatic = <
|
|
14
|
+
K extends keyof App['config']['globalProperties']['$buefy'],
|
|
15
|
+
C extends App['config']['globalProperties']['$buefy'][K]
|
|
16
|
+
>(Vue: App, property: K, component: C) => {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
|
+
if (!Vue.config.globalProperties.$buefy) Vue.config.globalProperties.$buefy = {} as any
|
|
19
|
+
Vue.config.globalProperties.$buefy[property] = component
|
|
20
|
+
}
|
package/src/utils/ssr.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Resulting `vue-augmentation.d.ts` file of this file must be appended to
|
|
2
|
+
// `buefy.d.ts` after its generation, because `api-extractor` won't include the
|
|
3
|
+
// module augmentation in the rolled up output.
|
|
4
|
+
// https://github.com/microsoft/rushstack/issues/1709
|
|
5
|
+
|
|
6
|
+
// KEEP a SINGLE IMPORT statement in a SINGLE LINE,
|
|
7
|
+
// otherwise the post processing will be messed up.
|
|
8
|
+
import 'vue'
|
|
9
|
+
|
|
10
|
+
import type { DialogProgrammatic } from '../components/dialog'
|
|
11
|
+
import type { LoadingProgrammatic } from '../components/loading'
|
|
12
|
+
import type { ModalProgrammatic } from '../components/modal'
|
|
13
|
+
import type { NotificationProgrammatic } from '../components/notification'
|
|
14
|
+
import type { SnackbarProgrammatic } from '../components/snackbar'
|
|
15
|
+
import type { ToastProgrammatic } from '../components/toast'
|
|
16
|
+
import ConfigComponent from './ConfigComponent'
|
|
17
|
+
|
|
18
|
+
// Augments the global property with `$buefy`.
|
|
19
|
+
// https://vuejs.org/guide/typescript/options-api.html#augmenting-global-properties
|
|
20
|
+
declare module '@vue/runtime-core' {
|
|
21
|
+
/* @public */
|
|
22
|
+
interface ComponentCustomProperties {
|
|
23
|
+
/* Global Buefy API. */
|
|
24
|
+
$buefy: {
|
|
25
|
+
config: typeof ConfigComponent,
|
|
26
|
+
globalNoticeInterval?: ReturnType<typeof setTimeout>,
|
|
27
|
+
dialog: DialogProgrammatic,
|
|
28
|
+
loading: LoadingProgrammatic,
|
|
29
|
+
modal: ModalProgrammatic,
|
|
30
|
+
notification: NotificationProgrammatic,
|
|
31
|
+
snackbar: SnackbarProgrammatic,
|
|
32
|
+
toast: ToastProgrammatic
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|