@nectary/components 2.12.1 → 2.12.3
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/lib/cjs/accordion/index.js +88 -0
- package/lib/cjs/accordion/types.js +1 -0
- package/lib/cjs/accordion-item/index.js +97 -0
- package/lib/cjs/accordion-item/types.js +1 -0
- package/lib/cjs/accordion-item/utils.js +7 -0
- package/lib/cjs/action-menu/index.js +197 -0
- package/lib/cjs/action-menu/types.js +1 -0
- package/lib/cjs/action-menu-option/index.js +84 -0
- package/lib/cjs/action-menu-option/types.js +1 -0
- package/lib/cjs/action-menu-option/utils.js +10 -0
- package/lib/cjs/alert/index.js +50 -0
- package/lib/cjs/alert/types.js +1 -0
- package/lib/cjs/alert/utils.js +7 -0
- package/lib/cjs/avatar/index.js +96 -0
- package/lib/cjs/avatar/types.js +1 -0
- package/lib/cjs/avatar/utils.js +15 -0
- package/lib/cjs/badge/index.js +116 -0
- package/lib/cjs/badge/types.js +1 -0
- package/lib/cjs/badge/utils.js +7 -0
- package/lib/cjs/button/index.js +184 -0
- package/lib/cjs/button/types.js +1 -0
- package/lib/cjs/button/utils.js +7 -0
- package/lib/cjs/card/index.js +135 -0
- package/lib/cjs/card/types.js +1 -0
- package/lib/cjs/card-container/index.js +13 -0
- package/lib/cjs/card-container/types.js +1 -0
- package/lib/cjs/chat/index.js +13 -0
- package/lib/cjs/chat/types.js +1 -0
- package/lib/cjs/chat-block/index.js +88 -0
- package/lib/cjs/chat-block/types.js +1 -0
- package/lib/cjs/chat-bubble/index.js +43 -0
- package/lib/cjs/chat-bubble/types.js +1 -0
- package/lib/cjs/chat-bubble/utils.js +8 -0
- package/lib/cjs/checkbox/index.js +128 -0
- package/lib/cjs/checkbox/types.js +1 -0
- package/lib/cjs/chip/index.js +146 -0
- package/lib/cjs/chip/types.js +1 -0
- package/lib/cjs/chip/utils.js +14 -0
- package/lib/cjs/code-tag/index.js +33 -0
- package/lib/cjs/code-tag/types.js +1 -0
- package/lib/cjs/color-menu/index.js +310 -0
- package/lib/cjs/color-menu/types.js +1 -0
- package/lib/cjs/color-menu/utils.js +18 -0
- package/lib/cjs/color-menu-option/index.js +50 -0
- package/lib/cjs/color-menu-option/types.js +1 -0
- package/lib/cjs/color-menu-option/utils.js +18 -0
- package/lib/cjs/color-swatch/index.js +56 -0
- package/lib/cjs/color-swatch/types.js +1 -0
- package/lib/cjs/color-swatch/utils.js +14 -0
- package/lib/cjs/date-picker/index.js +383 -0
- package/lib/cjs/date-picker/types.js +1 -0
- package/lib/cjs/date-picker/utils.js +171 -0
- package/lib/cjs/dialog/index.js +146 -0
- package/lib/cjs/dialog/types.js +1 -0
- package/lib/cjs/dialog/utils.js +26 -0
- package/lib/cjs/emoji/index.js +48 -0
- package/lib/cjs/emoji/types.js +1 -0
- package/lib/cjs/emoji/utils.js +56 -0
- package/lib/cjs/emoji-picker/index.js +311 -0
- package/lib/cjs/emoji-picker/types.js +1 -0
- package/lib/cjs/field/index.js +122 -0
- package/lib/cjs/field/types.js +1 -0
- package/lib/cjs/file-drop/index.js +207 -0
- package/lib/cjs/file-drop/types.js +1 -0
- package/lib/cjs/file-drop/utils.js +39 -0
- package/lib/cjs/file-picker/index.js +105 -0
- package/lib/cjs/file-picker/types.js +1 -0
- package/lib/cjs/file-picker/utils.js +15 -0
- package/lib/cjs/file-status/index.js +63 -0
- package/lib/cjs/file-status/types.js +1 -0
- package/lib/cjs/file-status/utils.js +7 -0
- package/lib/cjs/flag/index.js +48 -0
- package/lib/cjs/flag/types.js +1 -0
- package/lib/cjs/flag/utils.js +24 -0
- package/lib/cjs/grid/index.js +13 -0
- package/lib/cjs/grid/types.js +1 -0
- package/lib/cjs/grid-item/index.js +37 -0
- package/lib/cjs/grid-item/types.js +1 -0
- package/lib/cjs/help-tooltip/index.js +76 -0
- package/lib/cjs/help-tooltip/types.js +1 -0
- package/lib/cjs/horizontal-stepper/index.js +63 -0
- package/lib/cjs/horizontal-stepper/types.js +1 -0
- package/lib/cjs/horizontal-stepper-item/index.js +63 -0
- package/lib/cjs/horizontal-stepper-item/types.js +1 -0
- package/lib/cjs/horizontal-stepper-item/utils.js +7 -0
- package/lib/cjs/icon/index.js +34 -0
- package/lib/cjs/icon/types.js +1 -0
- package/lib/cjs/icon-button/index.js +177 -0
- package/lib/cjs/icon-button/types.js +1 -0
- package/lib/cjs/icon-button/utils.js +7 -0
- package/lib/cjs/imports.d.js +1 -0
- package/lib/cjs/imports.d.ts +9 -0
- package/lib/cjs/inline-alert/index.js +85 -0
- package/lib/cjs/inline-alert/types.js +1 -0
- package/lib/cjs/inline-alert/utils.js +7 -0
- package/lib/cjs/input/index.js +644 -0
- package/lib/cjs/input/types.js +1 -0
- package/lib/cjs/input/utils.js +317 -0
- package/lib/cjs/link/index.js +152 -0
- package/lib/cjs/link/types.js +1 -0
- package/lib/cjs/list/index.js +16 -0
- package/lib/cjs/list/types.js +1 -0
- package/lib/cjs/list-item/index.js +16 -0
- package/lib/cjs/list-item/types.js +1 -0
- package/lib/cjs/pagination/index.js +149 -0
- package/lib/cjs/pagination/types.js +1 -0
- package/lib/cjs/pop/index.js +427 -0
- package/lib/cjs/pop/types.js +1 -0
- package/lib/cjs/pop/utils.js +24 -0
- package/lib/cjs/popover/index.js +148 -0
- package/lib/cjs/popover/types.js +1 -0
- package/lib/cjs/popover/utils.js +17 -0
- package/lib/cjs/progress/index.js +60 -0
- package/lib/cjs/progress/types.js +1 -0
- package/lib/cjs/progress-stepper/index.js +208 -0
- package/lib/cjs/progress-stepper/types.js +1 -0
- package/lib/cjs/progress-stepper-item/index.js +84 -0
- package/lib/cjs/progress-stepper-item/types.js +1 -0
- package/lib/cjs/progress-stepper-item/utils.js +25 -0
- package/lib/cjs/radio/index.js +156 -0
- package/lib/cjs/radio/types.js +1 -0
- package/lib/cjs/radio-option/index.js +81 -0
- package/lib/cjs/radio-option/types.js +1 -0
- package/lib/cjs/rich-text/index.js +77 -0
- package/lib/cjs/rich-text/types.js +1 -0
- package/lib/cjs/rich-text/utils.js +117 -0
- package/lib/cjs/rich-textarea/index.js +466 -0
- package/lib/cjs/rich-textarea/types.js +1 -0
- package/lib/cjs/rich-textarea/utils.js +1754 -0
- package/lib/cjs/segment/index.js +111 -0
- package/lib/cjs/segment/types.js +1 -0
- package/lib/cjs/segment/utils.js +23 -0
- package/lib/cjs/segment-collapse/index.js +62 -0
- package/lib/cjs/segment-collapse/types.js +1 -0
- package/lib/cjs/segmented-control/index.js +87 -0
- package/lib/cjs/segmented-control/types.js +1 -0
- package/lib/cjs/segmented-control-option/index.js +97 -0
- package/lib/cjs/segmented-control-option/types.js +1 -0
- package/lib/cjs/segmented-icon-control/index.js +103 -0
- package/lib/cjs/segmented-icon-control/types.js +1 -0
- package/lib/cjs/segmented-icon-control-option/index.js +84 -0
- package/lib/cjs/segmented-icon-control-option/types.js +1 -0
- package/lib/cjs/select-button/index.js +204 -0
- package/lib/cjs/select-button/types.js +1 -0
- package/lib/cjs/select-menu/index.js +341 -0
- package/lib/cjs/select-menu/types.js +1 -0
- package/lib/cjs/select-menu-option/index.js +72 -0
- package/lib/cjs/select-menu-option/types.js +1 -0
- package/lib/cjs/skeleton/index.js +110 -0
- package/lib/cjs/skeleton/types.js +1 -0
- package/lib/cjs/skeleton-item/index.js +13 -0
- package/lib/cjs/skeleton-item/types.js +1 -0
- package/lib/cjs/spinner/index.js +60 -0
- package/lib/cjs/spinner/types.js +1 -0
- package/lib/cjs/standalone.js +89 -0
- package/lib/cjs/stop-events/index.js +29 -0
- package/lib/cjs/table/index.js +16 -0
- package/lib/cjs/table/types.js +1 -0
- package/lib/cjs/table-body/index.js +16 -0
- package/lib/cjs/table-body/types.js +1 -0
- package/lib/cjs/table-cell/index.js +23 -0
- package/lib/cjs/table-cell/types.js +1 -0
- package/lib/cjs/table-cell/utils.js +7 -0
- package/lib/cjs/table-head/index.js +16 -0
- package/lib/cjs/table-head/types.js +1 -0
- package/lib/cjs/table-head-cell/index.js +59 -0
- package/lib/cjs/table-head-cell/types.js +1 -0
- package/lib/cjs/table-row/index.js +44 -0
- package/lib/cjs/table-row/types.js +1 -0
- package/lib/cjs/tabs/index.js +82 -0
- package/lib/cjs/tabs/types.js +1 -0
- package/lib/cjs/tabs-icon-option/index.js +81 -0
- package/lib/cjs/tabs-icon-option/types.js +1 -0
- package/lib/cjs/tabs-option/index.js +88 -0
- package/lib/cjs/tabs-option/types.js +1 -0
- package/lib/cjs/tag/index.js +86 -0
- package/lib/cjs/tag/types.js +1 -0
- package/lib/cjs/tag/utils.js +14 -0
- package/lib/cjs/text/index.js +66 -0
- package/lib/cjs/text/types.js +1 -0
- package/lib/cjs/text/utils.js +7 -0
- package/lib/cjs/textarea/index.js +324 -0
- package/lib/cjs/textarea/types.js +1 -0
- package/lib/cjs/tile-control/index.js +112 -0
- package/lib/cjs/tile-control/types.js +1 -0
- package/lib/cjs/tile-control-option/index.js +100 -0
- package/lib/cjs/tile-control-option/types.js +1 -0
- package/lib/cjs/time-picker/index.js +339 -0
- package/lib/cjs/time-picker/types.js +1 -0
- package/lib/cjs/time-picker/utils.js +89 -0
- package/lib/cjs/title/index.js +62 -0
- package/lib/cjs/title/types.js +1 -0
- package/lib/cjs/title/utils.js +24 -0
- package/lib/cjs/toast/index.js +88 -0
- package/lib/cjs/toast/types.js +1 -0
- package/lib/cjs/toast/utils.js +7 -0
- package/lib/cjs/toast-manager/index.js +172 -0
- package/lib/cjs/toast-manager/types.js +1 -0
- package/lib/cjs/toast-manager/utils.js +7 -0
- package/lib/cjs/toggle/index.js +143 -0
- package/lib/cjs/toggle/types.js +1 -0
- package/lib/cjs/tooltip/index.js +277 -0
- package/lib/cjs/tooltip/tooltip-state.js +133 -0
- package/lib/cjs/tooltip/types.js +1 -0
- package/lib/cjs/tooltip/utils.js +25 -0
- package/lib/cjs/types.d.js +1 -0
- package/lib/cjs/utils/context.js +92 -0
- package/lib/cjs/utils/countries.js +9 -0
- package/lib/cjs/utils/csv.js +32 -0
- package/lib/cjs/utils/debounce.js +29 -0
- package/lib/cjs/utils/dom.js +183 -0
- package/lib/cjs/utils/element.js +58 -0
- package/lib/cjs/utils/event-target.js +36 -0
- package/lib/cjs/utils/get-react-event-handler.js +15 -0
- package/lib/cjs/utils/index.js +137 -0
- package/lib/cjs/utils/markdown.js +151 -0
- package/lib/cjs/utils/rect.js +37 -0
- package/lib/cjs/utils/size.js +9 -0
- package/lib/cjs/utils/slot.js +47 -0
- package/lib/cjs/utils/throttle.js +26 -0
- package/lib/cjs/utils/uid.js +20 -0
- package/lib/cjs/vertical-stepper/index.js +59 -0
- package/lib/cjs/vertical-stepper/types.js +1 -0
- package/lib/cjs/vertical-stepper-item/index.js +63 -0
- package/lib/cjs/vertical-stepper-item/types.js +1 -0
- package/lib/cjs/vertical-stepper-item/utils.js +7 -0
- package/lib/esm/accordion/index.d.ts +11 -0
- package/lib/esm/accordion/types.d.ts +21 -0
- package/lib/esm/accordion-item/index.d.ts +14 -0
- package/lib/esm/accordion-item/types.d.ts +36 -0
- package/lib/esm/accordion-item/utils.d.ts +2 -0
- package/lib/esm/action-menu/index.d.ts +11 -0
- package/lib/esm/action-menu/types.d.ts +13 -0
- package/lib/esm/action-menu-option/index.d.ts +12 -0
- package/lib/esm/action-menu-option/types.d.ts +23 -0
- package/lib/esm/action-menu-option/utils.d.ts +2 -0
- package/lib/esm/alert/index.d.ts +14 -0
- package/lib/esm/alert/types.d.ts +18 -0
- package/lib/esm/alert/utils.d.ts +2 -0
- package/lib/esm/avatar/index.d.ts +11 -0
- package/lib/esm/avatar/types.d.ts +37 -0
- package/lib/esm/avatar/utils.d.ts +4 -0
- package/lib/esm/badge/index.d.ts +11 -0
- package/lib/esm/badge/types.d.ts +34 -0
- package/lib/esm/badge/utils.d.ts +2 -0
- package/lib/esm/button/index.d.ts +11 -0
- package/lib/esm/button/types.d.ts +53 -0
- package/lib/esm/button/utils.d.ts +2 -0
- package/lib/esm/card/index.d.ts +13 -0
- package/lib/esm/card/types.d.ts +28 -0
- package/lib/esm/card-container/index.d.ts +11 -0
- package/lib/esm/card-container/types.d.ts +3 -0
- package/lib/esm/chat/index.d.ts +11 -0
- package/lib/esm/chat/types.d.ts +3 -0
- package/lib/esm/chat-block/index.d.ts +11 -0
- package/lib/esm/chat-block/types.d.ts +30 -0
- package/lib/esm/chat-bubble/index.d.ts +11 -0
- package/lib/esm/chat-bubble/types.d.ts +20 -0
- package/lib/esm/chat-bubble/utils.d.ts +3 -0
- package/lib/esm/checkbox/index.d.ts +11 -0
- package/lib/esm/checkbox/types.d.ts +49 -0
- package/lib/esm/chip/index.d.ts +13 -0
- package/lib/esm/chip/types.d.ts +37 -0
- package/lib/esm/chip/utils.d.ts +2 -0
- package/lib/esm/code-tag/index.d.ts +11 -0
- package/lib/esm/code-tag/types.d.ts +11 -0
- package/lib/esm/color-menu/index.d.ts +11 -0
- package/lib/esm/color-menu/types.d.ts +32 -0
- package/lib/esm/color-menu/utils.d.ts +1 -0
- package/lib/esm/color-menu-option/index.d.ts +13 -0
- package/lib/esm/color-menu-option/types.d.ts +11 -0
- package/lib/esm/color-menu-option/utils.d.ts +1 -0
- package/lib/esm/color-swatch/index.d.ts +12 -0
- package/lib/esm/color-swatch/types.d.ts +11 -0
- package/lib/esm/color-swatch/utils.d.ts +2 -0
- package/lib/esm/colors.json +88 -0
- package/lib/esm/date-picker/index.d.ts +14 -0
- package/lib/esm/date-picker/types.d.ts +70 -0
- package/lib/esm/date-picker/utils.d.ts +28 -0
- package/lib/esm/dialog/index.d.ts +15 -0
- package/lib/esm/dialog/types.d.ts +28 -0
- package/lib/esm/dialog/utils.d.ts +2 -0
- package/lib/esm/emoji/index.d.ts +11 -0
- package/lib/esm/emoji/types.d.ts +11 -0
- package/lib/esm/emoji/utils.d.ts +3 -0
- package/lib/esm/emoji-picker/data.json +1 -0
- package/lib/esm/emoji-picker/index.d.ts +22 -0
- package/lib/esm/emoji-picker/types.d.ts +26 -0
- package/lib/esm/field/index.d.ts +11 -0
- package/lib/esm/field/types.d.ts +35 -0
- package/lib/esm/file-drop/index.d.ts +13 -0
- package/lib/esm/file-drop/types.d.ts +50 -0
- package/lib/esm/file-drop/utils.d.ts +2 -0
- package/lib/esm/file-picker/index.d.ts +11 -0
- package/lib/esm/file-picker/types.d.ts +32 -0
- package/lib/esm/file-picker/utils.d.ts +1 -0
- package/lib/esm/file-status/index.d.ts +14 -0
- package/lib/esm/file-status/types.d.ts +18 -0
- package/lib/esm/file-status/utils.d.ts +2 -0
- package/lib/esm/flag/index.d.ts +11 -0
- package/lib/esm/flag/types.d.ts +11 -0
- package/lib/esm/flag/utils.d.ts +1 -0
- package/lib/esm/grid/index.d.ts +11 -0
- package/lib/esm/grid/types.d.ts +3 -0
- package/lib/esm/grid-item/index.d.ts +11 -0
- package/lib/esm/grid-item/types.d.ts +17 -0
- package/lib/esm/help-tooltip/index.d.ts +13 -0
- package/lib/esm/help-tooltip/types.d.ts +3 -0
- package/lib/esm/horizontal-stepper/index.d.ts +11 -0
- package/lib/esm/horizontal-stepper/types.d.ts +13 -0
- package/lib/esm/horizontal-stepper-item/index.d.ts +14 -0
- package/lib/esm/horizontal-stepper-item/types.d.ts +24 -0
- package/lib/esm/horizontal-stepper-item/utils.d.ts +2 -0
- package/lib/esm/icon/index.d.ts +11 -0
- package/lib/esm/icon/types.d.ts +11 -0
- package/lib/esm/icon-button/index.d.ts +12 -0
- package/lib/esm/icon-button/types.d.ts +44 -0
- package/lib/esm/icon-button/utils.d.ts +2 -0
- package/lib/esm/imports.d.js +0 -0
- package/lib/esm/imports.d.ts +9 -0
- package/lib/esm/inline-alert/index.d.ts +15 -0
- package/lib/esm/inline-alert/types.d.ts +15 -0
- package/lib/esm/inline-alert/utils.d.ts +2 -0
- package/lib/esm/input/index.d.ts +11 -0
- package/lib/esm/input/types.d.ts +86 -0
- package/lib/esm/input/utils.d.ts +26 -0
- package/lib/esm/link/index.d.ts +12 -0
- package/lib/esm/link/types.d.ts +59 -0
- package/lib/esm/list/index.d.ts +11 -0
- package/lib/esm/list/types.d.ts +3 -0
- package/lib/esm/list-item/index.d.ts +11 -0
- package/lib/esm/list-item/types.d.ts +3 -0
- package/lib/esm/pagination/index.d.ts +12 -0
- package/lib/esm/pagination/types.d.ts +16 -0
- package/lib/esm/pop/index.d.ts +11 -0
- package/lib/esm/pop/types.d.ts +35 -0
- package/lib/esm/pop/utils.d.ts +4 -0
- package/lib/esm/popover/index.d.ts +12 -0
- package/lib/esm/popover/types.d.ts +38 -0
- package/lib/esm/popover/utils.d.ts +4 -0
- package/lib/esm/progress/index.d.ts +12 -0
- package/lib/esm/progress/types.d.ts +12 -0
- package/lib/esm/progress-stepper/index.d.ts +11 -0
- package/lib/esm/progress-stepper/types.d.ts +22 -0
- package/lib/esm/progress-stepper-item/index.d.ts +12 -0
- package/lib/esm/progress-stepper-item/types.d.ts +23 -0
- package/lib/esm/progress-stepper-item/utils.d.ts +11 -0
- package/lib/esm/radio/index.d.ts +11 -0
- package/lib/esm/radio/types.d.ts +14 -0
- package/lib/esm/radio-option/index.d.ts +11 -0
- package/lib/esm/radio-option/types.d.ts +18 -0
- package/lib/esm/rich-text/index.d.ts +14 -0
- package/lib/esm/rich-text/types.d.ts +12 -0
- package/lib/esm/rich-text/utils.d.ts +7 -0
- package/lib/esm/rich-textarea/index.d.ts +11 -0
- package/lib/esm/rich-textarea/types.d.ts +48 -0
- package/lib/esm/rich-textarea/utils.d.ts +39 -0
- package/lib/esm/segment/index.d.ts +12 -0
- package/lib/esm/segment/types.d.ts +16 -0
- package/lib/esm/segment/utils.d.ts +3 -0
- package/lib/esm/segment-collapse/index.d.ts +13 -0
- package/lib/esm/segment-collapse/types.d.ts +11 -0
- package/lib/esm/segmented-control/index.d.ts +11 -0
- package/lib/esm/segmented-control/types.d.ts +11 -0
- package/lib/esm/segmented-control-option/index.d.ts +11 -0
- package/lib/esm/segmented-control-option/types.d.ts +19 -0
- package/lib/esm/segmented-icon-control/index.d.ts +11 -0
- package/lib/esm/segmented-icon-control/types.d.ts +14 -0
- package/lib/esm/segmented-icon-control-option/index.d.ts +11 -0
- package/lib/esm/segmented-icon-control-option/types.d.ts +16 -0
- package/lib/esm/select-button/index.d.ts +13 -0
- package/lib/esm/select-button/types.d.ts +50 -0
- package/lib/esm/select-menu/index.d.ts +15 -0
- package/lib/esm/select-menu/types.d.ts +41 -0
- package/lib/esm/select-menu-option/index.d.ts +28 -0
- package/lib/esm/select-menu-option/types.d.ts +26 -0
- package/lib/esm/skeleton/index.d.ts +11 -0
- package/lib/esm/skeleton/types.d.ts +9 -0
- package/lib/esm/skeleton-item/index.d.ts +11 -0
- package/lib/esm/skeleton-item/types.d.ts +13 -0
- package/lib/esm/spinner/index.d.ts +11 -0
- package/lib/esm/spinner/types.d.ts +12 -0
- package/lib/esm/standalone.d.ts +85 -0
- package/lib/esm/stop-events/index.d.ts +1 -0
- package/lib/esm/table/index.d.ts +11 -0
- package/lib/esm/table/types.d.ts +3 -0
- package/lib/esm/table-body/index.d.ts +11 -0
- package/lib/esm/table-body/types.d.ts +3 -0
- package/lib/esm/table-cell/index.d.ts +11 -0
- package/lib/esm/table-cell/types.d.ts +9 -0
- package/lib/esm/table-cell/utils.d.ts +2 -0
- package/lib/esm/table-head/index.d.ts +11 -0
- package/lib/esm/table-head/types.d.ts +3 -0
- package/lib/esm/table-head-cell/index.d.ts +12 -0
- package/lib/esm/table-head-cell/types.d.ts +15 -0
- package/lib/esm/table-row/index.d.ts +11 -0
- package/lib/esm/table-row/types.d.ts +11 -0
- package/lib/esm/tabs/index.d.ts +11 -0
- package/lib/esm/tabs/types.d.ts +18 -0
- package/lib/esm/tabs-icon-option/index.d.ts +11 -0
- package/lib/esm/tabs-icon-option/types.d.ts +19 -0
- package/lib/esm/tabs-option/index.d.ts +12 -0
- package/lib/esm/tabs-option/types.d.ts +25 -0
- package/lib/esm/tag/index.d.ts +12 -0
- package/lib/esm/tag/types.d.ts +23 -0
- package/lib/esm/tag/utils.d.ts +2 -0
- package/lib/esm/text/index.d.ts +11 -0
- package/lib/esm/text/types.d.ts +30 -0
- package/lib/esm/text/utils.d.ts +2 -0
- package/lib/esm/textarea/index.d.ts +11 -0
- package/lib/esm/textarea/types.d.ts +60 -0
- package/lib/esm/tile-control/index.d.ts +11 -0
- package/lib/esm/tile-control/types.d.ts +37 -0
- package/lib/esm/tile-control-option/index.d.ts +11 -0
- package/lib/esm/tile-control-option/types.d.ts +37 -0
- package/lib/esm/time-picker/index.d.ts +15 -0
- package/lib/esm/time-picker/types.d.ts +34 -0
- package/lib/esm/time-picker/utils.d.ts +11 -0
- package/lib/esm/title/index.d.ts +11 -0
- package/lib/esm/title/types.d.ts +31 -0
- package/lib/esm/title/utils.d.ts +3 -0
- package/lib/esm/toast/index.d.ts +13 -0
- package/lib/esm/toast/types.d.ts +28 -0
- package/lib/esm/toast/utils.d.ts +2 -0
- package/lib/esm/toast-manager/index.d.ts +13 -0
- package/lib/esm/toast-manager/types.d.ts +13 -0
- package/lib/esm/toast-manager/utils.d.ts +2 -0
- package/lib/esm/toggle/index.d.ts +11 -0
- package/lib/esm/toggle/types.d.ts +23 -0
- package/lib/esm/tooltip/index.d.ts +13 -0
- package/lib/esm/tooltip/tooltip-state.d.ts +19 -0
- package/lib/esm/tooltip/types.d.ts +42 -0
- package/lib/esm/tooltip/utils.d.ts +6 -0
- package/lib/esm/types.d.ts +14 -0
- package/lib/esm/utils/context.d.ts +20 -0
- package/lib/esm/utils/countries.d.ts +6 -0
- package/lib/esm/utils/countries.json +1217 -0
- package/lib/esm/utils/csv.d.ts +5 -0
- package/lib/esm/utils/debounce.d.ts +8 -0
- package/lib/esm/utils/dom.d.ts +34 -0
- package/lib/esm/utils/element.d.ts +16 -0
- package/lib/esm/utils/element.js +48 -0
- package/lib/esm/utils/event-target.d.ts +4 -0
- package/lib/esm/utils/get-react-event-handler.d.ts +1 -0
- package/lib/esm/utils/index.d.ts +12 -0
- package/lib/esm/utils/markdown.d.ts +19 -0
- package/lib/esm/utils/rect.d.ts +4 -0
- package/lib/esm/utils/size.d.ts +5 -0
- package/lib/esm/utils/slot.d.ts +4 -0
- package/lib/esm/utils/throttle.d.ts +4 -0
- package/lib/esm/utils/uid.d.ts +1 -0
- package/lib/esm/vertical-stepper/index.d.ts +11 -0
- package/lib/esm/vertical-stepper/types.d.ts +13 -0
- package/lib/esm/vertical-stepper/types.js +1 -0
- package/lib/esm/vertical-stepper-item/index.d.ts +14 -0
- package/lib/esm/vertical-stepper-item/types.d.ts +24 -0
- package/lib/esm/vertical-stepper-item/utils.d.ts +2 -0
- package/lib/package.json +1 -0
- package/package.json +33 -11
- package/standalone.ts +0 -93
- package/utils/element.js +0 -48
- /package/{accordion → lib/cjs/accordion}/index.d.ts +0 -0
- /package/{accordion → lib/cjs/accordion}/types.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/index.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/types.d.ts +0 -0
- /package/{accordion-item → lib/cjs/accordion-item}/utils.d.ts +0 -0
- /package/{action-menu → lib/cjs/action-menu}/index.d.ts +0 -0
- /package/{action-menu → lib/cjs/action-menu}/types.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/index.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/types.d.ts +0 -0
- /package/{action-menu-option → lib/cjs/action-menu-option}/utils.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/index.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/types.d.ts +0 -0
- /package/{alert → lib/cjs/alert}/utils.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/index.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/types.d.ts +0 -0
- /package/{avatar → lib/cjs/avatar}/utils.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/index.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/types.d.ts +0 -0
- /package/{badge → lib/cjs/badge}/utils.d.ts +0 -0
- /package/{button → lib/cjs/button}/index.d.ts +0 -0
- /package/{button → lib/cjs/button}/types.d.ts +0 -0
- /package/{button → lib/cjs/button}/utils.d.ts +0 -0
- /package/{card → lib/cjs/card}/index.d.ts +0 -0
- /package/{card → lib/cjs/card}/types.d.ts +0 -0
- /package/{card-container → lib/cjs/card-container}/index.d.ts +0 -0
- /package/{card-container → lib/cjs/card-container}/types.d.ts +0 -0
- /package/{chat → lib/cjs/chat}/index.d.ts +0 -0
- /package/{chat → lib/cjs/chat}/types.d.ts +0 -0
- /package/{chat-block → lib/cjs/chat-block}/index.d.ts +0 -0
- /package/{chat-block → lib/cjs/chat-block}/types.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/index.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/types.d.ts +0 -0
- /package/{chat-bubble → lib/cjs/chat-bubble}/utils.d.ts +0 -0
- /package/{checkbox → lib/cjs/checkbox}/index.d.ts +0 -0
- /package/{checkbox → lib/cjs/checkbox}/types.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/index.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/types.d.ts +0 -0
- /package/{chip → lib/cjs/chip}/utils.d.ts +0 -0
- /package/{code-tag → lib/cjs/code-tag}/index.d.ts +0 -0
- /package/{code-tag → lib/cjs/code-tag}/types.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/index.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/types.d.ts +0 -0
- /package/{color-menu → lib/cjs/color-menu}/utils.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/index.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/types.d.ts +0 -0
- /package/{color-menu-option → lib/cjs/color-menu-option}/utils.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/index.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/types.d.ts +0 -0
- /package/{color-swatch → lib/cjs/color-swatch}/utils.d.ts +0 -0
- /package/{colors.json → lib/cjs/colors.json} +0 -0
- /package/{date-picker → lib/cjs/date-picker}/index.d.ts +0 -0
- /package/{date-picker → lib/cjs/date-picker}/types.d.ts +0 -0
- /package/{date-picker → lib/cjs/date-picker}/utils.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/index.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/types.d.ts +0 -0
- /package/{dialog → lib/cjs/dialog}/utils.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/index.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/types.d.ts +0 -0
- /package/{emoji → lib/cjs/emoji}/utils.d.ts +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/data.json +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/index.d.ts +0 -0
- /package/{emoji-picker → lib/cjs/emoji-picker}/types.d.ts +0 -0
- /package/{field → lib/cjs/field}/index.d.ts +0 -0
- /package/{field → lib/cjs/field}/types.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/index.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/types.d.ts +0 -0
- /package/{file-drop → lib/cjs/file-drop}/utils.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/index.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/types.d.ts +0 -0
- /package/{file-picker → lib/cjs/file-picker}/utils.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/index.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/types.d.ts +0 -0
- /package/{file-status → lib/cjs/file-status}/utils.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/index.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/types.d.ts +0 -0
- /package/{flag → lib/cjs/flag}/utils.d.ts +0 -0
- /package/{grid → lib/cjs/grid}/index.d.ts +0 -0
- /package/{grid → lib/cjs/grid}/types.d.ts +0 -0
- /package/{grid-item → lib/cjs/grid-item}/index.d.ts +0 -0
- /package/{grid-item → lib/cjs/grid-item}/types.d.ts +0 -0
- /package/{help-tooltip → lib/cjs/help-tooltip}/index.d.ts +0 -0
- /package/{help-tooltip → lib/cjs/help-tooltip}/types.d.ts +0 -0
- /package/{horizontal-stepper → lib/cjs/horizontal-stepper}/index.d.ts +0 -0
- /package/{horizontal-stepper → lib/cjs/horizontal-stepper}/types.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/index.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/types.d.ts +0 -0
- /package/{horizontal-stepper-item → lib/cjs/horizontal-stepper-item}/utils.d.ts +0 -0
- /package/{icon → lib/cjs/icon}/index.d.ts +0 -0
- /package/{icon → lib/cjs/icon}/types.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/index.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/types.d.ts +0 -0
- /package/{icon-button → lib/cjs/icon-button}/utils.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/index.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/types.d.ts +0 -0
- /package/{inline-alert → lib/cjs/inline-alert}/utils.d.ts +0 -0
- /package/{input → lib/cjs/input}/index.d.ts +0 -0
- /package/{input → lib/cjs/input}/types.d.ts +0 -0
- /package/{input → lib/cjs/input}/utils.d.ts +0 -0
- /package/{link → lib/cjs/link}/index.d.ts +0 -0
- /package/{link → lib/cjs/link}/types.d.ts +0 -0
- /package/{list → lib/cjs/list}/index.d.ts +0 -0
- /package/{list → lib/cjs/list}/types.d.ts +0 -0
- /package/{list-item → lib/cjs/list-item}/index.d.ts +0 -0
- /package/{list-item → lib/cjs/list-item}/types.d.ts +0 -0
- /package/{pagination → lib/cjs/pagination}/index.d.ts +0 -0
- /package/{pagination → lib/cjs/pagination}/types.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/index.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/types.d.ts +0 -0
- /package/{pop → lib/cjs/pop}/utils.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/index.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/types.d.ts +0 -0
- /package/{popover → lib/cjs/popover}/utils.d.ts +0 -0
- /package/{progress → lib/cjs/progress}/index.d.ts +0 -0
- /package/{progress → lib/cjs/progress}/types.d.ts +0 -0
- /package/{progress-stepper → lib/cjs/progress-stepper}/index.d.ts +0 -0
- /package/{progress-stepper → lib/cjs/progress-stepper}/types.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/index.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/types.d.ts +0 -0
- /package/{progress-stepper-item → lib/cjs/progress-stepper-item}/utils.d.ts +0 -0
- /package/{radio → lib/cjs/radio}/index.d.ts +0 -0
- /package/{radio → lib/cjs/radio}/types.d.ts +0 -0
- /package/{radio-option → lib/cjs/radio-option}/index.d.ts +0 -0
- /package/{radio-option → lib/cjs/radio-option}/types.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/index.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/types.d.ts +0 -0
- /package/{rich-text → lib/cjs/rich-text}/utils.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/index.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/types.d.ts +0 -0
- /package/{rich-textarea → lib/cjs/rich-textarea}/utils.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/index.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/types.d.ts +0 -0
- /package/{segment → lib/cjs/segment}/utils.d.ts +0 -0
- /package/{segment-collapse → lib/cjs/segment-collapse}/index.d.ts +0 -0
- /package/{segment-collapse → lib/cjs/segment-collapse}/types.d.ts +0 -0
- /package/{segmented-control → lib/cjs/segmented-control}/index.d.ts +0 -0
- /package/{segmented-control → lib/cjs/segmented-control}/types.d.ts +0 -0
- /package/{segmented-control-option → lib/cjs/segmented-control-option}/index.d.ts +0 -0
- /package/{segmented-control-option → lib/cjs/segmented-control-option}/types.d.ts +0 -0
- /package/{segmented-icon-control → lib/cjs/segmented-icon-control}/index.d.ts +0 -0
- /package/{segmented-icon-control → lib/cjs/segmented-icon-control}/types.d.ts +0 -0
- /package/{segmented-icon-control-option → lib/cjs/segmented-icon-control-option}/index.d.ts +0 -0
- /package/{segmented-icon-control-option → lib/cjs/segmented-icon-control-option}/types.d.ts +0 -0
- /package/{select-button → lib/cjs/select-button}/index.d.ts +0 -0
- /package/{select-button → lib/cjs/select-button}/types.d.ts +0 -0
- /package/{select-menu → lib/cjs/select-menu}/index.d.ts +0 -0
- /package/{select-menu → lib/cjs/select-menu}/types.d.ts +0 -0
- /package/{select-menu-option → lib/cjs/select-menu-option}/index.d.ts +0 -0
- /package/{select-menu-option → lib/cjs/select-menu-option}/types.d.ts +0 -0
- /package/{skeleton → lib/cjs/skeleton}/index.d.ts +0 -0
- /package/{skeleton → lib/cjs/skeleton}/types.d.ts +0 -0
- /package/{skeleton-item → lib/cjs/skeleton-item}/index.d.ts +0 -0
- /package/{skeleton-item → lib/cjs/skeleton-item}/types.d.ts +0 -0
- /package/{spinner → lib/cjs/spinner}/index.d.ts +0 -0
- /package/{spinner → lib/cjs/spinner}/types.d.ts +0 -0
- /package/{standalone.d.ts → lib/cjs/standalone.d.ts} +0 -0
- /package/{stop-events → lib/cjs/stop-events}/index.d.ts +0 -0
- /package/{table → lib/cjs/table}/index.d.ts +0 -0
- /package/{table → lib/cjs/table}/types.d.ts +0 -0
- /package/{table-body → lib/cjs/table-body}/index.d.ts +0 -0
- /package/{table-body → lib/cjs/table-body}/types.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/index.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/types.d.ts +0 -0
- /package/{table-cell → lib/cjs/table-cell}/utils.d.ts +0 -0
- /package/{table-head → lib/cjs/table-head}/index.d.ts +0 -0
- /package/{table-head → lib/cjs/table-head}/types.d.ts +0 -0
- /package/{table-head-cell → lib/cjs/table-head-cell}/index.d.ts +0 -0
- /package/{table-head-cell → lib/cjs/table-head-cell}/types.d.ts +0 -0
- /package/{table-row → lib/cjs/table-row}/index.d.ts +0 -0
- /package/{table-row → lib/cjs/table-row}/types.d.ts +0 -0
- /package/{tabs → lib/cjs/tabs}/index.d.ts +0 -0
- /package/{tabs → lib/cjs/tabs}/types.d.ts +0 -0
- /package/{tabs-icon-option → lib/cjs/tabs-icon-option}/index.d.ts +0 -0
- /package/{tabs-icon-option → lib/cjs/tabs-icon-option}/types.d.ts +0 -0
- /package/{tabs-option → lib/cjs/tabs-option}/index.d.ts +0 -0
- /package/{tabs-option → lib/cjs/tabs-option}/types.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/index.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/types.d.ts +0 -0
- /package/{tag → lib/cjs/tag}/utils.d.ts +0 -0
- /package/{text → lib/cjs/text}/index.d.ts +0 -0
- /package/{text → lib/cjs/text}/types.d.ts +0 -0
- /package/{text → lib/cjs/text}/utils.d.ts +0 -0
- /package/{textarea → lib/cjs/textarea}/index.d.ts +0 -0
- /package/{textarea → lib/cjs/textarea}/types.d.ts +0 -0
- /package/{tile-control → lib/cjs/tile-control}/index.d.ts +0 -0
- /package/{tile-control → lib/cjs/tile-control}/types.d.ts +0 -0
- /package/{tile-control-option → lib/cjs/tile-control-option}/index.d.ts +0 -0
- /package/{tile-control-option → lib/cjs/tile-control-option}/types.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/index.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/types.d.ts +0 -0
- /package/{time-picker → lib/cjs/time-picker}/utils.d.ts +0 -0
- /package/{title → lib/cjs/title}/index.d.ts +0 -0
- /package/{title → lib/cjs/title}/types.d.ts +0 -0
- /package/{title → lib/cjs/title}/utils.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/index.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/types.d.ts +0 -0
- /package/{toast → lib/cjs/toast}/utils.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/index.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/types.d.ts +0 -0
- /package/{toast-manager → lib/cjs/toast-manager}/utils.d.ts +0 -0
- /package/{toggle → lib/cjs/toggle}/index.d.ts +0 -0
- /package/{toggle → lib/cjs/toggle}/types.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/index.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/tooltip-state.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/types.d.ts +0 -0
- /package/{tooltip → lib/cjs/tooltip}/utils.d.ts +0 -0
- /package/{types.d.ts → lib/cjs/types.d.ts} +0 -0
- /package/{utils → lib/cjs/utils}/context.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/countries.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/countries.json +0 -0
- /package/{utils → lib/cjs/utils}/csv.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/debounce.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/dom.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/element.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/event-target.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/get-react-event-handler.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/index.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/markdown.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/rect.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/size.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/slot.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/throttle.d.ts +0 -0
- /package/{utils → lib/cjs/utils}/uid.d.ts +0 -0
- /package/{vertical-stepper → lib/cjs/vertical-stepper}/index.d.ts +0 -0
- /package/{vertical-stepper → lib/cjs/vertical-stepper}/types.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/index.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/types.d.ts +0 -0
- /package/{vertical-stepper-item → lib/cjs/vertical-stepper-item}/utils.d.ts +0 -0
- /package/{accordion → lib/esm/accordion}/index.js +0 -0
- /package/{accordion → lib/esm/accordion}/types.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/index.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/types.js +0 -0
- /package/{accordion-item → lib/esm/accordion-item}/utils.js +0 -0
- /package/{action-menu → lib/esm/action-menu}/index.js +0 -0
- /package/{action-menu → lib/esm/action-menu}/types.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/index.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/types.js +0 -0
- /package/{action-menu-option → lib/esm/action-menu-option}/utils.js +0 -0
- /package/{alert → lib/esm/alert}/index.js +0 -0
- /package/{alert → lib/esm/alert}/types.js +0 -0
- /package/{alert → lib/esm/alert}/utils.js +0 -0
- /package/{avatar → lib/esm/avatar}/index.js +0 -0
- /package/{avatar → lib/esm/avatar}/types.js +0 -0
- /package/{avatar → lib/esm/avatar}/utils.js +0 -0
- /package/{badge → lib/esm/badge}/index.js +0 -0
- /package/{badge → lib/esm/badge}/types.js +0 -0
- /package/{badge → lib/esm/badge}/utils.js +0 -0
- /package/{button → lib/esm/button}/index.js +0 -0
- /package/{button → lib/esm/button}/types.js +0 -0
- /package/{button → lib/esm/button}/utils.js +0 -0
- /package/{card → lib/esm/card}/index.js +0 -0
- /package/{card → lib/esm/card}/types.js +0 -0
- /package/{card-container → lib/esm/card-container}/index.js +0 -0
- /package/{card-container → lib/esm/card-container}/types.js +0 -0
- /package/{chat → lib/esm/chat}/index.js +0 -0
- /package/{chat → lib/esm/chat}/types.js +0 -0
- /package/{chat-block → lib/esm/chat-block}/index.js +0 -0
- /package/{chat-block → lib/esm/chat-block}/types.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/index.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/types.js +0 -0
- /package/{chat-bubble → lib/esm/chat-bubble}/utils.js +0 -0
- /package/{checkbox → lib/esm/checkbox}/index.js +0 -0
- /package/{checkbox → lib/esm/checkbox}/types.js +0 -0
- /package/{chip → lib/esm/chip}/index.js +0 -0
- /package/{chip → lib/esm/chip}/types.js +0 -0
- /package/{chip → lib/esm/chip}/utils.js +0 -0
- /package/{code-tag → lib/esm/code-tag}/index.js +0 -0
- /package/{code-tag → lib/esm/code-tag}/types.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/index.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/types.js +0 -0
- /package/{color-menu → lib/esm/color-menu}/utils.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/index.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/types.js +0 -0
- /package/{color-menu-option → lib/esm/color-menu-option}/utils.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/index.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/types.js +0 -0
- /package/{color-swatch → lib/esm/color-swatch}/utils.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/index.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/types.js +0 -0
- /package/{date-picker → lib/esm/date-picker}/utils.js +0 -0
- /package/{dialog → lib/esm/dialog}/index.js +0 -0
- /package/{dialog → lib/esm/dialog}/types.js +0 -0
- /package/{dialog → lib/esm/dialog}/utils.js +0 -0
- /package/{emoji → lib/esm/emoji}/index.js +0 -0
- /package/{emoji → lib/esm/emoji}/types.js +0 -0
- /package/{emoji → lib/esm/emoji}/utils.js +0 -0
- /package/{emoji-picker → lib/esm/emoji-picker}/index.js +0 -0
- /package/{emoji-picker → lib/esm/emoji-picker}/types.js +0 -0
- /package/{field → lib/esm/field}/index.js +0 -0
- /package/{field → lib/esm/field}/types.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/index.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/types.js +0 -0
- /package/{file-drop → lib/esm/file-drop}/utils.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/index.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/types.js +0 -0
- /package/{file-picker → lib/esm/file-picker}/utils.js +0 -0
- /package/{file-status → lib/esm/file-status}/index.js +0 -0
- /package/{file-status → lib/esm/file-status}/types.js +0 -0
- /package/{file-status → lib/esm/file-status}/utils.js +0 -0
- /package/{flag → lib/esm/flag}/index.js +0 -0
- /package/{flag → lib/esm/flag}/types.js +0 -0
- /package/{flag → lib/esm/flag}/utils.js +0 -0
- /package/{grid → lib/esm/grid}/index.js +0 -0
- /package/{grid → lib/esm/grid}/types.js +0 -0
- /package/{grid-item → lib/esm/grid-item}/index.js +0 -0
- /package/{grid-item → lib/esm/grid-item}/types.js +0 -0
- /package/{help-tooltip → lib/esm/help-tooltip}/index.js +0 -0
- /package/{help-tooltip → lib/esm/help-tooltip}/types.js +0 -0
- /package/{horizontal-stepper → lib/esm/horizontal-stepper}/index.js +0 -0
- /package/{horizontal-stepper → lib/esm/horizontal-stepper}/types.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/index.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/types.js +0 -0
- /package/{horizontal-stepper-item → lib/esm/horizontal-stepper-item}/utils.js +0 -0
- /package/{icon → lib/esm/icon}/index.js +0 -0
- /package/{icon → lib/esm/icon}/types.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/index.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/types.js +0 -0
- /package/{icon-button → lib/esm/icon-button}/utils.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/index.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/types.js +0 -0
- /package/{inline-alert → lib/esm/inline-alert}/utils.js +0 -0
- /package/{input → lib/esm/input}/index.js +0 -0
- /package/{input → lib/esm/input}/types.js +0 -0
- /package/{input → lib/esm/input}/utils.js +0 -0
- /package/{link → lib/esm/link}/index.js +0 -0
- /package/{link → lib/esm/link}/types.js +0 -0
- /package/{list → lib/esm/list}/index.js +0 -0
- /package/{list → lib/esm/list}/types.js +0 -0
- /package/{list-item → lib/esm/list-item}/index.js +0 -0
- /package/{list-item → lib/esm/list-item}/types.js +0 -0
- /package/{pagination → lib/esm/pagination}/index.js +0 -0
- /package/{pagination → lib/esm/pagination}/types.js +0 -0
- /package/{pop → lib/esm/pop}/index.js +0 -0
- /package/{pop → lib/esm/pop}/types.js +0 -0
- /package/{pop → lib/esm/pop}/utils.js +0 -0
- /package/{popover → lib/esm/popover}/index.js +0 -0
- /package/{popover → lib/esm/popover}/types.js +0 -0
- /package/{popover → lib/esm/popover}/utils.js +0 -0
- /package/{progress → lib/esm/progress}/index.js +0 -0
- /package/{progress → lib/esm/progress}/types.js +0 -0
- /package/{progress-stepper → lib/esm/progress-stepper}/index.js +0 -0
- /package/{progress-stepper → lib/esm/progress-stepper}/types.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/index.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/types.js +0 -0
- /package/{progress-stepper-item → lib/esm/progress-stepper-item}/utils.js +0 -0
- /package/{radio → lib/esm/radio}/index.js +0 -0
- /package/{radio → lib/esm/radio}/types.js +0 -0
- /package/{radio-option → lib/esm/radio-option}/index.js +0 -0
- /package/{radio-option → lib/esm/radio-option}/types.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/index.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/types.js +0 -0
- /package/{rich-text → lib/esm/rich-text}/utils.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/index.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/types.js +0 -0
- /package/{rich-textarea → lib/esm/rich-textarea}/utils.js +0 -0
- /package/{segment → lib/esm/segment}/index.js +0 -0
- /package/{segment → lib/esm/segment}/types.js +0 -0
- /package/{segment → lib/esm/segment}/utils.js +0 -0
- /package/{segment-collapse → lib/esm/segment-collapse}/index.js +0 -0
- /package/{segment-collapse → lib/esm/segment-collapse}/types.js +0 -0
- /package/{segmented-control → lib/esm/segmented-control}/index.js +0 -0
- /package/{segmented-control → lib/esm/segmented-control}/types.js +0 -0
- /package/{segmented-control-option → lib/esm/segmented-control-option}/index.js +0 -0
- /package/{segmented-control-option → lib/esm/segmented-control-option}/types.js +0 -0
- /package/{segmented-icon-control → lib/esm/segmented-icon-control}/index.js +0 -0
- /package/{segmented-icon-control → lib/esm/segmented-icon-control}/types.js +0 -0
- /package/{segmented-icon-control-option → lib/esm/segmented-icon-control-option}/index.js +0 -0
- /package/{segmented-icon-control-option → lib/esm/segmented-icon-control-option}/types.js +0 -0
- /package/{select-button → lib/esm/select-button}/index.js +0 -0
- /package/{select-button → lib/esm/select-button}/types.js +0 -0
- /package/{select-menu → lib/esm/select-menu}/index.js +0 -0
- /package/{select-menu → lib/esm/select-menu}/types.js +0 -0
- /package/{select-menu-option → lib/esm/select-menu-option}/index.js +0 -0
- /package/{select-menu-option → lib/esm/select-menu-option}/types.js +0 -0
- /package/{skeleton → lib/esm/skeleton}/index.js +0 -0
- /package/{skeleton → lib/esm/skeleton}/types.js +0 -0
- /package/{skeleton-item → lib/esm/skeleton-item}/index.js +0 -0
- /package/{skeleton-item → lib/esm/skeleton-item}/types.js +0 -0
- /package/{spinner → lib/esm/spinner}/index.js +0 -0
- /package/{spinner → lib/esm/spinner}/types.js +0 -0
- /package/{standalone.js → lib/esm/standalone.js} +0 -0
- /package/{stop-events → lib/esm/stop-events}/index.js +0 -0
- /package/{table → lib/esm/table}/index.js +0 -0
- /package/{table → lib/esm/table}/types.js +0 -0
- /package/{table-body → lib/esm/table-body}/index.js +0 -0
- /package/{table-body → lib/esm/table-body}/types.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/index.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/types.js +0 -0
- /package/{table-cell → lib/esm/table-cell}/utils.js +0 -0
- /package/{table-head → lib/esm/table-head}/index.js +0 -0
- /package/{table-head → lib/esm/table-head}/types.js +0 -0
- /package/{table-head-cell → lib/esm/table-head-cell}/index.js +0 -0
- /package/{table-head-cell → lib/esm/table-head-cell}/types.js +0 -0
- /package/{table-row → lib/esm/table-row}/index.js +0 -0
- /package/{table-row → lib/esm/table-row}/types.js +0 -0
- /package/{tabs → lib/esm/tabs}/index.js +0 -0
- /package/{tabs → lib/esm/tabs}/types.js +0 -0
- /package/{tabs-icon-option → lib/esm/tabs-icon-option}/index.js +0 -0
- /package/{tabs-icon-option → lib/esm/tabs-icon-option}/types.js +0 -0
- /package/{tabs-option → lib/esm/tabs-option}/index.js +0 -0
- /package/{tabs-option → lib/esm/tabs-option}/types.js +0 -0
- /package/{tag → lib/esm/tag}/index.js +0 -0
- /package/{tag → lib/esm/tag}/types.js +0 -0
- /package/{tag → lib/esm/tag}/utils.js +0 -0
- /package/{text → lib/esm/text}/index.js +0 -0
- /package/{text → lib/esm/text}/types.js +0 -0
- /package/{text → lib/esm/text}/utils.js +0 -0
- /package/{textarea → lib/esm/textarea}/index.js +0 -0
- /package/{textarea → lib/esm/textarea}/types.js +0 -0
- /package/{tile-control → lib/esm/tile-control}/index.js +0 -0
- /package/{tile-control → lib/esm/tile-control}/types.js +0 -0
- /package/{tile-control-option → lib/esm/tile-control-option}/index.js +0 -0
- /package/{tile-control-option → lib/esm/tile-control-option}/types.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/index.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/types.js +0 -0
- /package/{time-picker → lib/esm/time-picker}/utils.js +0 -0
- /package/{title → lib/esm/title}/index.js +0 -0
- /package/{title → lib/esm/title}/types.js +0 -0
- /package/{title → lib/esm/title}/utils.js +0 -0
- /package/{toast → lib/esm/toast}/index.js +0 -0
- /package/{toast → lib/esm/toast}/types.js +0 -0
- /package/{toast → lib/esm/toast}/utils.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/index.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/types.js +0 -0
- /package/{toast-manager → lib/esm/toast-manager}/utils.js +0 -0
- /package/{toggle → lib/esm/toggle}/index.js +0 -0
- /package/{toggle → lib/esm/toggle}/types.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/index.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/tooltip-state.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/types.js +0 -0
- /package/{tooltip → lib/esm/tooltip}/utils.js +0 -0
- /package/{vertical-stepper-item/types.js → lib/esm/types.d.js} +0 -0
- /package/{utils → lib/esm/utils}/context.js +0 -0
- /package/{utils → lib/esm/utils}/countries.js +0 -0
- /package/{utils → lib/esm/utils}/csv.js +0 -0
- /package/{utils → lib/esm/utils}/debounce.js +0 -0
- /package/{utils → lib/esm/utils}/dom.js +0 -0
- /package/{utils → lib/esm/utils}/event-target.js +0 -0
- /package/{utils → lib/esm/utils}/get-react-event-handler.js +0 -0
- /package/{utils → lib/esm/utils}/index.js +0 -0
- /package/{utils → lib/esm/utils}/markdown.js +0 -0
- /package/{utils → lib/esm/utils}/rect.js +0 -0
- /package/{utils → lib/esm/utils}/size.js +0 -0
- /package/{utils → lib/esm/utils}/slot.js +0 -0
- /package/{utils → lib/esm/utils}/throttle.js +0 -0
- /package/{utils → lib/esm/utils}/uid.js +0 -0
- /package/{vertical-stepper → lib/esm/vertical-stepper}/index.js +0 -0
- /package/{vertical-stepper-item → lib/esm/vertical-stepper-item}/index.js +0 -0
- /package/{vertical-stepper → lib/esm/vertical-stepper-item}/types.js +0 -0
- /package/{vertical-stepper-item → lib/esm/vertical-stepper-item}/utils.js +0 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.splitValueAndMask = exports.insertText = exports.insertFromPaste = exports.inputTypes = exports.getMergedValueSliced = exports.getMaskSymbols = exports.endMaskedComposition = exports.deleteContentForward = exports.deleteContentBackward = exports.beginMaskedComposition = void 0;
|
|
7
|
+
const inputTypes = exports.inputTypes = ['text', 'password', 'number'];
|
|
8
|
+
const MASK_SYMBOL_LETTER = 'A';
|
|
9
|
+
const MASK_SYMBOL_DIGIT = '0';
|
|
10
|
+
const EMPTY_CHAR = ' ';
|
|
11
|
+
const MASK_MODE_DIGIT = 0;
|
|
12
|
+
const MASK_MODE_LETTER = 1;
|
|
13
|
+
const MASK_MODE_EXACT = 2;
|
|
14
|
+
const MASK_PLACEHOLDER_DELIMITER = '@@';
|
|
15
|
+
const MASK_PLACEHOLDER = '_';
|
|
16
|
+
const testMaskedValue = (maskSymbol, inputChar) => {
|
|
17
|
+
switch (maskSymbol.mode) {
|
|
18
|
+
case MASK_MODE_DIGIT:
|
|
19
|
+
{
|
|
20
|
+
return /\d/.test(inputChar);
|
|
21
|
+
}
|
|
22
|
+
case MASK_MODE_LETTER:
|
|
23
|
+
{
|
|
24
|
+
return /\p{Letter}/u.test(inputChar);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
};
|
|
29
|
+
const isExactMode = maskSymbol => maskSymbol.mode === MASK_MODE_EXACT;
|
|
30
|
+
const isEmptyChar = char => char === EMPTY_CHAR;
|
|
31
|
+
const getMaskSymbols = maskValue => {
|
|
32
|
+
const res = [];
|
|
33
|
+
const [mask, placeholder] = maskValue.split(MASK_PLACEHOLDER_DELIMITER);
|
|
34
|
+
const maskSymbols = [...mask];
|
|
35
|
+
const placeholderChars = placeholder != null ? [...placeholder] : [];
|
|
36
|
+
for (let maskIndex = 0, placeholderIndex = 0; maskIndex < maskSymbols.length; maskIndex++, placeholderIndex++) {
|
|
37
|
+
if (maskSymbols[maskIndex] === '\\') {
|
|
38
|
+
maskIndex += 1;
|
|
39
|
+
res.push({
|
|
40
|
+
value: maskSymbols[maskIndex],
|
|
41
|
+
mode: MASK_MODE_EXACT,
|
|
42
|
+
placeholder: placeholderChars[placeholderIndex] ?? maskSymbols[maskIndex]
|
|
43
|
+
});
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (maskSymbols[maskIndex] === MASK_SYMBOL_LETTER || maskSymbols[maskIndex] === MASK_SYMBOL_DIGIT) {
|
|
47
|
+
res.push({
|
|
48
|
+
value: maskSymbols[maskIndex],
|
|
49
|
+
mode: maskSymbols[maskIndex] === MASK_SYMBOL_LETTER ? MASK_MODE_LETTER : MASK_MODE_DIGIT,
|
|
50
|
+
placeholder: placeholderChars[placeholderIndex] ?? MASK_PLACEHOLDER
|
|
51
|
+
});
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
res.push({
|
|
55
|
+
value: maskSymbols[maskIndex],
|
|
56
|
+
mode: MASK_MODE_EXACT,
|
|
57
|
+
placeholder: placeholderChars[placeholderIndex] ?? maskSymbols[maskIndex]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return res;
|
|
61
|
+
};
|
|
62
|
+
exports.getMaskSymbols = getMaskSymbols;
|
|
63
|
+
const clearCharsSelection = (chars, selectionStart, selectionEnd) => {
|
|
64
|
+
for (let i = selectionStart; i < selectionEnd && i < chars.length; i++) {
|
|
65
|
+
chars[i] = EMPTY_CHAR;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const getPlaceholder = (chars, maskSymbols) => {
|
|
69
|
+
const res = new Array(maskSymbols.length);
|
|
70
|
+
for (let i = 0; i < maskSymbols.length; i++) {
|
|
71
|
+
res[i] = i >= chars.length || isEmptyChar(chars[i]) || isExactMode(maskSymbols[i]) ? maskSymbols[i].placeholder : EMPTY_CHAR;
|
|
72
|
+
}
|
|
73
|
+
return res.join('');
|
|
74
|
+
};
|
|
75
|
+
const isMaskedInputComplete = (chars, maskSymbols) => {
|
|
76
|
+
if (chars.length > maskSymbols.length) {
|
|
77
|
+
throw new Error('chars.length > maskSymbols.length');
|
|
78
|
+
}
|
|
79
|
+
if (chars.length < maskSymbols.length) {
|
|
80
|
+
return false;
|
|
81
|
+
}
|
|
82
|
+
for (let i = 0; i < maskSymbols.length; i++) {
|
|
83
|
+
if (i >= chars.length || !isExactMode(maskSymbols[i]) && !testMaskedValue(maskSymbols[i], chars[i])) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return true;
|
|
88
|
+
};
|
|
89
|
+
const getCharsFromInputValue = (inputValue, maskSymbols) => {
|
|
90
|
+
const chars = new Array(maskSymbols.length);
|
|
91
|
+
let i = 0;
|
|
92
|
+
for (const c of inputValue) {
|
|
93
|
+
chars[i++] = c;
|
|
94
|
+
}
|
|
95
|
+
chars.fill(EMPTY_CHAR, i);
|
|
96
|
+
return chars;
|
|
97
|
+
};
|
|
98
|
+
const isCursorAtTheBeginning = (maskSymbols, selectoinStart) => {
|
|
99
|
+
if (selectoinStart >= maskSymbols.length) {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
for (let i = 0; i < selectoinStart; i++) {
|
|
103
|
+
if (!isExactMode(maskSymbols[i])) {
|
|
104
|
+
return false;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return true;
|
|
108
|
+
};
|
|
109
|
+
const getMergedValue = (chars, maskSymbols) => {
|
|
110
|
+
if (!isMaskedInputComplete(chars, maskSymbols)) {
|
|
111
|
+
return '';
|
|
112
|
+
}
|
|
113
|
+
const res = new Array(chars.length);
|
|
114
|
+
for (let i = 0; i < chars.length; i++) {
|
|
115
|
+
res[i] = isExactMode(maskSymbols[i]) ? maskSymbols[i].value : chars[i];
|
|
116
|
+
}
|
|
117
|
+
return res.join('');
|
|
118
|
+
};
|
|
119
|
+
const findLastNonEmptyCharIndex = chars => {
|
|
120
|
+
for (let i = chars.length - 1; i >= 0; i--) {
|
|
121
|
+
if (!isEmptyChar(chars[i])) {
|
|
122
|
+
return i;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return -1;
|
|
126
|
+
};
|
|
127
|
+
const compileResult = (chars, maskSymbols, cursorPos) => {
|
|
128
|
+
if (chars.length > maskSymbols.length) {
|
|
129
|
+
chars.length = maskSymbols.length;
|
|
130
|
+
}
|
|
131
|
+
let lastEmptyPos = findLastNonEmptyCharIndex(chars) + 1;
|
|
132
|
+
while (lastEmptyPos < maskSymbols.length && isExactMode(maskSymbols[lastEmptyPos])) {
|
|
133
|
+
++lastEmptyPos;
|
|
134
|
+
}
|
|
135
|
+
if (lastEmptyPos < chars.length) {
|
|
136
|
+
chars.length = lastEmptyPos;
|
|
137
|
+
}
|
|
138
|
+
return {
|
|
139
|
+
value: chars.join(''),
|
|
140
|
+
placeholder: getPlaceholder(chars, maskSymbols),
|
|
141
|
+
cursorPos: Math.min(cursorPos, chars.length),
|
|
142
|
+
mergedValue: getMergedValue(chars, maskSymbols)
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
const deleteContentBackward = (inputValue, maskSymbols, selectionStart, selectionEnd) => {
|
|
146
|
+
if (selectionEnd === 0) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
149
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
150
|
+
if (selectionStart !== selectionEnd) {
|
|
151
|
+
clearCharsSelection(chars, selectionStart, selectionEnd);
|
|
152
|
+
return compileResult(chars, maskSymbols, selectionStart);
|
|
153
|
+
}
|
|
154
|
+
let cusrsorPos = selectionStart;
|
|
155
|
+
while (cusrsorPos > 0 && isExactMode(maskSymbols[cusrsorPos - 1])) {
|
|
156
|
+
--cusrsorPos;
|
|
157
|
+
}
|
|
158
|
+
if (cusrsorPos > 0) {
|
|
159
|
+
clearCharsSelection(chars, cusrsorPos - 1, cusrsorPos);
|
|
160
|
+
do {
|
|
161
|
+
--cusrsorPos;
|
|
162
|
+
} while (cusrsorPos > 0 && isExactMode(maskSymbols[cusrsorPos - 1]));
|
|
163
|
+
}
|
|
164
|
+
return compileResult(chars, maskSymbols, cusrsorPos);
|
|
165
|
+
};
|
|
166
|
+
exports.deleteContentBackward = deleteContentBackward;
|
|
167
|
+
const deleteContentForward = (inputValue, maskSymbols, selectionStart, selectionEnd) => {
|
|
168
|
+
if (selectionStart >= maskSymbols.length) {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
172
|
+
if (selectionStart !== selectionEnd) {
|
|
173
|
+
clearCharsSelection(chars, selectionStart, selectionEnd);
|
|
174
|
+
return compileResult(chars, maskSymbols, selectionEnd);
|
|
175
|
+
}
|
|
176
|
+
let cursorPos = selectionStart;
|
|
177
|
+
while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos])) {
|
|
178
|
+
cursorPos++;
|
|
179
|
+
}
|
|
180
|
+
if (cursorPos < chars.length) {
|
|
181
|
+
clearCharsSelection(chars, cursorPos, cursorPos + 1);
|
|
182
|
+
}
|
|
183
|
+
return compileResult(chars, maskSymbols, cursorPos + 1);
|
|
184
|
+
};
|
|
185
|
+
exports.deleteContentForward = deleteContentForward;
|
|
186
|
+
const beginMaskedComposition = (inputValue, maskSymbols, selectionStart) => {
|
|
187
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
188
|
+
const placeholder = new Array(chars.length);
|
|
189
|
+
for (let i = 0; i < maskSymbols.length; i++) {
|
|
190
|
+
placeholder[i] = isEmptyChar(chars[i]) || isExactMode(maskSymbols[i]) ? maskSymbols[i].placeholder : EMPTY_CHAR;
|
|
191
|
+
}
|
|
192
|
+
placeholder[selectionStart] = EMPTY_CHAR;
|
|
193
|
+
chars.splice(selectionStart, 1);
|
|
194
|
+
return {
|
|
195
|
+
value: chars.join(''),
|
|
196
|
+
placeholder: placeholder.join('')
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
exports.beginMaskedComposition = beginMaskedComposition;
|
|
200
|
+
const endMaskedComposition = (inputValue, data, maskSymbols, selectionStart, wasValueInserted) => {
|
|
201
|
+
let cursorPos = selectionStart;
|
|
202
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
203
|
+
const dataChars = [...data];
|
|
204
|
+
if (!wasValueInserted) {
|
|
205
|
+
chars.splice(cursorPos, 0, ...dataChars);
|
|
206
|
+
chars.length = maskSymbols.length;
|
|
207
|
+
cursorPos += dataChars.length;
|
|
208
|
+
}
|
|
209
|
+
cursorPos -= dataChars.length;
|
|
210
|
+
clearCharsSelection(chars, cursorPos, cursorPos + dataChars.length);
|
|
211
|
+
while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos])) {
|
|
212
|
+
cursorPos++;
|
|
213
|
+
}
|
|
214
|
+
if (cursorPos >= maskSymbols.length) {
|
|
215
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
216
|
+
}
|
|
217
|
+
for (let dataPos = 0; dataPos < dataChars.length && cursorPos < maskSymbols.length; ++dataPos, ++cursorPos) {
|
|
218
|
+
const data = dataChars[dataPos];
|
|
219
|
+
if (isEmptyChar(chars[cursorPos]) && testMaskedValue(maskSymbols[cursorPos], data)) {
|
|
220
|
+
chars[cursorPos] = data;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos])) {
|
|
224
|
+
cursorPos++;
|
|
225
|
+
}
|
|
226
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
227
|
+
};
|
|
228
|
+
exports.endMaskedComposition = endMaskedComposition;
|
|
229
|
+
const insertText = (inputValue, data, maskSymbols, selectionStart, selectionEnd) => {
|
|
230
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
231
|
+
let cursorPos = selectionStart;
|
|
232
|
+
clearCharsSelection(chars, selectionStart, selectionEnd);
|
|
233
|
+
while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos])) {
|
|
234
|
+
cursorPos++;
|
|
235
|
+
}
|
|
236
|
+
if (cursorPos >= maskSymbols.length) {
|
|
237
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
238
|
+
}
|
|
239
|
+
if (testMaskedValue(maskSymbols[cursorPos], data)) {
|
|
240
|
+
if (cursorPos >= chars.length) {
|
|
241
|
+
chars.length = cursorPos + 1;
|
|
242
|
+
}
|
|
243
|
+
chars[cursorPos] = data;
|
|
244
|
+
do {
|
|
245
|
+
cursorPos++;
|
|
246
|
+
} while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos]));
|
|
247
|
+
}
|
|
248
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
249
|
+
};
|
|
250
|
+
exports.insertText = insertText;
|
|
251
|
+
const insertFromPaste = (inputValue, data, maskSymbols, selectionStart, selectionEnd) => {
|
|
252
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
253
|
+
let cursorPos = selectionStart;
|
|
254
|
+
clearCharsSelection(chars, selectionStart, selectionEnd);
|
|
255
|
+
if (isCursorAtTheBeginning(maskSymbols, cursorPos)) {
|
|
256
|
+
cursorPos = 0;
|
|
257
|
+
} else {
|
|
258
|
+
while (cursorPos < maskSymbols.length && isExactMode(maskSymbols[cursorPos])) {
|
|
259
|
+
cursorPos++;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
if (cursorPos >= maskSymbols.length) {
|
|
263
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
264
|
+
}
|
|
265
|
+
const dataChars = [...data];
|
|
266
|
+
for (let dataPos = 0; dataPos < dataChars.length && cursorPos < maskSymbols.length;) {
|
|
267
|
+
const data = dataChars[dataPos];
|
|
268
|
+
const maskSymbol = maskSymbols[cursorPos];
|
|
269
|
+
if (isExactMode(maskSymbol)) {
|
|
270
|
+
if (maskSymbol.value === data) {
|
|
271
|
+
++dataPos;
|
|
272
|
+
}
|
|
273
|
+
++cursorPos;
|
|
274
|
+
} else {
|
|
275
|
+
if (testMaskedValue(maskSymbol, data)) {
|
|
276
|
+
chars[cursorPos] = data;
|
|
277
|
+
++cursorPos;
|
|
278
|
+
}
|
|
279
|
+
++dataPos;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return compileResult(chars, maskSymbols, cursorPos);
|
|
283
|
+
};
|
|
284
|
+
exports.insertFromPaste = insertFromPaste;
|
|
285
|
+
const splitValueAndMask = (inputValue, maskSymbols) => {
|
|
286
|
+
const chars = getCharsFromInputValue('', maskSymbols);
|
|
287
|
+
const dataChars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
288
|
+
let cursorPos = 0;
|
|
289
|
+
for (let dataPos = 0; dataPos < dataChars.length && cursorPos < maskSymbols.length;) {
|
|
290
|
+
const data = dataChars[dataPos];
|
|
291
|
+
const maskSymbol = maskSymbols[cursorPos];
|
|
292
|
+
if (isExactMode(maskSymbol)) {
|
|
293
|
+
if (maskSymbol.value === data) {
|
|
294
|
+
++dataPos;
|
|
295
|
+
}
|
|
296
|
+
++cursorPos;
|
|
297
|
+
} else {
|
|
298
|
+
if (testMaskedValue(maskSymbol, data)) {
|
|
299
|
+
chars[cursorPos] = data;
|
|
300
|
+
++cursorPos;
|
|
301
|
+
}
|
|
302
|
+
++dataPos;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return compileResult(chars, maskSymbols, chars.length);
|
|
306
|
+
};
|
|
307
|
+
exports.splitValueAndMask = splitValueAndMask;
|
|
308
|
+
const getMergedValueSliced = (inputValue, maskSymbols, selectionStart, selectionEnd) => {
|
|
309
|
+
const chars = getCharsFromInputValue(inputValue, maskSymbols);
|
|
310
|
+
for (let i = selectionStart; i < selectionEnd && i < maskSymbols.length; i++) {
|
|
311
|
+
if (isExactMode(maskSymbols[i])) {
|
|
312
|
+
chars[i] = maskSymbols[i].value;
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return chars.slice(selectionStart, selectionEnd).join('');
|
|
316
|
+
};
|
|
317
|
+
exports.getMergedValueSliced = getMergedValueSliced;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../icon');
|
|
4
|
+
var _utils = require('../utils');
|
|
5
|
+
const templateHTML = '<style>:host{display:inline}a{font:var(--sinch-comp-link-default-font-initial);font-size:inherit;line-height:inherit;text-decoration:var(--sinch-comp-link-default-text-decoration-initial);color:var(--sinch-comp-link-color-default-text-initial);border-radius:.5em;white-space:nowrap;--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-initial)}a:hover{text-decoration:var(--sinch-comp-link-default-text-decoration-hover);color:var(--sinch-comp-link-color-default-text-hover);--sinch-global-color-icon:var(--sinch-comp-link-color-default-icon-hover)}a:focus-visible{outline:2px solid var(--sinch-comp-link-color-default-outline-focus);outline-offset:2px}:host([standalone]){display:block}:host([standalone]) a{display:block;font:var(--sinch-comp-link-standalone-font-initial);font-size:inherit;line-height:inherit;text-decoration:none;width:fit-content}#external-icon,#standalone-icon{display:none;height:1em}#icon-prefix{display:none;margin-left:-.25em}:host([external]:not([standalone])) #external-icon{display:inline-block;margin-left:.25em;vertical-align:-.2em;--sinch-global-size-icon:1em}:host([standalone][external]) #external-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([standalone]) #icon-prefix{display:inline}:host([standalone]:not([external])) #standalone-icon{display:inline-block;vertical-align:-.4em;--sinch-global-size-icon:1.5em}:host([disabled]) a{color:var(--sinch-comp-link-color-disabled-text-initial);pointer-events:none;cursor:initial;text-decoration:var(--sinch-comp-link-default-text-decoration-disabled);--sinch-global-color-icon:var(--sinch-comp-link-color-disabled-icon-initial)}#content{white-space:var(--sinch-global-text-white-space,normal)}</style><a referrerpolicy="no-referer" aria-hidden="true"><span id="content"></span><span id="icon-prefix"> </span><sinch-icon id="external-icon" name="open_in_new"></sinch-icon><sinch-icon id="standalone-icon" name="arrow_forward"></sinch-icon></a>';
|
|
6
|
+
const template = document.createElement('template');
|
|
7
|
+
template.innerHTML = templateHTML;
|
|
8
|
+
(0, _utils.defineCustomElement)('sinch-link', class extends _utils.NectaryElement {
|
|
9
|
+
#$anchor;
|
|
10
|
+
#$text;
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
const shadowRoot = this.attachShadow();
|
|
14
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
15
|
+
this.#$anchor = shadowRoot.querySelector('a');
|
|
16
|
+
this.#$text = shadowRoot.querySelector('#content');
|
|
17
|
+
}
|
|
18
|
+
connectedCallback() {
|
|
19
|
+
this.setAttribute('role', 'link');
|
|
20
|
+
this.#$anchor.addEventListener('click', this.#onAnchorClick);
|
|
21
|
+
this.#$anchor.addEventListener('focus', this.#onAnchorFocus);
|
|
22
|
+
this.#$anchor.addEventListener('blur', this.#onAnchorBlur);
|
|
23
|
+
this.addEventListener('-click', this.#onClickReactHandler);
|
|
24
|
+
this.addEventListener('-focus', this.#onFocusReactHandler);
|
|
25
|
+
this.addEventListener('-blur', this.#onBlurReactHandler);
|
|
26
|
+
}
|
|
27
|
+
disconnectedCallback() {
|
|
28
|
+
this.#$anchor.removeEventListener('click', this.#onAnchorClick);
|
|
29
|
+
this.#$anchor.removeEventListener('focus', this.#onAnchorFocus);
|
|
30
|
+
this.#$anchor.removeEventListener('blur', this.#onAnchorBlur);
|
|
31
|
+
this.removeEventListener('-click', this.#onClickReactHandler);
|
|
32
|
+
this.removeEventListener('-focus', this.#onFocusReactHandler);
|
|
33
|
+
this.removeEventListener('-blur', this.#onBlurReactHandler);
|
|
34
|
+
}
|
|
35
|
+
static get observedAttributes() {
|
|
36
|
+
return ['text', 'href', 'use-history', 'external', 'standalone', 'disabled'];
|
|
37
|
+
}
|
|
38
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
39
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
switch (name) {
|
|
43
|
+
case 'text':
|
|
44
|
+
{
|
|
45
|
+
this.#$text.textContent = newVal;
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case 'href':
|
|
49
|
+
{
|
|
50
|
+
(0, _utils.updateAttribute)(this.#$anchor, 'href', newVal);
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
case 'use-history':
|
|
54
|
+
{
|
|
55
|
+
const shouldUseHistory = (0, _utils.isAttrTrue)(newVal);
|
|
56
|
+
if (shouldUseHistory) {
|
|
57
|
+
(0, _utils.updateBooleanAttribute)(this, 'preventdefault', true);
|
|
58
|
+
}
|
|
59
|
+
(0, _utils.updateBooleanAttribute)(this, name, shouldUseHistory);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
case 'standalone':
|
|
63
|
+
case 'disabled':
|
|
64
|
+
{
|
|
65
|
+
(0, _utils.updateBooleanAttribute)(this, name, (0, _utils.isAttrTrue)(newVal));
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case 'external':
|
|
69
|
+
{
|
|
70
|
+
const isExternal = (0, _utils.isAttrTrue)(newVal);
|
|
71
|
+
(0, _utils.updateAttribute)(this.#$anchor, 'target', isExternal ? '_blank' : null);
|
|
72
|
+
(0, _utils.updateBooleanAttribute)(this, name, isExternal);
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
get text() {
|
|
78
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
79
|
+
}
|
|
80
|
+
set text(value) {
|
|
81
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
82
|
+
}
|
|
83
|
+
get href() {
|
|
84
|
+
return (0, _utils.getAttribute)(this, 'href', '');
|
|
85
|
+
}
|
|
86
|
+
set href(value) {
|
|
87
|
+
(0, _utils.updateAttribute)(this, 'href', value);
|
|
88
|
+
}
|
|
89
|
+
set 'use-history'(value) {
|
|
90
|
+
(0, _utils.updateBooleanAttribute)(this, 'use-history', value);
|
|
91
|
+
}
|
|
92
|
+
get 'use-history'() {
|
|
93
|
+
return (0, _utils.getBooleanAttribute)(this, 'use-history');
|
|
94
|
+
}
|
|
95
|
+
set disabled(isDisabled) {
|
|
96
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
97
|
+
}
|
|
98
|
+
get disabled() {
|
|
99
|
+
return (0, _utils.getBooleanAttribute)(this, 'disabled');
|
|
100
|
+
}
|
|
101
|
+
set external(isExternal) {
|
|
102
|
+
(0, _utils.updateBooleanAttribute)(this, 'external', isExternal);
|
|
103
|
+
}
|
|
104
|
+
get external() {
|
|
105
|
+
return (0, _utils.getBooleanAttribute)(this, 'external');
|
|
106
|
+
}
|
|
107
|
+
set standalone(isstandalone) {
|
|
108
|
+
(0, _utils.updateBooleanAttribute)(this, 'standalone', isstandalone);
|
|
109
|
+
}
|
|
110
|
+
get standalone() {
|
|
111
|
+
return (0, _utils.getBooleanAttribute)(this, 'standalone');
|
|
112
|
+
}
|
|
113
|
+
set preventDefault(isPrevented) {
|
|
114
|
+
(0, _utils.updateBooleanAttribute)(this, 'preventdefault', isPrevented);
|
|
115
|
+
}
|
|
116
|
+
get preventDefault() {
|
|
117
|
+
return (0, _utils.getBooleanAttribute)(this, 'preventdefault');
|
|
118
|
+
}
|
|
119
|
+
get focusable() {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
focus() {
|
|
123
|
+
this.#$anchor.focus();
|
|
124
|
+
}
|
|
125
|
+
blur() {
|
|
126
|
+
this.#$anchor.blur();
|
|
127
|
+
}
|
|
128
|
+
#onAnchorClick = e => {
|
|
129
|
+
if (this.preventDefault) {
|
|
130
|
+
e.preventDefault();
|
|
131
|
+
if (this['use-history']) {
|
|
132
|
+
history.pushState({}, '', this.href);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
this.dispatchEvent(new CustomEvent('-click'));
|
|
136
|
+
};
|
|
137
|
+
#onAnchorFocus = () => {
|
|
138
|
+
this.dispatchEvent(new CustomEvent('-focus'));
|
|
139
|
+
};
|
|
140
|
+
#onAnchorBlur = () => {
|
|
141
|
+
this.dispatchEvent(new CustomEvent('-blur'));
|
|
142
|
+
};
|
|
143
|
+
#onFocusReactHandler = () => {
|
|
144
|
+
(0, _utils.getReactEventHandler)(this, 'on-focus')?.();
|
|
145
|
+
};
|
|
146
|
+
#onBlurReactHandler = () => {
|
|
147
|
+
(0, _utils.getReactEventHandler)(this, 'on-blur')?.();
|
|
148
|
+
};
|
|
149
|
+
#onClickReactHandler = e => {
|
|
150
|
+
(0, _utils.getReactEventHandler)(this, 'on-click')?.(e);
|
|
151
|
+
};
|
|
152
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:block;height:100%}#wrapper{display:flex;flex-direction:column;box-sizing:border-box;width:100%;height:100%;overflow-y:auto}</style><div id="wrapper"><slot></slot></div>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-list', class extends _utils.NectaryElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const shadowRoot = this.attachShadow();
|
|
11
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
this.setAttribute('role', 'list');
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _utils = require('../utils');
|
|
4
|
+
const templateHTML = '<style>:host{display:block;outline:0}#wrapper{width:100%;height:100%;box-sizing:border-box;overflow:hidden;padding:8px 0;background-color:var(--sinch-comp-list-color-default-background-initial);border-bottom:1px solid var(--sinch-comp-list-color-default-border-initial)}:host(:last-child)>#wrapper{border-bottom:none}:host(:hover)>#wrapper{background-color:var(--sinch-comp-list-color-default-background-hover)}</style><div id="wrapper"><slot name="content"></slot></div>';
|
|
5
|
+
const template = document.createElement('template');
|
|
6
|
+
template.innerHTML = templateHTML;
|
|
7
|
+
(0, _utils.defineCustomElement)('sinch-list-item', class extends _utils.NectaryElement {
|
|
8
|
+
constructor() {
|
|
9
|
+
super();
|
|
10
|
+
const shadowRoot = this.attachShadow();
|
|
11
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
12
|
+
}
|
|
13
|
+
connectedCallback() {
|
|
14
|
+
this.setAttribute('role', 'listitem');
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../icon');
|
|
4
|
+
var _utils = require('../utils');
|
|
5
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0}#wrapper{display:flex;justify-content:center;gap:8px;width:100%;height:var(--sinch-local-size);--sinch-local-size:24px}button{all:initial;position:relative;display:flex;justify-content:center;align-items:center;min-width:var(--sinch-local-size);height:var(--sinch-local-size);cursor:pointer;border-radius:var(--sinch-comp-pagination-shape-radius);user-select:none;--sinch-global-color-icon:var(--sinch-comp-pagination-color-default-icon-default)}button:focus-visible::before{content:"";position:absolute;inset:-3px;border:2px solid var(--sinch-comp-pagination-color-default-outline-focus);border-radius:calc(var(--sinch-comp-pagination-shape-radius) + 3px);pointer-events:none}button:disabled{--sinch-global-color-icon:var(--sinch-comp-pagination-color-disabled-icon-initial);cursor:initial}button:enabled:hover{background-color:var(--sinch-comp-pagination-color-default-background-hover)}button>*{display:block;overflow:hidden;pointer-events:none}.page{font:var(--sinch-comp-pagination-font-default-page-number);color:var(--sinch-comp-pagination-color-default-text-initial);background-color:var(--sinch-comp-pagination-color-default-background-initial);padding:0 4px;box-sizing:border-box}.page.dots>span{display:none}.page.dots::after{content:"..."}.page.active{font:var(--sinch-comp-pagination-font-checked-page-number);background-color:var(--sinch-comp-pagination-color-checked-background-initial);pointer-events:none;cursor:initial}.page.active:hover{background-color:var(--sinch-comp-pagination-color-checked-background-hover)}.page.hidden{display:none}#left,#right{--sinch-icon-size:24px}</style><div id="wrapper"><button id="left"><sinch-icon id="icon-left" name="keyboard_arrow_left"></sinch-icon></button><button class="page"><span>1</span></button><button class="page active"><span>2</span></button><button class="page"><span>3</span></button><button class="page"><span>4</span></button><button class="page"><span>5</span></button><button class="page dots"><span>6</span></button><button class="page"><span>20</span></button><button id="right"><sinch-icon id="icon-right" name="keyboard_arrow_right"></sinch-icon></button></div>';
|
|
6
|
+
const NUM_BUTTONS = 7;
|
|
7
|
+
const MIDDLE_BTN_INDEX = Math.floor(NUM_BUTTONS / 2);
|
|
8
|
+
const FIRST_BTN_INDEX = 0;
|
|
9
|
+
const LAST_BTN_INDEX = NUM_BUTTONS - 1;
|
|
10
|
+
const DOTS_LEFT_INDEX = 1;
|
|
11
|
+
const DOTS_RIGHT_INDEX = LAST_BTN_INDEX - 1;
|
|
12
|
+
const template = document.createElement('template');
|
|
13
|
+
template.innerHTML = templateHTML;
|
|
14
|
+
(0, _utils.defineCustomElement)('sinch-pagination', class extends _utils.NectaryElement {
|
|
15
|
+
#$left;
|
|
16
|
+
#$right;
|
|
17
|
+
#$buttons;
|
|
18
|
+
#$wrapper;
|
|
19
|
+
constructor() {
|
|
20
|
+
super();
|
|
21
|
+
const shadowRoot = this.attachShadow();
|
|
22
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
23
|
+
this.#$left = shadowRoot.querySelector('#left');
|
|
24
|
+
this.#$right = shadowRoot.querySelector('#right');
|
|
25
|
+
this.#$buttons = shadowRoot.querySelectorAll('.page');
|
|
26
|
+
this.#$wrapper = shadowRoot.querySelector('#wrapper');
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
this.#onValueChange();
|
|
30
|
+
this.#$wrapper.addEventListener('click', this.#onButtonClick);
|
|
31
|
+
this.addEventListener('-change', this.#onChangeReactHandler);
|
|
32
|
+
}
|
|
33
|
+
disconnectedCallback() {
|
|
34
|
+
this.#$wrapper.removeEventListener('click', this.#onButtonClick);
|
|
35
|
+
this.removeEventListener('-change', this.#onChangeReactHandler);
|
|
36
|
+
}
|
|
37
|
+
static get observedAttributes() {
|
|
38
|
+
return ['max', 'value'];
|
|
39
|
+
}
|
|
40
|
+
attributeChangedCallback(name) {
|
|
41
|
+
switch (name) {
|
|
42
|
+
case 'value':
|
|
43
|
+
case 'max':
|
|
44
|
+
{
|
|
45
|
+
this.#onValueChange();
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
set value(val) {
|
|
51
|
+
(0, _utils.updateAttribute)(this, 'value', val);
|
|
52
|
+
}
|
|
53
|
+
get value() {
|
|
54
|
+
return (0, _utils.getIntegerAttribute)(this, 'value', 0);
|
|
55
|
+
}
|
|
56
|
+
set max(val) {
|
|
57
|
+
(0, _utils.updateAttribute)(this, 'max', val);
|
|
58
|
+
}
|
|
59
|
+
get max() {
|
|
60
|
+
return (0, _utils.getIntegerAttribute)(this, 'value', 0);
|
|
61
|
+
}
|
|
62
|
+
#onValueChange() {
|
|
63
|
+
const value = (0, _utils.getIntegerAttribute)(this, 'value', 0) - 1;
|
|
64
|
+
const max = Math.max(0, (0, _utils.getIntegerAttribute)(this, 'max', 0));
|
|
65
|
+
const valueOffset = Math.min(Math.max(0, value - MIDDLE_BTN_INDEX), Math.max(0, max - NUM_BUTTONS));
|
|
66
|
+
for (let i = 0; i < this.#$buttons.length; i++) {
|
|
67
|
+
const $b = this.#$buttons[i];
|
|
68
|
+
if (value < 3) {
|
|
69
|
+
(0, _utils.setClass)($b, 'active', value === i);
|
|
70
|
+
} else if (value >= max - MIDDLE_BTN_INDEX) {
|
|
71
|
+
(0, _utils.setClass)($b, 'active', i + valueOffset === value);
|
|
72
|
+
} else {
|
|
73
|
+
(0, _utils.setClass)($b, 'active', i === MIDDLE_BTN_INDEX);
|
|
74
|
+
}
|
|
75
|
+
if (max > NUM_BUTTONS) {
|
|
76
|
+
(0, _utils.setClass)($b, 'dots', i === DOTS_LEFT_INDEX && value > MIDDLE_BTN_INDEX || i === DOTS_RIGHT_INDEX && value <= max - DOTS_RIGHT_INDEX);
|
|
77
|
+
}
|
|
78
|
+
(0, _utils.setClass)($b, 'hidden', i >= max);
|
|
79
|
+
const btnText = $b.firstElementChild;
|
|
80
|
+
if (btnText != null) {
|
|
81
|
+
btnText.textContent = i === FIRST_BTN_INDEX ? '1' : i === LAST_BTN_INDEX ? String(max) : String(i + 1 + valueOffset);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const isValueBad = value < 0 || value >= max;
|
|
85
|
+
this.#$left.disabled = isValueBad || value === 0;
|
|
86
|
+
this.#$right.disabled = isValueBad || value === max - 1;
|
|
87
|
+
}
|
|
88
|
+
#onButtonClick = e => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
const value = Math.max((0, _utils.getIntegerAttribute)(this, 'value', 0) - 1);
|
|
91
|
+
const max = Math.max(0, (0, _utils.getIntegerAttribute)(this, 'max', 0));
|
|
92
|
+
if ((0, _utils.isTargetEqual)(e, this.#$left)) {
|
|
93
|
+
return this.#dispatchChangeEvent(Math.max(value - 1, 0));
|
|
94
|
+
}
|
|
95
|
+
if ((0, _utils.isTargetEqual)(e, this.#$right)) {
|
|
96
|
+
return this.#dispatchChangeEvent(Math.min(value + 1, max));
|
|
97
|
+
}
|
|
98
|
+
const btnIndex = (0, _utils.getTargetIndexInParent)(e, this.#$wrapper) - 1;
|
|
99
|
+
if (btnIndex >= FIRST_BTN_INDEX && btnIndex <= LAST_BTN_INDEX) {
|
|
100
|
+
if (btnIndex === FIRST_BTN_INDEX) {
|
|
101
|
+
return this.#dispatchChangeEvent(0);
|
|
102
|
+
}
|
|
103
|
+
if (btnIndex === LAST_BTN_INDEX) {
|
|
104
|
+
return this.#dispatchChangeEvent(max);
|
|
105
|
+
}
|
|
106
|
+
if (btnIndex === DOTS_LEFT_INDEX && max > NUM_BUTTONS && value > MIDDLE_BTN_INDEX) {
|
|
107
|
+
return this.#dispatchChangeEvent(Math.floor(value / 2));
|
|
108
|
+
}
|
|
109
|
+
if (btnIndex === DOTS_RIGHT_INDEX && max > NUM_BUTTONS && value <= max - DOTS_RIGHT_INDEX) {
|
|
110
|
+
return this.#dispatchChangeEvent(Math.floor((max - value) / 2 + value));
|
|
111
|
+
}
|
|
112
|
+
return this.#dispatchChangeEvent(btnIndex + Math.min(Math.max(0, value - MIDDLE_BTN_INDEX), Math.max(0, max - NUM_BUTTONS)));
|
|
113
|
+
}
|
|
114
|
+
};
|
|
115
|
+
#clamp(value) {
|
|
116
|
+
const max = (0, _utils.getIntegerAttribute)(this, 'max', 0);
|
|
117
|
+
return Math.max(0, Math.min(max - 1, value)) + 1;
|
|
118
|
+
}
|
|
119
|
+
#dispatchChangeEvent(value) {
|
|
120
|
+
const detail = this.#clamp(value);
|
|
121
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
122
|
+
detail
|
|
123
|
+
}));
|
|
124
|
+
}
|
|
125
|
+
#onChangeReactHandler = e => {
|
|
126
|
+
(0, _utils.getReactEventHandler)(this, 'on-change')?.(e);
|
|
127
|
+
};
|
|
128
|
+
get focusable() {
|
|
129
|
+
return true;
|
|
130
|
+
}
|
|
131
|
+
focus() {
|
|
132
|
+
this.#$left.focus();
|
|
133
|
+
}
|
|
134
|
+
blur() {
|
|
135
|
+
this.#$left.blur();
|
|
136
|
+
this.#$right.blur();
|
|
137
|
+
this.#$buttons.forEach($b => $b.blur());
|
|
138
|
+
}
|
|
139
|
+
get prevButtonRect() {
|
|
140
|
+
return (0, _utils.getRect)(this.#$left);
|
|
141
|
+
}
|
|
142
|
+
get nextButtonRect() {
|
|
143
|
+
return (0, _utils.getRect)(this.#$right);
|
|
144
|
+
}
|
|
145
|
+
nthButtonRect(index) {
|
|
146
|
+
const btn = this.#$buttons[index];
|
|
147
|
+
return btn == null ? null : (0, _utils.getRect)(btn);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|