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,354 @@
|
|
|
1
|
+
import '../../theme.css'
|
|
2
|
+
import '../../input.css'
|
|
3
|
+
import '../../icon.css'
|
|
4
|
+
import '../../popover.css'
|
|
5
|
+
import '../../stack.css'
|
|
6
|
+
import '../../text.css'
|
|
7
|
+
import '../../time-picker.css'
|
|
8
|
+
import "../chunks/icon-gQAtsERy.js";
|
|
9
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
10
|
+
import "../chunks/text-BHkEs8U5.js";
|
|
11
|
+
import "../chunks/input-8bbXzpa5.js";
|
|
12
|
+
import "../chunks/popover-gviDCspV.js";
|
|
13
|
+
//#region src/components/time-picker/TimePicker.ts
|
|
14
|
+
var t = class extends HTMLElement {
|
|
15
|
+
constructor(...e) {
|
|
16
|
+
super(...e), this._triggerId = `mint-time-picker-trigger-${Math.random().toString(36).slice(2, 10)}`, this._popover = null, this._popoverObserver = null, this._inputEl = null, this._hiddenInput = null, this._single = {
|
|
17
|
+
hour: 9,
|
|
18
|
+
minute: 0,
|
|
19
|
+
second: 0,
|
|
20
|
+
meridiem: "AM"
|
|
21
|
+
}, this._rangeStart = {
|
|
22
|
+
hour: 9,
|
|
23
|
+
minute: 0,
|
|
24
|
+
second: 0,
|
|
25
|
+
meridiem: "AM"
|
|
26
|
+
}, this._rangeEnd = {
|
|
27
|
+
hour: 5,
|
|
28
|
+
minute: 0,
|
|
29
|
+
second: 0,
|
|
30
|
+
meridiem: "PM"
|
|
31
|
+
}, this._invalidFromInput = !1;
|
|
32
|
+
}
|
|
33
|
+
static get observedAttributes() {
|
|
34
|
+
return [
|
|
35
|
+
"value",
|
|
36
|
+
"label",
|
|
37
|
+
"info",
|
|
38
|
+
"disabled",
|
|
39
|
+
"id",
|
|
40
|
+
"name",
|
|
41
|
+
"required",
|
|
42
|
+
"readonly",
|
|
43
|
+
"range",
|
|
44
|
+
"hours",
|
|
45
|
+
"minutes",
|
|
46
|
+
"seconds",
|
|
47
|
+
"error",
|
|
48
|
+
"error-message"
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
connectedCallback() {
|
|
52
|
+
this.classList.add("mint-time-picker-host"), this._parseAndApplyValue(this.getAttribute("value") || ""), this.render();
|
|
53
|
+
}
|
|
54
|
+
disconnectedCallback() {
|
|
55
|
+
this._popoverObserver &&= (this._popoverObserver.disconnect(), null);
|
|
56
|
+
}
|
|
57
|
+
attributeChangedCallback(e, t, n) {
|
|
58
|
+
if (t !== n) {
|
|
59
|
+
if (e === "value") {
|
|
60
|
+
if (this._parseAndApplyValue(n || ""), this._syncHiddenInput(), this._syncInputValue(), this._popover) {
|
|
61
|
+
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
62
|
+
e && this._buildPopoverContent(e);
|
|
63
|
+
}
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
e !== "error" && e !== "error-message" && (this._invalidFromInput = !1), this.render();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
get value() {
|
|
70
|
+
return this.getValue();
|
|
71
|
+
}
|
|
72
|
+
set value(e) {
|
|
73
|
+
this.setValue(e || "");
|
|
74
|
+
}
|
|
75
|
+
getValue() {
|
|
76
|
+
return this.getAttribute("value") || "";
|
|
77
|
+
}
|
|
78
|
+
setValue(e) {
|
|
79
|
+
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this._parseAndApplyValue(e || ""), this._syncHiddenInput(), this._syncInputValue();
|
|
80
|
+
}
|
|
81
|
+
isRange() {
|
|
82
|
+
return this.getAttribute("range") === "true";
|
|
83
|
+
}
|
|
84
|
+
isHoursEnabled() {
|
|
85
|
+
let e = this.getAttribute("hours");
|
|
86
|
+
return e === null ? !0 : e !== "false";
|
|
87
|
+
}
|
|
88
|
+
isMinutesEnabled() {
|
|
89
|
+
let e = this.getAttribute("minutes");
|
|
90
|
+
return e === null ? !0 : e !== "false";
|
|
91
|
+
}
|
|
92
|
+
isSecondsEnabled() {
|
|
93
|
+
let e = this.getAttribute("seconds");
|
|
94
|
+
return e === null ? !1 : e !== "false";
|
|
95
|
+
}
|
|
96
|
+
isDisabled() {
|
|
97
|
+
return this.getAttribute("disabled") === "true";
|
|
98
|
+
}
|
|
99
|
+
isReadonly() {
|
|
100
|
+
return this.getAttribute("readonly") === "true";
|
|
101
|
+
}
|
|
102
|
+
isRequired() {
|
|
103
|
+
return this.getAttribute("required") === "true";
|
|
104
|
+
}
|
|
105
|
+
hasExternalError() {
|
|
106
|
+
return this.getAttribute("error") === "true";
|
|
107
|
+
}
|
|
108
|
+
getExternalErrorMessage() {
|
|
109
|
+
return this.getAttribute("error-message") || "";
|
|
110
|
+
}
|
|
111
|
+
getLabel() {
|
|
112
|
+
return this.getAttribute("label") || "";
|
|
113
|
+
}
|
|
114
|
+
getInfo() {
|
|
115
|
+
return this.getAttribute("info") || "";
|
|
116
|
+
}
|
|
117
|
+
getName() {
|
|
118
|
+
return this.getAttribute("name") || "";
|
|
119
|
+
}
|
|
120
|
+
_getEffectiveError() {
|
|
121
|
+
return {
|
|
122
|
+
hasError: this.hasExternalError(),
|
|
123
|
+
message: this.getExternalErrorMessage()
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
_formatParts(e) {
|
|
127
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = [];
|
|
128
|
+
return t && i.push(e.hour.toString()), n && i.push(e.minute.toString().padStart(2, "0")), r && i.push(e.second.toString().padStart(2, "0")), t ? `${i.join(":")} ${e.meridiem.toLowerCase()}` : i.join(":");
|
|
129
|
+
}
|
|
130
|
+
_to24Hour(e) {
|
|
131
|
+
let t = e.hour % 12;
|
|
132
|
+
return e.meridiem === "PM" && (t += 12), {
|
|
133
|
+
hour: t,
|
|
134
|
+
minute: e.minute,
|
|
135
|
+
second: e.second
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
_formatParts24(e) {
|
|
139
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = this._to24Hour(e), a = [];
|
|
140
|
+
return t && a.push(i.hour.toString().padStart(2, "0")), n && a.push(i.minute.toString().padStart(2, "0")), r && a.push(i.second.toString().padStart(2, "0")), a.join(":");
|
|
141
|
+
}
|
|
142
|
+
_getDisplayValue() {
|
|
143
|
+
return this.isRange() ? `${this._formatParts(this._rangeStart)} - ${this._formatParts(this._rangeEnd)}` : this._formatParts(this._single);
|
|
144
|
+
}
|
|
145
|
+
_getOutputValue() {
|
|
146
|
+
return this.isRange() ? `${this._formatParts24(this._rangeStart)} - ${this._formatParts24(this._rangeEnd)}` : this._formatParts24(this._single);
|
|
147
|
+
}
|
|
148
|
+
_getExpectedFormat() {
|
|
149
|
+
let e = this.isHoursEnabled(), t = this.isMinutesEnabled(), n = this.isSecondsEnabled(), r = [];
|
|
150
|
+
e && r.push("h"), t && r.push("mm"), n && r.push("ss");
|
|
151
|
+
let i = e ? `${r.join(":")} am/pm` : r.join(":");
|
|
152
|
+
return this.isRange() ? `${i} - ${i}` : i;
|
|
153
|
+
}
|
|
154
|
+
_syncHiddenInput() {
|
|
155
|
+
this._hiddenInput && (this._hiddenInput.value = this.getValue() || this._getOutputValue());
|
|
156
|
+
}
|
|
157
|
+
_syncInputValue() {
|
|
158
|
+
this._inputEl && (this._inputEl.value = this._getDisplayValue(), typeof this._inputEl.render == "function" && this._inputEl.render());
|
|
159
|
+
}
|
|
160
|
+
_emitChangeFromPicker() {
|
|
161
|
+
let e = this._getOutputValue();
|
|
162
|
+
this._invalidFromInput = !1, this.setAttribute("value", e), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
163
|
+
bubbles: !0,
|
|
164
|
+
composed: !0
|
|
165
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
166
|
+
}
|
|
167
|
+
_parseSingle(e) {
|
|
168
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
169
|
+
if (t) {
|
|
170
|
+
let e = i.match(/^(\d{1,2})(?::(\d{2}))?(?::(\d{2}))?\s*(am|pm)$/i);
|
|
171
|
+
if (!e) return null;
|
|
172
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0), s = e[4].toUpperCase();
|
|
173
|
+
return t < 1 || t > 12 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59) ? null : {
|
|
174
|
+
hour: t,
|
|
175
|
+
minute: a,
|
|
176
|
+
second: o,
|
|
177
|
+
meridiem: s
|
|
178
|
+
};
|
|
179
|
+
}
|
|
180
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
181
|
+
if (!a) return null;
|
|
182
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
183
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
184
|
+
hour: 12,
|
|
185
|
+
minute: o,
|
|
186
|
+
second: s,
|
|
187
|
+
meridiem: "AM"
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
_parseSingleOutput24(e) {
|
|
191
|
+
let t = this.isHoursEnabled(), n = this.isMinutesEnabled(), r = this.isSecondsEnabled(), i = e.trim();
|
|
192
|
+
if (t) {
|
|
193
|
+
let e = i.match(/^(\d{2})(?::(\d{2}))?(?::(\d{2}))?$/);
|
|
194
|
+
if (!e) return null;
|
|
195
|
+
let t = Number(e[1]), a = Number(e[2] ?? 0), o = Number(e[3] ?? 0);
|
|
196
|
+
if (t < 0 || t > 23 || n && (a < 0 || a > 59) || r && (o < 0 || o > 59)) return null;
|
|
197
|
+
let s = t >= 12 ? "PM" : "AM";
|
|
198
|
+
return {
|
|
199
|
+
hour: t % 12 == 0 ? 12 : t % 12,
|
|
200
|
+
minute: a,
|
|
201
|
+
second: o,
|
|
202
|
+
meridiem: s
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
let a = i.match(/^(\d{2})(?::(\d{2}))?$/);
|
|
206
|
+
if (!a) return null;
|
|
207
|
+
let o = Number(a[1]), s = Number(a[2] ?? 0);
|
|
208
|
+
return n && (o < 0 || o > 59) || r && (s < 0 || s > 59) ? null : {
|
|
209
|
+
hour: 12,
|
|
210
|
+
minute: o,
|
|
211
|
+
second: s,
|
|
212
|
+
meridiem: "AM"
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
_parseAndApplyValue(e) {
|
|
216
|
+
if (!e) return !1;
|
|
217
|
+
if (this.isRange()) {
|
|
218
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingleOutput24(t || ""), i = this._parseSingleOutput24(n || "");
|
|
219
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
220
|
+
}
|
|
221
|
+
let t = this._parseSingleOutput24(e);
|
|
222
|
+
return t ? (this._single = t, !0) : !1;
|
|
223
|
+
}
|
|
224
|
+
_parseAndApplyDisplayValue(e) {
|
|
225
|
+
if (!e) return !1;
|
|
226
|
+
if (this.isRange()) {
|
|
227
|
+
let [t, n] = e.split("-").map((e) => e.trim()), r = this._parseSingle(t || ""), i = this._parseSingle(n || "");
|
|
228
|
+
return !r || !i ? !1 : (this._rangeStart = r, this._rangeEnd = i, !0);
|
|
229
|
+
}
|
|
230
|
+
let t = this._parseSingle(e);
|
|
231
|
+
return t ? (this._single = t, !0) : !1;
|
|
232
|
+
}
|
|
233
|
+
_handleTypedValue(e) {
|
|
234
|
+
let t = e.trim();
|
|
235
|
+
if (!t) {
|
|
236
|
+
this._invalidFromInput = !1, this.removeAttribute("value"), this._syncHiddenInput(), this._syncInputValue();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
if (!this._parseAndApplyDisplayValue(t)) {
|
|
240
|
+
this._invalidFromInput = !0, this.removeAttribute("value"), this._inputEl && (this._inputEl.value = ""), this._syncHiddenInput(), this.render(), this.dispatchEvent(new Event("input", {
|
|
241
|
+
bubbles: !0,
|
|
242
|
+
composed: !0
|
|
243
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
this._invalidFromInput = !1;
|
|
247
|
+
let n = this._getOutputValue();
|
|
248
|
+
this.setAttribute("value", n), this._syncHiddenInput(), this._syncInputValue(), this.dispatchEvent(new Event("input", {
|
|
249
|
+
bubbles: !0,
|
|
250
|
+
composed: !0
|
|
251
|
+
})), this.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
252
|
+
}
|
|
253
|
+
_buildColumn(e, t, n, r = !0, i = "standard", a = "Time") {
|
|
254
|
+
let o = document.createElement("div");
|
|
255
|
+
return o.className = `mint-time-picker-column mint-time-picker-column-${i}${r ? " mint-time-picker-column-divider" : ""}`, o.setAttribute("role", "group"), o.setAttribute("aria-label", a), e.forEach((e) => {
|
|
256
|
+
let r = document.createElement("button");
|
|
257
|
+
r.type = "button";
|
|
258
|
+
let i = e === t;
|
|
259
|
+
r.className = `mint-time-picker-option${i ? " is-selected" : ""}`, r.dataset.selected = i ? "true" : "false", r.setAttribute("aria-pressed", String(i)), r.setAttribute("aria-label", `${a}: ${e}`), r.textContent = e, r.addEventListener("click", () => n(e)), o.appendChild(r);
|
|
260
|
+
}), o;
|
|
261
|
+
}
|
|
262
|
+
_centerSelectedInColumn(e, t = 0) {
|
|
263
|
+
let n = e.querySelector("button[data-selected=\"true\"]");
|
|
264
|
+
if (!n) return;
|
|
265
|
+
let r = n.offsetTop - (e.clientHeight / 2 - n.clientHeight / 2) - t;
|
|
266
|
+
e.scrollTop = Math.max(0, r);
|
|
267
|
+
}
|
|
268
|
+
_centerAllColumnsInPopoverBody() {
|
|
269
|
+
if (!this._popover) return;
|
|
270
|
+
let e = this._popover.querySelector("[data-mint-time-picker-body=\"true\"]");
|
|
271
|
+
if (!e) return;
|
|
272
|
+
let t = Array.from(e.querySelectorAll(".mint-time-picker-column")), n = this.isRange() ? 20 : 0;
|
|
273
|
+
t.forEach((e) => this._centerSelectedInColumn(e, n));
|
|
274
|
+
}
|
|
275
|
+
_setupPopoverOpenObserver() {
|
|
276
|
+
this._popover && (this._popoverObserver &&= (this._popoverObserver.disconnect(), null), this._popoverObserver = new MutationObserver(() => {
|
|
277
|
+
this._popover?.getAttribute("open") === "true" && requestAnimationFrame(() => {
|
|
278
|
+
requestAnimationFrame(() => {
|
|
279
|
+
this._centerAllColumnsInPopoverBody();
|
|
280
|
+
});
|
|
281
|
+
});
|
|
282
|
+
}), this._popoverObserver.observe(this._popover, {
|
|
283
|
+
attributes: !0,
|
|
284
|
+
attributeFilter: ["open"]
|
|
285
|
+
}));
|
|
286
|
+
}
|
|
287
|
+
_buildPickerSet(e, t, n) {
|
|
288
|
+
let r = this.isHoursEnabled(), i = this.isMinutesEnabled(), a = this.isSecondsEnabled(), o = document.createElement("div"), s = (r ? 1 : 0) + (i ? 1 : 0) + (a ? 1 : 0) + (r ? 1 : 0);
|
|
289
|
+
o.className = "mint-time-picker-wheel", o.style.gridTemplateColumns = `repeat(${Math.max(s, 1)}, minmax(0, 1fr))`;
|
|
290
|
+
let c = Array.from({ length: 12 }, (e, t) => (t + 1).toString().padStart(2, "0")), l = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), u = Array.from({ length: 60 }, (e, t) => t.toString().padStart(2, "0")), d = ["AM", "PM"], f = [];
|
|
291
|
+
r && f.push(this._buildColumn(c, t.hour.toString().padStart(2, "0"), (e) => {
|
|
292
|
+
n({
|
|
293
|
+
...t,
|
|
294
|
+
hour: Number(e)
|
|
295
|
+
});
|
|
296
|
+
}, !0, "tall", "Hour")), i && f.push(this._buildColumn(l, t.minute.toString().padStart(2, "0"), (e) => {
|
|
297
|
+
n({
|
|
298
|
+
...t,
|
|
299
|
+
minute: Number(e)
|
|
300
|
+
});
|
|
301
|
+
}, !0, "tall", "Minute")), a && f.push(this._buildColumn(u, t.second.toString().padStart(2, "0"), (e) => {
|
|
302
|
+
n({
|
|
303
|
+
...t,
|
|
304
|
+
second: Number(e)
|
|
305
|
+
});
|
|
306
|
+
}, !0, "tall", "Second")), r && f.push(this._buildColumn(d, t.meridiem, (e) => {
|
|
307
|
+
n({
|
|
308
|
+
...t,
|
|
309
|
+
meridiem: e
|
|
310
|
+
});
|
|
311
|
+
}, !0, "compact", "Meridiem")), f.forEach((e, t) => {
|
|
312
|
+
t === f.length - 1 && e.classList.remove("mint-time-picker-column-divider"), o.appendChild(e);
|
|
313
|
+
}), e.appendChild(o);
|
|
314
|
+
}
|
|
315
|
+
_buildPopoverContent(e) {
|
|
316
|
+
if (e.innerHTML = "", !this.isRange()) {
|
|
317
|
+
this._buildPickerSet(e, this._single, (t) => {
|
|
318
|
+
this._single = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
319
|
+
});
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
322
|
+
let t = document.createElement("div");
|
|
323
|
+
t.className = "mint-time-picker-range";
|
|
324
|
+
let n = document.createElement("div"), r = document.createElement("mint-text");
|
|
325
|
+
r.setAttribute("variant", "muted"), r.className = "mint-time-picker-range-label", r.textContent = "Start", n.appendChild(r), this._buildPickerSet(n, this._rangeStart, (t) => {
|
|
326
|
+
this._rangeStart = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
327
|
+
});
|
|
328
|
+
let i = document.createElement("div"), a = document.createElement("mint-text");
|
|
329
|
+
a.setAttribute("variant", "muted"), a.className = "mint-time-picker-range-label", a.textContent = "End", i.appendChild(a), this._buildPickerSet(i, this._rangeEnd, (t) => {
|
|
330
|
+
this._rangeEnd = t, this._emitChangeFromPicker(), this._buildPopoverContent(e);
|
|
331
|
+
}), t.appendChild(n), t.appendChild(i), e.appendChild(t), requestAnimationFrame(() => {
|
|
332
|
+
this._centerAllColumnsInPopoverBody();
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
render() {
|
|
336
|
+
let e = this.isDisabled(), t = this.isReadonly(), n = this._getEffectiveError();
|
|
337
|
+
this.innerHTML = "";
|
|
338
|
+
let r = document.createElement("div");
|
|
339
|
+
r.className = "mint-time-picker-control", this._inputEl = document.createElement("mint-input"), this._inputEl.id = this._triggerId, this._inputEl.classList.add("mint-time-picker-trigger"), this._inputEl.setAttribute("type", "text"), this._inputEl.setAttribute("icon", "clock"), this._inputEl.setAttribute("placeholder", this._getExpectedFormat()), this._inputEl.setAttribute("label", this.getLabel()), this._inputEl.setAttribute("info", this.getInfo()), this._inputEl.setAttribute("value", this._getDisplayValue()), this._inputEl.setAttribute("error", n.hasError ? "true" : "false"), this._inputEl.setAttribute("error-message", n.message || ""), e && this._inputEl.setAttribute("disabled", "true"), t && this._inputEl.setAttribute("readonly", "true"), this._inputEl.addEventListener("change", (n) => {
|
|
340
|
+
if (e || t) return;
|
|
341
|
+
let r = n.target;
|
|
342
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
343
|
+
}), this._inputEl.addEventListener("blur", (n) => {
|
|
344
|
+
if (e || t) return;
|
|
345
|
+
let r = n.target;
|
|
346
|
+
this._handleTypedValue((r?.value || "").toString());
|
|
347
|
+
}, !0), r.appendChild(this._inputEl), this._hiddenInput = document.createElement("input"), this._hiddenInput.type = "hidden", this._hiddenInput.name = this.getName(), this._hiddenInput.required = this.isRequired(), r.appendChild(this._hiddenInput), this._syncHiddenInput(), this._popover = document.createElement("mint-popover"), this._popover.setAttribute("trigger-id", this._triggerId), this._popover.setAttribute("direction", "down"), this._popover.setAttribute("padding", "0"), this._popover.setAttribute("distance", "6px"), (e || t) && this._popover.setAttribute("open", "false");
|
|
348
|
+
let i = document.createElement("div");
|
|
349
|
+
i.setAttribute("data-mint-time-picker-body", "true"), i.className = "mint-time-picker-popover", this._buildPopoverContent(i), this._popover.appendChild(i), r.appendChild(this._popover), this._setupPopoverOpenObserver(), this.appendChild(r);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
customElements.get("mint-time-picker") || e("mint-time-picker", t);
|
|
353
|
+
//#endregion
|
|
354
|
+
export { t as default };
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
static get observedAttributes(): string[];
|
|
3
|
-
private _messageEl;
|
|
4
|
-
private _hideTimer;
|
|
5
|
-
private _hideResolve;
|
|
6
|
-
private _bottomNavObserver;
|
|
7
|
-
private _bodyObserver;
|
|
8
|
-
connectedCallback(): void;
|
|
9
|
-
disconnectedCallback(): void;
|
|
10
|
-
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
|
11
|
-
showToast(message: string, duration?: number): Promise<void>;
|
|
12
|
-
hideToast(immediate?: boolean): void;
|
|
13
|
-
private _clearHideTimer;
|
|
14
|
-
private _updateBottomOffset;
|
|
15
|
-
private _hasVisibleBottomNav;
|
|
16
|
-
private _setupBottomNavObservers;
|
|
17
|
-
private _disconnectBottomNavObservers;
|
|
18
|
-
render(): void;
|
|
19
|
-
}
|
|
20
|
-
export default MintToast;
|
|
21
|
-
//# sourceMappingURL=Toast.d.ts.map
|
|
1
|
+
export { MintToast as default, MintToast } from '../../mintui-elements'
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "Toast.d.ts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"Toast.d.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA"
|
|
10
|
+
}
|
|
@@ -0,0 +1,147 @@
|
|
|
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('toast', '../../toast.css')
|
|
15
|
+
import { t as e } from "../chunks/register-element-BFYmIynH.js";
|
|
16
|
+
//#region src/components/toast/Toast.ts
|
|
17
|
+
var t = class extends HTMLElement {
|
|
18
|
+
constructor(...e) {
|
|
19
|
+
super(...e), this._messageEl = null, this._hideTimer = null, this._hideResolve = null, this._bottomNavObserver = null, this._bodyObserver = null;
|
|
20
|
+
}
|
|
21
|
+
static get observedAttributes() {
|
|
22
|
+
return [
|
|
23
|
+
"open",
|
|
24
|
+
"message",
|
|
25
|
+
"type"
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.classList.add("mint-toast-host"), this._updateBottomOffset(), this._setupBottomNavObservers(), this.setAttribute("role", "status"), this.setAttribute("aria-live", "polite"), this.setAttribute("aria-atomic", "true"), this.render();
|
|
30
|
+
}
|
|
31
|
+
disconnectedCallback() {
|
|
32
|
+
this._clearHideTimer(), this._disconnectBottomNavObservers(), this._hideResolve = null;
|
|
33
|
+
}
|
|
34
|
+
attributeChangedCallback(e, t, n) {
|
|
35
|
+
t !== n && (e === "open" || e === "message" || e === "type") && this.render();
|
|
36
|
+
}
|
|
37
|
+
async showToast(e, t = 2200, n = "neutral") {
|
|
38
|
+
let r = e.trim().slice(0, 120);
|
|
39
|
+
r && (this._updateBottomOffset(), this._clearHideTimer(), this._hideResolve = null, this.setAttribute("message", r), this.setAttribute("type", n), this.setAttribute("open", "true"), this.render(), await new Promise((e) => {
|
|
40
|
+
this._hideResolve = e, this._hideTimer = window.setTimeout(() => {
|
|
41
|
+
this.hideToast();
|
|
42
|
+
}, t);
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
hideToast(e = !1) {
|
|
46
|
+
this.removeAttribute("open"), this.render(), this._clearHideTimer();
|
|
47
|
+
let t = this._hideResolve;
|
|
48
|
+
this._hideResolve = null, t && (e ? t() : window.setTimeout(t, 200));
|
|
49
|
+
}
|
|
50
|
+
_clearHideTimer() {
|
|
51
|
+
this._hideTimer !== null && (window.clearTimeout(this._hideTimer), this._hideTimer = null);
|
|
52
|
+
}
|
|
53
|
+
_updateBottomOffset() {
|
|
54
|
+
let e = this._hasVisibleBottomNav() ? "calc(env(safe-area-inset-bottom, 0px) + 4.5rem)" : "calc(env(safe-area-inset-bottom, 0px) + 1rem)";
|
|
55
|
+
this.style.setProperty("--mint-toast-bottom-offset", e);
|
|
56
|
+
}
|
|
57
|
+
_hasVisibleBottomNav() {
|
|
58
|
+
let e = document.querySelector("mint-bottom-navigation");
|
|
59
|
+
if (!e) return !1;
|
|
60
|
+
let t = window.getComputedStyle(e);
|
|
61
|
+
return !(t.display === "none" || t.visibility === "hidden" || e.classList.contains("is-hidden"));
|
|
62
|
+
}
|
|
63
|
+
_setupBottomNavObservers() {
|
|
64
|
+
this._disconnectBottomNavObservers();
|
|
65
|
+
let e = () => {
|
|
66
|
+
this._bottomNavObserver &&= (this._bottomNavObserver.disconnect(), null);
|
|
67
|
+
let e = document.querySelector("mint-bottom-navigation");
|
|
68
|
+
if (!e) {
|
|
69
|
+
this._updateBottomOffset();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this._bottomNavObserver = new MutationObserver(() => {
|
|
73
|
+
this._updateBottomOffset();
|
|
74
|
+
}), this._bottomNavObserver.observe(e, {
|
|
75
|
+
attributes: !0,
|
|
76
|
+
attributeFilter: ["class", "style"]
|
|
77
|
+
}), this._updateBottomOffset();
|
|
78
|
+
};
|
|
79
|
+
this._bodyObserver = new MutationObserver(() => {
|
|
80
|
+
e();
|
|
81
|
+
}), this._bodyObserver.observe(document.body, {
|
|
82
|
+
childList: !0,
|
|
83
|
+
subtree: !0
|
|
84
|
+
}), e();
|
|
85
|
+
}
|
|
86
|
+
_disconnectBottomNavObservers() {
|
|
87
|
+
this._bottomNavObserver &&= (this._bottomNavObserver.disconnect(), null), this._bodyObserver &&= (this._bodyObserver.disconnect(), null);
|
|
88
|
+
}
|
|
89
|
+
render() {
|
|
90
|
+
let e = this.getAttribute("open") === "true", t = this.getAttribute("message") || "";
|
|
91
|
+
this.classList.toggle("mint-toast-is-open", e), this._messageEl ||= (this.innerHTML = "<div class=\"mint-toast-surface\">\n <span data-mint-toast-message></span>\n </div>", this.querySelector("[data-mint-toast-message]")), this._messageEl && (this._messageEl.textContent = t);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
customElements.get("mint-toast") || e("mint-toast", t);
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/components/toast/ToastApi.ts
|
|
97
|
+
var n = 2200, r = [], i = !1, a = null;
|
|
98
|
+
function o() {
|
|
99
|
+
return typeof document > "u" || document.body ? Promise.resolve() : new Promise((e) => {
|
|
100
|
+
if (typeof window > "u") {
|
|
101
|
+
e();
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
window.addEventListener("DOMContentLoaded", () => {
|
|
105
|
+
e();
|
|
106
|
+
}, { once: !0 });
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
async function s() {
|
|
110
|
+
if (await o(), typeof document > "u") throw Error("mintui.toast is only available in browser environments.");
|
|
111
|
+
let e = document.querySelector("mint-toast[data-mint-toast-root=\"true\"]");
|
|
112
|
+
if (e) return e;
|
|
113
|
+
let t = document.createElement("mint-toast");
|
|
114
|
+
return t.setAttribute("data-mint-toast-root", "true"), document.body.appendChild(t), t;
|
|
115
|
+
}
|
|
116
|
+
async function c() {
|
|
117
|
+
if (!i) {
|
|
118
|
+
i = !0;
|
|
119
|
+
try {
|
|
120
|
+
for (; r.length > 0;) {
|
|
121
|
+
let e = r.shift();
|
|
122
|
+
if (!e) continue;
|
|
123
|
+
let t = e.message.trim().slice(0, 120);
|
|
124
|
+
if (!t) continue;
|
|
125
|
+
let i = await s();
|
|
126
|
+
a = i;
|
|
127
|
+
let o = e.options?.duration ?? n, c = e.options?.type ?? "neutral";
|
|
128
|
+
await i.showToast(t, o, c);
|
|
129
|
+
}
|
|
130
|
+
} finally {
|
|
131
|
+
i = !1, a = null;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
function l(e, t) {
|
|
136
|
+
typeof window > "u" || (r.push({
|
|
137
|
+
message: e,
|
|
138
|
+
options: t
|
|
139
|
+
}), i && a && a.hideToast(), c());
|
|
140
|
+
}
|
|
141
|
+
var u = { toast: l };
|
|
142
|
+
if (typeof window < "u") {
|
|
143
|
+
let e = window.mintui || {};
|
|
144
|
+
e.toast = l, window.mintui = e;
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
147
|
+
export { t as default, u as mintui, l as toast };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require(`../chunks/register-element-tCL_F1YI.js`);var t=class extends HTMLElement{constructor(...e){super(...e),this._messageEl=null,this._hideTimer=null,this._hideResolve=null,this._bottomNavObserver=null,this._bodyObserver=null}static get observedAttributes(){return[`open`,`message`,`type`]}connectedCallback(){this.classList.add(`mint-toast-host`),this._updateBottomOffset(),this._setupBottomNavObservers(),this.setAttribute(`role`,`status`),this.setAttribute(`aria-live`,`polite`),this.setAttribute(`aria-atomic`,`true`),this.render()}disconnectedCallback(){this._clearHideTimer(),this._disconnectBottomNavObservers(),this._hideResolve=null}attributeChangedCallback(e,t,n){t!==n&&(e===`open`||e===`message`||e===`type`)&&this.render()}async showToast(e,t=2200,n=`neutral`){let r=e.trim().slice(0,120);r&&(this._updateBottomOffset(),this._clearHideTimer(),this._hideResolve=null,this.setAttribute(`message`,r),this.setAttribute(`type`,n),this.setAttribute(`open`,`true`),this.render(),await new Promise(e=>{this._hideResolve=e,this._hideTimer=window.setTimeout(()=>{this.hideToast()},t)}))}hideToast(e=!1){this.removeAttribute(`open`),this.render(),this._clearHideTimer();let t=this._hideResolve;this._hideResolve=null,t&&(e?t():window.setTimeout(t,200))}_clearHideTimer(){this._hideTimer!==null&&(window.clearTimeout(this._hideTimer),this._hideTimer=null)}_updateBottomOffset(){let e=this._hasVisibleBottomNav()?`calc(env(safe-area-inset-bottom, 0px) + 4.5rem)`:`calc(env(safe-area-inset-bottom, 0px) + 1rem)`;this.style.setProperty(`--mint-toast-bottom-offset`,e)}_hasVisibleBottomNav(){let e=document.querySelector(`mint-bottom-navigation`);if(!e)return!1;let t=window.getComputedStyle(e);return!(t.display===`none`||t.visibility===`hidden`||e.classList.contains(`is-hidden`))}_setupBottomNavObservers(){this._disconnectBottomNavObservers();let e=()=>{this._bottomNavObserver&&=(this._bottomNavObserver.disconnect(),null);let e=document.querySelector(`mint-bottom-navigation`);if(!e){this._updateBottomOffset();return}this._bottomNavObserver=new MutationObserver(()=>{this._updateBottomOffset()}),this._bottomNavObserver.observe(e,{attributes:!0,attributeFilter:[`class`,`style`]}),this._updateBottomOffset()};this._bodyObserver=new MutationObserver(()=>{e()}),this._bodyObserver.observe(document.body,{childList:!0,subtree:!0}),e()}_disconnectBottomNavObservers(){this._bottomNavObserver&&=(this._bottomNavObserver.disconnect(),null),this._bodyObserver&&=(this._bodyObserver.disconnect(),null)}render(){let e=this.getAttribute(`open`)===`true`,t=this.getAttribute(`message`)||``;this.classList.toggle(`mint-toast-is-open`,e),this._messageEl||=(this.innerHTML=`<div class="mint-toast-surface">
|
|
2
|
+
<span data-mint-toast-message></span>
|
|
3
|
+
</div>`,this.querySelector(`[data-mint-toast-message]`)),this._messageEl&&(this._messageEl.textContent=t)}};customElements.get(`mint-toast`)||e.t(`mint-toast`,t);var n=2200,r=[],i=!1,a=null;function o(){return typeof document>`u`||document.body?Promise.resolve():new Promise(e=>{if(typeof window>`u`){e();return}window.addEventListener(`DOMContentLoaded`,()=>{e()},{once:!0})})}async function s(){if(await o(),typeof document>`u`)throw Error(`mintui.toast is only available in browser environments.`);let e=document.querySelector(`mint-toast[data-mint-toast-root="true"]`);if(e)return e;let t=document.createElement(`mint-toast`);return t.setAttribute(`data-mint-toast-root`,`true`),document.body.appendChild(t),t}async function c(){if(!i){i=!0;try{for(;r.length>0;){let e=r.shift();if(!e)continue;let t=e.message.trim().slice(0,120);if(!t)continue;let i=await s();a=i;let o=e.options?.duration??n,c=e.options?.type??`neutral`;await i.showToast(t,o,c)}}finally{i=!1,a=null}}}function l(e,t){typeof window>`u`||(r.push({message:e,options:t}),i&&a&&a.hideToast(),c())}var u={toast:l};if(typeof window<`u`){let e=window.mintui||{};e.toast=l,window.mintui=e}exports.default=t,exports.mintui=u,exports.toast=l;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
export { default, MintToast } from './Toast'
|
|
2
|
+
export { toast } from '../../mintui-elements'
|
|
3
|
+
export { mintui } from '../../mintui-elements'
|
|
@@ -1 +1,10 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"file": "index.d.ts",
|
|
4
|
+
"sourceRoot": "",
|
|
5
|
+
"sources": [
|
|
6
|
+
"index.d.ts"
|
|
7
|
+
],
|
|
8
|
+
"names": [],
|
|
9
|
+
"mappings": "AAAA"
|
|
10
|
+
}
|