@nectary/components 2.12.1 → 2.12.2
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,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../text');
|
|
4
|
+
require('../icon');
|
|
5
|
+
var _utils = require('../utils');
|
|
6
|
+
var _size = require('../utils/size');
|
|
7
|
+
const templateHTML = '<style>:host{display:inline-block;vertical-align:middle;outline:0;cursor:pointer}:host([disabled]){cursor:initial}#wrapper{position:relative;display:flex;flex-direction:row;align-items:center;gap:8px;box-sizing:border-box;width:100%;height:var(--sinch-local-size);padding:0 8px 0 12px;background-color:var(--sinch-comp-select-button-color-default-background-initial);border-radius:var(--sinch-local-shape-radius);--sinch-local-size:var(--sinch-comp-select-button-size-container-m);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-m);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-m);--sinch-global-color-icon:var(--sinch-comp-select-button-color-default-icon-initial)}:host([data-size="l"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-l);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-l);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-l)}:host([data-size="m"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-m);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-m);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-m)}:host([data-size="s"])>#wrapper{--sinch-local-size:var(--sinch-comp-select-button-size-container-s);--sinch-global-size-icon:var(--sinch-comp-select-button-size-icon-s);--sinch-local-shape-radius:var(--sinch-comp-select-button-shape-radius-size-s)}:host([data-size="l"]) #wrapper{padding:0 12px}:host([data-size="m"]) #wrapper{padding:0 8px 0 12px}:host([data-size="s"]) #wrapper{padding:0 4px 0 12px}:host([disabled]) #wrapper{--sinch-global-color-icon:var(--sinch-comp-select-button-color-disabled-icon-initial)}#text{flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-select-button-font-input);--sinch-global-color-text:var(--sinch-comp-select-button-color-default-text-initial)}#text:empty{display:none}#placeholder{display:none;flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-select-button-font-placeholder);--sinch-global-color-text:var(--sinch-comp-select-button-color-default-placeholder-initial)}#text:empty+#placeholder{display:block}#border{position:absolute;border:1px solid var(--sinch-comp-select-button-color-default-border-initial);border-radius:var(--sinch-local-shape-radius);inset:0;pointer-events:none}:host(:focus-visible) #border{border-color:var(--sinch-comp-select-button-color-default-border-focus);border-width:2px}:host([invalid]) #border{border-color:var(--sinch-comp-select-button-color-invalid-border-initial)}:host([disabled]) #border{border-color:var(--sinch-comp-select-button-color-disabled-border-initial)}:host([disabled]) #text{--sinch-global-color-text:var(--sinch-comp-select-button-color-disabled-text-initial)}:host([disabled]) #placeholder{--sinch-global-color-text:var(--sinch-comp-select-button-color-disabled-placeholder-initial)}#left{display:flex;flex-direction:row;align-self:stretch;align-items:center;gap:4px;margin-left:-4px}#left.empty{display:none}#dropdown-icon{margin-left:-4px}</style><div id="wrapper" inert><div id="border"></div><div id="left"><slot name="left"></slot></div><slot name="icon"></slot><sinch-text id="text" type="m" ellipsis></sinch-text><sinch-text id="placeholder" type="m" ellipsis></sinch-text><sinch-icon id="dropdown-icon" name="keyboard_arrow_down"></sinch-icon></div>';
|
|
8
|
+
const template = document.createElement('template');
|
|
9
|
+
template.innerHTML = templateHTML;
|
|
10
|
+
(0, _utils.defineCustomElement)('sinch-select-button', class extends _utils.NectaryElement {
|
|
11
|
+
#$text;
|
|
12
|
+
#$placeholder;
|
|
13
|
+
#$leftSlot;
|
|
14
|
+
#$leftWrapper;
|
|
15
|
+
#$wrapper;
|
|
16
|
+
#controller = null;
|
|
17
|
+
#sizeContext;
|
|
18
|
+
constructor() {
|
|
19
|
+
super();
|
|
20
|
+
const shadowRoot = this.attachShadow();
|
|
21
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
22
|
+
this.#$text = shadowRoot.querySelector('#text');
|
|
23
|
+
this.#$placeholder = shadowRoot.querySelector('#placeholder');
|
|
24
|
+
this.#$leftSlot = shadowRoot.querySelector('slot[name="left"]');
|
|
25
|
+
this.#$leftWrapper = shadowRoot.querySelector('#left');
|
|
26
|
+
this.#$wrapper = shadowRoot.querySelector('#wrapper');
|
|
27
|
+
this.#sizeContext = new _utils.Context(this.#$wrapper, 'size');
|
|
28
|
+
}
|
|
29
|
+
connectedCallback() {
|
|
30
|
+
super.connectedCallback();
|
|
31
|
+
this.#controller = new AbortController();
|
|
32
|
+
const {
|
|
33
|
+
signal
|
|
34
|
+
} = this.#controller;
|
|
35
|
+
this.role = 'button';
|
|
36
|
+
this.tabIndex = 0;
|
|
37
|
+
this.addEventListener('click', this.#onButtonClick, {
|
|
38
|
+
signal
|
|
39
|
+
});
|
|
40
|
+
this.addEventListener('focus', this.#onButtonFocus, {
|
|
41
|
+
signal
|
|
42
|
+
});
|
|
43
|
+
this.addEventListener('blur', this.#onButtonBlur, {
|
|
44
|
+
signal
|
|
45
|
+
});
|
|
46
|
+
this.addEventListener('keydown', this.#onButtonKeydown, {
|
|
47
|
+
signal
|
|
48
|
+
});
|
|
49
|
+
this.addEventListener('-click', this.#onClickReactHandler, {
|
|
50
|
+
signal
|
|
51
|
+
});
|
|
52
|
+
this.addEventListener('-focus', this.#onFocusReactHandler, {
|
|
53
|
+
signal
|
|
54
|
+
});
|
|
55
|
+
this.addEventListener('-blur', this.#onBlurReactHandler, {
|
|
56
|
+
signal
|
|
57
|
+
});
|
|
58
|
+
this.#$leftSlot.addEventListener('slotchange', this.#onLeftSlotChange, {
|
|
59
|
+
signal
|
|
60
|
+
});
|
|
61
|
+
this.#sizeContext.listen(this.#controller.signal);
|
|
62
|
+
(0, _utils.subscribeContext)(this, 'size', this.#onContextSize, signal);
|
|
63
|
+
this.#onLeftSlotChange();
|
|
64
|
+
this.#onSizeUpdate();
|
|
65
|
+
}
|
|
66
|
+
disconnectedCallback() {
|
|
67
|
+
super.disconnectedCallback();
|
|
68
|
+
this.#controller.abort();
|
|
69
|
+
this.#controller = null;
|
|
70
|
+
}
|
|
71
|
+
static get observedAttributes() {
|
|
72
|
+
return ['text', 'placeholder', 'invalid', 'disabled', 'size', 'data-size'];
|
|
73
|
+
}
|
|
74
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
75
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
switch (name) {
|
|
79
|
+
case 'text':
|
|
80
|
+
{
|
|
81
|
+
this.#$text.textContent = newVal;
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
84
|
+
case 'placeholder':
|
|
85
|
+
{
|
|
86
|
+
this.#$placeholder.textContent = newVal;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
case 'invalid':
|
|
90
|
+
{
|
|
91
|
+
const isInvalid = (0, _utils.isAttrTrue)(newVal);
|
|
92
|
+
this.ariaInvalid = isInvalid.toString();
|
|
93
|
+
(0, _utils.updateBooleanAttribute)(this, 'invalid', isInvalid);
|
|
94
|
+
break;
|
|
95
|
+
}
|
|
96
|
+
case 'disabled':
|
|
97
|
+
{
|
|
98
|
+
const isDisabled = (0, _utils.isAttrTrue)(newVal);
|
|
99
|
+
this.ariaDisabled = isDisabled.toString();
|
|
100
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
101
|
+
break;
|
|
102
|
+
}
|
|
103
|
+
case 'size':
|
|
104
|
+
{
|
|
105
|
+
(0, _utils.updateAttribute)(this, 'data-size', newVal);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case 'data-size':
|
|
109
|
+
{
|
|
110
|
+
this.#onSizeUpdate();
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
set text(value) {
|
|
116
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
117
|
+
}
|
|
118
|
+
get text() {
|
|
119
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
120
|
+
}
|
|
121
|
+
set placeholder(value) {
|
|
122
|
+
(0, _utils.updateAttribute)(this, 'placeholder', value);
|
|
123
|
+
}
|
|
124
|
+
get placeholder() {
|
|
125
|
+
return (0, _utils.getAttribute)(this, 'placeholder');
|
|
126
|
+
}
|
|
127
|
+
set invalid(isInvalid) {
|
|
128
|
+
(0, _utils.updateBooleanAttribute)(this, 'invalid', isInvalid);
|
|
129
|
+
}
|
|
130
|
+
get invalid() {
|
|
131
|
+
return (0, _utils.getBooleanAttribute)(this, 'invalid');
|
|
132
|
+
}
|
|
133
|
+
set disabled(isDisabled) {
|
|
134
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
135
|
+
}
|
|
136
|
+
get disabled() {
|
|
137
|
+
return (0, _utils.getBooleanAttribute)(this, 'disabled');
|
|
138
|
+
}
|
|
139
|
+
set size(size) {
|
|
140
|
+
(0, _utils.updateLiteralAttribute)(this, _size.sizeValues, 'size', size);
|
|
141
|
+
}
|
|
142
|
+
get size() {
|
|
143
|
+
return (0, _utils.getLiteralAttribute)(this, _size.sizeValues, 'size', _size.DEFAULT_SIZE);
|
|
144
|
+
}
|
|
145
|
+
get focusable() {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
#onContextSize = e => {
|
|
149
|
+
if (this.hasAttribute('size')) {
|
|
150
|
+
return;
|
|
151
|
+
}
|
|
152
|
+
switch (e.detail) {
|
|
153
|
+
case 'l':
|
|
154
|
+
{
|
|
155
|
+
this.setAttribute('data-size', 'm');
|
|
156
|
+
break;
|
|
157
|
+
}
|
|
158
|
+
default:
|
|
159
|
+
{
|
|
160
|
+
this.setAttribute('data-size', 's');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
};
|
|
164
|
+
#onSizeUpdate() {
|
|
165
|
+
if (!this.isDomConnected) {
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
const size = this.getAttribute('data-size') ?? _size.DEFAULT_SIZE;
|
|
169
|
+
this.#sizeContext.dispatch(size);
|
|
170
|
+
}
|
|
171
|
+
#onLeftSlotChange = () => {
|
|
172
|
+
(0, _utils.setClass)(this.#$leftWrapper, 'empty', this.#$leftSlot.assignedElements().length === 0);
|
|
173
|
+
};
|
|
174
|
+
#onButtonFocus = () => {
|
|
175
|
+
this.dispatchEvent(new CustomEvent('-focus'));
|
|
176
|
+
};
|
|
177
|
+
#onButtonBlur = () => {
|
|
178
|
+
this.dispatchEvent(new CustomEvent('-blur'));
|
|
179
|
+
};
|
|
180
|
+
#onButtonKeydown = e => {
|
|
181
|
+
switch (e.code) {
|
|
182
|
+
case 'Space':
|
|
183
|
+
case 'Enter':
|
|
184
|
+
{
|
|
185
|
+
e.preventDefault();
|
|
186
|
+
this.click();
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
};
|
|
190
|
+
#onButtonClick = () => {
|
|
191
|
+
if (!this.disabled) {
|
|
192
|
+
this.dispatchEvent(new CustomEvent('-click'));
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
#onClickReactHandler = e => {
|
|
196
|
+
(0, _utils.getReactEventHandler)(this, 'on-click')?.(e);
|
|
197
|
+
};
|
|
198
|
+
#onFocusReactHandler = () => {
|
|
199
|
+
(0, _utils.getReactEventHandler)(this, 'on-focus')?.();
|
|
200
|
+
};
|
|
201
|
+
#onBlurReactHandler = () => {
|
|
202
|
+
(0, _utils.getReactEventHandler)(this, 'on-blur')?.();
|
|
203
|
+
};
|
|
204
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require('../input');
|
|
4
|
+
require('../icon-button');
|
|
5
|
+
require('../icon');
|
|
6
|
+
require('../text');
|
|
7
|
+
var _utils = require('../utils');
|
|
8
|
+
const templateHTML = '<style>:host{display:block;outline:0}#listbox{overflow-y:auto}#search{display:none;margin:10px}#search.active{display:block}#search-clear:not(.active){display:none}#not-found{display:flex;align-items:center;justify-content:center;width:100%;height:30px;margin-bottom:10px;pointer-events:none;user-select:none;--sinch-comp-text-font:var(--sinch-comp-select-menu-font-not-found-text);--sinch-global-color-text:var(--sinch-comp-select-menu-color-default-not-found-text-initial)}#not-found:not(.active){display:none}::slotted(.hidden){display:none}</style><sinch-input id="search" size="s" placeholder="Search"><sinch-icon id="icon-search" slot="icon" name="search"></sinch-icon><sinch-icon-button id="search-clear" slot="right"><sinch-icon slot="icon" name="close"></sinch-icon></sinch-icon-button></sinch-input><div id="not-found"><sinch-text type="m">No results</sinch-text></div><div id="listbox" role="presentation"><slot></slot></div>';
|
|
9
|
+
const ITEM_HEIGHT = 40;
|
|
10
|
+
const NUM_ITEMS_SEARCH = 7;
|
|
11
|
+
const template = document.createElement('template');
|
|
12
|
+
template.innerHTML = templateHTML;
|
|
13
|
+
(0, _utils.defineCustomElement)('sinch-select-menu', class extends _utils.NectaryElement {
|
|
14
|
+
#$optionSlot;
|
|
15
|
+
#$listbox;
|
|
16
|
+
#$search;
|
|
17
|
+
#$searchClear;
|
|
18
|
+
#$notFound;
|
|
19
|
+
#controller = null;
|
|
20
|
+
#searchDebounce;
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
const shadowRoot = this.attachShadow();
|
|
24
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
25
|
+
this.#$optionSlot = shadowRoot.querySelector('slot');
|
|
26
|
+
this.#$listbox = shadowRoot.querySelector('#listbox');
|
|
27
|
+
this.#$search = shadowRoot.querySelector('#search');
|
|
28
|
+
this.#$searchClear = shadowRoot.querySelector('#search-clear');
|
|
29
|
+
this.#$notFound = shadowRoot.querySelector('#not-found');
|
|
30
|
+
this.#searchDebounce = (0, _utils.debounceTimeout)(200)(this.#updateSearch);
|
|
31
|
+
}
|
|
32
|
+
connectedCallback() {
|
|
33
|
+
this.#controller = new AbortController();
|
|
34
|
+
const options = {
|
|
35
|
+
signal: this.#controller.signal
|
|
36
|
+
};
|
|
37
|
+
this.role = 'listbox';
|
|
38
|
+
this.tabIndex = 0;
|
|
39
|
+
this.addEventListener('keydown', this.#onListboxKeyDown, options);
|
|
40
|
+
this.addEventListener('focus', this.#onFocus, options);
|
|
41
|
+
this.addEventListener('blur', this.#onListboxBlur, options);
|
|
42
|
+
this.#$listbox.addEventListener('click', this.#onListboxClick, options);
|
|
43
|
+
this.#$search.addEventListener('-change', this.#onSearchChange, options);
|
|
44
|
+
this.#$searchClear.addEventListener('-click', this.#onSearchClearClick, options);
|
|
45
|
+
this.#$optionSlot.addEventListener('slotchange', this.#onOptionSlotChange, options);
|
|
46
|
+
this.addEventListener('-search-change', this.#onSearchChangeReactHandler, options);
|
|
47
|
+
this.addEventListener('-change', this.#onChangeReactHandler, options);
|
|
48
|
+
(0, _utils.subscribeContext)(this, 'keydown', this.#onContextKeyDown, this.#controller.signal);
|
|
49
|
+
(0, _utils.subscribeContext)(this, 'visibility', this.#onContextVisibility, this.#controller.signal);
|
|
50
|
+
this.#onOptionSlotChange();
|
|
51
|
+
}
|
|
52
|
+
disconnectedCallback() {
|
|
53
|
+
this.#searchDebounce.cancel();
|
|
54
|
+
this.#controller.abort();
|
|
55
|
+
this.#controller = null;
|
|
56
|
+
}
|
|
57
|
+
static get observedAttributes() {
|
|
58
|
+
return ['value', 'rows', 'multiple', 'search-placeholder'];
|
|
59
|
+
}
|
|
60
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
61
|
+
switch (name) {
|
|
62
|
+
case 'multiple':
|
|
63
|
+
{
|
|
64
|
+
this.#onValueChange(this.value);
|
|
65
|
+
(0, _utils.updateExplicitBooleanAttribute)(this, 'aria-multiselectable', (0, _utils.isAttrTrue)(newVal));
|
|
66
|
+
break;
|
|
67
|
+
}
|
|
68
|
+
case 'value':
|
|
69
|
+
{
|
|
70
|
+
this.#onValueChange(newVal ?? '');
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'rows':
|
|
74
|
+
{
|
|
75
|
+
this.#$listbox.style.maxHeight = (0, _utils.attrValueToPixels)(newVal, {
|
|
76
|
+
min: 2,
|
|
77
|
+
itemSizeMultiplier: ITEM_HEIGHT
|
|
78
|
+
});
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
case 'search-placeholder':
|
|
82
|
+
{
|
|
83
|
+
(0, _utils.updateAttribute)(this.#$search, 'placeholder', newVal);
|
|
84
|
+
break;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
set value(value) {
|
|
89
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
90
|
+
}
|
|
91
|
+
get value() {
|
|
92
|
+
return (0, _utils.getAttribute)(this, 'value', '');
|
|
93
|
+
}
|
|
94
|
+
set rows(value) {
|
|
95
|
+
(0, _utils.updateIntegerAttribute)(this, 'rows', value);
|
|
96
|
+
}
|
|
97
|
+
get rows() {
|
|
98
|
+
return (0, _utils.getIntegerAttribute)(this, 'rows', null);
|
|
99
|
+
}
|
|
100
|
+
set multiple(isMultiple) {
|
|
101
|
+
(0, _utils.updateBooleanAttribute)(this, 'multiple', isMultiple);
|
|
102
|
+
}
|
|
103
|
+
get multiple() {
|
|
104
|
+
return (0, _utils.getBooleanAttribute)(this, 'multiple');
|
|
105
|
+
}
|
|
106
|
+
set searchable(isSearchable) {
|
|
107
|
+
(0, _utils.updateBooleanAttribute)(this, 'searchable', isSearchable);
|
|
108
|
+
}
|
|
109
|
+
get searchable() {
|
|
110
|
+
const searchableAttribute = this.getAttribute('searchable');
|
|
111
|
+
return searchableAttribute === null ? searchableAttribute : (0, _utils.isAttrTrue)(searchableAttribute);
|
|
112
|
+
}
|
|
113
|
+
set 'search-placeholder'(placeholder) {
|
|
114
|
+
(0, _utils.updateAttribute)(this.#$search, 'placeholder', placeholder);
|
|
115
|
+
}
|
|
116
|
+
get 'search-placeholder'() {
|
|
117
|
+
return (0, _utils.getAttribute)(this.#$search, 'placeholder', '');
|
|
118
|
+
}
|
|
119
|
+
get focusable() {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
#onFocus = () => {
|
|
123
|
+
const isSearchActive = (0, _utils.hasClass)(this.#$search, 'active');
|
|
124
|
+
if (isSearchActive) {
|
|
125
|
+
this.#$search.focus();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
#onListboxBlur = () => {
|
|
129
|
+
this.#selectOption(null);
|
|
130
|
+
};
|
|
131
|
+
#onListboxClick = e => {
|
|
132
|
+
const $elem = e.target;
|
|
133
|
+
this.focus();
|
|
134
|
+
if (!(0, _utils.isTargetEqual)(e, this.#$listbox) && !(0, _utils.getBooleanAttribute)($elem, 'disabled')) {
|
|
135
|
+
this.#selectOption($elem);
|
|
136
|
+
this.#dispatchChangeEvent($elem);
|
|
137
|
+
}
|
|
138
|
+
};
|
|
139
|
+
#onSearchChange = e => {
|
|
140
|
+
this.#$search.value = e.detail;
|
|
141
|
+
this.#searchDebounce.fn();
|
|
142
|
+
(0, _utils.setClass)(this.#$searchClear, 'active', e.detail.length > 0);
|
|
143
|
+
};
|
|
144
|
+
#onSearchClearClick = () => {
|
|
145
|
+
this.#$search.value = '';
|
|
146
|
+
this.#$search.focus();
|
|
147
|
+
this.#searchDebounce.fn();
|
|
148
|
+
(0, _utils.setClass)(this.#$searchClear, 'active', false);
|
|
149
|
+
};
|
|
150
|
+
#updateSearch = () => {
|
|
151
|
+
const searchValue = this.#$search.value.toLowerCase();
|
|
152
|
+
const searchChangedEvent = new CustomEvent('-search-change', {
|
|
153
|
+
detail: searchValue,
|
|
154
|
+
cancelable: true
|
|
155
|
+
});
|
|
156
|
+
this.dispatchEvent(searchChangedEvent);
|
|
157
|
+
if (!searchChangedEvent.defaultPrevented) {
|
|
158
|
+
const $options = this.#getOptionElements();
|
|
159
|
+
let someFound = false;
|
|
160
|
+
for (const $opt of $options) {
|
|
161
|
+
const isHidden = searchValue.length > 0 && !$opt.matchesSearch(searchValue);
|
|
162
|
+
someFound ||= !isHidden;
|
|
163
|
+
(0, _utils.setClass)($opt, 'hidden', isHidden);
|
|
164
|
+
}
|
|
165
|
+
(0, _utils.setClass)(this.#$notFound, 'active', !someFound);
|
|
166
|
+
this.#selectOption(null);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
#onContextKeyDown = e => {
|
|
170
|
+
this.#handleKeydown(e.detail);
|
|
171
|
+
};
|
|
172
|
+
#onContextVisibility = e => {
|
|
173
|
+
if (e.detail) {
|
|
174
|
+
this.#selectOption(this.#findCheckedOption());
|
|
175
|
+
this.#onFocus();
|
|
176
|
+
} else {
|
|
177
|
+
this.#selectOption(null);
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
#onListboxKeyDown = e => {
|
|
181
|
+
this.#handleKeydown(e);
|
|
182
|
+
};
|
|
183
|
+
#handleKeydown(e) {
|
|
184
|
+
switch (e.code) {
|
|
185
|
+
case 'Space':
|
|
186
|
+
case 'Enter':
|
|
187
|
+
{
|
|
188
|
+
e.preventDefault();
|
|
189
|
+
const $option = this.#findSelectedOption();
|
|
190
|
+
if ($option !== null) {
|
|
191
|
+
this.#dispatchChangeEvent($option);
|
|
192
|
+
}
|
|
193
|
+
break;
|
|
194
|
+
}
|
|
195
|
+
case 'ArrowUp':
|
|
196
|
+
{
|
|
197
|
+
e.preventDefault();
|
|
198
|
+
this.#selectOption(this.#getPrevOption());
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
case 'ArrowDown':
|
|
202
|
+
{
|
|
203
|
+
e.preventDefault();
|
|
204
|
+
this.#selectOption(this.#getNextOption());
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
#onOptionSlotChange = () => {
|
|
210
|
+
const searchable = this.searchable;
|
|
211
|
+
const options = this.#$optionSlot.assignedElements();
|
|
212
|
+
const isEnoughOptions = options.length >= NUM_ITEMS_SEARCH;
|
|
213
|
+
const isSearchActive = isEnoughOptions && searchable !== false || Boolean(searchable);
|
|
214
|
+
if (!isSearchActive) {
|
|
215
|
+
(0, _utils.updateAttribute)(this.#$search, 'value', null);
|
|
216
|
+
}
|
|
217
|
+
(0, _utils.setClass)(this.#$search, 'active', isSearchActive);
|
|
218
|
+
this.#onValueChange(this.value);
|
|
219
|
+
};
|
|
220
|
+
#onValueChange(csv) {
|
|
221
|
+
if (this.multiple) {
|
|
222
|
+
const values = (0, _utils.unpackCsv)(csv);
|
|
223
|
+
for (const $option of this.#getOptionElements()) {
|
|
224
|
+
const isChecked = !(0, _utils.getBooleanAttribute)($option, 'disabled') && values.includes((0, _utils.getAttribute)($option, 'value', ''));
|
|
225
|
+
(0, _utils.updateBooleanAttribute)($option, 'data-checked', isChecked);
|
|
226
|
+
}
|
|
227
|
+
} else {
|
|
228
|
+
const value = (0, _utils.getFirstCsvValue)(csv);
|
|
229
|
+
for (const $option of this.#getOptionElements()) {
|
|
230
|
+
const isChecked = !(0, _utils.getBooleanAttribute)($option, 'disabled') && value === (0, _utils.getAttribute)($option, 'value', '');
|
|
231
|
+
(0, _utils.updateBooleanAttribute)($option, 'data-checked', isChecked);
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
#getFirstOption() {
|
|
236
|
+
const $options = this.#getOptionElements();
|
|
237
|
+
for (let i = 0; i < $options.length; i++) {
|
|
238
|
+
const el = $options[i];
|
|
239
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && !el.classList.contains('hidden')) {
|
|
240
|
+
return el;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
return null;
|
|
244
|
+
}
|
|
245
|
+
#getLastOption() {
|
|
246
|
+
const $options = this.#getOptionElements();
|
|
247
|
+
for (let i = $options.length - 1; i >= 0; i--) {
|
|
248
|
+
const el = $options[i];
|
|
249
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && !el.classList.contains('hidden')) {
|
|
250
|
+
return el;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
return null;
|
|
254
|
+
}
|
|
255
|
+
#getNextOption() {
|
|
256
|
+
const index = this.#getSelectedOptionIndex();
|
|
257
|
+
if (index !== null) {
|
|
258
|
+
const $options = this.#getOptionElements();
|
|
259
|
+
for (let i = 1; i <= $options.length; i++) {
|
|
260
|
+
const el = $options[(i + index) % $options.length];
|
|
261
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && !el.classList.contains('hidden')) {
|
|
262
|
+
return el;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return this.#getFirstOption();
|
|
267
|
+
}
|
|
268
|
+
#getPrevOption() {
|
|
269
|
+
const index = this.#getSelectedOptionIndex();
|
|
270
|
+
if (index !== null) {
|
|
271
|
+
const $options = this.#getOptionElements();
|
|
272
|
+
for (let i = 1; i <= $options.length; i++) {
|
|
273
|
+
const el = $options[(index - i + $options.length) % $options.length];
|
|
274
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && !el.classList.contains('hidden')) {
|
|
275
|
+
return el;
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return this.#getLastOption();
|
|
280
|
+
}
|
|
281
|
+
#selectOption($option) {
|
|
282
|
+
const hasRows = this.hasAttribute('rows');
|
|
283
|
+
for (const $op of this.#getOptionElements()) {
|
|
284
|
+
const isSelected = $op === $option;
|
|
285
|
+
(0, _utils.updateBooleanAttribute)($op, 'data-selected', isSelected);
|
|
286
|
+
if (isSelected && hasRows) {
|
|
287
|
+
$op.scrollIntoView?.({
|
|
288
|
+
block: 'nearest'
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
#getOptionElements() {
|
|
294
|
+
return this.#$optionSlot.assignedElements();
|
|
295
|
+
}
|
|
296
|
+
#getSelectedOptionIndex() {
|
|
297
|
+
const elements = this.#getOptionElements();
|
|
298
|
+
for (let i = 0; i < elements.length; i++) {
|
|
299
|
+
const el = elements[i];
|
|
300
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && (0, _utils.getBooleanAttribute)(el, 'data-selected')) {
|
|
301
|
+
return i;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return null;
|
|
305
|
+
}
|
|
306
|
+
#findSelectedOption() {
|
|
307
|
+
const elements = this.#getOptionElements();
|
|
308
|
+
for (const el of elements) {
|
|
309
|
+
if (!(0, _utils.getBooleanAttribute)(el, 'disabled') && (0, _utils.getBooleanAttribute)(el, 'data-selected')) {
|
|
310
|
+
return el;
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return null;
|
|
314
|
+
}
|
|
315
|
+
#findCheckedOption() {
|
|
316
|
+
const elements = this.#getOptionElements();
|
|
317
|
+
const value = this.multiple ? (0, _utils.getFirstCsvValue)(this.value) : this.value;
|
|
318
|
+
for (const $el of elements) {
|
|
319
|
+
if (!(0, _utils.getBooleanAttribute)($el, 'disabled') && (0, _utils.getAttribute)($el, 'value') === value) {
|
|
320
|
+
return $el;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
#dispatchChangeEvent($opt) {
|
|
326
|
+
if ($opt === null) {
|
|
327
|
+
return;
|
|
328
|
+
}
|
|
329
|
+
const value = $opt.value;
|
|
330
|
+
const result = this.multiple ? (0, _utils.updateCsv)(this.value, value, !(0, _utils.getBooleanAttribute)($opt, 'data-checked')) : value;
|
|
331
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
332
|
+
detail: result
|
|
333
|
+
}));
|
|
334
|
+
}
|
|
335
|
+
#onChangeReactHandler = e => {
|
|
336
|
+
(0, _utils.getReactEventHandler)(this, 'on-change')?.(e);
|
|
337
|
+
};
|
|
338
|
+
#onSearchChangeReactHandler = e => {
|
|
339
|
+
(0, _utils.getReactEventHandler)(this, 'on-search-change')?.(e);
|
|
340
|
+
};
|
|
341
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SelectMenuOption = void 0;
|
|
7
|
+
require('../icon');
|
|
8
|
+
require('../text');
|
|
9
|
+
var _utils = require('../utils');
|
|
10
|
+
const templateHTML = '<style>:host{display:block}#wrapper{display:flex;position:relative;box-sizing:border-box;height:40px;padding:8px 16px;align-items:center;gap:10px;user-select:none;cursor:pointer;background-color:var(--sinch-comp-select-menu-color-default-background-initial);--sinch-global-color-text:var(--sinch-comp-select-menu-color-default-option-initial);--sinch-global-color-icon:var(--sinch-comp-select-menu-color-default-icon-initial);--sinch-global-size-icon:var(--sinch-comp-select-menu-size-icon)}#content{flex:1;min-width:0;--sinch-comp-text-font:var(--sinch-comp-select-menu-font-option)}#icon-check{display:none;margin-right:-6px}:host([data-checked]) #icon-check{display:block}:host([data-selected])>#wrapper{background-color:var(--sinch-comp-select-menu-color-default-background-selected)}:host(:hover)>#wrapper{background-color:var(--sinch-comp-select-menu-color-default-background-hover)}:host([disabled])>#wrapper{cursor:initial;pointer-events:none;background-color:var(--sinch-comp-select-menu-color-disabled-background-initial);--sinch-global-color-text:var(--sinch-comp-select-menu-color-disabled-option-initial);--sinch-global-color-icon:var(--sinch-comp-select-menu-color-disabled-icon-initial)}::slotted(*){margin-left:-6px}</style><div id="wrapper"><slot name="icon"></slot><sinch-text id="content" type="m" ellipsis></sinch-text><sinch-icon id="icon-check" name="check"></sinch-icon></div>';
|
|
11
|
+
const template = document.createElement('template');
|
|
12
|
+
template.innerHTML = templateHTML;
|
|
13
|
+
class SelectMenuOption extends _utils.NectaryElement {
|
|
14
|
+
#$content;
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
const shadowRoot = this.attachShadow();
|
|
18
|
+
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
19
|
+
this.#$content = shadowRoot.querySelector('#content');
|
|
20
|
+
}
|
|
21
|
+
connectedCallback() {
|
|
22
|
+
this.setAttribute('role', 'option');
|
|
23
|
+
}
|
|
24
|
+
static get observedAttributes() {
|
|
25
|
+
return ['text', 'data-checked', 'disabled'];
|
|
26
|
+
}
|
|
27
|
+
attributeChangedCallback(name, oldVal, newVal) {
|
|
28
|
+
if ((0, _utils.isAttrEqual)(oldVal, newVal)) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
switch (name) {
|
|
32
|
+
case 'text':
|
|
33
|
+
{
|
|
34
|
+
this.#$content.textContent = newVal;
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case 'data-checked':
|
|
38
|
+
{
|
|
39
|
+
(0, _utils.updateExplicitBooleanAttribute)(this, 'aria-selected', (0, _utils.isAttrTrue)(newVal));
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case 'disabled':
|
|
43
|
+
{
|
|
44
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', (0, _utils.isAttrTrue)(newVal));
|
|
45
|
+
break;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
set value(value) {
|
|
50
|
+
(0, _utils.updateAttribute)(this, 'value', value);
|
|
51
|
+
}
|
|
52
|
+
get value() {
|
|
53
|
+
return (0, _utils.getAttribute)(this, 'value', '');
|
|
54
|
+
}
|
|
55
|
+
set text(value) {
|
|
56
|
+
(0, _utils.updateAttribute)(this, 'text', value);
|
|
57
|
+
}
|
|
58
|
+
get text() {
|
|
59
|
+
return (0, _utils.getAttribute)(this, 'text', '');
|
|
60
|
+
}
|
|
61
|
+
set disabled(isDisabled) {
|
|
62
|
+
(0, _utils.updateBooleanAttribute)(this, 'disabled', isDisabled);
|
|
63
|
+
}
|
|
64
|
+
get disabled() {
|
|
65
|
+
return (0, _utils.getBooleanAttribute)(this, 'disabled');
|
|
66
|
+
}
|
|
67
|
+
matchesSearch(searchValue) {
|
|
68
|
+
return this.text.toLowerCase().includes(searchValue);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.SelectMenuOption = SelectMenuOption;
|
|
72
|
+
(0, _utils.defineCustomElement)('sinch-select-menu-option', SelectMenuOption);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|