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,4208 @@
|
|
|
1
|
+
/*! Buefy v1.0.2 | MIT License | github.com/buefy/buefy */
|
|
2
|
+
(function (global, factory) {
|
|
3
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue')) :
|
|
4
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue'], factory) :
|
|
5
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Table = {}, global.Vue));
|
|
6
|
+
})(this, (function (exports, vue) { 'use strict';
|
|
7
|
+
|
|
8
|
+
function getValueByPath(obj, path) {
|
|
9
|
+
return path.split(".").reduce((o, i) => o ? o[i] : null, obj);
|
|
10
|
+
}
|
|
11
|
+
function indexOf(array, obj, fn) {
|
|
12
|
+
if (!array) return -1;
|
|
13
|
+
if (!fn || typeof fn !== "function") return array.indexOf(obj);
|
|
14
|
+
for (let i = 0; i < array.length; i++) {
|
|
15
|
+
if (fn(array[i], obj)) {
|
|
16
|
+
return i;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return -1;
|
|
20
|
+
}
|
|
21
|
+
function removeElement(el) {
|
|
22
|
+
if (typeof el.remove !== "undefined") {
|
|
23
|
+
el.remove();
|
|
24
|
+
} else if (typeof el.parentNode !== "undefined" && el.parentNode !== null) {
|
|
25
|
+
el.parentNode.removeChild(el);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function createAbsoluteElement(el) {
|
|
29
|
+
const root = document.createElement("div");
|
|
30
|
+
root.style.position = "absolute";
|
|
31
|
+
root.style.left = "0px";
|
|
32
|
+
root.style.top = "0px";
|
|
33
|
+
root.style.width = "100%";
|
|
34
|
+
const wrapper = document.createElement("div");
|
|
35
|
+
root.appendChild(wrapper);
|
|
36
|
+
wrapper.appendChild(el);
|
|
37
|
+
document.body.appendChild(root);
|
|
38
|
+
return root;
|
|
39
|
+
}
|
|
40
|
+
function escapeRegExpChars(value) {
|
|
41
|
+
if (!value) return value;
|
|
42
|
+
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
|
|
43
|
+
}
|
|
44
|
+
function removeDiacriticsFromString(value) {
|
|
45
|
+
if (!value) return value;
|
|
46
|
+
return value.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
|
|
47
|
+
}
|
|
48
|
+
function multiColumnSort(inputArray, sortingPriority) {
|
|
49
|
+
const array = JSON.parse(JSON.stringify(inputArray));
|
|
50
|
+
const fieldSorter = (fields) => (a, b) => fields.map((o) => {
|
|
51
|
+
const { field, order, customSort } = o;
|
|
52
|
+
if (typeof customSort === "function") {
|
|
53
|
+
return customSort(a, b, order !== "desc");
|
|
54
|
+
} else {
|
|
55
|
+
const aValue = getValueByPath(a, field);
|
|
56
|
+
const bValue = getValueByPath(b, field);
|
|
57
|
+
const ord = aValue > bValue ? 1 : aValue < bValue ? -1 : 0;
|
|
58
|
+
return order === "desc" ? -ord : ord;
|
|
59
|
+
}
|
|
60
|
+
}).reduce((p, n) => p || n, 0);
|
|
61
|
+
return array.sort(fieldSorter(sortingPriority));
|
|
62
|
+
}
|
|
63
|
+
function toCssWidth(width) {
|
|
64
|
+
return width === void 0 ? null : isNaN(+width) ? `${width}` : width + "px";
|
|
65
|
+
}
|
|
66
|
+
const isNil = (value) => value === null || value === void 0;
|
|
67
|
+
function isFragment(vnode) {
|
|
68
|
+
return vnode.type === vue.Fragment;
|
|
69
|
+
}
|
|
70
|
+
const translateTouchAsDragEvent = (event, options) => {
|
|
71
|
+
const { type, target } = options;
|
|
72
|
+
let translateX = 0;
|
|
73
|
+
let translateY = 0;
|
|
74
|
+
if (target != null && target !== event.target) {
|
|
75
|
+
const baseRect = event.target.getBoundingClientRect();
|
|
76
|
+
const targetRect = target.getBoundingClientRect();
|
|
77
|
+
translateX = targetRect.left - baseRect.left;
|
|
78
|
+
translateY = targetRect.top - baseRect.top;
|
|
79
|
+
}
|
|
80
|
+
const touch = event.touches[0] || event.changedTouches[0];
|
|
81
|
+
return new DragEvent(type, {
|
|
82
|
+
dataTransfer: new DataTransfer(),
|
|
83
|
+
bubbles: true,
|
|
84
|
+
screenX: touch.screenX,
|
|
85
|
+
screenY: touch.screenY,
|
|
86
|
+
clientX: touch.clientX + translateX,
|
|
87
|
+
clientY: touch.clientY + translateY,
|
|
88
|
+
ctrlKey: event.ctrlKey,
|
|
89
|
+
shiftKey: event.shiftKey,
|
|
90
|
+
altKey: event.altKey,
|
|
91
|
+
metaKey: event.metaKey
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function debounce(func, wait, immediate) {
|
|
96
|
+
let timeout;
|
|
97
|
+
return function(...args) {
|
|
98
|
+
const context = this;
|
|
99
|
+
const later = function() {
|
|
100
|
+
timeout = void 0;
|
|
101
|
+
func.apply(context, args);
|
|
102
|
+
};
|
|
103
|
+
clearTimeout(timeout);
|
|
104
|
+
timeout = setTimeout(later, wait);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
let config = {
|
|
109
|
+
defaultIconPack: "mdi",
|
|
110
|
+
defaultIconComponent: null,
|
|
111
|
+
defaultIconPrev: "chevron-left",
|
|
112
|
+
defaultIconNext: "chevron-right",
|
|
113
|
+
defaultLocale: void 0,
|
|
114
|
+
defaultInputAutocomplete: "on",
|
|
115
|
+
defaultInputHasCounter: true,
|
|
116
|
+
defaultCompatFallthrough: true,
|
|
117
|
+
defaultUseHtml5Validation: true,
|
|
118
|
+
defaultStatusIcon: true,
|
|
119
|
+
defaultLinkTags: [
|
|
120
|
+
"a",
|
|
121
|
+
"button",
|
|
122
|
+
"input",
|
|
123
|
+
"router-link",
|
|
124
|
+
"nuxt-link",
|
|
125
|
+
"n-link",
|
|
126
|
+
"RouterLink",
|
|
127
|
+
"NuxtLink",
|
|
128
|
+
"NLink"
|
|
129
|
+
]};
|
|
130
|
+
|
|
131
|
+
var __getOwnPropSymbols$1 = Object.getOwnPropertySymbols;
|
|
132
|
+
var __hasOwnProp$1 = Object.prototype.hasOwnProperty;
|
|
133
|
+
var __propIsEnum$1 = Object.prototype.propertyIsEnumerable;
|
|
134
|
+
var __objRest = (source, exclude) => {
|
|
135
|
+
var target = {};
|
|
136
|
+
for (var prop in source)
|
|
137
|
+
if (__hasOwnProp$1.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
138
|
+
target[prop] = source[prop];
|
|
139
|
+
if (source != null && __getOwnPropSymbols$1)
|
|
140
|
+
for (var prop of __getOwnPropSymbols$1(source)) {
|
|
141
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum$1.call(source, prop))
|
|
142
|
+
target[prop] = source[prop];
|
|
143
|
+
}
|
|
144
|
+
return target;
|
|
145
|
+
};
|
|
146
|
+
var CompatFallthroughMixin = vue.defineComponent({
|
|
147
|
+
inheritAttrs: false,
|
|
148
|
+
props: {
|
|
149
|
+
compatFallthrough: {
|
|
150
|
+
type: Boolean,
|
|
151
|
+
default: () => config.defaultCompatFallthrough
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
computed: {
|
|
155
|
+
rootAttrs() {
|
|
156
|
+
return this.compatFallthrough ? {
|
|
157
|
+
class: this.$attrs.class,
|
|
158
|
+
style: this.$attrs.style,
|
|
159
|
+
id: this.$attrs.id
|
|
160
|
+
} : {};
|
|
161
|
+
},
|
|
162
|
+
fallthroughAttrs() {
|
|
163
|
+
if (this.compatFallthrough) {
|
|
164
|
+
const _a = this.$attrs, { style: _1, class: _2, id: _3 } = _a, rest = __objRest(_a, ["style", "class", "id"]);
|
|
165
|
+
return rest;
|
|
166
|
+
} else {
|
|
167
|
+
return this.$attrs;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
var CheckRadioMixin = vue.defineComponent({
|
|
174
|
+
props: {
|
|
175
|
+
modelValue: [String, Number, Boolean, Function, Object, Array],
|
|
176
|
+
nativeValue: [String, Number, Boolean, Function, Object, Array],
|
|
177
|
+
type: String,
|
|
178
|
+
disabled: Boolean,
|
|
179
|
+
required: Boolean,
|
|
180
|
+
name: String,
|
|
181
|
+
size: String
|
|
182
|
+
},
|
|
183
|
+
emits: {
|
|
184
|
+
// eslint-disable-next-line max-len
|
|
185
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars
|
|
186
|
+
"update:modelValue": (value) => true
|
|
187
|
+
},
|
|
188
|
+
data() {
|
|
189
|
+
return {
|
|
190
|
+
newValue: this.modelValue
|
|
191
|
+
};
|
|
192
|
+
},
|
|
193
|
+
computed: {
|
|
194
|
+
computedValue: {
|
|
195
|
+
get() {
|
|
196
|
+
return this.newValue;
|
|
197
|
+
},
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
199
|
+
set(value) {
|
|
200
|
+
this.newValue = value;
|
|
201
|
+
this.$emit("update:modelValue", value);
|
|
202
|
+
}
|
|
203
|
+
},
|
|
204
|
+
disabledOrUndefined() {
|
|
205
|
+
return this.disabled || void 0;
|
|
206
|
+
},
|
|
207
|
+
requiredOrUndefined() {
|
|
208
|
+
return this.required || void 0;
|
|
209
|
+
}
|
|
210
|
+
},
|
|
211
|
+
watch: {
|
|
212
|
+
/*
|
|
213
|
+
* When v-model change, set internal value.
|
|
214
|
+
*/
|
|
215
|
+
modelValue(value) {
|
|
216
|
+
this.newValue = value;
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
methods: {
|
|
220
|
+
focus() {
|
|
221
|
+
this.$refs.input.focus();
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
|
|
226
|
+
var _sfc_main$9 = vue.defineComponent({
|
|
227
|
+
name: "BCheckbox",
|
|
228
|
+
mixins: [CheckRadioMixin],
|
|
229
|
+
props: {
|
|
230
|
+
indeterminate: Boolean,
|
|
231
|
+
ariaLabelledby: String,
|
|
232
|
+
trueValue: {
|
|
233
|
+
type: [String, Number, Boolean, Function, Object, Array],
|
|
234
|
+
default: true
|
|
235
|
+
},
|
|
236
|
+
falseValue: {
|
|
237
|
+
type: [String, Number, Boolean, Function, Object, Array],
|
|
238
|
+
default: false
|
|
239
|
+
},
|
|
240
|
+
autocomplete: {
|
|
241
|
+
type: String,
|
|
242
|
+
default: "on"
|
|
243
|
+
},
|
|
244
|
+
inputId: {
|
|
245
|
+
type: String,
|
|
246
|
+
default: ""
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
var _export_sfc = (sfc, props) => {
|
|
252
|
+
const target = sfc.__vccOpts || sfc;
|
|
253
|
+
for (const [key, val] of props) {
|
|
254
|
+
target[key] = val;
|
|
255
|
+
}
|
|
256
|
+
return target;
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
const _hoisted_1$7 = ["disabled"];
|
|
260
|
+
const _hoisted_2$6 = ["id", ".indeterminate", "autocomplete", "disabled", "required", "name", "value", "true-value", "false-value", "aria-labelledby"];
|
|
261
|
+
const _hoisted_3$5 = ["id"];
|
|
262
|
+
function _sfc_render$9(_ctx, _cache, $props, $setup, $data, $options) {
|
|
263
|
+
return vue.openBlock(), vue.createElementBlock("label", {
|
|
264
|
+
class: vue.normalizeClass(["b-checkbox checkbox", [_ctx.size, { "is-disabled": _ctx.disabled }]]),
|
|
265
|
+
ref: "label",
|
|
266
|
+
disabled: _ctx.disabledOrUndefined,
|
|
267
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.focus && _ctx.focus(...args)),
|
|
268
|
+
onKeydown: [
|
|
269
|
+
_cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers(($event) => _ctx.$refs.label.click(), ["prevent"]), ["enter"])),
|
|
270
|
+
_cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers(($event) => _ctx.$refs.label.click(), ["prevent"]), ["space"]))
|
|
271
|
+
]
|
|
272
|
+
}, [
|
|
273
|
+
vue.createCommentVNode(" Checkbox needs to listen for a space event instead of a just a\n click and enter event so that that using the keyboard spacebar will also\n trigger the checkbox change in the b-table "),
|
|
274
|
+
vue.withDirectives(vue.createElementVNode("input", {
|
|
275
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event),
|
|
276
|
+
id: _ctx.inputId,
|
|
277
|
+
".indeterminate": _ctx.indeterminate,
|
|
278
|
+
type: "checkbox",
|
|
279
|
+
ref: "input",
|
|
280
|
+
onClick: _cache[1] || (_cache[1] = vue.withModifiers(() => {
|
|
281
|
+
}, ["stop"])),
|
|
282
|
+
autocomplete: _ctx.autocomplete,
|
|
283
|
+
disabled: _ctx.disabledOrUndefined,
|
|
284
|
+
required: _ctx.requiredOrUndefined,
|
|
285
|
+
name: _ctx.name,
|
|
286
|
+
value: _ctx.nativeValue,
|
|
287
|
+
"true-value": _ctx.trueValue,
|
|
288
|
+
"false-value": _ctx.falseValue,
|
|
289
|
+
"aria-labelledby": _ctx.ariaLabelledby
|
|
290
|
+
}, null, 40, _hoisted_2$6), [
|
|
291
|
+
[vue.vModelCheckbox, _ctx.computedValue]
|
|
292
|
+
]),
|
|
293
|
+
vue.createElementVNode(
|
|
294
|
+
"span",
|
|
295
|
+
{
|
|
296
|
+
class: vue.normalizeClass(["check", _ctx.type])
|
|
297
|
+
},
|
|
298
|
+
null,
|
|
299
|
+
2
|
|
300
|
+
/* CLASS */
|
|
301
|
+
),
|
|
302
|
+
vue.createElementVNode("span", {
|
|
303
|
+
id: _ctx.ariaLabelledby,
|
|
304
|
+
class: "control-label"
|
|
305
|
+
}, [
|
|
306
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
307
|
+
], 8, _hoisted_3$5)
|
|
308
|
+
], 42, _hoisted_1$7);
|
|
309
|
+
}
|
|
310
|
+
var BCheckbox = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["render", _sfc_render$9]]);
|
|
311
|
+
|
|
312
|
+
const mdiIcons = {
|
|
313
|
+
sizes: {
|
|
314
|
+
default: "mdi-24px",
|
|
315
|
+
"is-small": null,
|
|
316
|
+
"is-medium": "mdi-36px",
|
|
317
|
+
"is-large": "mdi-48px"
|
|
318
|
+
},
|
|
319
|
+
iconPrefix: "mdi-"
|
|
320
|
+
};
|
|
321
|
+
const faIcons = () => {
|
|
322
|
+
const faIconPrefix = "fa-";
|
|
323
|
+
return {
|
|
324
|
+
sizes: {
|
|
325
|
+
default: null,
|
|
326
|
+
"is-small": null,
|
|
327
|
+
"is-medium": faIconPrefix + "lg",
|
|
328
|
+
"is-large": faIconPrefix + "2x"
|
|
329
|
+
},
|
|
330
|
+
iconPrefix: faIconPrefix,
|
|
331
|
+
internalIcons: {
|
|
332
|
+
information: "info-circle",
|
|
333
|
+
alert: "exclamation-triangle",
|
|
334
|
+
"alert-circle": "exclamation-circle",
|
|
335
|
+
"chevron-right": "angle-right",
|
|
336
|
+
"chevron-left": "angle-left",
|
|
337
|
+
"chevron-down": "angle-down",
|
|
338
|
+
"eye-off": "eye-slash",
|
|
339
|
+
"menu-down": "caret-down",
|
|
340
|
+
"menu-up": "caret-up",
|
|
341
|
+
"close-circle": "times-circle"
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
};
|
|
345
|
+
const getIcons = () => {
|
|
346
|
+
let icons = {
|
|
347
|
+
mdi: mdiIcons,
|
|
348
|
+
fa: faIcons(),
|
|
349
|
+
fas: faIcons(),
|
|
350
|
+
far: faIcons(),
|
|
351
|
+
fad: faIcons(),
|
|
352
|
+
fab: faIcons(),
|
|
353
|
+
fal: faIcons(),
|
|
354
|
+
"fa-solid": faIcons(),
|
|
355
|
+
"fa-regular": faIcons(),
|
|
356
|
+
"fa-light": faIcons(),
|
|
357
|
+
"fa-thin": faIcons(),
|
|
358
|
+
"fa-duotone": faIcons(),
|
|
359
|
+
"fa-brands": faIcons()
|
|
360
|
+
};
|
|
361
|
+
return icons;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
var _sfc_main$8 = vue.defineComponent({
|
|
365
|
+
name: "BIcon",
|
|
366
|
+
props: {
|
|
367
|
+
type: [String, Object],
|
|
368
|
+
component: String,
|
|
369
|
+
pack: String,
|
|
370
|
+
icon: {
|
|
371
|
+
type: String,
|
|
372
|
+
required: true
|
|
373
|
+
},
|
|
374
|
+
size: String,
|
|
375
|
+
customSize: String,
|
|
376
|
+
customClass: String,
|
|
377
|
+
both: Boolean
|
|
378
|
+
// This is used internally to show both MDI and FA icon
|
|
379
|
+
},
|
|
380
|
+
computed: {
|
|
381
|
+
iconConfig() {
|
|
382
|
+
const allIcons = getIcons();
|
|
383
|
+
return allIcons[this.newPack];
|
|
384
|
+
},
|
|
385
|
+
iconPrefix() {
|
|
386
|
+
if (this.iconConfig && this.iconConfig.iconPrefix) {
|
|
387
|
+
return this.iconConfig.iconPrefix;
|
|
388
|
+
}
|
|
389
|
+
return "";
|
|
390
|
+
},
|
|
391
|
+
/*
|
|
392
|
+
* Internal icon name based on the pack.
|
|
393
|
+
* If pack is 'fa', gets the equivalent FA icon name of the MDI,
|
|
394
|
+
* internal icons are always MDI.
|
|
395
|
+
*/
|
|
396
|
+
newIcon() {
|
|
397
|
+
return `${this.iconPrefix}${this.getEquivalentIconOf(this.icon)}`;
|
|
398
|
+
},
|
|
399
|
+
newPack() {
|
|
400
|
+
return this.pack || config.defaultIconPack;
|
|
401
|
+
},
|
|
402
|
+
newType() {
|
|
403
|
+
if (!this.type) return;
|
|
404
|
+
let splitType = [];
|
|
405
|
+
if (typeof this.type === "string") {
|
|
406
|
+
splitType = this.type.split("-");
|
|
407
|
+
} else {
|
|
408
|
+
for (const key in this.type) {
|
|
409
|
+
if (this.type[key]) {
|
|
410
|
+
splitType = key.split("-");
|
|
411
|
+
break;
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
if (splitType.length <= 1) return;
|
|
416
|
+
const [, ...type] = splitType;
|
|
417
|
+
return `has-text-${type.join("-")}`;
|
|
418
|
+
},
|
|
419
|
+
newCustomSize() {
|
|
420
|
+
return this.customSize || this.customSizeByPack;
|
|
421
|
+
},
|
|
422
|
+
customSizeByPack() {
|
|
423
|
+
if (this.iconConfig && this.iconConfig.sizes) {
|
|
424
|
+
if (this.size && this.iconConfig.sizes[this.size] !== void 0) {
|
|
425
|
+
return this.iconConfig.sizes[this.size];
|
|
426
|
+
} else if (this.iconConfig.sizes.default) {
|
|
427
|
+
return this.iconConfig.sizes.default;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
return null;
|
|
431
|
+
},
|
|
432
|
+
useIconComponent() {
|
|
433
|
+
return this.component || config.defaultIconComponent;
|
|
434
|
+
}
|
|
435
|
+
},
|
|
436
|
+
methods: {
|
|
437
|
+
/*
|
|
438
|
+
* Equivalent icon name of the MDI.
|
|
439
|
+
*/
|
|
440
|
+
getEquivalentIconOf(value) {
|
|
441
|
+
if (!this.both) {
|
|
442
|
+
return value;
|
|
443
|
+
}
|
|
444
|
+
if (this.iconConfig == null) {
|
|
445
|
+
return value;
|
|
446
|
+
}
|
|
447
|
+
const maybeInternal = this.iconConfig;
|
|
448
|
+
if (maybeInternal && maybeInternal.internalIcons && maybeInternal.internalIcons[value]) {
|
|
449
|
+
return maybeInternal.internalIcons[value];
|
|
450
|
+
}
|
|
451
|
+
return value;
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
457
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
458
|
+
"span",
|
|
459
|
+
{
|
|
460
|
+
class: vue.normalizeClass(["icon", [_ctx.newType, _ctx.size]])
|
|
461
|
+
},
|
|
462
|
+
[
|
|
463
|
+
!_ctx.useIconComponent ? (vue.openBlock(), vue.createElementBlock(
|
|
464
|
+
"i",
|
|
465
|
+
{
|
|
466
|
+
key: 0,
|
|
467
|
+
class: vue.normalizeClass([_ctx.newPack, _ctx.newIcon, _ctx.newCustomSize, _ctx.customClass])
|
|
468
|
+
},
|
|
469
|
+
null,
|
|
470
|
+
2
|
|
471
|
+
/* CLASS */
|
|
472
|
+
)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.useIconComponent), {
|
|
473
|
+
key: 1,
|
|
474
|
+
icon: [_ctx.newPack, _ctx.newIcon],
|
|
475
|
+
size: _ctx.newCustomSize,
|
|
476
|
+
class: vue.normalizeClass([_ctx.customClass])
|
|
477
|
+
}, null, 8, ["icon", "size", "class"]))
|
|
478
|
+
],
|
|
479
|
+
2
|
|
480
|
+
/* CLASS */
|
|
481
|
+
);
|
|
482
|
+
}
|
|
483
|
+
var BIcon = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["render", _sfc_render$8]]);
|
|
484
|
+
|
|
485
|
+
const FormElementMixin = vue.defineComponent({
|
|
486
|
+
props: {
|
|
487
|
+
size: String,
|
|
488
|
+
expanded: Boolean,
|
|
489
|
+
loading: Boolean,
|
|
490
|
+
rounded: Boolean,
|
|
491
|
+
icon: String,
|
|
492
|
+
iconPack: String,
|
|
493
|
+
maxlength: [Number, String],
|
|
494
|
+
useHtml5Validation: {
|
|
495
|
+
type: Boolean,
|
|
496
|
+
default: () => config.defaultUseHtml5Validation
|
|
497
|
+
},
|
|
498
|
+
validationMessage: String,
|
|
499
|
+
locale: {
|
|
500
|
+
type: [String, Array],
|
|
501
|
+
default: () => {
|
|
502
|
+
return config.defaultLocale;
|
|
503
|
+
}
|
|
504
|
+
},
|
|
505
|
+
statusIcon: {
|
|
506
|
+
type: Boolean,
|
|
507
|
+
default: () => {
|
|
508
|
+
return config.defaultStatusIcon;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
emits: {
|
|
513
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
514
|
+
blur: (event) => true,
|
|
515
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
516
|
+
focus: (event) => true
|
|
517
|
+
},
|
|
518
|
+
data() {
|
|
519
|
+
return {
|
|
520
|
+
isValid: true,
|
|
521
|
+
isFocused: false,
|
|
522
|
+
newIconPack: this.iconPack || config.defaultIconPack,
|
|
523
|
+
// host component must override this
|
|
524
|
+
_elementRef: ""
|
|
525
|
+
};
|
|
526
|
+
},
|
|
527
|
+
computed: {
|
|
528
|
+
/*
|
|
529
|
+
* Find parent Field, max 3 levels deep.
|
|
530
|
+
*/
|
|
531
|
+
parentField() {
|
|
532
|
+
let parent = this.$parent;
|
|
533
|
+
for (let i = 0; i < 3; i++) {
|
|
534
|
+
if (parent && !parent.$data._isField) {
|
|
535
|
+
parent = parent.$parent;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return parent;
|
|
539
|
+
},
|
|
540
|
+
/*
|
|
541
|
+
* Get the type prop from parent if it's a Field.
|
|
542
|
+
*/
|
|
543
|
+
statusType() {
|
|
544
|
+
const { newType } = this.parentField || {};
|
|
545
|
+
if (!newType) return;
|
|
546
|
+
if (typeof newType === "string") {
|
|
547
|
+
return newType;
|
|
548
|
+
} else {
|
|
549
|
+
for (const key in newType) {
|
|
550
|
+
if (newType[key]) {
|
|
551
|
+
return key;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
return void 0;
|
|
556
|
+
},
|
|
557
|
+
/*
|
|
558
|
+
* Get the message prop from parent if it's a Field.
|
|
559
|
+
*/
|
|
560
|
+
statusMessage() {
|
|
561
|
+
if (!this.parentField) return;
|
|
562
|
+
return this.parentField.newMessage || this.parentField.$slots.message;
|
|
563
|
+
},
|
|
564
|
+
/*
|
|
565
|
+
* Fix icon size for inputs, large was too big
|
|
566
|
+
*/
|
|
567
|
+
iconSize() {
|
|
568
|
+
switch (this.size) {
|
|
569
|
+
case "is-small":
|
|
570
|
+
return this.size;
|
|
571
|
+
case "is-medium":
|
|
572
|
+
return;
|
|
573
|
+
case "is-large":
|
|
574
|
+
return this.newIconPack === "mdi" ? "is-medium" : "";
|
|
575
|
+
}
|
|
576
|
+
return void 0;
|
|
577
|
+
}
|
|
578
|
+
},
|
|
579
|
+
methods: {
|
|
580
|
+
/*
|
|
581
|
+
* Focus method that work dynamically depending on the component.
|
|
582
|
+
*/
|
|
583
|
+
focus() {
|
|
584
|
+
const el = this.getElement();
|
|
585
|
+
if (el === void 0) return;
|
|
586
|
+
this.$nextTick(() => {
|
|
587
|
+
if (el) el.focus();
|
|
588
|
+
});
|
|
589
|
+
},
|
|
590
|
+
onBlur($event) {
|
|
591
|
+
this.isFocused = false;
|
|
592
|
+
this.$emit("blur", $event);
|
|
593
|
+
this.checkHtml5Validity();
|
|
594
|
+
},
|
|
595
|
+
onFocus($event) {
|
|
596
|
+
this.isFocused = true;
|
|
597
|
+
this.$emit("focus", $event);
|
|
598
|
+
},
|
|
599
|
+
getElement() {
|
|
600
|
+
let el = this.$refs[this.$data._elementRef];
|
|
601
|
+
while (el != null && typeof el === "object" && "$refs" in el) {
|
|
602
|
+
const form = el;
|
|
603
|
+
el = form.$refs[form.$data._elementRef];
|
|
604
|
+
}
|
|
605
|
+
return el;
|
|
606
|
+
},
|
|
607
|
+
setInvalid() {
|
|
608
|
+
const type = "is-danger";
|
|
609
|
+
const message = this.validationMessage || this.getElement().validationMessage;
|
|
610
|
+
this.setValidity(type, message);
|
|
611
|
+
},
|
|
612
|
+
setValidity(type, message) {
|
|
613
|
+
this.$nextTick(() => {
|
|
614
|
+
if (this.parentField) {
|
|
615
|
+
if (!this.parentField.type) {
|
|
616
|
+
this.parentField.newType = type;
|
|
617
|
+
}
|
|
618
|
+
if (!this.parentField.message) {
|
|
619
|
+
this.parentField.newMessage = message;
|
|
620
|
+
}
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
},
|
|
624
|
+
/*
|
|
625
|
+
* Check HTML5 validation, set isValid property.
|
|
626
|
+
* If validation fail, send 'is-danger' type,
|
|
627
|
+
* and error message to parent if it's a Field.
|
|
628
|
+
*/
|
|
629
|
+
checkHtml5Validity() {
|
|
630
|
+
if (!this.useHtml5Validation) {
|
|
631
|
+
return false;
|
|
632
|
+
}
|
|
633
|
+
const el = this.getElement();
|
|
634
|
+
if (el == null) {
|
|
635
|
+
return false;
|
|
636
|
+
}
|
|
637
|
+
if (!el.checkValidity()) {
|
|
638
|
+
this.setInvalid();
|
|
639
|
+
this.isValid = false;
|
|
640
|
+
} else {
|
|
641
|
+
this.setValidity(null, null);
|
|
642
|
+
this.isValid = true;
|
|
643
|
+
}
|
|
644
|
+
return this.isValid;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
var _sfc_main$7 = vue.defineComponent({
|
|
650
|
+
name: "BInput",
|
|
651
|
+
components: { BIcon },
|
|
652
|
+
mixins: [CompatFallthroughMixin, FormElementMixin],
|
|
653
|
+
props: {
|
|
654
|
+
modelValue: {
|
|
655
|
+
type: [Number, String]
|
|
656
|
+
},
|
|
657
|
+
type: {
|
|
658
|
+
type: String,
|
|
659
|
+
default: "text"
|
|
660
|
+
},
|
|
661
|
+
lazy: {
|
|
662
|
+
type: Boolean,
|
|
663
|
+
default: false
|
|
664
|
+
},
|
|
665
|
+
passwordReveal: Boolean,
|
|
666
|
+
iconClickable: Boolean,
|
|
667
|
+
hasCounter: {
|
|
668
|
+
type: Boolean,
|
|
669
|
+
default: () => config.defaultInputHasCounter
|
|
670
|
+
},
|
|
671
|
+
customClass: {
|
|
672
|
+
type: String,
|
|
673
|
+
default: ""
|
|
674
|
+
},
|
|
675
|
+
iconRight: String,
|
|
676
|
+
iconRightClickable: Boolean,
|
|
677
|
+
iconRightType: String,
|
|
678
|
+
// Native options to use in HTML5 validation
|
|
679
|
+
autocomplete: String
|
|
680
|
+
},
|
|
681
|
+
emits: {
|
|
682
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
683
|
+
"icon-click": (event) => true,
|
|
684
|
+
"icon-right-click": (event) => true,
|
|
685
|
+
"update:modelValue": (value) => true
|
|
686
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
687
|
+
},
|
|
688
|
+
data() {
|
|
689
|
+
return {
|
|
690
|
+
newValue: this.modelValue,
|
|
691
|
+
newType: this.type,
|
|
692
|
+
newAutocomplete: this.autocomplete || config.defaultInputAutocomplete,
|
|
693
|
+
isPasswordVisible: false,
|
|
694
|
+
_elementRef: this.type === "textarea" ? "textarea" : "input"
|
|
695
|
+
};
|
|
696
|
+
},
|
|
697
|
+
computed: {
|
|
698
|
+
computedValue: {
|
|
699
|
+
get() {
|
|
700
|
+
return this.newValue;
|
|
701
|
+
},
|
|
702
|
+
set(value) {
|
|
703
|
+
this.newValue = value;
|
|
704
|
+
this.$emit("update:modelValue", value);
|
|
705
|
+
}
|
|
706
|
+
},
|
|
707
|
+
rootClasses() {
|
|
708
|
+
return [
|
|
709
|
+
this.iconPosition,
|
|
710
|
+
this.size,
|
|
711
|
+
{
|
|
712
|
+
"is-expanded": this.expanded,
|
|
713
|
+
"is-loading": this.loading,
|
|
714
|
+
"is-clearfix": !this.hasMessage
|
|
715
|
+
}
|
|
716
|
+
];
|
|
717
|
+
},
|
|
718
|
+
inputClasses() {
|
|
719
|
+
return [
|
|
720
|
+
this.statusType,
|
|
721
|
+
this.size,
|
|
722
|
+
{ "is-rounded": this.rounded }
|
|
723
|
+
];
|
|
724
|
+
},
|
|
725
|
+
hasIconRight() {
|
|
726
|
+
return this.passwordReveal || this.loading || this.statusIcon && this.statusTypeIcon || this.iconRight;
|
|
727
|
+
},
|
|
728
|
+
rightIcon() {
|
|
729
|
+
if (this.passwordReveal) {
|
|
730
|
+
return this.passwordVisibleIcon;
|
|
731
|
+
} else if (this.iconRight) {
|
|
732
|
+
return this.iconRight;
|
|
733
|
+
}
|
|
734
|
+
return this.statusTypeIcon;
|
|
735
|
+
},
|
|
736
|
+
rightIconType() {
|
|
737
|
+
if (this.passwordReveal) {
|
|
738
|
+
return "is-primary";
|
|
739
|
+
} else if (this.iconRight) {
|
|
740
|
+
return this.iconRightType || void 0;
|
|
741
|
+
}
|
|
742
|
+
return this.statusType;
|
|
743
|
+
},
|
|
744
|
+
/*
|
|
745
|
+
* Position of the icon or if it's both sides.
|
|
746
|
+
*/
|
|
747
|
+
iconPosition() {
|
|
748
|
+
let iconClasses = "";
|
|
749
|
+
if (this.icon) {
|
|
750
|
+
iconClasses += "has-icons-left ";
|
|
751
|
+
}
|
|
752
|
+
if (this.hasIconRight) {
|
|
753
|
+
iconClasses += "has-icons-right";
|
|
754
|
+
}
|
|
755
|
+
return iconClasses;
|
|
756
|
+
},
|
|
757
|
+
/*
|
|
758
|
+
* Icon name (MDI) based on the type.
|
|
759
|
+
*/
|
|
760
|
+
statusTypeIcon() {
|
|
761
|
+
switch (this.statusType) {
|
|
762
|
+
case "is-success":
|
|
763
|
+
return "check";
|
|
764
|
+
case "is-danger":
|
|
765
|
+
return "alert-circle";
|
|
766
|
+
case "is-info":
|
|
767
|
+
return "information";
|
|
768
|
+
case "is-warning":
|
|
769
|
+
return "alert";
|
|
770
|
+
default:
|
|
771
|
+
return void 0;
|
|
772
|
+
}
|
|
773
|
+
},
|
|
774
|
+
/*
|
|
775
|
+
* Check if have any message prop from parent if it's a Field.
|
|
776
|
+
*/
|
|
777
|
+
hasMessage() {
|
|
778
|
+
return !!this.statusMessage;
|
|
779
|
+
},
|
|
780
|
+
/*
|
|
781
|
+
* Current password-reveal icon name.
|
|
782
|
+
*/
|
|
783
|
+
passwordVisibleIcon() {
|
|
784
|
+
return !this.isPasswordVisible ? "eye" : "eye-off";
|
|
785
|
+
},
|
|
786
|
+
/*
|
|
787
|
+
* Get value length
|
|
788
|
+
*/
|
|
789
|
+
valueLength() {
|
|
790
|
+
if (typeof this.computedValue === "string") {
|
|
791
|
+
return Array.from(this.computedValue).length;
|
|
792
|
+
} else if (typeof this.computedValue === "number") {
|
|
793
|
+
return this.computedValue.toString().length;
|
|
794
|
+
}
|
|
795
|
+
return 0;
|
|
796
|
+
}
|
|
797
|
+
},
|
|
798
|
+
watch: {
|
|
799
|
+
/*
|
|
800
|
+
* When v-model is changed:
|
|
801
|
+
* 1. Set internal value.
|
|
802
|
+
* 2. Validate it if the value came from outside;
|
|
803
|
+
* i.e., not equal to computedValue
|
|
804
|
+
*/
|
|
805
|
+
modelValue(value) {
|
|
806
|
+
const fromOutside = this.computedValue != value;
|
|
807
|
+
this.newValue = value;
|
|
808
|
+
if (fromOutside) {
|
|
809
|
+
this.$nextTick(() => {
|
|
810
|
+
!this.isValid && this.checkHtml5Validity();
|
|
811
|
+
});
|
|
812
|
+
}
|
|
813
|
+
},
|
|
814
|
+
type(type) {
|
|
815
|
+
this.newType = type;
|
|
816
|
+
}
|
|
817
|
+
},
|
|
818
|
+
methods: {
|
|
819
|
+
/*
|
|
820
|
+
* Toggle the visibility of a password-reveal input
|
|
821
|
+
* by changing the type and focus the input right away.
|
|
822
|
+
*/
|
|
823
|
+
togglePasswordVisibility() {
|
|
824
|
+
this.isPasswordVisible = !this.isPasswordVisible;
|
|
825
|
+
this.newType = this.isPasswordVisible ? "text" : "password";
|
|
826
|
+
this.$nextTick(() => {
|
|
827
|
+
this.focus();
|
|
828
|
+
});
|
|
829
|
+
},
|
|
830
|
+
iconClick(emit, event) {
|
|
831
|
+
this.$emit(emit, event);
|
|
832
|
+
this.$nextTick(() => {
|
|
833
|
+
this.focus();
|
|
834
|
+
});
|
|
835
|
+
},
|
|
836
|
+
rightIconClick(event) {
|
|
837
|
+
if (this.passwordReveal) {
|
|
838
|
+
this.togglePasswordVisibility();
|
|
839
|
+
} else if (this.iconRightClickable) {
|
|
840
|
+
this.iconClick("icon-right-click", event);
|
|
841
|
+
}
|
|
842
|
+
},
|
|
843
|
+
onInput() {
|
|
844
|
+
if (!this.lazy) {
|
|
845
|
+
this.revalidate();
|
|
846
|
+
}
|
|
847
|
+
},
|
|
848
|
+
onChange() {
|
|
849
|
+
if (this.lazy) {
|
|
850
|
+
this.revalidate();
|
|
851
|
+
}
|
|
852
|
+
},
|
|
853
|
+
revalidate() {
|
|
854
|
+
!this.isValid && this.checkHtml5Validity();
|
|
855
|
+
}
|
|
856
|
+
}
|
|
857
|
+
});
|
|
858
|
+
|
|
859
|
+
const _hoisted_1$6 = ["type", "autocomplete", "maxlength"];
|
|
860
|
+
const _hoisted_2$5 = ["maxlength"];
|
|
861
|
+
const _hoisted_3$4 = ["type", "autocomplete", "maxlength"];
|
|
862
|
+
const _hoisted_4$4 = ["maxlength"];
|
|
863
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
864
|
+
const _component_b_icon = vue.resolveComponent("b-icon");
|
|
865
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
866
|
+
"div",
|
|
867
|
+
vue.mergeProps({
|
|
868
|
+
class: ["control", _ctx.rootClasses]
|
|
869
|
+
}, _ctx.rootAttrs),
|
|
870
|
+
[
|
|
871
|
+
_ctx.lazy ? (vue.openBlock(), vue.createElementBlock(
|
|
872
|
+
vue.Fragment,
|
|
873
|
+
{ key: 0 },
|
|
874
|
+
[
|
|
875
|
+
_ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
|
|
876
|
+
key: 0,
|
|
877
|
+
ref: "input",
|
|
878
|
+
class: ["input", [_ctx.inputClasses, _ctx.customClass]],
|
|
879
|
+
type: _ctx.newType,
|
|
880
|
+
autocomplete: _ctx.newAutocomplete,
|
|
881
|
+
maxlength: _ctx.maxlength,
|
|
882
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event)
|
|
883
|
+
}, _ctx.fallthroughAttrs, {
|
|
884
|
+
onInput: _cache[1] || (_cache[1] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
885
|
+
onChange: _cache[2] || (_cache[2] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
886
|
+
onBlur: _cache[3] || (_cache[3] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
887
|
+
onFocus: _cache[4] || (_cache[4] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
|
|
888
|
+
}), null, 16, _hoisted_1$6)), [
|
|
889
|
+
[
|
|
890
|
+
vue.vModelDynamic,
|
|
891
|
+
_ctx.computedValue,
|
|
892
|
+
void 0,
|
|
893
|
+
{ lazy: true }
|
|
894
|
+
]
|
|
895
|
+
]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
|
|
896
|
+
key: 1,
|
|
897
|
+
ref: "textarea",
|
|
898
|
+
class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
|
|
899
|
+
maxlength: _ctx.maxlength,
|
|
900
|
+
"onUpdate:modelValue": _cache[5] || (_cache[5] = ($event) => _ctx.computedValue = $event)
|
|
901
|
+
}, _ctx.fallthroughAttrs, {
|
|
902
|
+
onInput: _cache[6] || (_cache[6] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
903
|
+
onChange: _cache[7] || (_cache[7] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
904
|
+
onBlur: _cache[8] || (_cache[8] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
905
|
+
onFocus: _cache[9] || (_cache[9] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
|
|
906
|
+
}), null, 16, _hoisted_2$5)), [
|
|
907
|
+
[
|
|
908
|
+
vue.vModelText,
|
|
909
|
+
_ctx.computedValue,
|
|
910
|
+
void 0,
|
|
911
|
+
{ lazy: true }
|
|
912
|
+
]
|
|
913
|
+
])
|
|
914
|
+
],
|
|
915
|
+
64
|
|
916
|
+
/* STABLE_FRAGMENT */
|
|
917
|
+
)) : (vue.openBlock(), vue.createElementBlock(
|
|
918
|
+
vue.Fragment,
|
|
919
|
+
{ key: 1 },
|
|
920
|
+
[
|
|
921
|
+
_ctx.type !== "textarea" ? vue.withDirectives((vue.openBlock(), vue.createElementBlock("input", vue.mergeProps({
|
|
922
|
+
key: 0,
|
|
923
|
+
ref: "input",
|
|
924
|
+
class: ["input", [_ctx.inputClasses, _ctx.customClass]],
|
|
925
|
+
type: _ctx.newType,
|
|
926
|
+
autocomplete: _ctx.newAutocomplete,
|
|
927
|
+
maxlength: _ctx.maxlength,
|
|
928
|
+
"onUpdate:modelValue": _cache[10] || (_cache[10] = ($event) => _ctx.computedValue = $event)
|
|
929
|
+
}, _ctx.fallthroughAttrs, {
|
|
930
|
+
onInput: _cache[11] || (_cache[11] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
931
|
+
onChange: _cache[12] || (_cache[12] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
932
|
+
onBlur: _cache[13] || (_cache[13] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
933
|
+
onFocus: _cache[14] || (_cache[14] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
|
|
934
|
+
}), null, 16, _hoisted_3$4)), [
|
|
935
|
+
[vue.vModelDynamic, _ctx.computedValue]
|
|
936
|
+
]) : vue.withDirectives((vue.openBlock(), vue.createElementBlock("textarea", vue.mergeProps({
|
|
937
|
+
key: 1,
|
|
938
|
+
ref: "textarea",
|
|
939
|
+
class: ["textarea", [_ctx.inputClasses, _ctx.customClass]],
|
|
940
|
+
maxlength: _ctx.maxlength,
|
|
941
|
+
"onUpdate:modelValue": _cache[15] || (_cache[15] = ($event) => _ctx.computedValue = $event)
|
|
942
|
+
}, _ctx.fallthroughAttrs, {
|
|
943
|
+
onInput: _cache[16] || (_cache[16] = (...args) => _ctx.onInput && _ctx.onInput(...args)),
|
|
944
|
+
onChange: _cache[17] || (_cache[17] = (...args) => _ctx.onChange && _ctx.onChange(...args)),
|
|
945
|
+
onBlur: _cache[18] || (_cache[18] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
946
|
+
onFocus: _cache[19] || (_cache[19] = (...args) => _ctx.onFocus && _ctx.onFocus(...args))
|
|
947
|
+
}), null, 16, _hoisted_4$4)), [
|
|
948
|
+
[vue.vModelText, _ctx.computedValue]
|
|
949
|
+
])
|
|
950
|
+
],
|
|
951
|
+
64
|
|
952
|
+
/* STABLE_FRAGMENT */
|
|
953
|
+
)),
|
|
954
|
+
_ctx.icon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
|
|
955
|
+
key: 2,
|
|
956
|
+
class: vue.normalizeClass(["is-left", { "is-clickable": _ctx.iconClickable }]),
|
|
957
|
+
icon: _ctx.icon,
|
|
958
|
+
pack: _ctx.iconPack,
|
|
959
|
+
size: _ctx.iconSize,
|
|
960
|
+
onClick: _cache[20] || (_cache[20] = ($event) => _ctx.iconClick("icon-click", $event))
|
|
961
|
+
}, null, 8, ["class", "icon", "pack", "size"])) : vue.createCommentVNode("v-if", true),
|
|
962
|
+
!_ctx.loading && _ctx.hasIconRight && _ctx.rightIcon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
|
|
963
|
+
key: 3,
|
|
964
|
+
class: vue.normalizeClass(["is-right", { "is-clickable": _ctx.passwordReveal || _ctx.iconRightClickable }]),
|
|
965
|
+
icon: _ctx.rightIcon,
|
|
966
|
+
pack: _ctx.iconPack,
|
|
967
|
+
size: _ctx.iconSize,
|
|
968
|
+
type: _ctx.rightIconType,
|
|
969
|
+
both: "",
|
|
970
|
+
onClick: _ctx.rightIconClick
|
|
971
|
+
}, null, 8, ["class", "icon", "pack", "size", "type", "onClick"])) : vue.createCommentVNode("v-if", true),
|
|
972
|
+
_ctx.maxlength && _ctx.hasCounter && _ctx.type !== "number" ? (vue.openBlock(), vue.createElementBlock(
|
|
973
|
+
"small",
|
|
974
|
+
{
|
|
975
|
+
key: 4,
|
|
976
|
+
class: vue.normalizeClass(["help counter", { "is-invisible": !_ctx.isFocused }])
|
|
977
|
+
},
|
|
978
|
+
vue.toDisplayString(_ctx.valueLength) + " / " + vue.toDisplayString(_ctx.maxlength),
|
|
979
|
+
3
|
|
980
|
+
/* TEXT, CLASS */
|
|
981
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
982
|
+
],
|
|
983
|
+
16
|
|
984
|
+
/* FULL_PROPS */
|
|
985
|
+
);
|
|
986
|
+
}
|
|
987
|
+
var BInput = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["render", _sfc_render$7]]);
|
|
988
|
+
|
|
989
|
+
const isSSR = typeof window === "undefined";
|
|
990
|
+
const HTMLElement = isSSR ? Object : window.HTMLElement;
|
|
991
|
+
|
|
992
|
+
const Loading = vue.defineComponent({
|
|
993
|
+
name: "BLoading",
|
|
994
|
+
props: {
|
|
995
|
+
modelValue: Boolean,
|
|
996
|
+
programmatic: Boolean,
|
|
997
|
+
container: [Object, Function, HTMLElement],
|
|
998
|
+
isFullPage: {
|
|
999
|
+
type: Boolean,
|
|
1000
|
+
default: true
|
|
1001
|
+
},
|
|
1002
|
+
animation: {
|
|
1003
|
+
type: String,
|
|
1004
|
+
default: "fade"
|
|
1005
|
+
},
|
|
1006
|
+
canCancel: {
|
|
1007
|
+
type: Boolean,
|
|
1008
|
+
default: false
|
|
1009
|
+
},
|
|
1010
|
+
onCancel: {
|
|
1011
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1012
|
+
type: Function,
|
|
1013
|
+
default: () => {
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
emits: {
|
|
1018
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1019
|
+
close: () => true,
|
|
1020
|
+
"update:is-full-page": (_flag) => true,
|
|
1021
|
+
"update:modelValue": (_flag) => true
|
|
1022
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1023
|
+
},
|
|
1024
|
+
data() {
|
|
1025
|
+
return {
|
|
1026
|
+
isActive: this.modelValue || false,
|
|
1027
|
+
displayInFullPage: this.isFullPage
|
|
1028
|
+
};
|
|
1029
|
+
},
|
|
1030
|
+
watch: {
|
|
1031
|
+
modelValue(value) {
|
|
1032
|
+
this.isActive = value;
|
|
1033
|
+
},
|
|
1034
|
+
isFullPage(value) {
|
|
1035
|
+
this.displayInFullPage = value;
|
|
1036
|
+
}
|
|
1037
|
+
},
|
|
1038
|
+
methods: {
|
|
1039
|
+
/*
|
|
1040
|
+
* Close the Modal if canCancel.
|
|
1041
|
+
*/
|
|
1042
|
+
cancel() {
|
|
1043
|
+
if (!this.canCancel || !this.isActive) return;
|
|
1044
|
+
this.close();
|
|
1045
|
+
},
|
|
1046
|
+
/*
|
|
1047
|
+
* Emit events, and destroy modal if it's programmatic.
|
|
1048
|
+
*/
|
|
1049
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
1050
|
+
close(...args) {
|
|
1051
|
+
this.onCancel.apply(null, args);
|
|
1052
|
+
this.$emit("close");
|
|
1053
|
+
this.$emit("update:modelValue", false);
|
|
1054
|
+
if (this.programmatic) {
|
|
1055
|
+
this.isActive = false;
|
|
1056
|
+
setTimeout(() => {
|
|
1057
|
+
removeElement(this.$el);
|
|
1058
|
+
}, 150);
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
/*
|
|
1062
|
+
* Keypress event that is bound to the document.
|
|
1063
|
+
*/
|
|
1064
|
+
keyPress({ key }) {
|
|
1065
|
+
if (key === "Escape" || key === "Esc") this.cancel();
|
|
1066
|
+
}
|
|
1067
|
+
},
|
|
1068
|
+
created() {
|
|
1069
|
+
if (typeof window !== "undefined") {
|
|
1070
|
+
document.addEventListener("keyup", this.keyPress);
|
|
1071
|
+
}
|
|
1072
|
+
},
|
|
1073
|
+
mounted() {
|
|
1074
|
+
if (this.programmatic) {
|
|
1075
|
+
if (!this.container) {
|
|
1076
|
+
document.body.appendChild(this.$el);
|
|
1077
|
+
} else {
|
|
1078
|
+
this.displayInFullPage = false;
|
|
1079
|
+
this.$emit("update:is-full-page", false);
|
|
1080
|
+
this.container.appendChild(this.$el);
|
|
1081
|
+
}
|
|
1082
|
+
this.isActive = true;
|
|
1083
|
+
}
|
|
1084
|
+
},
|
|
1085
|
+
beforeUnmount() {
|
|
1086
|
+
if (typeof window !== "undefined") {
|
|
1087
|
+
document.removeEventListener("keyup", this.keyPress);
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
});
|
|
1091
|
+
|
|
1092
|
+
const _hoisted_1$5 = /* @__PURE__ */ vue.createElementVNode(
|
|
1093
|
+
"div",
|
|
1094
|
+
{ class: "loading-icon" },
|
|
1095
|
+
null,
|
|
1096
|
+
-1
|
|
1097
|
+
/* HOISTED */
|
|
1098
|
+
);
|
|
1099
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1100
|
+
return vue.openBlock(), vue.createBlock(vue.Transition, { name: _ctx.animation }, {
|
|
1101
|
+
default: vue.withCtx(() => [
|
|
1102
|
+
_ctx.isActive ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
1103
|
+
"div",
|
|
1104
|
+
{
|
|
1105
|
+
key: 0,
|
|
1106
|
+
class: vue.normalizeClass(["loading-overlay is-active", { "is-full-page": _ctx.displayInFullPage }])
|
|
1107
|
+
},
|
|
1108
|
+
[
|
|
1109
|
+
vue.createElementVNode("div", {
|
|
1110
|
+
class: "loading-background",
|
|
1111
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.cancel && _ctx.cancel(...args))
|
|
1112
|
+
}),
|
|
1113
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1114
|
+
_hoisted_1$5
|
|
1115
|
+
])
|
|
1116
|
+
],
|
|
1117
|
+
2
|
|
1118
|
+
/* CLASS */
|
|
1119
|
+
)), [
|
|
1120
|
+
[vue.vShow, _ctx.isActive]
|
|
1121
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
1122
|
+
]),
|
|
1123
|
+
_: 3
|
|
1124
|
+
/* FORWARDED */
|
|
1125
|
+
}, 8, ["name"]);
|
|
1126
|
+
}
|
|
1127
|
+
var BLoading = /* @__PURE__ */ _export_sfc(Loading, [["render", _sfc_render$6]]);
|
|
1128
|
+
|
|
1129
|
+
var BSlotComponent = vue.defineComponent({
|
|
1130
|
+
name: "BSlotComponent",
|
|
1131
|
+
props: {
|
|
1132
|
+
component: {
|
|
1133
|
+
type: Object,
|
|
1134
|
+
required: true
|
|
1135
|
+
},
|
|
1136
|
+
name: {
|
|
1137
|
+
type: String,
|
|
1138
|
+
default: "default"
|
|
1139
|
+
},
|
|
1140
|
+
scoped: {
|
|
1141
|
+
type: Boolean
|
|
1142
|
+
},
|
|
1143
|
+
props: {
|
|
1144
|
+
type: Object
|
|
1145
|
+
},
|
|
1146
|
+
tag: {
|
|
1147
|
+
type: [String, Object],
|
|
1148
|
+
default: "div"
|
|
1149
|
+
}
|
|
1150
|
+
},
|
|
1151
|
+
methods: {
|
|
1152
|
+
refresh() {
|
|
1153
|
+
this.$forceUpdate();
|
|
1154
|
+
}
|
|
1155
|
+
},
|
|
1156
|
+
render() {
|
|
1157
|
+
return vue.h(
|
|
1158
|
+
this.tag,
|
|
1159
|
+
{},
|
|
1160
|
+
this.component.$slots ? this.scoped ? this.component.$slots[this.name](this.props) : this.component.$slots[this.name]() : void 0
|
|
1161
|
+
);
|
|
1162
|
+
}
|
|
1163
|
+
});
|
|
1164
|
+
|
|
1165
|
+
var _sfc_main$6 = vue.defineComponent({
|
|
1166
|
+
name: "BSelect",
|
|
1167
|
+
components: {
|
|
1168
|
+
BIcon
|
|
1169
|
+
},
|
|
1170
|
+
mixins: [CompatFallthroughMixin, FormElementMixin],
|
|
1171
|
+
props: {
|
|
1172
|
+
modelValue: {
|
|
1173
|
+
type: [
|
|
1174
|
+
String,
|
|
1175
|
+
Number,
|
|
1176
|
+
Boolean,
|
|
1177
|
+
Object,
|
|
1178
|
+
Array,
|
|
1179
|
+
Function,
|
|
1180
|
+
Date,
|
|
1181
|
+
null
|
|
1182
|
+
],
|
|
1183
|
+
default: null
|
|
1184
|
+
},
|
|
1185
|
+
placeholder: String,
|
|
1186
|
+
multiple: Boolean,
|
|
1187
|
+
nativeSize: [String, Number]
|
|
1188
|
+
},
|
|
1189
|
+
emits: {
|
|
1190
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1191
|
+
blur: (_event) => true,
|
|
1192
|
+
focus: (_event) => true,
|
|
1193
|
+
"update:modelValue": (_value) => true
|
|
1194
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1195
|
+
},
|
|
1196
|
+
data() {
|
|
1197
|
+
return {
|
|
1198
|
+
selected: this.modelValue,
|
|
1199
|
+
_elementRef: "select"
|
|
1200
|
+
};
|
|
1201
|
+
},
|
|
1202
|
+
computed: {
|
|
1203
|
+
computedValue: {
|
|
1204
|
+
get() {
|
|
1205
|
+
return this.selected;
|
|
1206
|
+
},
|
|
1207
|
+
set(value) {
|
|
1208
|
+
this.selected = value;
|
|
1209
|
+
this.$emit("update:modelValue", value);
|
|
1210
|
+
!this.isValid && this.checkHtml5Validity();
|
|
1211
|
+
}
|
|
1212
|
+
},
|
|
1213
|
+
spanClasses() {
|
|
1214
|
+
return [this.size, this.statusType, {
|
|
1215
|
+
"is-fullwidth": this.expanded,
|
|
1216
|
+
"is-loading": this.loading,
|
|
1217
|
+
"is-multiple": this.multiple,
|
|
1218
|
+
"is-rounded": this.rounded,
|
|
1219
|
+
"is-empty": this.selected === null
|
|
1220
|
+
}];
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
watch: {
|
|
1224
|
+
/*
|
|
1225
|
+
* When v-model is changed:
|
|
1226
|
+
* 1. Set the selected option.
|
|
1227
|
+
* 2. If it's invalid, validate again.
|
|
1228
|
+
*/
|
|
1229
|
+
modelValue(value) {
|
|
1230
|
+
this.selected = value;
|
|
1231
|
+
!this.isValid && this.checkHtml5Validity();
|
|
1232
|
+
}
|
|
1233
|
+
}
|
|
1234
|
+
});
|
|
1235
|
+
|
|
1236
|
+
const _hoisted_1$4 = ["multiple", "size"];
|
|
1237
|
+
const _hoisted_2$4 = {
|
|
1238
|
+
key: 0,
|
|
1239
|
+
value: null,
|
|
1240
|
+
disabled: "",
|
|
1241
|
+
hidden: ""
|
|
1242
|
+
};
|
|
1243
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1244
|
+
const _component_b_icon = vue.resolveComponent("b-icon");
|
|
1245
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
1246
|
+
"div",
|
|
1247
|
+
vue.mergeProps({
|
|
1248
|
+
class: ["control", { "is-expanded": _ctx.expanded, "has-icons-left": _ctx.icon }]
|
|
1249
|
+
}, _ctx.rootAttrs),
|
|
1250
|
+
[
|
|
1251
|
+
vue.createElementVNode(
|
|
1252
|
+
"span",
|
|
1253
|
+
{
|
|
1254
|
+
class: vue.normalizeClass(["select", _ctx.spanClasses])
|
|
1255
|
+
},
|
|
1256
|
+
[
|
|
1257
|
+
vue.withDirectives(vue.createElementVNode("select", vue.mergeProps({
|
|
1258
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.computedValue = $event),
|
|
1259
|
+
ref: "select",
|
|
1260
|
+
multiple: _ctx.multiple,
|
|
1261
|
+
size: _ctx.nativeSize
|
|
1262
|
+
}, _ctx.fallthroughAttrs, {
|
|
1263
|
+
onBlur: _cache[1] || (_cache[1] = (...args) => _ctx.onBlur && _ctx.onBlur(...args)),
|
|
1264
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("focus", $event))
|
|
1265
|
+
}), [
|
|
1266
|
+
_ctx.placeholder ? (vue.openBlock(), vue.createElementBlock(
|
|
1267
|
+
vue.Fragment,
|
|
1268
|
+
{ key: 0 },
|
|
1269
|
+
[
|
|
1270
|
+
_ctx.computedValue == null ? (vue.openBlock(), vue.createElementBlock(
|
|
1271
|
+
"option",
|
|
1272
|
+
_hoisted_2$4,
|
|
1273
|
+
vue.toDisplayString(_ctx.placeholder),
|
|
1274
|
+
1
|
|
1275
|
+
/* TEXT */
|
|
1276
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
1277
|
+
],
|
|
1278
|
+
64
|
|
1279
|
+
/* STABLE_FRAGMENT */
|
|
1280
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
1281
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
1282
|
+
], 16, _hoisted_1$4), [
|
|
1283
|
+
[vue.vModelSelect, _ctx.computedValue]
|
|
1284
|
+
])
|
|
1285
|
+
],
|
|
1286
|
+
2
|
|
1287
|
+
/* CLASS */
|
|
1288
|
+
),
|
|
1289
|
+
_ctx.icon ? (vue.openBlock(), vue.createBlock(_component_b_icon, {
|
|
1290
|
+
key: 0,
|
|
1291
|
+
class: "is-left",
|
|
1292
|
+
icon: _ctx.icon,
|
|
1293
|
+
pack: _ctx.iconPack,
|
|
1294
|
+
size: _ctx.iconSize
|
|
1295
|
+
}, null, 8, ["icon", "pack", "size"])) : vue.createCommentVNode("v-if", true)
|
|
1296
|
+
],
|
|
1297
|
+
16
|
|
1298
|
+
/* FULL_PROPS */
|
|
1299
|
+
);
|
|
1300
|
+
}
|
|
1301
|
+
var BSelect = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["render", _sfc_render$5]]);
|
|
1302
|
+
|
|
1303
|
+
var _sfc_main$5 = vue.defineComponent({
|
|
1304
|
+
name: "BTableMobileSort",
|
|
1305
|
+
components: {
|
|
1306
|
+
BSelect,
|
|
1307
|
+
BIcon
|
|
1308
|
+
},
|
|
1309
|
+
props: {
|
|
1310
|
+
currentSortColumn: Object,
|
|
1311
|
+
sortMultipleData: Array,
|
|
1312
|
+
isAsc: Boolean,
|
|
1313
|
+
columns: Array,
|
|
1314
|
+
placeholder: String,
|
|
1315
|
+
iconPack: String,
|
|
1316
|
+
sortIcon: {
|
|
1317
|
+
type: String,
|
|
1318
|
+
default: "arrow-up"
|
|
1319
|
+
},
|
|
1320
|
+
sortIconSize: {
|
|
1321
|
+
type: String,
|
|
1322
|
+
default: "is-small"
|
|
1323
|
+
},
|
|
1324
|
+
sortMultiple: {
|
|
1325
|
+
type: Boolean,
|
|
1326
|
+
default: false
|
|
1327
|
+
}
|
|
1328
|
+
},
|
|
1329
|
+
emits: {
|
|
1330
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1331
|
+
removePriority: (_column) => true,
|
|
1332
|
+
sort: (_column, _event) => true
|
|
1333
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1334
|
+
},
|
|
1335
|
+
data() {
|
|
1336
|
+
return {
|
|
1337
|
+
sortMultipleSelect: null,
|
|
1338
|
+
sortMultipleSelectIndex: -1,
|
|
1339
|
+
mobileSort: this.currentSortColumn,
|
|
1340
|
+
mobileSortIndex: this.columns ? this.columns.indexOf(this.currentSortColumn) : -1,
|
|
1341
|
+
defaultEvent: {
|
|
1342
|
+
shiftKey: true,
|
|
1343
|
+
altKey: true,
|
|
1344
|
+
ctrlKey: true
|
|
1345
|
+
},
|
|
1346
|
+
ignoreSort: false
|
|
1347
|
+
};
|
|
1348
|
+
},
|
|
1349
|
+
computed: {
|
|
1350
|
+
showPlaceholder() {
|
|
1351
|
+
return !this.columns || !this.columns.some((column) => column === this.mobileSort);
|
|
1352
|
+
},
|
|
1353
|
+
sortableColumns() {
|
|
1354
|
+
return this.columns && this.columns.filter((column) => column.sortable);
|
|
1355
|
+
}
|
|
1356
|
+
},
|
|
1357
|
+
watch: {
|
|
1358
|
+
sortMultipleSelect(column) {
|
|
1359
|
+
if (this.ignoreSort) {
|
|
1360
|
+
this.ignoreSort = false;
|
|
1361
|
+
} else {
|
|
1362
|
+
this.$emit("sort", column, this.defaultEvent);
|
|
1363
|
+
}
|
|
1364
|
+
},
|
|
1365
|
+
sortMultipleSelectIndex(index) {
|
|
1366
|
+
if (index !== -1) {
|
|
1367
|
+
this.sortMultipleSelect = this.columns[index];
|
|
1368
|
+
} else {
|
|
1369
|
+
this.sortMultipleSelect = null;
|
|
1370
|
+
}
|
|
1371
|
+
},
|
|
1372
|
+
mobileSort(column) {
|
|
1373
|
+
if (this.currentSortColumn === column) return;
|
|
1374
|
+
this.$emit("sort", column, this.defaultEvent);
|
|
1375
|
+
},
|
|
1376
|
+
mobileSortIndex(index) {
|
|
1377
|
+
if (index !== -1) {
|
|
1378
|
+
this.mobileSort = this.columns[index];
|
|
1379
|
+
}
|
|
1380
|
+
},
|
|
1381
|
+
currentSortColumn(column) {
|
|
1382
|
+
this.mobileSort = column;
|
|
1383
|
+
this.mobileSortIndex = this.columns ? this.columns.indexOf(column) : -1;
|
|
1384
|
+
},
|
|
1385
|
+
columns(newColumns) {
|
|
1386
|
+
if (this.sortMultiple) {
|
|
1387
|
+
this.sortMultipleSelectIndex = newColumns.indexOf(
|
|
1388
|
+
this.sortMultipleSelect
|
|
1389
|
+
);
|
|
1390
|
+
} else {
|
|
1391
|
+
this.mobileSortIndex = newColumns.indexOf(this.mobileSort);
|
|
1392
|
+
}
|
|
1393
|
+
}
|
|
1394
|
+
},
|
|
1395
|
+
methods: {
|
|
1396
|
+
removePriority() {
|
|
1397
|
+
this.$emit("removePriority", this.sortMultipleSelect);
|
|
1398
|
+
this.ignoreSort = true;
|
|
1399
|
+
const remainingFields = this.sortMultipleData.filter((data) => data.field !== this.sortMultipleSelect.field).map((data) => data.field);
|
|
1400
|
+
this.sortMultipleSelectIndex = this.columns.findIndex((column) => remainingFields.includes(column.field));
|
|
1401
|
+
},
|
|
1402
|
+
getSortingObjectOfColumn(column) {
|
|
1403
|
+
return this.sortMultipleData.filter((i) => i.field === column.field)[0];
|
|
1404
|
+
},
|
|
1405
|
+
columnIsDesc(column) {
|
|
1406
|
+
const sortingObject = column && this.getSortingObjectOfColumn(column);
|
|
1407
|
+
if (sortingObject) {
|
|
1408
|
+
return !!(sortingObject.order && sortingObject.order === "desc");
|
|
1409
|
+
}
|
|
1410
|
+
return true;
|
|
1411
|
+
},
|
|
1412
|
+
getLabel(column) {
|
|
1413
|
+
const sortingObject = this.getSortingObjectOfColumn(column);
|
|
1414
|
+
if (sortingObject) {
|
|
1415
|
+
return column.label + "(" + (this.sortMultipleData.indexOf(sortingObject) + 1) + ")";
|
|
1416
|
+
}
|
|
1417
|
+
return column.label;
|
|
1418
|
+
},
|
|
1419
|
+
sort() {
|
|
1420
|
+
this.$emit("sort", this.sortMultiple ? this.sortMultipleSelect : this.mobileSort, this.defaultEvent);
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
});
|
|
1424
|
+
|
|
1425
|
+
const _hoisted_1$3 = { class: "field table-mobile-sort" };
|
|
1426
|
+
const _hoisted_2$3 = { class: "field has-addons" };
|
|
1427
|
+
const _hoisted_3$3 = ["value"];
|
|
1428
|
+
const _hoisted_4$3 = ["value"];
|
|
1429
|
+
const _hoisted_5$2 = { class: "control" };
|
|
1430
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1431
|
+
const _component_b_select = vue.resolveComponent("b-select");
|
|
1432
|
+
const _component_b_icon = vue.resolveComponent("b-icon");
|
|
1433
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$3, [
|
|
1434
|
+
vue.createElementVNode("div", _hoisted_2$3, [
|
|
1435
|
+
_ctx.sortMultiple ? (vue.openBlock(), vue.createBlock(_component_b_select, {
|
|
1436
|
+
key: 0,
|
|
1437
|
+
modelValue: _ctx.sortMultipleSelectIndex,
|
|
1438
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.sortMultipleSelectIndex = $event),
|
|
1439
|
+
expanded: ""
|
|
1440
|
+
}, {
|
|
1441
|
+
default: vue.withCtx(() => [
|
|
1442
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
1443
|
+
vue.Fragment,
|
|
1444
|
+
null,
|
|
1445
|
+
vue.renderList(_ctx.sortableColumns, (column, index) => {
|
|
1446
|
+
return vue.openBlock(), vue.createElementBlock("option", {
|
|
1447
|
+
key: index,
|
|
1448
|
+
value: index
|
|
1449
|
+
}, [
|
|
1450
|
+
vue.createTextVNode(
|
|
1451
|
+
vue.toDisplayString(_ctx.getLabel(column)) + " ",
|
|
1452
|
+
1
|
|
1453
|
+
/* TEXT */
|
|
1454
|
+
),
|
|
1455
|
+
_ctx.getSortingObjectOfColumn(column) ? (vue.openBlock(), vue.createElementBlock(
|
|
1456
|
+
vue.Fragment,
|
|
1457
|
+
{ key: 0 },
|
|
1458
|
+
[
|
|
1459
|
+
_ctx.columnIsDesc(column) ? (vue.openBlock(), vue.createElementBlock(
|
|
1460
|
+
vue.Fragment,
|
|
1461
|
+
{ key: 0 },
|
|
1462
|
+
[
|
|
1463
|
+
vue.createTextVNode(" ↓ ")
|
|
1464
|
+
],
|
|
1465
|
+
64
|
|
1466
|
+
/* STABLE_FRAGMENT */
|
|
1467
|
+
)) : (vue.openBlock(), vue.createElementBlock(
|
|
1468
|
+
vue.Fragment,
|
|
1469
|
+
{ key: 1 },
|
|
1470
|
+
[
|
|
1471
|
+
vue.createTextVNode(" ↑ ")
|
|
1472
|
+
],
|
|
1473
|
+
64
|
|
1474
|
+
/* STABLE_FRAGMENT */
|
|
1475
|
+
))
|
|
1476
|
+
],
|
|
1477
|
+
64
|
|
1478
|
+
/* STABLE_FRAGMENT */
|
|
1479
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
1480
|
+
], 8, _hoisted_3$3);
|
|
1481
|
+
}),
|
|
1482
|
+
128
|
|
1483
|
+
/* KEYED_FRAGMENT */
|
|
1484
|
+
))
|
|
1485
|
+
]),
|
|
1486
|
+
_: 1
|
|
1487
|
+
/* STABLE */
|
|
1488
|
+
}, 8, ["modelValue"])) : (vue.openBlock(), vue.createBlock(_component_b_select, {
|
|
1489
|
+
key: 1,
|
|
1490
|
+
modelValue: _ctx.mobileSortIndex,
|
|
1491
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.mobileSortIndex = $event),
|
|
1492
|
+
expanded: ""
|
|
1493
|
+
}, {
|
|
1494
|
+
default: vue.withCtx(() => [
|
|
1495
|
+
_ctx.placeholder ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
1496
|
+
"option",
|
|
1497
|
+
{
|
|
1498
|
+
key: 0,
|
|
1499
|
+
value: {},
|
|
1500
|
+
selected: "",
|
|
1501
|
+
disabled: "",
|
|
1502
|
+
hidden: ""
|
|
1503
|
+
},
|
|
1504
|
+
vue.toDisplayString(_ctx.placeholder),
|
|
1505
|
+
513
|
|
1506
|
+
/* TEXT, NEED_PATCH */
|
|
1507
|
+
)), [
|
|
1508
|
+
[vue.vShow, _ctx.showPlaceholder]
|
|
1509
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
1510
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
1511
|
+
vue.Fragment,
|
|
1512
|
+
null,
|
|
1513
|
+
vue.renderList(_ctx.sortableColumns, (column, index) => {
|
|
1514
|
+
return vue.openBlock(), vue.createElementBlock("option", {
|
|
1515
|
+
key: index,
|
|
1516
|
+
value: index
|
|
1517
|
+
}, vue.toDisplayString(column.label), 9, _hoisted_4$3);
|
|
1518
|
+
}),
|
|
1519
|
+
128
|
|
1520
|
+
/* KEYED_FRAGMENT */
|
|
1521
|
+
))
|
|
1522
|
+
]),
|
|
1523
|
+
_: 1
|
|
1524
|
+
/* STABLE */
|
|
1525
|
+
}, 8, ["modelValue"])),
|
|
1526
|
+
vue.createElementVNode("div", _hoisted_5$2, [
|
|
1527
|
+
_ctx.sortMultiple && _ctx.sortMultipleData.length > 0 ? (vue.openBlock(), vue.createElementBlock(
|
|
1528
|
+
vue.Fragment,
|
|
1529
|
+
{ key: 0 },
|
|
1530
|
+
[
|
|
1531
|
+
vue.createElementVNode("button", {
|
|
1532
|
+
class: "button is-primary",
|
|
1533
|
+
onClick: _cache[2] || (_cache[2] = (...args) => _ctx.sort && _ctx.sort(...args))
|
|
1534
|
+
}, [
|
|
1535
|
+
vue.createVNode(_component_b_icon, {
|
|
1536
|
+
class: vue.normalizeClass({ "is-desc": _ctx.columnIsDesc(_ctx.sortMultipleSelect) }),
|
|
1537
|
+
icon: _ctx.sortIcon,
|
|
1538
|
+
pack: _ctx.iconPack,
|
|
1539
|
+
size: _ctx.sortIconSize,
|
|
1540
|
+
both: ""
|
|
1541
|
+
}, null, 8, ["class", "icon", "pack", "size"])
|
|
1542
|
+
]),
|
|
1543
|
+
vue.createElementVNode("button", {
|
|
1544
|
+
class: "button is-primary",
|
|
1545
|
+
onClick: _cache[3] || (_cache[3] = (...args) => _ctx.removePriority && _ctx.removePriority(...args))
|
|
1546
|
+
}, [
|
|
1547
|
+
vue.createVNode(_component_b_icon, {
|
|
1548
|
+
icon: "delete",
|
|
1549
|
+
size: _ctx.sortIconSize,
|
|
1550
|
+
both: ""
|
|
1551
|
+
}, null, 8, ["size"])
|
|
1552
|
+
])
|
|
1553
|
+
],
|
|
1554
|
+
64
|
|
1555
|
+
/* STABLE_FRAGMENT */
|
|
1556
|
+
)) : !_ctx.sortMultiple ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
1557
|
+
key: 1,
|
|
1558
|
+
class: "button is-primary",
|
|
1559
|
+
onClick: _cache[4] || (_cache[4] = (...args) => _ctx.sort && _ctx.sort(...args))
|
|
1560
|
+
}, [
|
|
1561
|
+
vue.withDirectives(vue.createVNode(_component_b_icon, {
|
|
1562
|
+
class: vue.normalizeClass({ "is-desc": !_ctx.isAsc }),
|
|
1563
|
+
icon: _ctx.sortIcon,
|
|
1564
|
+
pack: _ctx.iconPack,
|
|
1565
|
+
size: _ctx.sortIconSize,
|
|
1566
|
+
both: ""
|
|
1567
|
+
}, null, 8, ["class", "icon", "pack", "size"]), [
|
|
1568
|
+
[vue.vShow, _ctx.currentSortColumn === _ctx.mobileSort]
|
|
1569
|
+
])
|
|
1570
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
1571
|
+
])
|
|
1572
|
+
])
|
|
1573
|
+
]);
|
|
1574
|
+
}
|
|
1575
|
+
var BTableMobileSort = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render$4]]);
|
|
1576
|
+
|
|
1577
|
+
var _sfc_main$4 = vue.defineComponent({
|
|
1578
|
+
name: "BPaginationButton",
|
|
1579
|
+
props: {
|
|
1580
|
+
page: {
|
|
1581
|
+
type: Object,
|
|
1582
|
+
required: true
|
|
1583
|
+
},
|
|
1584
|
+
tag: {
|
|
1585
|
+
type: [String, Object],
|
|
1586
|
+
default: "a",
|
|
1587
|
+
validator: (value) => {
|
|
1588
|
+
return typeof value === "object" || config.defaultLinkTags.indexOf(value) >= 0;
|
|
1589
|
+
}
|
|
1590
|
+
},
|
|
1591
|
+
disabled: {
|
|
1592
|
+
type: Boolean,
|
|
1593
|
+
default: false
|
|
1594
|
+
}
|
|
1595
|
+
},
|
|
1596
|
+
computed: {
|
|
1597
|
+
href() {
|
|
1598
|
+
if (this.tag === "a") {
|
|
1599
|
+
return "#";
|
|
1600
|
+
} else {
|
|
1601
|
+
return void 0;
|
|
1602
|
+
}
|
|
1603
|
+
},
|
|
1604
|
+
isDisabled() {
|
|
1605
|
+
return this.disabled || this.page.disabled;
|
|
1606
|
+
},
|
|
1607
|
+
disabledOrUndefined() {
|
|
1608
|
+
return this.isDisabled || void 0;
|
|
1609
|
+
}
|
|
1610
|
+
}
|
|
1611
|
+
});
|
|
1612
|
+
|
|
1613
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1614
|
+
return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.tag), vue.mergeProps({
|
|
1615
|
+
role: "button",
|
|
1616
|
+
href: _ctx.href,
|
|
1617
|
+
disabled: _ctx.disabledOrUndefined,
|
|
1618
|
+
class: ["pagination-link", { "is-current": _ctx.page.isCurrent, [_ctx.page.class]: true }]
|
|
1619
|
+
}, _ctx.$attrs, {
|
|
1620
|
+
onClick: vue.withModifiers(_ctx.page.click, ["prevent"]),
|
|
1621
|
+
"aria-label": _ctx.page["aria-label"],
|
|
1622
|
+
"aria-current": _ctx.page.isCurrent || void 0
|
|
1623
|
+
}), {
|
|
1624
|
+
default: vue.withCtx(() => [
|
|
1625
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
1626
|
+
vue.createTextVNode(
|
|
1627
|
+
vue.toDisplayString(_ctx.page.number),
|
|
1628
|
+
1
|
|
1629
|
+
/* TEXT */
|
|
1630
|
+
)
|
|
1631
|
+
])
|
|
1632
|
+
]),
|
|
1633
|
+
_: 3
|
|
1634
|
+
/* FORWARDED */
|
|
1635
|
+
}, 16, ["href", "disabled", "class", "onClick", "aria-label", "aria-current"]);
|
|
1636
|
+
}
|
|
1637
|
+
var BPaginationButton = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["render", _sfc_render$3]]);
|
|
1638
|
+
|
|
1639
|
+
var _sfc_main$3 = vue.defineComponent({
|
|
1640
|
+
name: "BPagination",
|
|
1641
|
+
components: {
|
|
1642
|
+
BIcon,
|
|
1643
|
+
BPaginationButton
|
|
1644
|
+
},
|
|
1645
|
+
props: {
|
|
1646
|
+
total: [Number, String],
|
|
1647
|
+
perPage: {
|
|
1648
|
+
type: [Number, String],
|
|
1649
|
+
default: 20
|
|
1650
|
+
},
|
|
1651
|
+
modelValue: {
|
|
1652
|
+
type: [Number, String],
|
|
1653
|
+
default: 1
|
|
1654
|
+
},
|
|
1655
|
+
rangeBefore: {
|
|
1656
|
+
type: [Number, String],
|
|
1657
|
+
default: 1
|
|
1658
|
+
},
|
|
1659
|
+
rangeAfter: {
|
|
1660
|
+
type: [Number, String],
|
|
1661
|
+
default: 1
|
|
1662
|
+
},
|
|
1663
|
+
size: String,
|
|
1664
|
+
simple: Boolean,
|
|
1665
|
+
rounded: Boolean,
|
|
1666
|
+
order: String,
|
|
1667
|
+
iconPack: String,
|
|
1668
|
+
iconPrev: {
|
|
1669
|
+
type: String,
|
|
1670
|
+
default: () => {
|
|
1671
|
+
return config.defaultIconPrev;
|
|
1672
|
+
}
|
|
1673
|
+
},
|
|
1674
|
+
iconNext: {
|
|
1675
|
+
type: String,
|
|
1676
|
+
default: () => {
|
|
1677
|
+
return config.defaultIconNext;
|
|
1678
|
+
}
|
|
1679
|
+
},
|
|
1680
|
+
ariaNextLabel: String,
|
|
1681
|
+
ariaPreviousLabel: String,
|
|
1682
|
+
ariaPageLabel: String,
|
|
1683
|
+
ariaCurrentLabel: String,
|
|
1684
|
+
pageInput: {
|
|
1685
|
+
type: Boolean,
|
|
1686
|
+
default: false
|
|
1687
|
+
},
|
|
1688
|
+
pageInputPosition: String,
|
|
1689
|
+
debouncePageInput: [Number, String]
|
|
1690
|
+
},
|
|
1691
|
+
data() {
|
|
1692
|
+
return {
|
|
1693
|
+
inputValue: this.modelValue,
|
|
1694
|
+
debounceHandlePageInput: void 0
|
|
1695
|
+
};
|
|
1696
|
+
},
|
|
1697
|
+
emits: {
|
|
1698
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
1699
|
+
change: (_num) => true,
|
|
1700
|
+
"update:modelValue": (_num) => true
|
|
1701
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
1702
|
+
},
|
|
1703
|
+
computed: {
|
|
1704
|
+
rootClasses() {
|
|
1705
|
+
return [
|
|
1706
|
+
this.order,
|
|
1707
|
+
this.size,
|
|
1708
|
+
this.pageInputPosition,
|
|
1709
|
+
{
|
|
1710
|
+
"is-simple": this.simple,
|
|
1711
|
+
"is-rounded": this.rounded,
|
|
1712
|
+
"has-input": this.pageInput
|
|
1713
|
+
}
|
|
1714
|
+
];
|
|
1715
|
+
},
|
|
1716
|
+
beforeCurrent() {
|
|
1717
|
+
return parseInt(this.rangeBefore + "");
|
|
1718
|
+
},
|
|
1719
|
+
afterCurrent() {
|
|
1720
|
+
return parseInt(this.rangeAfter + "");
|
|
1721
|
+
},
|
|
1722
|
+
/*
|
|
1723
|
+
* Total page size (count).
|
|
1724
|
+
*/
|
|
1725
|
+
pageCount() {
|
|
1726
|
+
return Math.ceil(+this.total / +this.perPage);
|
|
1727
|
+
},
|
|
1728
|
+
/*
|
|
1729
|
+
* First item of the page (count).
|
|
1730
|
+
*/
|
|
1731
|
+
firstItem() {
|
|
1732
|
+
const firstItem = +this.modelValue * +this.perPage - +this.perPage + 1;
|
|
1733
|
+
return firstItem >= 0 ? firstItem : 0;
|
|
1734
|
+
},
|
|
1735
|
+
/*
|
|
1736
|
+
* Check if previous button is available.
|
|
1737
|
+
*/
|
|
1738
|
+
hasPrev() {
|
|
1739
|
+
return +this.modelValue > 1;
|
|
1740
|
+
},
|
|
1741
|
+
/*
|
|
1742
|
+
* Check if first page button should be visible.
|
|
1743
|
+
*/
|
|
1744
|
+
hasFirst() {
|
|
1745
|
+
return +this.modelValue >= 2 + this.beforeCurrent;
|
|
1746
|
+
},
|
|
1747
|
+
/*
|
|
1748
|
+
* Check if first ellipsis should be visible.
|
|
1749
|
+
*/
|
|
1750
|
+
hasFirstEllipsis() {
|
|
1751
|
+
return +this.modelValue >= this.beforeCurrent + 4;
|
|
1752
|
+
},
|
|
1753
|
+
/*
|
|
1754
|
+
* Check if last page button should be visible.
|
|
1755
|
+
*/
|
|
1756
|
+
hasLast() {
|
|
1757
|
+
return +this.modelValue <= this.pageCount - (1 + this.afterCurrent);
|
|
1758
|
+
},
|
|
1759
|
+
/*
|
|
1760
|
+
* Check if last ellipsis should be visible.
|
|
1761
|
+
*/
|
|
1762
|
+
hasLastEllipsis() {
|
|
1763
|
+
return +this.modelValue < this.pageCount - (2 + this.afterCurrent);
|
|
1764
|
+
},
|
|
1765
|
+
/*
|
|
1766
|
+
* Check if next button is available.
|
|
1767
|
+
*/
|
|
1768
|
+
hasNext() {
|
|
1769
|
+
return +this.modelValue < this.pageCount;
|
|
1770
|
+
},
|
|
1771
|
+
/*
|
|
1772
|
+
* Get near pages, 1 before and 1 after the current.
|
|
1773
|
+
* Also add the click event to the array.
|
|
1774
|
+
*/
|
|
1775
|
+
pagesInRange() {
|
|
1776
|
+
if (this.simple) return;
|
|
1777
|
+
let left = Math.max(1, +this.modelValue - this.beforeCurrent);
|
|
1778
|
+
if (left - 1 === 2) {
|
|
1779
|
+
left--;
|
|
1780
|
+
}
|
|
1781
|
+
let right = Math.min(+this.modelValue + this.afterCurrent, this.pageCount);
|
|
1782
|
+
if (this.pageCount - right === 2) {
|
|
1783
|
+
right++;
|
|
1784
|
+
}
|
|
1785
|
+
const pages = [];
|
|
1786
|
+
for (let i = left; i <= right; i++) {
|
|
1787
|
+
pages.push(this.getPage(i));
|
|
1788
|
+
}
|
|
1789
|
+
return pages;
|
|
1790
|
+
}
|
|
1791
|
+
},
|
|
1792
|
+
watch: {
|
|
1793
|
+
/*
|
|
1794
|
+
* If current page is trying to be greater than page count, set to last.
|
|
1795
|
+
*/
|
|
1796
|
+
pageCount(value) {
|
|
1797
|
+
if (this.modelValue > value) this.last();
|
|
1798
|
+
},
|
|
1799
|
+
modelValue(value) {
|
|
1800
|
+
this.inputValue = value;
|
|
1801
|
+
},
|
|
1802
|
+
debouncePageInput: {
|
|
1803
|
+
handler(value) {
|
|
1804
|
+
this.debounceHandlePageInput = debounce(
|
|
1805
|
+
this.handleOnInputPageChange,
|
|
1806
|
+
value
|
|
1807
|
+
);
|
|
1808
|
+
},
|
|
1809
|
+
immediate: true
|
|
1810
|
+
}
|
|
1811
|
+
},
|
|
1812
|
+
methods: {
|
|
1813
|
+
/*
|
|
1814
|
+
* Previous button click listener.
|
|
1815
|
+
*/
|
|
1816
|
+
prev(event) {
|
|
1817
|
+
this.changePage(+this.modelValue - 1, event);
|
|
1818
|
+
},
|
|
1819
|
+
/*
|
|
1820
|
+
* Next button click listener.
|
|
1821
|
+
*/
|
|
1822
|
+
next(event) {
|
|
1823
|
+
this.changePage(+this.modelValue + 1, event);
|
|
1824
|
+
},
|
|
1825
|
+
/*
|
|
1826
|
+
* First button click listener.
|
|
1827
|
+
*/
|
|
1828
|
+
first(event) {
|
|
1829
|
+
this.changePage(1, event);
|
|
1830
|
+
},
|
|
1831
|
+
/*
|
|
1832
|
+
* Last button click listener.
|
|
1833
|
+
*/
|
|
1834
|
+
last(event) {
|
|
1835
|
+
this.changePage(this.pageCount, event);
|
|
1836
|
+
},
|
|
1837
|
+
changePage(num, event) {
|
|
1838
|
+
if (this.modelValue === num || num < 1 || num > this.pageCount) return;
|
|
1839
|
+
this.$emit("update:modelValue", num);
|
|
1840
|
+
this.$emit("change", num);
|
|
1841
|
+
if (event && event.target) {
|
|
1842
|
+
this.$nextTick(() => event.target.focus());
|
|
1843
|
+
}
|
|
1844
|
+
},
|
|
1845
|
+
getPage(num, options = {}) {
|
|
1846
|
+
return {
|
|
1847
|
+
number: num,
|
|
1848
|
+
isCurrent: this.modelValue === num,
|
|
1849
|
+
click: (event) => this.changePage(num, event),
|
|
1850
|
+
input: (event, inputNum) => this.changePage(+inputNum, event),
|
|
1851
|
+
disabled: options.disabled || false,
|
|
1852
|
+
class: options.class || "",
|
|
1853
|
+
"aria-label": options["aria-label"] || this.getAriaPageLabel(num, this.modelValue === num)
|
|
1854
|
+
};
|
|
1855
|
+
},
|
|
1856
|
+
/*
|
|
1857
|
+
* Get text for aria-label according to page number.
|
|
1858
|
+
*/
|
|
1859
|
+
getAriaPageLabel(pageNumber, isCurrent) {
|
|
1860
|
+
if (this.ariaPageLabel && (!isCurrent || !this.ariaCurrentLabel)) {
|
|
1861
|
+
return this.ariaPageLabel + " " + pageNumber + ".";
|
|
1862
|
+
} else if (this.ariaPageLabel && isCurrent && this.ariaCurrentLabel) {
|
|
1863
|
+
return this.ariaCurrentLabel + ", " + this.ariaPageLabel + " " + pageNumber + ".";
|
|
1864
|
+
}
|
|
1865
|
+
return null;
|
|
1866
|
+
},
|
|
1867
|
+
handleOnInputPageChange(event) {
|
|
1868
|
+
this.getPage(+this.inputValue).input(event, this.inputValue);
|
|
1869
|
+
},
|
|
1870
|
+
handleOnInputDebounce(event) {
|
|
1871
|
+
if (this.debouncePageInput) {
|
|
1872
|
+
this.debounceHandlePageInput(event);
|
|
1873
|
+
} else {
|
|
1874
|
+
this.handleOnInputPageChange(event);
|
|
1875
|
+
}
|
|
1876
|
+
},
|
|
1877
|
+
handleOnKeyPress(event) {
|
|
1878
|
+
const ASCIICode = event.which || event.keyCode;
|
|
1879
|
+
if (ASCIICode >= 48 && ASCIICode <= 57) {
|
|
1880
|
+
return true;
|
|
1881
|
+
} else {
|
|
1882
|
+
return event.preventDefault();
|
|
1883
|
+
}
|
|
1884
|
+
},
|
|
1885
|
+
handleAllowableInputPageRange(event) {
|
|
1886
|
+
const target = event.target;
|
|
1887
|
+
if (+target.value > 0 && +target.value <= this.pageCount) {
|
|
1888
|
+
this.handleOnInputValue(event);
|
|
1889
|
+
} else {
|
|
1890
|
+
this.inputValue = 1;
|
|
1891
|
+
this.inputValue = "";
|
|
1892
|
+
}
|
|
1893
|
+
},
|
|
1894
|
+
handleOnInputValue(event) {
|
|
1895
|
+
const inputValue = +event.target.value;
|
|
1896
|
+
this.inputValue = inputValue;
|
|
1897
|
+
if (Number.isInteger(this.inputValue)) {
|
|
1898
|
+
this.handleOnInputDebounce(event);
|
|
1899
|
+
} else {
|
|
1900
|
+
this.inputValue = this.modelValue;
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
}
|
|
1904
|
+
});
|
|
1905
|
+
|
|
1906
|
+
const _hoisted_1$2 = { class: "control pagination-input" };
|
|
1907
|
+
const _hoisted_2$2 = ["value", "size", "maxlength"];
|
|
1908
|
+
const _hoisted_3$2 = {
|
|
1909
|
+
key: 4,
|
|
1910
|
+
class: "info"
|
|
1911
|
+
};
|
|
1912
|
+
const _hoisted_4$2 = {
|
|
1913
|
+
key: 5,
|
|
1914
|
+
class: "pagination-list"
|
|
1915
|
+
};
|
|
1916
|
+
const _hoisted_5$1 = { key: 0 };
|
|
1917
|
+
const _hoisted_6$1 = { key: 1 };
|
|
1918
|
+
const _hoisted_7$1 = /* @__PURE__ */ vue.createElementVNode(
|
|
1919
|
+
"span",
|
|
1920
|
+
{ class: "pagination-ellipsis" },
|
|
1921
|
+
"…",
|
|
1922
|
+
-1
|
|
1923
|
+
/* HOISTED */
|
|
1924
|
+
);
|
|
1925
|
+
const _hoisted_8$1 = [
|
|
1926
|
+
_hoisted_7$1
|
|
1927
|
+
];
|
|
1928
|
+
const _hoisted_9$1 = { key: 2 };
|
|
1929
|
+
const _hoisted_10$1 = /* @__PURE__ */ vue.createElementVNode(
|
|
1930
|
+
"span",
|
|
1931
|
+
{ class: "pagination-ellipsis" },
|
|
1932
|
+
"…",
|
|
1933
|
+
-1
|
|
1934
|
+
/* HOISTED */
|
|
1935
|
+
);
|
|
1936
|
+
const _hoisted_11$1 = [
|
|
1937
|
+
_hoisted_10$1
|
|
1938
|
+
];
|
|
1939
|
+
const _hoisted_12$1 = { key: 3 };
|
|
1940
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1941
|
+
const _component_b_icon = vue.resolveComponent("b-icon");
|
|
1942
|
+
const _component_BPaginationButton = vue.resolveComponent("BPaginationButton");
|
|
1943
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
1944
|
+
"nav",
|
|
1945
|
+
{
|
|
1946
|
+
class: vue.normalizeClass(["pagination", _ctx.rootClasses])
|
|
1947
|
+
},
|
|
1948
|
+
[
|
|
1949
|
+
_ctx.$slots.previous ? vue.renderSlot(_ctx.$slots, "previous", {
|
|
1950
|
+
key: 0,
|
|
1951
|
+
page: _ctx.getPage(+_ctx.modelValue - 1, {
|
|
1952
|
+
disabled: !_ctx.hasPrev,
|
|
1953
|
+
class: "pagination-previous",
|
|
1954
|
+
"aria-label": _ctx.ariaPreviousLabel
|
|
1955
|
+
})
|
|
1956
|
+
}, () => [
|
|
1957
|
+
vue.createVNode(_component_b_icon, {
|
|
1958
|
+
icon: _ctx.iconPrev,
|
|
1959
|
+
pack: _ctx.iconPack,
|
|
1960
|
+
both: "",
|
|
1961
|
+
"aria-hidden": "true"
|
|
1962
|
+
}, null, 8, ["icon", "pack"])
|
|
1963
|
+
]) : (vue.openBlock(), vue.createBlock(_component_BPaginationButton, {
|
|
1964
|
+
key: 1,
|
|
1965
|
+
class: "pagination-previous",
|
|
1966
|
+
disabled: !_ctx.hasPrev,
|
|
1967
|
+
page: _ctx.getPage(+_ctx.modelValue - 1),
|
|
1968
|
+
"aria-label": _ctx.ariaPreviousLabel
|
|
1969
|
+
}, {
|
|
1970
|
+
default: vue.withCtx(() => [
|
|
1971
|
+
vue.createVNode(_component_b_icon, {
|
|
1972
|
+
icon: _ctx.iconPrev,
|
|
1973
|
+
pack: _ctx.iconPack,
|
|
1974
|
+
both: "",
|
|
1975
|
+
"aria-hidden": "true"
|
|
1976
|
+
}, null, 8, ["icon", "pack"])
|
|
1977
|
+
]),
|
|
1978
|
+
_: 1
|
|
1979
|
+
/* STABLE */
|
|
1980
|
+
}, 8, ["disabled", "page", "aria-label"])),
|
|
1981
|
+
_ctx.$slots.next ? vue.renderSlot(_ctx.$slots, "next", {
|
|
1982
|
+
key: 2,
|
|
1983
|
+
page: _ctx.getPage(+_ctx.modelValue + 1, {
|
|
1984
|
+
disabled: !_ctx.hasNext,
|
|
1985
|
+
class: "pagination-next",
|
|
1986
|
+
"aria-label": _ctx.ariaNextLabel
|
|
1987
|
+
})
|
|
1988
|
+
}, () => [
|
|
1989
|
+
vue.createVNode(_component_b_icon, {
|
|
1990
|
+
icon: _ctx.iconNext,
|
|
1991
|
+
pack: _ctx.iconPack,
|
|
1992
|
+
both: "",
|
|
1993
|
+
"aria-hidden": "true"
|
|
1994
|
+
}, null, 8, ["icon", "pack"])
|
|
1995
|
+
]) : (vue.openBlock(), vue.createBlock(_component_BPaginationButton, {
|
|
1996
|
+
key: 3,
|
|
1997
|
+
class: "pagination-next",
|
|
1998
|
+
disabled: !_ctx.hasNext,
|
|
1999
|
+
page: _ctx.getPage(+_ctx.modelValue + 1),
|
|
2000
|
+
"aria-label": _ctx.ariaNextLabel
|
|
2001
|
+
}, {
|
|
2002
|
+
default: vue.withCtx(() => [
|
|
2003
|
+
vue.createVNode(_component_b_icon, {
|
|
2004
|
+
icon: _ctx.iconNext,
|
|
2005
|
+
pack: _ctx.iconPack,
|
|
2006
|
+
both: "",
|
|
2007
|
+
"aria-hidden": "true"
|
|
2008
|
+
}, null, 8, ["icon", "pack"])
|
|
2009
|
+
]),
|
|
2010
|
+
_: 1
|
|
2011
|
+
/* STABLE */
|
|
2012
|
+
}, 8, ["disabled", "page", "aria-label"])),
|
|
2013
|
+
vue.createElementVNode("div", _hoisted_1$2, [
|
|
2014
|
+
_ctx.pageInput ? (vue.openBlock(), vue.createElementBlock("input", {
|
|
2015
|
+
key: 0,
|
|
2016
|
+
class: "input",
|
|
2017
|
+
value: _ctx.inputValue,
|
|
2018
|
+
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.handleAllowableInputPageRange && _ctx.handleAllowableInputPageRange(...args)),
|
|
2019
|
+
onKeypress: _cache[1] || (_cache[1] = (...args) => _ctx.handleOnKeyPress && _ctx.handleOnKeyPress(...args)),
|
|
2020
|
+
size: _ctx.pageCount.toString().length,
|
|
2021
|
+
maxlength: _ctx.pageCount.toString().length
|
|
2022
|
+
}, null, 40, _hoisted_2$2)) : vue.createCommentVNode("v-if", true)
|
|
2023
|
+
]),
|
|
2024
|
+
_ctx.simple ? (vue.openBlock(), vue.createElementBlock("small", _hoisted_3$2, [
|
|
2025
|
+
_ctx.perPage == 1 ? (vue.openBlock(), vue.createElementBlock(
|
|
2026
|
+
vue.Fragment,
|
|
2027
|
+
{ key: 0 },
|
|
2028
|
+
[
|
|
2029
|
+
vue.createTextVNode(
|
|
2030
|
+
vue.toDisplayString(_ctx.firstItem) + " / " + vue.toDisplayString(_ctx.total),
|
|
2031
|
+
1
|
|
2032
|
+
/* TEXT */
|
|
2033
|
+
)
|
|
2034
|
+
],
|
|
2035
|
+
64
|
|
2036
|
+
/* STABLE_FRAGMENT */
|
|
2037
|
+
)) : (vue.openBlock(), vue.createElementBlock(
|
|
2038
|
+
vue.Fragment,
|
|
2039
|
+
{ key: 1 },
|
|
2040
|
+
[
|
|
2041
|
+
vue.createTextVNode(
|
|
2042
|
+
vue.toDisplayString(_ctx.firstItem) + "-" + vue.toDisplayString(Math.min(+_ctx.modelValue * +_ctx.perPage, +_ctx.total)) + " / " + vue.toDisplayString(_ctx.total),
|
|
2043
|
+
1
|
|
2044
|
+
/* TEXT */
|
|
2045
|
+
)
|
|
2046
|
+
],
|
|
2047
|
+
64
|
|
2048
|
+
/* STABLE_FRAGMENT */
|
|
2049
|
+
))
|
|
2050
|
+
])) : (vue.openBlock(), vue.createElementBlock("ul", _hoisted_4$2, [
|
|
2051
|
+
vue.createCommentVNode("First"),
|
|
2052
|
+
_ctx.hasFirst ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_5$1, [
|
|
2053
|
+
_ctx.$slots.default ? vue.renderSlot(_ctx.$slots, "default", {
|
|
2054
|
+
key: 0,
|
|
2055
|
+
page: _ctx.getPage(1)
|
|
2056
|
+
}) : (vue.openBlock(), vue.createBlock(_component_BPaginationButton, {
|
|
2057
|
+
key: 1,
|
|
2058
|
+
page: _ctx.getPage(1)
|
|
2059
|
+
}, null, 8, ["page"]))
|
|
2060
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
2061
|
+
_ctx.hasFirstEllipsis ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_6$1, [..._hoisted_8$1])) : vue.createCommentVNode("v-if", true),
|
|
2062
|
+
vue.createCommentVNode("Pages"),
|
|
2063
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
2064
|
+
vue.Fragment,
|
|
2065
|
+
null,
|
|
2066
|
+
vue.renderList(_ctx.pagesInRange, (page) => {
|
|
2067
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
2068
|
+
key: page.number
|
|
2069
|
+
}, [
|
|
2070
|
+
_ctx.$slots.default ? vue.renderSlot(_ctx.$slots, "default", {
|
|
2071
|
+
key: 0,
|
|
2072
|
+
page
|
|
2073
|
+
}) : (vue.openBlock(), vue.createBlock(_component_BPaginationButton, {
|
|
2074
|
+
key: 1,
|
|
2075
|
+
page
|
|
2076
|
+
}, null, 8, ["page"]))
|
|
2077
|
+
]);
|
|
2078
|
+
}),
|
|
2079
|
+
128
|
|
2080
|
+
/* KEYED_FRAGMENT */
|
|
2081
|
+
)),
|
|
2082
|
+
vue.createCommentVNode("Last"),
|
|
2083
|
+
_ctx.hasLastEllipsis ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_9$1, [..._hoisted_11$1])) : vue.createCommentVNode("v-if", true),
|
|
2084
|
+
_ctx.hasLast ? (vue.openBlock(), vue.createElementBlock("li", _hoisted_12$1, [
|
|
2085
|
+
_ctx.$slots.default ? vue.renderSlot(_ctx.$slots, "default", {
|
|
2086
|
+
key: 0,
|
|
2087
|
+
page: _ctx.getPage(_ctx.pageCount)
|
|
2088
|
+
}) : (vue.openBlock(), vue.createBlock(_component_BPaginationButton, {
|
|
2089
|
+
key: 1,
|
|
2090
|
+
page: _ctx.getPage(_ctx.pageCount)
|
|
2091
|
+
}, null, 8, ["page"]))
|
|
2092
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
2093
|
+
]))
|
|
2094
|
+
],
|
|
2095
|
+
2
|
|
2096
|
+
/* CLASS */
|
|
2097
|
+
);
|
|
2098
|
+
}
|
|
2099
|
+
var BPagination = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["render", _sfc_render$2]]);
|
|
2100
|
+
|
|
2101
|
+
var _sfc_main$2 = vue.defineComponent({
|
|
2102
|
+
name: "BTablePagination",
|
|
2103
|
+
components: {
|
|
2104
|
+
BPagination
|
|
2105
|
+
},
|
|
2106
|
+
props: {
|
|
2107
|
+
paginated: Boolean,
|
|
2108
|
+
total: [Number, String],
|
|
2109
|
+
perPage: [Number, String],
|
|
2110
|
+
currentPage: [Number, String],
|
|
2111
|
+
paginationSimple: Boolean,
|
|
2112
|
+
paginationSize: String,
|
|
2113
|
+
rounded: Boolean,
|
|
2114
|
+
iconPack: String,
|
|
2115
|
+
ariaNextLabel: String,
|
|
2116
|
+
ariaPreviousLabel: String,
|
|
2117
|
+
ariaPageLabel: String,
|
|
2118
|
+
ariaCurrentLabel: String,
|
|
2119
|
+
pageInput: Boolean,
|
|
2120
|
+
paginationOrder: String,
|
|
2121
|
+
pageInputPosition: String,
|
|
2122
|
+
debouncePageInput: [Number, String]
|
|
2123
|
+
},
|
|
2124
|
+
emits: {
|
|
2125
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2126
|
+
"page-change": (_page) => true,
|
|
2127
|
+
"update:currentPage": (_page) => true
|
|
2128
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
2129
|
+
},
|
|
2130
|
+
data() {
|
|
2131
|
+
return {
|
|
2132
|
+
newCurrentPage: this.currentPage
|
|
2133
|
+
};
|
|
2134
|
+
},
|
|
2135
|
+
watch: {
|
|
2136
|
+
currentPage(newVal) {
|
|
2137
|
+
this.newCurrentPage = newVal;
|
|
2138
|
+
}
|
|
2139
|
+
},
|
|
2140
|
+
methods: {
|
|
2141
|
+
/*
|
|
2142
|
+
* Paginator change listener.
|
|
2143
|
+
*/
|
|
2144
|
+
pageChanged(page) {
|
|
2145
|
+
this.newCurrentPage = page > 0 ? page : 1;
|
|
2146
|
+
this.$emit("update:currentPage", this.newCurrentPage);
|
|
2147
|
+
this.$emit("page-change", this.newCurrentPage);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
});
|
|
2151
|
+
|
|
2152
|
+
const _hoisted_1$1 = { class: "top level" };
|
|
2153
|
+
const _hoisted_2$1 = { class: "level-left" };
|
|
2154
|
+
const _hoisted_3$1 = { class: "level-right" };
|
|
2155
|
+
const _hoisted_4$1 = {
|
|
2156
|
+
key: 0,
|
|
2157
|
+
class: "level-item"
|
|
2158
|
+
};
|
|
2159
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2160
|
+
const _component_b_pagination = vue.resolveComponent("b-pagination");
|
|
2161
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$1, [
|
|
2162
|
+
vue.createElementVNode("div", _hoisted_2$1, [
|
|
2163
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
2164
|
+
]),
|
|
2165
|
+
vue.createElementVNode("div", _hoisted_3$1, [
|
|
2166
|
+
_ctx.paginated ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4$1, [
|
|
2167
|
+
vue.createVNode(_component_b_pagination, {
|
|
2168
|
+
"icon-pack": _ctx.iconPack,
|
|
2169
|
+
total: _ctx.total,
|
|
2170
|
+
"per-page": _ctx.perPage,
|
|
2171
|
+
simple: _ctx.paginationSimple,
|
|
2172
|
+
size: _ctx.paginationSize,
|
|
2173
|
+
"model-value": _ctx.newCurrentPage,
|
|
2174
|
+
rounded: _ctx.rounded,
|
|
2175
|
+
onChange: _ctx.pageChanged,
|
|
2176
|
+
"aria-next-label": _ctx.ariaNextLabel,
|
|
2177
|
+
"aria-previous-label": _ctx.ariaPreviousLabel,
|
|
2178
|
+
"aria-page-label": _ctx.ariaPageLabel,
|
|
2179
|
+
"aria-current-label": _ctx.ariaCurrentLabel,
|
|
2180
|
+
"page-input": _ctx.pageInput,
|
|
2181
|
+
order: _ctx.paginationOrder,
|
|
2182
|
+
"page-input-position": _ctx.pageInputPosition,
|
|
2183
|
+
"debounce-page-input": _ctx.debouncePageInput
|
|
2184
|
+
}, null, 8, ["icon-pack", "total", "per-page", "simple", "size", "model-value", "rounded", "onChange", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "order", "page-input-position", "debounce-page-input"])
|
|
2185
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
2186
|
+
])
|
|
2187
|
+
]);
|
|
2188
|
+
}
|
|
2189
|
+
var BTablePagination = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["render", _sfc_render$1]]);
|
|
2190
|
+
|
|
2191
|
+
var __defProp = Object.defineProperty;
|
|
2192
|
+
var __defProps = Object.defineProperties;
|
|
2193
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2194
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
2195
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2196
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
2197
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
2198
|
+
var __spreadValues = (a, b) => {
|
|
2199
|
+
for (var prop in b || (b = {}))
|
|
2200
|
+
if (__hasOwnProp.call(b, prop))
|
|
2201
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2202
|
+
if (__getOwnPropSymbols)
|
|
2203
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
2204
|
+
if (__propIsEnum.call(b, prop))
|
|
2205
|
+
__defNormalProp(a, prop, b[prop]);
|
|
2206
|
+
}
|
|
2207
|
+
return a;
|
|
2208
|
+
};
|
|
2209
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
2210
|
+
function mockTableColumn(table, column) {
|
|
2211
|
+
const defaultProps = {
|
|
2212
|
+
label: void 0,
|
|
2213
|
+
customKey: void 0,
|
|
2214
|
+
field: void 0,
|
|
2215
|
+
meta: void 0,
|
|
2216
|
+
width: void 0,
|
|
2217
|
+
numeric: void 0,
|
|
2218
|
+
centered: void 0,
|
|
2219
|
+
searchable: void 0,
|
|
2220
|
+
sortable: void 0,
|
|
2221
|
+
visible: true,
|
|
2222
|
+
subheading: void 0,
|
|
2223
|
+
customSort: void 0,
|
|
2224
|
+
customSearch: void 0,
|
|
2225
|
+
sticky: void 0,
|
|
2226
|
+
headerSelectable: void 0,
|
|
2227
|
+
headerClass: void 0,
|
|
2228
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2229
|
+
thAttrs: () => ({}),
|
|
2230
|
+
tdAttrs: () => ({})
|
|
2231
|
+
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
2232
|
+
};
|
|
2233
|
+
return __spreadProps(__spreadValues(__spreadValues({}, defaultProps), column), {
|
|
2234
|
+
// data
|
|
2235
|
+
newKey: column.customKey || column.label,
|
|
2236
|
+
_isTableColumn: true,
|
|
2237
|
+
// public computed
|
|
2238
|
+
get thClasses() {
|
|
2239
|
+
const attrs = this.thAttrs(this);
|
|
2240
|
+
const classes = [this.headerClass, {
|
|
2241
|
+
"is-sortable": this.sortable,
|
|
2242
|
+
"is-sticky": this.sticky,
|
|
2243
|
+
"is-unselectable": this.isHeaderUnSelectable
|
|
2244
|
+
}];
|
|
2245
|
+
if (attrs && attrs.class) {
|
|
2246
|
+
classes.push(attrs.class);
|
|
2247
|
+
}
|
|
2248
|
+
return classes;
|
|
2249
|
+
},
|
|
2250
|
+
get thStyle() {
|
|
2251
|
+
const attrs = this.thAttrs(this);
|
|
2252
|
+
const style = [this.style];
|
|
2253
|
+
if (attrs && attrs.style) {
|
|
2254
|
+
style.push(attrs.style);
|
|
2255
|
+
}
|
|
2256
|
+
return style;
|
|
2257
|
+
},
|
|
2258
|
+
get thWrapStyle() {
|
|
2259
|
+
return this.style;
|
|
2260
|
+
},
|
|
2261
|
+
get style() {
|
|
2262
|
+
var _a;
|
|
2263
|
+
return {
|
|
2264
|
+
width: (_a = toCssWidth(this.width)) != null ? _a : void 0
|
|
2265
|
+
// null → undefined to satisfy StyleValue
|
|
2266
|
+
};
|
|
2267
|
+
},
|
|
2268
|
+
getRootClasses(row) {
|
|
2269
|
+
const attrs = this.tdAttrs(row, this);
|
|
2270
|
+
const classes = [this.rootClasses];
|
|
2271
|
+
if (attrs && attrs.class) {
|
|
2272
|
+
classes.push(attrs.class);
|
|
2273
|
+
}
|
|
2274
|
+
return classes;
|
|
2275
|
+
},
|
|
2276
|
+
getRootStyle(row) {
|
|
2277
|
+
const attrs = this.tdAttrs(row, this);
|
|
2278
|
+
const style = [];
|
|
2279
|
+
if (attrs && attrs.style) {
|
|
2280
|
+
style.push(attrs.style);
|
|
2281
|
+
}
|
|
2282
|
+
return style;
|
|
2283
|
+
},
|
|
2284
|
+
$slots: {
|
|
2285
|
+
default: (props) => {
|
|
2286
|
+
const vnode = vue.h("span", {
|
|
2287
|
+
innerHTML: getValueByPath(props.row, column.field)
|
|
2288
|
+
});
|
|
2289
|
+
return [vnode];
|
|
2290
|
+
}
|
|
2291
|
+
},
|
|
2292
|
+
// private properties
|
|
2293
|
+
get rootClasses() {
|
|
2294
|
+
return [this.cellClass, {
|
|
2295
|
+
"has-text-right": this.numeric && !this.centered,
|
|
2296
|
+
"has-text-centered": this.centered,
|
|
2297
|
+
"is-sticky": this.sticky
|
|
2298
|
+
}];
|
|
2299
|
+
},
|
|
2300
|
+
get isHeaderUnSelectable() {
|
|
2301
|
+
return !this.headerSelectable && !!this.sortable;
|
|
2302
|
+
}
|
|
2303
|
+
});
|
|
2304
|
+
}
|
|
2305
|
+
|
|
2306
|
+
const BLANK_COLUMN = {
|
|
2307
|
+
thAttrs: () => ({}),
|
|
2308
|
+
tdAttrs: () => ({}),
|
|
2309
|
+
getRootClasses: () => [],
|
|
2310
|
+
getRootStyle: () => void 0,
|
|
2311
|
+
$slots: {}
|
|
2312
|
+
};
|
|
2313
|
+
var _sfc_main$1 = vue.defineComponent({
|
|
2314
|
+
name: "BTable",
|
|
2315
|
+
components: {
|
|
2316
|
+
BCheckbox,
|
|
2317
|
+
BIcon,
|
|
2318
|
+
BInput,
|
|
2319
|
+
BLoading,
|
|
2320
|
+
BSlotComponent,
|
|
2321
|
+
BTableMobileSort,
|
|
2322
|
+
BTablePagination
|
|
2323
|
+
},
|
|
2324
|
+
mixins: [CompatFallthroughMixin],
|
|
2325
|
+
provide() {
|
|
2326
|
+
return {
|
|
2327
|
+
$table: this
|
|
2328
|
+
};
|
|
2329
|
+
},
|
|
2330
|
+
props: {
|
|
2331
|
+
data: {
|
|
2332
|
+
type: Array,
|
|
2333
|
+
default: () => []
|
|
2334
|
+
},
|
|
2335
|
+
columns: {
|
|
2336
|
+
type: Array,
|
|
2337
|
+
default: () => []
|
|
2338
|
+
},
|
|
2339
|
+
bordered: Boolean,
|
|
2340
|
+
striped: Boolean,
|
|
2341
|
+
narrowed: Boolean,
|
|
2342
|
+
hoverable: Boolean,
|
|
2343
|
+
loading: Boolean,
|
|
2344
|
+
detailed: Boolean,
|
|
2345
|
+
checkable: Boolean,
|
|
2346
|
+
headerCheckable: {
|
|
2347
|
+
type: Boolean,
|
|
2348
|
+
default: true
|
|
2349
|
+
},
|
|
2350
|
+
checkboxType: {
|
|
2351
|
+
type: String,
|
|
2352
|
+
default: "is-primary"
|
|
2353
|
+
},
|
|
2354
|
+
checkboxPosition: {
|
|
2355
|
+
type: String,
|
|
2356
|
+
default: "left",
|
|
2357
|
+
validator: (value) => {
|
|
2358
|
+
return [
|
|
2359
|
+
"left",
|
|
2360
|
+
"right"
|
|
2361
|
+
].indexOf(value) >= 0;
|
|
2362
|
+
}
|
|
2363
|
+
},
|
|
2364
|
+
stickyCheckbox: {
|
|
2365
|
+
type: Boolean,
|
|
2366
|
+
default: false
|
|
2367
|
+
},
|
|
2368
|
+
selected: Object,
|
|
2369
|
+
isRowSelectable: {
|
|
2370
|
+
type: Function,
|
|
2371
|
+
default: () => true
|
|
2372
|
+
},
|
|
2373
|
+
focusable: Boolean,
|
|
2374
|
+
customIsChecked: Function,
|
|
2375
|
+
isRowCheckable: {
|
|
2376
|
+
type: Function,
|
|
2377
|
+
default: () => true
|
|
2378
|
+
},
|
|
2379
|
+
checkedRows: {
|
|
2380
|
+
type: Array,
|
|
2381
|
+
default: () => []
|
|
2382
|
+
},
|
|
2383
|
+
mobileCards: {
|
|
2384
|
+
type: Boolean,
|
|
2385
|
+
default: true
|
|
2386
|
+
},
|
|
2387
|
+
defaultSort: [String, Array],
|
|
2388
|
+
defaultSortDirection: {
|
|
2389
|
+
type: String,
|
|
2390
|
+
default: "asc"
|
|
2391
|
+
},
|
|
2392
|
+
sortIcon: {
|
|
2393
|
+
type: String,
|
|
2394
|
+
default: "arrow-up"
|
|
2395
|
+
},
|
|
2396
|
+
sortIconSize: {
|
|
2397
|
+
type: String,
|
|
2398
|
+
default: "is-small"
|
|
2399
|
+
},
|
|
2400
|
+
sortMultiple: {
|
|
2401
|
+
type: Boolean,
|
|
2402
|
+
default: false
|
|
2403
|
+
},
|
|
2404
|
+
sortMultipleData: {
|
|
2405
|
+
type: Array,
|
|
2406
|
+
default: () => []
|
|
2407
|
+
},
|
|
2408
|
+
sortMultipleKey: {
|
|
2409
|
+
type: String,
|
|
2410
|
+
default: null
|
|
2411
|
+
},
|
|
2412
|
+
paginated: Boolean,
|
|
2413
|
+
currentPage: {
|
|
2414
|
+
type: Number,
|
|
2415
|
+
default: 1
|
|
2416
|
+
},
|
|
2417
|
+
perPage: {
|
|
2418
|
+
type: [Number, String],
|
|
2419
|
+
default: 20
|
|
2420
|
+
},
|
|
2421
|
+
showDetailIcon: {
|
|
2422
|
+
type: Boolean,
|
|
2423
|
+
default: true
|
|
2424
|
+
},
|
|
2425
|
+
detailIcon: {
|
|
2426
|
+
type: String,
|
|
2427
|
+
default: "chevron-right"
|
|
2428
|
+
},
|
|
2429
|
+
paginationPosition: {
|
|
2430
|
+
type: String,
|
|
2431
|
+
default: "bottom",
|
|
2432
|
+
validator: (value) => {
|
|
2433
|
+
return [
|
|
2434
|
+
"bottom",
|
|
2435
|
+
"top",
|
|
2436
|
+
"both"
|
|
2437
|
+
].indexOf(value) >= 0;
|
|
2438
|
+
}
|
|
2439
|
+
},
|
|
2440
|
+
paginationRounded: Boolean,
|
|
2441
|
+
backendSorting: Boolean,
|
|
2442
|
+
backendFiltering: Boolean,
|
|
2443
|
+
rowClass: {
|
|
2444
|
+
type: Function,
|
|
2445
|
+
default: () => ""
|
|
2446
|
+
},
|
|
2447
|
+
openedDetailed: {
|
|
2448
|
+
type: Array,
|
|
2449
|
+
default: () => []
|
|
2450
|
+
},
|
|
2451
|
+
hasDetailedVisible: {
|
|
2452
|
+
type: Function,
|
|
2453
|
+
default: () => true
|
|
2454
|
+
},
|
|
2455
|
+
detailKey: {
|
|
2456
|
+
type: String,
|
|
2457
|
+
default: ""
|
|
2458
|
+
},
|
|
2459
|
+
detailTransition: {
|
|
2460
|
+
type: String,
|
|
2461
|
+
default: ""
|
|
2462
|
+
},
|
|
2463
|
+
customDetailRow: {
|
|
2464
|
+
type: Boolean,
|
|
2465
|
+
default: false
|
|
2466
|
+
},
|
|
2467
|
+
backendPagination: Boolean,
|
|
2468
|
+
total: {
|
|
2469
|
+
type: [Number, String],
|
|
2470
|
+
default: 0
|
|
2471
|
+
},
|
|
2472
|
+
iconPack: String,
|
|
2473
|
+
mobileSortPlaceholder: String,
|
|
2474
|
+
customRowKey: String,
|
|
2475
|
+
draggable: {
|
|
2476
|
+
type: Boolean,
|
|
2477
|
+
default: false
|
|
2478
|
+
},
|
|
2479
|
+
draggableColumn: {
|
|
2480
|
+
type: Boolean,
|
|
2481
|
+
default: false
|
|
2482
|
+
},
|
|
2483
|
+
scrollable: Boolean,
|
|
2484
|
+
ariaNextLabel: String,
|
|
2485
|
+
ariaPreviousLabel: String,
|
|
2486
|
+
ariaPageLabel: String,
|
|
2487
|
+
ariaCurrentLabel: String,
|
|
2488
|
+
stickyHeader: Boolean,
|
|
2489
|
+
height: [Number, String],
|
|
2490
|
+
filtersEvent: {
|
|
2491
|
+
type: String,
|
|
2492
|
+
default: ""
|
|
2493
|
+
},
|
|
2494
|
+
cardLayout: Boolean,
|
|
2495
|
+
showHeader: {
|
|
2496
|
+
type: Boolean,
|
|
2497
|
+
default: true
|
|
2498
|
+
},
|
|
2499
|
+
debounceSearch: Number,
|
|
2500
|
+
caption: String,
|
|
2501
|
+
showCaption: {
|
|
2502
|
+
type: Boolean,
|
|
2503
|
+
default: true
|
|
2504
|
+
},
|
|
2505
|
+
pageInput: {
|
|
2506
|
+
type: Boolean,
|
|
2507
|
+
default: false
|
|
2508
|
+
},
|
|
2509
|
+
paginationOrder: String,
|
|
2510
|
+
pageInputPosition: String,
|
|
2511
|
+
debouncePageInput: [Number, String]
|
|
2512
|
+
},
|
|
2513
|
+
emits: {
|
|
2514
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2515
|
+
cellclick: (_row, _column, _rowIndex, _colIndex) => true,
|
|
2516
|
+
check: (_checkedRows, _row) => true,
|
|
2517
|
+
"check-all": (_rows) => true,
|
|
2518
|
+
click: (_row) => true,
|
|
2519
|
+
columndragend: (_event) => true,
|
|
2520
|
+
columndragleave: (_event) => true,
|
|
2521
|
+
columndragover: (_event) => true,
|
|
2522
|
+
columndragstart: (_event) => true,
|
|
2523
|
+
columndrop: (_event) => true,
|
|
2524
|
+
contextmenu: (_row, _event) => true,
|
|
2525
|
+
dblclick: (_row) => true,
|
|
2526
|
+
"details-close": (_row) => true,
|
|
2527
|
+
"details-open": (_row) => true,
|
|
2528
|
+
dragend: (_event) => true,
|
|
2529
|
+
dragleave: (_event) => true,
|
|
2530
|
+
dragover: (_event) => true,
|
|
2531
|
+
dragstart: (_event) => true,
|
|
2532
|
+
drop: (_event) => true,
|
|
2533
|
+
"filters-change": (_value) => true,
|
|
2534
|
+
"page-change": (_page) => true,
|
|
2535
|
+
select: (_new, _old) => true,
|
|
2536
|
+
sort: (_field, _order, _event) => true,
|
|
2537
|
+
"sorting-priority-removed": (_field) => true,
|
|
2538
|
+
"update:checkedRows": (_rows) => true,
|
|
2539
|
+
"update:currentPage": (_page) => true,
|
|
2540
|
+
"update:openedDetailed": (_rows) => true,
|
|
2541
|
+
"update:selected": (_row) => true
|
|
2542
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
2543
|
+
},
|
|
2544
|
+
data() {
|
|
2545
|
+
return {
|
|
2546
|
+
sortMultipleDataLocal: [],
|
|
2547
|
+
getValueByPath,
|
|
2548
|
+
visibleDetailRows: this.openedDetailed,
|
|
2549
|
+
newData: this.data,
|
|
2550
|
+
newDataTotal: this.backendPagination ? this.total : this.data.length,
|
|
2551
|
+
newCheckedRows: [...this.checkedRows],
|
|
2552
|
+
lastCheckedRowIndex: null,
|
|
2553
|
+
newCurrentPage: this.currentPage,
|
|
2554
|
+
currentSortColumn: {},
|
|
2555
|
+
isAsc: true,
|
|
2556
|
+
filters: {},
|
|
2557
|
+
defaultSlots: [],
|
|
2558
|
+
firstTimeSort: true,
|
|
2559
|
+
// Used by first time initSort
|
|
2560
|
+
isDraggingRow: false,
|
|
2561
|
+
isDraggingColumn: false,
|
|
2562
|
+
debouncedHandleFiltersChange: void 0,
|
|
2563
|
+
// for touch-enabled devices
|
|
2564
|
+
_selectedRow: null,
|
|
2565
|
+
mayBeTouchDragging: false,
|
|
2566
|
+
touchDragoverTarget: null,
|
|
2567
|
+
_draggedCellEl: void 0,
|
|
2568
|
+
draggedCellContent: ""
|
|
2569
|
+
};
|
|
2570
|
+
},
|
|
2571
|
+
computed: {
|
|
2572
|
+
sortMultipleDataComputed() {
|
|
2573
|
+
return this.backendSorting ? this.sortMultipleData : this.sortMultipleDataLocal;
|
|
2574
|
+
},
|
|
2575
|
+
tableClasses() {
|
|
2576
|
+
return {
|
|
2577
|
+
"is-bordered": this.bordered,
|
|
2578
|
+
"is-striped": this.striped,
|
|
2579
|
+
"is-narrow": this.narrowed,
|
|
2580
|
+
"is-hoverable": (this.hoverable || this.focusable) && this.visibleData.length
|
|
2581
|
+
};
|
|
2582
|
+
},
|
|
2583
|
+
tableWrapperClasses() {
|
|
2584
|
+
return {
|
|
2585
|
+
"has-mobile-cards": this.mobileCards,
|
|
2586
|
+
"has-sticky-header": this.stickyHeader,
|
|
2587
|
+
"is-card-list": this.cardLayout,
|
|
2588
|
+
"table-container": this.isScrollable
|
|
2589
|
+
};
|
|
2590
|
+
},
|
|
2591
|
+
tableStyle() {
|
|
2592
|
+
return {
|
|
2593
|
+
height: toCssWidth(this.height)
|
|
2594
|
+
};
|
|
2595
|
+
},
|
|
2596
|
+
touchDraggedCellClasses() {
|
|
2597
|
+
return {
|
|
2598
|
+
"has-mobile-cards": this.mobileCards
|
|
2599
|
+
};
|
|
2600
|
+
},
|
|
2601
|
+
/*
|
|
2602
|
+
* Splitted data based on the pagination.
|
|
2603
|
+
*/
|
|
2604
|
+
visibleData() {
|
|
2605
|
+
if (!this.paginated) return this.newData;
|
|
2606
|
+
const currentPage = this.newCurrentPage;
|
|
2607
|
+
const perPage = +this.perPage;
|
|
2608
|
+
if (this.newData.length <= perPage) {
|
|
2609
|
+
return this.newData;
|
|
2610
|
+
} else {
|
|
2611
|
+
const start = (currentPage - 1) * perPage;
|
|
2612
|
+
const end = parseInt(start + "", 10) + parseInt(perPage + "", 10);
|
|
2613
|
+
return this.newData.slice(start, end);
|
|
2614
|
+
}
|
|
2615
|
+
},
|
|
2616
|
+
visibleColumns() {
|
|
2617
|
+
if (!this.newColumns) return this.newColumns;
|
|
2618
|
+
return this.newColumns.filter((column) => {
|
|
2619
|
+
return column.visible || column.visible === void 0;
|
|
2620
|
+
});
|
|
2621
|
+
},
|
|
2622
|
+
/*
|
|
2623
|
+
* Check if all rows in the page are checked.
|
|
2624
|
+
*/
|
|
2625
|
+
isAllChecked() {
|
|
2626
|
+
const validVisibleData = this.visibleData.filter(
|
|
2627
|
+
(row) => this.isRowCheckable(row)
|
|
2628
|
+
);
|
|
2629
|
+
if (validVisibleData.length === 0) return false;
|
|
2630
|
+
const isAllChecked = validVisibleData.some((currentVisibleRow) => {
|
|
2631
|
+
return indexOf(this.newCheckedRows, currentVisibleRow, this.customIsChecked) < 0;
|
|
2632
|
+
});
|
|
2633
|
+
return !isAllChecked;
|
|
2634
|
+
},
|
|
2635
|
+
/*
|
|
2636
|
+
* Check if all rows in the page are checkable.
|
|
2637
|
+
*/
|
|
2638
|
+
isAllUncheckable() {
|
|
2639
|
+
const validVisibleData = this.visibleData.filter(
|
|
2640
|
+
(row) => this.isRowCheckable(row)
|
|
2641
|
+
);
|
|
2642
|
+
return validVisibleData.length === 0;
|
|
2643
|
+
},
|
|
2644
|
+
/*
|
|
2645
|
+
* Check if has any sortable column.
|
|
2646
|
+
*/
|
|
2647
|
+
hasSortablenewColumns() {
|
|
2648
|
+
return this.newColumns.some((column) => {
|
|
2649
|
+
return column.sortable;
|
|
2650
|
+
});
|
|
2651
|
+
},
|
|
2652
|
+
/*
|
|
2653
|
+
* Check if has any searchable column.
|
|
2654
|
+
*/
|
|
2655
|
+
hasSearchablenewColumns() {
|
|
2656
|
+
return this.newColumns.some((column) => {
|
|
2657
|
+
return column.searchable;
|
|
2658
|
+
});
|
|
2659
|
+
},
|
|
2660
|
+
/*
|
|
2661
|
+
* Check if has any column using subheading.
|
|
2662
|
+
*/
|
|
2663
|
+
hasCustomSubheadings() {
|
|
2664
|
+
if (this.$slots && this.$slots.subheading) return true;
|
|
2665
|
+
return this.newColumns.some((column) => {
|
|
2666
|
+
return column.subheading || column.$slots.subheading;
|
|
2667
|
+
});
|
|
2668
|
+
},
|
|
2669
|
+
/*
|
|
2670
|
+
* Return total column count based if it's checkable or expanded
|
|
2671
|
+
*/
|
|
2672
|
+
columnCount() {
|
|
2673
|
+
let count = this.visibleColumns.length;
|
|
2674
|
+
count += this.checkable ? 1 : 0;
|
|
2675
|
+
count += this.detailed && this.showDetailIcon ? 1 : 0;
|
|
2676
|
+
return count;
|
|
2677
|
+
},
|
|
2678
|
+
/*
|
|
2679
|
+
* return if detailed row tabled
|
|
2680
|
+
* will be with chevron column & icon or not
|
|
2681
|
+
*/
|
|
2682
|
+
showDetailRowIcon() {
|
|
2683
|
+
return this.detailed && this.showDetailIcon;
|
|
2684
|
+
},
|
|
2685
|
+
/*
|
|
2686
|
+
* return if scrollable table
|
|
2687
|
+
*/
|
|
2688
|
+
isScrollable() {
|
|
2689
|
+
if (this.scrollable) return true;
|
|
2690
|
+
if (!this.newColumns) return false;
|
|
2691
|
+
return this.newColumns.some((column) => {
|
|
2692
|
+
return column.sticky;
|
|
2693
|
+
});
|
|
2694
|
+
},
|
|
2695
|
+
newColumns() {
|
|
2696
|
+
if (this.columns && this.columns.length) {
|
|
2697
|
+
return this.columns.map((column) => {
|
|
2698
|
+
return mockTableColumn(this, column);
|
|
2699
|
+
});
|
|
2700
|
+
}
|
|
2701
|
+
return this.defaultSlots;
|
|
2702
|
+
},
|
|
2703
|
+
canDragRow() {
|
|
2704
|
+
return this.draggable && !this.isDraggingColumn;
|
|
2705
|
+
},
|
|
2706
|
+
canDragColumn() {
|
|
2707
|
+
return this.draggableColumn && !this.isDraggingRow;
|
|
2708
|
+
}
|
|
2709
|
+
},
|
|
2710
|
+
watch: {
|
|
2711
|
+
/*
|
|
2712
|
+
* When data prop change:
|
|
2713
|
+
* 1. Update internal value.
|
|
2714
|
+
* 2. Filter data if it's not backend-filtered.
|
|
2715
|
+
* 3. Sort again if it's not backend-sorted.
|
|
2716
|
+
* 4. Set new total if it's not backend-paginated.
|
|
2717
|
+
*/
|
|
2718
|
+
data(value) {
|
|
2719
|
+
this.newData = value;
|
|
2720
|
+
if (!this.backendFiltering) {
|
|
2721
|
+
this.newData = value.filter(
|
|
2722
|
+
(row) => this.isRowFiltered(row)
|
|
2723
|
+
);
|
|
2724
|
+
}
|
|
2725
|
+
if (!this.backendSorting) {
|
|
2726
|
+
this.sort(this.currentSortColumn, true);
|
|
2727
|
+
}
|
|
2728
|
+
if (!this.backendPagination) {
|
|
2729
|
+
this.newDataTotal = this.newData.length;
|
|
2730
|
+
}
|
|
2731
|
+
},
|
|
2732
|
+
/*
|
|
2733
|
+
* When Pagination total change, update internal total
|
|
2734
|
+
* only if it's backend-paginated.
|
|
2735
|
+
*/
|
|
2736
|
+
total(newTotal) {
|
|
2737
|
+
if (!this.backendPagination) return;
|
|
2738
|
+
this.newDataTotal = newTotal;
|
|
2739
|
+
},
|
|
2740
|
+
currentPage(newVal) {
|
|
2741
|
+
this.newCurrentPage = newVal;
|
|
2742
|
+
},
|
|
2743
|
+
newCurrentPage(newVal) {
|
|
2744
|
+
this.$emit("update:currentPage", newVal);
|
|
2745
|
+
},
|
|
2746
|
+
/*
|
|
2747
|
+
* When checkedRows prop change, update internal value without
|
|
2748
|
+
* mutating original data.
|
|
2749
|
+
*/
|
|
2750
|
+
checkedRows(rows) {
|
|
2751
|
+
this.newCheckedRows = [...rows];
|
|
2752
|
+
},
|
|
2753
|
+
debounceSearch: {
|
|
2754
|
+
handler(value) {
|
|
2755
|
+
this.debouncedHandleFiltersChange = debounce(this.handleFiltersChange, value);
|
|
2756
|
+
},
|
|
2757
|
+
immediate: true
|
|
2758
|
+
},
|
|
2759
|
+
filters: {
|
|
2760
|
+
handler(value) {
|
|
2761
|
+
if (this.debounceSearch) {
|
|
2762
|
+
this.debouncedHandleFiltersChange(value);
|
|
2763
|
+
} else {
|
|
2764
|
+
this.handleFiltersChange(value);
|
|
2765
|
+
}
|
|
2766
|
+
},
|
|
2767
|
+
deep: true
|
|
2768
|
+
},
|
|
2769
|
+
/*
|
|
2770
|
+
* When the user wants to control the detailed rows via props.
|
|
2771
|
+
* Or wants to open the details of certain row with the router for example.
|
|
2772
|
+
*/
|
|
2773
|
+
openedDetailed(expandedRows) {
|
|
2774
|
+
this.visibleDetailRows = expandedRows;
|
|
2775
|
+
}
|
|
2776
|
+
},
|
|
2777
|
+
methods: {
|
|
2778
|
+
onFiltersEvent(event) {
|
|
2779
|
+
this.$emit(`filters-event-${this.filtersEvent}`, { event, filters: this.filters });
|
|
2780
|
+
},
|
|
2781
|
+
handleFiltersChange(value) {
|
|
2782
|
+
if (this.backendFiltering) {
|
|
2783
|
+
this.$emit("filters-change", value);
|
|
2784
|
+
} else {
|
|
2785
|
+
this.newData = this.data.filter(
|
|
2786
|
+
(row) => this.isRowFiltered(row)
|
|
2787
|
+
);
|
|
2788
|
+
if (!this.backendPagination) {
|
|
2789
|
+
this.newDataTotal = this.newData.length;
|
|
2790
|
+
}
|
|
2791
|
+
if (!this.backendSorting) {
|
|
2792
|
+
if (this.sortMultiple && this.sortMultipleDataLocal && this.sortMultipleDataLocal.length > 0) {
|
|
2793
|
+
this.doSortMultiColumn();
|
|
2794
|
+
} else if (Object.keys(this.currentSortColumn).length > 0) {
|
|
2795
|
+
this.doSortSingleColumn(this.currentSortColumn);
|
|
2796
|
+
}
|
|
2797
|
+
}
|
|
2798
|
+
}
|
|
2799
|
+
},
|
|
2800
|
+
findIndexOfSortData(column) {
|
|
2801
|
+
const sortObj = this.sortMultipleDataComputed.filter((i) => i.field === column.field)[0];
|
|
2802
|
+
return this.sortMultipleDataComputed.indexOf(sortObj) + 1;
|
|
2803
|
+
},
|
|
2804
|
+
removeSortingPriority(column) {
|
|
2805
|
+
if (this.backendSorting) {
|
|
2806
|
+
this.$emit("sorting-priority-removed", column.field);
|
|
2807
|
+
} else {
|
|
2808
|
+
this.sortMultipleDataLocal = this.sortMultipleDataLocal.filter(
|
|
2809
|
+
(priority) => priority.field !== column.field
|
|
2810
|
+
);
|
|
2811
|
+
if (this.sortMultipleDataLocal.length === 0) {
|
|
2812
|
+
this.resetMultiSorting();
|
|
2813
|
+
} else {
|
|
2814
|
+
this.newData = multiColumnSort(this.newData, this.sortMultipleDataLocal);
|
|
2815
|
+
}
|
|
2816
|
+
}
|
|
2817
|
+
},
|
|
2818
|
+
resetMultiSorting() {
|
|
2819
|
+
this.sortMultipleDataLocal = [];
|
|
2820
|
+
this.currentSortColumn = BLANK_COLUMN;
|
|
2821
|
+
this.newData = this.data;
|
|
2822
|
+
},
|
|
2823
|
+
/*
|
|
2824
|
+
* Sort an array by key without mutating original data.
|
|
2825
|
+
* Call the user sort function if it was passed.
|
|
2826
|
+
*/
|
|
2827
|
+
sortBy(array, key, fn, isAsc) {
|
|
2828
|
+
let sorted = [];
|
|
2829
|
+
if (fn && typeof fn === "function") {
|
|
2830
|
+
sorted = [...array].sort((a, b) => fn(a, b, isAsc));
|
|
2831
|
+
} else {
|
|
2832
|
+
sorted = [...array].sort((a, b) => {
|
|
2833
|
+
let newA = getValueByPath(a, key);
|
|
2834
|
+
let newB = getValueByPath(b, key);
|
|
2835
|
+
if (typeof newA === "boolean" && typeof newB === "boolean") {
|
|
2836
|
+
return isAsc ? +newA - +newB : +newB - +newA;
|
|
2837
|
+
}
|
|
2838
|
+
if (!isNil(newB) && isNil(newA)) return isAsc ? 1 : -1;
|
|
2839
|
+
if (!isNil(newA) && isNil(newB)) return isAsc ? -1 : 1;
|
|
2840
|
+
if (newA === newB) return 0;
|
|
2841
|
+
newA = typeof newA === "string" ? newA.toUpperCase() : newA;
|
|
2842
|
+
newB = typeof newB === "string" ? newB.toUpperCase() : newB;
|
|
2843
|
+
return isAsc ? newA > newB ? 1 : -1 : newA > newB ? -1 : 1;
|
|
2844
|
+
});
|
|
2845
|
+
}
|
|
2846
|
+
return sorted;
|
|
2847
|
+
},
|
|
2848
|
+
sortMultiColumn(column) {
|
|
2849
|
+
this.currentSortColumn = BLANK_COLUMN;
|
|
2850
|
+
if (!this.backendSorting) {
|
|
2851
|
+
const existingPriority = this.sortMultipleDataLocal.filter((i) => i.field === column.field)[0];
|
|
2852
|
+
if (existingPriority) {
|
|
2853
|
+
existingPriority.order = existingPriority.order === "desc" ? "asc" : "desc";
|
|
2854
|
+
} else {
|
|
2855
|
+
this.sortMultipleDataLocal.push({
|
|
2856
|
+
field: column.field,
|
|
2857
|
+
order: this.isAsc ? "asc" : "desc",
|
|
2858
|
+
customSort: column.customSort
|
|
2859
|
+
});
|
|
2860
|
+
}
|
|
2861
|
+
this.doSortMultiColumn();
|
|
2862
|
+
}
|
|
2863
|
+
},
|
|
2864
|
+
doSortMultiColumn() {
|
|
2865
|
+
this.newData = multiColumnSort(this.newData, this.sortMultipleDataLocal);
|
|
2866
|
+
},
|
|
2867
|
+
/*
|
|
2868
|
+
* Sort the column.
|
|
2869
|
+
* Toggle current direction on column if it's sortable
|
|
2870
|
+
* and not just updating the prop.
|
|
2871
|
+
*/
|
|
2872
|
+
sort(column, updatingData = false, event = null) {
|
|
2873
|
+
if (!column || !column.sortable) return;
|
|
2874
|
+
if (
|
|
2875
|
+
// if backend sorting is enabled, just emit the sort press like usual
|
|
2876
|
+
// if the correct key combination isnt pressed, sort like usual
|
|
2877
|
+
!this.backendSorting && this.sortMultiple && (this.sortMultipleKey && event[this.sortMultipleKey] || !this.sortMultipleKey)
|
|
2878
|
+
) {
|
|
2879
|
+
if (updatingData) {
|
|
2880
|
+
this.doSortMultiColumn();
|
|
2881
|
+
} else {
|
|
2882
|
+
this.sortMultiColumn(column);
|
|
2883
|
+
}
|
|
2884
|
+
} else {
|
|
2885
|
+
if (this.sortMultiple) {
|
|
2886
|
+
this.sortMultipleDataLocal = [];
|
|
2887
|
+
}
|
|
2888
|
+
if (!updatingData) {
|
|
2889
|
+
this.isAsc = vue.toRaw(column) === vue.toRaw(this.currentSortColumn) ? !this.isAsc : this.defaultSortDirection.toLowerCase() !== "desc";
|
|
2890
|
+
}
|
|
2891
|
+
if (!this.firstTimeSort) {
|
|
2892
|
+
this.$emit("sort", column.field, this.isAsc ? "asc" : "desc", event);
|
|
2893
|
+
}
|
|
2894
|
+
if (!this.backendSorting) {
|
|
2895
|
+
this.doSortSingleColumn(column);
|
|
2896
|
+
}
|
|
2897
|
+
this.currentSortColumn = column;
|
|
2898
|
+
}
|
|
2899
|
+
},
|
|
2900
|
+
doSortSingleColumn(column) {
|
|
2901
|
+
this.newData = this.sortBy(
|
|
2902
|
+
this.newData,
|
|
2903
|
+
column.field,
|
|
2904
|
+
column.customSort,
|
|
2905
|
+
this.isAsc
|
|
2906
|
+
);
|
|
2907
|
+
},
|
|
2908
|
+
isRowSelected(row, selected) {
|
|
2909
|
+
if (!selected) {
|
|
2910
|
+
return false;
|
|
2911
|
+
}
|
|
2912
|
+
if (this.customRowKey) {
|
|
2913
|
+
return row[this.customRowKey] === selected[this.customRowKey];
|
|
2914
|
+
}
|
|
2915
|
+
return row === selected;
|
|
2916
|
+
},
|
|
2917
|
+
/*
|
|
2918
|
+
* Check if the row is checked (is added to the array).
|
|
2919
|
+
*/
|
|
2920
|
+
isRowChecked(row) {
|
|
2921
|
+
return indexOf(this.newCheckedRows, row, this.customIsChecked) >= 0;
|
|
2922
|
+
},
|
|
2923
|
+
/*
|
|
2924
|
+
* Remove a checked row from the array.
|
|
2925
|
+
*/
|
|
2926
|
+
removeCheckedRow(row) {
|
|
2927
|
+
const index = indexOf(this.newCheckedRows, row, this.customIsChecked);
|
|
2928
|
+
if (index >= 0) {
|
|
2929
|
+
this.newCheckedRows.splice(index, 1);
|
|
2930
|
+
}
|
|
2931
|
+
},
|
|
2932
|
+
/*
|
|
2933
|
+
* Header checkbox click listener.
|
|
2934
|
+
* Add or remove all rows in current page.
|
|
2935
|
+
*/
|
|
2936
|
+
checkAll() {
|
|
2937
|
+
const isAllChecked = this.isAllChecked;
|
|
2938
|
+
this.visibleData.forEach((currentRow) => {
|
|
2939
|
+
if (this.isRowCheckable(currentRow)) {
|
|
2940
|
+
this.removeCheckedRow(currentRow);
|
|
2941
|
+
}
|
|
2942
|
+
if (!isAllChecked) {
|
|
2943
|
+
if (this.isRowCheckable(currentRow)) {
|
|
2944
|
+
this.newCheckedRows.push(currentRow);
|
|
2945
|
+
}
|
|
2946
|
+
}
|
|
2947
|
+
});
|
|
2948
|
+
this.$emit("check", this.newCheckedRows);
|
|
2949
|
+
this.$emit("check-all", this.newCheckedRows);
|
|
2950
|
+
this.$emit("update:checkedRows", this.newCheckedRows);
|
|
2951
|
+
},
|
|
2952
|
+
/*
|
|
2953
|
+
* Row checkbox click listener.
|
|
2954
|
+
*/
|
|
2955
|
+
checkRow(row, index, event) {
|
|
2956
|
+
if (!this.isRowCheckable(row)) return;
|
|
2957
|
+
const lastIndex = this.lastCheckedRowIndex;
|
|
2958
|
+
this.lastCheckedRowIndex = index;
|
|
2959
|
+
if (event.shiftKey && lastIndex !== null && index !== lastIndex) {
|
|
2960
|
+
this.shiftCheckRow(row, index, lastIndex);
|
|
2961
|
+
} else if (!this.isRowChecked(row)) {
|
|
2962
|
+
this.newCheckedRows.push(row);
|
|
2963
|
+
} else {
|
|
2964
|
+
this.removeCheckedRow(row);
|
|
2965
|
+
}
|
|
2966
|
+
this.$emit("check", this.newCheckedRows, row);
|
|
2967
|
+
this.$emit("update:checkedRows", this.newCheckedRows);
|
|
2968
|
+
},
|
|
2969
|
+
/*
|
|
2970
|
+
* Check row when shift is pressed.
|
|
2971
|
+
*/
|
|
2972
|
+
shiftCheckRow(row, index, lastCheckedRowIndex) {
|
|
2973
|
+
const subset = this.visibleData.slice(
|
|
2974
|
+
Math.min(index, lastCheckedRowIndex),
|
|
2975
|
+
Math.max(index, lastCheckedRowIndex) + 1
|
|
2976
|
+
);
|
|
2977
|
+
const shouldCheck = !this.isRowChecked(row);
|
|
2978
|
+
subset.forEach((item) => {
|
|
2979
|
+
this.removeCheckedRow(item);
|
|
2980
|
+
if (shouldCheck && this.isRowCheckable(item)) {
|
|
2981
|
+
this.newCheckedRows.push(item);
|
|
2982
|
+
}
|
|
2983
|
+
});
|
|
2984
|
+
},
|
|
2985
|
+
/*
|
|
2986
|
+
* Row click listener.
|
|
2987
|
+
* Emit all necessary events.
|
|
2988
|
+
*/
|
|
2989
|
+
selectRow(row) {
|
|
2990
|
+
this.$emit("click", row);
|
|
2991
|
+
this._selectedRow = row;
|
|
2992
|
+
if (this.selected === row) return;
|
|
2993
|
+
if (!this.isRowSelectable(row)) return;
|
|
2994
|
+
this.$emit("select", row, this.selected);
|
|
2995
|
+
this.$emit("update:selected", row);
|
|
2996
|
+
},
|
|
2997
|
+
/*
|
|
2998
|
+
* Toggle to show/hide details slot
|
|
2999
|
+
*/
|
|
3000
|
+
toggleDetails(obj) {
|
|
3001
|
+
const found = this.isVisibleDetailRow(obj);
|
|
3002
|
+
if (found) {
|
|
3003
|
+
this.closeDetailRow(obj);
|
|
3004
|
+
this.$emit("details-close", obj);
|
|
3005
|
+
} else {
|
|
3006
|
+
this.openDetailRow(obj);
|
|
3007
|
+
this.$emit("details-open", obj);
|
|
3008
|
+
}
|
|
3009
|
+
this.$emit("update:openedDetailed", this.visibleDetailRows);
|
|
3010
|
+
},
|
|
3011
|
+
openDetailRow(obj) {
|
|
3012
|
+
const index = this.handleDetailKey(obj);
|
|
3013
|
+
this.visibleDetailRows.push(index);
|
|
3014
|
+
},
|
|
3015
|
+
closeDetailRow(obj) {
|
|
3016
|
+
const index = this.handleDetailKey(obj);
|
|
3017
|
+
const i = this.visibleDetailRows.indexOf(index);
|
|
3018
|
+
if (i >= 0) {
|
|
3019
|
+
this.visibleDetailRows.splice(i, 1);
|
|
3020
|
+
}
|
|
3021
|
+
},
|
|
3022
|
+
isVisibleDetailRow(obj) {
|
|
3023
|
+
const index = this.handleDetailKey(obj);
|
|
3024
|
+
return this.visibleDetailRows.indexOf(index) >= 0;
|
|
3025
|
+
},
|
|
3026
|
+
isActiveDetailRow(row) {
|
|
3027
|
+
return this.detailed && !this.customDetailRow && this.isVisibleDetailRow(row);
|
|
3028
|
+
},
|
|
3029
|
+
isActiveCustomDetailRow(row) {
|
|
3030
|
+
return this.detailed && this.customDetailRow && this.isVisibleDetailRow(row);
|
|
3031
|
+
},
|
|
3032
|
+
isRowFiltered(row) {
|
|
3033
|
+
for (const key in this.filters) {
|
|
3034
|
+
if (!this.filters[key]) continue;
|
|
3035
|
+
const input = this.filters[key];
|
|
3036
|
+
const column = this.newColumns.filter((c) => c.field === key)[0];
|
|
3037
|
+
if (column && column.customSearch && typeof column.customSearch === "function") {
|
|
3038
|
+
if (!column.customSearch(row, input)) return false;
|
|
3039
|
+
} else {
|
|
3040
|
+
const value = this.getValueByPath(row, key);
|
|
3041
|
+
if (value == null) return false;
|
|
3042
|
+
if (Number.isInteger(value)) {
|
|
3043
|
+
if (value !== Number(input)) return false;
|
|
3044
|
+
} else {
|
|
3045
|
+
const re = new RegExp(escapeRegExpChars(input + ""), "i");
|
|
3046
|
+
if (Array.isArray(value)) {
|
|
3047
|
+
const valid = value.some(
|
|
3048
|
+
(val) => re.test(removeDiacriticsFromString(val)) || re.test(val)
|
|
3049
|
+
);
|
|
3050
|
+
if (!valid) return false;
|
|
3051
|
+
} else {
|
|
3052
|
+
if (!re.test(removeDiacriticsFromString(value)) && !re.test(value)) {
|
|
3053
|
+
return false;
|
|
3054
|
+
}
|
|
3055
|
+
}
|
|
3056
|
+
}
|
|
3057
|
+
}
|
|
3058
|
+
}
|
|
3059
|
+
return true;
|
|
3060
|
+
},
|
|
3061
|
+
/*
|
|
3062
|
+
* When the detailKey is defined we use the object[detailKey] as index.
|
|
3063
|
+
* If not, use the object reference by default.
|
|
3064
|
+
*/
|
|
3065
|
+
handleDetailKey(index) {
|
|
3066
|
+
const key = this.detailKey;
|
|
3067
|
+
return !key.length || !index ? index : index[key];
|
|
3068
|
+
},
|
|
3069
|
+
checkPredefinedDetailedRows() {
|
|
3070
|
+
const defaultExpandedRowsDefined = this.openedDetailed.length > 0;
|
|
3071
|
+
if (defaultExpandedRowsDefined && !this.detailKey.length) {
|
|
3072
|
+
throw new Error('If you set a predefined opened-detailed, you must provide a unique key using the prop "detail-key"');
|
|
3073
|
+
}
|
|
3074
|
+
},
|
|
3075
|
+
/*
|
|
3076
|
+
* Call initSort only first time (For example async data).
|
|
3077
|
+
*/
|
|
3078
|
+
checkSort() {
|
|
3079
|
+
if (this.newColumns.length && this.firstTimeSort) {
|
|
3080
|
+
this.initSort();
|
|
3081
|
+
this.firstTimeSort = false;
|
|
3082
|
+
} else if (this.newColumns.length) {
|
|
3083
|
+
if (vue.toRaw(this.currentSortColumn) !== BLANK_COLUMN) {
|
|
3084
|
+
for (let i = 0; i < this.newColumns.length; i++) {
|
|
3085
|
+
if (this.newColumns[i].field === this.currentSortColumn.field) {
|
|
3086
|
+
this.currentSortColumn = this.newColumns[i];
|
|
3087
|
+
break;
|
|
3088
|
+
}
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}
|
|
3092
|
+
},
|
|
3093
|
+
/*
|
|
3094
|
+
* Check if footer slot has custom content.
|
|
3095
|
+
*
|
|
3096
|
+
* Assumes that `$slots.footer` is specified.
|
|
3097
|
+
*/
|
|
3098
|
+
hasCustomFooterSlot() {
|
|
3099
|
+
var _a;
|
|
3100
|
+
const footer = this.$slots.footer();
|
|
3101
|
+
if (footer.length > 1) return true;
|
|
3102
|
+
if (isFragment(footer[0])) return true;
|
|
3103
|
+
const tag = (_a = footer[0].el) == null ? void 0 : _a.tag;
|
|
3104
|
+
if (tag !== "th" && tag !== "td") return false;
|
|
3105
|
+
return true;
|
|
3106
|
+
},
|
|
3107
|
+
/*
|
|
3108
|
+
* Check if bottom-left slot exists.
|
|
3109
|
+
*/
|
|
3110
|
+
hasBottomLeftSlot() {
|
|
3111
|
+
return typeof this.$slots["bottom-left"] !== "undefined";
|
|
3112
|
+
},
|
|
3113
|
+
/*
|
|
3114
|
+
* Table arrow keys listener, change selection.
|
|
3115
|
+
*/
|
|
3116
|
+
pressedArrow(pos) {
|
|
3117
|
+
if (!this.visibleData.length) return;
|
|
3118
|
+
let index = this.visibleData.indexOf(this.selected) + pos;
|
|
3119
|
+
index = index < 0 ? 0 : index > this.visibleData.length - 1 ? this.visibleData.length - 1 : index;
|
|
3120
|
+
const row = this.visibleData[index];
|
|
3121
|
+
if (!this.isRowSelectable(row)) {
|
|
3122
|
+
let newIndex = null;
|
|
3123
|
+
if (pos > 0) {
|
|
3124
|
+
for (let i = index; i < this.visibleData.length && newIndex === null; i++) {
|
|
3125
|
+
if (this.isRowSelectable(this.visibleData[i])) newIndex = i;
|
|
3126
|
+
}
|
|
3127
|
+
} else {
|
|
3128
|
+
for (let i = index; i >= 0 && newIndex === null; i--) {
|
|
3129
|
+
if (this.isRowSelectable(this.visibleData[i])) newIndex = i;
|
|
3130
|
+
}
|
|
3131
|
+
}
|
|
3132
|
+
if (newIndex >= 0) {
|
|
3133
|
+
this.selectRow(this.visibleData[newIndex]);
|
|
3134
|
+
}
|
|
3135
|
+
} else {
|
|
3136
|
+
this.selectRow(row);
|
|
3137
|
+
}
|
|
3138
|
+
},
|
|
3139
|
+
/*
|
|
3140
|
+
* Focus table element if has selected prop.
|
|
3141
|
+
*/
|
|
3142
|
+
focus() {
|
|
3143
|
+
if (!this.focusable) return;
|
|
3144
|
+
this.$el.querySelector("table").focus();
|
|
3145
|
+
},
|
|
3146
|
+
/*
|
|
3147
|
+
* Initial sorted column based on the default-sort prop.
|
|
3148
|
+
*/
|
|
3149
|
+
initSort() {
|
|
3150
|
+
if (this.sortMultiple && this.sortMultipleData) {
|
|
3151
|
+
this.sortMultipleData.forEach((column) => {
|
|
3152
|
+
this.sortMultiColumn(column);
|
|
3153
|
+
});
|
|
3154
|
+
} else {
|
|
3155
|
+
if (!this.defaultSort) return;
|
|
3156
|
+
let sortField = "";
|
|
3157
|
+
let sortDirection = this.defaultSortDirection;
|
|
3158
|
+
if (Array.isArray(this.defaultSort)) {
|
|
3159
|
+
sortField = this.defaultSort[0];
|
|
3160
|
+
if (this.defaultSort[1]) {
|
|
3161
|
+
sortDirection = this.defaultSort[1];
|
|
3162
|
+
}
|
|
3163
|
+
} else {
|
|
3164
|
+
sortField = this.defaultSort;
|
|
3165
|
+
}
|
|
3166
|
+
const sortColumn = this.newColumns.filter(
|
|
3167
|
+
(column) => column.field === sortField
|
|
3168
|
+
)[0];
|
|
3169
|
+
if (sortColumn) {
|
|
3170
|
+
this.isAsc = sortDirection.toLowerCase() !== "desc";
|
|
3171
|
+
this.sort(sortColumn, true);
|
|
3172
|
+
}
|
|
3173
|
+
}
|
|
3174
|
+
},
|
|
3175
|
+
/*
|
|
3176
|
+
* Emits drag start event (row)
|
|
3177
|
+
*/
|
|
3178
|
+
handleDragStart(event, row, index) {
|
|
3179
|
+
if (!this.canDragRow) return;
|
|
3180
|
+
this.isDraggingRow = true;
|
|
3181
|
+
this.$emit("dragstart", { event, row, index });
|
|
3182
|
+
},
|
|
3183
|
+
/*
|
|
3184
|
+
* Emits drag leave event (row)
|
|
3185
|
+
*/
|
|
3186
|
+
handleDragEnd(event, row, index) {
|
|
3187
|
+
if (!this.canDragRow) return;
|
|
3188
|
+
this.isDraggingRow = false;
|
|
3189
|
+
this.$emit("dragend", { event, row, index });
|
|
3190
|
+
},
|
|
3191
|
+
/*
|
|
3192
|
+
* Emits drop event (row)
|
|
3193
|
+
*/
|
|
3194
|
+
handleDrop(event, row, index) {
|
|
3195
|
+
if (!this.canDragRow) return;
|
|
3196
|
+
this.$emit("drop", { event, row, index });
|
|
3197
|
+
},
|
|
3198
|
+
/*
|
|
3199
|
+
* Emits drag over event (row)
|
|
3200
|
+
*/
|
|
3201
|
+
handleDragOver(event, row, index) {
|
|
3202
|
+
if (!this.canDragRow) return;
|
|
3203
|
+
this.$emit("dragover", { event, row, index });
|
|
3204
|
+
},
|
|
3205
|
+
/*
|
|
3206
|
+
* Emits drag leave event (row)
|
|
3207
|
+
*/
|
|
3208
|
+
handleDragLeave(event, row, index) {
|
|
3209
|
+
if (!this.canDragRow) return;
|
|
3210
|
+
this.$emit("dragleave", { event, row, index });
|
|
3211
|
+
},
|
|
3212
|
+
// FIXME: this method may emit events not listed in `emits`.
|
|
3213
|
+
// I decided not to list them to check if event listeners are actually
|
|
3214
|
+
// set in `$attrs`. The original idea of this method was to address
|
|
3215
|
+
// some performance issues and introduced at the commit:
|
|
3216
|
+
// https://github.com/ntohq/buefy-next/commit/e38726497785145195e9605840e33980fd4ae9e0
|
|
3217
|
+
// I am not sure whether the justification at https://github.com/buefy/buefy/pull/2150
|
|
3218
|
+
// is still relevant with Vue 3.
|
|
3219
|
+
emitEventForRow(eventName, event, row) {
|
|
3220
|
+
return this.$attrs[`on${eventName}`] ? this.$emit(eventName, row, event) : null;
|
|
3221
|
+
},
|
|
3222
|
+
/*
|
|
3223
|
+
* Emits drag start event (column)
|
|
3224
|
+
*/
|
|
3225
|
+
handleColumnDragStart(event, column, index) {
|
|
3226
|
+
if (!this.canDragColumn) return;
|
|
3227
|
+
this.isDraggingColumn = true;
|
|
3228
|
+
this.$emit("columndragstart", { event, column, index });
|
|
3229
|
+
},
|
|
3230
|
+
/*
|
|
3231
|
+
* Emits drag leave event (column)
|
|
3232
|
+
*/
|
|
3233
|
+
handleColumnDragEnd(event, column, index) {
|
|
3234
|
+
if (!this.canDragColumn) return;
|
|
3235
|
+
this.isDraggingColumn = false;
|
|
3236
|
+
this.$emit("columndragend", { event, column, index });
|
|
3237
|
+
},
|
|
3238
|
+
/*
|
|
3239
|
+
* Emits drop event (column)
|
|
3240
|
+
*/
|
|
3241
|
+
handleColumnDrop(event, column, index) {
|
|
3242
|
+
if (!this.canDragColumn) return;
|
|
3243
|
+
this.$emit("columndrop", { event, column, index });
|
|
3244
|
+
},
|
|
3245
|
+
/*
|
|
3246
|
+
* Emits drag over event (column)
|
|
3247
|
+
*/
|
|
3248
|
+
handleColumnDragOver(event, column, index) {
|
|
3249
|
+
if (!this.canDragColumn) return;
|
|
3250
|
+
this.$emit("columndragover", { event, column, index });
|
|
3251
|
+
},
|
|
3252
|
+
/*
|
|
3253
|
+
* Emits drag leave event (column)
|
|
3254
|
+
*/
|
|
3255
|
+
handleColumnDragLeave(event, column, index) {
|
|
3256
|
+
if (!this.canDragColumn) return;
|
|
3257
|
+
this.$emit("columndragleave", { event, column, index });
|
|
3258
|
+
},
|
|
3259
|
+
/*
|
|
3260
|
+
* Starts monitoring drag-by-touch events (row on touch-enabled devices)
|
|
3261
|
+
*/
|
|
3262
|
+
handleTouchStart(event, row) {
|
|
3263
|
+
if (!this.canDragRow) return;
|
|
3264
|
+
if (this.isDraggingColumn) return;
|
|
3265
|
+
if (this._selectedRow !== row) return;
|
|
3266
|
+
event.preventDefault();
|
|
3267
|
+
this.mayBeTouchDragging = true;
|
|
3268
|
+
},
|
|
3269
|
+
/*
|
|
3270
|
+
* Emits dragover and dragleave events (row on touch-enabled devices)
|
|
3271
|
+
*
|
|
3272
|
+
* Emits also dragstart if this is the first touchmove after touchstart.
|
|
3273
|
+
*/
|
|
3274
|
+
handleTouchMove(event) {
|
|
3275
|
+
if (!this.canDragRow) return;
|
|
3276
|
+
if (!this.mayBeTouchDragging) return;
|
|
3277
|
+
if (!this.isDraggingRow) {
|
|
3278
|
+
const eventTarget = event.target;
|
|
3279
|
+
const tr = eventTarget.closest("tr");
|
|
3280
|
+
this.draggedCellContent = tr ? `<table class="table"><tr>${tr.innerHTML}</tr></table>` : eventTarget.innerHTML;
|
|
3281
|
+
this.$refs.draggedCell.style.width = tr ? `${tr.offsetWidth}px` : `${eventTarget.offsetWidth}px`;
|
|
3282
|
+
eventTarget.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3283
|
+
type: "dragstart"
|
|
3284
|
+
}));
|
|
3285
|
+
}
|
|
3286
|
+
const touch = event.touches[0];
|
|
3287
|
+
const target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
3288
|
+
if (target != null) {
|
|
3289
|
+
if (target !== this.touchDragoverTarget) {
|
|
3290
|
+
if (this.touchDragoverTarget != null) {
|
|
3291
|
+
this.touchDragoverTarget.dispatchEvent(
|
|
3292
|
+
translateTouchAsDragEvent(event, {
|
|
3293
|
+
type: "dragleave",
|
|
3294
|
+
target: this.touchDragoverTarget
|
|
3295
|
+
})
|
|
3296
|
+
);
|
|
3297
|
+
}
|
|
3298
|
+
this.touchDragoverTarget = target;
|
|
3299
|
+
target.dispatchEvent(
|
|
3300
|
+
translateTouchAsDragEvent(event, {
|
|
3301
|
+
type: "dragover",
|
|
3302
|
+
target
|
|
3303
|
+
})
|
|
3304
|
+
);
|
|
3305
|
+
}
|
|
3306
|
+
} else if (this.touchDragoverTarget != null) {
|
|
3307
|
+
this.touchDragoverTarget.dispatchEvent(
|
|
3308
|
+
translateTouchAsDragEvent(event, {
|
|
3309
|
+
type: "dragleave",
|
|
3310
|
+
target: this.touchDragoverTarget
|
|
3311
|
+
})
|
|
3312
|
+
);
|
|
3313
|
+
this.touchDragoverTarget = null;
|
|
3314
|
+
}
|
|
3315
|
+
this.updateDraggedCell(touch);
|
|
3316
|
+
},
|
|
3317
|
+
/*
|
|
3318
|
+
* Emits drop and dragend events (row on touch-enabled devices)
|
|
3319
|
+
*/
|
|
3320
|
+
handleTouchEnd(event) {
|
|
3321
|
+
if (!this.canDragRow) return;
|
|
3322
|
+
if (this.isDraggingRow) {
|
|
3323
|
+
const touch = event.changedTouches[0];
|
|
3324
|
+
const target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
3325
|
+
if (target != null) {
|
|
3326
|
+
target.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3327
|
+
type: "drop",
|
|
3328
|
+
target
|
|
3329
|
+
}));
|
|
3330
|
+
}
|
|
3331
|
+
event.target.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3332
|
+
type: "dragend"
|
|
3333
|
+
}));
|
|
3334
|
+
this._selectedRow = null;
|
|
3335
|
+
}
|
|
3336
|
+
this.mayBeTouchDragging = false;
|
|
3337
|
+
},
|
|
3338
|
+
/*
|
|
3339
|
+
* Starts monitoring drag-by-touch events (column on touch-enabled devices)
|
|
3340
|
+
*/
|
|
3341
|
+
handleColumnTouchStart(event) {
|
|
3342
|
+
if (!this.canDragColumn) return;
|
|
3343
|
+
if (this.isDraggingRow) return;
|
|
3344
|
+
event.preventDefault();
|
|
3345
|
+
this.mayBeTouchDragging = true;
|
|
3346
|
+
},
|
|
3347
|
+
/*
|
|
3348
|
+
* Emits dragover and dragleave events (column on touch-enabled devices)
|
|
3349
|
+
*
|
|
3350
|
+
* Also emits dragstart if this is the first touchmove after touchstart.
|
|
3351
|
+
*/
|
|
3352
|
+
handleColumnTouchMove(event) {
|
|
3353
|
+
if (!this.canDragColumn) return;
|
|
3354
|
+
if (!this.mayBeTouchDragging) return;
|
|
3355
|
+
if (!this.isDraggingColumn) {
|
|
3356
|
+
const eventTarget = event.target;
|
|
3357
|
+
this.draggedCellContent = eventTarget.innerHTML;
|
|
3358
|
+
this.$refs.draggedCell.style.width = `${eventTarget.offsetWidth}px`;
|
|
3359
|
+
eventTarget.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3360
|
+
type: "dragstart"
|
|
3361
|
+
}));
|
|
3362
|
+
}
|
|
3363
|
+
const touch = event.touches[0];
|
|
3364
|
+
const target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
3365
|
+
if (target != null) {
|
|
3366
|
+
if (target !== this.touchDragoverTarget) {
|
|
3367
|
+
if (this.touchDragoverTarget != null) {
|
|
3368
|
+
this.touchDragoverTarget.dispatchEvent(
|
|
3369
|
+
translateTouchAsDragEvent(event, {
|
|
3370
|
+
type: "dragleave",
|
|
3371
|
+
target: this.touchDragoverTarget
|
|
3372
|
+
})
|
|
3373
|
+
);
|
|
3374
|
+
}
|
|
3375
|
+
this.touchDragoverTarget = target;
|
|
3376
|
+
target.dispatchEvent(
|
|
3377
|
+
translateTouchAsDragEvent(event, {
|
|
3378
|
+
type: "dragover",
|
|
3379
|
+
target
|
|
3380
|
+
})
|
|
3381
|
+
);
|
|
3382
|
+
}
|
|
3383
|
+
} else if (this.touchDragoverTarget != null) {
|
|
3384
|
+
this.touchDragoverTarget.dispatchEvent(
|
|
3385
|
+
translateTouchAsDragEvent(event, {
|
|
3386
|
+
type: "dragleave",
|
|
3387
|
+
target: this.touchDragoverTarget
|
|
3388
|
+
})
|
|
3389
|
+
);
|
|
3390
|
+
this.touchDragoverTarget = null;
|
|
3391
|
+
}
|
|
3392
|
+
this.updateDraggedCell(touch);
|
|
3393
|
+
},
|
|
3394
|
+
/*
|
|
3395
|
+
* Emits drop and dragend events (column on touch-enabled devices)
|
|
3396
|
+
*/
|
|
3397
|
+
handleColumnTouchEnd(event) {
|
|
3398
|
+
if (!this.canDragColumn) return;
|
|
3399
|
+
if (this.isDraggingColumn) {
|
|
3400
|
+
const touch = event.changedTouches[0];
|
|
3401
|
+
const target = document.elementFromPoint(touch.clientX, touch.clientY);
|
|
3402
|
+
if (target != null) {
|
|
3403
|
+
target.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3404
|
+
type: "drop",
|
|
3405
|
+
target
|
|
3406
|
+
}));
|
|
3407
|
+
}
|
|
3408
|
+
event.target.dispatchEvent(translateTouchAsDragEvent(event, {
|
|
3409
|
+
type: "dragend"
|
|
3410
|
+
}));
|
|
3411
|
+
}
|
|
3412
|
+
this.mayBeTouchDragging = false;
|
|
3413
|
+
},
|
|
3414
|
+
updateDraggedCell({ clientX, clientY }) {
|
|
3415
|
+
const cellRect = this.$refs.draggedCell.getBoundingClientRect();
|
|
3416
|
+
const top = clientY + window.scrollY - cellRect.height / 2;
|
|
3417
|
+
const left = clientX + window.scrollX - cellRect.width / 2;
|
|
3418
|
+
this.$refs.draggedCell.style.top = `calc(${top}px)`;
|
|
3419
|
+
this.$refs.draggedCell.style.left = `calc(${left}px)`;
|
|
3420
|
+
},
|
|
3421
|
+
_registerTableColumn(column) {
|
|
3422
|
+
if (column._isTableColumn) {
|
|
3423
|
+
this.defaultSlots.push(column);
|
|
3424
|
+
}
|
|
3425
|
+
},
|
|
3426
|
+
_unregisterTableColumn(column) {
|
|
3427
|
+
const index = this.defaultSlots.indexOf(column);
|
|
3428
|
+
if (index !== -1) {
|
|
3429
|
+
this.defaultSlots.splice(index, 1);
|
|
3430
|
+
}
|
|
3431
|
+
}
|
|
3432
|
+
},
|
|
3433
|
+
mounted() {
|
|
3434
|
+
this.checkPredefinedDetailedRows();
|
|
3435
|
+
this.checkSort();
|
|
3436
|
+
const prepareDraggedCell = (isDraggable) => {
|
|
3437
|
+
if (isDraggable && this.$data._draggedCellEl == null) {
|
|
3438
|
+
this.$data._draggedCellEl = createAbsoluteElement(this.$refs.draggedCell);
|
|
3439
|
+
}
|
|
3440
|
+
};
|
|
3441
|
+
this.$watch("draggable", prepareDraggedCell, { immediate: true });
|
|
3442
|
+
this.$watch("draggableColumn", prepareDraggedCell, { immediate: true });
|
|
3443
|
+
},
|
|
3444
|
+
beforeUnmount() {
|
|
3445
|
+
if (this.$data._draggedCellEl) {
|
|
3446
|
+
removeElement(this.$data._draggedCellEl);
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
});
|
|
3450
|
+
|
|
3451
|
+
const _hoisted_1 = ["tabindex"];
|
|
3452
|
+
const _hoisted_2 = { key: 1 };
|
|
3453
|
+
const _hoisted_3 = {
|
|
3454
|
+
key: 0,
|
|
3455
|
+
width: "40px"
|
|
3456
|
+
};
|
|
3457
|
+
const _hoisted_4 = ["onClick", "draggable", "onDragstart", "onDragend", "onDrop", "onDragover", "onDragleave"];
|
|
3458
|
+
const _hoisted_5 = {
|
|
3459
|
+
key: 0,
|
|
3460
|
+
class: "multi-sort-icons"
|
|
3461
|
+
};
|
|
3462
|
+
const _hoisted_6 = ["onClick"];
|
|
3463
|
+
const _hoisted_7 = {
|
|
3464
|
+
key: 0,
|
|
3465
|
+
class: "is-subheading"
|
|
3466
|
+
};
|
|
3467
|
+
const _hoisted_8 = {
|
|
3468
|
+
key: 0,
|
|
3469
|
+
width: "40px"
|
|
3470
|
+
};
|
|
3471
|
+
const _hoisted_9 = { key: 1 };
|
|
3472
|
+
const _hoisted_10 = { key: 2 };
|
|
3473
|
+
const _hoisted_11 = { key: 1 };
|
|
3474
|
+
const _hoisted_12 = {
|
|
3475
|
+
key: 0,
|
|
3476
|
+
width: "40px"
|
|
3477
|
+
};
|
|
3478
|
+
const _hoisted_13 = { key: 1 };
|
|
3479
|
+
const _hoisted_14 = { key: 2 };
|
|
3480
|
+
const _hoisted_15 = ["onClick", "onDblclick", "onMouseenter", "onMouseleave", "onContextmenu", "draggable", "onDragstart", "onDragend", "onDrop", "onDragover", "onDragleave", "onTouchstart"];
|
|
3481
|
+
const _hoisted_16 = {
|
|
3482
|
+
key: 0,
|
|
3483
|
+
class: "chevron-cell"
|
|
3484
|
+
};
|
|
3485
|
+
const _hoisted_17 = ["onClick"];
|
|
3486
|
+
const _hoisted_18 = {
|
|
3487
|
+
key: 0,
|
|
3488
|
+
class: "detail"
|
|
3489
|
+
};
|
|
3490
|
+
const _hoisted_19 = ["colspan"];
|
|
3491
|
+
const _hoisted_20 = { class: "detail-container" };
|
|
3492
|
+
const _hoisted_21 = {
|
|
3493
|
+
key: 0,
|
|
3494
|
+
class: "is-empty"
|
|
3495
|
+
};
|
|
3496
|
+
const _hoisted_22 = ["colspan"];
|
|
3497
|
+
const _hoisted_23 = { key: 2 };
|
|
3498
|
+
const _hoisted_24 = { class: "table-footer" };
|
|
3499
|
+
const _hoisted_25 = ["colspan"];
|
|
3500
|
+
const _hoisted_26 = ["innerHTML"];
|
|
3501
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3502
|
+
const _component_b_table_mobile_sort = vue.resolveComponent("b-table-mobile-sort");
|
|
3503
|
+
const _component_b_table_pagination = vue.resolveComponent("b-table-pagination");
|
|
3504
|
+
const _component_b_checkbox = vue.resolveComponent("b-checkbox");
|
|
3505
|
+
const _component_b_slot_component = vue.resolveComponent("b-slot-component");
|
|
3506
|
+
const _component_b_icon = vue.resolveComponent("b-icon");
|
|
3507
|
+
const _component_b_input = vue.resolveComponent("b-input");
|
|
3508
|
+
const _component_b_loading = vue.resolveComponent("b-loading");
|
|
3509
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3510
|
+
"div",
|
|
3511
|
+
vue.mergeProps({ class: "b-table" }, _ctx.rootAttrs),
|
|
3512
|
+
[
|
|
3513
|
+
vue.renderSlot(_ctx.$slots, "default"),
|
|
3514
|
+
_ctx.mobileCards && _ctx.hasSortablenewColumns ? (vue.openBlock(), vue.createBlock(_component_b_table_mobile_sort, {
|
|
3515
|
+
key: 0,
|
|
3516
|
+
"current-sort-column": _ctx.currentSortColumn,
|
|
3517
|
+
"sort-multiple": _ctx.sortMultiple,
|
|
3518
|
+
"sort-multiple-data": _ctx.sortMultipleDataComputed,
|
|
3519
|
+
"is-asc": _ctx.isAsc,
|
|
3520
|
+
columns: _ctx.newColumns,
|
|
3521
|
+
placeholder: _ctx.mobileSortPlaceholder,
|
|
3522
|
+
"icon-pack": _ctx.iconPack,
|
|
3523
|
+
"sort-icon": _ctx.sortIcon,
|
|
3524
|
+
"sort-icon-size": _ctx.sortIconSize,
|
|
3525
|
+
onSort: _cache[0] || (_cache[0] = (column, event) => _ctx.sort(column, null, event)),
|
|
3526
|
+
onRemovePriority: _cache[1] || (_cache[1] = (column) => _ctx.removeSortingPriority(column))
|
|
3527
|
+
}, null, 8, ["current-sort-column", "sort-multiple", "sort-multiple-data", "is-asc", "columns", "placeholder", "icon-pack", "sort-icon", "sort-icon-size"])) : vue.createCommentVNode("v-if", true),
|
|
3528
|
+
_ctx.paginated && (_ctx.paginationPosition === "top" || _ctx.paginationPosition === "both") ? vue.renderSlot(_ctx.$slots, "pagination", { key: 1 }, () => [
|
|
3529
|
+
vue.createVNode(_component_b_table_pagination, vue.mergeProps(_ctx.fallthroughAttrs, {
|
|
3530
|
+
"per-page": _ctx.perPage,
|
|
3531
|
+
paginated: _ctx.paginated,
|
|
3532
|
+
rounded: _ctx.paginationRounded,
|
|
3533
|
+
"icon-pack": _ctx.iconPack,
|
|
3534
|
+
total: _ctx.newDataTotal,
|
|
3535
|
+
"current-page": _ctx.newCurrentPage,
|
|
3536
|
+
"onUpdate:currentPage": _cache[2] || (_cache[2] = ($event) => _ctx.newCurrentPage = $event),
|
|
3537
|
+
"aria-next-label": _ctx.ariaNextLabel,
|
|
3538
|
+
"aria-previous-label": _ctx.ariaPreviousLabel,
|
|
3539
|
+
"aria-page-label": _ctx.ariaPageLabel,
|
|
3540
|
+
"aria-current-label": _ctx.ariaCurrentLabel,
|
|
3541
|
+
onPageChange: _cache[3] || (_cache[3] = (event) => _ctx.$emit("page-change", event)),
|
|
3542
|
+
"page-input": _ctx.pageInput,
|
|
3543
|
+
"pagination-order": _ctx.paginationOrder,
|
|
3544
|
+
"page-input-position": _ctx.pageInputPosition,
|
|
3545
|
+
"debounce-page-input": _ctx.debouncePageInput
|
|
3546
|
+
}), {
|
|
3547
|
+
default: vue.withCtx(() => [
|
|
3548
|
+
vue.renderSlot(_ctx.$slots, "top-left")
|
|
3549
|
+
]),
|
|
3550
|
+
_: 3
|
|
3551
|
+
/* FORWARDED */
|
|
3552
|
+
}, 16, ["per-page", "paginated", "rounded", "icon-pack", "total", "current-page", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "pagination-order", "page-input-position", "debounce-page-input"])
|
|
3553
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
3554
|
+
vue.createElementVNode(
|
|
3555
|
+
"div",
|
|
3556
|
+
{
|
|
3557
|
+
class: vue.normalizeClass(["table-wrapper", _ctx.tableWrapperClasses]),
|
|
3558
|
+
style: vue.normalizeStyle(_ctx.tableStyle)
|
|
3559
|
+
},
|
|
3560
|
+
[
|
|
3561
|
+
vue.createElementVNode("table", {
|
|
3562
|
+
class: vue.normalizeClass(["table", _ctx.tableClasses]),
|
|
3563
|
+
tabindex: !_ctx.focusable ? void 0 : 0,
|
|
3564
|
+
onKeydown: [
|
|
3565
|
+
_cache[9] || (_cache[9] = vue.withKeys(vue.withModifiers(($event) => _ctx.pressedArrow(-1), ["self", "prevent"]), ["up"])),
|
|
3566
|
+
_cache[10] || (_cache[10] = vue.withKeys(vue.withModifiers(($event) => _ctx.pressedArrow(1), ["self", "prevent"]), ["down"]))
|
|
3567
|
+
]
|
|
3568
|
+
}, [
|
|
3569
|
+
_ctx.caption ? vue.withDirectives((vue.openBlock(), vue.createElementBlock(
|
|
3570
|
+
"caption",
|
|
3571
|
+
{ key: 0 },
|
|
3572
|
+
vue.toDisplayString(_ctx.caption),
|
|
3573
|
+
513
|
|
3574
|
+
/* TEXT, NEED_PATCH */
|
|
3575
|
+
)), [
|
|
3576
|
+
[vue.vShow, _ctx.showCaption]
|
|
3577
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
3578
|
+
_ctx.newColumns.length && _ctx.showHeader ? (vue.openBlock(), vue.createElementBlock("thead", _hoisted_2, [
|
|
3579
|
+
vue.createElementVNode("tr", null, [
|
|
3580
|
+
_ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_3)) : vue.createCommentVNode("v-if", true),
|
|
3581
|
+
_ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock(
|
|
3582
|
+
"th",
|
|
3583
|
+
{
|
|
3584
|
+
key: 1,
|
|
3585
|
+
class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
|
|
3586
|
+
},
|
|
3587
|
+
[
|
|
3588
|
+
_ctx.headerCheckable ? vue.renderSlot(_ctx.$slots, "check-all", {
|
|
3589
|
+
key: 0,
|
|
3590
|
+
isAllChecked: _ctx.isAllChecked,
|
|
3591
|
+
isAllUncheckable: _ctx.isAllUncheckable,
|
|
3592
|
+
checkAll: _ctx.checkAll
|
|
3593
|
+
}, () => [
|
|
3594
|
+
vue.createVNode(_component_b_checkbox, {
|
|
3595
|
+
autocomplete: "off",
|
|
3596
|
+
"model-value": _ctx.isAllChecked,
|
|
3597
|
+
type: _ctx.checkboxType,
|
|
3598
|
+
disabled: _ctx.isAllUncheckable,
|
|
3599
|
+
onChange: _ctx.checkAll
|
|
3600
|
+
}, null, 8, ["model-value", "type", "disabled", "onChange"])
|
|
3601
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
3602
|
+
],
|
|
3603
|
+
2
|
|
3604
|
+
/* CLASS */
|
|
3605
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
3606
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3607
|
+
vue.Fragment,
|
|
3608
|
+
null,
|
|
3609
|
+
vue.renderList(_ctx.visibleColumns, (column, index) => {
|
|
3610
|
+
return vue.openBlock(), vue.createElementBlock("th", vue.mergeProps({
|
|
3611
|
+
key: column.newKey + ":" + index + "header"
|
|
3612
|
+
}, column.thAttrs(column), {
|
|
3613
|
+
class: [column.thClasses, {
|
|
3614
|
+
"is-current-sort": !_ctx.sortMultiple && _ctx.currentSortColumn === column
|
|
3615
|
+
}],
|
|
3616
|
+
style: column.thStyle,
|
|
3617
|
+
onClick: vue.withModifiers(($event) => _ctx.sort(column, null, $event), ["stop"]),
|
|
3618
|
+
draggable: _ctx.canDragColumn,
|
|
3619
|
+
onDragstart: ($event) => _ctx.handleColumnDragStart($event, column, index),
|
|
3620
|
+
onDragend: ($event) => _ctx.handleColumnDragEnd($event, column, index),
|
|
3621
|
+
onDrop: ($event) => _ctx.handleColumnDrop($event, column, index),
|
|
3622
|
+
onDragover: ($event) => _ctx.handleColumnDragOver($event, column, index),
|
|
3623
|
+
onDragleave: ($event) => _ctx.handleColumnDragLeave($event, column, index),
|
|
3624
|
+
onTouchstart: _cache[4] || (_cache[4] = ($event) => _ctx.handleColumnTouchStart($event)),
|
|
3625
|
+
onTouchmove: _cache[5] || (_cache[5] = ($event) => _ctx.handleColumnTouchMove($event)),
|
|
3626
|
+
onTouchend: _cache[6] || (_cache[6] = ($event) => _ctx.handleColumnTouchEnd($event))
|
|
3627
|
+
}), [
|
|
3628
|
+
vue.createElementVNode(
|
|
3629
|
+
"div",
|
|
3630
|
+
{
|
|
3631
|
+
class: vue.normalizeClass(["th-wrap is-relative", {
|
|
3632
|
+
"is-numeric": column.numeric,
|
|
3633
|
+
"is-centered": column.centered
|
|
3634
|
+
}]),
|
|
3635
|
+
style: vue.normalizeStyle(column.thWrapStyle)
|
|
3636
|
+
},
|
|
3637
|
+
[
|
|
3638
|
+
column.$slots.header ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
|
|
3639
|
+
key: 0,
|
|
3640
|
+
component: column,
|
|
3641
|
+
scoped: "",
|
|
3642
|
+
name: "header",
|
|
3643
|
+
tag: "span",
|
|
3644
|
+
props: { column, index }
|
|
3645
|
+
}, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createElementBlock(
|
|
3646
|
+
vue.Fragment,
|
|
3647
|
+
{ key: 1 },
|
|
3648
|
+
[
|
|
3649
|
+
vue.createTextVNode(
|
|
3650
|
+
vue.toDisplayString(column.label) + " ",
|
|
3651
|
+
1
|
|
3652
|
+
/* TEXT */
|
|
3653
|
+
),
|
|
3654
|
+
_ctx.sortMultiple && _ctx.sortMultipleDataComputed && _ctx.sortMultipleDataComputed.length > 0 && _ctx.sortMultipleDataComputed.filter((i) => i.field === column.field).length > 0 ? (vue.openBlock(), vue.createElementBlock("span", _hoisted_5, [
|
|
3655
|
+
vue.createVNode(_component_b_icon, {
|
|
3656
|
+
icon: _ctx.sortIcon,
|
|
3657
|
+
pack: _ctx.iconPack,
|
|
3658
|
+
both: "",
|
|
3659
|
+
size: _ctx.sortIconSize,
|
|
3660
|
+
class: vue.normalizeClass({
|
|
3661
|
+
"is-desc": _ctx.sortMultipleDataComputed.filter((i) => i.field === column.field)[0].order === "desc"
|
|
3662
|
+
})
|
|
3663
|
+
}, null, 8, ["icon", "pack", "size", "class"]),
|
|
3664
|
+
vue.createTextVNode(
|
|
3665
|
+
" " + vue.toDisplayString(_ctx.findIndexOfSortData(column)) + " ",
|
|
3666
|
+
1
|
|
3667
|
+
/* TEXT */
|
|
3668
|
+
),
|
|
3669
|
+
vue.createElementVNode("button", {
|
|
3670
|
+
class: "delete is-small multi-sort-cancel-icon",
|
|
3671
|
+
type: "button",
|
|
3672
|
+
onClick: vue.withModifiers(($event) => _ctx.removeSortingPriority(column), ["stop"])
|
|
3673
|
+
}, null, 8, _hoisted_6)
|
|
3674
|
+
])) : (vue.openBlock(), vue.createBlock(_component_b_icon, {
|
|
3675
|
+
key: 1,
|
|
3676
|
+
icon: _ctx.sortIcon,
|
|
3677
|
+
pack: _ctx.iconPack,
|
|
3678
|
+
both: "",
|
|
3679
|
+
size: _ctx.sortIconSize,
|
|
3680
|
+
class: vue.normalizeClass(["sort-icon", {
|
|
3681
|
+
"is-desc": !_ctx.isAsc,
|
|
3682
|
+
"is-invisible": _ctx.currentSortColumn !== column
|
|
3683
|
+
}])
|
|
3684
|
+
}, null, 8, ["icon", "pack", "size", "class"]))
|
|
3685
|
+
],
|
|
3686
|
+
64
|
|
3687
|
+
/* STABLE_FRAGMENT */
|
|
3688
|
+
))
|
|
3689
|
+
],
|
|
3690
|
+
6
|
|
3691
|
+
/* CLASS, STYLE */
|
|
3692
|
+
)
|
|
3693
|
+
], 16, _hoisted_4);
|
|
3694
|
+
}),
|
|
3695
|
+
128
|
|
3696
|
+
/* KEYED_FRAGMENT */
|
|
3697
|
+
)),
|
|
3698
|
+
_ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock(
|
|
3699
|
+
"th",
|
|
3700
|
+
{
|
|
3701
|
+
key: 2,
|
|
3702
|
+
class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
|
|
3703
|
+
},
|
|
3704
|
+
[
|
|
3705
|
+
_ctx.headerCheckable ? vue.renderSlot(_ctx.$slots, "check-all", {
|
|
3706
|
+
key: 0,
|
|
3707
|
+
isAllChecked: _ctx.isAllChecked,
|
|
3708
|
+
isAllUncheckable: _ctx.isAllUncheckable,
|
|
3709
|
+
checkAll: _ctx.checkAll
|
|
3710
|
+
}, () => [
|
|
3711
|
+
vue.createVNode(_component_b_checkbox, {
|
|
3712
|
+
autocomplete: "off",
|
|
3713
|
+
"model-value": _ctx.isAllChecked,
|
|
3714
|
+
type: _ctx.checkboxType,
|
|
3715
|
+
disabled: _ctx.isAllUncheckable,
|
|
3716
|
+
onChange: _ctx.checkAll
|
|
3717
|
+
}, null, 8, ["model-value", "type", "disabled", "onChange"])
|
|
3718
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
3719
|
+
],
|
|
3720
|
+
2
|
|
3721
|
+
/* CLASS */
|
|
3722
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
3723
|
+
]),
|
|
3724
|
+
_ctx.hasCustomSubheadings ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_7, [
|
|
3725
|
+
_ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_8)) : vue.createCommentVNode("v-if", true),
|
|
3726
|
+
_ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_9)) : vue.createCommentVNode("v-if", true),
|
|
3727
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3728
|
+
vue.Fragment,
|
|
3729
|
+
null,
|
|
3730
|
+
vue.renderList(_ctx.visibleColumns, (column, index) => {
|
|
3731
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3732
|
+
"th",
|
|
3733
|
+
{
|
|
3734
|
+
key: column.newKey + ":" + index + "subheading",
|
|
3735
|
+
style: vue.normalizeStyle(column.style)
|
|
3736
|
+
},
|
|
3737
|
+
[
|
|
3738
|
+
vue.createElementVNode(
|
|
3739
|
+
"div",
|
|
3740
|
+
{
|
|
3741
|
+
class: vue.normalizeClass(["th-wrap", {
|
|
3742
|
+
"is-numeric": column.numeric,
|
|
3743
|
+
"is-centered": column.centered
|
|
3744
|
+
}]),
|
|
3745
|
+
style: vue.normalizeStyle(column.thWrapStyle)
|
|
3746
|
+
},
|
|
3747
|
+
[
|
|
3748
|
+
column.$slots.subheading ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
|
|
3749
|
+
key: 0,
|
|
3750
|
+
component: column,
|
|
3751
|
+
scoped: "",
|
|
3752
|
+
name: "subheading",
|
|
3753
|
+
tag: "span",
|
|
3754
|
+
props: { column, index }
|
|
3755
|
+
}, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createElementBlock(
|
|
3756
|
+
vue.Fragment,
|
|
3757
|
+
{ key: 1 },
|
|
3758
|
+
[
|
|
3759
|
+
vue.createTextVNode(
|
|
3760
|
+
vue.toDisplayString(column.subheading),
|
|
3761
|
+
1
|
|
3762
|
+
/* TEXT */
|
|
3763
|
+
)
|
|
3764
|
+
],
|
|
3765
|
+
64
|
|
3766
|
+
/* STABLE_FRAGMENT */
|
|
3767
|
+
))
|
|
3768
|
+
],
|
|
3769
|
+
6
|
|
3770
|
+
/* CLASS, STYLE */
|
|
3771
|
+
)
|
|
3772
|
+
],
|
|
3773
|
+
4
|
|
3774
|
+
/* STYLE */
|
|
3775
|
+
);
|
|
3776
|
+
}),
|
|
3777
|
+
128
|
|
3778
|
+
/* KEYED_FRAGMENT */
|
|
3779
|
+
)),
|
|
3780
|
+
_ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_10)) : vue.createCommentVNode("v-if", true)
|
|
3781
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
3782
|
+
_ctx.hasSearchablenewColumns ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_11, [
|
|
3783
|
+
_ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_12)) : vue.createCommentVNode("v-if", true),
|
|
3784
|
+
_ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_13)) : vue.createCommentVNode("v-if", true),
|
|
3785
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3786
|
+
vue.Fragment,
|
|
3787
|
+
null,
|
|
3788
|
+
vue.renderList(_ctx.visibleColumns, (column, index) => {
|
|
3789
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3790
|
+
"th",
|
|
3791
|
+
vue.mergeProps({
|
|
3792
|
+
key: column.newKey + ":" + index + "searchable"
|
|
3793
|
+
}, column.thAttrs(column), {
|
|
3794
|
+
style: column.thStyle,
|
|
3795
|
+
class: { "is-sticky": column.sticky }
|
|
3796
|
+
}),
|
|
3797
|
+
[
|
|
3798
|
+
vue.createElementVNode(
|
|
3799
|
+
"div",
|
|
3800
|
+
{
|
|
3801
|
+
class: "th-wrap",
|
|
3802
|
+
style: vue.normalizeStyle(column.thWrapStyle)
|
|
3803
|
+
},
|
|
3804
|
+
[
|
|
3805
|
+
column.searchable ? (vue.openBlock(), vue.createElementBlock(
|
|
3806
|
+
vue.Fragment,
|
|
3807
|
+
{ key: 0 },
|
|
3808
|
+
[
|
|
3809
|
+
column.$slots.searchable ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, {
|
|
3810
|
+
key: 0,
|
|
3811
|
+
component: column,
|
|
3812
|
+
scoped: true,
|
|
3813
|
+
name: "searchable",
|
|
3814
|
+
tag: "span",
|
|
3815
|
+
props: { column, filters: _ctx.filters }
|
|
3816
|
+
}, null, 8, ["component", "props"])) : (vue.openBlock(), vue.createBlock(_component_b_input, vue.mergeProps({
|
|
3817
|
+
key: 1,
|
|
3818
|
+
[vue.toHandlerKey(_ctx.filtersEvent)]: _ctx.onFiltersEvent
|
|
3819
|
+
}, {
|
|
3820
|
+
modelValue: _ctx.filters[column.field],
|
|
3821
|
+
"onUpdate:modelValue": ($event) => _ctx.filters[column.field] = $event,
|
|
3822
|
+
type: column.numeric ? "number" : "text"
|
|
3823
|
+
}), null, 16, ["modelValue", "onUpdate:modelValue", "type"]))
|
|
3824
|
+
],
|
|
3825
|
+
64
|
|
3826
|
+
/* STABLE_FRAGMENT */
|
|
3827
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
3828
|
+
],
|
|
3829
|
+
4
|
|
3830
|
+
/* STYLE */
|
|
3831
|
+
)
|
|
3832
|
+
],
|
|
3833
|
+
16
|
|
3834
|
+
/* FULL_PROPS */
|
|
3835
|
+
);
|
|
3836
|
+
}),
|
|
3837
|
+
128
|
|
3838
|
+
/* KEYED_FRAGMENT */
|
|
3839
|
+
)),
|
|
3840
|
+
_ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock("th", _hoisted_14)) : vue.createCommentVNode("v-if", true)
|
|
3841
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
3842
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
3843
|
+
vue.createElementVNode("tbody", null, [
|
|
3844
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3845
|
+
vue.Fragment,
|
|
3846
|
+
null,
|
|
3847
|
+
vue.renderList(_ctx.visibleData, (row, index) => {
|
|
3848
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3849
|
+
vue.Fragment,
|
|
3850
|
+
{
|
|
3851
|
+
key: _ctx.customRowKey ? row[_ctx.customRowKey] : index
|
|
3852
|
+
},
|
|
3853
|
+
[
|
|
3854
|
+
vue.createElementVNode("tr", {
|
|
3855
|
+
class: vue.normalizeClass([_ctx.rowClass(row, index), {
|
|
3856
|
+
"is-selected": _ctx.isRowSelected(row, _ctx.selected),
|
|
3857
|
+
"is-checked": _ctx.isRowChecked(row)
|
|
3858
|
+
}]),
|
|
3859
|
+
onClick: ($event) => _ctx.selectRow(row),
|
|
3860
|
+
onDblclick: ($event) => _ctx.$emit("dblclick", row),
|
|
3861
|
+
onMouseenter: ($event) => _ctx.emitEventForRow("mouseenter", $event, row),
|
|
3862
|
+
onMouseleave: ($event) => _ctx.emitEventForRow("mouseleave", $event, row),
|
|
3863
|
+
onContextmenu: ($event) => _ctx.$emit("contextmenu", row, $event),
|
|
3864
|
+
draggable: _ctx.canDragRow,
|
|
3865
|
+
onDragstart: ($event) => _ctx.handleDragStart($event, row, index),
|
|
3866
|
+
onDragend: ($event) => _ctx.handleDragEnd($event, row, index),
|
|
3867
|
+
onDrop: ($event) => _ctx.handleDrop($event, row, index),
|
|
3868
|
+
onDragover: ($event) => _ctx.handleDragOver($event, row, index),
|
|
3869
|
+
onDragleave: ($event) => _ctx.handleDragLeave($event, row, index),
|
|
3870
|
+
onTouchstart: ($event) => _ctx.handleTouchStart($event, row),
|
|
3871
|
+
onTouchmove: _cache[7] || (_cache[7] = ($event) => _ctx.handleTouchMove($event)),
|
|
3872
|
+
onTouchend: _cache[8] || (_cache[8] = ($event) => _ctx.handleTouchEnd($event))
|
|
3873
|
+
}, [
|
|
3874
|
+
_ctx.showDetailRowIcon ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_16, [
|
|
3875
|
+
_ctx.hasDetailedVisible(row) ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
3876
|
+
key: 0,
|
|
3877
|
+
role: "button",
|
|
3878
|
+
onClick: vue.withModifiers(($event) => _ctx.toggleDetails(row), ["stop"])
|
|
3879
|
+
}, [
|
|
3880
|
+
vue.createVNode(_component_b_icon, {
|
|
3881
|
+
icon: _ctx.detailIcon,
|
|
3882
|
+
pack: _ctx.iconPack,
|
|
3883
|
+
both: "",
|
|
3884
|
+
class: vue.normalizeClass({ "is-expanded": _ctx.isVisibleDetailRow(row) })
|
|
3885
|
+
}, null, 8, ["icon", "pack", "class"])
|
|
3886
|
+
], 8, _hoisted_17)) : vue.createCommentVNode("v-if", true)
|
|
3887
|
+
])) : vue.createCommentVNode("v-if", true),
|
|
3888
|
+
_ctx.checkable && _ctx.checkboxPosition === "left" ? (vue.openBlock(), vue.createElementBlock(
|
|
3889
|
+
"td",
|
|
3890
|
+
{
|
|
3891
|
+
key: 1,
|
|
3892
|
+
class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
|
|
3893
|
+
},
|
|
3894
|
+
[
|
|
3895
|
+
vue.createVNode(_component_b_checkbox, {
|
|
3896
|
+
autocomplete: "off",
|
|
3897
|
+
"model-value": _ctx.isRowChecked(row),
|
|
3898
|
+
type: _ctx.checkboxType,
|
|
3899
|
+
disabled: !_ctx.isRowCheckable(row),
|
|
3900
|
+
onClick: vue.withModifiers(($event) => _ctx.checkRow(row, index, $event), ["prevent", "stop"])
|
|
3901
|
+
}, null, 8, ["model-value", "type", "disabled", "onClick"])
|
|
3902
|
+
],
|
|
3903
|
+
2
|
|
3904
|
+
/* CLASS */
|
|
3905
|
+
)) : vue.createCommentVNode("v-if", true),
|
|
3906
|
+
(vue.openBlock(true), vue.createElementBlock(
|
|
3907
|
+
vue.Fragment,
|
|
3908
|
+
null,
|
|
3909
|
+
vue.renderList(_ctx.visibleColumns, (column, colindex) => {
|
|
3910
|
+
return vue.openBlock(), vue.createElementBlock(
|
|
3911
|
+
vue.Fragment,
|
|
3912
|
+
{
|
|
3913
|
+
key: column.newKey + ":" + index + ":" + colindex
|
|
3914
|
+
},
|
|
3915
|
+
[
|
|
3916
|
+
column.$slots.default ? (vue.openBlock(), vue.createBlock(_component_b_slot_component, vue.mergeProps({
|
|
3917
|
+
key: 0,
|
|
3918
|
+
component: column
|
|
3919
|
+
}, column.tdAttrs(row, column), {
|
|
3920
|
+
scoped: "",
|
|
3921
|
+
name: "default",
|
|
3922
|
+
tag: "td",
|
|
3923
|
+
class: column.getRootClasses(row),
|
|
3924
|
+
style: column.getRootStyle(row),
|
|
3925
|
+
"data-label": column.label,
|
|
3926
|
+
props: {
|
|
3927
|
+
row,
|
|
3928
|
+
column,
|
|
3929
|
+
index,
|
|
3930
|
+
colindex,
|
|
3931
|
+
toggleDetails: _ctx.toggleDetails,
|
|
3932
|
+
isActiveDetailRow: _ctx.isActiveDetailRow
|
|
3933
|
+
},
|
|
3934
|
+
onClick: ($event) => _ctx.$emit("cellclick", row, column, index, colindex)
|
|
3935
|
+
}), null, 16, ["component", "class", "style", "data-label", "props", "onClick"])) : vue.createCommentVNode("v-if", true)
|
|
3936
|
+
],
|
|
3937
|
+
64
|
|
3938
|
+
/* STABLE_FRAGMENT */
|
|
3939
|
+
);
|
|
3940
|
+
}),
|
|
3941
|
+
128
|
|
3942
|
+
/* KEYED_FRAGMENT */
|
|
3943
|
+
)),
|
|
3944
|
+
_ctx.checkable && _ctx.checkboxPosition === "right" ? (vue.openBlock(), vue.createElementBlock(
|
|
3945
|
+
"td",
|
|
3946
|
+
{
|
|
3947
|
+
key: 2,
|
|
3948
|
+
class: vue.normalizeClass(["checkbox-cell", { "is-sticky": _ctx.stickyCheckbox }])
|
|
3949
|
+
},
|
|
3950
|
+
[
|
|
3951
|
+
vue.createVNode(_component_b_checkbox, {
|
|
3952
|
+
autocomplete: "off",
|
|
3953
|
+
"model-value": _ctx.isRowChecked(row),
|
|
3954
|
+
type: _ctx.checkboxType,
|
|
3955
|
+
disabled: !_ctx.isRowCheckable(row),
|
|
3956
|
+
onClick: vue.withModifiers(($event) => _ctx.checkRow(row, index, $event), ["prevent", "stop"])
|
|
3957
|
+
}, null, 8, ["model-value", "type", "disabled", "onClick"])
|
|
3958
|
+
],
|
|
3959
|
+
2
|
|
3960
|
+
/* CLASS */
|
|
3961
|
+
)) : vue.createCommentVNode("v-if", true)
|
|
3962
|
+
], 42, _hoisted_15),
|
|
3963
|
+
vue.createVNode(vue.Transition, { name: _ctx.detailTransition }, {
|
|
3964
|
+
default: vue.withCtx(() => [
|
|
3965
|
+
_ctx.isActiveDetailRow(row) ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_18, [
|
|
3966
|
+
vue.createElementVNode("td", { colspan: _ctx.columnCount }, [
|
|
3967
|
+
vue.createElementVNode("div", _hoisted_20, [
|
|
3968
|
+
vue.renderSlot(_ctx.$slots, "detail", {
|
|
3969
|
+
row,
|
|
3970
|
+
index
|
|
3971
|
+
})
|
|
3972
|
+
])
|
|
3973
|
+
], 8, _hoisted_19)
|
|
3974
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
3975
|
+
]),
|
|
3976
|
+
_: 2
|
|
3977
|
+
/* DYNAMIC */
|
|
3978
|
+
}, 1032, ["name"]),
|
|
3979
|
+
_ctx.isActiveCustomDetailRow(row) ? vue.renderSlot(_ctx.$slots, "detail", {
|
|
3980
|
+
key: 0,
|
|
3981
|
+
row,
|
|
3982
|
+
index
|
|
3983
|
+
}) : vue.createCommentVNode("v-if", true)
|
|
3984
|
+
],
|
|
3985
|
+
64
|
|
3986
|
+
/* STABLE_FRAGMENT */
|
|
3987
|
+
);
|
|
3988
|
+
}),
|
|
3989
|
+
128
|
|
3990
|
+
/* KEYED_FRAGMENT */
|
|
3991
|
+
)),
|
|
3992
|
+
!_ctx.visibleData.length ? (vue.openBlock(), vue.createElementBlock("tr", _hoisted_21, [
|
|
3993
|
+
vue.createElementVNode("td", { colspan: _ctx.columnCount }, [
|
|
3994
|
+
vue.renderSlot(_ctx.$slots, "empty")
|
|
3995
|
+
], 8, _hoisted_22)
|
|
3996
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
3997
|
+
]),
|
|
3998
|
+
_ctx.$slots.footer !== void 0 ? (vue.openBlock(), vue.createElementBlock("tfoot", _hoisted_23, [
|
|
3999
|
+
vue.createElementVNode("tr", _hoisted_24, [
|
|
4000
|
+
_ctx.hasCustomFooterSlot() ? vue.renderSlot(_ctx.$slots, "footer", { key: 0 }) : (vue.openBlock(), vue.createElementBlock("th", {
|
|
4001
|
+
key: 1,
|
|
4002
|
+
colspan: _ctx.columnCount
|
|
4003
|
+
}, [
|
|
4004
|
+
vue.renderSlot(_ctx.$slots, "footer")
|
|
4005
|
+
], 8, _hoisted_25))
|
|
4006
|
+
])
|
|
4007
|
+
])) : vue.createCommentVNode("v-if", true)
|
|
4008
|
+
], 42, _hoisted_1),
|
|
4009
|
+
_ctx.loading ? vue.renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
|
|
4010
|
+
vue.createVNode(_component_b_loading, {
|
|
4011
|
+
"is-full-page": false,
|
|
4012
|
+
"model-value": _ctx.loading
|
|
4013
|
+
}, null, 8, ["model-value"])
|
|
4014
|
+
]) : vue.createCommentVNode("v-if", true)
|
|
4015
|
+
],
|
|
4016
|
+
6
|
|
4017
|
+
/* CLASS, STYLE */
|
|
4018
|
+
),
|
|
4019
|
+
_ctx.checkable && _ctx.hasBottomLeftSlot() || _ctx.paginated && (_ctx.paginationPosition === "bottom" || _ctx.paginationPosition === "both") ? vue.renderSlot(_ctx.$slots, "pagination", { key: 2 }, () => [
|
|
4020
|
+
vue.createVNode(_component_b_table_pagination, vue.mergeProps(_ctx.fallthroughAttrs, {
|
|
4021
|
+
"per-page": _ctx.perPage,
|
|
4022
|
+
paginated: _ctx.paginated,
|
|
4023
|
+
rounded: _ctx.paginationRounded,
|
|
4024
|
+
"icon-pack": _ctx.iconPack,
|
|
4025
|
+
total: _ctx.newDataTotal,
|
|
4026
|
+
"current-page": _ctx.newCurrentPage,
|
|
4027
|
+
"onUpdate:currentPage": _cache[11] || (_cache[11] = ($event) => _ctx.newCurrentPage = $event),
|
|
4028
|
+
"aria-next-label": _ctx.ariaNextLabel,
|
|
4029
|
+
"aria-previous-label": _ctx.ariaPreviousLabel,
|
|
4030
|
+
"aria-page-label": _ctx.ariaPageLabel,
|
|
4031
|
+
"aria-current-label": _ctx.ariaCurrentLabel,
|
|
4032
|
+
onPageChange: _cache[12] || (_cache[12] = (event) => _ctx.$emit("page-change", event)),
|
|
4033
|
+
"page-input": _ctx.pageInput,
|
|
4034
|
+
"pagination-order": _ctx.paginationOrder,
|
|
4035
|
+
"page-input-position": _ctx.pageInputPosition,
|
|
4036
|
+
"debounce-page-input": _ctx.debouncePageInput
|
|
4037
|
+
}), {
|
|
4038
|
+
default: vue.withCtx(() => [
|
|
4039
|
+
vue.renderSlot(_ctx.$slots, "bottom-left")
|
|
4040
|
+
]),
|
|
4041
|
+
_: 3
|
|
4042
|
+
/* FORWARDED */
|
|
4043
|
+
}, 16, ["per-page", "paginated", "rounded", "icon-pack", "total", "current-page", "aria-next-label", "aria-previous-label", "aria-page-label", "aria-current-label", "page-input", "pagination-order", "page-input-position", "debounce-page-input"])
|
|
4044
|
+
]) : vue.createCommentVNode("v-if", true),
|
|
4045
|
+
vue.createCommentVNode(" eslint-disable vue/no-v-html "),
|
|
4046
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
4047
|
+
ref: "draggedCell",
|
|
4048
|
+
class: vue.normalizeClass(["touch-dragged-cell", _ctx.touchDraggedCellClasses]),
|
|
4049
|
+
innerHTML: _ctx.draggedCellContent
|
|
4050
|
+
}, null, 10, _hoisted_26), [
|
|
4051
|
+
[vue.vShow, _ctx.mayBeTouchDragging && (_ctx.isDraggingRow || _ctx.isDraggingColumn)]
|
|
4052
|
+
]),
|
|
4053
|
+
vue.createCommentVNode(" eslint-enable vue/no-v-html ")
|
|
4054
|
+
],
|
|
4055
|
+
16
|
|
4056
|
+
/* FULL_PROPS */
|
|
4057
|
+
);
|
|
4058
|
+
}
|
|
4059
|
+
var Table = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["render", _sfc_render]]);
|
|
4060
|
+
|
|
4061
|
+
var _sfc_main = vue.defineComponent({
|
|
4062
|
+
name: "BTableColumn",
|
|
4063
|
+
inject: {
|
|
4064
|
+
$table: { name: "$table", default: false }
|
|
4065
|
+
},
|
|
4066
|
+
props: {
|
|
4067
|
+
label: String,
|
|
4068
|
+
customKey: [String, Number],
|
|
4069
|
+
field: String,
|
|
4070
|
+
meta: [String, Number, Boolean, Function, Object, Array],
|
|
4071
|
+
width: [Number, String],
|
|
4072
|
+
numeric: Boolean,
|
|
4073
|
+
centered: Boolean,
|
|
4074
|
+
searchable: Boolean,
|
|
4075
|
+
sortable: Boolean,
|
|
4076
|
+
visible: {
|
|
4077
|
+
type: Boolean,
|
|
4078
|
+
default: true
|
|
4079
|
+
},
|
|
4080
|
+
subheading: [String, Number],
|
|
4081
|
+
customSort: Function,
|
|
4082
|
+
customSearch: Function,
|
|
4083
|
+
sticky: Boolean,
|
|
4084
|
+
headerSelectable: Boolean,
|
|
4085
|
+
headerClass: String,
|
|
4086
|
+
cellClass: String,
|
|
4087
|
+
thAttrs: {
|
|
4088
|
+
type: Function,
|
|
4089
|
+
default: () => ({})
|
|
4090
|
+
},
|
|
4091
|
+
tdAttrs: {
|
|
4092
|
+
type: Function,
|
|
4093
|
+
default: () => ({})
|
|
4094
|
+
}
|
|
4095
|
+
},
|
|
4096
|
+
data() {
|
|
4097
|
+
return {
|
|
4098
|
+
newKey: this.customKey || this.label,
|
|
4099
|
+
_isTableColumn: true
|
|
4100
|
+
};
|
|
4101
|
+
},
|
|
4102
|
+
computed: {
|
|
4103
|
+
thClasses() {
|
|
4104
|
+
const attrs = this.thAttrs(this);
|
|
4105
|
+
const classes = [this.headerClass, {
|
|
4106
|
+
"is-sortable": this.sortable,
|
|
4107
|
+
"is-sticky": this.sticky,
|
|
4108
|
+
"is-unselectable": this.isHeaderUnSelectable
|
|
4109
|
+
}];
|
|
4110
|
+
if (attrs && attrs.class) {
|
|
4111
|
+
classes.push(attrs.class);
|
|
4112
|
+
}
|
|
4113
|
+
return classes;
|
|
4114
|
+
},
|
|
4115
|
+
thStyle() {
|
|
4116
|
+
const attrs = this.thAttrs(this);
|
|
4117
|
+
const style = [this.style];
|
|
4118
|
+
if (attrs && attrs.style) {
|
|
4119
|
+
style.push(attrs.style);
|
|
4120
|
+
}
|
|
4121
|
+
return style;
|
|
4122
|
+
},
|
|
4123
|
+
thWrapStyle() {
|
|
4124
|
+
const width = toCssWidth(this.width);
|
|
4125
|
+
if (width != null && !width.trim().endsWith("%")) {
|
|
4126
|
+
return { width };
|
|
4127
|
+
} else {
|
|
4128
|
+
return {};
|
|
4129
|
+
}
|
|
4130
|
+
},
|
|
4131
|
+
rootClasses() {
|
|
4132
|
+
return [this.cellClass, {
|
|
4133
|
+
"has-text-right": this.numeric && !this.centered,
|
|
4134
|
+
"has-text-centered": this.centered,
|
|
4135
|
+
"is-sticky": this.sticky
|
|
4136
|
+
}];
|
|
4137
|
+
},
|
|
4138
|
+
style() {
|
|
4139
|
+
var _a;
|
|
4140
|
+
return {
|
|
4141
|
+
width: (_a = toCssWidth(this.width)) != null ? _a : void 0
|
|
4142
|
+
// null → undefined to satisfy StyleValue
|
|
4143
|
+
};
|
|
4144
|
+
},
|
|
4145
|
+
hasDefaultSlot() {
|
|
4146
|
+
return !!this.$slots.default;
|
|
4147
|
+
},
|
|
4148
|
+
/*
|
|
4149
|
+
* Return if column header is un-selectable
|
|
4150
|
+
*/
|
|
4151
|
+
isHeaderUnSelectable() {
|
|
4152
|
+
return !this.headerSelectable && this.sortable;
|
|
4153
|
+
}
|
|
4154
|
+
},
|
|
4155
|
+
methods: {
|
|
4156
|
+
getRootClasses(row) {
|
|
4157
|
+
const attrs = this.tdAttrs(row, this);
|
|
4158
|
+
const classes = [this.rootClasses];
|
|
4159
|
+
if (attrs && attrs.class) {
|
|
4160
|
+
classes.push(attrs.class);
|
|
4161
|
+
}
|
|
4162
|
+
return classes;
|
|
4163
|
+
},
|
|
4164
|
+
getRootStyle(row) {
|
|
4165
|
+
const attrs = this.tdAttrs(row, this);
|
|
4166
|
+
const style = [];
|
|
4167
|
+
if (attrs && attrs.style) {
|
|
4168
|
+
style.push(attrs.style);
|
|
4169
|
+
}
|
|
4170
|
+
return style;
|
|
4171
|
+
}
|
|
4172
|
+
},
|
|
4173
|
+
created() {
|
|
4174
|
+
if (!this.$table) {
|
|
4175
|
+
throw new Error("You should wrap bTableColumn on a bTable");
|
|
4176
|
+
}
|
|
4177
|
+
this.$table._registerTableColumn(this);
|
|
4178
|
+
},
|
|
4179
|
+
beforeUnmount() {
|
|
4180
|
+
this.$table._unregisterTableColumn(this);
|
|
4181
|
+
},
|
|
4182
|
+
render() {
|
|
4183
|
+
return null;
|
|
4184
|
+
}
|
|
4185
|
+
});
|
|
4186
|
+
|
|
4187
|
+
const registerComponent = (Vue, component, name) => {
|
|
4188
|
+
const componentName = component.name;
|
|
4189
|
+
if (componentName == null) {
|
|
4190
|
+
throw new Error("Buefy.registerComponent: missing component name");
|
|
4191
|
+
}
|
|
4192
|
+
Vue.component(componentName, component);
|
|
4193
|
+
};
|
|
4194
|
+
|
|
4195
|
+
const Plugin = {
|
|
4196
|
+
install(Vue) {
|
|
4197
|
+
registerComponent(Vue, Table);
|
|
4198
|
+
registerComponent(Vue, _sfc_main);
|
|
4199
|
+
}
|
|
4200
|
+
};
|
|
4201
|
+
|
|
4202
|
+
exports.BTable = Table;
|
|
4203
|
+
exports.BTableColumn = _sfc_main;
|
|
4204
|
+
exports.default = Plugin;
|
|
4205
|
+
|
|
4206
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4207
|
+
|
|
4208
|
+
}));
|