monobill-mintui 0.6.612 → 0.6.613
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/README.md +76 -302
- package/bin/component-dependencies.json +131 -0
- package/bin/mint-ui.js +446 -0
- package/dist/alert.css +3 -0
- package/dist/back-button.css +3 -0
- package/dist/bottom-navigation.css +3 -0
- package/dist/button.css +3 -0
- package/dist/card.css +3 -0
- package/dist/chart.css +3 -0
- package/dist/checkbox.css +3 -0
- package/dist/chip.css +3 -0
- package/dist/choice.css +3 -0
- package/dist/clickable.css +3 -0
- package/dist/collapsible.css +3 -0
- package/dist/components/alert/Alert.d.ts +1 -32
- package/dist/components/alert/Alert.d.ts.map +10 -1
- package/dist/components/alert/browser.js +167 -0
- package/dist/components/alert/index.cjs +1 -0
- package/dist/components/alert/index.d.ts +1 -3
- package/dist/components/alert/index.d.ts.map +10 -1
- package/dist/components/alert/index.js +155 -0
- package/dist/components/back-button/BackButton.d.ts +1 -18
- package/dist/components/back-button/BackButton.d.ts.map +10 -1
- package/dist/components/back-button/browser.js +241 -0
- package/dist/components/back-button/index.cjs +1 -0
- package/dist/components/back-button/index.d.ts +1 -3
- package/dist/components/back-button/index.d.ts.map +10 -1
- package/dist/components/back-button/index.js +229 -0
- package/dist/components/bottom-navigation/BottomNavigation.d.ts +1 -10
- package/dist/components/bottom-navigation/BottomNavigation.d.ts.map +10 -1
- package/dist/components/bottom-navigation/browser.js +97 -0
- package/dist/components/bottom-navigation/index.cjs +1 -0
- package/dist/components/bottom-navigation/index.d.ts +2 -5
- package/dist/components/bottom-navigation/index.d.ts.map +10 -1
- package/dist/components/bottom-navigation/index.js +85 -0
- package/dist/components/button/Button.d.ts +1 -57
- package/dist/components/button/Button.d.ts.map +10 -1
- package/dist/components/button/browser.js +18 -0
- package/dist/components/button/index.cjs +1 -0
- package/dist/components/button/index.d.ts +1 -3
- package/dist/components/button/index.d.ts.map +10 -1
- package/dist/components/button/index.js +6 -0
- package/dist/components/card/Card.d.ts +1 -17
- package/dist/components/card/Card.d.ts.map +10 -1
- package/dist/components/card/browser.js +25 -0
- package/dist/components/card/index.cjs +1 -0
- package/dist/components/card/index.d.ts +1 -3
- package/dist/components/card/index.d.ts.map +10 -1
- package/dist/components/card/index.js +13 -0
- package/dist/components/chart/Chart.d.ts +1 -291
- package/dist/components/chart/Chart.d.ts.map +10 -1
- package/dist/components/chart/browser.js +1331 -0
- package/dist/components/chart/index.cjs +37 -0
- package/dist/components/chart/index.d.ts +1 -3
- package/dist/components/chart/index.d.ts.map +10 -1
- package/dist/components/chart/index.js +1319 -0
- package/dist/components/checkbox/Checkbox.d.ts +1 -41
- package/dist/components/checkbox/Checkbox.d.ts.map +10 -1
- package/dist/components/checkbox/browser.js +162 -0
- package/dist/components/checkbox/index.cjs +1 -0
- package/dist/components/checkbox/index.d.ts +1 -3
- package/dist/components/checkbox/index.d.ts.map +10 -1
- package/dist/components/checkbox/index.js +150 -0
- package/dist/components/chip/Chip.d.ts +1 -16
- package/dist/components/chip/Chip.d.ts.map +10 -1
- package/dist/components/chip/browser.js +17 -0
- package/dist/components/chip/index.cjs +1 -0
- package/dist/components/chip/index.d.ts +1 -3
- package/dist/components/chip/index.d.ts.map +10 -1
- package/dist/components/chip/index.js +5 -0
- package/dist/components/choice/Choice.d.ts +1 -27
- package/dist/components/choice/Choice.d.ts.map +10 -1
- package/dist/components/choice/browser.js +272 -0
- package/dist/components/choice/index.cjs +1 -0
- package/dist/components/choice/index.d.ts +1 -5
- package/dist/components/choice/index.d.ts.map +10 -1
- package/dist/components/choice/index.js +260 -0
- package/dist/components/chunks/button-B0Yt0MX1.js +380 -0
- package/dist/components/chunks/button-BlbLHMts.js +1 -0
- package/dist/components/chunks/caret-down-BN9cl4o4.js +1 -0
- package/dist/components/chunks/caret-down-Ch6IfR7r.js +9 -0
- package/dist/components/chunks/caret-right-CDUwqoen.js +1 -0
- package/dist/components/chunks/caret-right-CVOgr4nk.js +9 -0
- package/dist/components/chunks/caret-up-3XCuTXSE.js +1 -0
- package/dist/components/chunks/caret-up-D_6oa7o1.js +9 -0
- package/dist/components/chunks/chip-B04bJM4r.js +1 -0
- package/dist/components/chunks/chip-B9whjEvW.js +54 -0
- package/dist/components/chunks/close-5tYlQdkk.js +1 -0
- package/dist/components/chunks/close-Dg6U0IjZ.js +10 -0
- package/dist/components/chunks/icon-C0OLmjDY.js +1 -0
- package/dist/components/chunks/icon-CyzR9aVl.js +1 -0
- package/dist/components/chunks/icon-dG8sLTBn.js +27 -0
- package/dist/components/chunks/icon-gQAtsERy.js +1324 -0
- package/dist/components/chunks/input-8bbXzpa5.js +334 -0
- package/dist/components/chunks/input-BoiREc6Y.js +1 -0
- package/dist/components/chunks/link-BxhPnVaz.js +1 -0
- package/dist/components/chunks/link-DKgtBYK6.js +38 -0
- package/dist/components/chunks/modal-B8gNdwEl.js +153 -0
- package/dist/components/chunks/modal-WYWvk2lZ.js +1 -0
- package/dist/components/chunks/popover-BeaGf_JC.js +1 -0
- package/dist/components/chunks/popover-gviDCspV.js +188 -0
- package/dist/components/chunks/register-element-BFYmIynH.js +53 -0
- package/dist/components/chunks/register-element-tCL_F1YI.js +1 -0
- package/dist/components/chunks/search-ANUKQi0r.js +9 -0
- package/dist/components/chunks/search-B3egXuw4.js +1 -0
- package/dist/components/chunks/spinner-BsaFHuS6.js +108 -0
- package/dist/components/chunks/spinner-DbTohC6i.js +63 -0
- package/dist/components/chunks/stack-D1uh4L79.js +1 -0
- package/dist/components/chunks/stack-DyQfjPDh.js +53 -0
- package/dist/components/chunks/table-BgboosRK.js +65 -0
- package/dist/components/chunks/table-DDUNUwGd.js +1 -0
- package/dist/components/chunks/text-BHkEs8U5.js +67 -0
- package/dist/components/chunks/text-BmHZbBMo.js +1 -0
- package/dist/components/clickable/Clickable.d.ts +1 -14
- package/dist/components/clickable/Clickable.d.ts.map +10 -1
- package/dist/components/clickable/browser.js +78 -0
- package/dist/components/clickable/index.cjs +1 -0
- package/dist/components/clickable/index.d.ts +1 -3
- package/dist/components/clickable/index.d.ts.map +10 -1
- package/dist/components/clickable/index.js +66 -0
- package/dist/components/collapsible/Collapsible.d.ts +1 -28
- package/dist/components/collapsible/Collapsible.d.ts.map +10 -1
- package/dist/components/collapsible/browser.js +170 -0
- package/dist/components/collapsible/index.cjs +1 -0
- package/dist/components/collapsible/index.d.ts +1 -3
- package/dist/components/collapsible/index.d.ts.map +10 -1
- package/dist/components/collapsible/index.js +158 -0
- package/dist/components/confirm-action/ConfirmAction.d.ts +1 -27
- package/dist/components/confirm-action/ConfirmAction.d.ts.map +10 -1
- package/dist/components/confirm-action/browser.js +130 -0
- package/dist/components/confirm-action/index.cjs +1 -0
- package/dist/components/confirm-action/index.d.ts +2 -3
- package/dist/components/confirm-action/index.d.ts.map +10 -1
- package/dist/components/confirm-action/index.js +118 -0
- package/dist/components/date-picker/DatePicker.d.ts +1 -130
- package/dist/components/date-picker/DatePicker.d.ts.map +10 -1
- package/dist/components/date-picker/browser.js +1288 -0
- package/dist/components/date-picker/index.cjs +1 -0
- package/dist/components/date-picker/index.d.ts +1 -3
- package/dist/components/date-picker/index.d.ts.map +10 -1
- package/dist/components/date-picker/index.js +1276 -0
- package/dist/components/dropzone/Dropzone.d.ts +1 -59
- package/dist/components/dropzone/Dropzone.d.ts.map +10 -1
- package/dist/components/dropzone/browser.js +355 -0
- package/dist/components/dropzone/index.cjs +1 -0
- package/dist/components/dropzone/index.d.ts +1 -3
- package/dist/components/dropzone/index.d.ts.map +10 -1
- package/dist/components/dropzone/index.js +343 -0
- package/dist/components/form/Form.d.ts +1 -133
- package/dist/components/form/Form.d.ts.map +10 -1
- package/dist/components/form/browser.js +1002 -0
- package/dist/components/form/index.cjs +1 -0
- package/dist/components/form/index.d.ts +1 -3
- package/dist/components/form/index.d.ts.map +10 -1
- package/dist/components/form/index.js +990 -0
- package/dist/components/grid/Grid.d.ts +1 -16
- package/dist/components/grid/Grid.d.ts.map +10 -1
- package/dist/components/grid/browser.js +24 -0
- package/dist/components/grid/index.cjs +1 -0
- package/dist/components/grid/index.d.ts +1 -3
- package/dist/components/grid/index.d.ts.map +10 -1
- package/dist/components/grid/index.js +12 -0
- package/dist/components/icon/Icon.d.ts +1 -16
- package/dist/components/icon/Icon.d.ts.map +10 -1
- package/dist/components/icon/browser.js +16 -0
- package/dist/components/icon/index.cjs +1 -0
- package/dist/components/icon/index.d.ts +2 -3
- package/dist/components/icon/index.d.ts.map +10 -1
- package/dist/components/icon/index.js +4 -0
- package/dist/components/input/Input.d.ts +1 -68
- package/dist/components/input/Input.d.ts.map +10 -1
- package/dist/components/input/browser.js +17 -0
- package/dist/components/input/index.cjs +1 -0
- package/dist/components/input/index.d.ts +1 -3
- package/dist/components/input/index.d.ts.map +10 -1
- package/dist/components/input/index.js +5 -0
- package/dist/components/link/Link.d.ts +1 -16
- package/dist/components/link/Link.d.ts.map +10 -1
- package/dist/components/link/browser.js +16 -0
- package/dist/components/link/index.cjs +1 -0
- package/dist/components/link/index.d.ts +1 -3
- package/dist/components/link/index.d.ts.map +10 -1
- package/dist/components/link/index.js +4 -0
- package/dist/components/modal/Modal.d.ts +1 -38
- package/dist/components/modal/Modal.d.ts.map +10 -1
- package/dist/components/modal/browser.js +21 -0
- package/dist/components/modal/index.cjs +1 -0
- package/dist/components/modal/index.d.ts +1 -3
- package/dist/components/modal/index.d.ts.map +10 -1
- package/dist/components/modal/index.js +9 -0
- package/dist/components/navigation/Navigation.d.ts +1 -0
- package/dist/components/navigation/Navigation.d.ts.map +10 -0
- package/dist/components/navigation/browser.js +198 -0
- package/dist/components/navigation/index.cjs +1 -0
- package/dist/components/navigation/index.d.ts +1 -0
- package/dist/components/navigation/index.d.ts.map +10 -0
- package/dist/components/navigation/index.js +186 -0
- package/dist/components/off-canvas/OffCanvas.d.ts +1 -46
- package/dist/components/off-canvas/OffCanvas.d.ts.map +10 -1
- package/dist/components/off-canvas/browser.js +192 -0
- package/dist/components/off-canvas/index.cjs +1 -0
- package/dist/components/off-canvas/index.d.ts +1 -3
- package/dist/components/off-canvas/index.d.ts.map +10 -1
- package/dist/components/off-canvas/index.js +180 -0
- package/dist/components/page/Page.d.ts +1 -37
- package/dist/components/page/Page.d.ts.map +10 -1
- package/dist/components/page/browser.js +74 -0
- package/dist/components/page/index.cjs +16 -0
- package/dist/components/page/index.d.ts +1 -3
- package/dist/components/page/index.d.ts.map +10 -1
- package/dist/components/page/index.js +62 -0
- package/dist/components/popover/Popover.d.ts +1 -64
- package/dist/components/popover/Popover.d.ts.map +10 -1
- package/dist/components/popover/browser.js +17 -0
- package/dist/components/popover/index.cjs +1 -0
- package/dist/components/popover/index.d.ts +1 -3
- package/dist/components/popover/index.d.ts.map +10 -1
- package/dist/components/popover/index.js +5 -0
- package/dist/components/resource-table/ResourceTable.d.ts +1 -327
- package/dist/components/resource-table/ResourceTable.d.ts.map +10 -1
- package/dist/components/resource-table/browser.js +1457 -0
- package/dist/components/resource-table/index.cjs +2 -0
- package/dist/components/resource-table/index.d.ts +1 -4
- package/dist/components/resource-table/index.d.ts.map +10 -1
- package/dist/components/resource-table/index.js +1445 -0
- package/dist/components/search/Search.d.ts +1 -151
- package/dist/components/search/Search.d.ts.map +10 -1
- package/dist/components/search/browser.js +681 -0
- package/dist/components/search/index.cjs +1 -0
- package/dist/components/search/index.d.ts +1 -3
- package/dist/components/search/index.d.ts.map +10 -1
- package/dist/components/search/index.js +669 -0
- package/dist/components/select/Select.d.ts +1 -37
- package/dist/components/select/Select.d.ts.map +10 -1
- package/dist/components/select/browser.js +285 -0
- package/dist/components/select/index.cjs +1 -0
- package/dist/components/select/index.d.ts +1 -3
- package/dist/components/select/index.d.ts.map +10 -1
- package/dist/components/select/index.js +273 -0
- package/dist/components/side-navigation/SideNavigation.d.ts +1 -52
- package/dist/components/side-navigation/SideNavigation.d.ts.map +10 -1
- package/dist/components/side-navigation/browser.js +466 -0
- package/dist/components/side-navigation/index.cjs +1 -0
- package/dist/components/side-navigation/index.d.ts +5 -8
- package/dist/components/side-navigation/index.d.ts.map +10 -1
- package/dist/components/side-navigation/index.js +454 -0
- package/dist/components/sortable/Sortable.d.ts +1 -62
- package/dist/components/sortable/Sortable.d.ts.map +10 -1
- package/dist/components/sortable/browser.js +340 -0
- package/dist/components/sortable/index.cjs +1 -0
- package/dist/components/sortable/index.d.ts +1 -3
- package/dist/components/sortable/index.d.ts.map +10 -1
- package/dist/components/sortable/index.js +328 -0
- package/dist/components/spinner/Spinner.d.ts +1 -13
- package/dist/components/spinner/Spinner.d.ts.map +10 -1
- package/dist/components/spinner/browser.js +16 -0
- package/dist/components/spinner/index.cjs +1 -0
- package/dist/components/spinner/index.d.ts +1 -3
- package/dist/components/spinner/index.d.ts.map +10 -1
- package/dist/components/spinner/index.js +4 -0
- package/dist/components/stack/Stack.d.ts +1 -23
- package/dist/components/stack/Stack.d.ts.map +10 -1
- package/dist/components/stack/browser.js +16 -0
- package/dist/components/stack/index.cjs +1 -0
- package/dist/components/stack/index.d.ts +1 -3
- package/dist/components/stack/index.d.ts.map +10 -1
- package/dist/components/stack/index.js +4 -0
- package/dist/components/switch/Switch.d.ts +1 -33
- package/dist/components/switch/Switch.d.ts.map +10 -1
- package/dist/components/switch/browser.js +203 -0
- package/dist/components/switch/index.cjs +1 -0
- package/dist/components/switch/index.d.ts +1 -3
- package/dist/components/switch/index.d.ts.map +10 -1
- package/dist/components/switch/index.js +191 -0
- package/dist/components/table/Table.d.ts +1 -11
- package/dist/components/table/Table.d.ts.map +10 -1
- package/dist/components/table/browser.js +16 -0
- package/dist/components/table/index.cjs +1 -0
- package/dist/components/table/index.d.ts +1 -3
- package/dist/components/table/index.d.ts.map +10 -1
- package/dist/components/table/index.js +4 -0
- package/dist/components/tabs/Tabs.d.ts +1 -20
- package/dist/components/tabs/Tabs.d.ts.map +10 -1
- package/dist/components/tabs/browser.js +251 -0
- package/dist/components/tabs/index.cjs +1 -0
- package/dist/components/tabs/index.d.ts +4 -9
- package/dist/components/tabs/index.d.ts.map +10 -1
- package/dist/components/tabs/index.js +239 -0
- package/dist/components/tags/Tags.d.ts +1 -82
- package/dist/components/tags/Tags.d.ts.map +10 -1
- package/dist/components/tags/browser.js +416 -0
- package/dist/components/tags/index.cjs +1 -0
- package/dist/components/tags/index.d.ts +1 -3
- package/dist/components/tags/index.d.ts.map +10 -1
- package/dist/components/tags/index.js +404 -0
- package/dist/components/text/Text.d.ts +1 -25
- package/dist/components/text/Text.d.ts.map +10 -1
- package/dist/components/text/browser.js +16 -0
- package/dist/components/text/index.cjs +1 -0
- package/dist/components/text/index.d.ts +1 -3
- package/dist/components/text/index.d.ts.map +10 -1
- package/dist/components/text/index.js +4 -0
- package/dist/components/time-picker/TimePicker.d.ts +1 -61
- package/dist/components/time-picker/TimePicker.d.ts.map +10 -1
- package/dist/components/time-picker/browser.js +366 -0
- package/dist/components/time-picker/index.cjs +1 -0
- package/dist/components/time-picker/index.d.ts +1 -3
- package/dist/components/time-picker/index.d.ts.map +10 -1
- package/dist/components/time-picker/index.js +354 -0
- package/dist/components/toast/Toast.d.ts +1 -21
- package/dist/components/toast/Toast.d.ts.map +10 -1
- package/dist/components/toast/browser.js +147 -0
- package/dist/components/toast/index.cjs +3 -0
- package/dist/components/toast/index.d.ts +3 -3
- package/dist/components/toast/index.d.ts.map +10 -1
- package/dist/components/toast/index.js +135 -0
- package/dist/confirm-action.css +3 -0
- package/dist/date-picker.css +3 -0
- package/dist/dropzone.css +3 -0
- package/dist/form.css +3 -0
- package/dist/grid.css +3 -0
- package/dist/icon.css +3 -0
- package/dist/icons/ai.svg +5 -6
- package/dist/icons/bank.svg +1 -1
- package/dist/icons/barcode.svg +1 -1
- package/dist/icons/basket.svg +1 -1
- package/dist/icons/building.svg +1 -1
- package/dist/icons/buildings.svg +1 -1
- package/dist/icons/calendar.svg +1 -1
- package/dist/icons/cash.svg +3 -0
- package/dist/icons/check.svg +1 -1
- package/dist/icons/close.svg +1 -1
- package/dist/icons/coupon.svg +3 -0
- package/dist/icons/delivery-location.svg +3 -0
- package/dist/icons/desktop.svg +3 -0
- package/dist/icons/dollar-sign.svg +1 -1
- package/dist/icons/edit.svg +1 -1
- package/dist/icons/gift.svg +3 -0
- package/dist/icons/grip-lines.svg +2 -2
- package/dist/icons/heart.svg +3 -0
- package/dist/icons/installments.svg +3 -0
- package/dist/icons/inventory.svg +3 -0
- package/dist/icons/invoice.svg +3 -0
- package/dist/icons/loyalty-points.svg +3 -0
- package/dist/icons/membership.svg +3 -0
- package/dist/icons/mobile.svg +3 -0
- package/dist/icons/order-tracking.svg +7 -0
- package/dist/icons/out-of-stock.svg +3 -0
- package/dist/icons/package.svg +3 -0
- package/dist/icons/percent-discount.svg +3 -0
- package/dist/icons/pickup.svg +3 -0
- package/dist/icons/plus.svg +1 -1
- package/dist/icons/price-label.svg +3 -0
- package/dist/icons/product-review.svg +3 -0
- package/dist/icons/receipt.svg +3 -0
- package/dist/icons/refund.svg +3 -0
- package/dist/icons/remove.svg +1 -1
- package/dist/icons/return.svg +3 -0
- package/dist/icons/sale-burst.svg +3 -0
- package/dist/icons/secure-checkout.svg +3 -0
- package/dist/icons/shopping-bag.svg +3 -0
- package/dist/icons/shopping-cart.svg +3 -0
- package/dist/icons/storefront.svg +3 -0
- package/dist/icons/support.svg +3 -0
- package/dist/icons/tablet.svg +3 -0
- package/dist/icons/wallet.svg +3 -0
- package/dist/icons/warehouse.svg +3 -0
- package/dist/index.cjs +83 -79
- package/dist/index.css +253 -0
- package/dist/index.d.ts +94 -91
- package/dist/index.d.ts.map +10 -1
- package/dist/index.js +10695 -10239
- package/dist/input.css +3 -0
- package/dist/link.css +3 -0
- package/dist/mintui-elements.d.ts +156 -0
- package/dist/mintui-elements.d.ts.map +10 -0
- package/dist/modal.css +3 -0
- package/dist/navigation.css +3 -0
- package/dist/off-canvas.css +3 -0
- package/dist/page.css +3 -0
- package/dist/popover.css +3 -0
- package/dist/resource-table.css +3 -0
- package/dist/search.css +3 -0
- package/dist/select.css +3 -0
- package/dist/side-navigation.css +3 -0
- package/dist/sortable.css +3 -0
- package/dist/spinner.css +3 -0
- package/dist/stack.css +3 -0
- package/dist/switch.css +3 -0
- package/dist/table.css +3 -0
- package/dist/tabs.css +3 -0
- package/dist/tags.css +3 -0
- package/dist/text.css +3 -0
- package/dist/theme.css +101 -0
- package/dist/time-picker.css +3 -0
- package/dist/toast.css +3 -0
- package/package.json +379 -30
- package/dist/components/bottom-navigation/BottomNavItem.d.ts +0 -14
- package/dist/components/bottom-navigation/BottomNavItem.d.ts.map +0 -1
- package/dist/components/choice/ChoiceOption.d.ts +0 -30
- package/dist/components/choice/ChoiceOption.d.ts.map +0 -1
- package/dist/components/confirm-action/ConfirmActionApi.d.ts +0 -17
- package/dist/components/confirm-action/ConfirmActionApi.d.ts.map +0 -1
- package/dist/components/icon/build-icons.d.ts +0 -2
- package/dist/components/icon/build-icons.d.ts.map +0 -1
- package/dist/components/icon/icons/ai.d.ts +0 -3
- package/dist/components/icon/icons/ai.d.ts.map +0 -1
- package/dist/components/icon/icons/archive.d.ts +0 -3
- package/dist/components/icon/icons/archive.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-down.d.ts +0 -3
- package/dist/components/icon/icons/arrow-down.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-left.d.ts +0 -3
- package/dist/components/icon/icons/arrow-left.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-right.d.ts +0 -3
- package/dist/components/icon/icons/arrow-right.d.ts.map +0 -1
- package/dist/components/icon/icons/arrow-up.d.ts +0 -3
- package/dist/components/icon/icons/arrow-up.d.ts.map +0 -1
- package/dist/components/icon/icons/attach.d.ts +0 -3
- package/dist/components/icon/icons/attach.d.ts.map +0 -1
- package/dist/components/icon/icons/bank.d.ts +0 -3
- package/dist/components/icon/icons/bank.d.ts.map +0 -1
- package/dist/components/icon/icons/barcode.d.ts +0 -3
- package/dist/components/icon/icons/barcode.d.ts.map +0 -1
- package/dist/components/icon/icons/basket.d.ts +0 -3
- package/dist/components/icon/icons/basket.d.ts.map +0 -1
- package/dist/components/icon/icons/bookmark.d.ts +0 -3
- package/dist/components/icon/icons/bookmark.d.ts.map +0 -1
- package/dist/components/icon/icons/building.d.ts +0 -3
- package/dist/components/icon/icons/building.d.ts.map +0 -1
- package/dist/components/icon/icons/buildings.d.ts +0 -3
- package/dist/components/icon/icons/buildings.d.ts.map +0 -1
- package/dist/components/icon/icons/bullhorn.d.ts +0 -3
- package/dist/components/icon/icons/bullhorn.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-day.d.ts +0 -3
- package/dist/components/icon/icons/calendar-day.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-empty.d.ts +0 -3
- package/dist/components/icon/icons/calendar-empty.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar-week.d.ts +0 -3
- package/dist/components/icon/icons/calendar-week.d.ts.map +0 -1
- package/dist/components/icon/icons/calendar.d.ts +0 -3
- package/dist/components/icon/icons/calendar.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-down.d.ts +0 -3
- package/dist/components/icon/icons/caret-down.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-left.d.ts +0 -3
- package/dist/components/icon/icons/caret-left.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-right.d.ts +0 -3
- package/dist/components/icon/icons/caret-right.d.ts.map +0 -1
- package/dist/components/icon/icons/caret-up.d.ts +0 -3
- package/dist/components/icon/icons/caret-up.d.ts.map +0 -1
- package/dist/components/icon/icons/chart-bar.d.ts +0 -3
- package/dist/components/icon/icons/chart-bar.d.ts.map +0 -1
- package/dist/components/icon/icons/chart-line.d.ts +0 -3
- package/dist/components/icon/icons/chart-line.d.ts.map +0 -1
- package/dist/components/icon/icons/chat.d.ts +0 -3
- package/dist/components/icon/icons/chat.d.ts.map +0 -1
- package/dist/components/icon/icons/check.d.ts +0 -3
- package/dist/components/icon/icons/check.d.ts.map +0 -1
- package/dist/components/icon/icons/clock.d.ts +0 -3
- package/dist/components/icon/icons/clock.d.ts.map +0 -1
- package/dist/components/icon/icons/close.d.ts +0 -3
- package/dist/components/icon/icons/close.d.ts.map +0 -1
- package/dist/components/icon/icons/copy.d.ts +0 -3
- package/dist/components/icon/icons/copy.d.ts.map +0 -1
- package/dist/components/icon/icons/credit-card.d.ts +0 -3
- package/dist/components/icon/icons/credit-card.d.ts.map +0 -1
- package/dist/components/icon/icons/delete.d.ts +0 -3
- package/dist/components/icon/icons/delete.d.ts.map +0 -1
- package/dist/components/icon/icons/desktop-screen.d.ts +0 -3
- package/dist/components/icon/icons/desktop-screen.d.ts.map +0 -1
- package/dist/components/icon/icons/documentation.d.ts +0 -3
- package/dist/components/icon/icons/documentation.d.ts.map +0 -1
- package/dist/components/icon/icons/dollar-sign.d.ts +0 -3
- package/dist/components/icon/icons/dollar-sign.d.ts.map +0 -1
- package/dist/components/icon/icons/download.d.ts +0 -3
- package/dist/components/icon/icons/download.d.ts.map +0 -1
- package/dist/components/icon/icons/duplicate.d.ts +0 -3
- package/dist/components/icon/icons/duplicate.d.ts.map +0 -1
- package/dist/components/icon/icons/edit.d.ts +0 -3
- package/dist/components/icon/icons/edit.d.ts.map +0 -1
- package/dist/components/icon/icons/ellipsis.d.ts +0 -3
- package/dist/components/icon/icons/ellipsis.d.ts.map +0 -1
- package/dist/components/icon/icons/error.d.ts +0 -3
- package/dist/components/icon/icons/error.d.ts.map +0 -1
- package/dist/components/icon/icons/external-link.d.ts +0 -3
- package/dist/components/icon/icons/external-link.d.ts.map +0 -1
- package/dist/components/icon/icons/eye.d.ts +0 -3
- package/dist/components/icon/icons/eye.d.ts.map +0 -1
- package/dist/components/icon/icons/file.d.ts +0 -3
- package/dist/components/icon/icons/file.d.ts.map +0 -1
- package/dist/components/icon/icons/filter.d.ts +0 -3
- package/dist/components/icon/icons/filter.d.ts.map +0 -1
- package/dist/components/icon/icons/folder.d.ts +0 -3
- package/dist/components/icon/icons/folder.d.ts.map +0 -1
- package/dist/components/icon/icons/gavel.d.ts +0 -3
- package/dist/components/icon/icons/gavel.d.ts.map +0 -1
- package/dist/components/icon/icons/globe.d.ts +0 -3
- package/dist/components/icon/icons/globe.d.ts.map +0 -1
- package/dist/components/icon/icons/grid.d.ts +0 -3
- package/dist/components/icon/icons/grid.d.ts.map +0 -1
- package/dist/components/icon/icons/grip-lines.d.ts +0 -3
- package/dist/components/icon/icons/grip-lines.d.ts.map +0 -1
- package/dist/components/icon/icons/help.d.ts +0 -3
- package/dist/components/icon/icons/help.d.ts.map +0 -1
- package/dist/components/icon/icons/home.d.ts +0 -3
- package/dist/components/icon/icons/home.d.ts.map +0 -1
- package/dist/components/icon/icons/image.d.ts +0 -3
- package/dist/components/icon/icons/image.d.ts.map +0 -1
- package/dist/components/icon/icons/index.cjs +0 -34
- package/dist/components/icon/icons/index.d.ts +0 -92
- package/dist/components/icon/icons/index.d.ts.map +0 -1
- package/dist/components/icon/icons/index.js +0 -752
- package/dist/components/icon/icons/info.d.ts +0 -3
- package/dist/components/icon/icons/info.d.ts.map +0 -1
- package/dist/components/icon/icons/language.d.ts +0 -3
- package/dist/components/icon/icons/language.d.ts.map +0 -1
- package/dist/components/icon/icons/line-chart.d.ts +0 -3
- package/dist/components/icon/icons/line-chart.d.ts.map +0 -1
- package/dist/components/icon/icons/link.d.ts +0 -3
- package/dist/components/icon/icons/link.d.ts.map +0 -1
- package/dist/components/icon/icons/list.d.ts +0 -3
- package/dist/components/icon/icons/list.d.ts.map +0 -1
- package/dist/components/icon/icons/location.d.ts +0 -3
- package/dist/components/icon/icons/location.d.ts.map +0 -1
- package/dist/components/icon/icons/lock.d.ts +0 -3
- package/dist/components/icon/icons/lock.d.ts.map +0 -1
- package/dist/components/icon/icons/login.d.ts +0 -3
- package/dist/components/icon/icons/login.d.ts.map +0 -1
- package/dist/components/icon/icons/logout.d.ts +0 -3
- package/dist/components/icon/icons/logout.d.ts.map +0 -1
- package/dist/components/icon/icons/mail.d.ts +0 -3
- package/dist/components/icon/icons/mail.d.ts.map +0 -1
- package/dist/components/icon/icons/map.d.ts +0 -3
- package/dist/components/icon/icons/map.d.ts.map +0 -1
- package/dist/components/icon/icons/menu.d.ts +0 -3
- package/dist/components/icon/icons/menu.d.ts.map +0 -1
- package/dist/components/icon/icons/moon.d.ts +0 -3
- package/dist/components/icon/icons/moon.d.ts.map +0 -1
- package/dist/components/icon/icons/notifications.d.ts +0 -3
- package/dist/components/icon/icons/notifications.d.ts.map +0 -1
- package/dist/components/icon/icons/paste.d.ts +0 -3
- package/dist/components/icon/icons/paste.d.ts.map +0 -1
- package/dist/components/icon/icons/pin.d.ts +0 -3
- package/dist/components/icon/icons/pin.d.ts.map +0 -1
- package/dist/components/icon/icons/plus.d.ts +0 -3
- package/dist/components/icon/icons/plus.d.ts.map +0 -1
- package/dist/components/icon/icons/print.d.ts +0 -3
- package/dist/components/icon/icons/print.d.ts.map +0 -1
- package/dist/components/icon/icons/refresh.d.ts +0 -3
- package/dist/components/icon/icons/refresh.d.ts.map +0 -1
- package/dist/components/icon/icons/remove.d.ts +0 -3
- package/dist/components/icon/icons/remove.d.ts.map +0 -1
- package/dist/components/icon/icons/save.d.ts +0 -3
- package/dist/components/icon/icons/save.d.ts.map +0 -1
- package/dist/components/icon/icons/search.d.ts +0 -3
- package/dist/components/icon/icons/search.d.ts.map +0 -1
- package/dist/components/icon/icons/settings.d.ts +0 -3
- package/dist/components/icon/icons/settings.d.ts.map +0 -1
- package/dist/components/icon/icons/share.d.ts +0 -3
- package/dist/components/icon/icons/share.d.ts.map +0 -1
- package/dist/components/icon/icons/sort-arrows.d.ts +0 -3
- package/dist/components/icon/icons/sort-arrows.d.ts.map +0 -1
- package/dist/components/icon/icons/sort.d.ts +0 -3
- package/dist/components/icon/icons/sort.d.ts.map +0 -1
- package/dist/components/icon/icons/star.d.ts +0 -3
- package/dist/components/icon/icons/star.d.ts.map +0 -1
- package/dist/components/icon/icons/success.d.ts +0 -3
- package/dist/components/icon/icons/success.d.ts.map +0 -1
- package/dist/components/icon/icons/sun.d.ts +0 -3
- package/dist/components/icon/icons/sun.d.ts.map +0 -1
- package/dist/components/icon/icons/table.d.ts +0 -3
- package/dist/components/icon/icons/table.d.ts.map +0 -1
- package/dist/components/icon/icons/tag.d.ts +0 -3
- package/dist/components/icon/icons/tag.d.ts.map +0 -1
- package/dist/components/icon/icons/trash.d.ts +0 -3
- package/dist/components/icon/icons/trash.d.ts.map +0 -1
- package/dist/components/icon/icons/truck.d.ts +0 -3
- package/dist/components/icon/icons/truck.d.ts.map +0 -1
- package/dist/components/icon/icons/unlock.d.ts +0 -3
- package/dist/components/icon/icons/unlock.d.ts.map +0 -1
- package/dist/components/icon/icons/upload.d.ts +0 -3
- package/dist/components/icon/icons/upload.d.ts.map +0 -1
- package/dist/components/icon/icons/user-add.d.ts +0 -3
- package/dist/components/icon/icons/user-add.d.ts.map +0 -1
- package/dist/components/icon/icons/user.d.ts +0 -3
- package/dist/components/icon/icons/user.d.ts.map +0 -1
- package/dist/components/icon/icons/users.d.ts +0 -3
- package/dist/components/icon/icons/users.d.ts.map +0 -1
- package/dist/components/icon/icons/video.d.ts +0 -3
- package/dist/components/icon/icons/video.d.ts.map +0 -1
- package/dist/components/icon/icons/warning.d.ts +0 -3
- package/dist/components/icon/icons/warning.d.ts.map +0 -1
- package/dist/components/icon/registry.d.ts +0 -15
- package/dist/components/icon/registry.d.ts.map +0 -1
- package/dist/components/resource-table/ResourceTableContextMenu.d.ts +0 -40
- package/dist/components/resource-table/ResourceTableContextMenu.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionHeader.d.ts +0 -2
- package/dist/components/side-navigation/SideNavigationActionHeader.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionLinks.d.ts +0 -9
- package/dist/components/side-navigation/SideNavigationActionLinks.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationActionMenu.d.ts +0 -26
- package/dist/components/side-navigation/SideNavigationActionMenu.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationLink.d.ts +0 -38
- package/dist/components/side-navigation/SideNavigationLink.d.ts.map +0 -1
- package/dist/components/side-navigation/SideNavigationLinks.d.ts +0 -38
- package/dist/components/side-navigation/SideNavigationLinks.d.ts.map +0 -1
- package/dist/components/tabs/Tab.d.ts +0 -19
- package/dist/components/tabs/Tab.d.ts.map +0 -1
- package/dist/components/tabs/TabContent.d.ts +0 -13
- package/dist/components/tabs/TabContent.d.ts.map +0 -1
- package/dist/components/tabs/TabList.d.ts +0 -12
- package/dist/components/tabs/TabList.d.ts.map +0 -1
- package/dist/components/toast/ToastApi.d.ts +0 -21
- package/dist/components/toast/ToastApi.d.ts.map +0 -1
- package/dist/components/top-navigation/TopNavigation.d.ts +0 -65
- package/dist/components/top-navigation/TopNavigation.d.ts.map +0 -1
- package/dist/components/top-navigation/index.d.ts +0 -4
- package/dist/components/top-navigation/index.d.ts.map +0 -1
- package/dist/icons/truck.svg +0 -13
- package/dist/search-CM-OgatF.js +0 -179
- package/dist/search-C_vLUsm7.cjs +0 -1
- package/dist/styles.css +0 -3
- package/tailwind.preset.cjs +0 -75
- package/tailwind.preset.js +0 -97
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
|
|
2
|
+
const __mintLoadStyle = (key, url) => {
|
|
3
|
+
if (typeof document === 'undefined') return
|
|
4
|
+
const href = new URL(url, import.meta.url).href
|
|
5
|
+
if ([...document.querySelectorAll('link[rel="stylesheet"]')].some(link => link.href === href)) return
|
|
6
|
+
if (document.querySelector('style[data-mint-ui-style="' + key + '"]') || document.querySelector('link[data-mint-ui-style="' + key + '"]')) return
|
|
7
|
+
const link = document.createElement('link')
|
|
8
|
+
link.rel = 'stylesheet'
|
|
9
|
+
link.href = href
|
|
10
|
+
link.dataset.mintUiStyle = key
|
|
11
|
+
document.head.append(link)
|
|
12
|
+
}
|
|
13
|
+
__mintLoadStyle('theme', '../../theme.css')
|
|
14
|
+
__mintLoadStyle('sortable', '../../sortable.css')
|
|
15
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
16
|
+
//#region src/components/sortable/Sortable.ts
|
|
17
|
+
var t = "mint-sortable-placeholder", n = "mint-sortable-dragging", r = class extends HTMLElement {
|
|
18
|
+
static get observedAttributes() {
|
|
19
|
+
return [
|
|
20
|
+
"direction",
|
|
21
|
+
"gap",
|
|
22
|
+
"text-align",
|
|
23
|
+
"align-content",
|
|
24
|
+
"scroll-max-height",
|
|
25
|
+
"disabled",
|
|
26
|
+
"handle-selector",
|
|
27
|
+
"scroll-sensitivity",
|
|
28
|
+
"scroll-speed",
|
|
29
|
+
"animation-duration",
|
|
30
|
+
"item-key-attribute"
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
constructor() {
|
|
34
|
+
super(), this._pointerId = null, this._dragEl = null, this._placeholder = null, this._listRoot = this, this._startIndex = 0, this._pointerStartX = 0, this._pointerStartY = 0, this._dragStartLeft = 0, this._dragStartTop = 0, this._scrollRaf = null, this._childObserver = null, this._pointerBoundRoot = null, this._restoreAfter = null, this._sortStatus = null, this._keyboardKeydownHandler = (e) => this._onKeyboardReorder(e), this._onListPointerDown = (e) => {
|
|
35
|
+
let t = e;
|
|
36
|
+
if (this._isDisabled() || this._pointerId !== null || t.button !== 0) return;
|
|
37
|
+
let n = t.target;
|
|
38
|
+
if (!n || !this.contains(n)) return;
|
|
39
|
+
let r = this._closestSortableItem(n);
|
|
40
|
+
if (!r || !this._listRoot.contains(r) || r.hasAttribute("data-sortable-disabled")) return;
|
|
41
|
+
let i = this._getHandleSelector();
|
|
42
|
+
if (i) {
|
|
43
|
+
let e = t.target.closest(i);
|
|
44
|
+
if (!e || !r.contains(e)) return;
|
|
45
|
+
}
|
|
46
|
+
t.preventDefault(), this._startDrag(t, r);
|
|
47
|
+
}, this._boundPointerMove = this._onPointerMove.bind(this), this._boundPointerUp = this._onPointerUp.bind(this), this._boundPointerCancel = this._onPointerCancel.bind(this);
|
|
48
|
+
}
|
|
49
|
+
connectedCallback() {
|
|
50
|
+
this.classList.add("mint-sortable"), this._syncInnerStackAttributes(), this._applyHostScrollAndLayout(), this.addEventListener("keydown", this._keyboardKeydownHandler), this._observeInnerStack();
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this._unobserveInnerStack(), this.removeEventListener("keydown", this._keyboardKeydownHandler), this._teardownDrag(), this._pointerBoundRoot &&= (this._pointerBoundRoot.removeEventListener("pointerdown", this._onListPointerDown), null);
|
|
54
|
+
}
|
|
55
|
+
attributeChangedCallback(e, t, n) {
|
|
56
|
+
t !== n && (this._syncInnerStackAttributes(), this._applyHostScrollAndLayout());
|
|
57
|
+
}
|
|
58
|
+
_observeInnerStack() {
|
|
59
|
+
this._childObserver || (this._childObserver = new MutationObserver(() => {
|
|
60
|
+
this._pointerId === null && (this._syncInnerStackAttributes(), this._applyHostScrollAndLayout());
|
|
61
|
+
}), this._childObserver.observe(this, { childList: !0 }));
|
|
62
|
+
}
|
|
63
|
+
_unobserveInnerStack() {
|
|
64
|
+
this._childObserver &&= (this._childObserver.disconnect(), null);
|
|
65
|
+
}
|
|
66
|
+
_getInnerStack() {
|
|
67
|
+
for (let e = 0; e < this.children.length; e++) {
|
|
68
|
+
let t = this.children[e];
|
|
69
|
+
if (t.nodeType === Node.ELEMENT_NODE && t.tagName === "MINT-STACK") return t;
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
_resolveListRoot() {
|
|
74
|
+
return this._getInnerStack() ?? this;
|
|
75
|
+
}
|
|
76
|
+
_getItemKeyAttribute() {
|
|
77
|
+
return this.getAttribute("item-key-attribute")?.trim() || "data-sortable-id";
|
|
78
|
+
}
|
|
79
|
+
_collectOrderedKeys() {
|
|
80
|
+
let e = this._resolveListRoot(), n = this._getItemKeyAttribute(), r = [];
|
|
81
|
+
for (let i = 0; i < e.children.length; i++) {
|
|
82
|
+
let a = e.children[i];
|
|
83
|
+
if (a.nodeType !== Node.ELEMENT_NODE) continue;
|
|
84
|
+
let o = a;
|
|
85
|
+
o.classList.contains(t) || o.hasAttribute("data-mint-sortable-status") || r.push(o.getAttribute(n) ?? "");
|
|
86
|
+
}
|
|
87
|
+
return r;
|
|
88
|
+
}
|
|
89
|
+
_syncInnerStackAttributes() {
|
|
90
|
+
let e = this._getInnerStack();
|
|
91
|
+
if (!e) return;
|
|
92
|
+
let t = this.getDirection(), n = this.getGap(), r = this.getTextAlign();
|
|
93
|
+
e.setAttribute("direction", t), e.setAttribute("gap", String(n)), r ? e.setAttribute("text-align", r) : e.removeAttribute("text-align");
|
|
94
|
+
let i = this.getAlignContent();
|
|
95
|
+
i ? e.setAttribute("align-content", i) : e.removeAttribute("align-content");
|
|
96
|
+
}
|
|
97
|
+
_applyHostScrollAndLayout() {
|
|
98
|
+
this._listRoot = this._resolveListRoot();
|
|
99
|
+
let e = this.getAttribute("scroll-max-height");
|
|
100
|
+
e ? (this.style.maxHeight = e, this.style.overflowY = "auto", this.style.overflowX = "hidden", this.classList.add("mint-sortable-scrollable")) : (this.style.maxHeight = "", this.style.overflowY = "", this.style.overflowX = "", this.classList.remove("mint-sortable-scrollable"));
|
|
101
|
+
let t = this._getInnerStack();
|
|
102
|
+
this.classList.toggle("mint-sortable-has-inner-stack", !!t);
|
|
103
|
+
let n = this.getDirection(), r = this.getAlignContent(), i = Math.min(12, Math.max(1, Math.round(this.getGap()))), a = this.getTextAlign();
|
|
104
|
+
this.style.setProperty("--mint-sortable-direction", n === "horizontal" ? "row" : "column"), this.style.setProperty("--mint-sortable-gap", `${i * .25}rem`), this.style.setProperty("--mint-sortable-text-align", a || "initial"), this.style.setProperty("--mint-sortable-button-justify", a === "left" ? "flex-start" : a === "right" ? "flex-end" : "center");
|
|
105
|
+
let o = r ? r === "left" ? "flex-start" : r === "right" ? "flex-end" : "center" : "", s = n === "vertical" && o || "stretch", c = n === "horizontal" && o || "flex-start";
|
|
106
|
+
this.style.setProperty("--mint-sortable-cross-align", s), this.style.setProperty("--mint-sortable-main-align", c), this._ensureListPointerBinding(), this._syncKeyboardAccessibility();
|
|
107
|
+
}
|
|
108
|
+
_syncKeyboardAccessibility() {
|
|
109
|
+
let e = this._resolveListRoot();
|
|
110
|
+
e.hasAttribute("role") || e.setAttribute("role", "list"), this._sortStatus || (this._sortStatus = document.createElement("div"), this._sortStatus.className = "mint-sortable-status", this._sortStatus.setAttribute("role", "status"), this._sortStatus.setAttribute("aria-live", "polite"), this._sortStatus.setAttribute("aria-atomic", "true"), this._sortStatus.setAttribute("data-mint-sortable-status", ""), this.appendChild(this._sortStatus)), this._getLayoutChildren().forEach((e) => {
|
|
111
|
+
e.classList.contains(t) || (e.hasAttribute("role") || e.setAttribute("role", "listitem"), e.hasAttribute("tabindex") || (e.tabIndex = 0), e.setAttribute("aria-keyshortcuts", "Alt+ArrowUp Alt+ArrowDown"), e.hasAttribute("aria-roledescription") || e.setAttribute("aria-roledescription", "sortable item"));
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
_onKeyboardReorder(e) {
|
|
115
|
+
if (this._isDisabled() || !e.altKey || !["ArrowUp", "ArrowDown"].includes(e.key)) return;
|
|
116
|
+
let n = e.target instanceof Element ? e.target : null, r = n ? this._closestSortableItem(n) : null;
|
|
117
|
+
if (!r || r.hasAttribute("data-sortable-disabled")) return;
|
|
118
|
+
let i = this._getLayoutChildren().filter((e) => !e.classList.contains(t)), a = i.indexOf(r), o = a + (e.key === "ArrowUp" ? -1 : 1);
|
|
119
|
+
if (a < 0 || o < 0 || o >= i.length) return;
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
let s = i[o];
|
|
122
|
+
e.key === "ArrowUp" ? this._listRoot.insertBefore(r, s) : this._listRoot.insertBefore(s, r), r.focus({ preventScroll: !0 });
|
|
123
|
+
let c = this._collectOrderedKeys(), l = this._indexOfItem(r), u = r.getAttribute("aria-label") || r.textContent?.trim().replace(/\s+/g, " ") || "Item";
|
|
124
|
+
this._sortStatus && (this._sortStatus.textContent = `${u} moved to position ${l + 1} of ${i.length}.`);
|
|
125
|
+
let d = {
|
|
126
|
+
oldIndex: a,
|
|
127
|
+
newIndex: l,
|
|
128
|
+
keys: c
|
|
129
|
+
};
|
|
130
|
+
this.dispatchEvent(new CustomEvent("mint-sortable-change", {
|
|
131
|
+
bubbles: !0,
|
|
132
|
+
composed: !0,
|
|
133
|
+
detail: d
|
|
134
|
+
})), this.dispatchEvent(new CustomEvent("mint-sortable-order", {
|
|
135
|
+
bubbles: !0,
|
|
136
|
+
composed: !0,
|
|
137
|
+
detail: { keys: c }
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
getDirection() {
|
|
141
|
+
return (this.getAttribute("direction") || "vertical") === "horizontal" ? "horizontal" : "vertical";
|
|
142
|
+
}
|
|
143
|
+
getGap() {
|
|
144
|
+
let e = this.getAttribute("gap") || "3", t = parseFloat(e);
|
|
145
|
+
return Number.isFinite(t) ? t : 3;
|
|
146
|
+
}
|
|
147
|
+
getTextAlign() {
|
|
148
|
+
let e = this.getAttribute("text-align") || "";
|
|
149
|
+
return [
|
|
150
|
+
"left",
|
|
151
|
+
"center",
|
|
152
|
+
"right",
|
|
153
|
+
"justify"
|
|
154
|
+
].includes(e) ? e : "";
|
|
155
|
+
}
|
|
156
|
+
getAlignContent() {
|
|
157
|
+
let e = (this.getAttribute("align-content") || "").trim().toLowerCase();
|
|
158
|
+
return e === "left" || e === "right" || e === "center" ? e : "";
|
|
159
|
+
}
|
|
160
|
+
_isDisabled() {
|
|
161
|
+
return this.hasAttribute("disabled") && this.getAttribute("disabled") !== "false";
|
|
162
|
+
}
|
|
163
|
+
_getHandleSelector() {
|
|
164
|
+
let e = this.getAttribute("handle-selector");
|
|
165
|
+
return e && e.trim() ? e.trim() : null;
|
|
166
|
+
}
|
|
167
|
+
_getScrollSensitivity() {
|
|
168
|
+
let e = parseFloat(this.getAttribute("scroll-sensitivity") || "48");
|
|
169
|
+
return Number.isFinite(e) ? e : 48;
|
|
170
|
+
}
|
|
171
|
+
_getScrollSpeed() {
|
|
172
|
+
let e = parseFloat(this.getAttribute("scroll-speed") || "12");
|
|
173
|
+
return Number.isFinite(e) ? e : 12;
|
|
174
|
+
}
|
|
175
|
+
_getAnimationDurationMs() {
|
|
176
|
+
let e = parseFloat(this.getAttribute("animation-duration") || "220");
|
|
177
|
+
return Number.isFinite(e) ? Math.max(0, e) : 220;
|
|
178
|
+
}
|
|
179
|
+
_ensureListPointerBinding() {
|
|
180
|
+
let e = this._resolveListRoot();
|
|
181
|
+
this._pointerBoundRoot !== e && (this._pointerBoundRoot && this._pointerBoundRoot.removeEventListener("pointerdown", this._onListPointerDown), e.addEventListener("pointerdown", this._onListPointerDown), this._pointerBoundRoot = e, this._listRoot = e);
|
|
182
|
+
}
|
|
183
|
+
_closestSortableItem(e) {
|
|
184
|
+
let r = e;
|
|
185
|
+
for (; r && r !== this._listRoot;) {
|
|
186
|
+
if (r.nodeType === Node.ELEMENT_NODE) {
|
|
187
|
+
let e = r;
|
|
188
|
+
if (e.classList.contains(t) || e.classList.contains(n)) return null;
|
|
189
|
+
if (r.parentElement === this._listRoot) return e;
|
|
190
|
+
}
|
|
191
|
+
r = r.parentElement;
|
|
192
|
+
}
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
_startDrag(e, r) {
|
|
196
|
+
this._listRoot = this._resolveListRoot(), this._restoreAfter = r.nextElementSibling, this._dragEl = r, this._pointerId = e.pointerId, this._startIndex = this._indexOfItem(r);
|
|
197
|
+
let i = r.getBoundingClientRect();
|
|
198
|
+
this._pointerStartX = e.clientX, this._pointerStartY = e.clientY, this._dragStartLeft = i.left, this._dragStartTop = i.top;
|
|
199
|
+
let a = document.createElement("div");
|
|
200
|
+
a.className = t, a.style.minHeight = `${i.height}px`, a.style.minWidth = `${i.width}px`, a.setAttribute("aria-hidden", "true"), this._placeholder = a, this._listRoot.insertBefore(a, r), r.classList.add(n), r.style.position = "fixed", r.style.left = `${i.left}px`, r.style.top = `${i.top}px`, r.style.width = `${i.width}px`, r.style.height = `${i.height}px`, r.style.margin = "0", r.style.zIndex = "10000", r.style.boxSizing = "border-box", r.style.pointerEvents = "none", r.style.touchAction = "none", r.style.willChange = "transform, left, top", r.setPointerCapture(e.pointerId);
|
|
201
|
+
let o = this._collectOrderedKeys(), s = {
|
|
202
|
+
index: this._startIndex,
|
|
203
|
+
keys: o
|
|
204
|
+
};
|
|
205
|
+
this.dispatchEvent(new CustomEvent("mint-sortable-start", {
|
|
206
|
+
bubbles: !0,
|
|
207
|
+
composed: !0,
|
|
208
|
+
detail: s
|
|
209
|
+
})), this.dispatchEvent(new CustomEvent("sort-start", {
|
|
210
|
+
bubbles: !0,
|
|
211
|
+
composed: !0,
|
|
212
|
+
detail: s
|
|
213
|
+
})), window.addEventListener("pointermove", this._boundPointerMove, { passive: !1 }), window.addEventListener("pointerup", this._boundPointerUp), window.addEventListener("pointercancel", this._boundPointerCancel);
|
|
214
|
+
}
|
|
215
|
+
_indexOfItem(e) {
|
|
216
|
+
let n = 0;
|
|
217
|
+
for (let r = 0; r < this._listRoot.children.length; r++) {
|
|
218
|
+
let i = this._listRoot.children[r];
|
|
219
|
+
if (i.nodeType !== Node.ELEMENT_NODE) continue;
|
|
220
|
+
let a = i;
|
|
221
|
+
if (!a.classList.contains(t)) {
|
|
222
|
+
if (a === e) return n;
|
|
223
|
+
n++;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return -1;
|
|
227
|
+
}
|
|
228
|
+
_getLayoutChildren() {
|
|
229
|
+
return Array.from(this._listRoot.children).filter((e) => e.nodeType === Node.ELEMENT_NODE && !e.hasAttribute("data-mint-sortable-status"));
|
|
230
|
+
}
|
|
231
|
+
_onPointerMove(e) {
|
|
232
|
+
if (e.pointerId !== this._pointerId || !this._dragEl || !this._placeholder) return;
|
|
233
|
+
e.preventDefault();
|
|
234
|
+
let t = e.clientX - this._pointerStartX, n = e.clientY - this._pointerStartY;
|
|
235
|
+
this._dragEl.style.left = `${this._dragStartLeft + t}px`, this._dragEl.style.top = `${this._dragStartTop + n}px`, this._autoScroll(e), this._maybeMovePlaceholder(e);
|
|
236
|
+
}
|
|
237
|
+
_autoScroll(e) {
|
|
238
|
+
let t = this;
|
|
239
|
+
if (!t.style.maxHeight) return;
|
|
240
|
+
let n = this._getScrollSensitivity(), r = this._getScrollSpeed(), i = t.getBoundingClientRect();
|
|
241
|
+
this._scrollRaf !== null && cancelAnimationFrame(this._scrollRaf), this._scrollRaf = requestAnimationFrame(() => {
|
|
242
|
+
this._scrollRaf = null;
|
|
243
|
+
let a = 0;
|
|
244
|
+
e.clientY < i.top + n ? a = -r : e.clientY > i.bottom - n && (a = r), a !== 0 && (t.scrollTop += a, this._maybeMovePlaceholder(e));
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
_maybeMovePlaceholder(e) {
|
|
248
|
+
let t = this._placeholder, n = this._dragEl;
|
|
249
|
+
if (!t || !n) return;
|
|
250
|
+
let r = this.getDirection() === "horizontal", i = r ? e.clientX : e.clientY, a = Array.from(this._listRoot.children).filter((e) => e.nodeType === Node.ELEMENT_NODE && e !== n && e !== t), o = null;
|
|
251
|
+
for (let e of a) {
|
|
252
|
+
let t = e.getBoundingClientRect();
|
|
253
|
+
if (i < (r ? t.left + t.width / 2 : t.top + t.height / 2)) {
|
|
254
|
+
o = e;
|
|
255
|
+
break;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
let s = Array.from(this._listRoot.children).filter((e) => e.nodeType === Node.ELEMENT_NODE && e !== n), c = s.length > 0 && s[s.length - 1] === t;
|
|
259
|
+
(o ? !(t.nextSibling === o && t.parentNode === this._listRoot) : !c) && this._flipAnimate(() => {
|
|
260
|
+
o ? this._listRoot.insertBefore(t, o) : this._listRoot.appendChild(t);
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
_flipAnimate(e) {
|
|
264
|
+
let t = this._dragEl, n = this._getAnimationDurationMs(), r = this._getLayoutChildren().filter((e) => e !== t), i = /* @__PURE__ */ new Map();
|
|
265
|
+
r.forEach((e) => i.set(e, e.getBoundingClientRect())), e(), !(n <= 0) && r.forEach((e) => {
|
|
266
|
+
let t = i.get(e);
|
|
267
|
+
if (!t) return;
|
|
268
|
+
let r = e.getBoundingClientRect(), a = t.left - r.left, o = t.top - r.top;
|
|
269
|
+
Math.abs(a) < .5 && Math.abs(o) < .5 || (e.style.transition = "none", e.style.transform = `translate(${a}px, ${o}px)`, requestAnimationFrame(() => {
|
|
270
|
+
e.style.transition = `transform ${n}ms cubic-bezier(0.2, 0.8, 0.2, 1)`, e.style.transform = "";
|
|
271
|
+
let t = () => {
|
|
272
|
+
e.removeEventListener("transitionend", t), e.style.transition = "", e.style.transform = "";
|
|
273
|
+
};
|
|
274
|
+
e.addEventListener("transitionend", t, { once: !0 }), setTimeout(t, n + 40);
|
|
275
|
+
}));
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
_onPointerUp(e) {
|
|
279
|
+
e.pointerId === this._pointerId && this._finishDrag(!1);
|
|
280
|
+
}
|
|
281
|
+
_onPointerCancel(e) {
|
|
282
|
+
e.pointerId === this._pointerId && this._finishDrag(!0);
|
|
283
|
+
}
|
|
284
|
+
_finishDrag(e) {
|
|
285
|
+
let t = this._dragEl, r = this._placeholder;
|
|
286
|
+
if (!t || this._pointerId === null) {
|
|
287
|
+
this._teardownDrag();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
try {
|
|
291
|
+
t.releasePointerCapture(this._pointerId);
|
|
292
|
+
} catch {}
|
|
293
|
+
if (window.removeEventListener("pointermove", this._boundPointerMove), window.removeEventListener("pointerup", this._boundPointerUp), window.removeEventListener("pointercancel", this._boundPointerCancel), e) {
|
|
294
|
+
let e = this._restoreAfter;
|
|
295
|
+
e && e.parentNode === this._listRoot ? this._listRoot.insertBefore(t, e) : this._listRoot.appendChild(t);
|
|
296
|
+
} else r?.parentNode && this._listRoot.insertBefore(t, r);
|
|
297
|
+
r?.remove(), this._placeholder = null, t.classList.remove(n), t.style.cssText = "";
|
|
298
|
+
let i = this._indexOfItem(t), a = this._startIndex;
|
|
299
|
+
this._pointerId = null, this._dragEl = null, this._restoreAfter = null;
|
|
300
|
+
let o = this._collectOrderedKeys(), s = {
|
|
301
|
+
oldIndex: a,
|
|
302
|
+
newIndex: i,
|
|
303
|
+
cancelled: e,
|
|
304
|
+
keys: o
|
|
305
|
+
};
|
|
306
|
+
this.dispatchEvent(new CustomEvent("mint-sortable-end", {
|
|
307
|
+
bubbles: !0,
|
|
308
|
+
composed: !0,
|
|
309
|
+
detail: s
|
|
310
|
+
})), this.dispatchEvent(new CustomEvent("sort-stop", {
|
|
311
|
+
bubbles: !0,
|
|
312
|
+
composed: !0,
|
|
313
|
+
detail: s
|
|
314
|
+
})), !e && i !== a && (this.dispatchEvent(new CustomEvent("mint-sortable-change", {
|
|
315
|
+
bubbles: !0,
|
|
316
|
+
composed: !0,
|
|
317
|
+
detail: {
|
|
318
|
+
oldIndex: a,
|
|
319
|
+
newIndex: i,
|
|
320
|
+
keys: o
|
|
321
|
+
}
|
|
322
|
+
})), this.dispatchEvent(new CustomEvent("mint-sortable-order", {
|
|
323
|
+
bubbles: !0,
|
|
324
|
+
composed: !0,
|
|
325
|
+
detail: { keys: o }
|
|
326
|
+
})));
|
|
327
|
+
}
|
|
328
|
+
_teardownDrag() {
|
|
329
|
+
if (this._scrollRaf !== null && (cancelAnimationFrame(this._scrollRaf), this._scrollRaf = null), window.removeEventListener("pointermove", this._boundPointerMove), window.removeEventListener("pointerup", this._boundPointerUp), window.removeEventListener("pointercancel", this._boundPointerCancel), this._dragEl) {
|
|
330
|
+
try {
|
|
331
|
+
this._pointerId !== null && this._dragEl.releasePointerCapture(this._pointerId);
|
|
332
|
+
} catch {}
|
|
333
|
+
this._dragEl.classList.remove(n), this._dragEl.style.cssText = "";
|
|
334
|
+
}
|
|
335
|
+
this._placeholder?.remove(), this._placeholder = null, this._dragEl = null, this._pointerId = null, this._restoreAfter = null;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
customElements.get("mint-sortable") || e("mint-sortable", r);
|
|
339
|
+
//#endregion
|
|
340
|
+
export { r as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`../chunks/register-element-tCL_F1YI.js`);var t=`mint-sortable-placeholder`,n=`mint-sortable-dragging`,r=class extends HTMLElement{static get observedAttributes(){return[`direction`,`gap`,`text-align`,`align-content`,`scroll-max-height`,`disabled`,`handle-selector`,`scroll-sensitivity`,`scroll-speed`,`animation-duration`,`item-key-attribute`]}constructor(){super(),this._pointerId=null,this._dragEl=null,this._placeholder=null,this._listRoot=this,this._startIndex=0,this._pointerStartX=0,this._pointerStartY=0,this._dragStartLeft=0,this._dragStartTop=0,this._scrollRaf=null,this._childObserver=null,this._pointerBoundRoot=null,this._restoreAfter=null,this._sortStatus=null,this._keyboardKeydownHandler=e=>this._onKeyboardReorder(e),this._onListPointerDown=e=>{let t=e;if(this._isDisabled()||this._pointerId!==null||t.button!==0)return;let n=t.target;if(!n||!this.contains(n))return;let r=this._closestSortableItem(n);if(!r||!this._listRoot.contains(r)||r.hasAttribute(`data-sortable-disabled`))return;let i=this._getHandleSelector();if(i){let e=t.target.closest(i);if(!e||!r.contains(e))return}t.preventDefault(),this._startDrag(t,r)},this._boundPointerMove=this._onPointerMove.bind(this),this._boundPointerUp=this._onPointerUp.bind(this),this._boundPointerCancel=this._onPointerCancel.bind(this)}connectedCallback(){this.classList.add(`mint-sortable`),this._syncInnerStackAttributes(),this._applyHostScrollAndLayout(),this.addEventListener(`keydown`,this._keyboardKeydownHandler),this._observeInnerStack()}disconnectedCallback(){this._unobserveInnerStack(),this.removeEventListener(`keydown`,this._keyboardKeydownHandler),this._teardownDrag(),this._pointerBoundRoot&&=(this._pointerBoundRoot.removeEventListener(`pointerdown`,this._onListPointerDown),null)}attributeChangedCallback(e,t,n){t!==n&&(this._syncInnerStackAttributes(),this._applyHostScrollAndLayout())}_observeInnerStack(){this._childObserver||(this._childObserver=new MutationObserver(()=>{this._pointerId===null&&(this._syncInnerStackAttributes(),this._applyHostScrollAndLayout())}),this._childObserver.observe(this,{childList:!0}))}_unobserveInnerStack(){this._childObserver&&=(this._childObserver.disconnect(),null)}_getInnerStack(){for(let e=0;e<this.children.length;e++){let t=this.children[e];if(t.nodeType===Node.ELEMENT_NODE&&t.tagName===`MINT-STACK`)return t}return null}_resolveListRoot(){return this._getInnerStack()??this}_getItemKeyAttribute(){return this.getAttribute(`item-key-attribute`)?.trim()||`data-sortable-id`}_collectOrderedKeys(){let e=this._resolveListRoot(),n=this._getItemKeyAttribute(),r=[];for(let i=0;i<e.children.length;i++){let a=e.children[i];if(a.nodeType!==Node.ELEMENT_NODE)continue;let o=a;o.classList.contains(t)||o.hasAttribute(`data-mint-sortable-status`)||r.push(o.getAttribute(n)??``)}return r}_syncInnerStackAttributes(){let e=this._getInnerStack();if(!e)return;let t=this.getDirection(),n=this.getGap(),r=this.getTextAlign();e.setAttribute(`direction`,t),e.setAttribute(`gap`,String(n)),r?e.setAttribute(`text-align`,r):e.removeAttribute(`text-align`);let i=this.getAlignContent();i?e.setAttribute(`align-content`,i):e.removeAttribute(`align-content`)}_applyHostScrollAndLayout(){this._listRoot=this._resolveListRoot();let e=this.getAttribute(`scroll-max-height`);e?(this.style.maxHeight=e,this.style.overflowY=`auto`,this.style.overflowX=`hidden`,this.classList.add(`mint-sortable-scrollable`)):(this.style.maxHeight=``,this.style.overflowY=``,this.style.overflowX=``,this.classList.remove(`mint-sortable-scrollable`));let t=this._getInnerStack();this.classList.toggle(`mint-sortable-has-inner-stack`,!!t);let n=this.getDirection(),r=this.getAlignContent(),i=Math.min(12,Math.max(1,Math.round(this.getGap()))),a=this.getTextAlign();this.style.setProperty(`--mint-sortable-direction`,n===`horizontal`?`row`:`column`),this.style.setProperty(`--mint-sortable-gap`,`${i*.25}rem`),this.style.setProperty(`--mint-sortable-text-align`,a||`initial`),this.style.setProperty(`--mint-sortable-button-justify`,a===`left`?`flex-start`:a===`right`?`flex-end`:`center`);let o=r?r===`left`?`flex-start`:r===`right`?`flex-end`:`center`:``,s=n===`vertical`&&o||`stretch`,c=n===`horizontal`&&o||`flex-start`;this.style.setProperty(`--mint-sortable-cross-align`,s),this.style.setProperty(`--mint-sortable-main-align`,c),this._ensureListPointerBinding(),this._syncKeyboardAccessibility()}_syncKeyboardAccessibility(){let e=this._resolveListRoot();e.hasAttribute(`role`)||e.setAttribute(`role`,`list`),this._sortStatus||(this._sortStatus=document.createElement(`div`),this._sortStatus.className=`mint-sortable-status`,this._sortStatus.setAttribute(`role`,`status`),this._sortStatus.setAttribute(`aria-live`,`polite`),this._sortStatus.setAttribute(`aria-atomic`,`true`),this._sortStatus.setAttribute(`data-mint-sortable-status`,``),this.appendChild(this._sortStatus)),this._getLayoutChildren().forEach(e=>{e.classList.contains(t)||(e.hasAttribute(`role`)||e.setAttribute(`role`,`listitem`),e.hasAttribute(`tabindex`)||(e.tabIndex=0),e.setAttribute(`aria-keyshortcuts`,`Alt+ArrowUp Alt+ArrowDown`),e.hasAttribute(`aria-roledescription`)||e.setAttribute(`aria-roledescription`,`sortable item`))})}_onKeyboardReorder(e){if(this._isDisabled()||!e.altKey||![`ArrowUp`,`ArrowDown`].includes(e.key))return;let n=e.target instanceof Element?e.target:null,r=n?this._closestSortableItem(n):null;if(!r||r.hasAttribute(`data-sortable-disabled`))return;let i=this._getLayoutChildren().filter(e=>!e.classList.contains(t)),a=i.indexOf(r),o=a+(e.key===`ArrowUp`?-1:1);if(a<0||o<0||o>=i.length)return;e.preventDefault();let s=i[o];e.key===`ArrowUp`?this._listRoot.insertBefore(r,s):this._listRoot.insertBefore(s,r),r.focus({preventScroll:!0});let c=this._collectOrderedKeys(),l=this._indexOfItem(r),u=r.getAttribute(`aria-label`)||r.textContent?.trim().replace(/\s+/g,` `)||`Item`;this._sortStatus&&(this._sortStatus.textContent=`${u} moved to position ${l+1} of ${i.length}.`);let d={oldIndex:a,newIndex:l,keys:c};this.dispatchEvent(new CustomEvent(`mint-sortable-change`,{bubbles:!0,composed:!0,detail:d})),this.dispatchEvent(new CustomEvent(`mint-sortable-order`,{bubbles:!0,composed:!0,detail:{keys:c}}))}getDirection(){return(this.getAttribute(`direction`)||`vertical`)===`horizontal`?`horizontal`:`vertical`}getGap(){let e=this.getAttribute(`gap`)||`3`,t=parseFloat(e);return Number.isFinite(t)?t:3}getTextAlign(){let e=this.getAttribute(`text-align`)||``;return[`left`,`center`,`right`,`justify`].includes(e)?e:``}getAlignContent(){let e=(this.getAttribute(`align-content`)||``).trim().toLowerCase();return e===`left`||e===`right`||e===`center`?e:``}_isDisabled(){return this.hasAttribute(`disabled`)&&this.getAttribute(`disabled`)!==`false`}_getHandleSelector(){let e=this.getAttribute(`handle-selector`);return e&&e.trim()?e.trim():null}_getScrollSensitivity(){let e=parseFloat(this.getAttribute(`scroll-sensitivity`)||`48`);return Number.isFinite(e)?e:48}_getScrollSpeed(){let e=parseFloat(this.getAttribute(`scroll-speed`)||`12`);return Number.isFinite(e)?e:12}_getAnimationDurationMs(){let e=parseFloat(this.getAttribute(`animation-duration`)||`220`);return Number.isFinite(e)?Math.max(0,e):220}_ensureListPointerBinding(){let e=this._resolveListRoot();this._pointerBoundRoot!==e&&(this._pointerBoundRoot&&this._pointerBoundRoot.removeEventListener(`pointerdown`,this._onListPointerDown),e.addEventListener(`pointerdown`,this._onListPointerDown),this._pointerBoundRoot=e,this._listRoot=e)}_closestSortableItem(e){let r=e;for(;r&&r!==this._listRoot;){if(r.nodeType===Node.ELEMENT_NODE){let e=r;if(e.classList.contains(t)||e.classList.contains(n))return null;if(r.parentElement===this._listRoot)return e}r=r.parentElement}return null}_startDrag(e,r){this._listRoot=this._resolveListRoot(),this._restoreAfter=r.nextElementSibling,this._dragEl=r,this._pointerId=e.pointerId,this._startIndex=this._indexOfItem(r);let i=r.getBoundingClientRect();this._pointerStartX=e.clientX,this._pointerStartY=e.clientY,this._dragStartLeft=i.left,this._dragStartTop=i.top;let a=document.createElement(`div`);a.className=t,a.style.minHeight=`${i.height}px`,a.style.minWidth=`${i.width}px`,a.setAttribute(`aria-hidden`,`true`),this._placeholder=a,this._listRoot.insertBefore(a,r),r.classList.add(n),r.style.position=`fixed`,r.style.left=`${i.left}px`,r.style.top=`${i.top}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin=`0`,r.style.zIndex=`10000`,r.style.boxSizing=`border-box`,r.style.pointerEvents=`none`,r.style.touchAction=`none`,r.style.willChange=`transform, left, top`,r.setPointerCapture(e.pointerId);let o=this._collectOrderedKeys(),s={index:this._startIndex,keys:o};this.dispatchEvent(new CustomEvent(`mint-sortable-start`,{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent(`sort-start`,{bubbles:!0,composed:!0,detail:s})),window.addEventListener(`pointermove`,this._boundPointerMove,{passive:!1}),window.addEventListener(`pointerup`,this._boundPointerUp),window.addEventListener(`pointercancel`,this._boundPointerCancel)}_indexOfItem(e){let n=0;for(let r=0;r<this._listRoot.children.length;r++){let i=this._listRoot.children[r];if(i.nodeType!==Node.ELEMENT_NODE)continue;let a=i;if(!a.classList.contains(t)){if(a===e)return n;n++}}return-1}_getLayoutChildren(){return Array.from(this._listRoot.children).filter(e=>e.nodeType===Node.ELEMENT_NODE&&!e.hasAttribute(`data-mint-sortable-status`))}_onPointerMove(e){if(e.pointerId!==this._pointerId||!this._dragEl||!this._placeholder)return;e.preventDefault();let t=e.clientX-this._pointerStartX,n=e.clientY-this._pointerStartY;this._dragEl.style.left=`${this._dragStartLeft+t}px`,this._dragEl.style.top=`${this._dragStartTop+n}px`,this._autoScroll(e),this._maybeMovePlaceholder(e)}_autoScroll(e){let t=this;if(!t.style.maxHeight)return;let n=this._getScrollSensitivity(),r=this._getScrollSpeed(),i=t.getBoundingClientRect();this._scrollRaf!==null&&cancelAnimationFrame(this._scrollRaf),this._scrollRaf=requestAnimationFrame(()=>{this._scrollRaf=null;let a=0;e.clientY<i.top+n?a=-r:e.clientY>i.bottom-n&&(a=r),a!==0&&(t.scrollTop+=a,this._maybeMovePlaceholder(e))})}_maybeMovePlaceholder(e){let t=this._placeholder,n=this._dragEl;if(!t||!n)return;let r=this.getDirection()===`horizontal`,i=r?e.clientX:e.clientY,a=Array.from(this._listRoot.children).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e!==n&&e!==t),o=null;for(let e of a){let t=e.getBoundingClientRect();if(i<(r?t.left+t.width/2:t.top+t.height/2)){o=e;break}}let s=Array.from(this._listRoot.children).filter(e=>e.nodeType===Node.ELEMENT_NODE&&e!==n),c=s.length>0&&s[s.length-1]===t;(o?!(t.nextSibling===o&&t.parentNode===this._listRoot):!c)&&this._flipAnimate(()=>{o?this._listRoot.insertBefore(t,o):this._listRoot.appendChild(t)})}_flipAnimate(e){let t=this._dragEl,n=this._getAnimationDurationMs(),r=this._getLayoutChildren().filter(e=>e!==t),i=new Map;r.forEach(e=>i.set(e,e.getBoundingClientRect())),e(),!(n<=0)&&r.forEach(e=>{let t=i.get(e);if(!t)return;let r=e.getBoundingClientRect(),a=t.left-r.left,o=t.top-r.top;Math.abs(a)<.5&&Math.abs(o)<.5||(e.style.transition=`none`,e.style.transform=`translate(${a}px, ${o}px)`,requestAnimationFrame(()=>{e.style.transition=`transform ${n}ms cubic-bezier(0.2, 0.8, 0.2, 1)`,e.style.transform=``;let t=()=>{e.removeEventListener(`transitionend`,t),e.style.transition=``,e.style.transform=``};e.addEventListener(`transitionend`,t,{once:!0}),setTimeout(t,n+40)}))})}_onPointerUp(e){e.pointerId===this._pointerId&&this._finishDrag(!1)}_onPointerCancel(e){e.pointerId===this._pointerId&&this._finishDrag(!0)}_finishDrag(e){let t=this._dragEl,r=this._placeholder;if(!t||this._pointerId===null){this._teardownDrag();return}try{t.releasePointerCapture(this._pointerId)}catch{}if(window.removeEventListener(`pointermove`,this._boundPointerMove),window.removeEventListener(`pointerup`,this._boundPointerUp),window.removeEventListener(`pointercancel`,this._boundPointerCancel),e){let e=this._restoreAfter;e&&e.parentNode===this._listRoot?this._listRoot.insertBefore(t,e):this._listRoot.appendChild(t)}else r?.parentNode&&this._listRoot.insertBefore(t,r);r?.remove(),this._placeholder=null,t.classList.remove(n),t.style.cssText=``;let i=this._indexOfItem(t),a=this._startIndex;this._pointerId=null,this._dragEl=null,this._restoreAfter=null;let o=this._collectOrderedKeys(),s={oldIndex:a,newIndex:i,cancelled:e,keys:o};this.dispatchEvent(new CustomEvent(`mint-sortable-end`,{bubbles:!0,composed:!0,detail:s})),this.dispatchEvent(new CustomEvent(`sort-stop`,{bubbles:!0,composed:!0,detail:s})),!e&&i!==a&&(this.dispatchEvent(new CustomEvent(`mint-sortable-change`,{bubbles:!0,composed:!0,detail:{oldIndex:a,newIndex:i,keys:o}})),this.dispatchEvent(new CustomEvent(`mint-sortable-order`,{bubbles:!0,composed:!0,detail:{keys:o}})))}_teardownDrag(){if(this._scrollRaf!==null&&(cancelAnimationFrame(this._scrollRaf),this._scrollRaf=null),window.removeEventListener(`pointermove`,this._boundPointerMove),window.removeEventListener(`pointerup`,this._boundPointerUp),window.removeEventListener(`pointercancel`,this._boundPointerCancel),this._dragEl){try{this._pointerId!==null&&this._dragEl.releasePointerCapture(this._pointerId)}catch{}this._dragEl.classList.remove(n),this._dragEl.style.cssText=``}this._placeholder?.remove(),this._placeholder=null,this._dragEl=null,this._pointerId=null,this._restoreAfter=null}};customElements.get(`mint-sortable`)||e.t(`mint-sortable`,r),module.exports=r;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "index.d.ts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"index.d.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA"
|
|
10
|
+
}
|