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,1457 @@
|
|
|
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('table', '../../table.css')
|
|
15
|
+
__mintLoadStyle('input', '../../input.css')
|
|
16
|
+
__mintLoadStyle('icon', '../../icon.css')
|
|
17
|
+
__mintLoadStyle('button', '../../button.css')
|
|
18
|
+
__mintLoadStyle('spinner', '../../spinner.css')
|
|
19
|
+
__mintLoadStyle('popover', '../../popover.css')
|
|
20
|
+
__mintLoadStyle('stack', '../../stack.css')
|
|
21
|
+
__mintLoadStyle('resource-table', '../../resource-table.css')
|
|
22
|
+
import "../chunks/icon-gQAtsERy.js";
|
|
23
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
24
|
+
import "../chunks/icon-C0OLmjDY.js";
|
|
25
|
+
import "../chunks/spinner-BsaFHuS6.js";
|
|
26
|
+
import "../chunks/button-B0Yt0MX1.js";
|
|
27
|
+
import "../chunks/input-8bbXzpa5.js";
|
|
28
|
+
import "../chunks/caret-up-D_6oa7o1.js";
|
|
29
|
+
import "../chunks/caret-down-Ch6IfR7r.js";
|
|
30
|
+
import "../chunks/popover-gviDCspV.js";
|
|
31
|
+
import "../chunks/search-ANUKQi0r.js";
|
|
32
|
+
import "../chunks/table-BgboosRK.js";
|
|
33
|
+
//#region src/components/resource-table/utility-aliases.js
|
|
34
|
+
var t = {
|
|
35
|
+
"-mr-1": "rtu-8956a4275",
|
|
36
|
+
"-translate-y-1/2": "rtu-36b381be4",
|
|
37
|
+
"[&>*]:m-0": "rtu-7b41b3d11",
|
|
38
|
+
"[&>*]:max-w-full": "rtu-ba23a8c34",
|
|
39
|
+
"[&>*]:min-h-0": "rtu-860618883",
|
|
40
|
+
"[&>*]:min-w-0": "rtu-85a48d872",
|
|
41
|
+
"[&>*]:p-0": "rtu-299511c44",
|
|
42
|
+
"[&>*]:w-full": "rtu-d26168286",
|
|
43
|
+
"[&>span]:flex": "rtu-684665eca",
|
|
44
|
+
"[&>span]:h-full": "rtu-e4b40d71e",
|
|
45
|
+
"[&>span]:items-stretch": "rtu-d7d251fc2",
|
|
46
|
+
"[&>span]:justify-stretch": "rtu-86ed0d205",
|
|
47
|
+
"[&>span]:min-h-0": "rtu-f145dfde7",
|
|
48
|
+
"[&>span]:min-w-0": "rtu-0a6cfb970",
|
|
49
|
+
"[&>span]:w-full": "rtu-85ca68177",
|
|
50
|
+
"[&_img]:!block": "rtu-83fb557c2",
|
|
51
|
+
"[&_img]:!border-0": "rtu-2288f2d07",
|
|
52
|
+
"[&_img]:!box-border": "rtu-9253a17e4",
|
|
53
|
+
"[&_img]:!h-full": "rtu-07505e4a3",
|
|
54
|
+
"[&_img]:!m-0": "rtu-52565be3c",
|
|
55
|
+
"[&_img]:!max-h-full": "rtu-9b7f93d32",
|
|
56
|
+
"[&_img]:!max-w-full": "rtu-690df1880",
|
|
57
|
+
"[&_img]:!min-h-0": "rtu-a6c91024c",
|
|
58
|
+
"[&_img]:!min-w-0": "rtu-249d05caa",
|
|
59
|
+
"[&_img]:!object-center": "rtu-c24cf3532",
|
|
60
|
+
"[&_img]:!object-cover": "rtu-5c4ff5239",
|
|
61
|
+
"[&_img]:!p-0": "rtu-45a528345",
|
|
62
|
+
"[&_img]:!rounded-none": "rtu-6b1008ffa",
|
|
63
|
+
"[&_img]:!w-full": "rtu-ce262d06f",
|
|
64
|
+
"[-webkit-overflow-scrolling:touch]": "rtu-66a5833b4",
|
|
65
|
+
absolute: "rtu-da4dbfbc4",
|
|
66
|
+
"align-baseline": "rtu-8d378d3b6",
|
|
67
|
+
"animate-pulse": "rtu-d59b97947",
|
|
68
|
+
"animate-spin": "rtu-afbdd13a3",
|
|
69
|
+
"bg-gray-100": "rtu-d260f3e1b",
|
|
70
|
+
"bg-gray-200": "rtu-fcf159058",
|
|
71
|
+
"bg-white": "rtu-5e10cdb8f",
|
|
72
|
+
block: "rtu-0214b4b35",
|
|
73
|
+
border: "rtu-ca6bcd4b6",
|
|
74
|
+
"border-0": "rtu-119b2aa0b",
|
|
75
|
+
"border-2": "rtu-65935df57",
|
|
76
|
+
"border-b": "rtu-65fdbade2",
|
|
77
|
+
"border-collapse": "rtu-4583f90cd",
|
|
78
|
+
"border-gray-200": "rtu-534158080",
|
|
79
|
+
"border-gray-300": "rtu-5ab1f191a",
|
|
80
|
+
"border-t": "rtu-b950dda29",
|
|
81
|
+
"border-t-gray-700": "rtu-2f99a0daf",
|
|
82
|
+
"box-border": "rtu-7906320e4",
|
|
83
|
+
"cursor-pointer": "rtu-345168367",
|
|
84
|
+
"dark:bg-mint-canvas": "rtu-91530d570",
|
|
85
|
+
"dark:bg-mint-hover": "rtu-f3646e34b",
|
|
86
|
+
"dark:bg-mint-nav": "rtu-ef1a5fba7",
|
|
87
|
+
"dark:bg-white/15": "rtu-2a035a254",
|
|
88
|
+
"dark:border-gray-600": "rtu-17b5ca3ec",
|
|
89
|
+
"dark:border-mint-divider": "rtu-785e12750",
|
|
90
|
+
"dark:border-t-gray-200": "rtu-d1e9bc81b",
|
|
91
|
+
"dark:hover:bg-gray-800": "rtu-c211aa745",
|
|
92
|
+
"dark:hover:bg-mint-elevated": "rtu-e02bea78e",
|
|
93
|
+
"dark:text-gray-400": "rtu-cd05fca6d",
|
|
94
|
+
"dark:text-gray-500": "rtu-cae7d218d",
|
|
95
|
+
"dark:text-gray-600": "rtu-916f092fc",
|
|
96
|
+
"dark:text-red-400": "rtu-150dc4530",
|
|
97
|
+
"dark:text-white": "rtu-889e4e871",
|
|
98
|
+
fixed: "rtu-7bc555991",
|
|
99
|
+
flex: "rtu-60fbb7713",
|
|
100
|
+
"flex-1": "rtu-36e579c0b",
|
|
101
|
+
"flex-col": "rtu-8dddea077",
|
|
102
|
+
"flex-nowrap": "rtu-51ecff099",
|
|
103
|
+
"font-normal": "rtu-8ecebc9f8",
|
|
104
|
+
"font-semibold": "rtu-e83a7042b",
|
|
105
|
+
"gap-0.5": "rtu-a3899220f",
|
|
106
|
+
"gap-1": "rtu-44ee8ba0a",
|
|
107
|
+
"gap-2": "rtu-77a2a20e9",
|
|
108
|
+
"gap-3": "rtu-1004c0c39",
|
|
109
|
+
"h-3": "rtu-6a60c09e6",
|
|
110
|
+
"h-4": "rtu-11e59c6d5",
|
|
111
|
+
"h-full": "rtu-668b21aa5",
|
|
112
|
+
hidden: "rtu-99d72c7fc",
|
|
113
|
+
"hover:bg-gray-50": "rtu-6c0fe2c8e",
|
|
114
|
+
"inline-block": "rtu-bb0c4bfc5",
|
|
115
|
+
"inline-flex": "rtu-52083e7da",
|
|
116
|
+
"items-center": "rtu-3960ffc24",
|
|
117
|
+
"items-start": "rtu-60541e1e2",
|
|
118
|
+
"items-stretch": "rtu-a13d486c1",
|
|
119
|
+
"justify-between": "rtu-8ef2268ef",
|
|
120
|
+
"justify-center": "rtu-86843cf1e",
|
|
121
|
+
"justify-end": "rtu-77c08e015",
|
|
122
|
+
"leading-snug": "rtu-e25ca6535",
|
|
123
|
+
"left-3": "rtu-22e59b722",
|
|
124
|
+
"list-none": "rtu-b20d79b23",
|
|
125
|
+
"m-0": "rtu-74f9876a6",
|
|
126
|
+
"max-w-[95%]": "rtu-80fa57ccf",
|
|
127
|
+
"max-w-none": "rtu-2191c1456",
|
|
128
|
+
"max-w-xs": "rtu-3acf64d53",
|
|
129
|
+
"mb-3": "rtu-1bb883263",
|
|
130
|
+
"md:block": "rtu-9d60be3a6",
|
|
131
|
+
"md:border-t-0": "rtu-f6099fc6b",
|
|
132
|
+
"md:flex": "rtu-7651aeb99",
|
|
133
|
+
"md:hidden": "rtu-e477a6af4",
|
|
134
|
+
"md:justify-end": "rtu-70ce0294b",
|
|
135
|
+
"md:mt-4": "rtu-ef9aeb563",
|
|
136
|
+
"md:pt-0": "rtu-30dec114f",
|
|
137
|
+
"md:py-0": "rtu-3957f1b8e",
|
|
138
|
+
"min-h-0": "rtu-fb7302e53",
|
|
139
|
+
"min-w-0": "rtu-7e0b7cdf1",
|
|
140
|
+
"min-w-[11rem]": "rtu-46b2fd2eb",
|
|
141
|
+
"ml-2": "rtu-c68af9986",
|
|
142
|
+
"mr-0": "rtu-719fceda9",
|
|
143
|
+
"mr-2": "rtu-d2347e849",
|
|
144
|
+
"overflow-hidden": "rtu-2cd02d11d",
|
|
145
|
+
"overflow-x-auto": "rtu-1384f66f4",
|
|
146
|
+
"overflow-x-hidden": "rtu-e271e6ae1",
|
|
147
|
+
"overflow-y-auto": "rtu-92bf82f49",
|
|
148
|
+
"overflow-y-hidden": "rtu-b70fd23f6",
|
|
149
|
+
"overscroll-x-contain": "rtu-63ccdaaca",
|
|
150
|
+
"p-0": "rtu-8a539c7fe",
|
|
151
|
+
"p-1": "rtu-eb6a3cef9",
|
|
152
|
+
"p-3.5": "rtu-56796a90b",
|
|
153
|
+
"p-4": "rtu-8e63407b5",
|
|
154
|
+
"pb-3.5": "rtu-2d1f72154",
|
|
155
|
+
"pl-0": "rtu-d569803f7",
|
|
156
|
+
"pointer-events-none": "rtu-a4326536b",
|
|
157
|
+
"pr-4": "rtu-ba64a7c03",
|
|
158
|
+
"pt-3": "rtu-ce335a8e4",
|
|
159
|
+
"px-1": "rtu-d8e0e382c",
|
|
160
|
+
"px-2": "rtu-d5eab218a",
|
|
161
|
+
"px-3.5": "rtu-e0d9cc7f0",
|
|
162
|
+
"px-4": "rtu-f0faeb26d",
|
|
163
|
+
"py-0.5": "rtu-465609a24",
|
|
164
|
+
"py-2": "rtu-03b4dd7f1",
|
|
165
|
+
"py-3": "rtu-1b2d54a3f",
|
|
166
|
+
"py-3.5": "rtu-69e76918f",
|
|
167
|
+
"py-8": "rtu-a1f611f02",
|
|
168
|
+
rounded: "rtu-07389a777",
|
|
169
|
+
"rounded-full": "rtu-ac204c108",
|
|
170
|
+
"rounded-md": "rtu-421ac2be5",
|
|
171
|
+
"rounded-t-none": "rtu-79ee0e356",
|
|
172
|
+
"shrink-0": "rtu-012fbd121",
|
|
173
|
+
sticky: "rtu-3e0fd166d",
|
|
174
|
+
table: "rtu-c3ee137d4",
|
|
175
|
+
"table-fixed": "rtu-604d60250",
|
|
176
|
+
"text-center": "rtu-ca6bf6303",
|
|
177
|
+
"text-gray-300": "rtu-5ed47f375",
|
|
178
|
+
"text-gray-400": "rtu-a572cdde6",
|
|
179
|
+
"text-gray-500": "rtu-5a630e0cf",
|
|
180
|
+
"text-gray-900": "rtu-ba48f7479",
|
|
181
|
+
"text-left": "rtu-2eba0d65d",
|
|
182
|
+
"text-red-500": "rtu-e3f51cc69",
|
|
183
|
+
"text-sm": "rtu-fc7473ca0",
|
|
184
|
+
"text-xs": "rtu-359090c2d",
|
|
185
|
+
"top-0": "rtu-2167406b2",
|
|
186
|
+
"top-1/2": "rtu-d694ba66e",
|
|
187
|
+
truncate: "rtu-f283ea9be",
|
|
188
|
+
"w-4": "rtu-dc7972ebf",
|
|
189
|
+
"w-40": "rtu-84789e8a2",
|
|
190
|
+
"w-full": "rtu-6da6a3c3f",
|
|
191
|
+
"w-max": "rtu-2f935d2ee",
|
|
192
|
+
"z-10": "rtu-236812d64",
|
|
193
|
+
"z-20": "rtu-145745bf5",
|
|
194
|
+
"z-30": "rtu-0f2fff0ae"
|
|
195
|
+
}, n = class extends HTMLElement {
|
|
196
|
+
static get observedAttributes() {
|
|
197
|
+
return [
|
|
198
|
+
"configuration",
|
|
199
|
+
"loading",
|
|
200
|
+
"virtual-scroll",
|
|
201
|
+
"virtual-scroll-root",
|
|
202
|
+
"virtual-row-height",
|
|
203
|
+
"virtual-max-height",
|
|
204
|
+
"fixed-header",
|
|
205
|
+
"fixed-controls"
|
|
206
|
+
];
|
|
207
|
+
}
|
|
208
|
+
_isExternalLoading() {
|
|
209
|
+
let e = this.getAttribute("loading");
|
|
210
|
+
return e !== null && e !== "false";
|
|
211
|
+
}
|
|
212
|
+
constructor() {
|
|
213
|
+
super(), this._configuration = null, this._rows = [], this._search = "", this._currentPage = 1, this._perPage = 15, this._totalRows = 0, this._lastPage = 0, this._offset = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._loadingPage = null, this._fetchError = null, this._searching = !1, this._sorting = !1, this._sortingColumn = null, this._type = "provided", this._searchTimeoutId = null, this._sortTimeoutId = null, this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._tableId = "", this._searchInput = null, this._tableContainer = null, this._paginationContainer = null, this._skeletonContainer = null, this._inMintCard = !1, this._virtualBodyScrollEl = null, this._virtualScrollHandler = null, this._virtualWindowRaf = null, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualResizeObserver = null, this._virtualWindowResizeHandler = null, this._virtualRowCache = /* @__PURE__ */ new Map(), this._virtualRangeFetching = !1, this._mobileListMql = null, this._boundMobileListMqlListener = null, this._virtualFetchGeneration = 0, this._virtualAjaxPrefetchTimer = null, this._fixedChromeResizeObserver = null, this._utilityClassObserver = null;
|
|
214
|
+
}
|
|
215
|
+
get inMintCard() {
|
|
216
|
+
return this._inMintCard;
|
|
217
|
+
}
|
|
218
|
+
get configuration() {
|
|
219
|
+
return this._configuration;
|
|
220
|
+
}
|
|
221
|
+
set configuration(e) {
|
|
222
|
+
e && typeof e == "object" && !Array.isArray(e) ? (this._configuration = e, this._tableId = this._configuration.id || `mint-resource-table-${Date.now()}`, this._perPage = this._configuration.perPage || 15, this._type = typeof this._configuration.data == "string" ? "ajax" : "provided", this._loaded = !1, this._currentPage = 1, this._offset = 0, this._type === "provided" && Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._configuration.data.length), this._initializeColumns(), this.isConnected && this.render()) : e == null ? this._configuration = null : this._parseConfiguration();
|
|
223
|
+
}
|
|
224
|
+
connectedCallback() {
|
|
225
|
+
this.classList.add("box-border", "m-0", "p-0", "border-0", "align-baseline", "block", "w-full"), this._utilityClassObserver = new MutationObserver(() => this._replaceUtilityClasses()), this._utilityClassObserver.observe(this, {
|
|
226
|
+
attributes: !0,
|
|
227
|
+
attributeFilter: ["class"],
|
|
228
|
+
childList: !0,
|
|
229
|
+
subtree: !0
|
|
230
|
+
}), this._inMintCard = this.parentElement?.tagName?.toLowerCase() === "mint-card", this._configuration || this._parseConfiguration(), this._initializeColumns(), this._loadPageFromUrl(), this._attachRowClickHandler(), this.render();
|
|
231
|
+
}
|
|
232
|
+
disconnectedCallback() {
|
|
233
|
+
this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._detachMobileListMql(), this._utilityClassObserver?.disconnect(), this._utilityClassObserver = null, this._rowClickHandler &&= (this.removeEventListener("click", this._rowClickHandler, !0), null), this._scrollHandler &&= (window.removeEventListener("scroll", this._scrollHandler), null);
|
|
234
|
+
}
|
|
235
|
+
attributeChangedCallback(e, t, n) {
|
|
236
|
+
e === "configuration" && t !== n ? (!this._configuration || typeof n == "string") && (this._parseConfiguration(), this.render()) : t !== n && (e === "loading" || e === "virtual-scroll" || e === "virtual-scroll-root" || e === "virtual-row-height" || e === "virtual-max-height" || e === "fixed-header" || e === "fixed-controls") && this._configuration && this.isConnected && this.render();
|
|
237
|
+
}
|
|
238
|
+
refresh() {
|
|
239
|
+
this._configuration && (this._type === "ajax" ? this._fetchData(void 0, !0, this._perPage, this._offset) : (Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._rows.length), this.render()));
|
|
240
|
+
}
|
|
241
|
+
setData(e) {
|
|
242
|
+
if (this._configuration) {
|
|
243
|
+
if (this._configuration.data = e, this._type = typeof e == "string" ? "ajax" : "provided", this._currentPage = 1, this._offset = 0, this._fetchError = null, this._searching = !1, this._loadingPage = null, this._sortTimeoutId &&= (clearTimeout(this._sortTimeoutId), null), this._searchTimeoutId &&= (clearTimeout(this._searchTimeoutId), null), this._virtualScrollActive() && (this._virtualRowCache.clear(), this._virtualInvalidate()), this._type === "ajax") {
|
|
244
|
+
this._rows = [], this._totalRows = 0, this._lastPage = 0, this._loaded = !1, this._fetching = !1, this._loading = !1, this._fetchData(void 0, !0, this._perPage, 0);
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
this._rows = Array.isArray(e) ? [...e] : [], this._totalRows = this._rows.length, this._lastPage = Math.max(1, Math.ceil(this._totalRows / this._perPage)), this._loaded = !0, this._fetching = !1, this._loading = !1, this.render();
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
_parseConfiguration() {
|
|
251
|
+
let e = this.getAttribute("configuration");
|
|
252
|
+
if (!e) {
|
|
253
|
+
console.error("mint-resource-table: configuration attribute is required");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
try {
|
|
257
|
+
this._configuration = JSON.parse(e), this._tableId = this._configuration.id || `mint-resource-table-${Date.now()}`, this._perPage = this._configuration.perPage || 15, this._type = typeof this._configuration.data == "string" ? "ajax" : "provided", this._loaded = !1, this._currentPage = this._getPageFromUrl() || 1, this._offset = (this._currentPage - 1) * this._perPage, this._type === "provided" && Array.isArray(this._configuration.data) && (this._rows = [...this._configuration.data], this._totalRows = this._configuration.data.length), this._initializeColumns();
|
|
258
|
+
} catch (e) {
|
|
259
|
+
console.error("mint-resource-table: Invalid configuration JSON", e);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
_initializeColumns() {
|
|
263
|
+
this._configuration && (this._searchColumns = [], this._exportColumns = {}, this._columns = [], this._configuration.columns.forEach((e) => {
|
|
264
|
+
e.searchable && e.data && this._searchColumns.push(e.data), e.export && e.data && (this._exportColumns[e.data] = e.label), e.data && this._columns.push(e.data);
|
|
265
|
+
}), this._configuration.sortBy || (this._configuration.sortBy = "id"), this._configuration.sort || (this._configuration.sort = "asc"));
|
|
266
|
+
}
|
|
267
|
+
async _fetchData(e, t = !0, n, r) {
|
|
268
|
+
if (!this._configuration) return;
|
|
269
|
+
let i = e || (typeof this._configuration.data == "string" ? this._configuration.data : null);
|
|
270
|
+
if (!i || this._fetching || this._loading) return;
|
|
271
|
+
t && (this._fetching = !0, this._loaded ? this._updatePagination() : this.render()), this._loading = !0;
|
|
272
|
+
let a = n || this._perPage, o = r === void 0 ? this._offset : r;
|
|
273
|
+
this._virtualScrollActive() && this._type === "ajax" && o === 0 && (this._virtualFetchGeneration++, this._virtualRowCache.clear(), this._virtualInvalidate());
|
|
274
|
+
try {
|
|
275
|
+
let e = new URLSearchParams({
|
|
276
|
+
perPage: a.toString(),
|
|
277
|
+
offset: o.toString(),
|
|
278
|
+
search: this._search,
|
|
279
|
+
sortBy: this._configuration.sortBy || "id",
|
|
280
|
+
sort: this._configuration.sort || "asc",
|
|
281
|
+
searchColumns: this._searchColumns.join(","),
|
|
282
|
+
columns: this._columns.join(",")
|
|
283
|
+
}), t = {};
|
|
284
|
+
this._configuration.headers && (t.headers = this._configuration.headers);
|
|
285
|
+
let n = await fetch(`${i}?${e.toString()}`, t);
|
|
286
|
+
if (!n.ok) throw Error(`HTTP error! status: ${n.status}`);
|
|
287
|
+
let r = await n.json(), s = r.content?.rows || [], c = r.content?.total || 0, l = s;
|
|
288
|
+
this._configuration.predefinedData ? (l = [...this._configuration.predefinedData, ...s], this._totalRows = c + this._configuration.predefinedData.length) : this._totalRows = c, this._rows = l;
|
|
289
|
+
let u = Math.floor(o / a) + 1;
|
|
290
|
+
r.content?.current_page !== void 0 && r.content.current_page === u ? this._currentPage = r.content.current_page : this._currentPage = u, this._offset = (this._currentPage - 1) * a, this._lastPage = r.content?.last_page || 1, this._fetching = !1, this._loaded = !0, this._loading = !1, this._fetchError = null, this._searching = !1;
|
|
291
|
+
let d = this._sorting;
|
|
292
|
+
d && this._updateSortIcons(), this._sorting = !1, this._sortingColumn = null, d && this._updateSortIcons(), this.dispatchEvent(new CustomEvent("loaded", { detail: { rows: this._rows } })), this._updateSearchIcon();
|
|
293
|
+
let f = `tbody[data-mint-rt-tbody="${this._tableId}"]`, p = !!this.querySelector(f);
|
|
294
|
+
if (this._virtualScrollActive() && this._type === "ajax") p || this.render(), s.forEach((e, t) => {
|
|
295
|
+
this._virtualRowCache.set(o + t, e);
|
|
296
|
+
}), this._virtualInvalidate(), o === 0 ? queueMicrotask(() => this._scrollVirtualTableTopIntoView()) : this._scheduleVirtualWindowSync(), this._loadingPage, this._loadingPage = null, this._updatePagination(), setTimeout(() => {
|
|
297
|
+
let e = this._paginationMountedRoot();
|
|
298
|
+
e && e.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
|
|
299
|
+
"render" in e && typeof e.render == "function" && e.render();
|
|
300
|
+
});
|
|
301
|
+
}, 0);
|
|
302
|
+
else if (this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody")) {
|
|
303
|
+
if (d) {
|
|
304
|
+
let e = this._loading, t = this._fetching;
|
|
305
|
+
this._loading = !1, this._fetching = !1, this._updateTableBody(), this._loading = e, this._fetching = t;
|
|
306
|
+
} else this._updateTableBody();
|
|
307
|
+
this._loadingPage, this._loadingPage = null, this._updatePagination(), setTimeout(() => {
|
|
308
|
+
let e = this._paginationMountedRoot();
|
|
309
|
+
e && e.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
|
|
310
|
+
"render" in e && typeof e.render == "function" && e.render();
|
|
311
|
+
});
|
|
312
|
+
}, 0);
|
|
313
|
+
} else this.render();
|
|
314
|
+
} catch (e) {
|
|
315
|
+
this._fetching = !1, this._loading = !1, this._loadingPage = null, this._loaded = !0, this._searching = !1, this._fetchError = e instanceof Error ? e.message : "Failed to fetch data", console.error("mint-resource-table: Error fetching data", e), this._updateSearchIcon(), this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody") ? (this._updateTableBody(), this._loadingPage = null, this._updatePagination()) : this.render();
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
_getRows() {
|
|
319
|
+
if (!this._configuration) return [];
|
|
320
|
+
if (this._type === "ajax") return this._rows;
|
|
321
|
+
let e = [...this._rows], t = this._configuration.sortBy || "id", n = this._configuration.sort || "asc";
|
|
322
|
+
if (this._search) {
|
|
323
|
+
let t = this._search.toLowerCase().trim().split(/\s+/);
|
|
324
|
+
e = e.filter((e) => {
|
|
325
|
+
let n = Object.values(e).map((e) => String(e).toLowerCase()).join(" ");
|
|
326
|
+
return t.every((e) => n.includes(e));
|
|
327
|
+
});
|
|
328
|
+
}
|
|
329
|
+
if (e.sort((e, r) => {
|
|
330
|
+
let i = e[t], a = r[t];
|
|
331
|
+
if (i == null && a == null) return 0;
|
|
332
|
+
if (i == null) return 1;
|
|
333
|
+
if (a == null) return -1;
|
|
334
|
+
let o = typeof i == "number" ? i : typeof i == "string" && !isNaN(Number(i)) && i.trim() !== "" ? Number(i) : null, s = typeof a == "number" ? a : typeof a == "string" && !isNaN(Number(a)) && a.trim() !== "" ? Number(a) : null;
|
|
335
|
+
if (o !== null && s !== null) {
|
|
336
|
+
let e = o - s;
|
|
337
|
+
return n === "asc" ? e : -e;
|
|
338
|
+
}
|
|
339
|
+
let c = i instanceof Date ? i : typeof i == "string" ? new Date(i) : null, l = a instanceof Date ? a : typeof a == "string" ? new Date(a) : null;
|
|
340
|
+
if (c && l && !isNaN(c.getTime()) && !isNaN(l.getTime())) {
|
|
341
|
+
let e = c.getTime() - l.getTime();
|
|
342
|
+
return n === "asc" ? e : -e;
|
|
343
|
+
}
|
|
344
|
+
let u = String(i).localeCompare(String(a), void 0, {
|
|
345
|
+
numeric: !0,
|
|
346
|
+
sensitivity: "base"
|
|
347
|
+
});
|
|
348
|
+
return n === "asc" ? u : -u;
|
|
349
|
+
}), this._perPage) {
|
|
350
|
+
let t = Math.ceil(e.length / this._perPage);
|
|
351
|
+
this._lastPage = t, e.forEach((e, t) => {
|
|
352
|
+
e.page = Math.ceil((t + 1) / this._perPage);
|
|
353
|
+
}), this._currentPage > t && t > 0 && (this._currentPage = t);
|
|
354
|
+
}
|
|
355
|
+
return e.filter((e) => !this._perPage || e.page === this._currentPage);
|
|
356
|
+
}
|
|
357
|
+
_getAllFilteredRowsSorted() {
|
|
358
|
+
if (!this._configuration || this._type !== "provided") return [];
|
|
359
|
+
let e = [...this._rows], t = this._configuration.sortBy || "id", n = this._configuration.sort || "asc";
|
|
360
|
+
if (this._search) {
|
|
361
|
+
let t = this._search.toLowerCase().trim().split(/\s+/);
|
|
362
|
+
e = e.filter((e) => {
|
|
363
|
+
let n = Object.values(e).map((e) => String(e).toLowerCase()).join(" ");
|
|
364
|
+
return t.every((e) => n.includes(e));
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
return e.sort((e, r) => {
|
|
368
|
+
let i = e[t], a = r[t];
|
|
369
|
+
if (i == null && a == null) return 0;
|
|
370
|
+
if (i == null) return 1;
|
|
371
|
+
if (a == null) return -1;
|
|
372
|
+
let o = typeof i == "number" ? i : typeof i == "string" && !isNaN(Number(i)) && i.trim() !== "" ? Number(i) : null, s = typeof a == "number" ? a : typeof a == "string" && !isNaN(Number(a)) && a.trim() !== "" ? Number(a) : null;
|
|
373
|
+
if (o !== null && s !== null) {
|
|
374
|
+
let e = o - s;
|
|
375
|
+
return n === "asc" ? e : -e;
|
|
376
|
+
}
|
|
377
|
+
let c = i instanceof Date ? i : typeof i == "string" ? new Date(i) : null, l = a instanceof Date ? a : typeof a == "string" ? new Date(a) : null;
|
|
378
|
+
if (c && l && !isNaN(c.getTime()) && !isNaN(l.getTime())) {
|
|
379
|
+
let e = c.getTime() - l.getTime();
|
|
380
|
+
return n === "asc" ? e : -e;
|
|
381
|
+
}
|
|
382
|
+
let u = String(i).localeCompare(String(a), void 0, {
|
|
383
|
+
numeric: !0,
|
|
384
|
+
sensitivity: "base"
|
|
385
|
+
});
|
|
386
|
+
return n === "asc" ? u : -u;
|
|
387
|
+
}), e;
|
|
388
|
+
}
|
|
389
|
+
_virtualInvalidate() {
|
|
390
|
+
this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "";
|
|
391
|
+
}
|
|
392
|
+
_getRowDataForEventIndex(e) {
|
|
393
|
+
if (this._configuration) {
|
|
394
|
+
if (!this._virtualScrollActive()) return this._getRows()[e];
|
|
395
|
+
if (this._type === "provided") return this._getAllFilteredRowsSorted()[e];
|
|
396
|
+
if (this._type === "ajax") return this._virtualRowCache.get(e);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
getRowByIndex(e) {
|
|
400
|
+
return this._getRowDataForEventIndex(e);
|
|
401
|
+
}
|
|
402
|
+
_virtualScrollActive() {
|
|
403
|
+
return this._configuration ? (this.getAttribute("virtual-scroll") || "").toLowerCase().trim() === "true" : !1;
|
|
404
|
+
}
|
|
405
|
+
_virtualScrollRoot() {
|
|
406
|
+
let e = (this.getAttribute("virtual-scroll-root") || "").toLowerCase().trim();
|
|
407
|
+
return e === "table-body" || e === "body" || this._configuration?.virtualScrollRoot === "table-body" ? "table-body" : "document";
|
|
408
|
+
}
|
|
409
|
+
_virtualBodyScrollDisablesDocumentFixedChrome() {
|
|
410
|
+
return this._virtualScrollActive() && this._virtualScrollRoot() === "table-body";
|
|
411
|
+
}
|
|
412
|
+
_fixedHeader() {
|
|
413
|
+
if (this._virtualBodyScrollDisablesDocumentFixedChrome() || !this.hasAttribute("fixed-header")) return !1;
|
|
414
|
+
let e = (this.getAttribute("fixed-header") || "").toLowerCase().trim();
|
|
415
|
+
return e !== "false" && e !== "0";
|
|
416
|
+
}
|
|
417
|
+
_fixedControls() {
|
|
418
|
+
if (this._virtualBodyScrollDisablesDocumentFixedChrome() || !this.hasAttribute("fixed-controls")) return !1;
|
|
419
|
+
let e = (this.getAttribute("fixed-controls") || "").toLowerCase().trim();
|
|
420
|
+
return e !== "false" && e !== "0";
|
|
421
|
+
}
|
|
422
|
+
_virtualRowHeightPx() {
|
|
423
|
+
let e = parseInt(this.getAttribute("virtual-row-height") || "", 10);
|
|
424
|
+
if (!isNaN(e) && e > 0) return e;
|
|
425
|
+
let t = this._configuration?.virtualRowHeight;
|
|
426
|
+
return typeof t == "number" && t > 0 ? t : 48;
|
|
427
|
+
}
|
|
428
|
+
_virtualRowHeightPxForSync(e) {
|
|
429
|
+
let t = this._virtualRowHeightPx();
|
|
430
|
+
if (!this._configuration) return t;
|
|
431
|
+
if (e) {
|
|
432
|
+
let e = this._mobileThumbnailColumn();
|
|
433
|
+
if (e) {
|
|
434
|
+
let n = this._thumbnailMobilePx(e);
|
|
435
|
+
return Math.max(t, n + 36);
|
|
436
|
+
}
|
|
437
|
+
return Math.max(t, 80);
|
|
438
|
+
}
|
|
439
|
+
let n = this._mobileThumbnailColumn();
|
|
440
|
+
if (n) {
|
|
441
|
+
let e = this._thumbnailDesktopPx(n);
|
|
442
|
+
return Math.max(t, e + 28);
|
|
443
|
+
}
|
|
444
|
+
return t;
|
|
445
|
+
}
|
|
446
|
+
_virtualMaxHeightCss() {
|
|
447
|
+
let e = this.getAttribute("virtual-max-height");
|
|
448
|
+
if (e && e.trim()) return e.trim();
|
|
449
|
+
let t = this._configuration?.virtualMaxHeight;
|
|
450
|
+
return t && String(t).trim() ? String(t).trim() : "min(70dvh, 28rem)";
|
|
451
|
+
}
|
|
452
|
+
_virtualColspan() {
|
|
453
|
+
return this._configuration ? Math.max(1, this._configuration.columns.filter((e) => !e.hidden).length) : 1;
|
|
454
|
+
}
|
|
455
|
+
_ensureMobileListMql() {
|
|
456
|
+
typeof window > "u" || !window.matchMedia || this._mobileListMql || (this._mobileListMql = window.matchMedia("(max-width: 767px)"), this._boundMobileListMqlListener = () => {
|
|
457
|
+
this._configuration && this.isConnected && this.render();
|
|
458
|
+
}, this._mobileListMql.addEventListener("change", this._boundMobileListMqlListener));
|
|
459
|
+
}
|
|
460
|
+
_detachMobileListMql() {
|
|
461
|
+
this._mobileListMql && this._boundMobileListMqlListener && this._mobileListMql.removeEventListener("change", this._boundMobileListMqlListener), this._mobileListMql = null, this._boundMobileListMqlListener = null;
|
|
462
|
+
}
|
|
463
|
+
_useMobileListLayout() {
|
|
464
|
+
return !!this._mobileListMql?.matches;
|
|
465
|
+
}
|
|
466
|
+
_paginationHostPlaceholderHtml() {
|
|
467
|
+
if (!this._configuration?.perPage || this._virtualScrollActive()) return "";
|
|
468
|
+
let e = this._lastPage || Math.ceil(this._rows.length / this._perPage);
|
|
469
|
+
if ((this._lastPage > 0 ? this._lastPage : e) <= 1) return "";
|
|
470
|
+
let t = [
|
|
471
|
+
"mint-rt-pagination-host",
|
|
472
|
+
"w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain",
|
|
473
|
+
"flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end",
|
|
474
|
+
this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"
|
|
475
|
+
].join(" ");
|
|
476
|
+
return `<div id="mint-rt-pagination-host-${this._tableId}" data-mint-rt-pagination-wrap="" class="${t}"></div>`;
|
|
477
|
+
}
|
|
478
|
+
_getPaginationHostEl() {
|
|
479
|
+
return this.querySelector(`#mint-rt-pagination-host-${this._tableId}`);
|
|
480
|
+
}
|
|
481
|
+
_paginationMountedRoot() {
|
|
482
|
+
return this._getPaginationHostEl() || this.querySelector("nav[data-mint-rt-pagination-nav]")?.parentElement || this.querySelector("nav")?.closest(".flex.justify-end");
|
|
483
|
+
}
|
|
484
|
+
_paginationPageButtonLi(e) {
|
|
485
|
+
let t = this._currentPage === e, n = this._loadingPage === e;
|
|
486
|
+
return `<li class="shrink-0"><mint-button variant="solid" size="sm"${t ? " active=\"true\"" : ""}${this._loading || this._fetching ? " disabled=\"true\"" : ""}${n ? " loading=\"true\"" : ""} data-action="page" data-page="${e}">${n ? "" : `${e}`}</mint-button></li>`;
|
|
487
|
+
}
|
|
488
|
+
_paginationHtmlCompactMiddle(e) {
|
|
489
|
+
let t = "", n = this._currentPage;
|
|
490
|
+
if (e <= 5) {
|
|
491
|
+
for (let n = 1; n <= e; n++) t += this._paginationPageButtonLi(n);
|
|
492
|
+
return t;
|
|
493
|
+
}
|
|
494
|
+
let r = [...new Set([
|
|
495
|
+
1,
|
|
496
|
+
e,
|
|
497
|
+
n - 1,
|
|
498
|
+
n,
|
|
499
|
+
n + 1
|
|
500
|
+
].map((t) => Math.min(e, Math.max(1, t))))].sort((e, t) => e - t), i = 0;
|
|
501
|
+
for (let e of r) i > 0 && e - i > 1 && (t += "<li class=\"shrink-0\"><span class=\"px-1 text-gray-500 dark:text-gray-400\" aria-hidden=\"true\">…</span></li>"), t += this._paginationPageButtonLi(e), i = e;
|
|
502
|
+
return t;
|
|
503
|
+
}
|
|
504
|
+
_paginationHtmlDesktopMiddle(e) {
|
|
505
|
+
let t = "", n = e >= 10, r = Math.max(1, this._currentPage - 1), i = Math.min(e, this._currentPage + 1);
|
|
506
|
+
if (n) {
|
|
507
|
+
for (let e = 1; e <= 3; e++) t += this._paginationPageButtonLi(e);
|
|
508
|
+
let n = i <= 3, a = r >= e - 2;
|
|
509
|
+
if (!n && !a) {
|
|
510
|
+
r > 4 && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
|
|
511
|
+
for (let e = r; e <= i; e++) e <= 3 || (t += this._paginationPageButtonLi(e));
|
|
512
|
+
i < e - 3 && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
|
|
513
|
+
} else (n && !a || !n && a && e - 2 > 4) && (t += "<li class=\"shrink-0\"><span class=\"px-2\">...</span></li>");
|
|
514
|
+
for (let o = e - 2; o <= e; o++) o <= 3 || !n && !a && o >= r && o <= i || (t += this._paginationPageButtonLi(o));
|
|
515
|
+
} else for (let n = 1; n <= e; n++) t += this._paginationPageButtonLi(n);
|
|
516
|
+
return t;
|
|
517
|
+
}
|
|
518
|
+
_buildPaginationNavMarkup(e) {
|
|
519
|
+
let t = this._currentPage === 1 || this._loading || this._fetching, n = "<nav data-mint-rt-pagination-nav=\"\" class=\"w-max max-w-none shrink-0\" aria-label=\"Pagination\">";
|
|
520
|
+
n += "<ul class=\"flex flex-nowrap items-center gap-1\">", n += `<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-left" ${t ? "disabled=\"true\"" : ""} data-action="page-prev"></mint-button></li>`, n += this._useMobileListLayout() ? this._paginationHtmlCompactMiddle(e) : this._paginationHtmlDesktopMiddle(e);
|
|
521
|
+
let r = this._currentPage >= e || this._loading || this._fetching;
|
|
522
|
+
return n += `<li class="shrink-0"><mint-button variant="solid" size="sm" icon="caret-right" ${r ? "disabled=\"true\"" : ""} data-action="page-next"></mint-button></li>`, n += "</ul></nav>", n;
|
|
523
|
+
}
|
|
524
|
+
_hasSortableColumns() {
|
|
525
|
+
return !!this._configuration?.columns.some((e) => !e.hidden && e.sortable && e.data);
|
|
526
|
+
}
|
|
527
|
+
_getMobileSortTriggerIconName() {
|
|
528
|
+
return "sort-arrows";
|
|
529
|
+
}
|
|
530
|
+
_mobileSortPopoverAffordanceInnerHtml(e) {
|
|
531
|
+
return e === "spinner" ? "<span class=\"inline-block h-4 w-4 shrink-0 animate-spin rounded-full border-2 border-gray-300 border-t-gray-700 dark:border-gray-600 dark:border-t-gray-200\" aria-hidden=\"true\"></span>" : e === "caret-up" || e === "caret-down" ? `<mint-icon name="${e}" class="h-4 w-4 shrink-0 text-gray-500 dark:text-gray-400"></mint-icon>` : "";
|
|
532
|
+
}
|
|
533
|
+
_buildMobileSortPopoverInnerHtml() {
|
|
534
|
+
if (!this._configuration) return "";
|
|
535
|
+
let e = "<div class=\"flex w-full min-w-[11rem] flex-col gap-0.5 p-1\">";
|
|
536
|
+
return this._configuration.columns.forEach((t, n) => {
|
|
537
|
+
if (t.hidden || !t.sortable || !t.data) return;
|
|
538
|
+
let r = t.raw ? t.label : this._escapeHtml(t.label), i = this._getSortClass(t), a = this._mobileSortPopoverAffordanceInnerHtml(i), o = ` type="button" variant="ghost" tone="neutral" size="sm" full-width="true" align="left" data-action="mobile-sort" data-column-key="${n}"`;
|
|
539
|
+
e += `<mint-button${o}>`, e += "<span class=\"flex w-full min-w-0 flex-1 items-center justify-between gap-2\">", e += `<span class="min-w-0 flex-1 truncate text-left">${r}</span>`, e += `<span class="inline-flex shrink-0 items-center justify-end" data-mint-rt-mobile-sort-affordance="">${a}</span>`, e += "</span></mint-button>";
|
|
540
|
+
}), e += "</div>", e;
|
|
541
|
+
}
|
|
542
|
+
_syncMobileSortPopoverIcons() {
|
|
543
|
+
if (!this._configuration) return;
|
|
544
|
+
let e = this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);
|
|
545
|
+
e && this._configuration.columns.forEach((t, n) => {
|
|
546
|
+
if (t.hidden || !t.sortable || !t.data) return;
|
|
547
|
+
let r = e.querySelector(`[data-action="mobile-sort"][data-column-key="${n}"]`);
|
|
548
|
+
if (!r || r.tagName !== "MINT-BUTTON") return;
|
|
549
|
+
let i = r.querySelector("[data-mint-rt-mobile-sort-affordance]");
|
|
550
|
+
if (!i) return;
|
|
551
|
+
let a = this._getSortClass(t);
|
|
552
|
+
i.innerHTML = this._mobileSortPopoverAffordanceInnerHtml(a), i.querySelectorAll("mint-icon").forEach((e) => {
|
|
553
|
+
let t = e;
|
|
554
|
+
typeof t.render == "function" && t.render();
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
}
|
|
558
|
+
_closeMobileSortPopover() {
|
|
559
|
+
let e = this.querySelector(`#mint-rt-mobile-sort-popover-${this._tableId}`);
|
|
560
|
+
e && typeof e.close == "function" ? e.close() : e && e.removeAttribute("open");
|
|
561
|
+
}
|
|
562
|
+
_buildMobileSortToolbarHtml() {
|
|
563
|
+
if (!this._hasSortableColumns()) return "";
|
|
564
|
+
let e = `mint-rt-mobile-sort-btn-${this._tableId}`, t = `mint-rt-mobile-sort-popover-${this._tableId}`, n = this._sorting ? " loading=\"true\"" : "", r = ` icon="${this._escapeHtml(this._getMobileSortTriggerIconName())}"`, i = "<div class=\"flex shrink-0 items-center md:hidden\">";
|
|
565
|
+
return i += `<mint-button id="${e}" data-mint-rt-toolbar="mobile-sort" variant="solid" tone="neutral" size="sm"${n}${r}></mint-button>`, i += `<mint-popover id="${t}" trigger-id="${e}" direction="down" padding="0">`, i += this._buildMobileSortPopoverInnerHtml(), i += "</mint-popover></div>", i;
|
|
566
|
+
}
|
|
567
|
+
_stripHtml(e) {
|
|
568
|
+
if (!e) return "";
|
|
569
|
+
let t = document.createElement("div");
|
|
570
|
+
return t.innerHTML = e, (t.textContent || t.innerText || "").replace(/\s+/g, " ").trim();
|
|
571
|
+
}
|
|
572
|
+
_visibleDataColumns() {
|
|
573
|
+
return this._configuration ? this._configuration.columns.filter((e) => !e.hidden) : [];
|
|
574
|
+
}
|
|
575
|
+
_mobileThumbnailColumn() {
|
|
576
|
+
return this._visibleDataColumns().find((e) => e.thumbnail) || null;
|
|
577
|
+
}
|
|
578
|
+
_thumbnailDesktopPx(e) {
|
|
579
|
+
let t = typeof e.thumbnailDesktopPx == "number" && e.thumbnailDesktopPx > 0 ? e.thumbnailDesktopPx : void 0, n = this._configuration, r = n && typeof n.thumbnailDesktopPx == "number" && n.thumbnailDesktopPx > 0 ? n.thumbnailDesktopPx : void 0;
|
|
580
|
+
return Math.round(t ?? r ?? 40);
|
|
581
|
+
}
|
|
582
|
+
_thumbnailMobilePx(e) {
|
|
583
|
+
let t = typeof e.thumbnailMobilePx == "number" && e.thumbnailMobilePx > 0 ? e.thumbnailMobilePx : void 0, n = this._configuration, r = n && typeof n.thumbnailMobilePx == "number" && n.thumbnailMobilePx > 0 ? n.thumbnailMobilePx : void 0;
|
|
584
|
+
return Math.round(t ?? r ?? 56);
|
|
585
|
+
}
|
|
586
|
+
_wrapThumbnailDesktopBox(e, t) {
|
|
587
|
+
let n = this._thumbnailDesktopPx(t);
|
|
588
|
+
return `<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${`width:${n}px;height:${n}px;min-width:${n}px;min-height:${n}px`}">${e}</div>`;
|
|
589
|
+
}
|
|
590
|
+
_mobilePrimaryColumn() {
|
|
591
|
+
let e = this._visibleDataColumns();
|
|
592
|
+
return e.find((e) => e.primary) || e.find((e) => (e.data || typeof e.format == "function") && !e.thumbnail && !e.actions) || e[0] || null;
|
|
593
|
+
}
|
|
594
|
+
_mobileActionsDropdownColumn() {
|
|
595
|
+
return this._visibleDataColumns().find((e) => e.actions && e.actionStyle !== "buttons") || null;
|
|
596
|
+
}
|
|
597
|
+
_columnPlainSummaryText(e, t) {
|
|
598
|
+
if (!(!e.show || e.show(this, t)) || e.actions || e.action) return "";
|
|
599
|
+
try {
|
|
600
|
+
if (e.raw) {
|
|
601
|
+
if (typeof e.format == "function") return this._stripHtml(e.format(this, t));
|
|
602
|
+
if (e.data) return String(t[e.data] ?? "");
|
|
603
|
+
} else {
|
|
604
|
+
if (typeof e.format == "function") return this._stripHtml(e.format(this, t));
|
|
605
|
+
if (e.data) return String(t[e.data] ?? "");
|
|
606
|
+
}
|
|
607
|
+
} catch {
|
|
608
|
+
return "";
|
|
609
|
+
}
|
|
610
|
+
return "";
|
|
611
|
+
}
|
|
612
|
+
_buildTableCellInnerHtml(e, t, n, r = "table") {
|
|
613
|
+
if (!this._configuration) return "";
|
|
614
|
+
let i = n, a = "";
|
|
615
|
+
if (!(!e.show || e.show(this, t))) return "";
|
|
616
|
+
if (e.raw) if (e.action) {
|
|
617
|
+
if (!e.action.show || e.action.show(this, t)) {
|
|
618
|
+
let n = typeof e.action.label == "function" ? e.action.label(this, t) : e.action.label;
|
|
619
|
+
a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${this._escapeHtml(String(n))}</mint-button>`;
|
|
620
|
+
}
|
|
621
|
+
} else if (e.actions) if (e.actionStyle !== "buttons") {
|
|
622
|
+
let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
|
|
623
|
+
a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
|
|
624
|
+
if (!n.show || n.show(this, t)) {
|
|
625
|
+
let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
|
|
626
|
+
a += `<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>${this._escapeHtml(String(o ?? ""))}</mint-button>`;
|
|
627
|
+
}
|
|
628
|
+
}), a += "</div>", a += "</mint-popover>";
|
|
629
|
+
} else e.actions.forEach((n, r) => {
|
|
630
|
+
if (!n.show || n.show(this, t)) {
|
|
631
|
+
let o = n.label ? typeof n.label == "function" ? n.label(this, t) : n.label : "", s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? ` variant="${this._escapeHtml(n.variant)}"` : " variant=\"ghost\"", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
|
|
632
|
+
a += `<mint-button${c} class="${n.classes || ""}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>`, o && (a += this._escapeHtml(String(o))), a += "</mint-button>";
|
|
633
|
+
}
|
|
634
|
+
});
|
|
635
|
+
else typeof e.format == "function" ? a += e.format(this, t) : e.data && (a += this._escapeHtml(String(t[e.data] || "")));
|
|
636
|
+
else if (e.action) (!e.action.show || e.action.show(this, t)) && (a += `<mint-button variant="solid" data-action="column-action" data-row-index="${i}" data-column-key="${this._configuration.columns.indexOf(e)}">${e.action.label}</mint-button>`);
|
|
637
|
+
else if (e.actions) if (e.actionStyle !== "buttons") {
|
|
638
|
+
let n = `actions-popover-${this._tableId}-${i}`, r = `actions-button-${this._tableId}-${i}`;
|
|
639
|
+
a += `<mint-button id="${r}" variant="ghost" icon="ellipsis">`, a += "</mint-button>", a += `<mint-popover id="${n}" trigger-id="${r}" direction="down">`, a += "<div class=\"mint-resource-action-menu\">", e.actions.forEach((n, r) => {
|
|
640
|
+
if (!n.show || n.show(this, t)) {
|
|
641
|
+
let o = typeof n.label == "function" ? n.label(this, t) : n.label, s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? this._escapeHtml(n.variant) : "ghost", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
|
|
642
|
+
a += `<mint-button variant="${c}" full-width="true" align="left" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>${this._escapeHtml(String(o ?? ""))}</mint-button>`;
|
|
643
|
+
}
|
|
644
|
+
}), a += "</div>", a += "</mint-popover>";
|
|
645
|
+
} else e.actions.forEach((n, r) => {
|
|
646
|
+
if (!n.show || n.show(this, t)) {
|
|
647
|
+
let o = n.label ? typeof n.label == "function" ? n.label(this, t) : n.label : "", s = n.icon ? ` icon="${this._escapeHtml(n.icon)}"` : "", c = n.variant ? ` variant="${this._escapeHtml(n.variant)}"` : " variant=\"ghost\"", l = n.tone ? ` tone="${this._escapeHtml(n.tone)}"` : "";
|
|
648
|
+
a += `<mint-button${c} class="${n.classes || ""}" data-action="row-action" data-row-index="${i}" data-action-index="${r}" data-column-key="${this._configuration.columns.indexOf(e)}"${s}${l}>`, o && (a += this._escapeHtml(String(o))), a += "</mint-button>";
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
else typeof e.format == "function" ? a += this._escapeHtml(e.format(this, t)) : e.data && (a += this._escapeHtml(String(t[e.data] || "")));
|
|
652
|
+
return r === "table" && e.thumbnail && a && !e.actions && !e.action ? this._wrapThumbnailDesktopBox(a, e) : a;
|
|
653
|
+
}
|
|
654
|
+
_buildMobileListItemHtml(e, t, n, r = !1) {
|
|
655
|
+
if (!this._configuration) return "";
|
|
656
|
+
let i = t, a = typeof this._configuration.onRowClick == "function", o = this._mobileThumbnailColumn(), s = this._mobilePrimaryColumn(), c = this._mobileActionsDropdownColumn(), l = o ? this._buildTableCellInnerHtml(o, e, i, "mobile") : "", u = s ? this._buildTableCellInnerHtml(s, e, i, "mobile") : "", d = c ? this._buildTableCellInnerHtml(c, e, i, "mobile") : "", f = [], p = this._configuration.mobileShowLabels === !0;
|
|
657
|
+
for (let t of this._configuration.columns) {
|
|
658
|
+
if (t.hidden || o && t === o || s && t === s || c && t === c) continue;
|
|
659
|
+
let n = this._columnPlainSummaryText(t, e);
|
|
660
|
+
if (n) if (p) {
|
|
661
|
+
let e = this._stripHtml(String(t.label || "")).trim();
|
|
662
|
+
e ? f.push(`${this._escapeHtml(e)}: ${this._escapeHtml(n)}`) : f.push(this._escapeHtml(n));
|
|
663
|
+
} else f.push(this._escapeHtml(n));
|
|
664
|
+
}
|
|
665
|
+
let m = f.join("<span class=\"text-gray-300 dark:text-gray-600\" aria-hidden=\"true\"> · </span>"), h = [
|
|
666
|
+
"list-none",
|
|
667
|
+
...r ? [] : [
|
|
668
|
+
"border-b",
|
|
669
|
+
"border-gray-200",
|
|
670
|
+
"dark:border-mint-divider"
|
|
671
|
+
],
|
|
672
|
+
"bg-white",
|
|
673
|
+
"dark:bg-mint-canvas",
|
|
674
|
+
a ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : ""
|
|
675
|
+
].filter(Boolean).join(" "), g = `<div class="flex items-center gap-3 py-3 pr-4${o ? " pl-0" : " pl-4"}">`;
|
|
676
|
+
if (o) {
|
|
677
|
+
let e = this._thumbnailMobilePx(o), t = `width:${e}px;height:${e}px;min-width:${e}px;min-height:${e}px`;
|
|
678
|
+
g += `<div class="flex shrink-0 items-stretch overflow-hidden rounded-md border border-gray-200 bg-gray-100 p-0 dark:border-mint-divider dark:bg-mint-hover [&>*]:m-0 [&>*]:min-h-0 [&>*]:min-w-0 [&>*]:w-full [&>*]:max-w-full [&>*]:p-0 [&>span]:flex [&>span]:h-full [&>span]:w-full [&>span]:min-h-0 [&>span]:min-w-0 [&>span]:items-stretch [&>span]:justify-stretch [&_img]:!m-0 [&_img]:!box-border [&_img]:!block [&_img]:!h-full [&_img]:!w-full [&_img]:!min-h-0 [&_img]:!min-w-0 [&_img]:!max-h-full [&_img]:!max-w-full [&_img]:!border-0 [&_img]:!p-0 [&_img]:!rounded-none [&_img]:!object-cover [&_img]:!object-center" style="${t}">${l}</div>`;
|
|
679
|
+
}
|
|
680
|
+
g += "<div class=\"flex min-w-0 flex-1 flex-col justify-center gap-1\">", g += "<div class=\"flex items-start justify-between gap-2\">", g += `<div class="min-w-0 text-sm font-semibold leading-snug text-gray-900 dark:text-white">${u}</div>`, d && (g += `<div class="shrink-0 -mr-1">${d}</div>`), g += "</div>", m && (g += `<div class="text-xs font-normal leading-snug text-gray-500 dark:text-gray-400">${m}</div>`), g += "</div></div>";
|
|
681
|
+
let _ = typeof n == "number" && n > 0 ? ` style="box-sizing:border-box;min-height:${n}px;max-height:${n}px;height:${n}px;overflow:hidden"` : "";
|
|
682
|
+
return `<li data-row-index="${i}" ${a ? "data-row-clickable=\"true\" " : ""}class="${h}"${_}>${g}</li>`;
|
|
683
|
+
}
|
|
684
|
+
_buildMobileListPlaceholderLi(e, t, n = !1) {
|
|
685
|
+
let r = this._mobileThumbnailColumn(), i = r ? this._thumbnailMobilePx(r) : 56, a = `width:${i}px;height:${i}px;min-width:${i}px;min-height:${i}px`;
|
|
686
|
+
return `<li data-row-index="${e}" data-mint-rt-placeholder="true" class="list-none${n ? "" : " border-b border-gray-200 dark:border-mint-divider"} bg-white dark:bg-mint-canvas" style="box-sizing:border-box;min-height:${t}px;max-height:${t}px;height:${t}px;overflow:hidden"><div class="flex h-full min-h-0 items-center gap-3 py-3 pl-0 pr-4"><div class="shrink-0 overflow-hidden rounded-md bg-gray-200 dark:bg-white/15" style="${a}"></div><div class="flex min-h-0 min-w-0 flex-1 flex-col justify-center gap-1 py-0.5"><div class="h-4 w-40 rounded bg-gray-200 dark:bg-white/15"></div><div class="h-3 w-full max-w-xs rounded bg-gray-200 dark:bg-white/15"></div></div></div></li>`;
|
|
687
|
+
}
|
|
688
|
+
_renderColgroupHtml() {
|
|
689
|
+
if (!this._configuration) return "";
|
|
690
|
+
let e = this._configuration.columns.filter((e) => !e.hidden), t = [], n = 0;
|
|
691
|
+
for (let r of e) {
|
|
692
|
+
let e = r.width == null ? "" : String(r.width).trim();
|
|
693
|
+
e ? /^\d+(\.\d+)?$/.test(e) ? (n += parseFloat(e), t.push("px")) : t.push("lit") : t.push("flex");
|
|
694
|
+
}
|
|
695
|
+
let r = t.filter((e) => e === "flex").length, i = t.includes("lit"), a = "";
|
|
696
|
+
r > 0 && !i && (a = n > 0 ? `width:calc((100% - ${n}px) / ${r});min-width:0` : `width:${100 / r}%;min-width:0`);
|
|
697
|
+
let o = "<colgroup>";
|
|
698
|
+
return e.forEach((e, n) => {
|
|
699
|
+
let r = e.width == null ? "" : String(e.width).trim(), i = t[n], s = "";
|
|
700
|
+
i === "px" ? s = ` style="width:${r}px;min-width:0"` : i === "lit" ? s = ` style="width:${this._escapeHtml(r)};min-width:0"` : a && (s = ` style="${a}"`), o += `<col${s} />`;
|
|
701
|
+
}), o += "</colgroup>", o;
|
|
702
|
+
}
|
|
703
|
+
_buildDataRowHtml(e, t, n, r = !1) {
|
|
704
|
+
if (!this._configuration) return "";
|
|
705
|
+
let i = t, a = n, o = `box-sizing:border-box;min-height:${a}px;max-height:${a}px;height:${a}px;overflow:hidden`, s = "", c = typeof this._configuration.onRowClick == "function", l = c ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "", u = c ? " data-row-clickable=\"true\"" : "", d = l ? ` class="${l}"` : "";
|
|
706
|
+
return s += `<tr data-row-index="${i}"${r ? " data-mint-rt-last-row=\"\"" : ""}${u}${d} style="${o}">`, this._configuration.columns.forEach((t) => {
|
|
707
|
+
if (t.hidden) return;
|
|
708
|
+
let n = !t.show || t.show(this, e), r = `${this._getStyle(t)}box-sizing:border-box;max-height:${a}px;overflow:hidden;vertical-align:middle;`;
|
|
709
|
+
s += `<td style="${r}" class="${this._getClasses(t, !0)}">`, s += n ? this._buildTableCellInnerHtml(t, e, i) : "", s += "</td>";
|
|
710
|
+
}), s += "</tr>", s;
|
|
711
|
+
}
|
|
712
|
+
_getVirtualRowCount() {
|
|
713
|
+
return !this._virtualScrollActive() || !this._configuration ? 0 : this._type === "provided" ? this._getAllFilteredRowsSorted().length : this._type === "ajax" ? this._totalRows : 0;
|
|
714
|
+
}
|
|
715
|
+
_getVirtualRowAt(e) {
|
|
716
|
+
return this._type === "provided" ? this._getAllFilteredRowsSorted()[e] ?? null : this._type === "ajax" && this._virtualRowCache.has(e) ? this._virtualRowCache.get(e) : null;
|
|
717
|
+
}
|
|
718
|
+
_buildVirtualPlaceholderRowHtml(e, t, n = !1) {
|
|
719
|
+
if (!this._configuration) return "";
|
|
720
|
+
let r = t, i = `box-sizing:border-box;min-height:${r}px;max-height:${r}px;height:${r}px;overflow:hidden`, a = `<tr data-row-index="${e}" data-mint-rt-placeholder="true"${n ? " data-mint-rt-last-row=\"\"" : ""} class="bg-white dark:bg-mint-canvas" style="${i}">`;
|
|
721
|
+
return this._configuration.columns.forEach((e) => {
|
|
722
|
+
if (e.hidden) return;
|
|
723
|
+
let t = `${this._getStyle(e)}box-sizing:border-box;max-height:${r}px;height:${r}px;overflow:hidden;vertical-align:middle;line-height:0;`;
|
|
724
|
+
if (a += `<td style="${t}" class="${this._getClasses(e, !0)}">`, e.thumbnail) {
|
|
725
|
+
let t = this._thumbnailDesktopPx(e);
|
|
726
|
+
a += `<div class="rounded-md bg-gray-200 dark:bg-white/15" style="width:${t}px;height:${t}px;max-width:100%;box-sizing:border-box"></div>`;
|
|
727
|
+
} else a += "<div class=\"h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15\"></div>";
|
|
728
|
+
a += "</td>";
|
|
729
|
+
}), a += "</tr>", a;
|
|
730
|
+
}
|
|
731
|
+
_virtualScrollStickyOverlapPx(e) {
|
|
732
|
+
let t = 0;
|
|
733
|
+
if (this._fixedControls()) {
|
|
734
|
+
let e = this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);
|
|
735
|
+
if (e) t += Math.ceil(e.getBoundingClientRect().height);
|
|
736
|
+
else {
|
|
737
|
+
let e = getComputedStyle(this).getPropertyValue("--mint-rt-fixed-controls-h").trim(), n = parseFloat(e);
|
|
738
|
+
isNaN(n) || (t += Math.ceil(n));
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
if (this._fixedHeader() && e) {
|
|
742
|
+
let n = e.querySelector("thead");
|
|
743
|
+
n && (t += Math.ceil(n.getBoundingClientRect().height));
|
|
744
|
+
}
|
|
745
|
+
return t;
|
|
746
|
+
}
|
|
747
|
+
_scrollVirtualTableTopIntoView() {
|
|
748
|
+
if (!(!this._virtualScrollActive() || !this.isConnected)) {
|
|
749
|
+
if (this._virtualScrollRoot() === "table-body") {
|
|
750
|
+
let e = this._virtualBodyScrollEl?.isConnected ? this._virtualBodyScrollEl : this.querySelector(`#mint-rt-vscroll-${this._tableId}`);
|
|
751
|
+
this._useMobileListLayout() && e && e.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);
|
|
752
|
+
let t = e?.querySelector("mint-table.table-section") || e?.querySelector("mint-table"), n = t?.querySelector(`#${this._tableId}`)?.closest("table") || t?.querySelector("table");
|
|
753
|
+
this._virtualScrollStickyOverlapPx(n), e && (e.scrollTop = 0, this._virtualBodyScrollEl = e, this._virtualInvalidate(), this._scheduleVirtualWindowSync());
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
this._virtualInvalidate(), this._scheduleVirtualWindowSync();
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
_scheduleVirtualWindowSync() {
|
|
760
|
+
this._virtualScrollActive() && this._virtualWindowRaf === null && (this._virtualWindowRaf = window.requestAnimationFrame(() => {
|
|
761
|
+
this._virtualWindowRaf = null, this._syncVirtualWindow();
|
|
762
|
+
}));
|
|
763
|
+
}
|
|
764
|
+
_syncVirtualWindow() {
|
|
765
|
+
if (!this._virtualScrollActive() || !this._configuration) return;
|
|
766
|
+
let e = this._useMobileListLayout(), t = this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`), n = this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`), r = e ? n : t;
|
|
767
|
+
if (!r) return;
|
|
768
|
+
let i = this._getVirtualRowCount(), a = this._virtualRowHeightPxForSync(e), o = this._virtualColspan();
|
|
769
|
+
if (i === 0) {
|
|
770
|
+
e ? this._fetchError ? r.innerHTML = `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>` : r.innerHTML = "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>" : this._fetchError ? r.innerHTML = `<tr><td colspan="${o}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>` : r.innerHTML = `<tr><td colspan="${o}" class="text-center py-8">No records found.</td></tr>`, this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "";
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
let s = 0, c = window.innerHeight;
|
|
774
|
+
if (this._virtualScrollRoot() === "table-body") {
|
|
775
|
+
let e = this._virtualBodyScrollEl;
|
|
776
|
+
if ((!e || !e.isConnected) && (e = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl = e), !e) return;
|
|
777
|
+
s = e.scrollTop, c = e.clientHeight || 400;
|
|
778
|
+
} else {
|
|
779
|
+
let e = r.getBoundingClientRect();
|
|
780
|
+
s = Math.max(0, -e.top);
|
|
781
|
+
}
|
|
782
|
+
let l = Math.min(Math.max(0, Math.floor(s / a)), Math.max(0, i - 1)), u = Math.ceil(c / a) + 16, d = Math.max(0, l - 8), f = Math.min(i, l + u), p = "";
|
|
783
|
+
if (this._type === "ajax") for (let e = d; e < f; e++) p += this._virtualRowCache.has(e) ? "1" : "0";
|
|
784
|
+
if (d === this._virtualLastRangeStart && f === this._virtualLastRangeEnd && (this._type !== "ajax" || p === this._virtualLastRangeCacheSig)) return;
|
|
785
|
+
this._virtualLastRangeStart = d, this._virtualLastRangeEnd = f, this._virtualLastRangeCacheSig = p;
|
|
786
|
+
let m = d * a, h = Math.max(0, (i - f) * a), g = "";
|
|
787
|
+
if (e) {
|
|
788
|
+
g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${m}px"></li>`;
|
|
789
|
+
for (let e = d; e < f; e++) {
|
|
790
|
+
let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
|
|
791
|
+
t ? g += this._buildMobileListItemHtml(t, e, a, n) : g += this._buildMobileListPlaceholderLi(e, a, n);
|
|
792
|
+
}
|
|
793
|
+
g += `<li aria-hidden="true" class="pointer-events-none m-0 block list-none border-0 p-0" style="height:${h}px"></li>`;
|
|
794
|
+
} else {
|
|
795
|
+
g += `<tr data-mint-rt-spacer="top" aria-hidden="true"><td colspan="${o}" style="height:${m}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;
|
|
796
|
+
for (let e = d; e < f; e++) {
|
|
797
|
+
let t = this._getVirtualRowAt(e), n = i > 0 && e === i - 1;
|
|
798
|
+
t ? g += this._buildDataRowHtml(t, e, a, n) : g += this._buildVirtualPlaceholderRowHtml(e, a, n);
|
|
799
|
+
}
|
|
800
|
+
g += `<tr data-mint-rt-spacer="bottom" aria-hidden="true"><td colspan="${o}" style="height:${h}px;padding:0;border:0;line-height:0;font-size:0"></td></tr>`;
|
|
801
|
+
}
|
|
802
|
+
if (r.innerHTML = g, this.querySelectorAll(`tbody[data-mint-rt-tbody="${this._tableId}"] mint-button[data-action], ul[data-mint-rt-mobile-list="${this._tableId}"] mint-button[data-action]`).forEach((e) => {
|
|
803
|
+
e.render && e.render();
|
|
804
|
+
}), this._attachTableEventListeners(), this._attachRowClickHandler(), this._type === "ajax" && this._virtualScrollActive() && this._scheduleVirtualAjaxPrefetch(d, f), this._virtualScrollRoot() === "table-body" && !e) {
|
|
805
|
+
let e = this._virtualBodyScrollEl;
|
|
806
|
+
e?.isConnected && requestAnimationFrame(() => {
|
|
807
|
+
if (!e.isConnected) return;
|
|
808
|
+
let t = Math.max(0, e.scrollHeight - e.clientHeight);
|
|
809
|
+
e.scrollTop > t && (e.scrollTop = t);
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
_detachVirtualScroll() {
|
|
814
|
+
this._virtualScrollHandler &&= (window.removeEventListener("scroll", this._virtualScrollHandler), this._virtualBodyScrollEl?.removeEventListener("scroll", this._virtualScrollHandler), null), this._virtualWindowResizeHandler &&= (window.removeEventListener("resize", this._virtualWindowResizeHandler), null), this._virtualResizeObserver &&= (this._virtualResizeObserver.disconnect(), null), this._virtualBodyScrollEl = null, this._virtualWindowRaf !== null && (window.cancelAnimationFrame(this._virtualWindowRaf), this._virtualWindowRaf = null), this._virtualLastRangeStart = -1, this._virtualLastRangeEnd = -1, this._virtualLastRangeCacheSig = "", this._virtualAjaxPrefetchTimer !== null && (window.clearTimeout(this._virtualAjaxPrefetchTimer), this._virtualAjaxPrefetchTimer = null), this._virtualRangeFetching = !1;
|
|
815
|
+
}
|
|
816
|
+
_scheduleVirtualAjaxPrefetch(e, t) {
|
|
817
|
+
if (this._type !== "ajax" || !this._virtualScrollActive() || !this._configuration) return;
|
|
818
|
+
let n = !1;
|
|
819
|
+
for (let r = e; r < t; r++) if (!this._virtualRowCache.has(r)) {
|
|
820
|
+
n = !0;
|
|
821
|
+
break;
|
|
822
|
+
}
|
|
823
|
+
if (!n) return;
|
|
824
|
+
this._virtualAjaxPrefetchTimer !== null && window.clearTimeout(this._virtualAjaxPrefetchTimer);
|
|
825
|
+
let r = e, i = t;
|
|
826
|
+
this._virtualAjaxPrefetchTimer = window.setTimeout(() => {
|
|
827
|
+
this._virtualAjaxPrefetchTimer = null, this._fetchVirtualAjaxRange(r, i - r);
|
|
828
|
+
}, 60);
|
|
829
|
+
}
|
|
830
|
+
async _fetchVirtualAjaxRange(e, t) {
|
|
831
|
+
if (!this._configuration || this._type !== "ajax" || !this._virtualScrollActive()) return;
|
|
832
|
+
let n = typeof this._configuration.data == "string" ? this._configuration.data : null;
|
|
833
|
+
if (!n || t <= 0 || this._virtualRangeFetching || e < 0 || e >= this._totalRows) return;
|
|
834
|
+
this._virtualRangeFetching = !0;
|
|
835
|
+
let r = this._virtualFetchGeneration, i = Math.min(e, Math.max(0, this._totalRows - 1)), a = Math.min(150, Math.max(this._perPage, t, 15), Math.max(1, this._totalRows - i));
|
|
836
|
+
try {
|
|
837
|
+
let e = new URLSearchParams({
|
|
838
|
+
perPage: a.toString(),
|
|
839
|
+
offset: i.toString(),
|
|
840
|
+
search: this._search,
|
|
841
|
+
sortBy: this._configuration.sortBy || "id",
|
|
842
|
+
sort: this._configuration.sort || "asc",
|
|
843
|
+
searchColumns: this._searchColumns.join(","),
|
|
844
|
+
columns: this._columns.join(",")
|
|
845
|
+
}), t = {};
|
|
846
|
+
this._configuration.headers && (t.headers = this._configuration.headers);
|
|
847
|
+
let o = await fetch(`${n}?${e.toString()}`, t);
|
|
848
|
+
if (!o.ok) throw Error(`HTTP error! status: ${o.status}`);
|
|
849
|
+
let s = await o.json();
|
|
850
|
+
if (r !== this._virtualFetchGeneration) return;
|
|
851
|
+
(s.content?.rows || []).forEach((e, t) => {
|
|
852
|
+
let n = i + t;
|
|
853
|
+
n < this._totalRows && this._virtualRowCache.set(n, e);
|
|
854
|
+
});
|
|
855
|
+
} catch (e) {
|
|
856
|
+
console.error("mint-resource-table: virtual range fetch failed", e);
|
|
857
|
+
} finally {
|
|
858
|
+
this._virtualRangeFetching = !1, r === this._virtualFetchGeneration && (this._virtualInvalidate(), this._scheduleVirtualWindowSync());
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
_detachFixedChromeResize() {
|
|
862
|
+
this._fixedChromeResizeObserver?.disconnect(), this._fixedChromeResizeObserver = null, this.style.removeProperty("--mint-rt-fixed-controls-h");
|
|
863
|
+
}
|
|
864
|
+
_syncFixedControlsChromeHeight() {
|
|
865
|
+
if (!this._fixedHeader() || !this._fixedControls()) return;
|
|
866
|
+
this._fixedChromeResizeObserver?.disconnect(), this._fixedChromeResizeObserver = null;
|
|
867
|
+
let e = this.querySelector(`#mint-rt-fixed-controls-${this._tableId}`);
|
|
868
|
+
if (!e) return;
|
|
869
|
+
let t = () => {
|
|
870
|
+
let t = Math.ceil(e.getBoundingClientRect().height);
|
|
871
|
+
this.style.setProperty("--mint-rt-fixed-controls-h", `${t}px`);
|
|
872
|
+
};
|
|
873
|
+
t(), this._fixedChromeResizeObserver = new ResizeObserver(t), this._fixedChromeResizeObserver.observe(e);
|
|
874
|
+
}
|
|
875
|
+
_attachVirtualScrollListeners() {
|
|
876
|
+
if (this._detachVirtualScroll(), !this._virtualScrollActive()) return;
|
|
877
|
+
let e = () => {
|
|
878
|
+
this._scheduleVirtualWindowSync();
|
|
879
|
+
};
|
|
880
|
+
this._virtualScrollHandler = e, this._virtualScrollRoot() === "table-body" ? (this._virtualBodyScrollEl = this.querySelector(`#mint-rt-vscroll-${this._tableId}`), this._virtualBodyScrollEl?.addEventListener("scroll", e, { passive: !0 }), this._virtualBodyScrollEl && typeof ResizeObserver < "u" && (this._virtualResizeObserver = new ResizeObserver(() => this._scheduleVirtualWindowSync()), this._virtualResizeObserver.observe(this._virtualBodyScrollEl))) : window.addEventListener("scroll", e, { passive: !0 }), this._virtualWindowResizeHandler = () => this._scheduleVirtualWindowSync(), window.addEventListener("resize", this._virtualWindowResizeHandler, { passive: !0 }), this._scheduleVirtualWindowSync();
|
|
881
|
+
}
|
|
882
|
+
_toggleSort(e) {
|
|
883
|
+
if (!this._configuration || !e.data || !e.sortable) return;
|
|
884
|
+
let t = e.data;
|
|
885
|
+
if (this._sortTimeoutId !== null && (clearTimeout(this._sortTimeoutId), this._sortTimeoutId = null), this._sorting = !0, this._sortingColumn = e, this._updateSortIcons(), this._type === "ajax") this._sortTimeoutId = window.setTimeout(() => {
|
|
886
|
+
if (this._sortTimeoutId = null, !this._configuration || !t || !e.sortable) return;
|
|
887
|
+
let n = this._configuration.sort || "asc";
|
|
888
|
+
this._configuration.sortBy?.toLowerCase() === t.toLowerCase() && (n = n === "desc" ? "asc" : "desc"), this._configuration.sort = n, this._configuration.sortBy = t, this._updateSortIcons(), this._offset = 0, this._currentPage = 1, this._fetching = !1, this._loading = !1, this._fetchData(void 0, !1, this._perPage, 0);
|
|
889
|
+
}, 10);
|
|
890
|
+
else {
|
|
891
|
+
let e = this._configuration.sort || "asc";
|
|
892
|
+
this._configuration.sortBy?.toLowerCase() === t.toLowerCase() && (e = e === "desc" ? "asc" : "desc"), this._configuration.sort = e, this._configuration.sortBy = t, this._currentPage = 1, this._sorting = !1, this._sortingColumn = null, this._updateSortIcons(), this.render(), this._virtualScrollActive() && queueMicrotask(() => this._scrollVirtualTableTopIntoView());
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
_getSortClass(e) {
|
|
896
|
+
return this._sorting && this._sortingColumn === e ? "spinner" : this._configuration?.sortBy?.toLowerCase() === e.data?.toLowerCase() ? this._configuration?.sort?.toLowerCase() === "desc" ? "caret-down" : "caret-up" : "";
|
|
897
|
+
}
|
|
898
|
+
_updateSortIcons() {
|
|
899
|
+
if (!this._configuration) return;
|
|
900
|
+
this._configuration.columns.forEach((e, t) => {
|
|
901
|
+
if (!e.sortable || e.hidden) return;
|
|
902
|
+
let n = this.querySelector(`th[data-column-key="${t}"]`);
|
|
903
|
+
if (!n) return;
|
|
904
|
+
let r = n.querySelector(":scope > div.flex.items-center");
|
|
905
|
+
if (!r) return;
|
|
906
|
+
let i = r.querySelector(":scope > div.ml-2.flex.items-center"), a = this._getSortClass(e), o = () => {
|
|
907
|
+
if (!i) {
|
|
908
|
+
let e = document.createElement("div");
|
|
909
|
+
e.className = "ml-2 flex items-center", r.appendChild(e), i = e;
|
|
910
|
+
}
|
|
911
|
+
return i;
|
|
912
|
+
}, s = () => {
|
|
913
|
+
i &&= (i.remove(), null);
|
|
914
|
+
};
|
|
915
|
+
if (a === "spinner") {
|
|
916
|
+
let e = o();
|
|
917
|
+
if (e.querySelector("mint-icon")?.remove(), !e.querySelector("mint-spinner")) {
|
|
918
|
+
let t = document.createElement("mint-spinner");
|
|
919
|
+
t.className = "w-4 h-4", e.appendChild(t);
|
|
920
|
+
}
|
|
921
|
+
} else if (a === "caret-up" || a === "caret-down") {
|
|
922
|
+
let e = o();
|
|
923
|
+
e.querySelector("mint-spinner")?.remove();
|
|
924
|
+
let t = e.querySelector("mint-icon");
|
|
925
|
+
t || (t = document.createElement("mint-icon"), e.appendChild(t)), t.setAttribute("name", a), t.className = "w-4 h-4";
|
|
926
|
+
} else s();
|
|
927
|
+
}), this._syncMobileSortPopoverIcons();
|
|
928
|
+
let e = this.querySelector(`#mint-rt-mobile-sort-btn-${this._tableId}`);
|
|
929
|
+
e && (e.setAttribute("icon", this._getMobileSortTriggerIconName()), this._sorting ? e.setAttribute("loading", "true") : e.removeAttribute("loading"), typeof e.render == "function" && e.render());
|
|
930
|
+
}
|
|
931
|
+
_showFetchingState() {}
|
|
932
|
+
_triggerSearch() {
|
|
933
|
+
this._searchTimeoutId && clearTimeout(this._searchTimeoutId), this._searching = !0, this._type === "ajax" && this._updateSearchIcon(), this._type !== "ajax" && (this._currentPage = 1), this._updateTableBody(), this._type !== "ajax" && this._updatePagination(), this._searchTimeoutId = window.setTimeout(() => {
|
|
934
|
+
this._type === "ajax" ? (this._offset = 0, this._fetchData(void 0, !1, this._perPage, 0)) : (this._searching = !1, this._virtualScrollActive() && queueMicrotask(() => this._scrollVirtualTableTopIntoView()));
|
|
935
|
+
}, 400);
|
|
936
|
+
}
|
|
937
|
+
_updateSearchIcon() {
|
|
938
|
+
let e = this.querySelector(`#search-${this._tableId}`);
|
|
939
|
+
if (!e) return;
|
|
940
|
+
let t = this._type === "ajax" && (this._searching || this._fetching);
|
|
941
|
+
setTimeout(() => {
|
|
942
|
+
let n = e.querySelector(".relative") || e.querySelector("div");
|
|
943
|
+
if (!n) return;
|
|
944
|
+
let r = n.querySelector("mint-icon"), i = n.querySelector("mint-spinner");
|
|
945
|
+
if (t) {
|
|
946
|
+
if (r && !i) {
|
|
947
|
+
let e = document.createElement("mint-spinner");
|
|
948
|
+
e.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none", r.replaceWith(e);
|
|
949
|
+
} else if (!r && !i) {
|
|
950
|
+
let e = document.createElement("mint-spinner");
|
|
951
|
+
e.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 pointer-events-none", n.appendChild(e);
|
|
952
|
+
}
|
|
953
|
+
} else if (i) {
|
|
954
|
+
e.getAttribute("icon") || e.setAttribute("icon", "search");
|
|
955
|
+
let t = document.createElement("mint-icon");
|
|
956
|
+
t.setAttribute("name", "search"), t.className = "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-500 pointer-events-none", i.replaceWith(t);
|
|
957
|
+
}
|
|
958
|
+
}, 0);
|
|
959
|
+
}
|
|
960
|
+
_updateTableBody() {
|
|
961
|
+
if (!this._configuration) return;
|
|
962
|
+
let e = this.querySelector(`tbody[data-mint-rt-tbody="${this._tableId}"]`), t = this.querySelector(`#${this._tableId}`)?.closest("table")?.querySelector("tbody");
|
|
963
|
+
if (this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax")) {
|
|
964
|
+
if (!(e || t)) {
|
|
965
|
+
this.render();
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
let n = this.querySelector(`#search-${this._tableId}`), r = document.activeElement === n || n?.querySelector("input") === document.activeElement, i = this._search;
|
|
969
|
+
if ((this._fetching || this._loading) && !this._loaded && !this._sorting) return;
|
|
970
|
+
if (this._virtualInvalidate(), this._syncVirtualWindow(), r && n) {
|
|
971
|
+
let e = n.querySelector("input") || n._element;
|
|
972
|
+
e ? (e.value = i, setTimeout(() => {
|
|
973
|
+
e.focus(), e.setSelectionRange(i.length, i.length);
|
|
974
|
+
}, 0)) : n.value !== void 0 && (n.value = i, setTimeout(() => {
|
|
975
|
+
n.focus();
|
|
976
|
+
}, 0));
|
|
977
|
+
}
|
|
978
|
+
return;
|
|
979
|
+
}
|
|
980
|
+
let n = this._getRows(), r = t;
|
|
981
|
+
if (!r) {
|
|
982
|
+
this.render();
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
let i = this.querySelector(`#search-${this._tableId}`), a = document.activeElement === i || i?.querySelector("input") === document.activeElement, o = this._search, s = "", c = "";
|
|
986
|
+
if ((this._fetching || this._loading) && !this._loaded && !this._sorting) return;
|
|
987
|
+
n.forEach((e, t) => {
|
|
988
|
+
c += this._buildMobileListItemHtml(e, t, void 0, t === n.length - 1);
|
|
989
|
+
let r = typeof this._configuration.onRowClick == "function", i = r ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-gray-800" : "";
|
|
990
|
+
s += `<tr data-row-index="${t}" ${r ? "data-row-clickable=\"true\"" : ""}${i ? ` class="${i}"` : ""}>`, this._configuration.columns.forEach((n) => {
|
|
991
|
+
if (n.hidden) return;
|
|
992
|
+
let r = !n.show || n.show(this, e);
|
|
993
|
+
s += `<td style="${this._getStyle(n)}" class="${this._getClasses(n, !0)}">`, r && (s += this._buildTableCellInnerHtml(n, e, t, "table")), s += "</td>";
|
|
994
|
+
}), s += "</tr>";
|
|
995
|
+
}), n.length === 0 && (this._fetchError ? (s += `<tr><td colspan="${this._configuration.columns.filter((e) => !e.hidden).length}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`, c += `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`) : (s += `<tr><td colspan="${this._configuration.columns.filter((e) => !e.hidden).length}" class="text-center py-8">No records found.</td></tr>`, c += "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>")), r.innerHTML = s;
|
|
996
|
+
let l = this.querySelector(`ul[data-mint-rt-mobile-list="${this._tableId}"]`);
|
|
997
|
+
if (l && (l.innerHTML = c), this._attachTableEventListeners(), this._attachRowClickHandler(), a && i) {
|
|
998
|
+
let e = i.querySelector("input") || i._element;
|
|
999
|
+
e ? (e.value = o, setTimeout(() => {
|
|
1000
|
+
e.focus(), e.setSelectionRange(o.length, o.length);
|
|
1001
|
+
}, 0)) : i.value !== void 0 && (i.value = o, setTimeout(() => {
|
|
1002
|
+
i.focus();
|
|
1003
|
+
}, 0));
|
|
1004
|
+
}
|
|
1005
|
+
}
|
|
1006
|
+
_updatePagination() {
|
|
1007
|
+
if (!this._configuration) return;
|
|
1008
|
+
let e = this._lastPage || Math.ceil(this._rows.length / this._perPage), t = () => {
|
|
1009
|
+
let e = this.querySelector("mint-table"), t = e?.nextElementSibling;
|
|
1010
|
+
e && t && t.id !== `mint-rt-pagination-host-${this._tableId}` && !t.classList.contains("mint-rt-pagination-host") && t.querySelector?.("[data-action=\"page\"]") && t.remove();
|
|
1011
|
+
};
|
|
1012
|
+
if (!this._configuration.perPage || e <= 1 || this._virtualScrollActive()) {
|
|
1013
|
+
this._getPaginationHostEl()?.replaceChildren(), t();
|
|
1014
|
+
return;
|
|
1015
|
+
}
|
|
1016
|
+
let n = this._getPaginationHostEl();
|
|
1017
|
+
if (!n) {
|
|
1018
|
+
let e = this.querySelector(`[data-mint-rt-mobile-list="${this._tableId}"]`) || this.querySelector("mint-table");
|
|
1019
|
+
if (!e) {
|
|
1020
|
+
this.render();
|
|
1021
|
+
return;
|
|
1022
|
+
}
|
|
1023
|
+
n = document.createElement("div"), n.id = `mint-rt-pagination-host-${this._tableId}`, n.setAttribute("data-mint-rt-pagination-wrap", ""), n.className = "mint-rt-pagination-host w-full min-w-0 overflow-x-auto overflow-y-hidden overscroll-x-contain flex justify-center [-webkit-overflow-scrolling:touch] md:justify-end " + (this._inMintCard ? "border-t border-gray-200 px-3.5 pb-3.5 pt-3 dark:border-mint-divider md:border-t-0 md:pt-0" : "border-t border-gray-200 px-2 py-3 dark:border-mint-divider md:border-t-0 md:py-0 md:mt-4"), e.insertAdjacentElement("afterend", n);
|
|
1024
|
+
}
|
|
1025
|
+
let r = this._buildPaginationNavMarkup(e);
|
|
1026
|
+
n.innerHTML = r, setTimeout(() => {
|
|
1027
|
+
this._attachPaginationListeners(), n.querySelectorAll("mint-button[data-action=\"page\"]").forEach((e) => {
|
|
1028
|
+
let t = e.getAttribute("data-page"), n = t && this._loadingPage === parseInt(t), r = e._button || e.querySelector("button");
|
|
1029
|
+
if (r) if (n) {
|
|
1030
|
+
let e = [], t = document.createTreeWalker(r, NodeFilter.SHOW_TEXT, null), n;
|
|
1031
|
+
for (; n = t.nextNode();) e.push(n);
|
|
1032
|
+
e.forEach((e) => e.parentNode?.removeChild(e));
|
|
1033
|
+
let i = r.querySelector(".mint-button-content");
|
|
1034
|
+
if (i) {
|
|
1035
|
+
let e = i.textContent?.trim();
|
|
1036
|
+
e && /^\d+$/.test(e) && i.remove();
|
|
1037
|
+
}
|
|
1038
|
+
let a = r.querySelector("span.mr-2");
|
|
1039
|
+
a && a.querySelector("mint-spinner") && (a.classList.remove("mr-2"), a.classList.add("mr-0"));
|
|
1040
|
+
} else {
|
|
1041
|
+
let e = r.textContent?.trim();
|
|
1042
|
+
if (!e || !/^\d+$/.test(e)) {
|
|
1043
|
+
let e = t || "", n = r.querySelector("mint-spinner");
|
|
1044
|
+
r.innerHTML = "", n && r.appendChild(n), r.appendChild(document.createTextNode(e));
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
if ("render" in e && typeof e.render == "function" && (e.render(), n && r)) {
|
|
1048
|
+
let e = r.querySelector("span.mr-2");
|
|
1049
|
+
e && e.querySelector("mint-spinner") && (e.classList.remove("mr-2"), e.classList.add("mr-0"));
|
|
1050
|
+
}
|
|
1051
|
+
}), n.querySelectorAll("mint-button[data-action=\"page-prev\"], mint-button[data-action=\"page-next\"]").forEach((e) => {
|
|
1052
|
+
"render" in e && typeof e.render == "function" && e.render();
|
|
1053
|
+
}), this._loadingPage !== null && !this._loading && !this._fetching && this._updatePagination();
|
|
1054
|
+
}, 0);
|
|
1055
|
+
}
|
|
1056
|
+
_goToPage(e) {
|
|
1057
|
+
let t = this._lastPage || Math.ceil(this._rows.length / this._perPage);
|
|
1058
|
+
e > t && (e = t), e < 1 && (e = 1), e !== this._currentPage && (this._currentPage = e, this._offset = (e - 1) * this._perPage, this._updatePageInUrl(e), this._type === "ajax" ? (this._loadingPage = e, this._updatePagination(), this._fetchData()) : this.render());
|
|
1059
|
+
}
|
|
1060
|
+
_handleButtonClick(e) {
|
|
1061
|
+
if (this._configuration) switch (e.type) {
|
|
1062
|
+
case "export": break;
|
|
1063
|
+
case "print":
|
|
1064
|
+
window.print();
|
|
1065
|
+
break;
|
|
1066
|
+
case "csv":
|
|
1067
|
+
this._downloadCSV();
|
|
1068
|
+
break;
|
|
1069
|
+
default:
|
|
1070
|
+
e.onClick && e.onClick(this);
|
|
1071
|
+
break;
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
_downloadCSV() {
|
|
1075
|
+
if (!this._configuration) return;
|
|
1076
|
+
let e = this.querySelector(`#${this._tableId}`) || this.querySelector("table");
|
|
1077
|
+
if (!e) return;
|
|
1078
|
+
let t = "data:text/csv;charset=utf-8,", n = (e) => {
|
|
1079
|
+
let n = [];
|
|
1080
|
+
e.querySelectorAll("th, td").forEach((e) => {
|
|
1081
|
+
let t = e.getAttribute("colspan");
|
|
1082
|
+
if (t) for (let e = 0; e < parseInt(t, 10) - 1; e++) n.push("");
|
|
1083
|
+
n.push("\"" + e.textContent?.trim().replace(/"/g, "\"\"") + "\"");
|
|
1084
|
+
}), t += n.join(",") + "\n";
|
|
1085
|
+
};
|
|
1086
|
+
e.querySelectorAll("tr").forEach((e) => n(e));
|
|
1087
|
+
let r = encodeURI(t), i = document.createElement("a");
|
|
1088
|
+
i.setAttribute("href", r), i.setAttribute("download", `${this._configuration.export_name || this._tableId}.csv`), document.body.appendChild(i), i.click(), document.body.removeChild(i);
|
|
1089
|
+
}
|
|
1090
|
+
_getStyle(e) {
|
|
1091
|
+
let t = "";
|
|
1092
|
+
return (e.nowrap || e.actions) && (t += "white-space: nowrap;"), e.offsetLeft && (t += `left: ${e.offsetLeft} !important;`), e.offsetRight && (t += `right: ${e.offsetRight} !important;`), e.width && (t += `min-width: ${e.width}px; max-width: ${e.width}px;`), t;
|
|
1093
|
+
}
|
|
1094
|
+
_getClasses(e, t = !1) {
|
|
1095
|
+
let n = [];
|
|
1096
|
+
return e.class && n.push(e.class.trim()), e.sortable && !t && n.push("cursor-pointer"), e.stickLeft && n.push("sticky-left"), e.stickRight && n.push("sticky-right"), n.join(" ");
|
|
1097
|
+
}
|
|
1098
|
+
_replaceUtilityClasses() {
|
|
1099
|
+
let e = t, n = [this, ...Array.from(this.querySelectorAll("[class]"))];
|
|
1100
|
+
for (let t of n) for (let n of Array.from(t.classList)) {
|
|
1101
|
+
let r = e[n];
|
|
1102
|
+
r && t.classList.replace(n, r);
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
_renderTheadHtml(e, t, n = !1, r = !1) {
|
|
1106
|
+
if (!this._configuration) return "";
|
|
1107
|
+
let i = ["bg-white", "dark:bg-mint-nav"];
|
|
1108
|
+
e && (i.push("sticky", "z-30"), r ? i.push("top-[var(--mint-rt-fixed-controls-h,0px)]") : i.push("top-0")), t && i.push("border-b", "border-gray-200", "dark:border-mint-divider");
|
|
1109
|
+
let a = `<thead class="${i.join(" ")}"><tr>`;
|
|
1110
|
+
return this._configuration.columns.forEach((e, t) => {
|
|
1111
|
+
if (e.hidden) return;
|
|
1112
|
+
let r = n ? "" : ` width="${e.width || ""}"`, i = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
|
|
1113
|
+
if (a += `<th${r} style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${i}>`, e.showLabel !== !1) {
|
|
1114
|
+
if (a += "<div class=\"flex items-center\">", a += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable) {
|
|
1115
|
+
let t = this._getSortClass(e);
|
|
1116
|
+
t === "spinner" ? a += "<div class=\"ml-2 flex items-center\"><mint-spinner class=\"w-4 h-4\"></mint-spinner></div>" : (t === "caret-up" || t === "caret-down") && (a += `<div class="ml-2 flex items-center"><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`);
|
|
1117
|
+
}
|
|
1118
|
+
a += "</div>";
|
|
1119
|
+
}
|
|
1120
|
+
a += "</th>";
|
|
1121
|
+
}), a += "</tr></thead>", a;
|
|
1122
|
+
}
|
|
1123
|
+
render() {
|
|
1124
|
+
if (!this._configuration) {
|
|
1125
|
+
this.innerHTML = "<div class=\"p-4 text-red-500\">Error: Invalid configuration</div>", this._replaceUtilityClasses();
|
|
1126
|
+
return;
|
|
1127
|
+
}
|
|
1128
|
+
this._ensureMobileListMql();
|
|
1129
|
+
let e = String(this._configuration.id || "").trim();
|
|
1130
|
+
e && (this.id = e), this._detachVirtualScroll(), this._detachFixedChromeResize(), this._virtualScrollActive() || this._virtualRowCache.clear();
|
|
1131
|
+
let t = !this._loaded || this._rows.length > 0 || this._search.length > 0 || this._searching, n = this._getRows();
|
|
1132
|
+
this._lastPage || Math.ceil(this._rows.length / this._perPage);
|
|
1133
|
+
let r = this._isExternalLoading(), i = "";
|
|
1134
|
+
if (t) {
|
|
1135
|
+
let e = this._fixedControls(), t = [
|
|
1136
|
+
"flex",
|
|
1137
|
+
"items-center",
|
|
1138
|
+
"min-w-0",
|
|
1139
|
+
this._inMintCard ? "p-3.5" : "mb-3",
|
|
1140
|
+
e ? "sticky top-0 z-20 bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider" : ""
|
|
1141
|
+
].filter(Boolean).join(" ");
|
|
1142
|
+
if (i += `<div id="mint-rt-fixed-controls-${this._tableId}" class="${t}">`, i += "<div class=\"flex min-w-0 flex-1 items-center gap-2\">", i += this._buildMobileSortToolbarHtml(), this._configuration.showSearch !== !1) {
|
|
1143
|
+
let e = `search-${this._tableId}`, t = this._escapeHtml(this._configuration.searchPlaceholder || "Search...");
|
|
1144
|
+
i += `<mint-input id="${e}" type="search" label="" placeholder="${t}" class="min-w-0 flex-1" icon="search" value="${this._escapeHtml(this._search)}"></mint-input>`;
|
|
1145
|
+
}
|
|
1146
|
+
i += "<div class=\"hidden shrink-0 items-center gap-2 md:flex\">", this._configuration.buttons && this._configuration.buttons.forEach((e) => {
|
|
1147
|
+
let t = e.icon ? ` icon="${this._escapeHtml(e.icon)}"` : "", n = e.tone ? ` tone="${this._escapeHtml(e.tone)}"` : "";
|
|
1148
|
+
i += `<mint-button variant="solid" class="${e.class || ""}" data-button-type="${e.type || "custom"}"${t}${n}>`, e.label && (i += this._escapeHtml(e.label)), i += "</mint-button>";
|
|
1149
|
+
}), i += "</div>", i += "</div>", i += "</div>";
|
|
1150
|
+
}
|
|
1151
|
+
if ((this._type === "ajax" && !this._loaded || this._type === "provided" && r) && !this._fetchError && !this._sorting) {
|
|
1152
|
+
let e = this._fixedHeader() ? " data-mint-rt-scroll-inner=\"\"" : "", t = this._fixedHeader() && this._fixedControls(), n = this._fixedHeader() ? t ? "sticky top-[var(--mint-rt-fixed-controls-h,0px)] z-30 " : "sticky top-0 z-30 " : "sticky top-0 z-10 ";
|
|
1153
|
+
i += "<div class=\"min-w-0\">", i += "<mint-table class=\"table-section" + (this._inMintCard ? " rounded-t-none" : "") + "\"" + e + ">", i += `<table id="${this._tableId}">`, i += "<thead class=\"" + n + "bg-white dark:bg-mint-nav border-b border-gray-200 dark:border-mint-divider\"><tr>", this._configuration.columns.forEach((e, t) => {
|
|
1154
|
+
if (e.hidden) return;
|
|
1155
|
+
let n = e.sortable ? " data-mint-rt-sortable=\"\"" : "";
|
|
1156
|
+
if (i += `<th width="${e.width || ""}" style="${this._getStyle(e)}" class="${this._getClasses(e)}" data-column-key="${t}"${n}>`, e.showLabel !== !1) {
|
|
1157
|
+
if (i += "<div class=\"flex items-center\">", i += `<div class="flex-1">${e.raw ? e.label : this._escapeHtml(e.label)}</div>`, e.sortable) {
|
|
1158
|
+
let t = this._getSortClass(e);
|
|
1159
|
+
t === "spinner" ? i += "<div class=\"ml-2 flex items-center\"><mint-spinner class=\"w-4 h-4\"></mint-spinner></div>" : (t === "caret-up" || t === "caret-down") && (i += `<div class="ml-2 flex items-center"><mint-icon name="${t}" class="w-4 h-4"></mint-icon></div>`);
|
|
1160
|
+
}
|
|
1161
|
+
i += "</div>";
|
|
1162
|
+
}
|
|
1163
|
+
i += "</th>";
|
|
1164
|
+
}), i += "</tr></thead>", i += "<tbody>";
|
|
1165
|
+
for (let e = 0; e < 4; e++) i += "<tr>", this._configuration.columns.forEach((e) => {
|
|
1166
|
+
if (!e.hidden) {
|
|
1167
|
+
if (i += `<td style="${this._getStyle(e)}" class="${this._getClasses(e, !0)}">`, e.thumbnail) {
|
|
1168
|
+
let t = this._thumbnailDesktopPx(e);
|
|
1169
|
+
i += `<div class="rounded-md bg-gray-200 dark:bg-white/15 animate-pulse" style="width:${t}px;height:${t}px;box-sizing:border-box"></div>`;
|
|
1170
|
+
} else i += "<div class=\"h-4 max-w-[95%] rounded bg-gray-200 dark:bg-white/15 animate-pulse\"></div>";
|
|
1171
|
+
i += "</td>";
|
|
1172
|
+
}
|
|
1173
|
+
}), i += "</tr>";
|
|
1174
|
+
i += "</tbody>", i += "</table>", i += "</mint-table>", i += "</div>", i += this._paginationHostPlaceholderHtml();
|
|
1175
|
+
} else if (n.length > 0 || this._search.length > 0 || this._searching || this._fetchError) {
|
|
1176
|
+
let e = this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax" && this._loaded && !this._fetchError), t = e && this._virtualScrollRoot() === "table-body", a = this._escapeHtml(this._virtualMaxHeightCss()), o = t || this._fixedHeader(), s = this._fixedHeader() && this._fixedControls(), c = o ? " data-mint-rt-scroll-inner=\"\"" : "", l = "table-section" + (this._inMintCard ? " rounded-t-none" : ""), u = `m-0 min-h-0 w-full list-none border-collapse overflow-x-hidden bg-white ${this._inMintCard ? "px-3.5 py-3.5" : "py-3"} dark:bg-mint-canvas md:hidden`, d = "";
|
|
1177
|
+
if (t) {
|
|
1178
|
+
let e = this._renderColgroupHtml();
|
|
1179
|
+
i += `<div id="mint-rt-vscroll-${this._tableId}" class="overflow-y-auto overflow-x-auto min-h-0 w-full" style="max-height: ${a}; scrollbar-gutter: stable; overscroll-behavior-x: contain; overscroll-behavior-y: none; overflow-anchor: none;">`, i += "<div class=\"hidden min-h-0 min-w-0 md:block\">", i += `<mint-table class="${l}"${c}>`, i += `<table id="${this._tableId}" class="w-full min-w-0 table-fixed">`, i += e, i += this._renderTheadHtml(!0, !0, !0, s);
|
|
1180
|
+
} else i += "<div class=\"hidden min-h-0 min-w-0 md:block\">", i += `<mint-table class="${l}"${c}>`, i += `<table id="${this._tableId}">`, e && (i += this._renderColgroupHtml()), i += this._renderTheadHtml(!0, !0, !!e, s);
|
|
1181
|
+
if (i += "<tbody" + (e ? ` data-mint-rt-tbody="${this._tableId}"` : "") + ">", !this._fetching && !this._loading && !r && !e && n.forEach((e, t) => {
|
|
1182
|
+
d += this._buildMobileListItemHtml(e, t, void 0, t === n.length - 1);
|
|
1183
|
+
let r = typeof this._configuration.onRowClick == "function", a = r ? "cursor-pointer hover:bg-gray-50 dark:hover:bg-mint-elevated" : "";
|
|
1184
|
+
i += `<tr data-row-index="${t}" ${r ? "data-row-clickable=\"true\"" : ""}${a ? ` class="${a}"` : ""}>`, this._configuration.columns.forEach((n) => {
|
|
1185
|
+
if (n.hidden) return;
|
|
1186
|
+
let r = !n.show || n.show(this, e);
|
|
1187
|
+
i += `<td style="${this._getStyle(n)}" class="${this._getClasses(n, !0)}">`, r && (i += this._buildTableCellInnerHtml(n, e, t, "table")), i += "</td>";
|
|
1188
|
+
}), i += "</tr>";
|
|
1189
|
+
}), !this._fetching && !this._loading && !r && n.length === 0 && !e) if (this._fetchError) {
|
|
1190
|
+
let e = this._configuration.columns.filter((e) => !e.hidden).length;
|
|
1191
|
+
i += `<tr><td colspan="${e}" class="text-center py-8 text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</td></tr>`, d += `<li class="list-none px-4 py-8 text-center text-sm text-red-500 dark:text-red-400">Failed to load data: ${this._escapeHtml(this._fetchError)}</li>`;
|
|
1192
|
+
} else {
|
|
1193
|
+
let e = this._configuration.columns.filter((e) => !e.hidden).length;
|
|
1194
|
+
i += `<tr><td colspan="${e}" class="text-center py-8">No records found.</td></tr>`, d += "<li class=\"list-none px-4 py-8 text-center text-sm\">No records found.</li>";
|
|
1195
|
+
}
|
|
1196
|
+
i += "</tbody>", i += "</table>", i += "</mint-table>", i += "</div>", i += `<ul class="${u}" data-mint-rt-mobile-list="${this._tableId}">${e ? "" : d}</ul>`, e || (i += this._paginationHostPlaceholderHtml()), t && (i += "</div>");
|
|
1197
|
+
} else i += "<slot name=\"empty\"></slot>";
|
|
1198
|
+
this._fixedHeader() ? this.setAttribute("data-mint-rt-fixed-header", "") : this.removeAttribute("data-mint-rt-fixed-header"), this._fixedControls() ? this.setAttribute("data-mint-rt-fixed-controls", "") : this.removeAttribute("data-mint-rt-fixed-controls"), this.innerHTML = i, this._replaceUtilityClasses(), this._updatePagination(), this.querySelectorAll("mint-button[data-action]").forEach((e) => {
|
|
1199
|
+
e.render && e.render();
|
|
1200
|
+
}), this.querySelectorAll("mint-button[data-mint-rt-toolbar]").forEach((e) => {
|
|
1201
|
+
e.render && e.render();
|
|
1202
|
+
}), this.querySelectorAll("mint-button[data-button-type]").forEach((e) => {
|
|
1203
|
+
e.render && e.render();
|
|
1204
|
+
}), this._attachEventListeners(), this._type === "ajax" && !this._loaded && !this._fetching && !this._loading && this._fetchData();
|
|
1205
|
+
}
|
|
1206
|
+
_attachRowClickHandler() {
|
|
1207
|
+
this._rowClickHandler && this.removeEventListener("click", this._rowClickHandler, !0);
|
|
1208
|
+
let e = (e) => {
|
|
1209
|
+
let t = e.target;
|
|
1210
|
+
if (t.tagName === "MINT-BUTTON" || t.tagName === "BUTTON" || t.closest("mint-button") || t.closest("button") || t.closest("mint-popover") || t.closest("[data-action]")) return;
|
|
1211
|
+
let n = t.closest("tr[data-row-clickable=\"true\"]") || t.closest("li[data-row-clickable=\"true\"]");
|
|
1212
|
+
if (!n) return;
|
|
1213
|
+
let r = n.getAttribute("data-row-index");
|
|
1214
|
+
if (!r) return;
|
|
1215
|
+
let i = parseInt(r), a = this._getRowDataForEventIndex(i);
|
|
1216
|
+
!a || !this._configuration?.onRowClick || (this._configuration.onRowClick.length === 1 ? this._configuration.onRowClick(a) : this._configuration.onRowClick(this, a));
|
|
1217
|
+
};
|
|
1218
|
+
this.addEventListener("click", e, !0), this._rowClickHandler = e;
|
|
1219
|
+
}
|
|
1220
|
+
_attachPaginationListeners() {
|
|
1221
|
+
this.querySelectorAll("[data-action=\"page\"]").forEach((e) => {
|
|
1222
|
+
e.addEventListener("click", () => {
|
|
1223
|
+
if (e.getAttribute("active") === "true") return;
|
|
1224
|
+
let t = parseInt(e.getAttribute("data-page") || "1");
|
|
1225
|
+
t !== this._currentPage && this._goToPage(t);
|
|
1226
|
+
});
|
|
1227
|
+
}), this.querySelectorAll("[data-action=\"page-prev\"]").forEach((e) => {
|
|
1228
|
+
e.addEventListener("click", () => {
|
|
1229
|
+
this._goToPage(this._currentPage - 1);
|
|
1230
|
+
});
|
|
1231
|
+
}), this.querySelectorAll("[data-action=\"page-next\"]").forEach((e) => {
|
|
1232
|
+
e.addEventListener("click", () => {
|
|
1233
|
+
this._goToPage(this._currentPage + 1);
|
|
1234
|
+
});
|
|
1235
|
+
});
|
|
1236
|
+
}
|
|
1237
|
+
_attachTableEventListeners() {
|
|
1238
|
+
this.querySelectorAll("[data-action=\"row-action\"]").forEach((e) => {
|
|
1239
|
+
e.addEventListener("click", () => {
|
|
1240
|
+
let t = parseInt(e.getAttribute("data-row-index") || "0"), n = parseInt(e.getAttribute("data-action-index") || "0"), r = parseInt(e.getAttribute("data-column-key") || "0"), i = this._getRowDataForEventIndex(t), a = this._configuration?.columns[r];
|
|
1241
|
+
a && a.actions && a.actions[n] && i !== void 0 && a.actions[n].onClick(this, i);
|
|
1242
|
+
});
|
|
1243
|
+
}), this.querySelectorAll("[data-action=\"column-action\"]").forEach((e) => {
|
|
1244
|
+
e.addEventListener("click", () => {
|
|
1245
|
+
let t = parseInt(e.getAttribute("data-row-index") || "0"), n = parseInt(e.getAttribute("data-column-key") || "0"), r = this._getRowDataForEventIndex(t), i = this._configuration?.columns[n];
|
|
1246
|
+
i && i.action && r !== void 0 && i.action.onClick(this, r);
|
|
1247
|
+
});
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
_attachEventListeners() {
|
|
1251
|
+
let e = this.querySelector(`#search-${this._tableId}`);
|
|
1252
|
+
if (e) {
|
|
1253
|
+
let t = e.querySelector("input") || e._element;
|
|
1254
|
+
t ? t.addEventListener("input", (e) => {
|
|
1255
|
+
this._search = e.target.value, this._triggerSearch();
|
|
1256
|
+
}) : e.addEventListener("input", (t) => {
|
|
1257
|
+
this._search = e.value || t.target.value || "", this._triggerSearch();
|
|
1258
|
+
});
|
|
1259
|
+
}
|
|
1260
|
+
this._attachTableEventListeners(), this._attachRowClickHandler(), this.querySelectorAll("th[data-column-key]").forEach((e) => {
|
|
1261
|
+
e.addEventListener("click", () => {
|
|
1262
|
+
let t = parseInt(e.getAttribute("data-column-key") || "0"), n = this._configuration?.columns[t];
|
|
1263
|
+
n && this._toggleSort(n);
|
|
1264
|
+
});
|
|
1265
|
+
}), this.querySelectorAll("[data-action=\"mobile-sort\"]").forEach((e) => {
|
|
1266
|
+
e.addEventListener("click", (t) => {
|
|
1267
|
+
t.stopPropagation();
|
|
1268
|
+
let n = parseInt(e.getAttribute("data-column-key") || "0", 10), r = this._configuration?.columns[n];
|
|
1269
|
+
r && (this._closeMobileSortPopover(), this._toggleSort(r));
|
|
1270
|
+
});
|
|
1271
|
+
}), this.querySelectorAll("[data-button-type]").forEach((e) => {
|
|
1272
|
+
e.addEventListener("click", () => {
|
|
1273
|
+
let t = e.getAttribute("data-button-type"), n = this._configuration?.buttons?.find((e) => (e.type || "custom") === t);
|
|
1274
|
+
n && this._handleButtonClick(n);
|
|
1275
|
+
});
|
|
1276
|
+
}), this._attachPaginationListeners(), this._virtualScrollActive() && (this._type === "provided" || this._type === "ajax") && this._attachVirtualScrollListeners(), this._fixedHeader() && this._fixedControls() && queueMicrotask(() => {
|
|
1277
|
+
this._syncFixedControlsChromeHeight(), requestAnimationFrame(() => this._syncFixedControlsChromeHeight());
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
_escapeHtml(e) {
|
|
1281
|
+
let t = document.createElement("div");
|
|
1282
|
+
return t.textContent = e, t.innerHTML;
|
|
1283
|
+
}
|
|
1284
|
+
_getPageFromUrl() {
|
|
1285
|
+
if (!this._tableId) return null;
|
|
1286
|
+
let e = new URLSearchParams(window.location.search).get(`mui.${this._tableId}`);
|
|
1287
|
+
if (!e) return null;
|
|
1288
|
+
let t = parseInt(e, 10);
|
|
1289
|
+
return isNaN(t) || t < 1 ? null : t;
|
|
1290
|
+
}
|
|
1291
|
+
_updatePageInUrl(e) {
|
|
1292
|
+
if (!this._tableId) return;
|
|
1293
|
+
let t = new URL(window.location.href), n = t.searchParams;
|
|
1294
|
+
n.set(`mui.${this._tableId}`, e.toString()), e === 1 && n.set(`mui.${this._tableId}`, "1"), window.history.replaceState({}, "", t.toString());
|
|
1295
|
+
}
|
|
1296
|
+
_loadPageFromUrl() {
|
|
1297
|
+
if (!this._configuration || !this._tableId) return;
|
|
1298
|
+
let e = this._getPageFromUrl();
|
|
1299
|
+
e !== null && (this._currentPage = e, this._offset = (this._currentPage - 1) * this._perPage);
|
|
1300
|
+
}
|
|
1301
|
+
};
|
|
1302
|
+
customElements.get("mint-resource-table") || e("mint-resource-table", n);
|
|
1303
|
+
//#endregion
|
|
1304
|
+
//#region src/components/resource-table/ResourceTableContextMenu.ts
|
|
1305
|
+
var r = 550, i = 12, a = { passive: !0 }, o = class extends HTMLElement {
|
|
1306
|
+
constructor(...e) {
|
|
1307
|
+
super(...e), this._table = null, this._anchor = null, this._popover = null, this._menuRoot = null, this._baseId = "", this._touchTimer = null, this._touchStart = null, this._slotObserver = null, this._scrollCloseTargets = [], this._onScrollClose = () => {
|
|
1308
|
+
this._closePopover();
|
|
1309
|
+
}, this._onContextMenu = (e) => {
|
|
1310
|
+
let t = e, n = this._rowTargetFromEventTarget(t.target);
|
|
1311
|
+
n && (t.preventDefault(), this._openAtRowIndex(n.index, t.clientX, t.clientY));
|
|
1312
|
+
}, this._onTouchStart = (e) => {
|
|
1313
|
+
let t = e;
|
|
1314
|
+
if (!t.touches.length) return;
|
|
1315
|
+
let n = this._rowTargetFromEventTarget(t.target);
|
|
1316
|
+
if (!n) return;
|
|
1317
|
+
let r = t.touches[0];
|
|
1318
|
+
this._touchStart = {
|
|
1319
|
+
x: r.clientX,
|
|
1320
|
+
y: r.clientY,
|
|
1321
|
+
rowIndex: n.index
|
|
1322
|
+
}, this._touchTimer !== null && (window.clearTimeout(this._touchTimer), this._touchTimer = null);
|
|
1323
|
+
let i = this._longPressMs();
|
|
1324
|
+
this._touchTimer = window.setTimeout(() => {
|
|
1325
|
+
this._touchTimer = null, this._touchStart &&= (this._openAtRowIndex(this._touchStart.rowIndex, this._touchStart.x, this._touchStart.y), null);
|
|
1326
|
+
}, i);
|
|
1327
|
+
}, this._onTouchMove = (e) => {
|
|
1328
|
+
if (!this._touchStart || this._touchTimer === null) return;
|
|
1329
|
+
let t = e.touches[0];
|
|
1330
|
+
if (!t) return;
|
|
1331
|
+
let n = t.clientX - this._touchStart.x, r = t.clientY - this._touchStart.y;
|
|
1332
|
+
n * n + r * r > i * i && (this._clearTouchTimer(), this._touchStart = null);
|
|
1333
|
+
}, this._onTouchEnd = () => {
|
|
1334
|
+
this._clearTouchTimer(), this._touchStart = null;
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1337
|
+
static get observedAttributes() {
|
|
1338
|
+
return ["for", "long-press-ms"];
|
|
1339
|
+
}
|
|
1340
|
+
connectedCallback() {
|
|
1341
|
+
this.classList.add("contents"), this._baseId = this.id?.trim() || `mint-rt-ctx-${Math.random().toString(36).slice(2, 10)}`, this._anchor = document.createElement("div"), this._anchor.id = `${this._baseId}-anchor`, this._anchor.setAttribute("aria-hidden", "true"), this._anchor.className = "pointer-events-none fixed z-0 h-px w-px overflow-hidden p-0 m-0 border-0 opacity-0", document.body.appendChild(this._anchor), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("data-mint-rt-ctx-internal", ""), this._popover.id = `${this._baseId}-popover`, this._popover.setAttribute("trigger-id", this._anchor.id), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), this._menuRoot = document.createElement("div"), this._menuRoot.className = "flex min-w-[11rem] flex-col gap-0.5 py-1", this._popover.appendChild(this._menuRoot), this.appendChild(this._popover), this._slotObserver = new MutationObserver(() => {
|
|
1342
|
+
this._hideMenuSlotSources();
|
|
1343
|
+
}), this._slotObserver.observe(this, { childList: !0 }), queueMicrotask(() => {
|
|
1344
|
+
this._hideMenuSlotSources(), this._bindTable();
|
|
1345
|
+
});
|
|
1346
|
+
}
|
|
1347
|
+
disconnectedCallback() {
|
|
1348
|
+
this._slotObserver?.disconnect(), this._slotObserver = null, this._unbindTable(), this._anchor?.remove(), this._anchor = null, this._popover?.remove(), this._popover = null, this._menuRoot = null;
|
|
1349
|
+
}
|
|
1350
|
+
attributeChangedCallback() {
|
|
1351
|
+
this.isConnected && this._bindTable();
|
|
1352
|
+
}
|
|
1353
|
+
_longPressMs() {
|
|
1354
|
+
let e = parseInt(this.getAttribute("long-press-ms") || "", 10);
|
|
1355
|
+
return !Number.isNaN(e) && e > 100 ? e : r;
|
|
1356
|
+
}
|
|
1357
|
+
_resolveTable() {
|
|
1358
|
+
let e = this.getAttribute("for")?.trim();
|
|
1359
|
+
if (e) {
|
|
1360
|
+
let t = document.getElementById(e);
|
|
1361
|
+
return t && t.tagName === "MINT-RESOURCE-TABLE" ? t : null;
|
|
1362
|
+
}
|
|
1363
|
+
let t = this.previousElementSibling;
|
|
1364
|
+
return t && t.tagName === "MINT-RESOURCE-TABLE" ? t : this.parentElement?.querySelector?.("mint-resource-table") ?? null;
|
|
1365
|
+
}
|
|
1366
|
+
_hideMenuSlotSources() {
|
|
1367
|
+
for (let e of Array.from(this.children)) e === this._popover || e.hasAttribute("data-mint-rt-ctx-internal") || e.setAttribute("hidden", "");
|
|
1368
|
+
}
|
|
1369
|
+
_bindTable() {
|
|
1370
|
+
this._unbindTable(), this._table = this._resolveTable(), this._table && (this._table.addEventListener("contextmenu", this._onContextMenu, !0), this._table.addEventListener("touchstart", this._onTouchStart, { passive: !0 }), this._table.addEventListener("touchmove", this._onTouchMove, { passive: !0 }), this._table.addEventListener("touchend", this._onTouchEnd, { passive: !0 }), this._table.addEventListener("touchcancel", this._onTouchEnd, { passive: !0 }));
|
|
1371
|
+
}
|
|
1372
|
+
_unbindTable() {
|
|
1373
|
+
this._closePopover(), this._table &&= (this._table.removeEventListener("contextmenu", this._onContextMenu, !0), this._table.removeEventListener("touchstart", this._onTouchStart), this._table.removeEventListener("touchmove", this._onTouchMove), this._table.removeEventListener("touchend", this._onTouchEnd), this._table.removeEventListener("touchcancel", this._onTouchEnd), null);
|
|
1374
|
+
}
|
|
1375
|
+
_rowTargetFromEventTarget(e) {
|
|
1376
|
+
if (!e || !this._table) return null;
|
|
1377
|
+
let t = e.closest?.("tr[data-row-index], li[data-row-index]");
|
|
1378
|
+
if (!t || !this._table.contains(t) || t.hasAttribute("data-mint-rt-spacer") || t.getAttribute("data-mint-rt-placeholder") === "true") return null;
|
|
1379
|
+
let n = t.getAttribute("data-row-index");
|
|
1380
|
+
if (n == null) return null;
|
|
1381
|
+
let r = parseInt(n, 10);
|
|
1382
|
+
return Number.isNaN(r) ? null : { index: r };
|
|
1383
|
+
}
|
|
1384
|
+
_clearTouchTimer() {
|
|
1385
|
+
this._touchTimer !== null && (window.clearTimeout(this._touchTimer), this._touchTimer = null);
|
|
1386
|
+
}
|
|
1387
|
+
_positionAnchor(e, t) {
|
|
1388
|
+
this._anchor && (this._anchor.style.left = `${Math.round(e)}px`, this._anchor.style.top = `${Math.round(t)}px`);
|
|
1389
|
+
}
|
|
1390
|
+
_slotTemplateElements() {
|
|
1391
|
+
return Array.from(this.children).filter((e) => e !== this._popover && e instanceof HTMLElement && !e.hasAttribute("data-mint-rt-ctx-internal"));
|
|
1392
|
+
}
|
|
1393
|
+
_elementIsScrollContainer(e) {
|
|
1394
|
+
let t = getComputedStyle(e);
|
|
1395
|
+
return t.overflowX === "auto" || t.overflowX === "scroll" || t.overflowY === "auto" || t.overflowY === "scroll";
|
|
1396
|
+
}
|
|
1397
|
+
_collectScrollCloseTargets(e) {
|
|
1398
|
+
let t = [], n = /* @__PURE__ */ new Set(), r = (e) => {
|
|
1399
|
+
!e || n.has(e) || (n.add(e), t.push(e));
|
|
1400
|
+
};
|
|
1401
|
+
r(window), e.querySelectorAll("[id^=\"mint-rt-vscroll-\"]").forEach((e) => {
|
|
1402
|
+
this._elementIsScrollContainer(e) && r(e);
|
|
1403
|
+
});
|
|
1404
|
+
let i = e.querySelector("mint-table");
|
|
1405
|
+
for (; i && i !== e;) this._elementIsScrollContainer(i) && r(i), i = i.parentElement;
|
|
1406
|
+
return this._elementIsScrollContainer(e) && r(e), t;
|
|
1407
|
+
}
|
|
1408
|
+
_detachScrollCloseListeners() {
|
|
1409
|
+
for (let e of this._scrollCloseTargets) e.removeEventListener("scroll", this._onScrollClose, a);
|
|
1410
|
+
this._scrollCloseTargets = [];
|
|
1411
|
+
}
|
|
1412
|
+
_attachScrollCloseListeners(e) {
|
|
1413
|
+
this._detachScrollCloseListeners(), this._scrollCloseTargets = this._collectScrollCloseTargets(e);
|
|
1414
|
+
for (let e of this._scrollCloseTargets) e.addEventListener("scroll", this._onScrollClose, a);
|
|
1415
|
+
}
|
|
1416
|
+
_closePopover() {
|
|
1417
|
+
if (this._detachScrollCloseListeners(), !this._popover?.hasAttribute("open")) return;
|
|
1418
|
+
let e = this._popover;
|
|
1419
|
+
typeof e.close == "function" ? e.close() : this._popover.removeAttribute("open");
|
|
1420
|
+
}
|
|
1421
|
+
_openAtRowIndex(e, t, n) {
|
|
1422
|
+
this._closePopover();
|
|
1423
|
+
let r = this._resolveTable();
|
|
1424
|
+
if (!r || typeof r.getRowByIndex != "function" || !this._popover || !this._menuRoot) return;
|
|
1425
|
+
let i = this._popover, a = this._menuRoot, o = r.getRowByIndex(e);
|
|
1426
|
+
if (o === void 0) return;
|
|
1427
|
+
let s = this._slotTemplateElements();
|
|
1428
|
+
if (!s.length) return;
|
|
1429
|
+
this._positionAnchor(t, n), a.innerHTML = "", s.forEach((t) => {
|
|
1430
|
+
if (t.hasAttribute("data-mint-rt-ctx-if-selection") && !(window.getSelection?.()?.toString?.()?.trim() ?? "")) return;
|
|
1431
|
+
let n = t.cloneNode(!0);
|
|
1432
|
+
n.removeAttribute("hidden"), n.addEventListener("click", (t) => {
|
|
1433
|
+
t.stopPropagation();
|
|
1434
|
+
let r = n.getAttribute("data-context-action") || n.querySelector?.("[data-context-action]")?.getAttribute("data-context-action") || "", i = window.getSelection?.()?.toString?.()?.trim() ?? "";
|
|
1435
|
+
this.dispatchEvent(new CustomEvent("context-action", {
|
|
1436
|
+
bubbles: !0,
|
|
1437
|
+
composed: !0,
|
|
1438
|
+
detail: {
|
|
1439
|
+
action: r,
|
|
1440
|
+
row: o,
|
|
1441
|
+
rowIndex: e,
|
|
1442
|
+
selectedText: i
|
|
1443
|
+
}
|
|
1444
|
+
})), this._closePopover();
|
|
1445
|
+
}), a.appendChild(n);
|
|
1446
|
+
let r = n;
|
|
1447
|
+
typeof r.render == "function" && queueMicrotask(() => r.render());
|
|
1448
|
+
}), i.removeAttribute("open"), i.offsetHeight, i.setAttribute("open", "true");
|
|
1449
|
+
let c = i;
|
|
1450
|
+
typeof c.render == "function" && queueMicrotask(() => c.render());
|
|
1451
|
+
let l = this._resolveTable();
|
|
1452
|
+
l && this._attachScrollCloseListeners(l);
|
|
1453
|
+
}
|
|
1454
|
+
};
|
|
1455
|
+
customElements.get("mint-resource-table-context-menu") || e("mint-resource-table-context-menu", o);
|
|
1456
|
+
//#endregion
|
|
1457
|
+
export { n as default };
|