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,334 @@
|
|
|
1
|
+
import "./icon-gQAtsERy.js";
|
|
2
|
+
import { t as e } from "./register-element-BFYmIynH.js";
|
|
3
|
+
import "./icon-C0OLmjDY.js";
|
|
4
|
+
import "./caret-up-D_6oa7o1.js";
|
|
5
|
+
import "./caret-down-Ch6IfR7r.js";
|
|
6
|
+
//#region src/components/input/Input.ts
|
|
7
|
+
var t = class extends HTMLElement {
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return [
|
|
10
|
+
"type",
|
|
11
|
+
"placeholder",
|
|
12
|
+
"value",
|
|
13
|
+
"disabled",
|
|
14
|
+
"id",
|
|
15
|
+
"name",
|
|
16
|
+
"required",
|
|
17
|
+
"readonly",
|
|
18
|
+
"rows",
|
|
19
|
+
"icon",
|
|
20
|
+
"label",
|
|
21
|
+
"info",
|
|
22
|
+
"error",
|
|
23
|
+
"error-message",
|
|
24
|
+
"loading",
|
|
25
|
+
"aria-label",
|
|
26
|
+
"aria-labelledby",
|
|
27
|
+
"aria-describedby"
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
constructor() {
|
|
31
|
+
super(), this._input = null, this._textarea = null, this._element = null, this._wrapper = null, this._icon = null, this._prependSlotContainer = null, this._appendSlotContainer = null, this._colorPicker = null, this._colorTextInput = null, this._colorContainer = null, this._colorPickerWrapper = null, this._numberSpinnerContainer = null, this._numberIncrementButton = null, this._numberDecrementButton = null, this._contentObserver = null, this._focusHandler = null, this._a11yId = "", this._blurHandler = null, this._clickHandler = null, this._clickOutsideHandler = null, this._renderFrame = null;
|
|
32
|
+
}
|
|
33
|
+
connectedCallback() {
|
|
34
|
+
this.classList.add("mint-input-host"), this.render(), this._observeContentMutations();
|
|
35
|
+
}
|
|
36
|
+
disconnectedCallback() {
|
|
37
|
+
this.removeEventListeners(), this._contentObserver &&= (this._contentObserver.disconnect(), null), this._renderFrame !== null && (cancelAnimationFrame(this._renderFrame), this._renderFrame = null);
|
|
38
|
+
}
|
|
39
|
+
attributeChangedCallback(e, t, n) {
|
|
40
|
+
if (t !== n) {
|
|
41
|
+
if (e === "error" || e === "error-message") {
|
|
42
|
+
this._renderErrorState(), this._syncControlAccessibility(), this._element && (this._element.className = this.getInputClasses()), this._colorTextInput && (this._colorTextInput.className = this.getInputClasses());
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (e === "loading") {
|
|
46
|
+
this.render();
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
this.render();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
_scheduleRender() {
|
|
53
|
+
this._renderFrame === null && (this._renderFrame = requestAnimationFrame(() => {
|
|
54
|
+
this._renderFrame = null, this.render();
|
|
55
|
+
}));
|
|
56
|
+
}
|
|
57
|
+
_observeContentMutations() {
|
|
58
|
+
this._contentObserver ||= new MutationObserver(() => {
|
|
59
|
+
this._scheduleRender();
|
|
60
|
+
}), this._contentObserver.disconnect(), this._contentObserver.observe(this, {
|
|
61
|
+
childList: !0,
|
|
62
|
+
attributes: !0,
|
|
63
|
+
attributeFilter: ["slot"]
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
getType() {
|
|
67
|
+
return this.getAttribute("type") || "text";
|
|
68
|
+
}
|
|
69
|
+
getRows() {
|
|
70
|
+
let e = this.getAttribute("rows");
|
|
71
|
+
return e ? parseInt(e, 10) : 3;
|
|
72
|
+
}
|
|
73
|
+
_getNormalizedType() {
|
|
74
|
+
let e = this.getType();
|
|
75
|
+
return e === "datetime" ? "datetime-local" : e === "money" ? "text" : e === "textarea" ? "textarea" : e;
|
|
76
|
+
}
|
|
77
|
+
_isTextarea() {
|
|
78
|
+
return this.getType() === "textarea";
|
|
79
|
+
}
|
|
80
|
+
_isMoney() {
|
|
81
|
+
return this.getType() === "money";
|
|
82
|
+
}
|
|
83
|
+
_isColor() {
|
|
84
|
+
return this.getType() === "color";
|
|
85
|
+
}
|
|
86
|
+
_isNumber() {
|
|
87
|
+
return this.getType() === "number";
|
|
88
|
+
}
|
|
89
|
+
getPlaceholder() {
|
|
90
|
+
return this.getAttribute("placeholder") || "";
|
|
91
|
+
}
|
|
92
|
+
getValue() {
|
|
93
|
+
return this._isColor() ? this._colorTextInput ? this._colorTextInput.value : this._colorPicker ? this._colorPicker.value : this.getAttribute("value") || "#000000" : this._element ? this._element.value : this.getAttribute("value") || "";
|
|
94
|
+
}
|
|
95
|
+
set value(e) {
|
|
96
|
+
try {
|
|
97
|
+
this._isColor() ? (this._colorPicker && (this._colorPicker.value = e || "#000000"), this._colorTextInput && (this._colorTextInput.value = e || "#000000")) : this._element && (this._element.value = e), e ? this.setAttribute("value", e) : this.removeAttribute("value");
|
|
98
|
+
} catch {}
|
|
99
|
+
}
|
|
100
|
+
get value() {
|
|
101
|
+
try {
|
|
102
|
+
return this.getValue() || "";
|
|
103
|
+
} catch {
|
|
104
|
+
return "";
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
isDisabled() {
|
|
108
|
+
return this.getAttribute("disabled") === "true";
|
|
109
|
+
}
|
|
110
|
+
isReadonly() {
|
|
111
|
+
return this.getAttribute("readonly") === "true";
|
|
112
|
+
}
|
|
113
|
+
isRequired() {
|
|
114
|
+
return this.getAttribute("required") === "true";
|
|
115
|
+
}
|
|
116
|
+
hasError() {
|
|
117
|
+
return this.getAttribute("error") === "true";
|
|
118
|
+
}
|
|
119
|
+
getErrorMessage() {
|
|
120
|
+
return this.getAttribute("error-message") || "";
|
|
121
|
+
}
|
|
122
|
+
getId() {
|
|
123
|
+
return this.getAttribute("id") || "";
|
|
124
|
+
}
|
|
125
|
+
getName() {
|
|
126
|
+
return this.getAttribute("name") || "";
|
|
127
|
+
}
|
|
128
|
+
getIcon() {
|
|
129
|
+
return this.getAttribute("icon") || "";
|
|
130
|
+
}
|
|
131
|
+
getLabel() {
|
|
132
|
+
return this.getAttribute("label") || "";
|
|
133
|
+
}
|
|
134
|
+
getInfo() {
|
|
135
|
+
return this.getAttribute("info") || "";
|
|
136
|
+
}
|
|
137
|
+
getInputClasses() {
|
|
138
|
+
let e = this._isTextarea(), t = !!this.getIcon(), n = this.querySelector("[slot=\"prepend\"]") !== null, r = this.querySelector("[slot=\"append\"]") !== null, i = this._isColor(), a = this._isNumber(), o = this.hasError();
|
|
139
|
+
return [
|
|
140
|
+
"mint-input-control",
|
|
141
|
+
e && "is-textarea",
|
|
142
|
+
t && "has-icon",
|
|
143
|
+
i && "is-color",
|
|
144
|
+
n && "has-prepend",
|
|
145
|
+
r && "has-append",
|
|
146
|
+
a && "is-number",
|
|
147
|
+
o && "has-error"
|
|
148
|
+
].filter(Boolean).join(" ");
|
|
149
|
+
}
|
|
150
|
+
_syncSlotAdornments(e, t) {
|
|
151
|
+
if (!this._wrapper || e || this._isColor()) {
|
|
152
|
+
this._prependSlotContainer &&= (this._prependSlotContainer.remove(), null), this._appendSlotContainer &&= (this._appendSlotContainer.remove(), null);
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
this._prependSlotContainer || (this._prependSlotContainer = document.createElement("div"), this._prependSlotContainer.className = "mint-input-adornment mint-input-prepend-slot", this._wrapper.appendChild(this._prependSlotContainer)), this._appendSlotContainer || (this._appendSlotContainer = document.createElement("div"), this._appendSlotContainer.className = "mint-input-adornment mint-input-append-slot", this._wrapper.appendChild(this._appendSlotContainer)), this._prependSlotContainer.classList.toggle("has-icon-offset", t);
|
|
156
|
+
let n = Array.from(this.querySelectorAll("[slot=\"prepend\"]")), r = Array.from(this.querySelectorAll("[slot=\"append\"]"));
|
|
157
|
+
this._prependSlotContainer.replaceChildren(), this._appendSlotContainer.replaceChildren(), n.forEach((e) => this._prependSlotContainer.appendChild(e)), r.forEach((e) => this._appendSlotContainer.appendChild(e)), this._prependSlotContainer.classList.toggle("is-hidden", n.length === 0), this._appendSlotContainer.classList.toggle("is-hidden", r.length === 0);
|
|
158
|
+
}
|
|
159
|
+
isLoading() {
|
|
160
|
+
return this.getAttribute("loading") === "true";
|
|
161
|
+
}
|
|
162
|
+
render() {
|
|
163
|
+
this.getType();
|
|
164
|
+
let e = this._getNormalizedType(), t = this._isTextarea(), n = this._isMoney(), r = this._isColor(), i = this.getPlaceholder(), a = this.isDisabled(), o = this.isReadonly(), s = this.isRequired(), c = this.getId(), l = this.getName(), u = this.getAttribute("value") || (r ? "#000000" : ""), d = this.getRows(), f = this.getIcon(), p = this.getLabel(), m = this.getInfo(), h = this.isLoading();
|
|
165
|
+
if (r && this._renderSkeleton(h), r) {
|
|
166
|
+
this._input &&= (this._input.remove(), null), this._textarea &&= (this._textarea.remove(), null), this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "mint-input-wrapper", this.appendChild(this._wrapper)), this._colorContainer &&= (this._colorContainer.remove(), null), this._colorPickerWrapper && !r && (this._colorPickerWrapper.remove(), this._colorPickerWrapper = null), this._colorPickerWrapper || (this._colorPickerWrapper = document.createElement("div"), this._colorPickerWrapper.className = "mint-color-picker-wrapper", this._wrapper.appendChild(this._colorPickerWrapper), this._colorPicker = document.createElement("input"), this._colorPicker.type = "color", this._colorPicker.className = "mint-color-picker", this._colorPickerWrapper.appendChild(this._colorPicker), this._focusHandler = (e) => {
|
|
167
|
+
this._colorPickerWrapper && this._colorPicker && this._colorPicker.matches(":focus-visible") && requestAnimationFrame(() => {
|
|
168
|
+
this._colorPicker && this._colorPicker.matches(":focus-visible") && this._colorPickerWrapper?.classList.add("is-focused");
|
|
169
|
+
});
|
|
170
|
+
}, this._blurHandler = () => {
|
|
171
|
+
this._colorPickerWrapper && this._colorPickerWrapper.classList.remove("is-focused");
|
|
172
|
+
}, this._colorPicker.addEventListener("focus", this._focusHandler), this._colorPicker.addEventListener("blur", this._blurHandler), this._colorPicker.addEventListener("input", () => {
|
|
173
|
+
let e = this._colorPicker?.value || "#000000";
|
|
174
|
+
this._colorTextInput && (this._colorTextInput.value = e), this.setAttribute("value", e), this.dispatchEvent(new CustomEvent("input", {
|
|
175
|
+
detail: { value: e },
|
|
176
|
+
bubbles: !0,
|
|
177
|
+
cancelable: !0
|
|
178
|
+
}));
|
|
179
|
+
}), this._colorPicker.addEventListener("change", () => {
|
|
180
|
+
let e = this._colorPicker?.value || "#000000";
|
|
181
|
+
this.setAttribute("value", e), this.dispatchEvent(new CustomEvent("change", {
|
|
182
|
+
detail: { value: e },
|
|
183
|
+
bubbles: !0,
|
|
184
|
+
cancelable: !0
|
|
185
|
+
}));
|
|
186
|
+
})), this._colorTextInput || (this._colorTextInput = document.createElement("input"), this._colorTextInput.type = "text", this._colorTextInput.className = this.getInputClasses(), this._colorTextInput.placeholder = i || "#000000", this._colorTextInput.pattern = "^#[0-9A-Fa-f]{6}$", this._wrapper.appendChild(this._colorTextInput), this._colorTextInput.addEventListener("input", () => {
|
|
187
|
+
let e = this._colorTextInput?.value || "";
|
|
188
|
+
/^#[0-9A-Fa-f]{6}$/.test(e) && (this._colorPicker && (this._colorPicker.value = e), this.setAttribute("value", e), this.dispatchEvent(new CustomEvent("input", {
|
|
189
|
+
detail: { value: e },
|
|
190
|
+
bubbles: !0,
|
|
191
|
+
cancelable: !0
|
|
192
|
+
})));
|
|
193
|
+
}), this._colorTextInput.addEventListener("blur", () => {
|
|
194
|
+
let e = this._colorTextInput?.value || "";
|
|
195
|
+
/^#[0-9A-Fa-f]{6}$/.test(e) ? (this._colorPicker && (this._colorPicker.value = e), this.setAttribute("value", e)) : this._colorPicker && this._colorTextInput && (this._colorTextInput.value = this._colorPicker.value), this.dispatchEvent(new CustomEvent("change", {
|
|
196
|
+
detail: { value: this._colorPicker?.value || "#000000" },
|
|
197
|
+
bubbles: !0,
|
|
198
|
+
cancelable: !0
|
|
199
|
+
}));
|
|
200
|
+
}));
|
|
201
|
+
let e = u || "#000000";
|
|
202
|
+
if (this._colorPicker && this._colorPicker.value !== e && (this._colorPicker.value = e), this._colorTextInput && this._colorTextInput.value !== e && (this._colorTextInput.value = e), this._colorPicker && (this._colorPicker.disabled = a), this._colorPickerWrapper && (a ? this._colorPickerWrapper.classList.add("is-disabled") : this._colorPickerWrapper.classList.remove("is-disabled")), this._colorTextInput && (this._colorTextInput.disabled = a, this._colorTextInput.readOnly = o, this._colorTextInput.required = s), this._colorTextInput) {
|
|
203
|
+
let e = this._colorTextInput;
|
|
204
|
+
c ? e.id = c : e.removeAttribute("id"), l ? e.name = l : e.removeAttribute("name"), e.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), this._element = e;
|
|
205
|
+
}
|
|
206
|
+
this._renderErrorState();
|
|
207
|
+
let t = this.querySelector(".mint-input-label-container");
|
|
208
|
+
if (p || m) {
|
|
209
|
+
t || (t = document.createElement("div"), t.className = "mint-input-label-container", this._wrapper && this._wrapper.parentElement === this ? this.insertBefore(t, this._wrapper) : this.insertBefore(t, this.firstChild));
|
|
210
|
+
let e = t.querySelector(".mint-input-label");
|
|
211
|
+
if (p) {
|
|
212
|
+
e || (e = document.createElement("label"), e.className = "mint-input-label", t.insertBefore(e, t.firstChild)), e.textContent = p;
|
|
213
|
+
let n = c || this._colorTextInput?.id;
|
|
214
|
+
if (n) e.setAttribute("for", n);
|
|
215
|
+
else {
|
|
216
|
+
let t = `mint-input-${Math.random().toString(36).substr(2, 9)}`;
|
|
217
|
+
this._colorTextInput && (this._colorTextInput.id = t), e.setAttribute("for", t);
|
|
218
|
+
}
|
|
219
|
+
a ? e.classList.add("is-disabled") : e.classList.remove("is-disabled");
|
|
220
|
+
} else e && e.remove();
|
|
221
|
+
let n = t.querySelector(".mint-input-info");
|
|
222
|
+
m ? (n || (n = document.createElement("span"), n.className = "mint-input-info", t.appendChild(n)), n.textContent = m, a ? n.classList.add("is-disabled") : n.classList.remove("is-disabled")) : n && n.remove();
|
|
223
|
+
} else t && t.remove();
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (this._wrapper || (this._wrapper = document.createElement("div"), this._wrapper.className = "mint-input-wrapper", this.appendChild(this._wrapper)), this._colorContainer && (this._colorContainer.remove(), this._colorContainer = null, this._colorPicker = null, this._colorTextInput = null), this._colorPickerWrapper && !r && (this._colorPickerWrapper.remove(), this._colorPickerWrapper = null, this._colorPicker = null, this._colorTextInput = null), f && !t ? this._icon ? this._icon.setAttribute("name", f) : (this._icon = document.createElement("mint-icon"), this._icon.setAttribute("name", f), this._icon.className = "mint-input-icon", this._wrapper.appendChild(this._icon)) : this._icon &&= (this._icon.remove(), null), this._syncSlotAdornments(t, !!f), this._isNumber() && !t) {
|
|
227
|
+
if (!this._numberSpinnerContainer) {
|
|
228
|
+
this._numberSpinnerContainer = document.createElement("div"), this._numberSpinnerContainer.className = "mint-input-spinner", this._wrapper.appendChild(this._numberSpinnerContainer), this._numberIncrementButton = document.createElement("button"), this._numberIncrementButton.type = "button", this._numberIncrementButton.className = "mint-input-spinner-button";
|
|
229
|
+
let e = document.createElement("mint-icon");
|
|
230
|
+
e.setAttribute("name", "caret-up"), e.className = "mint-input-spinner-icon", this._numberIncrementButton.appendChild(e), this._numberSpinnerContainer.appendChild(this._numberIncrementButton), this._numberDecrementButton = document.createElement("button"), this._numberDecrementButton.type = "button", this._numberDecrementButton.className = "mint-input-spinner-button";
|
|
231
|
+
let t = document.createElement("mint-icon");
|
|
232
|
+
t.setAttribute("name", "caret-down"), t.className = "mint-input-spinner-icon", this._numberDecrementButton.appendChild(t), this._numberSpinnerContainer.appendChild(this._numberDecrementButton), this._numberIncrementButton.addEventListener("click", (e) => {
|
|
233
|
+
if (e.preventDefault(), e.stopPropagation(), this._input && !this._input.disabled && !this._input.readOnly) {
|
|
234
|
+
let e = parseFloat(this._input.value) || 0, t = parseFloat(this._input.step) || 1, n = this._input.min ? parseFloat(this._input.min) : void 0, r = this._input.max ? parseFloat(this._input.max) : void 0, i = e + t;
|
|
235
|
+
r !== void 0 && i > r && (i = r), n !== void 0 && i < n && (i = n), this._input.value = i.toString(), this.setAttribute("value", i.toString()), this._input.dispatchEvent(new Event("input", { bubbles: !0 })), this._input.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
236
|
+
}
|
|
237
|
+
}), this._numberDecrementButton.addEventListener("click", (e) => {
|
|
238
|
+
if (e.preventDefault(), e.stopPropagation(), this._input && !this._input.disabled && !this._input.readOnly) {
|
|
239
|
+
let e = parseFloat(this._input.value) || 0, t = parseFloat(this._input.step) || 1, n = this._input.min ? parseFloat(this._input.min) : void 0, r = this._input.max ? parseFloat(this._input.max) : void 0, i = e - t;
|
|
240
|
+
n !== void 0 && i < n && (i = n), r !== void 0 && i > r && (i = r), this._input.value = i.toString(), this.setAttribute("value", i.toString()), this._input.dispatchEvent(new Event("input", { bubbles: !0 })), this._input.dispatchEvent(new Event("change", { bubbles: !0 }));
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
this._numberIncrementButton && (this._numberIncrementButton.disabled = a || o), this._numberDecrementButton && (this._numberDecrementButton.disabled = a || o);
|
|
245
|
+
} else this._numberSpinnerContainer && (this._numberSpinnerContainer.remove(), this._numberSpinnerContainer = null, this._numberIncrementButton = null, this._numberDecrementButton = null);
|
|
246
|
+
if (t) {
|
|
247
|
+
if (this._input &&= (this._input.remove(), null), this._textarea || (this._textarea = document.createElement("textarea"), this._element = this._textarea, this._wrapper.appendChild(this._textarea), this.setupEventListeners()), this._element = this._textarea, this._textarea.placeholder = i, this._textarea.disabled = a, this._textarea.readOnly = o, this._textarea.required = s, this._textarea.rows = d, this._textarea.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), u !== this._textarea.value && (this._textarea.value = u), c ? this._textarea.id = c : this._textarea.removeAttribute("id"), l ? this._textarea.name = l : this._textarea.removeAttribute("name"), this._textarea.className = this.getInputClasses(), this.firstChild && this.firstChild !== this._wrapper && this.firstChild.nodeType === Node.TEXT_NODE) {
|
|
248
|
+
let e = this.firstChild.textContent;
|
|
249
|
+
e && !this._textarea.value && (this._textarea.value = e.trim()), this.removeChild(this.firstChild);
|
|
250
|
+
}
|
|
251
|
+
} else if (this._textarea &&= (this._textarea.remove(), null), this._input || (this._input = document.createElement("input"), this._element = this._input, this._wrapper.appendChild(this._input), this.setupEventListeners()), this._element = this._input, this._input.type = e, this._input.placeholder = i, this._input.disabled = a, this._input.readOnly = o, this._input.required = s, this._input.setAttribute("aria-invalid", this.hasError() ? "true" : "false"), n ? (this._input.inputMode = "decimal", this._input.pattern = "[0-9]*\\.?[0-9]*") : (this._input.removeAttribute("inputmode"), this._input.removeAttribute("pattern")), u !== this._input.value && (this._input.value = u), c ? this._input.id = c : this._input.removeAttribute("id"), l ? this._input.name = l : this._input.removeAttribute("name"), this._input.className = this.getInputClasses(), this.firstChild && this.firstChild !== this._wrapper && this.firstChild.nodeType === Node.TEXT_NODE) {
|
|
252
|
+
let e = this.firstChild.textContent;
|
|
253
|
+
e && !this._input.value && (this._input.value = e.trim()), this.removeChild(this.firstChild);
|
|
254
|
+
}
|
|
255
|
+
let g = this.querySelector(".mint-input-label-container");
|
|
256
|
+
if (p || m) {
|
|
257
|
+
g || (g = document.createElement("div"), g.className = "mint-input-label-container", this._wrapper && this._wrapper.parentElement === this ? this.insertBefore(g, this._wrapper) : this.insertBefore(g, this.firstChild));
|
|
258
|
+
let e = g.querySelector(".mint-input-label");
|
|
259
|
+
if (p) {
|
|
260
|
+
e || (e = document.createElement("label"), e.className = "mint-input-label", g.insertBefore(e, g.firstChild)), e.textContent = p;
|
|
261
|
+
let t = c || this._element?.id || this._colorTextInput?.id || this._input?.id || this._textarea?.id;
|
|
262
|
+
if (t) e.setAttribute("for", t);
|
|
263
|
+
else {
|
|
264
|
+
let t = `mint-input-${Math.random().toString(36).substr(2, 9)}`;
|
|
265
|
+
this._element ? this._element.id = t : this._colorTextInput ? this._colorTextInput.id = t : this._input ? this._input.id = t : this._textarea && (this._textarea.id = t), e.setAttribute("for", t);
|
|
266
|
+
}
|
|
267
|
+
a ? e.classList.add("is-disabled") : e.classList.remove("is-disabled");
|
|
268
|
+
} else e && e.remove();
|
|
269
|
+
let t = g.querySelector(".mint-input-info");
|
|
270
|
+
m ? (t || (t = document.createElement("span"), t.className = "mint-input-info", g.appendChild(t)), t.textContent = m, a ? t.classList.add("is-disabled") : t.classList.remove("is-disabled")) : t && t.remove();
|
|
271
|
+
} else g && g.remove();
|
|
272
|
+
this._syncSlotAdornments(t, !!f), this._renderErrorState(), this._syncControlAccessibility(), this._renderSkeleton(h);
|
|
273
|
+
}
|
|
274
|
+
_renderErrorState() {
|
|
275
|
+
let e = this.hasError(), t = this.getErrorMessage(), n = this.querySelector(".mint-input-error");
|
|
276
|
+
e && t ? (n || (n = document.createElement("div"), n.className = "mint-input-error", this.appendChild(n)), n.textContent = t) : n && n.remove();
|
|
277
|
+
}
|
|
278
|
+
_syncControlAccessibility() {
|
|
279
|
+
let e = this._element;
|
|
280
|
+
if (!e) return;
|
|
281
|
+
this._a11yId ||= this.getId() || `mint-input-${Math.random().toString(36).slice(2, 10)}`;
|
|
282
|
+
let t = this.getAttribute("aria-label")?.trim(), n = !!this.querySelector(".mint-input-label");
|
|
283
|
+
t ? e.setAttribute("aria-label", t) : !n && this.getAttribute("placeholder")?.trim() ? e.setAttribute("aria-label", this.getAttribute("placeholder").trim()) : e.removeAttribute("aria-label");
|
|
284
|
+
let r = this.querySelector(".mint-input-info"), i = this.querySelector(".mint-input-error"), a = (this.getAttribute("aria-describedby") || "").split(/\s+/).filter(Boolean);
|
|
285
|
+
r && (r.id = `${this._a11yId}-info`, a.push(r.id)), i && (i.id = `${this._a11yId}-error`, a.push(i.id)), e.setAttribute("aria-invalid", String(this.hasError())), a.length ? e.setAttribute("aria-describedby", Array.from(new Set(a)).join(" ")) : e.removeAttribute("aria-describedby");
|
|
286
|
+
let o = this.getAttribute("aria-labelledby")?.trim();
|
|
287
|
+
o ? e.setAttribute("aria-labelledby", o) : e.removeAttribute("aria-labelledby");
|
|
288
|
+
}
|
|
289
|
+
setupEventListeners() {
|
|
290
|
+
this._element && (this._element.addEventListener("input", () => {
|
|
291
|
+
let e = this._element?.value || "";
|
|
292
|
+
e ? this.setAttribute("value", e) : this.removeAttribute("value");
|
|
293
|
+
let t = new Event("input", {
|
|
294
|
+
bubbles: !0,
|
|
295
|
+
cancelable: !0,
|
|
296
|
+
composed: !0
|
|
297
|
+
});
|
|
298
|
+
this.dispatchEvent(t), this.dispatchEvent(new CustomEvent("input", {
|
|
299
|
+
detail: { value: e },
|
|
300
|
+
bubbles: !0,
|
|
301
|
+
cancelable: !0,
|
|
302
|
+
composed: !0
|
|
303
|
+
}));
|
|
304
|
+
}), this._element.addEventListener("blur", () => {
|
|
305
|
+
let e = this._element?.value || "";
|
|
306
|
+
e ? this.setAttribute("value", e) : this.removeAttribute("value"), this.dispatchEvent(new CustomEvent("change", {
|
|
307
|
+
detail: { value: e },
|
|
308
|
+
bubbles: !0,
|
|
309
|
+
cancelable: !0
|
|
310
|
+
}));
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
removeEventListeners() {
|
|
314
|
+
this._colorPicker && (this._focusHandler &&= (this._colorPicker.removeEventListener("focus", this._focusHandler), null), this._blurHandler &&= (this._colorPicker.removeEventListener("blur", this._blurHandler), null));
|
|
315
|
+
}
|
|
316
|
+
focus() {
|
|
317
|
+
this._isColor() && this._colorTextInput ? this._colorTextInput.focus() : this._element?.focus();
|
|
318
|
+
}
|
|
319
|
+
blur() {
|
|
320
|
+
this._isColor() && this._colorTextInput ? this._colorTextInput.blur() : this._element?.blur();
|
|
321
|
+
}
|
|
322
|
+
_renderSkeleton(e) {
|
|
323
|
+
this.classList.toggle("is-loading", e);
|
|
324
|
+
let t = this.querySelector(".mint-input-skeleton-container"), n = this._wrapper || this.querySelector(".mint-input-wrapper");
|
|
325
|
+
if (e) {
|
|
326
|
+
t || (t = document.createElement("div"), t.className = "mint-input-skeleton-container", n ? (n.classList.add("mint-input-positioned"), n.appendChild(t)) : (this.classList.add("mint-input-positioned"), this.appendChild(t)));
|
|
327
|
+
let e = t.querySelector(".mint-input-skeleton");
|
|
328
|
+
e || (e = document.createElement("div"), e.className = "mint-input-skeleton", t.appendChild(e)), e.parentElement || t.appendChild(e);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
};
|
|
332
|
+
customElements.get("mint-input") || e("mint-input", t);
|
|
333
|
+
//#endregion
|
|
334
|
+
export { t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./icon-dG8sLTBn.js`);const e=require(`./register-element-tCL_F1YI.js`);require(`./icon-CyzR9aVl.js`),require(`./caret-up-3XCuTXSE.js`),require(`./caret-down-BN9cl4o4.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`type`,`placeholder`,`value`,`disabled`,`id`,`name`,`required`,`readonly`,`rows`,`icon`,`label`,`info`,`error`,`error-message`,`loading`,`aria-label`,`aria-labelledby`,`aria-describedby`]}constructor(){super(),this._input=null,this._textarea=null,this._element=null,this._wrapper=null,this._icon=null,this._prependSlotContainer=null,this._appendSlotContainer=null,this._colorPicker=null,this._colorTextInput=null,this._colorContainer=null,this._colorPickerWrapper=null,this._numberSpinnerContainer=null,this._numberIncrementButton=null,this._numberDecrementButton=null,this._contentObserver=null,this._focusHandler=null,this._a11yId=``,this._blurHandler=null,this._clickHandler=null,this._clickOutsideHandler=null,this._renderFrame=null}connectedCallback(){this.classList.add(`mint-input-host`),this.render(),this._observeContentMutations()}disconnectedCallback(){this.removeEventListeners(),this._contentObserver&&=(this._contentObserver.disconnect(),null),this._renderFrame!==null&&(cancelAnimationFrame(this._renderFrame),this._renderFrame=null)}attributeChangedCallback(e,t,n){if(t!==n){if(e===`error`||e===`error-message`){this._renderErrorState(),this._syncControlAccessibility(),this._element&&(this._element.className=this.getInputClasses()),this._colorTextInput&&(this._colorTextInput.className=this.getInputClasses());return}if(e===`loading`){this.render();return}this.render()}}_scheduleRender(){this._renderFrame===null&&(this._renderFrame=requestAnimationFrame(()=>{this._renderFrame=null,this.render()}))}_observeContentMutations(){this._contentObserver||=new MutationObserver(()=>{this._scheduleRender()}),this._contentObserver.disconnect(),this._contentObserver.observe(this,{childList:!0,attributes:!0,attributeFilter:[`slot`]})}getType(){return this.getAttribute(`type`)||`text`}getRows(){let e=this.getAttribute(`rows`);return e?parseInt(e,10):3}_getNormalizedType(){let e=this.getType();return e===`datetime`?`datetime-local`:e===`money`?`text`:e===`textarea`?`textarea`:e}_isTextarea(){return this.getType()===`textarea`}_isMoney(){return this.getType()===`money`}_isColor(){return this.getType()===`color`}_isNumber(){return this.getType()===`number`}getPlaceholder(){return this.getAttribute(`placeholder`)||``}getValue(){return this._isColor()?this._colorTextInput?this._colorTextInput.value:this._colorPicker?this._colorPicker.value:this.getAttribute(`value`)||`#000000`:this._element?this._element.value:this.getAttribute(`value`)||``}set value(e){try{this._isColor()?(this._colorPicker&&(this._colorPicker.value=e||`#000000`),this._colorTextInput&&(this._colorTextInput.value=e||`#000000`)):this._element&&(this._element.value=e),e?this.setAttribute(`value`,e):this.removeAttribute(`value`)}catch{}}get value(){try{return this.getValue()||``}catch{return``}}isDisabled(){return this.getAttribute(`disabled`)===`true`}isReadonly(){return this.getAttribute(`readonly`)===`true`}isRequired(){return this.getAttribute(`required`)===`true`}hasError(){return this.getAttribute(`error`)===`true`}getErrorMessage(){return this.getAttribute(`error-message`)||``}getId(){return this.getAttribute(`id`)||``}getName(){return this.getAttribute(`name`)||``}getIcon(){return this.getAttribute(`icon`)||``}getLabel(){return this.getAttribute(`label`)||``}getInfo(){return this.getAttribute(`info`)||``}getInputClasses(){let e=this._isTextarea(),t=!!this.getIcon(),n=this.querySelector(`[slot="prepend"]`)!==null,r=this.querySelector(`[slot="append"]`)!==null,i=this._isColor(),a=this._isNumber(),o=this.hasError();return[`mint-input-control`,e&&`is-textarea`,t&&`has-icon`,i&&`is-color`,n&&`has-prepend`,r&&`has-append`,a&&`is-number`,o&&`has-error`].filter(Boolean).join(` `)}_syncSlotAdornments(e,t){if(!this._wrapper||e||this._isColor()){this._prependSlotContainer&&=(this._prependSlotContainer.remove(),null),this._appendSlotContainer&&=(this._appendSlotContainer.remove(),null);return}this._prependSlotContainer||(this._prependSlotContainer=document.createElement(`div`),this._prependSlotContainer.className=`mint-input-adornment mint-input-prepend-slot`,this._wrapper.appendChild(this._prependSlotContainer)),this._appendSlotContainer||(this._appendSlotContainer=document.createElement(`div`),this._appendSlotContainer.className=`mint-input-adornment mint-input-append-slot`,this._wrapper.appendChild(this._appendSlotContainer)),this._prependSlotContainer.classList.toggle(`has-icon-offset`,t);let n=Array.from(this.querySelectorAll(`[slot="prepend"]`)),r=Array.from(this.querySelectorAll(`[slot="append"]`));this._prependSlotContainer.replaceChildren(),this._appendSlotContainer.replaceChildren(),n.forEach(e=>this._prependSlotContainer.appendChild(e)),r.forEach(e=>this._appendSlotContainer.appendChild(e)),this._prependSlotContainer.classList.toggle(`is-hidden`,n.length===0),this._appendSlotContainer.classList.toggle(`is-hidden`,r.length===0)}isLoading(){return this.getAttribute(`loading`)===`true`}render(){this.getType();let e=this._getNormalizedType(),t=this._isTextarea(),n=this._isMoney(),r=this._isColor(),i=this.getPlaceholder(),a=this.isDisabled(),o=this.isReadonly(),s=this.isRequired(),c=this.getId(),l=this.getName(),u=this.getAttribute(`value`)||(r?`#000000`:``),d=this.getRows(),f=this.getIcon(),p=this.getLabel(),m=this.getInfo(),h=this.isLoading();if(r&&this._renderSkeleton(h),r){this._input&&=(this._input.remove(),null),this._textarea&&=(this._textarea.remove(),null),this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-input-wrapper`,this.appendChild(this._wrapper)),this._colorContainer&&=(this._colorContainer.remove(),null),this._colorPickerWrapper&&!r&&(this._colorPickerWrapper.remove(),this._colorPickerWrapper=null),this._colorPickerWrapper||(this._colorPickerWrapper=document.createElement(`div`),this._colorPickerWrapper.className=`mint-color-picker-wrapper`,this._wrapper.appendChild(this._colorPickerWrapper),this._colorPicker=document.createElement(`input`),this._colorPicker.type=`color`,this._colorPicker.className=`mint-color-picker`,this._colorPickerWrapper.appendChild(this._colorPicker),this._focusHandler=e=>{this._colorPickerWrapper&&this._colorPicker&&this._colorPicker.matches(`:focus-visible`)&&requestAnimationFrame(()=>{this._colorPicker&&this._colorPicker.matches(`:focus-visible`)&&this._colorPickerWrapper?.classList.add(`is-focused`)})},this._blurHandler=()=>{this._colorPickerWrapper&&this._colorPickerWrapper.classList.remove(`is-focused`)},this._colorPicker.addEventListener(`focus`,this._focusHandler),this._colorPicker.addEventListener(`blur`,this._blurHandler),this._colorPicker.addEventListener(`input`,()=>{let e=this._colorPicker?.value||`#000000`;this._colorTextInput&&(this._colorTextInput.value=e),this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0}))}),this._colorPicker.addEventListener(`change`,()=>{let e=this._colorPicker?.value||`#000000`;this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,cancelable:!0}))})),this._colorTextInput||(this._colorTextInput=document.createElement(`input`),this._colorTextInput.type=`text`,this._colorTextInput.className=this.getInputClasses(),this._colorTextInput.placeholder=i||`#000000`,this._colorTextInput.pattern=`^#[0-9A-Fa-f]{6}$`,this._wrapper.appendChild(this._colorTextInput),this._colorTextInput.addEventListener(`input`,()=>{let e=this._colorTextInput?.value||``;/^#[0-9A-Fa-f]{6}$/.test(e)&&(this._colorPicker&&(this._colorPicker.value=e),this.setAttribute(`value`,e),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0})))}),this._colorTextInput.addEventListener(`blur`,()=>{let e=this._colorTextInput?.value||``;/^#[0-9A-Fa-f]{6}$/.test(e)?(this._colorPicker&&(this._colorPicker.value=e),this.setAttribute(`value`,e)):this._colorPicker&&this._colorTextInput&&(this._colorTextInput.value=this._colorPicker.value),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this._colorPicker?.value||`#000000`},bubbles:!0,cancelable:!0}))}));let e=u||`#000000`;if(this._colorPicker&&this._colorPicker.value!==e&&(this._colorPicker.value=e),this._colorTextInput&&this._colorTextInput.value!==e&&(this._colorTextInput.value=e),this._colorPicker&&(this._colorPicker.disabled=a),this._colorPickerWrapper&&(a?this._colorPickerWrapper.classList.add(`is-disabled`):this._colorPickerWrapper.classList.remove(`is-disabled`)),this._colorTextInput&&(this._colorTextInput.disabled=a,this._colorTextInput.readOnly=o,this._colorTextInput.required=s),this._colorTextInput){let e=this._colorTextInput;c?e.id=c:e.removeAttribute(`id`),l?e.name=l:e.removeAttribute(`name`),e.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),this._element=e}this._renderErrorState();let t=this.querySelector(`.mint-input-label-container`);if(p||m){t||(t=document.createElement(`div`),t.className=`mint-input-label-container`,this._wrapper&&this._wrapper.parentElement===this?this.insertBefore(t,this._wrapper):this.insertBefore(t,this.firstChild));let e=t.querySelector(`.mint-input-label`);if(p){e||(e=document.createElement(`label`),e.className=`mint-input-label`,t.insertBefore(e,t.firstChild)),e.textContent=p;let n=c||this._colorTextInput?.id;if(n)e.setAttribute(`for`,n);else{let t=`mint-input-${Math.random().toString(36).substr(2,9)}`;this._colorTextInput&&(this._colorTextInput.id=t),e.setAttribute(`for`,t)}a?e.classList.add(`is-disabled`):e.classList.remove(`is-disabled`)}else e&&e.remove();let n=t.querySelector(`.mint-input-info`);m?(n||(n=document.createElement(`span`),n.className=`mint-input-info`,t.appendChild(n)),n.textContent=m,a?n.classList.add(`is-disabled`):n.classList.remove(`is-disabled`)):n&&n.remove()}else t&&t.remove();return}if(this._wrapper||(this._wrapper=document.createElement(`div`),this._wrapper.className=`mint-input-wrapper`,this.appendChild(this._wrapper)),this._colorContainer&&(this._colorContainer.remove(),this._colorContainer=null,this._colorPicker=null,this._colorTextInput=null),this._colorPickerWrapper&&!r&&(this._colorPickerWrapper.remove(),this._colorPickerWrapper=null,this._colorPicker=null,this._colorTextInput=null),f&&!t?this._icon?this._icon.setAttribute(`name`,f):(this._icon=document.createElement(`mint-icon`),this._icon.setAttribute(`name`,f),this._icon.className=`mint-input-icon`,this._wrapper.appendChild(this._icon)):this._icon&&=(this._icon.remove(),null),this._syncSlotAdornments(t,!!f),this._isNumber()&&!t){if(!this._numberSpinnerContainer){this._numberSpinnerContainer=document.createElement(`div`),this._numberSpinnerContainer.className=`mint-input-spinner`,this._wrapper.appendChild(this._numberSpinnerContainer),this._numberIncrementButton=document.createElement(`button`),this._numberIncrementButton.type=`button`,this._numberIncrementButton.className=`mint-input-spinner-button`;let e=document.createElement(`mint-icon`);e.setAttribute(`name`,`caret-up`),e.className=`mint-input-spinner-icon`,this._numberIncrementButton.appendChild(e),this._numberSpinnerContainer.appendChild(this._numberIncrementButton),this._numberDecrementButton=document.createElement(`button`),this._numberDecrementButton.type=`button`,this._numberDecrementButton.className=`mint-input-spinner-button`;let t=document.createElement(`mint-icon`);t.setAttribute(`name`,`caret-down`),t.className=`mint-input-spinner-icon`,this._numberDecrementButton.appendChild(t),this._numberSpinnerContainer.appendChild(this._numberDecrementButton),this._numberIncrementButton.addEventListener(`click`,e=>{if(e.preventDefault(),e.stopPropagation(),this._input&&!this._input.disabled&&!this._input.readOnly){let e=parseFloat(this._input.value)||0,t=parseFloat(this._input.step)||1,n=this._input.min?parseFloat(this._input.min):void 0,r=this._input.max?parseFloat(this._input.max):void 0,i=e+t;r!==void 0&&i>r&&(i=r),n!==void 0&&i<n&&(i=n),this._input.value=i.toString(),this.setAttribute(`value`,i.toString()),this._input.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input.dispatchEvent(new Event(`change`,{bubbles:!0}))}}),this._numberDecrementButton.addEventListener(`click`,e=>{if(e.preventDefault(),e.stopPropagation(),this._input&&!this._input.disabled&&!this._input.readOnly){let e=parseFloat(this._input.value)||0,t=parseFloat(this._input.step)||1,n=this._input.min?parseFloat(this._input.min):void 0,r=this._input.max?parseFloat(this._input.max):void 0,i=e-t;n!==void 0&&i<n&&(i=n),r!==void 0&&i>r&&(i=r),this._input.value=i.toString(),this.setAttribute(`value`,i.toString()),this._input.dispatchEvent(new Event(`input`,{bubbles:!0})),this._input.dispatchEvent(new Event(`change`,{bubbles:!0}))}})}this._numberIncrementButton&&(this._numberIncrementButton.disabled=a||o),this._numberDecrementButton&&(this._numberDecrementButton.disabled=a||o)}else this._numberSpinnerContainer&&(this._numberSpinnerContainer.remove(),this._numberSpinnerContainer=null,this._numberIncrementButton=null,this._numberDecrementButton=null);if(t){if(this._input&&=(this._input.remove(),null),this._textarea||(this._textarea=document.createElement(`textarea`),this._element=this._textarea,this._wrapper.appendChild(this._textarea),this.setupEventListeners()),this._element=this._textarea,this._textarea.placeholder=i,this._textarea.disabled=a,this._textarea.readOnly=o,this._textarea.required=s,this._textarea.rows=d,this._textarea.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),u!==this._textarea.value&&(this._textarea.value=u),c?this._textarea.id=c:this._textarea.removeAttribute(`id`),l?this._textarea.name=l:this._textarea.removeAttribute(`name`),this._textarea.className=this.getInputClasses(),this.firstChild&&this.firstChild!==this._wrapper&&this.firstChild.nodeType===Node.TEXT_NODE){let e=this.firstChild.textContent;e&&!this._textarea.value&&(this._textarea.value=e.trim()),this.removeChild(this.firstChild)}}else if(this._textarea&&=(this._textarea.remove(),null),this._input||(this._input=document.createElement(`input`),this._element=this._input,this._wrapper.appendChild(this._input),this.setupEventListeners()),this._element=this._input,this._input.type=e,this._input.placeholder=i,this._input.disabled=a,this._input.readOnly=o,this._input.required=s,this._input.setAttribute(`aria-invalid`,this.hasError()?`true`:`false`),n?(this._input.inputMode=`decimal`,this._input.pattern=`[0-9]*\\.?[0-9]*`):(this._input.removeAttribute(`inputmode`),this._input.removeAttribute(`pattern`)),u!==this._input.value&&(this._input.value=u),c?this._input.id=c:this._input.removeAttribute(`id`),l?this._input.name=l:this._input.removeAttribute(`name`),this._input.className=this.getInputClasses(),this.firstChild&&this.firstChild!==this._wrapper&&this.firstChild.nodeType===Node.TEXT_NODE){let e=this.firstChild.textContent;e&&!this._input.value&&(this._input.value=e.trim()),this.removeChild(this.firstChild)}let g=this.querySelector(`.mint-input-label-container`);if(p||m){g||(g=document.createElement(`div`),g.className=`mint-input-label-container`,this._wrapper&&this._wrapper.parentElement===this?this.insertBefore(g,this._wrapper):this.insertBefore(g,this.firstChild));let e=g.querySelector(`.mint-input-label`);if(p){e||(e=document.createElement(`label`),e.className=`mint-input-label`,g.insertBefore(e,g.firstChild)),e.textContent=p;let t=c||this._element?.id||this._colorTextInput?.id||this._input?.id||this._textarea?.id;if(t)e.setAttribute(`for`,t);else{let t=`mint-input-${Math.random().toString(36).substr(2,9)}`;this._element?this._element.id=t:this._colorTextInput?this._colorTextInput.id=t:this._input?this._input.id=t:this._textarea&&(this._textarea.id=t),e.setAttribute(`for`,t)}a?e.classList.add(`is-disabled`):e.classList.remove(`is-disabled`)}else e&&e.remove();let t=g.querySelector(`.mint-input-info`);m?(t||(t=document.createElement(`span`),t.className=`mint-input-info`,g.appendChild(t)),t.textContent=m,a?t.classList.add(`is-disabled`):t.classList.remove(`is-disabled`)):t&&t.remove()}else g&&g.remove();this._syncSlotAdornments(t,!!f),this._renderErrorState(),this._syncControlAccessibility(),this._renderSkeleton(h)}_renderErrorState(){let e=this.hasError(),t=this.getErrorMessage(),n=this.querySelector(`.mint-input-error`);e&&t?(n||(n=document.createElement(`div`),n.className=`mint-input-error`,this.appendChild(n)),n.textContent=t):n&&n.remove()}_syncControlAccessibility(){let e=this._element;if(!e)return;this._a11yId||=this.getId()||`mint-input-${Math.random().toString(36).slice(2,10)}`;let t=this.getAttribute(`aria-label`)?.trim(),n=!!this.querySelector(`.mint-input-label`);t?e.setAttribute(`aria-label`,t):!n&&this.getAttribute(`placeholder`)?.trim()?e.setAttribute(`aria-label`,this.getAttribute(`placeholder`).trim()):e.removeAttribute(`aria-label`);let r=this.querySelector(`.mint-input-info`),i=this.querySelector(`.mint-input-error`),a=(this.getAttribute(`aria-describedby`)||``).split(/\s+/).filter(Boolean);r&&(r.id=`${this._a11yId}-info`,a.push(r.id)),i&&(i.id=`${this._a11yId}-error`,a.push(i.id)),e.setAttribute(`aria-invalid`,String(this.hasError())),a.length?e.setAttribute(`aria-describedby`,Array.from(new Set(a)).join(` `)):e.removeAttribute(`aria-describedby`);let o=this.getAttribute(`aria-labelledby`)?.trim();o?e.setAttribute(`aria-labelledby`,o):e.removeAttribute(`aria-labelledby`)}setupEventListeners(){this._element&&(this._element.addEventListener(`input`,()=>{let e=this._element?.value||``;e?this.setAttribute(`value`,e):this.removeAttribute(`value`);let t=new Event(`input`,{bubbles:!0,cancelable:!0,composed:!0});this.dispatchEvent(t),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,cancelable:!0,composed:!0}))}),this._element.addEventListener(`blur`,()=>{let e=this._element?.value||``;e?this.setAttribute(`value`,e):this.removeAttribute(`value`),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,cancelable:!0}))}))}removeEventListeners(){this._colorPicker&&(this._focusHandler&&=(this._colorPicker.removeEventListener(`focus`,this._focusHandler),null),this._blurHandler&&=(this._colorPicker.removeEventListener(`blur`,this._blurHandler),null))}focus(){this._isColor()&&this._colorTextInput?this._colorTextInput.focus():this._element?.focus()}blur(){this._isColor()&&this._colorTextInput?this._colorTextInput.blur():this._element?.blur()}_renderSkeleton(e){this.classList.toggle(`is-loading`,e);let t=this.querySelector(`.mint-input-skeleton-container`),n=this._wrapper||this.querySelector(`.mint-input-wrapper`);if(e){t||(t=document.createElement(`div`),t.className=`mint-input-skeleton-container`,n?(n.classList.add(`mint-input-positioned`),n.appendChild(t)):(this.classList.add(`mint-input-positioned`),this.appendChild(t)));let e=t.querySelector(`.mint-input-skeleton`);e||(e=document.createElement(`div`),e.className=`mint-input-skeleton`,t.appendChild(e)),e.parentElement||t.appendChild(e)}}};customElements.get(`mint-input`)||e.t(`mint-input`,t),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./register-element-tCL_F1YI.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`href`,`target`]}constructor(){super(),this._link=null}connectedCallback(){this.render()}attributeChangedCallback(e,t,n){t!==n&&this.render()}getHref(){return this.getAttribute(`href`)||`#`}getTarget(){return this.getAttribute(`target`)||``}hasIcon(){return!!this.querySelector(`mint-icon`)||!!this._link?.querySelector(`mint-icon`)}render(){let e=this.getHref(),t=this.getTarget();if(!this._link){for(this._link=document.createElement(`a`);this.firstChild;)this._link.appendChild(this.firstChild);this.appendChild(this._link)}this._link.href=e,t?(this._link.target=t,t===`_blank`&&(this._link.rel=`noopener noreferrer`)):(this._link.removeAttribute(`target`),this._link.removeAttribute(`rel`));let n=[`mint-link-anchor`,this.hasIcon()?`mint-link-with-icon`:``];this._link.className=n.filter(Boolean).join(` `)}};typeof customElements<`u`&&!customElements.get(`mint-link`)&&e.t(`mint-link`,t),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as e } from "./register-element-BFYmIynH.js";
|
|
2
|
+
//#region src/components/link/Link.js
|
|
3
|
+
var t = class extends HTMLElement {
|
|
4
|
+
static get observedAttributes() {
|
|
5
|
+
return ["href", "target"];
|
|
6
|
+
}
|
|
7
|
+
constructor() {
|
|
8
|
+
super(), this._link = null;
|
|
9
|
+
}
|
|
10
|
+
connectedCallback() {
|
|
11
|
+
this.render();
|
|
12
|
+
}
|
|
13
|
+
attributeChangedCallback(e, t, n) {
|
|
14
|
+
t !== n && this.render();
|
|
15
|
+
}
|
|
16
|
+
getHref() {
|
|
17
|
+
return this.getAttribute("href") || "#";
|
|
18
|
+
}
|
|
19
|
+
getTarget() {
|
|
20
|
+
return this.getAttribute("target") || "";
|
|
21
|
+
}
|
|
22
|
+
hasIcon() {
|
|
23
|
+
return !!this.querySelector("mint-icon") || !!this._link?.querySelector("mint-icon");
|
|
24
|
+
}
|
|
25
|
+
render() {
|
|
26
|
+
let e = this.getHref(), t = this.getTarget();
|
|
27
|
+
if (!this._link) {
|
|
28
|
+
for (this._link = document.createElement("a"); this.firstChild;) this._link.appendChild(this.firstChild);
|
|
29
|
+
this.appendChild(this._link);
|
|
30
|
+
}
|
|
31
|
+
this._link.href = e, t ? (this._link.target = t, t === "_blank" && (this._link.rel = "noopener noreferrer")) : (this._link.removeAttribute("target"), this._link.removeAttribute("rel"));
|
|
32
|
+
let n = ["mint-link-anchor", this.hasIcon() ? "mint-link-with-icon" : ""];
|
|
33
|
+
this._link.className = n.filter(Boolean).join(" ");
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
typeof customElements < "u" && !customElements.get("mint-link") && e("mint-link", t);
|
|
37
|
+
//#endregion
|
|
38
|
+
export { t };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import "./icon-gQAtsERy.js";
|
|
2
|
+
import { t as e } from "./register-element-BFYmIynH.js";
|
|
3
|
+
import "./text-BHkEs8U5.js";
|
|
4
|
+
import "./button-B0Yt0MX1.js";
|
|
5
|
+
import "./stack-DyQfjPDh.js";
|
|
6
|
+
//#region src/components/modal/Modal.js
|
|
7
|
+
var t = class extends HTMLElement {
|
|
8
|
+
static get observedAttributes() {
|
|
9
|
+
return [
|
|
10
|
+
"id",
|
|
11
|
+
"heading",
|
|
12
|
+
"open"
|
|
13
|
+
];
|
|
14
|
+
}
|
|
15
|
+
constructor() {
|
|
16
|
+
super(), this._overlay = null, this._modal = null, this._header = null, this._headingSlot = null, this._bodySlot = null, this._actionsSlot = null, this._closeButton = null, this._triggerElement = null, this._triggerPoint = null, this._renderedOpen = !1, this._lastPointerPoint = null, this._pointerDownHandler = null, this._darkModeObserver = null, this._exitTimer = null, this._backdropTimer = null;
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.isOpen() || this.classList.add("mint-hidden"), this.render(), this._observeDarkMode(), this._pointerDownHandler = (e) => {
|
|
20
|
+
this._lastPointerPoint = {
|
|
21
|
+
x: e.clientX,
|
|
22
|
+
y: e.clientY,
|
|
23
|
+
target: e.target,
|
|
24
|
+
time: Date.now()
|
|
25
|
+
};
|
|
26
|
+
}, document.addEventListener("pointerdown", this._pointerDownHandler, !0);
|
|
27
|
+
}
|
|
28
|
+
disconnectedCallback() {
|
|
29
|
+
this._pointerDownHandler &&= (document.removeEventListener("pointerdown", this._pointerDownHandler, !0), null), this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this._darkModeObserver &&= (this._darkModeObserver.disconnect(), null);
|
|
30
|
+
}
|
|
31
|
+
attributeChangedCallback(e, t, n) {
|
|
32
|
+
t !== n && (e === "open" && n !== null && !this._triggerElement && (this._triggerElement = this._findTriggerElement(), this._triggerPoint = this._findTriggerPoint(this._triggerElement)), this.render());
|
|
33
|
+
}
|
|
34
|
+
getId() {
|
|
35
|
+
return this.getAttribute("id") || "";
|
|
36
|
+
}
|
|
37
|
+
getHeading() {
|
|
38
|
+
return this.getAttribute("heading") || "";
|
|
39
|
+
}
|
|
40
|
+
isOpen() {
|
|
41
|
+
return this.hasAttribute("open");
|
|
42
|
+
}
|
|
43
|
+
open(e) {
|
|
44
|
+
this._triggerElement = this._findTriggerElement(e), this._triggerPoint = this._findTriggerPoint(this._triggerElement), this.setAttribute("open", "");
|
|
45
|
+
}
|
|
46
|
+
close() {
|
|
47
|
+
this.removeAttribute("open");
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
let e = this.getId(), t = this.getHeading(), n = this.isOpen();
|
|
51
|
+
if (e && (this.id = e), this._overlay || (this._overlay = document.createElement("div"), this._overlay.className = "mint-modal-overlay", this._overlay.addEventListener("click", () => this.close()), this.appendChild(this._overlay)), this._modal || (this._modal = document.createElement("div"), this._modal.className = "mint-modal-shell", this.appendChild(this._modal)), n) {
|
|
52
|
+
let e = this._modal.querySelector(".modal-content");
|
|
53
|
+
e || (e = document.createElement("div"), e.className = "modal-content", this._modal.appendChild(e)), this._renderedOpen || (this._renderedOpen = !0, this._animateEnter());
|
|
54
|
+
} else this._renderedOpen && (this._renderedOpen = !1, this._animateExit());
|
|
55
|
+
let r = this._modal.querySelector(".modal-content");
|
|
56
|
+
r || (r = document.createElement("div"), r.className = "modal-content", this._modal.appendChild(r)), this._header || (this._header = document.createElement("div"), this._header.className = "mint-modal-header", r.appendChild(this._header)), this._headingSlot || (this._headingSlot = document.createElement("div"), this._headingSlot.className = "mint-modal-heading", this._headingSlot.setAttribute("slot", "heading"), this._header.appendChild(this._headingSlot));
|
|
57
|
+
let i = this._headingSlot.querySelector("mint-text");
|
|
58
|
+
t ? (i || (i = document.createElement("mint-text"), i.setAttribute("size", "sub-heading"), i.setAttribute("bold", ""), this._headingSlot.appendChild(i)), i.textContent = t) : i && i.remove(), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._headingSlot && e.getAttribute("slot") === "heading").forEach((e) => {
|
|
59
|
+
e.parentElement !== this._headingSlot && this._headingSlot.appendChild(e);
|
|
60
|
+
}), this._closeButton || (this._closeButton = document.createElement("mint-button"), this._closeButton.setAttribute("variant", "ghost"), this._closeButton.setAttribute("icon", "close"), this._closeButton.addEventListener("click", () => this.close()), this._header.appendChild(this._closeButton)), this._bodySlot || (this._bodySlot = document.createElement("div"), this._bodySlot.className = "mint-modal-body", this._bodySlot.setAttribute("slot", "body"), r.appendChild(this._bodySlot)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._bodySlot && e.getAttribute("slot") === "body").forEach((e) => {
|
|
61
|
+
e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
62
|
+
}), this._actionsSlot || (this._actionsSlot = document.createElement("div"), this._actionsSlot.className = "mint-modal-actions", this._actionsSlot.setAttribute("slot", "actions"), r.appendChild(this._actionsSlot));
|
|
63
|
+
let a = this._actionsSlot.querySelector("mint-stack");
|
|
64
|
+
a || (a = document.createElement("mint-stack"), a.setAttribute("direction", "horizontal"), a.className = "mint-actions-stack", this._actionsSlot.appendChild(a)), Array.from(this.children).filter((e) => e !== this._overlay && e !== this._modal && e !== this._actionsSlot && e.getAttribute("slot") === "actions").forEach((e) => {
|
|
65
|
+
Array.from(e.children).forEach((e) => {
|
|
66
|
+
e.parentElement !== a && a.appendChild(e);
|
|
67
|
+
}), e.parentElement && e.remove();
|
|
68
|
+
}), Array.from(this.children).forEach((e) => {
|
|
69
|
+
e !== this._overlay && e !== this._modal && e.getAttribute("slot") !== "heading" && e.getAttribute("slot") !== "body" && e.getAttribute("slot") !== "actions" && e !== this._headingSlot && e !== this._bodySlot && e !== this._actionsSlot && e.parentElement !== this._bodySlot && this._bodySlot.appendChild(e);
|
|
70
|
+
}), this._updateBackgroundColor();
|
|
71
|
+
}
|
|
72
|
+
_updateBackgroundColor() {
|
|
73
|
+
if (!this._modal) return;
|
|
74
|
+
document.documentElement?.classList.contains("dark") || document.documentElement?.dataset.mintTheme;
|
|
75
|
+
let e = this._modal.querySelector(".modal-content");
|
|
76
|
+
e && (e.style.background = "var(--mint-color-surface-raised)");
|
|
77
|
+
}
|
|
78
|
+
_observeDarkMode() {
|
|
79
|
+
if (!this._darkModeObserver) {
|
|
80
|
+
if (this._darkModeObserver = new MutationObserver(() => {
|
|
81
|
+
this._updateBackgroundColor();
|
|
82
|
+
}), !document.documentElement) return;
|
|
83
|
+
this._darkModeObserver.observe(document.documentElement, {
|
|
84
|
+
attributes: !0,
|
|
85
|
+
attributeFilter: ["class", "data-mint-theme"]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
_animateEnter() {
|
|
90
|
+
let e = this._modal?.querySelector(".modal-content");
|
|
91
|
+
e && (this._exitTimer &&= (clearTimeout(this._exitTimer), null), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null), this.classList.remove("mint-modal-closing"), this.classList.remove("mint-modal-open"), this.classList.add("mint-modal-open"), this.classList.remove("mint-hidden"), e.style.transform = "none", e.style.opacity = "0", e.style.transition = "none", requestAnimationFrame(() => {
|
|
92
|
+
if (!this.isOpen()) return;
|
|
93
|
+
let t = window.getComputedStyle(e).borderRadius;
|
|
94
|
+
this._setTransformOrigin(e), e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", e.getBoundingClientRect(), e.style.transition = "opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)", requestAnimationFrame(() => {
|
|
95
|
+
this.isOpen() && (e.style.transform = "scale(1)", e.style.opacity = "1", e.style.borderRadius = t);
|
|
96
|
+
});
|
|
97
|
+
}));
|
|
98
|
+
}
|
|
99
|
+
_findTriggerElement(e) {
|
|
100
|
+
if (typeof e == "string") {
|
|
101
|
+
let t = document.getElementById(e);
|
|
102
|
+
return t && !this.contains(t) ? t : null;
|
|
103
|
+
}
|
|
104
|
+
if (e instanceof HTMLElement) return e.isConnected && !this.contains(e) ? e : null;
|
|
105
|
+
let t = this.getAttribute("trigger-id");
|
|
106
|
+
if (t) {
|
|
107
|
+
let e = document.getElementById(t);
|
|
108
|
+
if (e && !this.contains(e)) return e;
|
|
109
|
+
}
|
|
110
|
+
let n = document.activeElement;
|
|
111
|
+
return n instanceof HTMLElement && n.isConnected && n !== document.body && !this.contains(n) ? n : null;
|
|
112
|
+
}
|
|
113
|
+
_findTriggerPoint(e) {
|
|
114
|
+
if (!e) return null;
|
|
115
|
+
let t = this._lastPointerPoint;
|
|
116
|
+
if (!t || Date.now() - t.time > 1e3) return null;
|
|
117
|
+
let n = t.target instanceof Node ? t.target : null;
|
|
118
|
+
return n === e || n && e.contains(n) ? {
|
|
119
|
+
x: t.x,
|
|
120
|
+
y: t.y
|
|
121
|
+
} : null;
|
|
122
|
+
}
|
|
123
|
+
_setTransformOrigin(e) {
|
|
124
|
+
let t = this._findTriggerElement(this._triggerElement);
|
|
125
|
+
this._triggerElement = t;
|
|
126
|
+
let n = this._findTriggerPoint(t);
|
|
127
|
+
if (n) {
|
|
128
|
+
let t = e.getBoundingClientRect();
|
|
129
|
+
e.style.transformOrigin = `${n.x - t.left}px ${n.y - t.top}px`, this._triggerPoint = n;
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
this._triggerPoint = {
|
|
133
|
+
x: window.innerWidth / 2,
|
|
134
|
+
y: 0
|
|
135
|
+
};
|
|
136
|
+
let r = e.getBoundingClientRect();
|
|
137
|
+
e.style.transformOrigin = `${this._triggerPoint.x - r.left}px ${this._triggerPoint.y - r.top}px`;
|
|
138
|
+
}
|
|
139
|
+
_animateExit() {
|
|
140
|
+
this.classList.remove("mint-modal-open"), this._backdropTimer &&= (clearTimeout(this._backdropTimer), null);
|
|
141
|
+
let e = this._modal?.querySelector(".modal-content");
|
|
142
|
+
if (!e) {
|
|
143
|
+
this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing");
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this._exitTimer && clearTimeout(this._exitTimer), this.classList.add("mint-modal-closing"), e.style.transition = "opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)", e.style.borderRadius = "50%", e.style.transform = "scale(0.1, 0.2)", e.style.opacity = "0.9", this._exitTimer = setTimeout(() => {
|
|
147
|
+
this._exitTimer = null, !this.isOpen() && (this.classList.add("mint-hidden"), this.classList.remove("mint-modal-closing"), e.style.transform = "", e.style.opacity = "", e.style.borderRadius = "", e.style.transition = "");
|
|
148
|
+
}, 280);
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
typeof customElements < "u" && !customElements.get("mint-modal") && e("mint-modal", t);
|
|
152
|
+
//#endregion
|
|
153
|
+
export { t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./icon-dG8sLTBn.js`);const e=require(`./register-element-tCL_F1YI.js`);require(`./text-BmHZbBMo.js`),require(`./button-BlbLHMts.js`),require(`./stack-D1uh4L79.js`);var t=class extends HTMLElement{static get observedAttributes(){return[`id`,`heading`,`open`]}constructor(){super(),this._overlay=null,this._modal=null,this._header=null,this._headingSlot=null,this._bodySlot=null,this._actionsSlot=null,this._closeButton=null,this._triggerElement=null,this._triggerPoint=null,this._renderedOpen=!1,this._lastPointerPoint=null,this._pointerDownHandler=null,this._darkModeObserver=null,this._exitTimer=null,this._backdropTimer=null}connectedCallback(){this.isOpen()||this.classList.add(`mint-hidden`),this.render(),this._observeDarkMode(),this._pointerDownHandler=e=>{this._lastPointerPoint={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()}},document.addEventListener(`pointerdown`,this._pointerDownHandler,!0)}disconnectedCallback(){this._pointerDownHandler&&=(document.removeEventListener(`pointerdown`,this._pointerDownHandler,!0),null),this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this._darkModeObserver&&=(this._darkModeObserver.disconnect(),null)}attributeChangedCallback(e,t,n){t!==n&&(e===`open`&&n!==null&&!this._triggerElement&&(this._triggerElement=this._findTriggerElement(),this._triggerPoint=this._findTriggerPoint(this._triggerElement)),this.render())}getId(){return this.getAttribute(`id`)||``}getHeading(){return this.getAttribute(`heading`)||``}isOpen(){return this.hasAttribute(`open`)}open(e){this._triggerElement=this._findTriggerElement(e),this._triggerPoint=this._findTriggerPoint(this._triggerElement),this.setAttribute(`open`,``)}close(){this.removeAttribute(`open`)}render(){let e=this.getId(),t=this.getHeading(),n=this.isOpen();if(e&&(this.id=e),this._overlay||(this._overlay=document.createElement(`div`),this._overlay.className=`mint-modal-overlay`,this._overlay.addEventListener(`click`,()=>this.close()),this.appendChild(this._overlay)),this._modal||(this._modal=document.createElement(`div`),this._modal.className=`mint-modal-shell`,this.appendChild(this._modal)),n){let e=this._modal.querySelector(`.modal-content`);e||(e=document.createElement(`div`),e.className=`modal-content`,this._modal.appendChild(e)),this._renderedOpen||(this._renderedOpen=!0,this._animateEnter())}else this._renderedOpen&&(this._renderedOpen=!1,this._animateExit());let r=this._modal.querySelector(`.modal-content`);r||(r=document.createElement(`div`),r.className=`modal-content`,this._modal.appendChild(r)),this._header||(this._header=document.createElement(`div`),this._header.className=`mint-modal-header`,r.appendChild(this._header)),this._headingSlot||(this._headingSlot=document.createElement(`div`),this._headingSlot.className=`mint-modal-heading`,this._headingSlot.setAttribute(`slot`,`heading`),this._header.appendChild(this._headingSlot));let i=this._headingSlot.querySelector(`mint-text`);t?(i||(i=document.createElement(`mint-text`),i.setAttribute(`size`,`sub-heading`),i.setAttribute(`bold`,``),this._headingSlot.appendChild(i)),i.textContent=t):i&&i.remove(),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._headingSlot&&e.getAttribute(`slot`)===`heading`).forEach(e=>{e.parentElement!==this._headingSlot&&this._headingSlot.appendChild(e)}),this._closeButton||(this._closeButton=document.createElement(`mint-button`),this._closeButton.setAttribute(`variant`,`ghost`),this._closeButton.setAttribute(`icon`,`close`),this._closeButton.addEventListener(`click`,()=>this.close()),this._header.appendChild(this._closeButton)),this._bodySlot||(this._bodySlot=document.createElement(`div`),this._bodySlot.className=`mint-modal-body`,this._bodySlot.setAttribute(`slot`,`body`),r.appendChild(this._bodySlot)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._bodySlot&&e.getAttribute(`slot`)===`body`).forEach(e=>{e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._actionsSlot||(this._actionsSlot=document.createElement(`div`),this._actionsSlot.className=`mint-modal-actions`,this._actionsSlot.setAttribute(`slot`,`actions`),r.appendChild(this._actionsSlot));let a=this._actionsSlot.querySelector(`mint-stack`);a||(a=document.createElement(`mint-stack`),a.setAttribute(`direction`,`horizontal`),a.className=`mint-actions-stack`,this._actionsSlot.appendChild(a)),Array.from(this.children).filter(e=>e!==this._overlay&&e!==this._modal&&e!==this._actionsSlot&&e.getAttribute(`slot`)===`actions`).forEach(e=>{Array.from(e.children).forEach(e=>{e.parentElement!==a&&a.appendChild(e)}),e.parentElement&&e.remove()}),Array.from(this.children).forEach(e=>{e!==this._overlay&&e!==this._modal&&e.getAttribute(`slot`)!==`heading`&&e.getAttribute(`slot`)!==`body`&&e.getAttribute(`slot`)!==`actions`&&e!==this._headingSlot&&e!==this._bodySlot&&e!==this._actionsSlot&&e.parentElement!==this._bodySlot&&this._bodySlot.appendChild(e)}),this._updateBackgroundColor()}_updateBackgroundColor(){if(!this._modal)return;document.documentElement?.classList.contains(`dark`)||document.documentElement?.dataset.mintTheme;let e=this._modal.querySelector(`.modal-content`);e&&(e.style.background=`var(--mint-color-surface-raised)`)}_observeDarkMode(){if(!this._darkModeObserver){if(this._darkModeObserver=new MutationObserver(()=>{this._updateBackgroundColor()}),!document.documentElement)return;this._darkModeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:[`class`,`data-mint-theme`]})}}_animateEnter(){let e=this._modal?.querySelector(`.modal-content`);e&&(this._exitTimer&&=(clearTimeout(this._exitTimer),null),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null),this.classList.remove(`mint-modal-closing`),this.classList.remove(`mint-modal-open`),this.classList.add(`mint-modal-open`),this.classList.remove(`mint-hidden`),e.style.transform=`none`,e.style.opacity=`0`,e.style.transition=`none`,requestAnimationFrame(()=>{if(!this.isOpen())return;let t=window.getComputedStyle(e).borderRadius;this._setTransformOrigin(e),e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,e.getBoundingClientRect(),e.style.transition=`opacity 320ms ease-out, transform 360ms cubic-bezier(0.2, 0.8, 0.2, 1), border-radius 360ms cubic-bezier(0.2, 0.8, 0.2, 1)`,requestAnimationFrame(()=>{this.isOpen()&&(e.style.transform=`scale(1)`,e.style.opacity=`1`,e.style.borderRadius=t)})}))}_findTriggerElement(e){if(typeof e==`string`){let t=document.getElementById(e);return t&&!this.contains(t)?t:null}if(e instanceof HTMLElement)return e.isConnected&&!this.contains(e)?e:null;let t=this.getAttribute(`trigger-id`);if(t){let e=document.getElementById(t);if(e&&!this.contains(e))return e}let n=document.activeElement;return n instanceof HTMLElement&&n.isConnected&&n!==document.body&&!this.contains(n)?n:null}_findTriggerPoint(e){if(!e)return null;let t=this._lastPointerPoint;if(!t||Date.now()-t.time>1e3)return null;let n=t.target instanceof Node?t.target:null;return n===e||n&&e.contains(n)?{x:t.x,y:t.y}:null}_setTransformOrigin(e){let t=this._findTriggerElement(this._triggerElement);this._triggerElement=t;let n=this._findTriggerPoint(t);if(n){let t=e.getBoundingClientRect();e.style.transformOrigin=`${n.x-t.left}px ${n.y-t.top}px`,this._triggerPoint=n;return}this._triggerPoint={x:window.innerWidth/2,y:0};let r=e.getBoundingClientRect();e.style.transformOrigin=`${this._triggerPoint.x-r.left}px ${this._triggerPoint.y-r.top}px`}_animateExit(){this.classList.remove(`mint-modal-open`),this._backdropTimer&&=(clearTimeout(this._backdropTimer),null);let e=this._modal?.querySelector(`.modal-content`);if(!e){this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`);return}this._exitTimer&&clearTimeout(this._exitTimer),this.classList.add(`mint-modal-closing`),e.style.transition=`opacity 220ms ease-in, transform 260ms cubic-bezier(0.4, 0, 1, 1), border-radius 260ms cubic-bezier(0.4, 0, 1, 1)`,e.style.borderRadius=`50%`,e.style.transform=`scale(0.1, 0.2)`,e.style.opacity=`0.9`,this._exitTimer=setTimeout(()=>{this._exitTimer=null,!this.isOpen()&&(this.classList.add(`mint-hidden`),this.classList.remove(`mint-modal-closing`),e.style.transform=``,e.style.opacity=``,e.style.borderRadius=``,e.style.transition=``)},280)}};typeof customElements<`u`&&!customElements.get(`mint-modal`)&&e.t(`mint-modal`,t),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./register-element-tCL_F1YI.js`);var t=new Set([`up`,`down`,`left`,`right`]),n=class extends HTMLElement{static get observedAttributes(){return[`direction`,`open`,`trigger-id`,`trigger-toggle`,`trigger-align`,`padding`,`hover`,`distance`]}constructor(){super(),this._trigger=null,this._triggerLookupTimer=null,this._clickHandler=null,this._hoverEnterHandler=null,this._hoverLeaveHandler=null,this._outsideHandler=null,this._escapeHandler=null,this._positionHandler=null,this._scrollHandler=null,this._resizeObserver=null,this._hoverCloseTimer=null,this._closeAnimationTimer=null,this._blobAnimation=null}connectedCallback(){this.render(),this._setupTrigger()}disconnectedCallback(){this._removeTrigger(),this._removeOpenListeners(),clearTimeout(this._hoverCloseTimer),clearTimeout(this._closeAnimationTimer),this._blobAnimation?.cancel()}attributeChangedCallback(e,t,n){t===n||!this.isConnected||((e===`trigger-id`||e===`trigger-toggle`||e===`hover`)&&this._setupTrigger(),this.render())}getDirection(){let e=this.getAttribute(`direction`)||`down`;return t.has(e)?e:`down`}getTriggerId(){return this.getAttribute(`trigger-id`)||``}isOpen(){return this.hasAttribute(`open`)&&this.getAttribute(`open`)!==`false`}isHoverEnabled(){return this.hasAttribute(`hover`)&&this.getAttribute(`hover`)!==`false`}isTriggerToggleEnabled(){return this.getAttribute(`trigger-toggle`)!==`false`}open(){this.setAttribute(`open`,`true`)}close(){this.removeAttribute(`open`)}_removeTrigger(){clearTimeout(this._triggerLookupTimer),this._triggerLookupTimer=null,this._trigger&&(this._clickHandler&&this._trigger.removeEventListener(`click`,this._clickHandler),this._hoverEnterHandler&&this._trigger.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this._trigger.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._hoverEnterHandler&&this.removeEventListener(`mouseenter`,this._hoverEnterHandler),this._hoverLeaveHandler&&this.removeEventListener(`mouseleave`,this._hoverLeaveHandler),this._trigger.removeAttribute(`aria-haspopup`),this._trigger.removeAttribute(`aria-expanded`),this._trigger=null,this._clickHandler=this._hoverEnterHandler=this._hoverLeaveHandler=null)}_setupTrigger(){this._removeTrigger();let e=this.getTriggerId();if(e){if(this._trigger=document.getElementById(e),!this._trigger){this._triggerLookupTimer=setTimeout(()=>{this.isConnected&&this.getTriggerId()===e&&!this._trigger&&this._setupTrigger()},40);return}this._trigger.setAttribute(`aria-haspopup`,`true`),this._trigger.setAttribute(`aria-expanded`,String(this.isOpen())),this.isTriggerToggleEnabled()&&(this._clickHandler=e=>{this._trigger?.tagName===`A`&&e.preventDefault(),this.isOpen()?this.close():this.open()},this._trigger.addEventListener(`click`,this._clickHandler)),this.isHoverEnabled()&&(this._hoverEnterHandler=()=>{clearTimeout(this._hoverCloseTimer),this.open()},this._hoverLeaveHandler=()=>this._scheduleHoverClose(),this._trigger.addEventListener(`mouseenter`,this._hoverEnterHandler),this._trigger.addEventListener(`mouseleave`,this._hoverLeaveHandler),this.addEventListener(`mouseenter`,this._hoverEnterHandler),this.addEventListener(`mouseleave`,this._hoverLeaveHandler))}}_scheduleHoverClose(){clearTimeout(this._hoverCloseTimer),this._hoverCloseTimer=setTimeout(()=>{!this._trigger?.matches(`:hover`)&&!this.matches(`:hover`)&&this.close()},140)}_removeOpenListeners(){this._outsideHandler&&document.removeEventListener(`click`,this._outsideHandler),this._escapeHandler&&document.removeEventListener(`keydown`,this._escapeHandler),this._positionHandler&&window.removeEventListener(`resize`,this._positionHandler),this._scrollHandler&&window.removeEventListener(`scroll`,this._scrollHandler,!0),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._outsideHandler=this._escapeHandler=this._positionHandler=this._scrollHandler=null}_setOpenListeners(){if(!this._outsideHandler){if(this._outsideHandler=e=>{let t=e.composedPath();t.includes(this)||t.includes(this._trigger)||(e.target instanceof Element?e.target:null)?.closest(`[data-keep-popover-open]`)||this.close()},this._escapeHandler=e=>{e.key===`Escape`&&(this.close(),this._trigger?.focus?.())},this._positionHandler=()=>{this.isOpen()&&this._position()},this._scrollHandler=()=>{this.isOpen()&&this._position({allowViewportFlip:!1,clampToViewport:!1})},typeof ResizeObserver<`u`&&this._trigger){this._resizeObserver=new ResizeObserver(()=>{this.isOpen()&&this._position()}),this._resizeObserver.observe(this);let e=this._trigger,t=0;for(;e&&e!==document.documentElement&&t<8;)this._resizeObserver.observe(e),e=e.parentElement,t+=1}setTimeout(()=>{this.isOpen()&&this._outsideHandler&&document.addEventListener(`click`,this._outsideHandler)},0),document.addEventListener(`keydown`,this._escapeHandler),window.addEventListener(`resize`,this._positionHandler),window.addEventListener(`scroll`,this._scrollHandler,!0)}}_position({allowViewportFlip:e=!0,clampToViewport:t=!0}={}){let n=document.getElementById(this.getTriggerId());n&&n!==this._trigger&&this._setupTrigger();let r=n||this._trigger;if(!r)return;let i=r.getBoundingClientRect(),a={width:this.offsetWidth,height:this.offsetHeight},o=this._distancePx(),s=e?this.getDirection():this.dataset.direction||this.getDirection(),c=0,l=0,u=this.getAttribute(`trigger-align`)||`center`;if(s===`down`||s===`up`){let t=i.bottom+o,n=i.top-a.height-o;e&&s===`down`&&t+a.height>innerHeight-12&&n>=12?s=`up`:e&&s===`up`&&n<12&&t+a.height<=innerHeight-12&&(s=`down`),c=s===`down`?t:n,l=u===`start`?i.left:u===`end`?i.right-a.width:i.left+(i.width-a.width)/2}else{let t=i.right+o,n=i.left-a.width-o;e&&s===`right`&&t+a.width>innerWidth-12&&n>=12?s=`left`:e&&s===`left`&&n<12&&t+a.width<=innerWidth-12&&(s=`right`),l=s===`right`?t:n,c=u===`start`?i.top:u===`end`?i.bottom-a.height:i.top+(i.height-a.height)/2}let d=t?Math.max(12,Math.min(c,innerHeight-a.height-12)):c,f=t?Math.max(12,Math.min(l,innerWidth-a.width-12)):l;this.style.top=`${d}px`,this.style.left=`${f}px`,this.dataset.direction=s,this.style.setProperty(`--mint-popover-origin-x`,`${i.left+i.width/2-f}px`),this.style.setProperty(`--mint-popover-origin-y`,`${i.top+i.height/2-d}px`)}_distancePx(){let e=(this.getAttribute(`distance`)||`8px`).trim(),t=Number.parseFloat(e);return Number.isFinite(t)?e.endsWith(`rem`)?t*(parseFloat(getComputedStyle(document.documentElement).fontSize)||16):Math.max(0,t):8}_animateBlob(e){if(this._blobAnimation?.cancel(),this._blobAnimation=null,typeof this.animate!=`function`)return 0;let t=getComputedStyle(this).borderRadius||`.75rem`;if(matchMedia(`(prefers-reduced-motion: reduce)`).matches)return 0;let n=e?380:280,r=[{transform:`scale(.035, .035)`,borderRadius:`50%`,opacity:.94,offset:0},{transform:`scale(.3, .42)`,borderRadius:`50%`,opacity:1,offset:.58},{transform:`scale(1.035, .96)`,borderRadius:`1rem`,offset:.9},{transform:`scale(1)`,borderRadius:t,offset:1}],i=e?r:[...r].reverse().map(({offset:e,...t})=>({...t,offset:1-e}));return this._blobAnimation=this.animate(i,{duration:n,easing:e?`cubic-bezier(.2, .8, .2, 1)`:`cubic-bezier(.4, 0, .8, .2)`,fill:`both`}),n}render(){let e=this.isOpen(),t=this.hasAttribute(`data-open`)||this.dataset.state===`closing`,n=this.hasAttribute(`data-open`);if(this.toggleAttribute(`data-open`,e),this.setAttribute(`aria-hidden`,String(!e)),this._trigger&&this._trigger.setAttribute(`aria-expanded`,String(e)),e){clearTimeout(this._closeAnimationTimer);let e=!n||this.dataset.state===`closing`;e&&(this._blobAnimation?.cancel(),this._blobAnimation=null),this.dataset.state=`open`,this._setOpenListeners(),this._position(),e&&this._animateBlob(!0),requestAnimationFrame(()=>requestAnimationFrame(()=>{this.isOpen()&&this._position()}))}else if(this._removeOpenListeners(),t){this.dataset.state=`closing`;let e=this._animateBlob(!1);e?this._closeAnimationTimer=setTimeout(()=>{this.dataset.state===`closing`&&(this._blobAnimation?.cancel(),this._blobAnimation=null,this.dataset.state=`closed`)},e):this.dataset.state=`closed`}else this.dataset.state=`closed`}};typeof customElements<`u`&&!customElements.get(`mint-popover`)&&e.t(`mint-popover`,n),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return n}});
|