@skf-design-system/ui-components 1.0.0-alpha.34 → 1.0.0-alpha.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -27
- package/custom-elements.json +25490 -0
- package/dist/components/accordion/accordion-item.component.d.ts +36 -0
- package/dist/components/accordion/accordion-item.component.js +98 -0
- package/dist/components/accordion/accordion-item.d.ts +3 -3
- package/dist/components/accordion/accordion-item.js +4 -5
- package/dist/components/accordion/accordion-item.styles.js +77 -0
- package/dist/components/accordion/accordion.component.d.ts +10 -14
- package/dist/components/accordion/accordion.component.js +10 -11
- package/dist/components/accordion/accordion.d.ts +0 -1
- package/dist/components/accordion/accordion.js +0 -2
- package/dist/components/alert/alert.component.d.ts +12 -12
- package/dist/components/alert/alert.component.js +57 -55
- package/dist/components/alert/alert.styles.js +50 -51
- package/dist/components/breadcrumb/breadcrumb-item.component.js +60 -0
- package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb-item.js +6 -0
- package/dist/components/breadcrumb/breadcrumb-item.styles.js +63 -0
- package/dist/components/breadcrumb/breadcrumb.component.d.ts +7 -4
- package/dist/components/breadcrumb/breadcrumb.component.js +65 -0
- package/dist/components/breadcrumb/breadcrumb.d.ts +2 -2
- package/dist/components/breadcrumb/breadcrumb.js +6 -0
- package/dist/components/breadcrumb/breadcrumb.styles.js +25 -0
- package/dist/components/button/button.component.d.ts +17 -14
- package/dist/components/button/button.component.js +73 -61
- package/dist/components/button/button.styles.d.ts +1 -2
- package/dist/components/button/button.styles.js +13 -3
- package/dist/components/card/card.component.d.ts +6 -1
- package/dist/components/card/card.component.js +46 -36
- package/dist/components/card/card.styles.js +37 -23
- package/dist/components/checkbox/checkbox.component.d.ts +17 -13
- package/dist/components/checkbox/checkbox.component.js +74 -61
- package/dist/components/checkbox/checkbox.styles.d.ts +1 -2
- package/dist/components/checkbox/checkbox.styles.js +1 -5
- package/dist/components/datepicker/datepicker-calendar.component.d.ts +80 -0
- package/dist/components/datepicker/datepicker-calendar.component.js +415 -0
- package/dist/components/datepicker/datepicker-calendar.d.ts +8 -0
- package/dist/components/datepicker/datepicker-calendar.js +6 -0
- package/dist/components/datepicker/datepicker-calendar.styles.js +202 -0
- package/dist/components/datepicker/datepicker-popup.component.d.ts +64 -0
- package/dist/components/datepicker/datepicker-popup.component.js +261 -0
- package/dist/components/datepicker/datepicker-popup.d.ts +8 -0
- package/dist/components/datepicker/datepicker-popup.helpers.d.ts +41 -0
- package/dist/components/datepicker/datepicker-popup.helpers.js +83 -0
- package/dist/components/datepicker/datepicker-popup.js +6 -0
- package/dist/components/datepicker/datepicker-popup.styles.js +87 -0
- package/dist/components/datepicker/datepicker.component.d.ts +121 -0
- package/dist/components/datepicker/datepicker.component.js +456 -0
- package/dist/components/datepicker/datepicker.d.ts +8 -0
- package/dist/components/datepicker/datepicker.helpers.d.ts +38 -0
- package/dist/components/datepicker/datepicker.helpers.js +31 -0
- package/dist/components/datepicker/datepicker.js +6 -0
- package/dist/components/datepicker/datepicker.styles.d.ts +1 -0
- package/dist/components/datepicker/datepicker.styles.js +18 -0
- package/dist/components/dialog/dialog.component.d.ts +20 -29
- package/dist/components/dialog/dialog.component.js +85 -75
- package/dist/components/dialog/dialog.d.ts +2 -2
- package/dist/components/dialog/dialog.styles.js +4 -4
- package/dist/components/divider/divider.component.d.ts +4 -8
- package/dist/components/divider/divider.component.js +24 -46
- package/dist/components/divider/divider.styles.js +34 -30
- package/dist/components/drawer/drawer.component.d.ts +61 -0
- package/dist/components/drawer/drawer.component.js +125 -0
- package/dist/components/drawer/drawer.d.ts +8 -0
- package/dist/components/drawer/drawer.js +6 -0
- package/dist/components/drawer/drawer.styles.js +71 -0
- package/dist/components/header/header.component.d.ts +46 -0
- package/dist/components/header/header.component.js +116 -0
- package/dist/components/header/header.d.ts +8 -0
- package/dist/components/header/header.js +6 -0
- package/dist/components/header/header.styles.js +68 -0
- package/dist/components/heading/heading.component.d.ts +8 -12
- package/dist/components/heading/heading.component.js +52 -24
- package/dist/components/heading/heading.styles.d.ts +1 -2
- package/dist/components/heading/heading.styles.js +35 -37
- package/dist/components/icon/icon.component.d.ts +15 -17
- package/dist/components/icon/icon.component.js +52 -43
- package/dist/components/icon/icon.styles.d.ts +1 -2
- package/dist/components/icon/icon.styles.js +60 -60
- package/dist/components/input/input.component.d.ts +31 -31
- package/dist/components/input/input.component.js +167 -146
- package/dist/components/input/input.controllers.d.ts +20 -6
- package/dist/components/input/input.controllers.js +14 -10
- package/dist/components/link/link.component.d.ts +20 -25
- package/dist/components/link/link.component.js +99 -107
- package/dist/components/link/link.styles.d.ts +1 -2
- package/dist/components/link/link.styles.js +47 -43
- package/dist/components/loader/loader.component.d.ts +1 -1
- package/dist/components/loader/loader.component.js +36 -40
- package/dist/components/loader/loader.styles.d.ts +1 -2
- package/dist/components/loader/loader.styles.js +40 -32
- package/dist/components/logo/logo.component.d.ts +8 -6
- package/dist/components/logo/logo.component.js +55 -51
- package/dist/components/logo/logo.styles.js +26 -16
- package/dist/components/menu/menu-item.component.d.ts +13 -0
- package/dist/components/menu/menu-item.component.js +13 -0
- package/dist/components/{menu-item → menu}/menu-item.d.ts +2 -2
- package/dist/components/{menu-item → menu}/menu-item.styles.js +8 -5
- package/dist/components/menu/menu.component.d.ts +10 -8
- package/dist/components/menu/menu.component.js +8 -10
- package/dist/components/menu/menu.d.ts +2 -2
- package/dist/components/nav/nav-item.component.d.ts +22 -0
- package/dist/components/nav/nav-item.component.js +57 -0
- package/dist/components/nav/nav-item.d.ts +8 -0
- package/dist/components/nav/nav-item.js +6 -0
- package/dist/components/nav/nav-item.styles.js +43 -0
- package/dist/components/nav/nav.component.d.ts +23 -0
- package/dist/components/nav/nav.component.js +55 -0
- package/dist/components/nav/nav.d.ts +8 -0
- package/dist/components/nav/nav.js +6 -0
- package/dist/components/nav/nav.styles.js +23 -0
- package/dist/components/popover/popover.component.d.ts +15 -8
- package/dist/components/popover/popover.component.js +29 -23
- package/dist/components/popover/popover.d.ts +2 -2
- package/dist/components/progress/progress.component.d.ts +4 -2
- package/dist/components/progress/progress.component.js +38 -35
- package/dist/components/progress/progress.d.ts +2 -2
- package/dist/components/progress/progress.styles.js +40 -33
- package/dist/components/radio/radio.component.d.ts +19 -13
- package/dist/components/radio/radio.component.js +12 -12
- package/dist/components/radio/radio.styles.d.ts +1 -2
- package/dist/components/radio/radio.styles.js +1 -1
- package/dist/components/segmented-button/segmented-button-item.component.d.ts +36 -0
- package/dist/components/segmented-button/segmented-button-item.component.js +56 -0
- package/dist/components/segmented-button/segmented-button-item.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button-item.js +6 -0
- package/dist/components/segmented-button/segmented-button-item.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button-item.styles.js +62 -0
- package/dist/components/segmented-button/segmented-button.component.d.ts +30 -0
- package/dist/components/segmented-button/segmented-button.component.js +73 -0
- package/dist/components/segmented-button/segmented-button.d.ts +8 -0
- package/dist/components/segmented-button/segmented-button.js +6 -0
- package/dist/components/segmented-button/segmented-button.styles.d.ts +1 -0
- package/dist/components/segmented-button/segmented-button.styles.js +16 -0
- package/dist/components/{select-option-group → select}/select-option-group.component.d.ts +4 -0
- package/dist/components/select/select-option-group.component.js +50 -0
- package/dist/components/{select-option-group → select}/select-option-group.d.ts +2 -2
- package/dist/components/select/select-option-group.style.d.ts +1 -0
- package/dist/components/select/select-option-group.style.js +24 -0
- package/dist/components/{select-option → select}/select-option.component.d.ts +14 -11
- package/dist/components/select/select-option.component.js +140 -0
- package/dist/components/select/select-option.controllers.d.ts +15 -0
- package/dist/components/select/select-option.styles.d.ts +1 -0
- package/dist/components/select/select-option.styles.js +65 -0
- package/dist/components/select/select.component.d.ts +22 -17
- package/dist/components/select/select.component.js +62 -45
- package/dist/components/select/select.controllers.d.ts +21 -10
- package/dist/components/select/select.controllers.js +29 -23
- package/dist/components/select/stories/select.stories.icons.d.ts +7 -0
- package/dist/components/{stepper-item → stepper}/stepper-item.component.js +48 -48
- package/dist/components/{stepper-item → stepper}/stepper-item.d.ts +2 -2
- package/dist/components/stepper/stepper-item.styles.d.ts +1 -0
- package/dist/components/stepper/stepper.component.d.ts +4 -3
- package/dist/components/stepper/stepper.component.js +15 -15
- package/dist/components/stepper/stepper.d.ts +2 -2
- package/dist/components/stepper/stepper.helpers.d.ts +1 -1
- package/dist/components/switch/switch.component.d.ts +7 -6
- package/dist/components/switch/switch.component.js +21 -21
- package/dist/components/switch/switch.d.ts +2 -2
- package/dist/components/{tab-panel → tabs}/tab-panel.component.js +1 -1
- package/dist/components/{tab-panel → tabs}/tab-panel.d.ts +2 -2
- package/dist/components/tabs/tab-panel.styles.d.ts +1 -0
- package/dist/components/{tab → tabs}/tab.component.d.ts +2 -2
- package/dist/components/{tab → tabs}/tab.component.js +1 -1
- package/dist/components/{tab → tabs}/tab.d.ts +2 -2
- package/dist/components/tabs/tab.styles.d.ts +1 -0
- package/dist/components/{tab-group/tab-group.component.d.ts → tabs/tabs.component.d.ts} +3 -4
- package/dist/components/{tab-group/tab-group.component.js → tabs/tabs.component.js} +36 -37
- package/dist/components/tabs/tabs.d.ts +8 -0
- package/dist/components/tabs/tabs.js +6 -0
- package/dist/components/tabs/tabs.styles.d.ts +1 -0
- package/dist/components/{tab-group/tab-group.styles.js → tabs/tabs.styles.js} +16 -16
- package/dist/components/tag/tag.component.d.ts +20 -17
- package/dist/components/tag/tag.component.js +68 -67
- package/dist/components/tag/tag.d.ts +2 -2
- package/dist/components/tag/tag.styles.js +63 -50
- package/dist/components/textarea/textarea.component.d.ts +10 -11
- package/dist/components/textarea/textarea.component.js +67 -68
- package/dist/components/{toast-item → toast}/toast-item.component.js +15 -15
- package/dist/components/{toast-item → toast}/toast-item.d.ts +2 -0
- package/dist/components/{toast-item → toast}/toast-item.js +4 -0
- package/dist/components/toast/toast-item.styles.js +18 -0
- package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.js +1 -1
- package/dist/components/toast/toast-wrapper.styles.d.ts +1 -0
- package/dist/components/toast/toast.component.d.ts +9 -5
- package/dist/components/toast/toast.component.js +31 -27
- package/dist/components/toast/toast.singleton.d.ts +7 -12
- package/dist/components/toast/toast.singleton.js +26 -26
- package/dist/components/tooltip/tooltip.component.d.ts +7 -7
- package/dist/components/tooltip/tooltip.component.js +16 -11
- package/dist/components/tooltip/tooltip.d.ts +2 -2
- package/dist/custom-elements.json +3980 -2348
- package/dist/index.d.ts +22 -9
- package/dist/index.js +111 -74
- package/dist/internal/base-classes/popover/popover.base.d.ts +24 -9
- package/dist/internal/base-classes/popover/popover.base.js +140 -79
- package/dist/internal/base-classes/popover/popover.styles.js +17 -5
- package/dist/internal/components/hint/hint.component.d.ts +6 -2
- package/dist/internal/components/hint/hint.component.js +47 -20
- package/dist/internal/components/hint/hint.styles.d.ts +1 -2
- package/dist/internal/components/hint/hint.styles.js +30 -26
- package/dist/internal/components/skf-element.d.ts +1 -3
- package/dist/internal/components/skf-element.js +4 -9
- package/dist/internal/constants/iconSeverity.d.ts +3 -2
- package/dist/internal/constants/iconSeverity.js +2 -3
- package/dist/internal/controllers/elementOverflowController.d.ts +13 -0
- package/dist/internal/controllers/popover.controller.d.ts +12 -6
- package/dist/internal/controllers/popover.controller.js +9 -14
- package/dist/internal/helpers/dateFormatter.d.ts +2 -0
- package/dist/internal/helpers/hintSeverity.d.ts +2 -2
- package/dist/internal/helpers/hintSeverity.js +1 -1
- package/dist/internal/helpers/stateMap.d.ts +14 -0
- package/dist/internal/helpers/stateMap.js +68 -0
- package/dist/internal/helpers/utilityTypes.d.ts +22 -0
- package/dist/internal/helpers/uuid.d.ts +15 -0
- package/dist/internal/helpers/uuid.js +14 -0
- package/dist/internal/helpers/watch.d.ts +1 -1
- package/dist/internal/helpers/watch.js +12 -12
- package/dist/internal/storybook/styles.d.ts +1 -0
- package/dist/internal/types/formField.d.ts +1 -1
- package/dist/internal/types.d.ts +18 -0
- package/dist/styles/component.styles.d.ts +1 -2
- package/dist/styles/component.styles.js +38 -37
- package/dist/styles/form-field.styles.js +11 -6
- package/dist/styles/global-alt.css +1 -0
- package/dist/styles/global.css +1 -1
- package/dist/types/jsx/custom-element-jsx.d.ts +871 -1307
- package/dist/types/vue/index.d.ts +593 -360
- package/dist/vscode.html-custom-data.json +630 -1184
- package/dist/web-types.json +1422 -945
- package/package.json +47 -63
- package/dist/components/accordion/accordion.test.d.ts +0 -1
- package/dist/components/checkbox/checkbox.test.d.ts +0 -1
- package/dist/components/collapse/collapse.component.d.ts +0 -40
- package/dist/components/collapse/collapse.component.js +0 -86
- package/dist/components/collapse/collapse.d.ts +0 -8
- package/dist/components/collapse/collapse.js +0 -6
- package/dist/components/collapse/collapse.styles.d.ts +0 -2
- package/dist/components/collapse/collapse.styles.js +0 -77
- package/dist/components/collapse/collapse.test.d.ts +0 -1
- package/dist/components/input/input.test.d.ts +0 -1
- package/dist/components/menu-item/menu-item.component.d.ts +0 -25
- package/dist/components/menu-item/menu-item.component.js +0 -13
- package/dist/components/radio/radio.test.d.ts +0 -1
- package/dist/components/select-option/select-option.component.js +0 -123
- package/dist/components/select-option/select-option.controllers.d.ts +0 -9
- package/dist/components/select-option/select-option.styles.js +0 -53
- package/dist/components/select-option-group/select-option-group.component.js +0 -31
- package/dist/components/select-option-group/select-option-group.style.js +0 -18
- package/dist/components/switch/switch.test.d.ts +0 -1
- package/dist/components/tab-group/tab-group.d.ts +0 -8
- package/dist/components/tab-group/tab-group.js +0 -6
- package/dist/components/toast-item/toast-item.styles.js +0 -16
- package/dist/internal/constants/heading.d.ts +0 -2
- package/dist/internal/playwright/index.d.ts +0 -1
- package/dist/react/index.d.ts +0 -35
- package/dist/react/index.js +0 -35
- package/dist/react/skf-accordion/index.d.ts +0 -3
- package/dist/react/skf-accordion/index.js +0 -13
- package/dist/react/skf-alert/index.d.ts +0 -9
- package/dist/react/skf-alert/index.js +0 -17
- package/dist/react/skf-breadcrumb/index.d.ts +0 -9
- package/dist/react/skf-breadcrumb/index.js +0 -17
- package/dist/react/skf-breadcrumb-item/index.d.ts +0 -3
- package/dist/react/skf-breadcrumb-item/index.js +0 -13
- package/dist/react/skf-button/index.d.ts +0 -9
- package/dist/react/skf-button/index.js +0 -17
- package/dist/react/skf-card/index.d.ts +0 -3
- package/dist/react/skf-card/index.js +0 -13
- package/dist/react/skf-checkbox/index.d.ts +0 -9
- package/dist/react/skf-checkbox/index.js +0 -17
- package/dist/react/skf-collapse/index.d.ts +0 -9
- package/dist/react/skf-collapse/index.js +0 -17
- package/dist/react/skf-dialog/index.d.ts +0 -15
- package/dist/react/skf-dialog/index.js +0 -19
- package/dist/react/skf-divider/index.d.ts +0 -3
- package/dist/react/skf-divider/index.js +0 -13
- package/dist/react/skf-heading/index.d.ts +0 -3
- package/dist/react/skf-heading/index.js +0 -13
- package/dist/react/skf-icon/index.d.ts +0 -3
- package/dist/react/skf-icon/index.js +0 -13
- package/dist/react/skf-input/index.d.ts +0 -12
- package/dist/react/skf-input/index.js +0 -18
- package/dist/react/skf-link/index.d.ts +0 -3
- package/dist/react/skf-link/index.js +0 -13
- package/dist/react/skf-loader/index.d.ts +0 -3
- package/dist/react/skf-loader/index.js +0 -13
- package/dist/react/skf-logo/index.d.ts +0 -3
- package/dist/react/skf-logo/index.js +0 -13
- package/dist/react/skf-menu/index.d.ts +0 -12
- package/dist/react/skf-menu/index.js +0 -18
- package/dist/react/skf-menu-item/index.d.ts +0 -27
- package/dist/react/skf-menu-item/index.js +0 -23
- package/dist/react/skf-popover/index.d.ts +0 -12
- package/dist/react/skf-popover/index.js +0 -18
- package/dist/react/skf-progress/index.d.ts +0 -3
- package/dist/react/skf-progress/index.js +0 -13
- package/dist/react/skf-radio/index.d.ts +0 -9
- package/dist/react/skf-radio/index.js +0 -17
- package/dist/react/skf-select/index.d.ts +0 -21
- package/dist/react/skf-select/index.js +0 -21
- package/dist/react/skf-select-option/index.d.ts +0 -9
- package/dist/react/skf-select-option/index.js +0 -17
- package/dist/react/skf-select-option-group/index.d.ts +0 -3
- package/dist/react/skf-select-option-group/index.js +0 -13
- package/dist/react/skf-stepper/index.d.ts +0 -9
- package/dist/react/skf-stepper/index.js +0 -17
- package/dist/react/skf-stepper-item/index.d.ts +0 -9
- package/dist/react/skf-stepper-item/index.js +0 -17
- package/dist/react/skf-switch/index.d.ts +0 -3
- package/dist/react/skf-switch/index.js +0 -13
- package/dist/react/skf-tab/index.d.ts +0 -12
- package/dist/react/skf-tab/index.js +0 -18
- package/dist/react/skf-tab-group/index.d.ts +0 -3
- package/dist/react/skf-tab-group/index.js +0 -13
- package/dist/react/skf-tab-panel/index.d.ts +0 -3
- package/dist/react/skf-tab-panel/index.js +0 -13
- package/dist/react/skf-tag/index.d.ts +0 -3
- package/dist/react/skf-tag/index.js +0 -13
- package/dist/react/skf-textarea/index.d.ts +0 -12
- package/dist/react/skf-textarea/index.js +0 -18
- package/dist/react/skf-toast/index.d.ts +0 -3
- package/dist/react/skf-toast/index.js +0 -13
- package/dist/react/skf-toast-wrapper/index.d.ts +0 -3
- package/dist/react/skf-toast-wrapper/index.js +0 -13
- package/dist/react/skf-tooltip/index.d.ts +0 -12
- package/dist/react/skf-tooltip/index.js +0 -18
- /package/dist/components/{breadcrumb-item/breadcrumb-item.styles.d.ts → accordion/accordion-item.styles.d.ts} +0 -0
- /package/dist/components/{breadcrumb-item → breadcrumb}/breadcrumb-item.component.d.ts +0 -0
- /package/dist/components/{menu-item/menu-item.styles.d.ts → breadcrumb/breadcrumb-item.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group/select-option-group.style.d.ts → datepicker/datepicker-calendar.styles.d.ts} +0 -0
- /package/dist/components/{select-option/select-option.styles.d.ts → datepicker/datepicker-popup.styles.d.ts} +0 -0
- /package/dist/components/{stepper-item/stepper-item.styles.d.ts → drawer/drawer.styles.d.ts} +0 -0
- /package/dist/components/{tab-group/tab-group.styles.d.ts → header/header.styles.d.ts} +0 -0
- /package/dist/components/{menu-item → menu}/menu-item.js +0 -0
- /package/dist/components/{tab-panel/tab-panel.styles.d.ts → menu/menu-item.styles.d.ts} +0 -0
- /package/dist/components/{tab/tab.styles.d.ts → nav/nav-item.styles.d.ts} +0 -0
- /package/dist/components/{toast-wrapper/toast-wrapper.styles.d.ts → nav/nav.styles.d.ts} +0 -0
- /package/dist/components/{select-option-group → select}/select-option-group.js +0 -0
- /package/dist/components/{select-option → select}/select-option.d.ts +0 -0
- /package/dist/components/{select-option → select}/select-option.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.component.d.ts +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.js +0 -0
- /package/dist/components/{stepper-item → stepper}/stepper-item.styles.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.component.d.ts +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.js +0 -0
- /package/dist/components/{tab-panel → tabs}/tab-panel.styles.js +0 -0
- /package/dist/components/{tab → tabs}/tab.js +0 -0
- /package/dist/components/{tab → tabs}/tab.styles.js +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.component.d.ts +0 -0
- /package/dist/components/{toast-item → toast}/toast-item.styles.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.component.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.d.ts +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.js +0 -0
- /package/dist/components/{toast-wrapper → toast}/toast-wrapper.styles.js +0 -0
@@ -0,0 +1,73 @@
|
|
1
|
+
import { SkfElement as d } from "../../internal/components/skf-element.js";
|
2
|
+
import { componentStyles as m } from "../../styles/component.styles.js";
|
3
|
+
import { html as c } from "lit";
|
4
|
+
import { property as u, state as f, queryAssignedElements as p } from "lit/decorators.js";
|
5
|
+
import { ifDefined as g } from "lit/directives/if-defined.js";
|
6
|
+
import { styles as y } from "./segmented-button.styles.js";
|
7
|
+
var v = Object.defineProperty, n = (a, s, e, i) => {
|
8
|
+
for (var t = void 0, o = a.length - 1, r; o >= 0; o--)
|
9
|
+
(r = a[o]) && (t = r(s, e, t) || t);
|
10
|
+
return t && v(s, e, t), t;
|
11
|
+
};
|
12
|
+
const h = class h extends d {
|
13
|
+
constructor() {
|
14
|
+
super(...arguments), this.multiple = !1, this.value = "", this._handleSegmentedButtonItemSelected = (s) => {
|
15
|
+
const e = s.detail.item;
|
16
|
+
this.multiple && (e.selected = !e.selected), this.value = "";
|
17
|
+
let i = [];
|
18
|
+
this.items.forEach((t) => {
|
19
|
+
this.multiple ? t.selected && (i = [...i, t.value], this.value = i.join()) : t !== e ? t.selected = !1 : (t.selected = !0, this.value = t.value);
|
20
|
+
});
|
21
|
+
}, this._handleSlotChange = () => {
|
22
|
+
this.items.forEach((s) => {
|
23
|
+
if (s.isMultiple = this.multiple, !this.multiple) {
|
24
|
+
const e = this.items.filter((i) => i.selected);
|
25
|
+
e.length > 1 && e.slice(0, -1).forEach((i) => i.selected = !1);
|
26
|
+
}
|
27
|
+
});
|
28
|
+
}, this._handleKeyDown = (s) => {
|
29
|
+
if (["ArrowLeft", "ArrowRight"].includes(s.key)) {
|
30
|
+
const e = this._getKeyDownNextItem(s.key);
|
31
|
+
e == null || e.focus({ preventScroll: !0 });
|
32
|
+
}
|
33
|
+
};
|
34
|
+
}
|
35
|
+
firstUpdated() {
|
36
|
+
this.addEventListener(
|
37
|
+
"skf-segmented-button-item-select",
|
38
|
+
this._handleSegmentedButtonItemSelected
|
39
|
+
);
|
40
|
+
}
|
41
|
+
/** @internal */
|
42
|
+
_getKeyDownNextItem(s) {
|
43
|
+
const e = this.items.findIndex((r) => r === document.activeElement);
|
44
|
+
if (e === -1) return;
|
45
|
+
const t = (e + (s === "ArrowRight" ? 1 : -1)) % this.items.length;
|
46
|
+
return this.items[t < 0 ? this.items.length - 1 : t];
|
47
|
+
}
|
48
|
+
render() {
|
49
|
+
return c`
|
50
|
+
<slot
|
51
|
+
@keydown=${this._handleKeyDown}
|
52
|
+
@slotchange=${this._handleSlotChange}
|
53
|
+
aria-label=${g(this.ariaLabel ?? "Segmented button label")}
|
54
|
+
id="root"
|
55
|
+
role=${this.multiple ? "group" : "radiogroup"}
|
56
|
+
></slot>
|
57
|
+
`;
|
58
|
+
}
|
59
|
+
};
|
60
|
+
h.styles = [m, y];
|
61
|
+
let l = h;
|
62
|
+
n([
|
63
|
+
u({ type: Boolean })
|
64
|
+
], l.prototype, "multiple");
|
65
|
+
n([
|
66
|
+
f()
|
67
|
+
], l.prototype, "value");
|
68
|
+
n([
|
69
|
+
p()
|
70
|
+
], l.prototype, "items");
|
71
|
+
export {
|
72
|
+
l as SkfSegmentedButton
|
73
|
+
};
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { SkfSegmentedButton } from './segmented-button.component.js';
|
2
|
+
export * from './segmented-button.component.js';
|
3
|
+
export default SkfSegmentedButton;
|
4
|
+
declare global {
|
5
|
+
interface HTMLElementTagNameMap {
|
6
|
+
'skf-segmented-button': SkfSegmentedButton;
|
7
|
+
}
|
8
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { css as r } from "lit";
|
2
|
+
const o = r`
|
3
|
+
@layer components {
|
4
|
+
#root {
|
5
|
+
block-size: var(--skf-size-44);
|
6
|
+
border: var(--skf-border-width-sm) solid var(--skf-border-color-primary);
|
7
|
+
border-radius: 6px; /* TODO: Missing token */
|
8
|
+
display: flex;
|
9
|
+
gap: var(--skf-spacing-75);
|
10
|
+
padding: var(--skf-spacing-25);
|
11
|
+
}
|
12
|
+
}
|
13
|
+
`;
|
14
|
+
export {
|
15
|
+
o as styles
|
16
|
+
};
|
@@ -10,7 +10,11 @@ import { type CSSResultGroup } from 'lit';
|
|
10
10
|
* @tagname skf-select-option-group
|
11
11
|
*/
|
12
12
|
export declare class SkfSelectOptionGroup extends SkfElement {
|
13
|
+
#private;
|
13
14
|
static styles: CSSResultGroup;
|
14
15
|
label: string;
|
16
|
+
small: boolean;
|
17
|
+
/** @internal */
|
18
|
+
_handleStateChange(): void;
|
15
19
|
render(): import("lit").TemplateResult<1>;
|
16
20
|
}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
var b = (t) => {
|
2
|
+
throw TypeError(t);
|
3
|
+
};
|
4
|
+
var d = (t, e, s) => e.has(t) || b("Cannot " + s);
|
5
|
+
var h = (t, e, s) => (d(t, e, "read from private field"), s ? s.call(t) : e.get(t)), n = (t, e, s) => e.has(t) ? b("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), f = (t, e, s, r) => (d(t, e, "write to private field"), r ? r.call(t, s) : e.set(t, s), s);
|
6
|
+
import { SkfElement as u } from "../../internal/components/skf-element.js";
|
7
|
+
import { stateMap as y } from "../../internal/helpers/stateMap.js";
|
8
|
+
import { watch as _ } from "../../internal/helpers/watch.js";
|
9
|
+
import { componentStyles as g } from "../../styles/component.styles.js";
|
10
|
+
import { html as P } from "lit";
|
11
|
+
import { property as w, state as C } from "lit/decorators.js";
|
12
|
+
import { styles as D } from "./select-option-group.style.js";
|
13
|
+
var j = Object.defineProperty, x = Object.getOwnPropertyDescriptor, v = (t, e, s, r) => {
|
14
|
+
for (var l = r > 1 ? void 0 : r ? x(e, s) : e, i = t.length - 1, p; i >= 0; i--)
|
15
|
+
(p = t[i]) && (l = (r ? p(e, s, l) : p(l)) || l);
|
16
|
+
return r && l && j(e, s, l), l;
|
17
|
+
}, o, m;
|
18
|
+
const c = class c extends u {
|
19
|
+
constructor() {
|
20
|
+
super(...arguments);
|
21
|
+
n(this, o);
|
22
|
+
n(this, m);
|
23
|
+
f(this, o, this.attachInternals()), f(this, m, h(this, o).states), this.label = "Default label", this.small = !1;
|
24
|
+
}
|
25
|
+
_handleStateChange() {
|
26
|
+
y(h(this, m), "small").set(this.small);
|
27
|
+
}
|
28
|
+
render() {
|
29
|
+
return P`
|
30
|
+
<div role="group">
|
31
|
+
<div id="label">${this.label}</div>
|
32
|
+
<slot></slot>
|
33
|
+
</div>
|
34
|
+
`;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
o = new WeakMap(), m = new WeakMap(), c.styles = [g, D];
|
38
|
+
let a = c;
|
39
|
+
v([
|
40
|
+
w({ reflect: !0 })
|
41
|
+
], a.prototype, "label", 2);
|
42
|
+
v([
|
43
|
+
C()
|
44
|
+
], a.prototype, "small", 2);
|
45
|
+
v([
|
46
|
+
_("small")
|
47
|
+
], a.prototype, "_handleStateChange", 1);
|
48
|
+
export {
|
49
|
+
a as SkfSelectOptionGroup
|
50
|
+
};
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { SkfSelectOptionGroup } from './select-option-group.component';
|
2
|
-
export * from './select-option-group.component';
|
1
|
+
import { SkfSelectOptionGroup } from './select-option-group.component.js';
|
2
|
+
export * from './select-option-group.component.js';
|
3
3
|
export default SkfSelectOptionGroup;
|
4
4
|
declare global {
|
5
5
|
interface HTMLElementTagNameMap {
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { css as e } from "lit";
|
2
|
+
const t = e`
|
3
|
+
@layer components {
|
4
|
+
@layer base {
|
5
|
+
#label {
|
6
|
+
--_skf-select-option-group-height: var(--skf-size-44);
|
7
|
+
|
8
|
+
align-items: center;
|
9
|
+
block-size: var(--_skf-select-option-group-height);
|
10
|
+
display: flex;
|
11
|
+
font-weight: var(--skf-font-weight-bold);
|
12
|
+
}
|
13
|
+
}
|
14
|
+
|
15
|
+
@layer mods {
|
16
|
+
:host(:state(small)) #label {
|
17
|
+
--_skf-select-option-group-height: var(--skf-size-32);
|
18
|
+
}
|
19
|
+
}
|
20
|
+
}
|
21
|
+
`;
|
22
|
+
export {
|
23
|
+
t as styles
|
24
|
+
};
|
@@ -1,9 +1,8 @@
|
|
1
|
+
import '../icon/icon.js';
|
1
2
|
import { SkfElement } from '../../internal/components/skf-element.js';
|
2
|
-
import type {
|
3
|
+
import type { Icon, IconColor } from '../../internal/types.js';
|
3
4
|
import { type CSSResultGroup } from 'lit';
|
4
|
-
import '
|
5
|
-
import { SkfIcon } from '../icon/icon';
|
6
|
-
import type { SkfSelect } from '../select/select.component.js';
|
5
|
+
import type { SkfSelect } from './select.component.js';
|
7
6
|
export interface SelectOptionEvent {
|
8
7
|
value: string | null;
|
9
8
|
option: SkfSelectOption;
|
@@ -16,11 +15,12 @@ export interface SelectOptionEvent {
|
|
16
15
|
* @slot - The option's text content
|
17
16
|
* @slot icon - The option's slot for icon or custom meta information (svg).
|
18
17
|
*
|
19
|
-
* @event skf-select-option
|
18
|
+
* @event skf-select-option-select - {detail: { value: string | null, option: SkfSelectOption }} Fires when the option is selected/deselected.
|
20
19
|
*
|
21
20
|
* @tagname skf-select-option
|
22
21
|
*/
|
23
22
|
export declare class SkfSelectOption extends SkfElement {
|
23
|
+
#private;
|
24
24
|
static styles: CSSResultGroup;
|
25
25
|
static shadowRootOptions: {
|
26
26
|
delegatesFocus: boolean;
|
@@ -37,15 +37,15 @@ export declare class SkfSelectOption extends SkfElement {
|
|
37
37
|
* Do not use directly, instead use `setSelectedDiscrete`.
|
38
38
|
* If true, instantly sets/unsets the selected property, without engaging ui feedback. Primarily for unselecting previous option in single select.
|
39
39
|
*/
|
40
|
-
_shortcutUpdate
|
40
|
+
_shortcutUpdate: boolean;
|
41
41
|
/** If true, prevents interaction with the option */
|
42
|
-
disabled
|
42
|
+
disabled: boolean;
|
43
43
|
/** If defined, set an icon */
|
44
|
-
icon?:
|
44
|
+
icon?: Icon;
|
45
45
|
/** If defined, sets provided color on the icon */
|
46
|
-
iconColor?:
|
46
|
+
iconColor?: IconColor;
|
47
47
|
/** If true, sets the option as selected */
|
48
|
-
selected
|
48
|
+
selected: boolean;
|
49
49
|
/** If defined, sets a short label */
|
50
50
|
shortLabel?: string;
|
51
51
|
/** The option's label text (equivalent to the tags textContent) */
|
@@ -54,16 +54,19 @@ export declare class SkfSelectOption extends SkfElement {
|
|
54
54
|
/** Returns or sets the tags value. If value is omitted, defaults to the tags text. */
|
55
55
|
set value(optionValue: string);
|
56
56
|
get value(): string;
|
57
|
+
small: boolean;
|
57
58
|
/** @internal */
|
58
59
|
private _assignedNodes?;
|
59
60
|
constructor();
|
60
61
|
updated(changedProperties: Map<string | number | symbol, unknown>): void;
|
62
|
+
/** @internal */
|
63
|
+
_handleStateChange(): void;
|
61
64
|
/**
|
62
65
|
* @internal
|
63
66
|
* This internal setter is to change selected state without emitting events triggering other side effects,
|
64
67
|
* e.g deselecting previous selected in a single select. Is used by skf-select in single select mode.
|
65
68
|
*/
|
66
|
-
set setSelectedDiscrete(
|
69
|
+
set setSelectedDiscrete(isSelected: boolean);
|
67
70
|
/**
|
68
71
|
* @internal
|
69
72
|
* Returns the slotted content as a string. If no slotted content, returns an empty string.
|
@@ -0,0 +1,140 @@
|
|
1
|
+
var y = (e) => {
|
2
|
+
throw TypeError(e);
|
3
|
+
};
|
4
|
+
var v = (e, s, t) => s.has(e) || y("Cannot " + t);
|
5
|
+
var u = (e, s, t) => (v(e, s, "read from private field"), t ? t.call(e) : s.get(e)), m = (e, s, t) => s.has(e) ? y("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), f = (e, s, t, i) => (v(e, s, "write to private field"), i ? i.call(e, t) : s.set(e, t), t);
|
6
|
+
import "../icon/icon.js";
|
7
|
+
import { SkfElement as C } from "../../internal/components/skf-element.js";
|
8
|
+
import { stateMap as x } from "../../internal/helpers/stateMap.js";
|
9
|
+
import { watch as g } from "../../internal/helpers/watch.js";
|
10
|
+
import { componentStyles as N } from "../../styles/component.styles.js";
|
11
|
+
import { LitElement as T, html as _ } from "lit";
|
12
|
+
import { property as a, state as $, queryAssignedNodes as O } from "lit/decorators.js";
|
13
|
+
import { ifDefined as b } from "lit/directives/if-defined.js";
|
14
|
+
import { styles as E } from "./select-option.styles.js";
|
15
|
+
var w = Object.defineProperty, D = Object.getOwnPropertyDescriptor, l = (e, s, t, i) => {
|
16
|
+
for (var r = i > 1 ? void 0 : i ? D(s, t) : s, d = e.length - 1, p; d >= 0; d--)
|
17
|
+
(p = e[d]) && (r = (i ? p(s, t, r) : p(r)) || r);
|
18
|
+
return i && r && w(s, t, r), r;
|
19
|
+
}, n, h;
|
20
|
+
const c = class c extends C {
|
21
|
+
constructor() {
|
22
|
+
super();
|
23
|
+
m(this, n);
|
24
|
+
m(this, h);
|
25
|
+
f(this, n, this.attachInternals()), f(this, h, u(this, n).states), this._shortcutUpdate = !1, this.disabled = !1, this.selected = !1, this.small = !1, this._handleClick = (t) => {
|
26
|
+
t.stopPropagation(), this.selected = !this.selected;
|
27
|
+
}, this.role = "option", this._parent = this.closest("skf-select"), this._shortcutUpdate = !1;
|
28
|
+
}
|
29
|
+
set text(t) {
|
30
|
+
this.textContent = t.trim();
|
31
|
+
}
|
32
|
+
get text() {
|
33
|
+
var t;
|
34
|
+
return ((t = this.textContent) == null ? void 0 : t.trim()) ?? "";
|
35
|
+
}
|
36
|
+
set value(t) {
|
37
|
+
this._value = t.trim();
|
38
|
+
}
|
39
|
+
get value() {
|
40
|
+
var t;
|
41
|
+
return !this._value && this._slotContainsOnlyText ? this._getSlottedContent().trim() : ((t = this._value) == null ? void 0 : t.trim()) ?? this.text;
|
42
|
+
}
|
43
|
+
updated(t) {
|
44
|
+
super.updated(t), t.has("selected") && !this._shortcutUpdate && this.emit("skf-select-option-select", {
|
45
|
+
detail: {
|
46
|
+
value: this.selected ? this.value : null,
|
47
|
+
option: this
|
48
|
+
}
|
49
|
+
});
|
50
|
+
}
|
51
|
+
_handleStateChange() {
|
52
|
+
x(u(this, h), "small").set(this.small);
|
53
|
+
}
|
54
|
+
/**
|
55
|
+
* @internal
|
56
|
+
* This internal setter is to change selected state without emitting events triggering other side effects,
|
57
|
+
* e.g deselecting previous selected in a single select. Is used by skf-select in single select mode.
|
58
|
+
*/
|
59
|
+
set setSelectedDiscrete(t) {
|
60
|
+
(async () => {
|
61
|
+
this._shortcutUpdate = !0, this.selected = t, await this.updateComplete, this._shortcutUpdate = !1;
|
62
|
+
})();
|
63
|
+
}
|
64
|
+
/**
|
65
|
+
* @internal
|
66
|
+
* Returns the slotted content as a string. If no slotted content, returns an empty string.
|
67
|
+
*/
|
68
|
+
_getSlottedContent() {
|
69
|
+
return this._assignedNodes ? [...this._assignedNodes].map((t) => t.nodeType === Node.ELEMENT_NODE ? t.outerHTML : t.textContent).join() : "";
|
70
|
+
}
|
71
|
+
/** @internal */
|
72
|
+
get _slotContainsOnlyText() {
|
73
|
+
return this._assignedNodes ? [...this._assignedNodes].every(
|
74
|
+
(i) => {
|
75
|
+
var r;
|
76
|
+
return i.nodeType === Node.TEXT_NODE && ((r = i.textContent) == null ? void 0 : r.trim()) !== "";
|
77
|
+
}
|
78
|
+
) : "";
|
79
|
+
}
|
80
|
+
render() {
|
81
|
+
return _`
|
82
|
+
<button
|
83
|
+
?disabled=${this.disabled}
|
84
|
+
@click=${this._handleClick}
|
85
|
+
aria-selected=${this.selected ? "true" : "false"}
|
86
|
+
role="option"
|
87
|
+
>
|
88
|
+
<skf-icon id="icon-check" name="check" size="sm"></skf-icon>
|
89
|
+
<slot>${this.text}</slot>
|
90
|
+
<div id="adornments">
|
91
|
+
<slot name="icon">
|
92
|
+
${this.icon && _`
|
93
|
+
<skf-icon
|
94
|
+
color=${b(this.iconColor)}
|
95
|
+
data-color=${b((this.disabled || !this.iconColor) && "custom")}
|
96
|
+
name=${this.icon}
|
97
|
+
></skf-icon>
|
98
|
+
`}
|
99
|
+
</slot>
|
100
|
+
${this.shortLabel && _`<div id="short-label">${this.shortLabel}</div>`}
|
101
|
+
</div>
|
102
|
+
</button>
|
103
|
+
`;
|
104
|
+
}
|
105
|
+
};
|
106
|
+
n = new WeakMap(), h = new WeakMap(), c.styles = [N, E], c.shadowRootOptions = { ...T.shadowRootOptions, delegatesFocus: !0 };
|
107
|
+
let o = c;
|
108
|
+
l([
|
109
|
+
a({ type: Boolean, reflect: !0 })
|
110
|
+
], o.prototype, "disabled", 2);
|
111
|
+
l([
|
112
|
+
a({ reflect: !0 })
|
113
|
+
], o.prototype, "icon", 2);
|
114
|
+
l([
|
115
|
+
a({ reflect: !0, attribute: "icon-color" })
|
116
|
+
], o.prototype, "iconColor", 2);
|
117
|
+
l([
|
118
|
+
a({ type: Boolean, reflect: !0 })
|
119
|
+
], o.prototype, "selected", 2);
|
120
|
+
l([
|
121
|
+
a({ reflect: !0, attribute: "short-label" })
|
122
|
+
], o.prototype, "shortLabel", 2);
|
123
|
+
l([
|
124
|
+
a({ attribute: !1 })
|
125
|
+
], o.prototype, "text", 1);
|
126
|
+
l([
|
127
|
+
a({ reflect: !0 })
|
128
|
+
], o.prototype, "value", 1);
|
129
|
+
l([
|
130
|
+
$()
|
131
|
+
], o.prototype, "small", 2);
|
132
|
+
l([
|
133
|
+
O({ flatten: !0 })
|
134
|
+
], o.prototype, "_assignedNodes", 2);
|
135
|
+
l([
|
136
|
+
g("small")
|
137
|
+
], o.prototype, "_handleStateChange", 1);
|
138
|
+
export {
|
139
|
+
o as SkfSelectOption
|
140
|
+
};
|
@@ -0,0 +1,15 @@
|
|
1
|
+
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
2
|
+
/**
|
3
|
+
* Workaround for storybook helper not being able to import types
|
4
|
+
* E.g type ControllerHost = SkfSelectOption;
|
5
|
+
*/
|
6
|
+
interface ControllerHostProps {
|
7
|
+
localName: keyof HTMLElementTagNameMap;
|
8
|
+
_parent: HTMLElement | null;
|
9
|
+
}
|
10
|
+
export declare class DeveloperFeedbackController implements ReactiveController {
|
11
|
+
host?: ReactiveControllerHost & Partial<ControllerHostProps>;
|
12
|
+
constructor(host: ReactiveControllerHost);
|
13
|
+
hostUpdated(): void;
|
14
|
+
}
|
15
|
+
export {};
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import { css as e } from "lit";
|
2
|
+
const o = e`
|
3
|
+
@layer components {
|
4
|
+
@layer base {
|
5
|
+
button {
|
6
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary);
|
7
|
+
--_skf-select-option-color: inherit;
|
8
|
+
--_skf-select-option-height: var(--skf-size-44);
|
9
|
+
|
10
|
+
align-items: center;
|
11
|
+
background-color: var(--_skf-select-option-bg);
|
12
|
+
block-size: var(--_skf-select-option-height);
|
13
|
+
color: var(--_skf-select-option-color);
|
14
|
+
display: flex;
|
15
|
+
gap: var(--skf-spacing-50);
|
16
|
+
padding-inline: var(--skf-spacing-50);
|
17
|
+
width: 100%;
|
18
|
+
}
|
19
|
+
|
20
|
+
#icon-check {
|
21
|
+
opacity: 0;
|
22
|
+
|
23
|
+
:host([selected]) & {
|
24
|
+
opacity: 1;
|
25
|
+
}
|
26
|
+
}
|
27
|
+
|
28
|
+
#adornments {
|
29
|
+
align-items: inherit;
|
30
|
+
display: inherit;
|
31
|
+
gap: inherit;
|
32
|
+
margin-inline-start: auto;
|
33
|
+
}
|
34
|
+
|
35
|
+
#short-label {
|
36
|
+
color: var(--skf-text-color-tertiary);
|
37
|
+
}
|
38
|
+
}
|
39
|
+
|
40
|
+
@layer states {
|
41
|
+
button {
|
42
|
+
&:disabled {
|
43
|
+
--_skf-select-option-color: var(--skf-interactive-text-color-disabled);
|
44
|
+
}
|
45
|
+
|
46
|
+
&:is(:hover, :focus):not(:disabled) {
|
47
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary-hover);
|
48
|
+
}
|
49
|
+
|
50
|
+
&:active:not(:disabled) {
|
51
|
+
--_skf-select-option-bg: var(--skf-interactive-bg-color-secondary-active);
|
52
|
+
}
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
@layer mods {
|
57
|
+
:host(:state(small)) button {
|
58
|
+
--_skf-select-option-height: var(--skf-size-32);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
`;
|
63
|
+
export {
|
64
|
+
o as styles
|
65
|
+
};
|
@@ -1,10 +1,11 @@
|
|
1
|
+
import { SkfSelectOptionGroup } from '../select/select-option-group.component.js';
|
2
|
+
import '../tag/tag.js';
|
1
3
|
import { FormBase } from '../../internal/components/formBase.js';
|
4
|
+
import '../../internal/components/hint/hint.js';
|
2
5
|
import { PopoverController } from '../../internal/controllers/popover.controller.js';
|
3
|
-
import type {
|
6
|
+
import type { FormFieldSeverity } from '../../internal/types.js';
|
4
7
|
import { type CSSResultGroup } from 'lit';
|
5
|
-
import '
|
6
|
-
import type { SelectOptionEvent, SkfSelectOption } from '../select-option/select-option.component.js';
|
7
|
-
import '../tag/tag';
|
8
|
+
import { SkfSelectOption, type SelectOptionEvent } from './select-option.component.js';
|
8
9
|
import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationController } from './select.controllers.js';
|
9
10
|
/**
|
10
11
|
* TODO: abstract the popover logic to a separate component/helper/partial, and use it in both select and in input[datalist], combobox etc
|
@@ -14,17 +15,18 @@ import { DeveloperFeedbackController, GlobalClickController, KeyboardNavigationC
|
|
14
15
|
/**
|
15
16
|
* The `<skf-select>` is a component that displays a list of actions or options. A click in the options list toggle the selected state of the option. Use it together with the ´skf-select-option` tag.
|
16
17
|
*
|
17
|
-
*
|
18
|
+
* See [zeroheight](https://zeroheight.com/853e936c9/p/91c9f0-select-and-combobox) for design principles
|
18
19
|
*
|
19
|
-
* @attribute {boolean} [disabled] - If true, the select is disabled
|
20
|
+
* @attribute {boolean} [disabled=false] - If true, the select is disabled
|
21
|
+
* @attribute {boolean} [required=false] - If true, the select is required
|
20
22
|
*
|
21
23
|
* @slot - The select's placeholder content
|
22
24
|
*
|
23
|
-
* @event change - Fired when the selected option(s) changes
|
24
|
-
* @event invalid - Fired when the select is invalid
|
25
|
-
* @event reset - Fired when the form is reset
|
26
|
-
* @event skf-select
|
27
|
-
* @event skf-select-option
|
25
|
+
* @event {Event} change - Fired when the selected option(s) changes
|
26
|
+
* @event {Event} invalid - Fired when the select is invalid
|
27
|
+
* @event {Event} reset - Fired when the form is reset
|
28
|
+
* @event {CustomEvent} skf-select-dropdown - {detail: {expanded: boolean}} Fired when the select dropdown is toggled
|
29
|
+
* @event {CustomEvent} skf-select-option-select - {detail: {value: string | null, option: SkfSelectOption}} Fired when the select dropdown is toggled
|
28
30
|
*
|
29
31
|
* @tagname skf-select
|
30
32
|
*/
|
@@ -39,9 +41,9 @@ export declare class SkfSelect extends FormBase {
|
|
39
41
|
/** If defined, forces component to invalid state until removed */
|
40
42
|
customInvalid?: string;
|
41
43
|
/** If true, hides the label visually */
|
42
|
-
hideLabel
|
44
|
+
hideLabel: boolean;
|
43
45
|
/** If true and mulltiple is true, no tags are displayed under the select */
|
44
|
-
hideTags
|
46
|
+
hideTags: boolean;
|
45
47
|
/** If defined, sets the hint text under the select component in the form */
|
46
48
|
hint?: string;
|
47
49
|
/** A readonly property that returns the selected value(s) in a array */
|
@@ -57,22 +59,22 @@ export declare class SkfSelect extends FormBase {
|
|
57
59
|
/** If defined, sets the minimum number of required options */
|
58
60
|
min?: number;
|
59
61
|
/** If true, allows for multiple options to be selected */
|
60
|
-
multiple
|
62
|
+
multiple: boolean;
|
61
63
|
/** If defined, set name of the component */
|
62
64
|
name?: string;
|
63
65
|
/** If defined, renders an alternative A11y text for the asterisk */
|
64
66
|
requiredLabel?: string;
|
65
67
|
/** If defined, displays provided severity state */
|
66
|
-
severity?:
|
68
|
+
severity?: FormFieldSeverity;
|
67
69
|
/** If true, displays valid state after interaction */
|
68
|
-
showValid
|
70
|
+
showValid: boolean;
|
69
71
|
/** Size of the Select */
|
70
72
|
size: 'sm' | 'md';
|
71
73
|
/** Read only, returns the selected value. (if multiple: in a comma separated string) */
|
72
74
|
set value(newValue: string);
|
73
75
|
get value(): string;
|
74
|
-
/** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
|
75
76
|
/** @internal */
|
77
|
+
/** Stores the selected SkfSelectOption tag(s) in a array. Is the source of truth for the internal state. */
|
76
78
|
private _selectedOptions;
|
77
79
|
/** @internal */
|
78
80
|
/** The selected options in an array. Treat it as a read only property. See selectedValues, slectedSlots for computed value arrays. */
|
@@ -91,6 +93,8 @@ export declare class SkfSelect extends FormBase {
|
|
91
93
|
/** @internal */
|
92
94
|
$popover: HTMLDivElement;
|
93
95
|
/** @internal */
|
96
|
+
_slottedItems: SkfSelectOption[] | SkfSelectOptionGroup[];
|
97
|
+
/** @internal */
|
94
98
|
protected globalClickController: GlobalClickController;
|
95
99
|
/** @internal */
|
96
100
|
protected keyboardNavController: KeyboardNavigationController;
|
@@ -101,6 +105,7 @@ export declare class SkfSelect extends FormBase {
|
|
101
105
|
constructor();
|
102
106
|
willUpdate(changedProperties: Map<string | number | symbol, unknown>): void;
|
103
107
|
firstUpdated(): void;
|
108
|
+
_handleSizeUpdate(): void;
|
104
109
|
handleExpandedChange(): void;
|
105
110
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
|
106
111
|
disconnectedCallback(): void;
|