@nectary/components 4.12.0 → 4.12.1
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/accordion/index.d.ts +22 -1
- package/accordion/index.js +39 -41
- package/accordion/types.d.ts +1 -21
- package/accordion/types.js +1 -1
- package/accordion-item/index.d.ts +22 -2
- package/accordion-item/index.js +49 -53
- package/accordion-item/types.d.ts +1 -21
- package/accordion-item/types.js +1 -1
- package/accordion-item/utils.js +1 -4
- package/action-menu/index.d.ts +22 -1
- package/action-menu/index.js +77 -62
- package/action-menu/types.d.ts +1 -21
- package/action-menu/types.js +1 -1
- package/action-menu-option/index.d.ts +22 -1
- package/action-menu-option/index.js +41 -39
- package/action-menu-option/types.d.ts +1 -21
- package/action-menu-option/types.js +1 -1
- package/action-menu-option/utils.js +3 -6
- package/alert/index.d.ts +22 -2
- package/alert/index.js +21 -24
- package/alert/types.d.ts +1 -21
- package/alert/types.js +1 -1
- package/alert/utils.js +1 -4
- package/avatar/colors.js +1 -1
- package/avatar/index.d.ts +22 -2
- package/avatar/index.js +41 -42
- package/avatar/types.d.ts +1 -21
- package/avatar/types.js +1 -1
- package/avatar/utils.js +4 -9
- package/badge/index.d.ts +22 -3
- package/badge/index.js +51 -52
- package/badge/types.d.ts +1 -21
- package/badge/types.js +1 -1
- package/badge/utils.js +1 -4
- package/button/index.d.ts +22 -2
- package/button/index.js +111 -101
- package/button/types.d.ts +1 -21
- package/button/types.js +1 -1
- package/button/utils.js +2 -18
- package/button-group/index.d.ts +22 -1
- package/button-group/index.js +18 -20
- package/button-group/types.d.ts +3 -22
- package/button-group/types.js +1 -1
- package/button-group-item/index.d.ts +22 -2
- package/button-group-item/index.js +42 -31
- package/button-group-item/types.d.ts +3 -22
- package/button-group-item/types.js +1 -1
- package/card/index.d.ts +40 -0
- package/card/index.js +134 -0
- package/card/types.d.ts +17 -0
- package/card/types.js +1 -0
- package/card-container/index.d.ts +21 -1
- package/card-container/index.js +5 -8
- package/card-container/types.d.ts +1 -21
- package/card-container/types.js +1 -1
- package/card-v2/index.d.ts +22 -1
- package/card-v2/index.js +57 -59
- package/card-v2/types.d.ts +1 -21
- package/card-v2/types.js +1 -1
- package/card-v2-title/index.d.ts +22 -2
- package/card-v2-title/index.js +26 -28
- package/card-v2-title/types.d.ts +1 -21
- package/card-v2-title/types.js +1 -1
- package/checkbox/index.d.ts +22 -1
- package/checkbox/index.js +81 -88
- package/checkbox/types.d.ts +1 -21
- package/checkbox/types.js +1 -1
- package/chip/colors.js +1 -1
- package/chip/index.d.ts +22 -1
- package/chip/index.js +75 -62
- package/chip/types.d.ts +1 -21
- package/chip/types.js +1 -1
- package/chip/utils.js +3 -7
- package/code-tag/index.d.ts +22 -1
- package/code-tag/index.js +14 -17
- package/code-tag/types.d.ts +1 -21
- package/code-tag/types.js +1 -1
- package/color-menu/index.d.ts +22 -2
- package/color-menu/index.js +115 -115
- package/color-menu/types.d.ts +1 -21
- package/color-menu/types.js +1 -1
- package/color-menu/utils.js +3 -6
- package/color-menu-option/index.d.ts +22 -1
- package/color-menu-option/index.js +26 -30
- package/color-menu-option/types.d.ts +1 -21
- package/color-menu-option/types.js +1 -1
- package/color-menu-option/utils.js +3 -6
- package/color-swatch/index.d.ts +22 -1
- package/color-swatch/index.js +20 -23
- package/color-swatch/types.d.ts +1 -21
- package/color-swatch/types.js +1 -1
- package/color-swatch/utils.js +3 -7
- package/date-picker/index.d.ts +22 -2
- package/date-picker/index.js +150 -157
- package/date-picker/types.d.ts +1 -21
- package/date-picker/types.js +1 -1
- package/date-picker/utils.js +42 -59
- package/dialog/index.d.ts +22 -1
- package/dialog/index.js +58 -71
- package/dialog/types.d.ts +1 -21
- package/dialog/types.js +1 -1
- package/dialog/utils.js +7 -11
- package/emoji/index.d.ts +22 -1
- package/emoji/index.js +16 -19
- package/emoji/types.d.ts +1 -21
- package/emoji/types.js +1 -1
- package/emoji/utils.js +17 -22
- package/emoji-picker/index.d.ts +22 -2
- package/emoji-picker/index.js +118 -138
- package/emoji-picker/types.d.ts +1 -21
- package/emoji-picker/types.js +1 -1
- package/field/index.d.ts +22 -1
- package/field/index.js +60 -63
- package/field/types.d.ts +1 -21
- package/field/types.js +1 -1
- package/file-drop/index.d.ts +22 -1
- package/file-drop/index.js +98 -103
- package/file-drop/types.d.ts +1 -21
- package/file-drop/types.js +1 -1
- package/file-drop/utils.js +22 -27
- package/file-picker/index.d.ts +22 -1
- package/file-picker/index.js +48 -53
- package/file-picker/types.d.ts +1 -21
- package/file-picker/types.js +1 -1
- package/file-picker/utils.js +3 -6
- package/file-status/index.d.ts +22 -2
- package/file-status/index.js +22 -33
- package/file-status/types.d.ts +1 -21
- package/file-status/types.js +1 -1
- package/file-status/utils.js +1 -4
- package/flag/index.d.ts +22 -1
- package/flag/index.js +16 -19
- package/flag/types.d.ts +1 -21
- package/flag/types.js +1 -1
- package/flag/utils.js +8 -11
- package/grid/index.d.ts +22 -1
- package/grid/index.js +5 -8
- package/grid/types.d.ts +1 -21
- package/grid/types.js +1 -1
- package/grid-item/index.d.ts +22 -1
- package/grid-item/index.js +13 -17
- package/grid-item/types.d.ts +1 -21
- package/grid-item/types.js +1 -1
- package/help-tooltip/index.d.ts +22 -1
- package/help-tooltip/index.js +26 -29
- package/help-tooltip/types.d.ts +1 -21
- package/help-tooltip/types.js +1 -1
- package/horizontal-stepper/index.d.ts +33 -0
- package/horizontal-stepper/index.js +62 -0
- package/horizontal-stepper/types.d.ts +42 -0
- package/horizontal-stepper/types.js +1 -0
- package/horizontal-stepper-item/index.d.ts +38 -0
- package/horizontal-stepper-item/index.js +62 -0
- package/horizontal-stepper-item/types.d.ts +38 -0
- package/horizontal-stepper-item/types.js +1 -0
- package/horizontal-stepper-item/utils.d.ts +2 -0
- package/horizontal-stepper-item/utils.js +1 -0
- package/icon/generated-icon-type.js +1 -1
- package/icon/index.d.ts +22 -1
- package/icon/index.js +28 -30
- package/icon/types.d.ts +1 -21
- package/icon/types.js +1 -1
- package/inline-alert/index.d.ts +22 -2
- package/inline-alert/index.js +39 -58
- package/inline-alert/types.d.ts +1 -21
- package/inline-alert/types.js +1 -1
- package/inline-alert/utils.js +1 -4
- package/input/index.d.ts +22 -2
- package/input/index.js +317 -295
- package/input/types.d.ts +1 -21
- package/input/types.js +1 -1
- package/input/utils.js +46 -56
- package/link/index.d.ts +22 -1
- package/link/index.js +79 -88
- package/link/types.d.ts +1 -21
- package/link/types.js +1 -1
- package/list/index.d.ts +21 -1
- package/list/index.js +6 -9
- package/list/types.d.ts +1 -21
- package/list/types.js +1 -1
- package/list-item/index.d.ts +22 -1
- package/list-item/index.js +6 -9
- package/list-item/types.d.ts +1 -21
- package/list-item/types.js +1 -1
- package/package.json +5 -11
- package/pagination/index.d.ts +22 -2
- package/pagination/index.js +46 -64
- package/pagination/types.d.ts +1 -21
- package/pagination/types.js +1 -1
- package/persistent-overlay/index.d.ts +22 -1
- package/persistent-overlay/index.js +44 -42
- package/persistent-overlay/types.d.ts +1 -21
- package/persistent-overlay/types.js +1 -1
- package/pop/index.d.ts +22 -3
- package/pop/index.js +150 -149
- package/pop/types.d.ts +1 -21
- package/pop/types.js +1 -1
- package/pop/utils.js +8 -24
- package/popover/index.d.ts +22 -2
- package/popover/index.js +68 -75
- package/popover/types.d.ts +1 -21
- package/popover/types.js +1 -1
- package/popover/utils.js +7 -18
- package/progress/index.d.ts +22 -1
- package/progress/index.js +33 -30
- package/progress/types.d.ts +1 -21
- package/progress/types.js +1 -1
- package/progress-stepper/index.d.ts +22 -2
- package/progress-stepper/index.js +66 -64
- package/progress-stepper/types.d.ts +1 -21
- package/progress-stepper/types.js +1 -1
- package/progress-stepper-item/index.d.ts +22 -1
- package/progress-stepper-item/index.js +50 -58
- package/progress-stepper-item/types.d.ts +1 -21
- package/progress-stepper-item/types.js +1 -1
- package/progress-stepper-item/utils.js +11 -22
- package/radio/index.d.ts +22 -1
- package/radio/index.js +83 -79
- package/radio/types.d.ts +1 -21
- package/radio/types.js +1 -1
- package/radio-option/index.d.ts +22 -1
- package/radio-option/index.js +41 -47
- package/radio-option/types.d.ts +1 -21
- package/radio-option/types.js +1 -1
- package/rich-text/index.d.ts +22 -1
- package/rich-text/index.js +46 -45
- package/rich-text/types.d.ts +1 -21
- package/rich-text/types.js +1 -1
- package/rich-text/utils.js +33 -31
- package/rich-textarea/index.d.ts +22 -1
- package/rich-textarea/index.js +194 -201
- package/rich-textarea/types.d.ts +1 -21
- package/rich-textarea/types.js +1 -1
- package/rich-textarea/utils.js +340 -313
- package/segment/index.d.ts +40 -0
- package/segment/index.js +110 -0
- package/segment/types.d.ts +23 -0
- package/segment/types.js +1 -0
- package/segment/utils.d.ts +3 -0
- package/segment/utils.js +16 -0
- package/segment-collapse/index.d.ts +22 -1
- package/segment-collapse/index.js +25 -31
- package/segment-collapse/types.d.ts +1 -21
- package/segment-collapse/types.js +1 -1
- package/segmented-control/index.d.ts +22 -1
- package/segmented-control/index.js +45 -45
- package/segmented-control/types.d.ts +1 -21
- package/segmented-control/types.js +1 -1
- package/segmented-control-option/index.d.ts +22 -1
- package/segmented-control-option/index.js +46 -44
- package/segmented-control-option/types.d.ts +1 -21
- package/segmented-control-option/types.js +1 -1
- package/segmented-icon-control/index.d.ts +22 -1
- package/segmented-icon-control/index.js +50 -51
- package/segmented-icon-control/types.d.ts +1 -21
- package/segmented-icon-control/types.js +1 -1
- package/segmented-icon-control-option/index.d.ts +22 -1
- package/segmented-icon-control-option/index.js +37 -36
- package/segmented-icon-control-option/types.d.ts +1 -21
- package/segmented-icon-control-option/types.js +1 -1
- package/select-button/index.d.ts +26 -1
- package/select-button/index.js +112 -104
- package/select-button/types.d.ts +1 -25
- package/select-button/types.js +1 -1
- package/select-menu/index.d.ts +22 -1
- package/select-menu/index.js +164 -201
- package/select-menu/types.d.ts +1 -21
- package/select-menu/types.js +1 -1
- package/select-menu-option/index.d.ts +22 -1
- package/select-menu-option/index.js +33 -41
- package/select-menu-option/types.d.ts +1 -21
- package/select-menu-option/types.js +1 -1
- package/select-menu-option/utils.js +1 -4
- package/skeleton/index.d.ts +22 -1
- package/skeleton/index.js +38 -35
- package/skeleton/types.d.ts +1 -21
- package/skeleton/types.js +1 -1
- package/skeleton-item/index.d.ts +22 -1
- package/skeleton-item/index.js +5 -8
- package/skeleton-item/types.d.ts +1 -21
- package/skeleton-item/types.js +1 -1
- package/spinner/index.d.ts +22 -1
- package/spinner/index.js +29 -31
- package/spinner/types.d.ts +1 -21
- package/spinner/types.js +1 -1
- package/standalone.d.ts +8 -0
- package/standalone.js +87 -79
- package/standalone.ts +8 -0
- package/stop-events/index.js +12 -12
- package/table/index.d.ts +21 -1
- package/table/index.js +6 -9
- package/table/types.d.ts +1 -21
- package/table/types.js +1 -1
- package/table-body/index.d.ts +21 -1
- package/table-body/index.js +6 -9
- package/table-body/types.d.ts +1 -21
- package/table-body/types.js +1 -1
- package/table-cell/index.d.ts +22 -2
- package/table-cell/index.js +9 -13
- package/table-cell/types.d.ts +1 -21
- package/table-cell/types.js +1 -1
- package/table-cell/utils.js +1 -4
- package/table-head/index.d.ts +21 -1
- package/table-head/index.js +6 -9
- package/table-head/types.d.ts +1 -21
- package/table-head/types.js +1 -1
- package/table-head-cell/index.d.ts +22 -1
- package/table-head-cell/index.js +27 -29
- package/table-head-cell/types.d.ts +1 -21
- package/table-head-cell/types.js +1 -1
- package/table-row/index.d.ts +22 -1
- package/table-row/index.js +17 -20
- package/table-row/types.d.ts +1 -21
- package/table-row/types.js +1 -1
- package/tabs/index.d.ts +22 -2
- package/tabs/index.js +35 -32
- package/tabs/types.d.ts +1 -21
- package/tabs/types.js +1 -1
- package/tabs-icon-option/index.d.ts +22 -1
- package/tabs-icon-option/index.js +40 -38
- package/tabs-icon-option/types.d.ts +1 -21
- package/tabs-icon-option/types.js +1 -1
- package/tabs-option/index.d.ts +22 -1
- package/tabs-option/index.js +43 -41
- package/tabs-option/types.d.ts +1 -21
- package/tabs-option/types.js +1 -1
- package/tag/colors.js +1 -1
- package/tag/index.d.ts +22 -1
- package/tag/index.js +44 -45
- package/tag/types.d.ts +1 -21
- package/tag/types.js +1 -1
- package/tag/utils.js +3 -7
- package/text/index.d.ts +22 -2
- package/text/index.js +28 -33
- package/text/types.d.ts +1 -21
- package/text/types.js +1 -1
- package/text/utils.js +1 -4
- package/textarea/index.d.ts +22 -1
- package/textarea/index.js +152 -147
- package/textarea/types.d.ts +1 -21
- package/textarea/types.js +1 -1
- package/tile-control/index.d.ts +39 -0
- package/tile-control/index.js +111 -0
- package/tile-control/types.d.ts +29 -0
- package/tile-control/types.js +1 -0
- package/tile-control-option/index.d.ts +40 -0
- package/tile-control-option/index.js +99 -0
- package/tile-control-option/types.d.ts +52 -0
- package/tile-control-option/types.js +1 -0
- package/time-picker/index.d.ts +22 -2
- package/time-picker/index.js +123 -119
- package/time-picker/types.d.ts +1 -21
- package/time-picker/types.js +1 -1
- package/time-picker/utils.js +33 -31
- package/title/index.d.ts +22 -2
- package/title/index.js +31 -32
- package/title/types.d.ts +1 -21
- package/title/types.js +1 -1
- package/title/utils.js +14 -18
- package/toast/index.d.ts +22 -2
- package/toast/index.js +34 -37
- package/toast/types.d.ts +1 -21
- package/toast/types.js +1 -1
- package/toast/utils.js +1 -4
- package/toast-manager/index.d.ts +22 -3
- package/toast-manager/index.js +63 -77
- package/toast-manager/types.d.ts +1 -21
- package/toast-manager/types.js +1 -1
- package/toast-manager/utils.js +1 -4
- package/toggle/index.d.ts +22 -1
- package/toggle/index.js +75 -81
- package/toggle/types.d.ts +1 -21
- package/toggle/types.js +1 -1
- package/tooltip/index.d.ts +22 -3
- package/tooltip/index.js +93 -105
- package/tooltip/tooltip-state.js +64 -56
- package/tooltip/types.d.ts +1 -21
- package/tooltip/types.js +1 -1
- package/tooltip/utils.js +13 -32
- package/types.d.ts +29 -12
- package/utils/adapters.js +1 -1
- package/utils/context.js +42 -32
- package/utils/countries.js +2 -490
- package/utils/csv.js +6 -13
- package/utils/debounce.js +3 -10
- package/utils/dom.js +53 -60
- package/utils/element.d.ts +15 -107
- package/utils/element.js +19 -100
- package/utils/event-target.js +5 -11
- package/utils/form.js +12 -17
- package/utils/get-react-event-handler.js +3 -6
- package/utils/index.js +12 -65
- package/utils/markdown.js +43 -56
- package/utils/rect.js +18 -13
- package/utils/size.js +3 -8
- package/utils/slot.js +9 -13
- package/utils/throttle.js +2 -5
- package/utils/uid.js +2 -5
- package/vertical-stepper/index.d.ts +33 -0
- package/vertical-stepper/index.js +58 -0
- package/vertical-stepper/types.d.ts +34 -0
- package/vertical-stepper/types.js +1 -0
- package/vertical-stepper-item/index.d.ts +38 -0
- package/vertical-stepper-item/index.js +62 -0
- package/vertical-stepper-item/types.d.ts +42 -0
- package/vertical-stepper-item/types.js +1 -0
- package/vertical-stepper-item/utils.d.ts +2 -0
- package/vertical-stepper-item/utils.js +1 -0
- package/accordion/global/index.d.ts +0 -1
- package/accordion/global/index.js +0 -2
- package/accordion-item/global/index.d.ts +0 -1
- package/accordion-item/global/index.js +0 -2
- package/action-menu/global/index.d.ts +0 -1
- package/action-menu/global/index.js +0 -2
- package/action-menu-option/global/index.d.ts +0 -1
- package/action-menu-option/global/index.js +0 -2
- package/alert/global/index.d.ts +0 -1
- package/alert/global/index.js +0 -2
- package/avatar/global/index.d.ts +0 -1
- package/avatar/global/index.js +0 -2
- package/badge/global/index.d.ts +0 -1
- package/badge/global/index.js +0 -2
- package/bundle.d.ts +0 -78
- package/bundle.js +0 -13033
- package/bundle.ts +0 -80
- package/button/global/index.d.ts +0 -1
- package/button/global/index.js +0 -2
- package/button-group/global/index.d.ts +0 -1
- package/button-group/global/index.js +0 -2
- package/button-group-item/global/index.d.ts +0 -1
- package/button-group-item/global/index.js +0 -2
- package/card-container/global/index.d.ts +0 -1
- package/card-container/global/index.js +0 -2
- package/card-v2/global/index.d.ts +0 -1
- package/card-v2/global/index.js +0 -2
- package/card-v2-title/global/index.d.ts +0 -1
- package/card-v2-title/global/index.js +0 -2
- package/checkbox/global/index.d.ts +0 -1
- package/checkbox/global/index.js +0 -2
- package/chip/global/index.d.ts +0 -1
- package/chip/global/index.js +0 -2
- package/code-tag/global/index.d.ts +0 -1
- package/code-tag/global/index.js +0 -2
- package/color-menu/global/index.d.ts +0 -1
- package/color-menu/global/index.js +0 -2
- package/color-menu-option/global/index.d.ts +0 -1
- package/color-menu-option/global/index.js +0 -2
- package/color-swatch/global/index.d.ts +0 -1
- package/color-swatch/global/index.js +0 -2
- package/date-picker/global/index.d.ts +0 -1
- package/date-picker/global/index.js +0 -2
- package/dialog/global/index.d.ts +0 -1
- package/dialog/global/index.js +0 -2
- package/emoji/global/index.d.ts +0 -1
- package/emoji/global/index.js +0 -2
- package/emoji-picker/global/index.d.ts +0 -1
- package/emoji-picker/global/index.js +0 -2
- package/field/global/index.d.ts +0 -1
- package/field/global/index.js +0 -2
- package/file-drop/global/index.d.ts +0 -1
- package/file-drop/global/index.js +0 -2
- package/file-picker/global/index.d.ts +0 -1
- package/file-picker/global/index.js +0 -2
- package/file-status/global/index.d.ts +0 -1
- package/file-status/global/index.js +0 -2
- package/flag/global/index.d.ts +0 -1
- package/flag/global/index.js +0 -2
- package/grid/global/index.d.ts +0 -1
- package/grid/global/index.js +0 -2
- package/grid-item/global/index.d.ts +0 -1
- package/grid-item/global/index.js +0 -2
- package/help-tooltip/global/index.d.ts +0 -1
- package/help-tooltip/global/index.js +0 -2
- package/icon/global/index.d.ts +0 -1
- package/icon/global/index.js +0 -2
- package/inline-alert/global/index.d.ts +0 -1
- package/inline-alert/global/index.js +0 -2
- package/input/global/index.d.ts +0 -1
- package/input/global/index.js +0 -2
- package/link/global/index.d.ts +0 -1
- package/link/global/index.js +0 -2
- package/list/global/index.d.ts +0 -1
- package/list/global/index.js +0 -2
- package/list-item/global/index.d.ts +0 -1
- package/list-item/global/index.js +0 -2
- package/pagination/global/index.d.ts +0 -1
- package/pagination/global/index.js +0 -2
- package/persistent-overlay/global/index.d.ts +0 -1
- package/persistent-overlay/global/index.js +0 -2
- package/pop/global/index.d.ts +0 -1
- package/pop/global/index.js +0 -2
- package/popover/global/index.d.ts +0 -1
- package/popover/global/index.js +0 -2
- package/progress/global/index.d.ts +0 -1
- package/progress/global/index.js +0 -2
- package/progress-stepper/global/index.d.ts +0 -1
- package/progress-stepper/global/index.js +0 -2
- package/progress-stepper-item/global/index.d.ts +0 -1
- package/progress-stepper-item/global/index.js +0 -2
- package/radio/global/index.d.ts +0 -1
- package/radio/global/index.js +0 -2
- package/radio-option/global/index.d.ts +0 -1
- package/radio-option/global/index.js +0 -2
- package/rich-text/global/index.d.ts +0 -1
- package/rich-text/global/index.js +0 -2
- package/rich-textarea/global/index.d.ts +0 -1
- package/rich-textarea/global/index.js +0 -2
- package/segment-collapse/global/index.d.ts +0 -1
- package/segment-collapse/global/index.js +0 -2
- package/segmented-control/global/index.d.ts +0 -1
- package/segmented-control/global/index.js +0 -2
- package/segmented-control-option/global/index.d.ts +0 -1
- package/segmented-control-option/global/index.js +0 -2
- package/segmented-icon-control/global/index.d.ts +0 -1
- package/segmented-icon-control/global/index.js +0 -2
- package/segmented-icon-control-option/global/index.d.ts +0 -1
- package/segmented-icon-control-option/global/index.js +0 -2
- package/select-button/global/index.d.ts +0 -1
- package/select-button/global/index.js +0 -2
- package/select-menu/global/index.d.ts +0 -1
- package/select-menu/global/index.js +0 -2
- package/select-menu-option/global/index.d.ts +0 -1
- package/select-menu-option/global/index.js +0 -2
- package/skeleton/global/index.d.ts +0 -1
- package/skeleton/global/index.js +0 -2
- package/skeleton-item/global/index.d.ts +0 -1
- package/skeleton-item/global/index.js +0 -2
- package/spinner/global/index.d.ts +0 -1
- package/spinner/global/index.js +0 -2
- package/table/global/index.d.ts +0 -1
- package/table/global/index.js +0 -2
- package/table-body/global/index.d.ts +0 -1
- package/table-body/global/index.js +0 -2
- package/table-cell/global/index.d.ts +0 -1
- package/table-cell/global/index.js +0 -2
- package/table-head/global/index.d.ts +0 -1
- package/table-head/global/index.js +0 -2
- package/table-head-cell/global/index.d.ts +0 -1
- package/table-head-cell/global/index.js +0 -2
- package/table-row/global/index.d.ts +0 -1
- package/table-row/global/index.js +0 -2
- package/tabs/global/index.d.ts +0 -1
- package/tabs/global/index.js +0 -2
- package/tabs-icon-option/global/index.d.ts +0 -1
- package/tabs-icon-option/global/index.js +0 -2
- package/tabs-option/global/index.d.ts +0 -1
- package/tabs-option/global/index.js +0 -2
- package/tag/global/index.d.ts +0 -1
- package/tag/global/index.js +0 -2
- package/text/global/index.d.ts +0 -1
- package/text/global/index.js +0 -2
- package/textarea/global/index.d.ts +0 -1
- package/textarea/global/index.js +0 -2
- package/time-picker/global/index.d.ts +0 -1
- package/time-picker/global/index.js +0 -2
- package/title/global/index.d.ts +0 -1
- package/title/global/index.js +0 -2
- package/toast/global/index.d.ts +0 -1
- package/toast/global/index.js +0 -2
- package/toast-manager/global/index.d.ts +0 -1
- package/toast-manager/global/index.js +0 -2
- package/toggle/global/index.d.ts +0 -1
- package/toggle/global/index.js +0 -2
- package/tooltip/global/index.d.ts +0 -1
- package/tooltip/global/index.js +0 -2
- package/utils/component-names.d.ts +0 -3
- package/utils/component-names.js +0 -85
- package/utils/global-components-constants.d.ts +0 -3
- package/utils/global-components-constants.js +0 -8
- package/utils/global-components-manager.d.ts +0 -71
- package/utils/global-components-manager.js +0 -24
- package/utils/shared/global-elements-manager.d.js +0 -1
- package/utils/shared/global-elements-manager.d.ts +0 -62
- package/utils/shared/global-elements-manager.js +0 -163
- package/utils/shared/global-elements-store.d.js +0 -1
- package/utils/shared/global-elements-store.d.ts +0 -12
- package/utils/shared/global-elements-store.js +0 -31
- package/utils/shared/index.d.js +0 -11
- package/utils/shared/index.d.ts +0 -3
- package/utils/shared/index.js +0 -11
- package/utils/shared/nectary-element-base.d.js +0 -1
- package/utils/shared/nectary-element-base.d.ts +0 -9
- package/utils/shared/nectary-element-base.js +0 -25
- package/utils/shared/package.json +0 -9
- package/utils/shared/tsconfig.json +0 -20
package/list-item/index.d.ts
CHANGED
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { NectaryElement } from '../utils';
|
|
2
|
-
|
|
2
|
+
import type { TSinchListItem } from './types';
|
|
3
|
+
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
3
4
|
export declare class ListItem extends NectaryElement {
|
|
4
5
|
constructor();
|
|
5
6
|
connectedCallback(): void;
|
|
6
7
|
}
|
|
8
|
+
declare global {
|
|
9
|
+
interface NectaryComponentMap {
|
|
10
|
+
'sinch-list-item': TSinchListItem;
|
|
11
|
+
}
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'sinch-list-item': NectaryComponentVanilla<'sinch-list-item'>;
|
|
14
|
+
}
|
|
15
|
+
namespace JSX {
|
|
16
|
+
interface IntrinsicElements {
|
|
17
|
+
'sinch-list-item': NectaryComponentReact<'sinch-list-item'>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
declare module 'react' {
|
|
22
|
+
namespace JSX {
|
|
23
|
+
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
24
|
+
'sinch-list-item': NectaryComponentReact<'sinch-list-item'>;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
package/list-item/index.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import { defineCustomElement, NectaryElement } from
|
|
2
|
-
const templateHTML = '<style
|
|
3
|
-
const template = document.createElement(
|
|
1
|
+
import { defineCustomElement, NectaryElement } from '../utils';
|
|
2
|
+
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>';
|
|
3
|
+
const template = document.createElement('template');
|
|
4
4
|
template.innerHTML = templateHTML;
|
|
5
|
-
class ListItem extends NectaryElement {
|
|
5
|
+
export class ListItem extends NectaryElement {
|
|
6
6
|
constructor() {
|
|
7
7
|
super();
|
|
8
8
|
const shadowRoot = this.attachShadow();
|
|
9
9
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
10
10
|
}
|
|
11
11
|
connectedCallback() {
|
|
12
|
-
this.setAttribute(
|
|
12
|
+
this.setAttribute('role', 'listitem');
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
|
-
defineCustomElement(
|
|
16
|
-
export {
|
|
17
|
-
ListItem
|
|
18
|
-
};
|
|
15
|
+
defineCustomElement('sinch-list-item', ListItem);
|
package/list-item/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NectaryComponentReactByType
|
|
1
|
+
import type { NectaryComponentReactByType } from '../types';
|
|
2
2
|
export type TSinchListItemStyle = {
|
|
3
3
|
'--sinch-comp-list-color-default-background-initial'?: string;
|
|
4
4
|
'--sinch-comp-list-color-default-background-hover'?: string;
|
|
@@ -9,23 +9,3 @@ export type TSinchListItem = {
|
|
|
9
9
|
};
|
|
10
10
|
export type TSinchListItemElement = HTMLElement;
|
|
11
11
|
export type TSinchListItemReact = NectaryComponentReactByType<TSinchListItemElement>;
|
|
12
|
-
declare global {
|
|
13
|
-
interface NectaryComponentMap {
|
|
14
|
-
'sinch-list-item': TSinchListItem;
|
|
15
|
-
}
|
|
16
|
-
interface HTMLElementTagNameMap {
|
|
17
|
-
'sinch-list-item': NectaryComponentVanilla<'sinch-list-item'>;
|
|
18
|
-
}
|
|
19
|
-
namespace JSX {
|
|
20
|
-
interface IntrinsicElements {
|
|
21
|
-
'sinch-list-item': NectaryComponentReact<'sinch-list-item'>;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
declare module 'react' {
|
|
26
|
-
namespace JSX {
|
|
27
|
-
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
28
|
-
'sinch-list-item': NectaryComponentReact<'sinch-list-item'>;
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
package/list-item/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nectary/components",
|
|
3
|
-
"version": "4.12.
|
|
3
|
+
"version": "4.12.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"**/*/*.css",
|
|
6
6
|
"**/*/*.json",
|
|
@@ -9,9 +9,6 @@
|
|
|
9
9
|
"standalone.ts",
|
|
10
10
|
"standalone.d.ts",
|
|
11
11
|
"standalone.js",
|
|
12
|
-
"bundle.ts",
|
|
13
|
-
"bundle.d.ts",
|
|
14
|
-
"bundle.js",
|
|
15
12
|
"types.d.ts",
|
|
16
13
|
"colors.json"
|
|
17
14
|
],
|
|
@@ -19,12 +16,11 @@
|
|
|
19
16
|
"access": "public"
|
|
20
17
|
},
|
|
21
18
|
"scripts": {
|
|
22
|
-
"build": "
|
|
23
|
-
"dev": "vite build --watch"
|
|
19
|
+
"build": "NODE_ENV=production babel . --extensions '.ts' --out-dir . && tsc --declaration --emitDeclarationOnly"
|
|
24
20
|
},
|
|
25
21
|
"dependencies": {
|
|
26
22
|
"@babel/runtime": "^7.22.15",
|
|
27
|
-
"@nectary/assets": "2.6.
|
|
23
|
+
"@nectary/assets": "2.6.1"
|
|
28
24
|
},
|
|
29
25
|
"devDependencies": {
|
|
30
26
|
"@babel/cli": "^7.22.15",
|
|
@@ -32,12 +28,10 @@
|
|
|
32
28
|
"@babel/plugin-transform-runtime": "^7.22.15",
|
|
33
29
|
"@babel/preset-env": "^7.22.20",
|
|
34
30
|
"@babel/preset-typescript": "^7.22.15",
|
|
35
|
-
"@types/node": "
|
|
31
|
+
"@types/node": "^18.17.17",
|
|
36
32
|
"@types/react": "^18.2.21",
|
|
37
33
|
"babel-plugin-html-inline-minifier": "workspace:*",
|
|
38
|
-
"
|
|
39
|
-
"typescript": "^5.2.2",
|
|
40
|
-
"vite": "^7.0.6"
|
|
34
|
+
"typescript": "^5.2.2"
|
|
41
35
|
},
|
|
42
36
|
"peerDependencies": {
|
|
43
37
|
"@nectary/theme-base": "1.5.0"
|
package/pagination/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../icon';
|
|
2
2
|
import { NectaryElement } from '../utils';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
3
|
+
import type { TSinchPagination } from './types';
|
|
4
|
+
import type { NectaryComponentReact, NectaryComponentVanilla, TRect } from '../types';
|
|
5
5
|
export declare class Pagination extends NectaryElement {
|
|
6
6
|
#private;
|
|
7
7
|
constructor();
|
|
@@ -20,3 +20,23 @@ export declare class Pagination extends NectaryElement {
|
|
|
20
20
|
get nextButtonRect(): TRect;
|
|
21
21
|
nthButtonRect(index: number): TRect | null;
|
|
22
22
|
}
|
|
23
|
+
declare global {
|
|
24
|
+
interface NectaryComponentMap {
|
|
25
|
+
'sinch-pagination': TSinchPagination;
|
|
26
|
+
}
|
|
27
|
+
interface HTMLElementTagNameMap {
|
|
28
|
+
'sinch-pagination': NectaryComponentVanilla<'sinch-pagination'>;
|
|
29
|
+
}
|
|
30
|
+
namespace JSX {
|
|
31
|
+
interface IntrinsicElements {
|
|
32
|
+
'sinch-pagination': NectaryComponentReact<'sinch-pagination'>;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
declare module 'react' {
|
|
37
|
+
namespace JSX {
|
|
38
|
+
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
39
|
+
'sinch-pagination': NectaryComponentReact<'sinch-pagination'>;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
package/pagination/index.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { updateAttribute, getIntegerAttribute, setClass } from
|
|
3
|
-
|
|
4
|
-
import { getRect } from "../utils/rect.js";
|
|
5
|
-
import { getReactEventHandler } from "../utils/get-react-event-handler.js";
|
|
6
|
-
import { isTargetEqual, getTargetIndexInParent } from "../utils/event-target.js";
|
|
7
|
-
const templateHTML = '<style>\n :host {\n display: inline-block;\n vertical-align: middle;\n outline: none;\n }\n\n #wrapper {\n display: flex;\n justify-content: center;\n gap: 8px;\n width: 100%;\n height: var(--sinch-local-size);\n\n --sinch-local-size: 24px;\n }\n\n button {\n all: initial;\n position: relative;\n display: flex;\n justify-content: center;\n align-items: center;\n min-width: var(--sinch-local-size);\n height: var(--sinch-local-size);\n cursor: pointer;\n border-radius: var(--sinch-comp-pagination-shape-radius);\n user-select: none;\n\n --sinch-global-color-icon:\n var(\n --sinch-comp-pagination-color-default-icon-default\n );\n }\n\n button:focus-visible::before {\n content: "";\n position: absolute;\n inset: -3px;\n border: 2px solid var(--sinch-comp-pagination-color-default-outline-focus);\n border-radius: calc(var(--sinch-comp-pagination-shape-radius) + 3px);\n pointer-events: none;\n }\n\n button:disabled {\n --sinch-global-color-icon:\n var(\n --sinch-comp-pagination-color-disabled-icon-initial\n );\n\n cursor: initial;\n }\n\n button:enabled:hover {\n background-color:\n var(\n --sinch-comp-pagination-color-default-background-hover\n );\n }\n\n button > * {\n display: block;\n overflow: hidden;\n pointer-events: none;\n }\n\n .page {\n font: var(--sinch-comp-pagination-font-default-page-number);\n color: var(--sinch-comp-pagination-color-default-text-initial);\n background-color:\n var(\n --sinch-comp-pagination-color-default-background-initial\n );\n padding: 0 4px;\n box-sizing: border-box;\n }\n\n .page.dots > span {\n display: none;\n }\n\n .page.dots::after {\n content: "...";\n }\n\n .page.active {\n font: var(--sinch-comp-pagination-font-checked-page-number);\n background-color:\n var(\n --sinch-comp-pagination-color-checked-background-initial\n );\n pointer-events: none;\n cursor: initial;\n }\n\n .page.active:hover {\n background-color:\n var(\n --sinch-comp-pagination-color-checked-background-hover\n );\n }\n\n .page.hidden {\n display: none;\n }\n\n #left,\n #right {\n --sinch-icon-size: 24px;\n }\n</style>\n\n<div id="wrapper">\n <button id="left">\n <sinch-icon icons-version="2" name="fa-angle-left" id="icon-left"></sinch-icon>\n </button>\n <button class="page"><span>1</span></button>\n <button class="page active"><span>2</span></button>\n <button class="page"><span>3</span></button>\n <button class="page"><span>4</span></button>\n <button class="page"><span>5</span></button>\n <button class="page dots"><span>6</span></button>\n <button class="page"><span>20</span></button>\n <button id="right">\n <sinch-icon icons-version="2" name="fa-angle-right" id="icon-right"></sinch-icon>\n </button>\n</div>\n';
|
|
1
|
+
import '../icon';
|
|
2
|
+
import { defineCustomElement, updateAttribute, getIntegerAttribute, setClass, NectaryElement, getRect, getReactEventHandler, isTargetEqual, getTargetIndexInParent } from '../utils';
|
|
3
|
+
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 icons-version="2" name="fa-angle-left" id="icon-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 icons-version="2" name="fa-angle-right" id="icon-right"></sinch-icon></button></div>';
|
|
8
4
|
const NUM_BUTTONS = 7;
|
|
9
5
|
const MIDDLE_BTN_INDEX = Math.floor(NUM_BUTTONS / 2);
|
|
10
6
|
const FIRST_BTN_INDEX = 0;
|
|
11
7
|
const LAST_BTN_INDEX = NUM_BUTTONS - 1;
|
|
12
8
|
const DOTS_LEFT_INDEX = 1;
|
|
13
9
|
const DOTS_RIGHT_INDEX = LAST_BTN_INDEX - 1;
|
|
14
|
-
const template = document.createElement(
|
|
10
|
+
const template = document.createElement('template');
|
|
15
11
|
template.innerHTML = templateHTML;
|
|
16
|
-
class Pagination extends NectaryElement {
|
|
12
|
+
export class Pagination extends NectaryElement {
|
|
17
13
|
#$left;
|
|
18
14
|
#$right;
|
|
19
15
|
#$buttons;
|
|
@@ -22,81 +18,75 @@ class Pagination extends NectaryElement {
|
|
|
22
18
|
super();
|
|
23
19
|
const shadowRoot = this.attachShadow();
|
|
24
20
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
25
|
-
this.#$left = shadowRoot.querySelector(
|
|
26
|
-
this.#$right = shadowRoot.querySelector(
|
|
27
|
-
this.#$buttons = shadowRoot.querySelectorAll(
|
|
28
|
-
this.#$wrapper = shadowRoot.querySelector(
|
|
21
|
+
this.#$left = shadowRoot.querySelector('#left');
|
|
22
|
+
this.#$right = shadowRoot.querySelector('#right');
|
|
23
|
+
this.#$buttons = shadowRoot.querySelectorAll('.page');
|
|
24
|
+
this.#$wrapper = shadowRoot.querySelector('#wrapper');
|
|
29
25
|
}
|
|
30
26
|
connectedCallback() {
|
|
31
27
|
this.#onValueChange();
|
|
32
|
-
this.#$wrapper.addEventListener(
|
|
33
|
-
this.addEventListener(
|
|
28
|
+
this.#$wrapper.addEventListener('click', this.#onButtonClick);
|
|
29
|
+
this.addEventListener('-change', this.#onChangeReactHandler);
|
|
34
30
|
}
|
|
35
31
|
disconnectedCallback() {
|
|
36
|
-
this.#$wrapper.removeEventListener(
|
|
37
|
-
this.removeEventListener(
|
|
32
|
+
this.#$wrapper.removeEventListener('click', this.#onButtonClick);
|
|
33
|
+
this.removeEventListener('-change', this.#onChangeReactHandler);
|
|
38
34
|
}
|
|
39
35
|
static get observedAttributes() {
|
|
40
|
-
return [
|
|
36
|
+
return ['max', 'value'];
|
|
41
37
|
}
|
|
42
38
|
attributeChangedCallback(name) {
|
|
43
39
|
switch (name) {
|
|
44
|
-
case
|
|
45
|
-
case
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
40
|
+
case 'value':
|
|
41
|
+
case 'max':
|
|
42
|
+
{
|
|
43
|
+
this.#onValueChange();
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
49
46
|
}
|
|
50
47
|
}
|
|
51
48
|
set value(val) {
|
|
52
|
-
updateAttribute(this,
|
|
49
|
+
updateAttribute(this, 'value', val);
|
|
53
50
|
}
|
|
54
51
|
get value() {
|
|
55
|
-
return getIntegerAttribute(this,
|
|
52
|
+
return getIntegerAttribute(this, 'value', 0);
|
|
56
53
|
}
|
|
57
54
|
set max(val) {
|
|
58
|
-
updateAttribute(this,
|
|
55
|
+
updateAttribute(this, 'max', val);
|
|
59
56
|
}
|
|
60
57
|
get max() {
|
|
61
|
-
return getIntegerAttribute(this,
|
|
58
|
+
return getIntegerAttribute(this, 'value', 0);
|
|
62
59
|
}
|
|
63
60
|
#onValueChange() {
|
|
64
|
-
const value = getIntegerAttribute(this,
|
|
65
|
-
const max = Math.max(0, getIntegerAttribute(this,
|
|
66
|
-
const valueOffset = Math.min(
|
|
67
|
-
Math.max(0, value - MIDDLE_BTN_INDEX),
|
|
68
|
-
Math.max(0, max - NUM_BUTTONS)
|
|
69
|
-
);
|
|
61
|
+
const value = getIntegerAttribute(this, 'value', 0) - 1;
|
|
62
|
+
const max = Math.max(0, getIntegerAttribute(this, 'max', 0));
|
|
63
|
+
const valueOffset = Math.min(Math.max(0, value - MIDDLE_BTN_INDEX), Math.max(0, max - NUM_BUTTONS));
|
|
70
64
|
for (let i = 0; i < this.#$buttons.length; i++) {
|
|
71
65
|
const $b = this.#$buttons[i];
|
|
72
66
|
if (value < 3) {
|
|
73
|
-
setClass($b,
|
|
67
|
+
setClass($b, 'active', value === i);
|
|
74
68
|
} else if (value >= max - MIDDLE_BTN_INDEX) {
|
|
75
|
-
setClass($b,
|
|
69
|
+
setClass($b, 'active', i + valueOffset === value);
|
|
76
70
|
} else {
|
|
77
|
-
setClass($b,
|
|
71
|
+
setClass($b, 'active', i === MIDDLE_BTN_INDEX);
|
|
78
72
|
}
|
|
79
73
|
if (max > NUM_BUTTONS) {
|
|
80
|
-
setClass(
|
|
81
|
-
$b,
|
|
82
|
-
"dots",
|
|
83
|
-
i === DOTS_LEFT_INDEX && value > MIDDLE_BTN_INDEX || i === DOTS_RIGHT_INDEX && value <= max - DOTS_RIGHT_INDEX
|
|
84
|
-
);
|
|
74
|
+
setClass($b, 'dots', i === DOTS_LEFT_INDEX && value > MIDDLE_BTN_INDEX || i === DOTS_RIGHT_INDEX && value <= max - DOTS_RIGHT_INDEX);
|
|
85
75
|
}
|
|
86
|
-
setClass($b,
|
|
76
|
+
setClass($b, 'hidden', i >= max);
|
|
87
77
|
const btnText = $b.firstElementChild;
|
|
88
78
|
if (btnText != null) {
|
|
89
|
-
btnText.textContent = i === FIRST_BTN_INDEX ?
|
|
79
|
+
btnText.textContent = i === FIRST_BTN_INDEX ? '1' : i === LAST_BTN_INDEX ? String(max) : String(i + 1 + valueOffset);
|
|
90
80
|
}
|
|
91
81
|
}
|
|
92
82
|
const isValueBad = value < 0 || value >= max;
|
|
93
83
|
this.#$left.disabled = isValueBad || value === 0;
|
|
94
84
|
this.#$right.disabled = isValueBad || value === max - 1;
|
|
95
85
|
}
|
|
96
|
-
#onButtonClick =
|
|
86
|
+
#onButtonClick = e => {
|
|
97
87
|
e.stopPropagation();
|
|
98
|
-
const value = Math.max(getIntegerAttribute(this,
|
|
99
|
-
const max = Math.max(0, getIntegerAttribute(this,
|
|
88
|
+
const value = Math.max(getIntegerAttribute(this, 'value', 0) - 1);
|
|
89
|
+
const max = Math.max(0, getIntegerAttribute(this, 'max', 0));
|
|
100
90
|
if (isTargetEqual(e, this.#$left)) {
|
|
101
91
|
return this.#dispatchChangeEvent(Math.max(value - 1, 0));
|
|
102
92
|
}
|
|
@@ -115,28 +105,23 @@ class Pagination extends NectaryElement {
|
|
|
115
105
|
return this.#dispatchChangeEvent(Math.floor(value / 2));
|
|
116
106
|
}
|
|
117
107
|
if (btnIndex === DOTS_RIGHT_INDEX && max > NUM_BUTTONS && value <= max - DOTS_RIGHT_INDEX) {
|
|
118
|
-
return this.#dispatchChangeEvent(
|
|
119
|
-
Math.floor((max - value) / 2 + value)
|
|
120
|
-
);
|
|
108
|
+
return this.#dispatchChangeEvent(Math.floor((max - value) / 2 + value));
|
|
121
109
|
}
|
|
122
|
-
return this.#dispatchChangeEvent(
|
|
123
|
-
btnIndex + Math.min(
|
|
124
|
-
Math.max(0, value - MIDDLE_BTN_INDEX),
|
|
125
|
-
Math.max(0, max - NUM_BUTTONS)
|
|
126
|
-
)
|
|
127
|
-
);
|
|
110
|
+
return this.#dispatchChangeEvent(btnIndex + Math.min(Math.max(0, value - MIDDLE_BTN_INDEX), Math.max(0, max - NUM_BUTTONS)));
|
|
128
111
|
}
|
|
129
112
|
};
|
|
130
113
|
#clamp(value) {
|
|
131
|
-
const max = getIntegerAttribute(this,
|
|
114
|
+
const max = getIntegerAttribute(this, 'max', 0);
|
|
132
115
|
return Math.max(0, Math.min(max - 1, value)) + 1;
|
|
133
116
|
}
|
|
134
117
|
#dispatchChangeEvent(value) {
|
|
135
118
|
const detail = this.#clamp(value);
|
|
136
|
-
this.dispatchEvent(new CustomEvent(
|
|
119
|
+
this.dispatchEvent(new CustomEvent('-change', {
|
|
120
|
+
detail
|
|
121
|
+
}));
|
|
137
122
|
}
|
|
138
|
-
#onChangeReactHandler =
|
|
139
|
-
getReactEventHandler(this,
|
|
123
|
+
#onChangeReactHandler = e => {
|
|
124
|
+
getReactEventHandler(this, 'on-change')?.(e);
|
|
140
125
|
};
|
|
141
126
|
get focusable() {
|
|
142
127
|
return true;
|
|
@@ -147,7 +132,7 @@ class Pagination extends NectaryElement {
|
|
|
147
132
|
blur() {
|
|
148
133
|
this.#$left.blur();
|
|
149
134
|
this.#$right.blur();
|
|
150
|
-
this.#$buttons.forEach(
|
|
135
|
+
this.#$buttons.forEach($b => $b.blur());
|
|
151
136
|
}
|
|
152
137
|
get prevButtonRect() {
|
|
153
138
|
return getRect(this.#$left);
|
|
@@ -160,7 +145,4 @@ class Pagination extends NectaryElement {
|
|
|
160
145
|
return btn == null ? null : getRect(btn);
|
|
161
146
|
}
|
|
162
147
|
}
|
|
163
|
-
defineCustomElement(
|
|
164
|
-
export {
|
|
165
|
-
Pagination
|
|
166
|
-
};
|
|
148
|
+
defineCustomElement('sinch-pagination', Pagination);
|
package/pagination/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect
|
|
1
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType, TRect } from '../types';
|
|
2
2
|
export type TSinchPaginationProps = {
|
|
3
3
|
value: number;
|
|
4
4
|
max: number;
|
|
@@ -34,23 +34,3 @@ export type TSinchPagination = {
|
|
|
34
34
|
};
|
|
35
35
|
export type TSinchPaginationElement = NectaryComponentVanillaByType<TSinchPagination>;
|
|
36
36
|
export type TSinchPaginationReact = NectaryComponentReactByType<TSinchPagination>;
|
|
37
|
-
declare global {
|
|
38
|
-
interface NectaryComponentMap {
|
|
39
|
-
'sinch-pagination': TSinchPagination;
|
|
40
|
-
}
|
|
41
|
-
interface HTMLElementTagNameMap {
|
|
42
|
-
'sinch-pagination': NectaryComponentVanilla<'sinch-pagination'>;
|
|
43
|
-
}
|
|
44
|
-
namespace JSX {
|
|
45
|
-
interface IntrinsicElements {
|
|
46
|
-
'sinch-pagination': NectaryComponentReact<'sinch-pagination'>;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
declare module 'react' {
|
|
51
|
-
namespace JSX {
|
|
52
|
-
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
53
|
-
'sinch-pagination': NectaryComponentReact<'sinch-pagination'>;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
package/pagination/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import '../dialog';
|
|
2
2
|
import { NectaryElement } from '../utils';
|
|
3
|
-
|
|
3
|
+
import type { TSinchPersistentOverlay } from './types';
|
|
4
|
+
import type { NectaryComponentReact, NectaryComponentVanilla } from '../types';
|
|
4
5
|
export declare class PersistentOverlay extends NectaryElement {
|
|
5
6
|
#private;
|
|
6
7
|
constructor();
|
|
@@ -13,3 +14,23 @@ export declare class PersistentOverlay extends NectaryElement {
|
|
|
13
14
|
set open(isOpen: boolean);
|
|
14
15
|
get open(): boolean;
|
|
15
16
|
}
|
|
17
|
+
declare global {
|
|
18
|
+
interface NectaryComponentMap {
|
|
19
|
+
'sinch-persistent-overlay': TSinchPersistentOverlay;
|
|
20
|
+
}
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'sinch-persistent-overlay': NectaryComponentVanilla<'sinch-persistent-overlay'>;
|
|
23
|
+
}
|
|
24
|
+
namespace JSX {
|
|
25
|
+
interface IntrinsicElements {
|
|
26
|
+
'sinch-persistent-overlay': NectaryComponentReact<'sinch-persistent-overlay'>;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
declare module 'react' {
|
|
31
|
+
namespace JSX {
|
|
32
|
+
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
33
|
+
'sinch-persistent-overlay': NectaryComponentReact<'sinch-persistent-overlay'>;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const templateHTML = '<style>\n #persisted-dialog {\n --sinch-dialog-close-button-display: none;\n }\n\n ::slotted(*) {\n display: block;\n }\n</style>\n\n<sinch-dialog id="persisted-dialog">\n <div slot="icon"><slot id="icon" name="icon"></slot></div>\n <div slot="content"><slot name="content"></slot></div>\n <div slot="buttons"><slot name="buttons"></slot></div>\n</sinch-dialog>\n';
|
|
6
|
-
const template = document.createElement("template");
|
|
1
|
+
import '../dialog';
|
|
2
|
+
import { defineCustomElement, getAttribute, getBooleanAttribute, updateAttribute, NectaryElement, updateBooleanAttribute, isAttrTrue, getReactEventHandler } from '../utils';
|
|
3
|
+
const templateHTML = '<style>#persisted-dialog{--sinch-dialog-close-button-display:none}::slotted(*){display:block}</style><sinch-dialog id="persisted-dialog"><div slot="icon"><slot id="icon" name="icon"></slot></div><div slot="content"><slot name="content"></slot></div><div slot="buttons"><slot name="buttons"></slot></div></sinch-dialog>';
|
|
4
|
+
const template = document.createElement('template');
|
|
7
5
|
template.innerHTML = templateHTML;
|
|
8
6
|
function isVisible(elementStyle) {
|
|
9
|
-
return elementStyle.visibility ===
|
|
7
|
+
return elementStyle.visibility === 'visible' && elementStyle.display !== 'none';
|
|
10
8
|
}
|
|
11
|
-
const observeDialogVisibilityManipulation = (sinchDialogElement, cb
|
|
9
|
+
const observeDialogVisibilityManipulation = function (sinchDialogElement, cb) {
|
|
10
|
+
let intervalLength = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
12
11
|
const checkInterval = setInterval(() => {
|
|
13
|
-
const dialogElement = sinchDialogElement.shadowRoot?.querySelector(
|
|
14
|
-
if (!isVisible(getComputedStyle(sinchDialogElement)) || sinchDialogElement.open !== true || dialogElement === null || dialogElement ===
|
|
12
|
+
const dialogElement = sinchDialogElement.shadowRoot?.querySelector('dialog');
|
|
13
|
+
if (!isVisible(getComputedStyle(sinchDialogElement)) || sinchDialogElement.open !== true || dialogElement === null || dialogElement === undefined || !isVisible(getComputedStyle(dialogElement)) || dialogElement.open !== true) {
|
|
15
14
|
cb();
|
|
16
15
|
}
|
|
17
16
|
}, intervalLength);
|
|
18
17
|
return checkInterval;
|
|
19
18
|
};
|
|
20
|
-
class PersistentOverlay extends NectaryElement {
|
|
19
|
+
export class PersistentOverlay extends NectaryElement {
|
|
21
20
|
#$sinchDialog;
|
|
22
21
|
#visibilityObserverInterval;
|
|
23
22
|
#controller = null;
|
|
@@ -25,36 +24,42 @@ class PersistentOverlay extends NectaryElement {
|
|
|
25
24
|
super();
|
|
26
25
|
const shadowRoot = this.attachShadow();
|
|
27
26
|
shadowRoot.appendChild(template.content.cloneNode(true));
|
|
28
|
-
this.#$sinchDialog = shadowRoot.querySelector(
|
|
27
|
+
this.#$sinchDialog = shadowRoot.querySelector('#persisted-dialog');
|
|
29
28
|
}
|
|
30
29
|
static get observedAttributes() {
|
|
31
|
-
return [
|
|
30
|
+
return ['caption', 'open'];
|
|
32
31
|
}
|
|
33
32
|
attributeChangedCallback(name, oldVal, newVal) {
|
|
34
33
|
switch (name) {
|
|
35
|
-
case
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
case 'caption':
|
|
35
|
+
{
|
|
36
|
+
updateAttribute(this.#$sinchDialog, 'caption', newVal);
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
case 'open':
|
|
40
|
+
{
|
|
41
|
+
updateAttribute(this.#$sinchDialog, 'open', newVal);
|
|
42
|
+
const shouldOpen = isAttrTrue(newVal);
|
|
43
|
+
if (shouldOpen) {
|
|
44
|
+
requestAnimationFrame(() => {
|
|
45
|
+
this.#startObservingAlteration();
|
|
46
|
+
});
|
|
47
|
+
} else {
|
|
48
|
+
this.#stopObservingAlteration();
|
|
49
|
+
}
|
|
48
50
|
}
|
|
49
|
-
}
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
connectedCallback() {
|
|
53
54
|
super.connectedCallback();
|
|
54
|
-
this.setAttribute(
|
|
55
|
+
this.setAttribute('role', 'dialog');
|
|
55
56
|
this.#controller = new AbortController();
|
|
56
|
-
const {
|
|
57
|
-
|
|
57
|
+
const {
|
|
58
|
+
signal
|
|
59
|
+
} = this.#controller;
|
|
60
|
+
this.addEventListener('-visibility-altered', this.#onVisibilityAlteredReactHandler, {
|
|
61
|
+
signal
|
|
62
|
+
});
|
|
58
63
|
if (this.open) {
|
|
59
64
|
this.#startObservingAlteration();
|
|
60
65
|
}
|
|
@@ -63,21 +68,21 @@ class PersistentOverlay extends NectaryElement {
|
|
|
63
68
|
super.disconnectedCallback();
|
|
64
69
|
this.#controller.abort();
|
|
65
70
|
this.#controller = null;
|
|
66
|
-
if (this.open || this.#visibilityObserverInterval !==
|
|
71
|
+
if (this.open || this.#visibilityObserverInterval !== undefined) {
|
|
67
72
|
this.#onVisibilityAltered();
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
set caption(caption) {
|
|
71
|
-
updateAttribute(this,
|
|
76
|
+
updateAttribute(this, 'caption', caption);
|
|
72
77
|
}
|
|
73
78
|
get caption() {
|
|
74
|
-
return getAttribute(this,
|
|
79
|
+
return getAttribute(this, 'caption', '');
|
|
75
80
|
}
|
|
76
81
|
set open(isOpen) {
|
|
77
|
-
updateBooleanAttribute(this,
|
|
82
|
+
updateBooleanAttribute(this, 'open', isOpen);
|
|
78
83
|
}
|
|
79
84
|
get open() {
|
|
80
|
-
return getBooleanAttribute(this,
|
|
85
|
+
return getBooleanAttribute(this, 'open');
|
|
81
86
|
}
|
|
82
87
|
#startObservingAlteration() {
|
|
83
88
|
this.#visibilityObserverInterval = observeDialogVisibilityManipulation(this.#$sinchDialog, () => {
|
|
@@ -88,13 +93,10 @@ class PersistentOverlay extends NectaryElement {
|
|
|
88
93
|
clearInterval(this.#visibilityObserverInterval);
|
|
89
94
|
}
|
|
90
95
|
#onVisibilityAltered() {
|
|
91
|
-
this.dispatchEvent(new CustomEvent(
|
|
96
|
+
this.dispatchEvent(new CustomEvent('-visibility-altered'));
|
|
92
97
|
}
|
|
93
|
-
#onVisibilityAlteredReactHandler =
|
|
94
|
-
getReactEventHandler(this,
|
|
98
|
+
#onVisibilityAlteredReactHandler = e => {
|
|
99
|
+
getReactEventHandler(this, 'on-visibility-altered')?.(e);
|
|
95
100
|
};
|
|
96
101
|
}
|
|
97
|
-
defineCustomElement(
|
|
98
|
-
export {
|
|
99
|
-
PersistentOverlay
|
|
100
|
-
};
|
|
102
|
+
defineCustomElement('sinch-persistent-overlay', PersistentOverlay);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TSinchDialogProps } from '../dialog/types';
|
|
2
|
-
import type { NectaryComponentReactByType, NectaryComponentVanillaByType
|
|
2
|
+
import type { NectaryComponentReactByType, NectaryComponentVanillaByType } from '../types';
|
|
3
3
|
export type TSinchPersistentOverlayProps = {
|
|
4
4
|
/** Controls whether the dialog should be open */
|
|
5
5
|
open: TSinchDialogProps['open'];
|
|
@@ -22,23 +22,3 @@ export type TSinchPersistentOverlay = {
|
|
|
22
22
|
};
|
|
23
23
|
export type TSinchPersistentOverlayElement = NectaryComponentVanillaByType<TSinchPersistentOverlay>;
|
|
24
24
|
export type TSinchPersistentOverlayReact = NectaryComponentReactByType<TSinchPersistentOverlay>;
|
|
25
|
-
declare global {
|
|
26
|
-
interface NectaryComponentMap {
|
|
27
|
-
'sinch-persistent-overlay': TSinchPersistentOverlay;
|
|
28
|
-
}
|
|
29
|
-
interface HTMLElementTagNameMap {
|
|
30
|
-
'sinch-persistent-overlay': NectaryComponentVanilla<'sinch-persistent-overlay'>;
|
|
31
|
-
}
|
|
32
|
-
namespace JSX {
|
|
33
|
-
interface IntrinsicElements {
|
|
34
|
-
'sinch-persistent-overlay': NectaryComponentReact<'sinch-persistent-overlay'>;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
declare module 'react' {
|
|
39
|
-
namespace JSX {
|
|
40
|
-
interface IntrinsicElements extends globalThis.JSX.IntrinsicElements {
|
|
41
|
-
'sinch-persistent-overlay': NectaryComponentReact<'sinch-persistent-overlay'>;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export {};
|