igniteui-webcomponents 4.8.2 → 4.9.0
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/CHANGELOG.md +16 -0
- package/README.md +2 -2
- package/animations/player.js +1 -1
- package/animations/player.js.map +1 -1
- package/animations/presets/slide/index.js +4 -4
- package/animations/presets/slide/index.js.map +1 -1
- package/components/accordion/accordion.js +2 -2
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.d.ts +1 -0
- package/components/avatar/avatar.js +11 -7
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/themes.js.map +1 -1
- package/components/badge/badge.js +7 -6
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/themes.d.ts +1 -1
- package/components/badge/themes/themes.js.map +1 -1
- package/components/button/button-base.d.ts +1 -1
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.js +6 -5
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.js +8 -7
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/themes.d.ts +1 -1
- package/components/button/themes/button/themes.js.map +1 -1
- package/components/button/themes/icon-button/themes.d.ts +1 -1
- package/components/button/themes/icon-button/themes.js.map +1 -1
- package/components/button-group/button-group.js +27 -19
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/button.js.map +1 -1
- package/components/button-group/themes/group.js.map +1 -1
- package/components/button-group/toggle-button.js +7 -6
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/calendar.d.ts +2 -2
- package/components/calendar/calendar.js +17 -19
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/common/calendar-base.d.ts +1 -1
- package/components/calendar/common/calendar-base.js +2 -2
- package/components/calendar/common/calendar-base.js.map +1 -1
- package/components/calendar/common/calendar.model.d.ts +1 -1
- package/components/calendar/common/calendar.model.js +12 -11
- package/components/calendar/common/calendar.model.js.map +1 -1
- package/components/calendar/common/utils.d.ts +1 -1
- package/components/calendar/common/utils.js +1 -1
- package/components/calendar/common/utils.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +4 -4
- package/components/calendar/days-view/days-view.js +11 -14
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/months-view/months-view.d.ts +2 -2
- package/components/calendar/months-view/months-view.js +4 -3
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/themes/calendar.d.ts +1 -1
- package/components/calendar/themes/calendar.js.map +1 -1
- package/components/calendar/themes/days.d.ts +1 -1
- package/components/calendar/themes/days.js.map +1 -1
- package/components/calendar/themes/year-month.d.ts +1 -1
- package/components/calendar/themes/year-month.js.map +1 -1
- package/components/calendar/years-view/years-view.d.ts +2 -2
- package/components/calendar/years-view/years-view.js +4 -3
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.actions.js +6 -5
- package/components/card/card.actions.js.map +1 -1
- package/components/card/card.content.js +6 -5
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.header.js +6 -5
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +6 -5
- package/components/card/card.js.map +1 -1
- package/components/card/card.media.js +2 -2
- package/components/card/card.media.js.map +1 -1
- package/components/card/themes/actions.d.ts +1 -1
- package/components/card/themes/actions.js.map +1 -1
- package/components/card/themes/container.d.ts +1 -1
- package/components/card/themes/container.js.map +1 -1
- package/components/card/themes/content.d.ts +1 -1
- package/components/card/themes/content.js.map +1 -1
- package/components/card/themes/header.d.ts +1 -1
- package/components/card/themes/header.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +2 -2
- package/components/checkbox/checkbox-base.js +1 -1
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +4 -4
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +4 -4
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/checkbox-themes.d.ts +1 -1
- package/components/checkbox/themes/checkbox-themes.js.map +1 -1
- package/components/checkbox/themes/switch-themes.d.ts +1 -1
- package/components/checkbox/themes/switch-themes.js.map +1 -1
- package/components/chip/chip.d.ts +1 -1
- package/components/chip/chip.js +7 -6
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +1 -1
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/themes.d.ts +1 -1
- package/components/chip/themes/themes.js.map +1 -1
- package/components/combo/combo-header.js +5 -4
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.js +5 -4
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo-list.js +1 -1
- package/components/combo/combo-list.js.map +1 -1
- package/components/combo/combo.d.ts +5 -5
- package/components/combo/combo.js +16 -14
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +2 -2
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +3 -3
- package/components/combo/controllers/navigation.js +1 -3
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/controllers/selection.d.ts +1 -1
- package/components/combo/controllers/selection.js.map +1 -1
- package/components/combo/operations/filter.d.ts +2 -2
- package/components/combo/operations/filter.js +2 -2
- package/components/combo/operations/filter.js.map +1 -1
- package/components/combo/operations/group.d.ts +1 -1
- package/components/combo/operations/group.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/themes/themes.d.ts +1 -1
- package/components/combo/themes/themes.js.map +1 -1
- package/components/combo/types.d.ts +2 -2
- package/components/combo/types.js.map +1 -1
- package/components/common/controllers/root-click.d.ts +1 -1
- package/components/common/controllers/root-click.js.map +1 -1
- package/components/common/controllers/root-scroll.d.ts +1 -1
- package/components/common/controllers/root-scroll.js.map +1 -1
- package/components/common/decorators/blazorDeepImport.d.ts +2 -1
- package/components/common/decorators/blazorDeepImport.js.map +1 -1
- package/components/common/decorators/blazorIndirectRender.d.ts +2 -1
- package/components/common/decorators/blazorIndirectRender.js.map +1 -1
- package/components/common/decorators/blazorSuppressComponent.d.ts +2 -1
- package/components/common/decorators/blazorSuppressComponent.js.map +1 -1
- package/components/common/decorators/watch.js +2 -2
- package/components/common/decorators/watch.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +4 -4
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/definitions/defineComponents.d.ts +1 -1
- package/components/common/definitions/defineComponents.js.map +1 -1
- package/components/common/mixins/alert.d.ts +1 -1
- package/components/common/mixins/alert.js.map +1 -1
- package/components/common/mixins/combo-box.js.map +1 -1
- package/components/common/mixins/constructor.d.ts +2 -2
- package/components/common/mixins/constructor.js.map +1 -1
- package/components/common/mixins/event-emitter.d.ts +1 -1
- package/components/common/mixins/event-emitter.js.map +1 -1
- package/components/common/mixins/form-associated-required.d.ts +2 -2
- package/components/common/mixins/form-associated-required.js +1 -1
- package/components/common/mixins/form-associated-required.js.map +1 -1
- package/components/common/mixins/form-associated.d.ts +2 -2
- package/components/common/mixins/form-associated.js.map +1 -1
- package/components/common/mixins/sizable.d.ts +1 -1
- package/components/common/mixins/sizable.js.map +1 -1
- package/components/common/util.d.ts +4 -2
- package/components/common/util.js +16 -18
- package/components/common/util.js.map +1 -1
- package/components/common/validators.js +5 -5
- package/components/common/validators.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +5 -5
- package/components/date-time-input/date-time-input.js +38 -55
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/date-util.d.ts +1 -1
- package/components/date-time-input/date-util.js +40 -32
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/dialog/dialog.js +4 -4
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/dialog.base.css.js +1 -1
- package/components/dialog/themes/dialog.base.css.js.map +1 -1
- package/components/dialog/themes/themes.d.ts +1 -1
- package/components/dialog/themes/themes.js.map +1 -1
- package/components/dropdown/dropdown-group.js +7 -6
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.js +6 -5
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.js +7 -6
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +4 -2
- package/components/dropdown/dropdown.js +10 -10
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/container.d.ts +1 -1
- package/components/dropdown/themes/container.js.map +1 -1
- package/components/dropdown/themes/group.d.ts +1 -1
- package/components/dropdown/themes/group.js.map +1 -1
- package/components/dropdown/themes/header.d.ts +1 -1
- package/components/dropdown/themes/header.js.map +1 -1
- package/components/dropdown/themes/item.d.ts +1 -1
- package/components/dropdown/themes/item.js.map +1 -1
- package/components/expansion-panel/expansion-panel.js +4 -4
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/themes.d.ts +1 -1
- package/components/expansion-panel/themes/themes.js.map +1 -1
- package/components/form/form.d.ts +1 -1
- package/components/form/form.js +2 -2
- package/components/form/form.js.map +1 -1
- package/components/icon/icon.js +8 -7
- package/components/icon/icon.js.map +1 -1
- package/components/icon/themes/themes.d.ts +1 -1
- package/components/icon/themes/themes.js.map +1 -1
- package/components/input/input-base.d.ts +2 -2
- package/components/input/input-base.js +5 -5
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +8 -1
- package/components/input/input.js +10 -14
- package/components/input/input.js.map +1 -1
- package/components/input/themes/themes.d.ts +1 -1
- package/components/input/themes/themes.js.map +1 -1
- package/components/list/list-header.js +6 -5
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.js +6 -5
- package/components/list/list-item.js.map +1 -1
- package/components/list/list.js +7 -6
- package/components/list/list.js.map +1 -1
- package/components/list/themes/container.d.ts +1 -1
- package/components/list/themes/container.js.map +1 -1
- package/components/list/themes/header.d.ts +1 -1
- package/components/list/themes/header.js.map +1 -1
- package/components/list/themes/item.d.ts +1 -1
- package/components/list/themes/item.js.map +1 -1
- package/components/mask-input/mask-input-base.d.ts +1 -1
- package/components/mask-input/mask-input-base.js +1 -1
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +2 -2
- package/components/mask-input/mask-input.js +2 -2
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.d.ts +2 -2
- package/components/mask-input/mask-parser.js +44 -34
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +6 -5
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.js +8 -7
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.js +7 -6
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.d.ts +1 -1
- package/components/nav-drawer/themes/container.js.map +1 -1
- package/components/nav-drawer/themes/header-item.d.ts +1 -1
- package/components/nav-drawer/themes/header-item.js.map +1 -1
- package/components/nav-drawer/themes/item.d.ts +1 -1
- package/components/nav-drawer/themes/item.js.map +1 -1
- package/components/navbar/navbar.js +6 -5
- package/components/navbar/navbar.js.map +1 -1
- package/components/navbar/themes/themes.d.ts +1 -1
- package/components/navbar/themes/themes.js.map +1 -1
- package/components/popover/popover.d.ts +2 -4
- package/components/popover/popover.js +16 -18
- package/components/popover/popover.js.map +1 -1
- package/components/popover/themes/light/popover.base.css.js +1 -1
- package/components/popover/themes/light/popover.base.css.js.map +1 -1
- package/components/progress/base.js +8 -5
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-gradient.js +1 -1
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.js +4 -4
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.js +7 -6
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/themes.d.ts +1 -1
- package/components/progress/themes/circular/themes.js.map +1 -1
- package/components/progress/themes/linear/themes.d.ts +1 -1
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/radio/radio.d.ts +2 -2
- package/components/radio/radio.js +5 -5
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/themes.d.ts +1 -1
- package/components/radio/themes/themes.js.map +1 -1
- package/components/radio/utils.js.map +1 -1
- package/components/radio-group/radio-group.js +7 -6
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating-symbol.js +2 -2
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.d.ts +3 -1
- package/components/rating/rating.js +24 -18
- package/components/rating/rating.js.map +1 -1
- package/components/rating/themes/themes.d.ts +1 -1
- package/components/rating/themes/themes.js.map +1 -1
- package/components/ripple/ripple.js +4 -4
- package/components/ripple/ripple.js.map +1 -1
- package/components/select/select-group.js +5 -4
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-header.js +4 -3
- package/components/select/select-header.js.map +1 -1
- package/components/select/select-item.js +4 -3
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.d.ts +3 -3
- package/components/select/select.js +10 -10
- package/components/select/select.js.map +1 -1
- package/components/select/themes/themes.d.ts +1 -1
- package/components/select/themes/themes.js.map +1 -1
- package/components/slider/range-slider.d.ts +1 -1
- package/components/slider/range-slider.js +15 -13
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +2 -2
- package/components/slider/slider-base.js +8 -8
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider-label.js +1 -1
- package/components/slider/slider-label.js.map +1 -1
- package/components/slider/slider.d.ts +1 -1
- package/components/slider/slider.js +3 -3
- package/components/slider/slider.js.map +1 -1
- package/components/slider/themes/themes.d.ts +1 -1
- package/components/slider/themes/themes.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +1 -1
- package/components/snackbar/snackbar.js +7 -6
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/themes.d.ts +1 -1
- package/components/snackbar/themes/themes.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +10 -11
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +2 -2
- package/components/stepper/stepper.js +21 -12
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/themes.d.ts +1 -1
- package/components/stepper/themes/step/themes.js.map +1 -1
- package/components/tabs/tab-panel.js +2 -2
- package/components/tabs/tab-panel.js.map +1 -1
- package/components/tabs/tab.js +5 -5
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +2 -2
- package/components/tabs/tabs.js +14 -10
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/tab-themes.d.ts +1 -1
- package/components/tabs/themes/tab-themes.js.map +1 -1
- package/components/tabs/themes/tabs-themes.d.ts +1 -1
- package/components/tabs/themes/tabs-themes.js.map +1 -1
- package/components/textarea/textarea.d.ts +8 -1
- package/components/textarea/textarea.js +11 -5
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/themes.d.ts +1 -1
- package/components/textarea/themes/themes.js.map +1 -1
- package/components/toast/themes/themes.d.ts +1 -1
- package/components/toast/themes/themes.js.map +1 -1
- package/components/toast/toast.js +7 -6
- package/components/toast/toast.js.map +1 -1
- package/components/tree/themes/container.d.ts +1 -1
- package/components/tree/themes/container.js.map +1 -1
- package/components/tree/themes/item.d.ts +1 -1
- package/components/tree/themes/item.js.map +1 -1
- package/components/tree/tree-item.js +12 -13
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.d.ts +2 -2
- package/components/tree/tree.js +25 -19
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +3 -3
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.d.ts +2 -2
- package/components/tree/tree.selection.js +12 -10
- package/components/tree/tree.selection.js.map +1 -1
- package/custom-elements.json +95 -48
- package/package.json +1 -1
- package/theming/config.js +4 -4
- package/theming/config.js.map +1 -1
- package/theming/theming-controller.d.ts +1 -1
- package/theming/theming-controller.js.map +1 -1
- package/theming/theming-decorator.js.map +1 -1
- package/theming/types.d.ts +1 -1
- package/theming/types.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/components/snackbar/themes/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../src/components/snackbar/themes/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAEzE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAC7E,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,iCAAiC,CAAC;AAEnE,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,cAAc;GAC9B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,aAAa;GAChB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,aAAa;GAC7B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,YAAY;GACf;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '../../../theming/types.js';\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/snackbar.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/snackbar.fluent.css.js';\nimport { styles as indigoDark } from './dark/snackbar.indigo.css.js';\nimport { styles as materialDark } from './dark/snackbar.material.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/snackbar.bootstrap.css.js';\nimport { styles as fluentLight } from './light/snackbar.fluent.css.js';\nimport { styles as indigoLight } from './light/snackbar.indigo.css.js';\nimport { styles as materialLight } from './light/snackbar.material.css.js';\nimport { styles as shared } from './light/snackbar.shared.css.js';\n// Shared Styles\nimport { styles as bootstrap } from './shared/snackbar.bootstrap.css.js';\nimport { styles as fluent } from './shared/snackbar.fluent.css.js';\nimport { styles as indigo } from './shared/snackbar.indigo.css.js';\n\nconst light = {\n shared: css`\n ${shared}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluent} ${fluentLight}\n `,\n indigo: css`\n ${indigo} ${indigoLight}\n `,\n};\n\nconst dark = {\n shared: css`\n ${shared}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluent} ${fluentDark}\n `,\n indigo: css`\n ${indigo} ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LitElement, nothing } from 'lit';
|
|
2
|
-
import { Animation } from './animations.js';
|
|
2
|
+
import { type Animation } from './animations.js';
|
|
3
3
|
/**
|
|
4
4
|
* The step component is used within the `igc-stepper` element and it holds the content of each step.
|
|
5
5
|
* It also supports custom indicators, title and subtitle.
|
|
@@ -4,21 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var IgcStepComponent_1;
|
|
7
8
|
import { LitElement, html, nothing } from 'lit';
|
|
8
9
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
9
10
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
10
11
|
import { when } from 'lit/directives/when.js';
|
|
11
|
-
import { animations } from './animations.js';
|
|
12
|
-
import { styles as shared } from './themes/step/shared/step.common.css.js';
|
|
13
|
-
import { styles } from './themes/step/step.base.css.js';
|
|
14
|
-
import { all } from './themes/step/themes.js';
|
|
15
12
|
import { EaseInOut } from '../../animations/easings.js';
|
|
16
13
|
import { addAnimationController } from '../../animations/player.js';
|
|
17
14
|
import { themes } from '../../theming/theming-decorator.js';
|
|
18
15
|
import { watch } from '../common/decorators/watch.js';
|
|
19
16
|
import { registerComponent } from '../common/definitions/register.js';
|
|
20
17
|
import { partNameMap } from '../common/util.js';
|
|
21
|
-
|
|
18
|
+
import { animations } from './animations.js';
|
|
19
|
+
import { styles as shared } from './themes/step/shared/step.common.css.js';
|
|
20
|
+
import { styles } from './themes/step/step.base.css.js';
|
|
21
|
+
import { all } from './themes/step/themes.js';
|
|
22
|
+
let IgcStepComponent = IgcStepComponent_1 = class IgcStepComponent extends LitElement {
|
|
22
23
|
constructor() {
|
|
23
24
|
super(...arguments);
|
|
24
25
|
this.bodyRef = createRef();
|
|
@@ -39,7 +40,7 @@ let IgcStepComponent = class IgcStepComponent extends LitElement {
|
|
|
39
40
|
this.animationDuration = 350;
|
|
40
41
|
}
|
|
41
42
|
static register() {
|
|
42
|
-
registerComponent(
|
|
43
|
+
registerComponent(IgcStepComponent_1);
|
|
43
44
|
}
|
|
44
45
|
async toggleAnimation(type, direction = 'normal') {
|
|
45
46
|
const animation = animations.get(this.animation).get(type);
|
|
@@ -116,9 +117,7 @@ let IgcStepComponent = class IgcStepComponent extends LitElement {
|
|
|
116
117
|
</div>
|
|
117
118
|
`;
|
|
118
119
|
}
|
|
119
|
-
|
|
120
|
-
return nothing;
|
|
121
|
-
}
|
|
120
|
+
return nothing;
|
|
122
121
|
}
|
|
123
122
|
renderTitleAndSubtitle() {
|
|
124
123
|
return html `
|
|
@@ -234,8 +233,8 @@ __decorate([
|
|
|
234
233
|
__decorate([
|
|
235
234
|
watch('complete', { waitUntilFirstUpdate: true })
|
|
236
235
|
], IgcStepComponent.prototype, "completeChange", null);
|
|
237
|
-
IgcStepComponent = __decorate([
|
|
238
|
-
themes(all
|
|
236
|
+
IgcStepComponent = IgcStepComponent_1 = __decorate([
|
|
237
|
+
themes(all)
|
|
239
238
|
], IgcStepComponent);
|
|
240
239
|
export default IgcStepComponent;
|
|
241
240
|
//# sourceMappingURL=step.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../../src/components/stepper/step.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ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Q,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDAC8B;AAItD;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;+CACb;AAIX;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;oDACL;AAInB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;wDACD;AAIvB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACR;AAIhB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;mDACM;AAI9B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2DACA;AAuBrB;IADT,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAO/C;AAKS;IAHT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,SAAS,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAChD,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;qEAKjD;AAGS;IADT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;sDAKjD;AA5IkB,gBAAgB;IADpC,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;GACG,gBAAgB,CAwQpC;eAxQoB,gBAAgB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { Ref, createRef, ref } from 'lit/directives/ref.js';\nimport { when } from 'lit/directives/when.js';\n\nimport { Animation, animations } from './animations.js';\nimport { styles as shared } from './themes/step/shared/step.common.css.js';\nimport { styles } from './themes/step/step.base.css.js';\nimport { all } from './themes/step/themes.js';\nimport { EaseInOut } from '../../animations/easings.js';\nimport { addAnimationController } from '../../animations/player.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { partNameMap } from '../common/util.js';\n\n/**\n * The step component is used within the `igc-stepper` element and it holds the content of each step.\n * It also supports custom indicators, title and subtitle.\n *\n * @element igc-step\n *\n * @slot - Renders the content of the step.\n * @slot indicator - Renders the indicator of the step. By default, it displays the step index + 1.\n * @slot title - Renders the title of the step.\n * @slot subtitle - Renders the subtitle of the step.\n *\n * @csspart header-container - Wrapper of the step's `header` and its separators.\n * @csspart disabled - Indicates a disabled state. Applies to `header-container`.\n * @csspart complete-start - Indicates a complete state of the current step. Applies to `header-container`.\n * @csspart complete-end - Indicates a complete state of the previous step. Applies to `header-container`.\n * @csspart optional - Indicates an optional state. Applies to `header-container`.\n * @csspart invalid - Indicates an invalid state. Applies to `header-container`.\n * @csspart top - Indicates that the title should be above the indicator. Applies to `header-container`.\n * @csspart bottom - Indicates that the title should be below the indicator. Applies to `header-container`.\n * @csspart start - Indicates that the title should be before the indicator. Applies to `header-container`.\n * @csspart end - Indicates that the title should be after the indicator. Applies to `header-container`.\n * @csspart header - Wrapper of the step's `indicator` and `text`.\n * @csspart indicator - The indicator of the step.\n * @csspart text - Wrapper of the step's `title` and `subtitle`.\n * @csspart empty - Indicates that no title and subtitle has been provided to the step. Applies to `text`.\n * @csspart title - The title of the step.\n * @csspart subtitle - The subtitle of the step.\n * @csspart body - Wrapper of the step's `content`.\n * @csspart content - The steps `content`.\n */\n@themes(all, true)\nexport default class IgcStepComponent extends LitElement {\n public static readonly tagName = 'igc-step';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register() {\n registerComponent(this);\n }\n\n private bodyRef: Ref<HTMLElement> = createRef();\n\n private animationPlayer = addAnimationController(this, this.bodyRef);\n\n @queryAssignedElements({ slot: 'title' })\n private _titleChildren!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'subtitle' })\n private _subTitleChildren!: Array<HTMLElement>;\n\n /* blazorSuppress */\n @query('[part~=\"header\"]')\n public header!: HTMLElement;\n\n /* blazorSuppress */\n @query('[part~=\"body\"]')\n public contentBody!: HTMLElement;\n\n /** Gets/sets whether the step is invalid. */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /** Gets/sets whether the step is activе. */\n @property({ reflect: true, type: Boolean })\n public active = false;\n\n /**\n * Gets/sets whether the step is optional.\n *\n * @remarks\n * Optional steps validity does not affect the default behavior when the stepper is in linear mode i.e.\n * if optional step is invalid the user could still move to the next step.\n */\n @property({ type: Boolean })\n public optional = false;\n\n /** Gets/sets whether the step is interactable. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** Gets/sets whether the step is completed.\n *\n * @remarks\n * When set to `true` the following separator is styled `solid`.\n */\n @property({ reflect: true, type: Boolean })\n public complete = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public previousComplete = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public stepType: 'indicator' | 'title' | 'full' = 'full';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public titlePosition?: 'bottom' | 'top' | 'end' | 'start';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public index = -1;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public contentTop = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public linearDisabled = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public visited = false;\n\n /** @hidden @intrnal @private */\n @property({ attribute: false })\n public animation: Animation = 'fade';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public animationDuration = 350;\n\n public async toggleAnimation(\n type: 'in' | 'out',\n direction: 'normal' | 'reverse' = 'normal'\n ) {\n const animation = animations.get(this.animation)!.get(type)!;\n\n const options: KeyframeAnimationOptions = {\n duration: this.animationDuration,\n easing: EaseInOut.Quad,\n direction,\n };\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation(options)),\n ]);\n\n return event.type;\n }\n\n @watch('active', { waitUntilFirstUpdate: true })\n protected activeChange() {\n if (this.active) {\n this.dispatchEvent(\n new CustomEvent('stepActiveChanged', { bubbles: true, detail: false })\n );\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n @watch('invalid', { waitUntilFirstUpdate: true })\n @watch('optional', { waitUntilFirstUpdate: true })\n protected disabledInvalidOptionalChange() {\n this.dispatchEvent(\n new CustomEvent('stepDisabledInvalidChanged', { bubbles: true })\n );\n }\n\n @watch('complete', { waitUntilFirstUpdate: true })\n protected completeChange() {\n this.dispatchEvent(\n new CustomEvent('stepCompleteChanged', { bubbles: true })\n );\n }\n\n private handleClick(event: MouseEvent): void {\n event.stopPropagation();\n if (this.isAccessible) {\n this.dispatchEvent(\n new CustomEvent('stepActiveChanged', { bubbles: true, detail: true })\n );\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n this.dispatchEvent(\n new CustomEvent('stepHeaderKeydown', {\n bubbles: true,\n detail: { event, focusedStep: this },\n })\n );\n }\n\n /** @hidden @internal */\n public get isAccessible(): boolean {\n return !this.disabled && !this.linearDisabled;\n }\n\n private get headerContainerParts() {\n return {\n 'header-container': true,\n disabled: !this.isAccessible,\n 'complete-start': this.complete,\n 'complete-end': this.previousComplete,\n optional: this.optional,\n invalid:\n this.invalid && this.visited && !this.active && this.isAccessible,\n top: this.titlePosition === 'top',\n bottom:\n this.titlePosition === 'bottom' ||\n (this.orientation === 'horizontal' && !this.titlePosition),\n start: this.titlePosition === 'start',\n end:\n this.titlePosition === 'end' ||\n (this.orientation === 'vertical' && !this.titlePosition),\n };\n }\n\n private get textParts() {\n return {\n text: true,\n empty:\n this.stepType === 'indicator'\n ? true\n : this.stepType === 'full' &&\n !this._titleChildren.length &&\n !this._subTitleChildren.length,\n };\n }\n\n protected renderIndicator() {\n if (this.stepType !== 'title') {\n return html`\n <div part=\"indicator\">\n <slot name=\"indicator\">\n <span>${this.index + 1}</span>\n </slot>\n </div>\n `;\n } else {\n return nothing;\n }\n }\n\n protected renderTitleAndSubtitle() {\n return html`\n <div part=\"${partNameMap(this.textParts)}\">\n <div part=\"title\">\n <slot name=\"title\"></slot>\n </div>\n <div part=\"subtitle\">\n <slot name=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n protected renderContent() {\n return html`<div\n ${ref(this.bodyRef)}\n id=\"igc-step-content-${this.index}\"\n part=\"body\"\n role=\"tabpanel\"\n aria-labelledby=\"igc-step-header-${this.index}\"\n >\n <div part=\"content\">\n <slot></slot>\n </div>\n </div>`;\n }\n\n protected override render() {\n return html`\n ${when(\n this.contentTop && this.orientation === 'horizontal',\n () => this.renderContent(),\n () => nothing\n )}\n <div part=\"${partNameMap(this.headerContainerParts)}\">\n <div\n part=\"header\"\n tabindex=\"${this.active ? '0' : '-1'}\"\n role=\"tab\"\n aria-selected=\"${this.active}\"\n @click=${this.handleClick}\n @keydown=${this.handleKeydown}\n >\n ${this.renderIndicator()} ${this.renderTitleAndSubtitle()}\n </div>\n </div>\n ${when(\n this.orientation === 'vertical' || !this.contentTop,\n () => this.renderContent(),\n () => nothing\n )}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-step': IgcStepComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"step.js","sourceRoot":"","sources":["../../../src/components/stepper/step.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAY,SAAS,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAE9C,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;A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C;wDACD;AAIvB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;iDACR;AAIhB;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;mDACM;AAI9B;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;2DACA;AAuBrB;IADT,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;oDAO/C;AAKS;IAHT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IACjD,KAAK,CAAC,SAAS,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAChD,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;qEAKjD;AAGS;IADT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;sDAKjD;AA5IkB,gBAAgB;IADpC,MAAM,CAAC,GAAG,CAAC;GACS,gBAAgB,CAuQpC;eAvQoB,gBAAgB","sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\nimport { type Ref, createRef, ref } from 'lit/directives/ref.js';\nimport { when } from 'lit/directives/when.js';\n\nimport { EaseInOut } from '../../animations/easings.js';\nimport { addAnimationController } from '../../animations/player.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { partNameMap } from '../common/util.js';\nimport { type Animation, animations } from './animations.js';\nimport { styles as shared } from './themes/step/shared/step.common.css.js';\nimport { styles } from './themes/step/step.base.css.js';\nimport { all } from './themes/step/themes.js';\n\n/**\n * The step component is used within the `igc-stepper` element and it holds the content of each step.\n * It also supports custom indicators, title and subtitle.\n *\n * @element igc-step\n *\n * @slot - Renders the content of the step.\n * @slot indicator - Renders the indicator of the step. By default, it displays the step index + 1.\n * @slot title - Renders the title of the step.\n * @slot subtitle - Renders the subtitle of the step.\n *\n * @csspart header-container - Wrapper of the step's `header` and its separators.\n * @csspart disabled - Indicates a disabled state. Applies to `header-container`.\n * @csspart complete-start - Indicates a complete state of the current step. Applies to `header-container`.\n * @csspart complete-end - Indicates a complete state of the previous step. Applies to `header-container`.\n * @csspart optional - Indicates an optional state. Applies to `header-container`.\n * @csspart invalid - Indicates an invalid state. Applies to `header-container`.\n * @csspart top - Indicates that the title should be above the indicator. Applies to `header-container`.\n * @csspart bottom - Indicates that the title should be below the indicator. Applies to `header-container`.\n * @csspart start - Indicates that the title should be before the indicator. Applies to `header-container`.\n * @csspart end - Indicates that the title should be after the indicator. Applies to `header-container`.\n * @csspart header - Wrapper of the step's `indicator` and `text`.\n * @csspart indicator - The indicator of the step.\n * @csspart text - Wrapper of the step's `title` and `subtitle`.\n * @csspart empty - Indicates that no title and subtitle has been provided to the step. Applies to `text`.\n * @csspart title - The title of the step.\n * @csspart subtitle - The subtitle of the step.\n * @csspart body - Wrapper of the step's `content`.\n * @csspart content - The steps `content`.\n */\n@themes(all)\nexport default class IgcStepComponent extends LitElement {\n public static readonly tagName = 'igc-step';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcStepComponent);\n }\n\n private bodyRef: Ref<HTMLElement> = createRef();\n\n private animationPlayer = addAnimationController(this, this.bodyRef);\n\n @queryAssignedElements({ slot: 'title' })\n private _titleChildren!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'subtitle' })\n private _subTitleChildren!: Array<HTMLElement>;\n\n /* blazorSuppress */\n @query('[part~=\"header\"]')\n public header!: HTMLElement;\n\n /* blazorSuppress */\n @query('[part~=\"body\"]')\n public contentBody!: HTMLElement;\n\n /** Gets/sets whether the step is invalid. */\n @property({ reflect: true, type: Boolean })\n public invalid = false;\n\n /** Gets/sets whether the step is activе. */\n @property({ reflect: true, type: Boolean })\n public active = false;\n\n /**\n * Gets/sets whether the step is optional.\n *\n * @remarks\n * Optional steps validity does not affect the default behavior when the stepper is in linear mode i.e.\n * if optional step is invalid the user could still move to the next step.\n */\n @property({ type: Boolean })\n public optional = false;\n\n /** Gets/sets whether the step is interactable. */\n @property({ reflect: true, type: Boolean })\n public disabled = false;\n\n /** Gets/sets whether the step is completed.\n *\n * @remarks\n * When set to `true` the following separator is styled `solid`.\n */\n @property({ reflect: true, type: Boolean })\n public complete = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public previousComplete = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public stepType: 'indicator' | 'title' | 'full' = 'full';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public titlePosition?: 'bottom' | 'top' | 'end' | 'start';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public index = -1;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public contentTop = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public linearDisabled = false;\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public visited = false;\n\n /** @hidden @intrnal @private */\n @property({ attribute: false })\n public animation: Animation = 'fade';\n\n /** @hidden @internal @private */\n @property({ attribute: false })\n public animationDuration = 350;\n\n public async toggleAnimation(\n type: 'in' | 'out',\n direction: 'normal' | 'reverse' = 'normal'\n ) {\n const animation = animations.get(this.animation)!.get(type)!;\n\n const options: KeyframeAnimationOptions = {\n duration: this.animationDuration,\n easing: EaseInOut.Quad,\n direction,\n };\n\n const [_, event] = await Promise.all([\n this.animationPlayer.stopAll(),\n this.animationPlayer.play(animation(options)),\n ]);\n\n return event.type;\n }\n\n @watch('active', { waitUntilFirstUpdate: true })\n protected activeChange() {\n if (this.active) {\n this.dispatchEvent(\n new CustomEvent('stepActiveChanged', { bubbles: true, detail: false })\n );\n }\n }\n\n @watch('disabled', { waitUntilFirstUpdate: true })\n @watch('invalid', { waitUntilFirstUpdate: true })\n @watch('optional', { waitUntilFirstUpdate: true })\n protected disabledInvalidOptionalChange() {\n this.dispatchEvent(\n new CustomEvent('stepDisabledInvalidChanged', { bubbles: true })\n );\n }\n\n @watch('complete', { waitUntilFirstUpdate: true })\n protected completeChange() {\n this.dispatchEvent(\n new CustomEvent('stepCompleteChanged', { bubbles: true })\n );\n }\n\n private handleClick(event: MouseEvent): void {\n event.stopPropagation();\n if (this.isAccessible) {\n this.dispatchEvent(\n new CustomEvent('stepActiveChanged', { bubbles: true, detail: true })\n );\n }\n }\n\n private handleKeydown(event: KeyboardEvent): void {\n this.dispatchEvent(\n new CustomEvent('stepHeaderKeydown', {\n bubbles: true,\n detail: { event, focusedStep: this },\n })\n );\n }\n\n /** @hidden @internal */\n public get isAccessible(): boolean {\n return !this.disabled && !this.linearDisabled;\n }\n\n private get headerContainerParts() {\n return {\n 'header-container': true,\n disabled: !this.isAccessible,\n 'complete-start': this.complete,\n 'complete-end': this.previousComplete,\n optional: this.optional,\n invalid:\n this.invalid && this.visited && !this.active && this.isAccessible,\n top: this.titlePosition === 'top',\n bottom:\n this.titlePosition === 'bottom' ||\n (this.orientation === 'horizontal' && !this.titlePosition),\n start: this.titlePosition === 'start',\n end:\n this.titlePosition === 'end' ||\n (this.orientation === 'vertical' && !this.titlePosition),\n };\n }\n\n private get textParts() {\n return {\n text: true,\n empty:\n this.stepType === 'indicator'\n ? true\n : this.stepType === 'full' &&\n !this._titleChildren.length &&\n !this._subTitleChildren.length,\n };\n }\n\n protected renderIndicator() {\n if (this.stepType !== 'title') {\n return html`\n <div part=\"indicator\">\n <slot name=\"indicator\">\n <span>${this.index + 1}</span>\n </slot>\n </div>\n `;\n }\n return nothing;\n }\n\n protected renderTitleAndSubtitle() {\n return html`\n <div part=\"${partNameMap(this.textParts)}\">\n <div part=\"title\">\n <slot name=\"title\"></slot>\n </div>\n <div part=\"subtitle\">\n <slot name=\"subtitle\"></slot>\n </div>\n </div>\n `;\n }\n\n protected renderContent() {\n return html`<div\n ${ref(this.bodyRef)}\n id=\"igc-step-content-${this.index}\"\n part=\"body\"\n role=\"tabpanel\"\n aria-labelledby=\"igc-step-header-${this.index}\"\n >\n <div part=\"content\">\n <slot></slot>\n </div>\n </div>`;\n }\n\n protected override render() {\n return html`\n ${when(\n this.contentTop && this.orientation === 'horizontal',\n () => this.renderContent(),\n () => nothing\n )}\n <div part=\"${partNameMap(this.headerContainerParts)}\">\n <div\n part=\"header\"\n tabindex=\"${this.active ? '0' : '-1'}\"\n role=\"tab\"\n aria-selected=\"${this.active}\"\n @click=${this.handleClick}\n @keydown=${this.handleKeydown}\n >\n ${this.renderIndicator()} ${this.renderTitleAndSubtitle()}\n </div>\n </div>\n ${when(\n this.orientation === 'vertical' || !this.contentTop,\n () => this.renderContent(),\n () => nothing\n )}\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-step': IgcStepComponent;\n }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
|
+
import type { Constructor } from '../common/mixins/constructor.js';
|
|
2
3
|
import IgcStepComponent from './step.js';
|
|
3
|
-
import { IgcStepperEventMap } from './stepper.common.js';
|
|
4
|
-
import { Constructor } from '../common/mixins/constructor.js';
|
|
4
|
+
import type { IgcStepperEventMap } from './stepper.common.js';
|
|
5
5
|
declare const IgcStepperComponent_base: Constructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcStepperEventMap>> & Constructor<LitElement>;
|
|
6
6
|
/**
|
|
7
7
|
* IgxStepper provides a wizard-like workflow by dividing content into logical steps.
|
|
@@ -4,21 +4,22 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
4
4
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
|
+
var IgcStepperComponent_1;
|
|
7
8
|
import { LitElement, html } from 'lit';
|
|
8
9
|
import { property, queryAssignedElements } from 'lit/decorators.js';
|
|
9
|
-
import IgcStepComponent from './step.js';
|
|
10
|
-
import { styles } from './themes/stepper/stepper.base.css.js';
|
|
11
|
-
import { styles as bootstrap } from './themes/stepper/stepper.bootstrap.css.js';
|
|
12
|
-
import { styles as fluent } from './themes/stepper/stepper.fluent.css.js';
|
|
13
|
-
import { styles as indigo } from './themes/stepper/stepper.indigo.css.js';
|
|
14
10
|
import { themes } from '../../theming/theming-decorator.js';
|
|
15
11
|
import { watch } from '../common/decorators/watch.js';
|
|
16
12
|
import { registerComponent } from '../common/definitions/register.js';
|
|
17
13
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
18
14
|
import { isLTR } from '../common/util.js';
|
|
19
|
-
|
|
15
|
+
import IgcStepComponent from './step.js';
|
|
16
|
+
import { styles } from './themes/stepper/stepper.base.css.js';
|
|
17
|
+
import { styles as bootstrap } from './themes/stepper/stepper.bootstrap.css.js';
|
|
18
|
+
import { styles as fluent } from './themes/stepper/stepper.fluent.css.js';
|
|
19
|
+
import { styles as indigo } from './themes/stepper/stepper.indigo.css.js';
|
|
20
|
+
let IgcStepperComponent = IgcStepperComponent_1 = class IgcStepperComponent extends EventEmitterMixin(LitElement) {
|
|
20
21
|
static register() {
|
|
21
|
-
registerComponent(
|
|
22
|
+
registerComponent(IgcStepperComponent_1, IgcStepComponent);
|
|
22
23
|
}
|
|
23
24
|
orientationChange() {
|
|
24
25
|
this.setAttribute('aria-orientation', this.orientation);
|
|
@@ -28,7 +29,9 @@ let IgcStepperComponent = class IgcStepperComponent extends EventEmitterMixin(Li
|
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
31
|
stepTypeChange() {
|
|
31
|
-
this.steps.forEach((step) =>
|
|
32
|
+
this.steps.forEach((step) => {
|
|
33
|
+
step.stepType = this.stepType;
|
|
34
|
+
});
|
|
32
35
|
}
|
|
33
36
|
titlePositionChange() {
|
|
34
37
|
this.steps.forEach((step) => {
|
|
@@ -44,7 +47,9 @@ let IgcStepperComponent = class IgcStepperComponent extends EventEmitterMixin(Li
|
|
|
44
47
|
});
|
|
45
48
|
}
|
|
46
49
|
contentTopChange() {
|
|
47
|
-
this.steps.forEach((step) =>
|
|
50
|
+
this.steps.forEach((step) => {
|
|
51
|
+
step.contentTop = this.contentTop;
|
|
52
|
+
});
|
|
48
53
|
}
|
|
49
54
|
linearChange() {
|
|
50
55
|
this.steps.forEach((step) => {
|
|
@@ -276,7 +281,9 @@ let IgcStepperComponent = class IgcStepperComponent extends EventEmitterMixin(Li
|
|
|
276
281
|
});
|
|
277
282
|
}
|
|
278
283
|
else {
|
|
279
|
-
this.steps.forEach((step) =>
|
|
284
|
+
this.steps.forEach((step) => {
|
|
285
|
+
step.linearDisabled = false;
|
|
286
|
+
});
|
|
280
287
|
}
|
|
281
288
|
}
|
|
282
289
|
updateAnimation(step) {
|
|
@@ -336,7 +343,9 @@ let IgcStepperComponent = class IgcStepperComponent extends EventEmitterMixin(Li
|
|
|
336
343
|
this.moveToNextStep(false);
|
|
337
344
|
}
|
|
338
345
|
reset() {
|
|
339
|
-
this.steps.forEach((step) =>
|
|
346
|
+
this.steps.forEach((step) => {
|
|
347
|
+
step.visited = false;
|
|
348
|
+
});
|
|
340
349
|
this.activateFirstStep();
|
|
341
350
|
}
|
|
342
351
|
render() {
|
|
@@ -394,7 +403,7 @@ __decorate([
|
|
|
394
403
|
__decorate([
|
|
395
404
|
watch('animationDuration', { waitUntilFirstUpdate: true })
|
|
396
405
|
], IgcStepperComponent.prototype, "animationDurationChange", null);
|
|
397
|
-
IgcStepperComponent = __decorate([
|
|
406
|
+
IgcStepperComponent = IgcStepperComponent_1 = __decorate([
|
|
398
407
|
themes({
|
|
399
408
|
light: { bootstrap, fluent, indigo },
|
|
400
409
|
dark: { bootstrap, fluent, indigo },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepper.js","sourceRo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AI,EAAE,CAAC;4DAOpD;AAGS;IADT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;yDAKjD;AAGS;IADT,KAAK,CAAC,eAAe,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;8DActD;AAGS;IADT,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;2DAKnD;AAGS;IADT,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;uDAa/C;AAIS;IAFT,KAAK,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC1D,KAAK,CAAC,qBAAqB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;8DAK5D;AAGS;IADT,KAAK,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;kEAK1D;AAtKkB,mBAAmB;IAJvC,MAAM,CAAC;QACN,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;QACpC,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;KACpC,CAAC;GACmB,mBAAmB,CAuevC;eAveoB,mBAAmB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\n\nimport IgcStepComponent from './step.js';\nimport { IgcStepperEventMap } from './stepper.common.js';\nimport { styles } from './themes/stepper/stepper.base.css.js';\nimport { styles as bootstrap } from './themes/stepper/stepper.bootstrap.css.js';\nimport { styles as fluent } from './themes/stepper/stepper.fluent.css.js';\nimport { styles as indigo } from './themes/stepper/stepper.indigo.css.js';\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { isLTR } from '../common/util.js';\n\n/**\n * IgxStepper provides a wizard-like workflow by dividing content into logical steps.\n *\n * @remarks\n * The stepper component allows the user to navigate between multiple steps.\n * It supports horizontal and vertical orientation as well as keyboard navigation and provides API methods to control the active step.\n *\n * @element igc-stepper\n *\n * @slot - Renders the step components inside default slot.\n *\n * @fires igcActiveStepChanging - Emitted when the active step is about to change.\n * @fires igcActiveStepChanged - Emitted when the active step is changed.\n */\n@themes({\n light: { bootstrap, fluent, indigo },\n dark: { bootstrap, fluent, indigo },\n})\nexport default class IgcStepperComponent extends EventEmitterMixin<\n IgcStepperEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-stepper';\n protected static styles = styles;\n\n /* blazorSuppress */\n public static register() {\n registerComponent(this, IgcStepComponent);\n }\n\n private readonly keyDownHandlers: Map<string, Function> = new Map(\n Object.entries({\n Enter: this.activateStep,\n Space: this.activateStep,\n SpaceBar: this.activateStep,\n ' ': this.activateStep,\n ArrowUp: this.onArrowUpKeyDown,\n ArrowDown: this.onArrowDownKeyDown,\n ArrowLeft: this.onArrowLeftKeyDown,\n ArrowRight: this.onArrowRightKeyDown,\n Home: this.onHomeKey,\n End: this.onEndKey,\n })\n );\n\n private activeStep!: IgcStepComponent;\n\n /** Returns all of the stepper's steps. */\n @queryAssignedElements({ selector: 'igc-step' })\n public steps!: Array<IgcStepComponent>;\n\n /** Gets/Sets the orientation of the stepper.\n *\n * @remarks\n * Default value is `horizontal`.\n */\n @property({ reflect: true })\n public orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Get/Set the type of the steps.\n *\n * @remarks\n * Default value is `full`.\n */\n @property({ reflect: true, attribute: 'step-type' })\n public stepType: 'indicator' | 'title' | 'full' = 'full';\n\n /**\n * Get/Set whether the stepper is linear.\n *\n * @remarks\n * If the stepper is in linear mode and if the active step is valid only then the user is able to move forward.\n */\n @property({ type: Boolean })\n public linear = false;\n\n /**\n * Get/Set whether the content is displayed above the steps.\n *\n * @remarks\n * Default value is `false` and the content is below the steps.\n */\n @property({ reflect: true, type: Boolean, attribute: 'content-top' })\n public contentTop = false;\n\n /**\n * The animation type when in vertical mode.\n * @attr vertical-animation\n */\n @property({ attribute: 'vertical-animation' })\n public verticalAnimation: 'grow' | 'fade' | 'none' = 'grow';\n\n /**\n * The animation type when in horizontal mode.\n * @attr horizontal-animation\n */\n @property({ attribute: 'horizontal-animation' })\n public horizontalAnimation: 'slide' | 'fade' | 'none' = 'slide';\n\n /**\n * The animation duration in either vertical or horizontal mode.\n * @attr animation-duration\n */\n @property({ attribute: 'animation-duration', type: Number })\n public animationDuration = 320;\n\n /**\n * Get/Set the position of the steps title.\n *\n * @remarks\n * The default value is undefined.\n * When the stepper is horizontally orientated the title is positioned below the indicator.\n * When the stepper is horizontally orientated the title is positioned on the right side of the indicator.\n */\n @property({ reflect: false, attribute: 'title-position' })\n public titlePosition?: 'bottom' | 'top' | 'end' | 'start';\n\n @watch('orientation', { waitUntilFirstUpdate: true })\n protected orientationChange(): void {\n this.setAttribute('aria-orientation', this.orientation);\n this.steps.forEach((step: IgcStepComponent) => {\n step.orientation = this.orientation;\n this.updateAnimation(step);\n });\n }\n\n @watch('stepType', { waitUntilFirstUpdate: true })\n protected stepTypeChange(): void {\n this.steps.forEach(\n (step: IgcStepComponent) => (step.stepType = this.stepType)\n );\n }\n\n @watch('titlePosition', { waitUntilFirstUpdate: true })\n protected titlePositionChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n if (\n this.titlePosition !== 'bottom' &&\n this.titlePosition !== 'top' &&\n this.titlePosition !== 'end' &&\n this.titlePosition !== 'start'\n ) {\n step.titlePosition = undefined;\n } else {\n step.titlePosition = this.titlePosition;\n }\n });\n }\n\n @watch('contentTop', { waitUntilFirstUpdate: true })\n protected contentTopChange(): void {\n this.steps.forEach(\n (step: IgcStepComponent) => (step.contentTop = this.contentTop)\n );\n }\n\n @watch('linear', { waitUntilFirstUpdate: true })\n protected linearChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n step.linearDisabled = this.linear;\n if (step.index <= this.activeStep.index) {\n step.visited = true;\n } else {\n step.visited = false;\n }\n });\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n }\n\n @watch('verticalAnimation', { waitUntilFirstUpdate: true })\n @watch('horizontalAnimation', { waitUntilFirstUpdate: true })\n protected animationTypeChange() {\n this.steps.forEach((step: IgcStepComponent) => {\n this.updateAnimation(step);\n });\n }\n\n @watch('animationDuration', { waitUntilFirstUpdate: true })\n protected animationDurationChange() {\n this.steps.forEach((step: IgcStepComponent) => {\n step.animationDuration = this.animationDuration;\n });\n }\n\n constructor() {\n super();\n\n this.addEventListener('stepActiveChanged', (event: any) => {\n event.stopPropagation();\n this.activateStep(event.target, event.detail);\n });\n\n this.addEventListener('stepDisabledInvalidChanged', (event: any) => {\n event.stopPropagation();\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n });\n\n this.addEventListener('stepCompleteChanged', (event: any) => {\n event.stopPropagation();\n const nextStep = this.steps[event.target.index + 1];\n if (nextStep) {\n nextStep.previousComplete = event.target.complete;\n }\n });\n\n this.addEventListener('stepHeaderKeydown', (event: any) => {\n event.stopPropagation();\n this.handleKeydown(event.detail.event, event.detail.focusedStep);\n });\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'tablist');\n this.setAttribute('aria-orientation', this.orientation);\n }\n\n private activateFirstStep() {\n const firstEnabledStep = this.steps.find(\n (s: IgcStepComponent) => !s.disabled\n );\n if (firstEnabledStep) {\n this.activateStep(firstEnabledStep, false);\n }\n }\n\n private animateSteps(\n nextStep: IgcStepComponent,\n currentStep: IgcStepComponent\n ) {\n if (nextStep.index > currentStep.index) {\n // Animate steps in ascending/next direction\n currentStep.toggleAnimation('out');\n nextStep.toggleAnimation('in');\n } else {\n // Animate steps in descending/previous direction\n currentStep.toggleAnimation('in', 'reverse');\n nextStep.toggleAnimation('out', 'reverse');\n }\n }\n\n private async activateStep(step: IgcStepComponent, shouldEmit = true) {\n if (step === this.activeStep) {\n return;\n }\n\n if (shouldEmit) {\n const args = {\n detail: {\n owner: this,\n oldIndex: this.activeStep.index,\n newIndex: step.index,\n },\n cancelable: true,\n };\n\n this.animateSteps(step, this.activeStep);\n\n const allowed = this.emitEvent('igcActiveStepChanging', args);\n\n if (!allowed) {\n return;\n }\n this.changeActiveStep(step);\n this.emitEvent('igcActiveStepChanged', {\n detail: { owner: this, index: step.index },\n });\n } else {\n this.changeActiveStep(step);\n }\n }\n\n private changeActiveStep(step: IgcStepComponent) {\n if (this.activeStep) {\n this.activeStep.active = false;\n }\n step.active = true;\n step.visited = true;\n this.activeStep = step;\n }\n\n private moveToNextStep(next = true) {\n let steps = this.steps;\n let activeStepIndex = this.activeStep.index;\n if (!next) {\n steps = this.steps.reverse();\n activeStepIndex = steps.findIndex(\n (step: IgcStepComponent) => step === this.activeStep\n );\n }\n\n const nextStep = steps.find(\n (step: IgcStepComponent, i: number) =>\n i > activeStepIndex && step.isAccessible\n );\n\n if (nextStep) {\n this.animateSteps(nextStep, this.activeStep);\n this.activateStep(nextStep, false);\n }\n }\n\n private handleKeydown(event: KeyboardEvent, focusedStep: IgcStepComponent) {\n const key = event.key.toLowerCase();\n\n if (this.keyDownHandlers.has(event.key)) {\n event.preventDefault();\n this.keyDownHandlers.get(event.key)?.call(this, focusedStep);\n }\n if (key === 'tab' && this.orientation === 'vertical') {\n return;\n }\n if (key === 'tab' && this.activeStep.index !== focusedStep.index) {\n this.activeStep.header.focus();\n }\n }\n\n private onHomeKey() {\n this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)[0]\n ?.header?.focus();\n }\n\n private onEndKey() {\n this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)\n .pop()\n ?.header?.focus();\n }\n\n private onArrowDownKeyDown(focusedStep: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n return;\n }\n this.getNextStep(focusedStep)?.header?.focus();\n }\n\n private onArrowUpKeyDown(focusedStep: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n return;\n }\n this.getPreviousStep(focusedStep)?.header?.focus();\n }\n\n private onArrowRightKeyDown(focusedStep: IgcStepComponent) {\n if (!isLTR(this) && this.orientation === 'horizontal') {\n this.getPreviousStep(focusedStep)?.header?.focus();\n } else {\n this.getNextStep(focusedStep)?.header?.focus();\n }\n }\n\n private onArrowLeftKeyDown(focusedStep: IgcStepComponent) {\n if (!isLTR(this) && this.orientation === 'horizontal') {\n this.getNextStep(focusedStep)?.header?.focus();\n } else {\n this.getPreviousStep(focusedStep)?.header?.focus();\n }\n }\n\n private getNextStep(\n focusedStep: IgcStepComponent\n ): IgcStepComponent | undefined {\n if (focusedStep.index === this.steps.length - 1) {\n return this.steps.find((step: IgcStepComponent) => step.isAccessible);\n }\n\n const nextAccessible = this.steps.find(\n (step: IgcStepComponent, i: number) =>\n i > focusedStep.index && step.isAccessible\n );\n return nextAccessible\n ? nextAccessible\n : this.steps.find((step: IgcStepComponent) => step.isAccessible);\n }\n\n private getPreviousStep(\n focusedStep: IgcStepComponent\n ): IgcStepComponent | undefined {\n if (focusedStep.index === 0) {\n return this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)\n .pop();\n }\n\n let prevStep;\n for (let i = focusedStep.index - 1; i >= 0; i--) {\n const step = this.steps[i];\n if (step.isAccessible) {\n prevStep = step;\n break;\n }\n }\n\n return prevStep\n ? prevStep\n : this.steps.filter((step: IgcStepComponent) => step.isAccessible).pop();\n }\n\n private updateStepsLinearDisabled(): void {\n const firstInvalidStep = this.steps\n .filter((step: IgcStepComponent) => !step.disabled && !step.optional)\n .find((step: IgcStepComponent) => step.invalid);\n if (firstInvalidStep) {\n this.steps.forEach((step: IgcStepComponent) => {\n if (step.index <= firstInvalidStep.index) {\n step.linearDisabled = false;\n } else {\n step.linearDisabled = true;\n }\n });\n } else {\n this.steps.forEach(\n (step: IgcStepComponent) => (step.linearDisabled = false)\n );\n }\n }\n\n private updateAnimation(step: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n step.animation = this.horizontalAnimation;\n }\n\n if (this.orientation === 'vertical') {\n step.animation = this.verticalAnimation;\n }\n }\n\n private syncProperties(): void {\n this.steps.forEach((step: IgcStepComponent, index: number) => {\n step.orientation = this.orientation;\n step.stepType = this.stepType;\n step.titlePosition = this.titlePosition;\n step.contentTop = this.contentTop;\n step.index = index;\n step.active = this.activeStep === step;\n step.header?.setAttribute('aria-posinset', (index + 1).toString());\n step.header?.setAttribute('aria-setsize', this.steps.length.toString());\n step.header?.setAttribute('id', `igc-step-header-${index}`);\n step.header?.setAttribute('aria-controls', `igc-step-content-${index}`);\n if (index > 0) {\n step.previousComplete = this.steps[index - 1].complete;\n }\n step.animationDuration = this.animationDuration;\n this.updateAnimation(step);\n });\n }\n\n private stepsChanged(): void {\n this.style.setProperty('--steps-count', this.steps.length.toString());\n\n const lastActiveStep = this.steps\n .reverse()\n .find((step: IgcStepComponent) => step.active);\n if (!lastActiveStep) {\n // initially when there isn't a predefined active step or when the active step is removed\n this.activateFirstStep();\n } else {\n // activate the last step marked as active\n this.activateStep(lastActiveStep, false);\n }\n\n this.syncProperties();\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n }\n\n /** Activates the step at a given index. */\n public navigateTo(index: number) {\n const step = this.steps[index];\n if (!step) {\n return;\n }\n this.activateStep(step, false);\n }\n\n /** Activates the next enabled step. */\n public next(): void {\n this.moveToNextStep();\n }\n\n /** Activates the previous enabled step. */\n public prev(): void {\n this.moveToNextStep(false);\n }\n\n /**\n * Resets the stepper to its initial state i.e. activates the first step.\n *\n * @remarks\n * The steps' content will not be automatically reset.\n */\n public reset(): void {\n this.steps.forEach((step) => (step.visited = false));\n this.activateFirstStep();\n }\n\n protected override render() {\n return html`<slot @slotchange=${this.stepsChanged}></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-stepper': IgcStepperComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"stepper.js","sourceRoot":"","sources":["../../../src/components/stepper/step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E,IAAI,EAAE,CAAC;4DAOpD;AAGS;IADT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;yDAKjD;AAGS;IADT,KAAK,CAAC,eAAe,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;8DActD;AAGS;IADT,KAAK,CAAC,YAAY,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;2DAKnD;AAGS;IADT,KAAK,CAAC,QAAQ,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;uDAa/C;AAIS;IAFT,KAAK,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;IAC1D,KAAK,CAAC,qBAAqB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;8DAK5D;AAGS;IADT,KAAK,CAAC,mBAAmB,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;kEAK1D;AAvKkB,mBAAmB;IAJvC,MAAM,CAAC;QACN,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;QACpC,IAAI,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE;KACpC,CAAC;GACmB,mBAAmB,CA0evC;eA1eoB,mBAAmB","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, queryAssignedElements } from 'lit/decorators.js';\n\nimport { themes } from '../../theming/theming-decorator.js';\nimport { watch } from '../common/decorators/watch.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { isLTR } from '../common/util.js';\nimport IgcStepComponent from './step.js';\nimport type { IgcStepperEventMap } from './stepper.common.js';\nimport { styles } from './themes/stepper/stepper.base.css.js';\nimport { styles as bootstrap } from './themes/stepper/stepper.bootstrap.css.js';\nimport { styles as fluent } from './themes/stepper/stepper.fluent.css.js';\nimport { styles as indigo } from './themes/stepper/stepper.indigo.css.js';\n\n/**\n * IgxStepper provides a wizard-like workflow by dividing content into logical steps.\n *\n * @remarks\n * The stepper component allows the user to navigate between multiple steps.\n * It supports horizontal and vertical orientation as well as keyboard navigation and provides API methods to control the active step.\n *\n * @element igc-stepper\n *\n * @slot - Renders the step components inside default slot.\n *\n * @fires igcActiveStepChanging - Emitted when the active step is about to change.\n * @fires igcActiveStepChanged - Emitted when the active step is changed.\n */\n@themes({\n light: { bootstrap, fluent, indigo },\n dark: { bootstrap, fluent, indigo },\n})\nexport default class IgcStepperComponent extends EventEmitterMixin<\n IgcStepperEventMap,\n Constructor<LitElement>\n>(LitElement) {\n public static readonly tagName = 'igc-stepper';\n protected static styles = styles;\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcStepperComponent, IgcStepComponent);\n }\n\n // biome-ignore lint/complexity/noBannedTypes: No easy fix as the callback shapes are wildly different\n private readonly keyDownHandlers: Map<string, Function> = new Map(\n Object.entries({\n Enter: this.activateStep,\n Space: this.activateStep,\n SpaceBar: this.activateStep,\n ' ': this.activateStep,\n ArrowUp: this.onArrowUpKeyDown,\n ArrowDown: this.onArrowDownKeyDown,\n ArrowLeft: this.onArrowLeftKeyDown,\n ArrowRight: this.onArrowRightKeyDown,\n Home: this.onHomeKey,\n End: this.onEndKey,\n })\n );\n\n private activeStep!: IgcStepComponent;\n\n /** Returns all of the stepper's steps. */\n @queryAssignedElements({ selector: 'igc-step' })\n public steps!: Array<IgcStepComponent>;\n\n /** Gets/Sets the orientation of the stepper.\n *\n * @remarks\n * Default value is `horizontal`.\n */\n @property({ reflect: true })\n public orientation: 'horizontal' | 'vertical' = 'horizontal';\n\n /** Get/Set the type of the steps.\n *\n * @remarks\n * Default value is `full`.\n */\n @property({ reflect: true, attribute: 'step-type' })\n public stepType: 'indicator' | 'title' | 'full' = 'full';\n\n /**\n * Get/Set whether the stepper is linear.\n *\n * @remarks\n * If the stepper is in linear mode and if the active step is valid only then the user is able to move forward.\n */\n @property({ type: Boolean })\n public linear = false;\n\n /**\n * Get/Set whether the content is displayed above the steps.\n *\n * @remarks\n * Default value is `false` and the content is below the steps.\n */\n @property({ reflect: true, type: Boolean, attribute: 'content-top' })\n public contentTop = false;\n\n /**\n * The animation type when in vertical mode.\n * @attr vertical-animation\n */\n @property({ attribute: 'vertical-animation' })\n public verticalAnimation: 'grow' | 'fade' | 'none' = 'grow';\n\n /**\n * The animation type when in horizontal mode.\n * @attr horizontal-animation\n */\n @property({ attribute: 'horizontal-animation' })\n public horizontalAnimation: 'slide' | 'fade' | 'none' = 'slide';\n\n /**\n * The animation duration in either vertical or horizontal mode.\n * @attr animation-duration\n */\n @property({ attribute: 'animation-duration', type: Number })\n public animationDuration = 320;\n\n /**\n * Get/Set the position of the steps title.\n *\n * @remarks\n * The default value is undefined.\n * When the stepper is horizontally orientated the title is positioned below the indicator.\n * When the stepper is horizontally orientated the title is positioned on the right side of the indicator.\n */\n @property({ reflect: false, attribute: 'title-position' })\n public titlePosition?: 'bottom' | 'top' | 'end' | 'start';\n\n @watch('orientation', { waitUntilFirstUpdate: true })\n protected orientationChange(): void {\n this.setAttribute('aria-orientation', this.orientation);\n this.steps.forEach((step: IgcStepComponent) => {\n step.orientation = this.orientation;\n this.updateAnimation(step);\n });\n }\n\n @watch('stepType', { waitUntilFirstUpdate: true })\n protected stepTypeChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n step.stepType = this.stepType;\n });\n }\n\n @watch('titlePosition', { waitUntilFirstUpdate: true })\n protected titlePositionChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n if (\n this.titlePosition !== 'bottom' &&\n this.titlePosition !== 'top' &&\n this.titlePosition !== 'end' &&\n this.titlePosition !== 'start'\n ) {\n step.titlePosition = undefined;\n } else {\n step.titlePosition = this.titlePosition;\n }\n });\n }\n\n @watch('contentTop', { waitUntilFirstUpdate: true })\n protected contentTopChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n step.contentTop = this.contentTop;\n });\n }\n\n @watch('linear', { waitUntilFirstUpdate: true })\n protected linearChange(): void {\n this.steps.forEach((step: IgcStepComponent) => {\n step.linearDisabled = this.linear;\n if (step.index <= this.activeStep.index) {\n step.visited = true;\n } else {\n step.visited = false;\n }\n });\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n }\n\n @watch('verticalAnimation', { waitUntilFirstUpdate: true })\n @watch('horizontalAnimation', { waitUntilFirstUpdate: true })\n protected animationTypeChange() {\n this.steps.forEach((step: IgcStepComponent) => {\n this.updateAnimation(step);\n });\n }\n\n @watch('animationDuration', { waitUntilFirstUpdate: true })\n protected animationDurationChange() {\n this.steps.forEach((step: IgcStepComponent) => {\n step.animationDuration = this.animationDuration;\n });\n }\n\n constructor() {\n super();\n\n this.addEventListener('stepActiveChanged', (event: any) => {\n event.stopPropagation();\n this.activateStep(event.target, event.detail);\n });\n\n this.addEventListener('stepDisabledInvalidChanged', (event: any) => {\n event.stopPropagation();\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n });\n\n this.addEventListener('stepCompleteChanged', (event: any) => {\n event.stopPropagation();\n const nextStep = this.steps[event.target.index + 1];\n if (nextStep) {\n nextStep.previousComplete = event.target.complete;\n }\n });\n\n this.addEventListener('stepHeaderKeydown', (event: any) => {\n event.stopPropagation();\n this.handleKeydown(event.detail.event, event.detail.focusedStep);\n });\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.setAttribute('role', 'tablist');\n this.setAttribute('aria-orientation', this.orientation);\n }\n\n private activateFirstStep() {\n const firstEnabledStep = this.steps.find(\n (s: IgcStepComponent) => !s.disabled\n );\n if (firstEnabledStep) {\n this.activateStep(firstEnabledStep, false);\n }\n }\n\n private animateSteps(\n nextStep: IgcStepComponent,\n currentStep: IgcStepComponent\n ) {\n if (nextStep.index > currentStep.index) {\n // Animate steps in ascending/next direction\n currentStep.toggleAnimation('out');\n nextStep.toggleAnimation('in');\n } else {\n // Animate steps in descending/previous direction\n currentStep.toggleAnimation('in', 'reverse');\n nextStep.toggleAnimation('out', 'reverse');\n }\n }\n\n private async activateStep(step: IgcStepComponent, shouldEmit = true) {\n if (step === this.activeStep) {\n return;\n }\n\n if (shouldEmit) {\n const args = {\n detail: {\n owner: this,\n oldIndex: this.activeStep.index,\n newIndex: step.index,\n },\n cancelable: true,\n };\n\n this.animateSteps(step, this.activeStep);\n\n const allowed = this.emitEvent('igcActiveStepChanging', args);\n\n if (!allowed) {\n return;\n }\n this.changeActiveStep(step);\n this.emitEvent('igcActiveStepChanged', {\n detail: { owner: this, index: step.index },\n });\n } else {\n this.changeActiveStep(step);\n }\n }\n\n private changeActiveStep(step: IgcStepComponent) {\n if (this.activeStep) {\n this.activeStep.active = false;\n }\n step.active = true;\n step.visited = true;\n this.activeStep = step;\n }\n\n private moveToNextStep(next = true) {\n let steps = this.steps;\n let activeStepIndex = this.activeStep.index;\n if (!next) {\n steps = this.steps.reverse();\n activeStepIndex = steps.findIndex(\n (step: IgcStepComponent) => step === this.activeStep\n );\n }\n\n const nextStep = steps.find(\n (step: IgcStepComponent, i: number) =>\n i > activeStepIndex && step.isAccessible\n );\n\n if (nextStep) {\n this.animateSteps(nextStep, this.activeStep);\n this.activateStep(nextStep, false);\n }\n }\n\n private handleKeydown(event: KeyboardEvent, focusedStep: IgcStepComponent) {\n const key = event.key.toLowerCase();\n\n if (this.keyDownHandlers.has(event.key)) {\n event.preventDefault();\n this.keyDownHandlers.get(event.key)?.call(this, focusedStep);\n }\n if (key === 'tab' && this.orientation === 'vertical') {\n return;\n }\n if (key === 'tab' && this.activeStep.index !== focusedStep.index) {\n this.activeStep.header.focus();\n }\n }\n\n private onHomeKey() {\n this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)[0]\n ?.header?.focus();\n }\n\n private onEndKey() {\n this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)\n .pop()\n ?.header?.focus();\n }\n\n private onArrowDownKeyDown(focusedStep: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n return;\n }\n this.getNextStep(focusedStep)?.header?.focus();\n }\n\n private onArrowUpKeyDown(focusedStep: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n return;\n }\n this.getPreviousStep(focusedStep)?.header?.focus();\n }\n\n private onArrowRightKeyDown(focusedStep: IgcStepComponent) {\n if (!isLTR(this) && this.orientation === 'horizontal') {\n this.getPreviousStep(focusedStep)?.header?.focus();\n } else {\n this.getNextStep(focusedStep)?.header?.focus();\n }\n }\n\n private onArrowLeftKeyDown(focusedStep: IgcStepComponent) {\n if (!isLTR(this) && this.orientation === 'horizontal') {\n this.getNextStep(focusedStep)?.header?.focus();\n } else {\n this.getPreviousStep(focusedStep)?.header?.focus();\n }\n }\n\n private getNextStep(\n focusedStep: IgcStepComponent\n ): IgcStepComponent | undefined {\n if (focusedStep.index === this.steps.length - 1) {\n return this.steps.find((step: IgcStepComponent) => step.isAccessible);\n }\n\n const nextAccessible = this.steps.find(\n (step: IgcStepComponent, i: number) =>\n i > focusedStep.index && step.isAccessible\n );\n return nextAccessible\n ? nextAccessible\n : this.steps.find((step: IgcStepComponent) => step.isAccessible);\n }\n\n private getPreviousStep(\n focusedStep: IgcStepComponent\n ): IgcStepComponent | undefined {\n if (focusedStep.index === 0) {\n return this.steps\n .filter((step: IgcStepComponent) => step.isAccessible)\n .pop();\n }\n\n let prevStep: IgcStepComponent | undefined;\n for (let i = focusedStep.index - 1; i >= 0; i--) {\n const step = this.steps[i];\n if (step.isAccessible) {\n prevStep = step;\n break;\n }\n }\n\n return prevStep\n ? prevStep\n : this.steps.filter((step: IgcStepComponent) => step.isAccessible).pop();\n }\n\n private updateStepsLinearDisabled(): void {\n const firstInvalidStep = this.steps\n .filter((step: IgcStepComponent) => !step.disabled && !step.optional)\n .find((step: IgcStepComponent) => step.invalid);\n if (firstInvalidStep) {\n this.steps.forEach((step: IgcStepComponent) => {\n if (step.index <= firstInvalidStep.index) {\n step.linearDisabled = false;\n } else {\n step.linearDisabled = true;\n }\n });\n } else {\n this.steps.forEach((step: IgcStepComponent) => {\n step.linearDisabled = false;\n });\n }\n }\n\n private updateAnimation(step: IgcStepComponent) {\n if (this.orientation === 'horizontal') {\n step.animation = this.horizontalAnimation;\n }\n\n if (this.orientation === 'vertical') {\n step.animation = this.verticalAnimation;\n }\n }\n\n private syncProperties(): void {\n this.steps.forEach((step: IgcStepComponent, index: number) => {\n step.orientation = this.orientation;\n step.stepType = this.stepType;\n step.titlePosition = this.titlePosition;\n step.contentTop = this.contentTop;\n step.index = index;\n step.active = this.activeStep === step;\n step.header?.setAttribute('aria-posinset', (index + 1).toString());\n step.header?.setAttribute('aria-setsize', this.steps.length.toString());\n step.header?.setAttribute('id', `igc-step-header-${index}`);\n step.header?.setAttribute('aria-controls', `igc-step-content-${index}`);\n if (index > 0) {\n step.previousComplete = this.steps[index - 1].complete;\n }\n step.animationDuration = this.animationDuration;\n this.updateAnimation(step);\n });\n }\n\n private stepsChanged(): void {\n this.style.setProperty('--steps-count', this.steps.length.toString());\n\n const lastActiveStep = this.steps\n .reverse()\n .find((step: IgcStepComponent) => step.active);\n if (!lastActiveStep) {\n // initially when there isn't a predefined active step or when the active step is removed\n this.activateFirstStep();\n } else {\n // activate the last step marked as active\n this.activateStep(lastActiveStep, false);\n }\n\n this.syncProperties();\n if (this.linear) {\n this.updateStepsLinearDisabled();\n }\n }\n\n /** Activates the step at a given index. */\n public navigateTo(index: number) {\n const step = this.steps[index];\n if (!step) {\n return;\n }\n this.activateStep(step, false);\n }\n\n /** Activates the next enabled step. */\n public next(): void {\n this.moveToNextStep();\n }\n\n /** Activates the previous enabled step. */\n public prev(): void {\n this.moveToNextStep(false);\n }\n\n /**\n * Resets the stepper to its initial state i.e. activates the first step.\n *\n * @remarks\n * The steps' content will not be automatically reset.\n */\n public reset(): void {\n this.steps.forEach((step) => {\n step.visited = false;\n });\n this.activateFirstStep();\n }\n\n protected override render() {\n return html`<slot @slotchange=${this.stepsChanged}></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-stepper': IgcStepperComponent;\n }\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Themes } from '../../../../theming/types.js';
|
|
1
|
+
import type { Themes } from '../../../../theming/types.js';
|
|
2
2
|
export declare const all: Themes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../../src/components/stepper/themes/step/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"themes.js","sourceRoot":"","sources":["../../../../../src/components/stepper/themes/step/themes.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAEjE,OAAO,EAAE,MAAM,IAAI,cAAc,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,MAAM,IAAI,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,MAAM,IAAI,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAE/D,MAAM,KAAK,GAAG;IACZ,MAAM,EAAE,GAAG,CAAA;MACP,WAAW;GACd;IACD,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,cAAc;GAC9B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,aAAa;GAChB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,WAAW;GACxB;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,MAAM,EAAE,GAAG,CAAA;MACP,UAAU;GACb;IACD,SAAS,EAAE,GAAG,CAAA;MACV,SAAS,IAAI,aAAa;GAC7B;IACD,QAAQ,EAAE,GAAG,CAAA;MACT,YAAY;GACf;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM,IAAI,UAAU;GACvB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '../../../../theming/types.js';\n// Dark Overrides\nimport { styles as bootstrapDark } from './dark/step.bootstrap.css.js';\nimport { styles as fluentDark } from './dark/step.fluent.css.js';\nimport { styles as indigoDark } from './dark/step.indigo.css.js';\nimport { styles as materialDark } from './dark/step.material.css.js';\nimport { styles as sharedDark } from './dark/step.shared.css.js';\n// Light Overrides\nimport { styles as bootstrapLight } from './light/step.bootstrap.css.js';\nimport { styles as fluentLight } from './light/step.fluent.css.js';\nimport { styles as indigoLight } from './light/step.indigo.css.js';\nimport { styles as materialLight } from './light/step.material.css.js';\nimport { styles as sharedLight } from './light/step.shared.css.js';\n// Shared Styles\nimport { styles as bootstrap } from './shared/step.bootstrap.css.js';\nimport { styles as fluent } from './shared/step.fluent.css.js';\nimport { styles as indigo } from './shared/step.indigo.css.js';\n\nconst light = {\n shared: css`\n ${sharedLight}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapLight}\n `,\n material: css`\n ${materialLight}\n `,\n fluent: css`\n ${fluent} ${fluentLight}\n `,\n indigo: css`\n ${indigo} ${indigoLight}\n `,\n};\n\nconst dark = {\n shared: css`\n ${sharedDark}\n `,\n bootstrap: css`\n ${bootstrap} ${bootstrapDark}\n `,\n material: css`\n ${materialDark}\n `,\n fluent: css`\n ${fluent} ${fluentDark}\n `,\n indigo: css`\n ${indigo} ${indigoDark}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { LitElement, html } from 'lit';
|
|
2
|
-
import { styles } from './themes/tab-panel.base.css.js';
|
|
3
2
|
import { registerComponent } from '../common/definitions/register.js';
|
|
4
3
|
import { createCounter } from '../common/util.js';
|
|
4
|
+
import { styles } from './themes/tab-panel.base.css.js';
|
|
5
5
|
class IgcTabPanelComponent extends LitElement {
|
|
6
6
|
static register() {
|
|
7
|
-
registerComponent(
|
|
7
|
+
registerComponent(IgcTabPanelComponent);
|
|
8
8
|
}
|
|
9
9
|
connectedCallback() {
|
|
10
10
|
super.connectedCallback();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab-panel.js","sourceRoot":"","sources":["../../../src/components/tabs/tab-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"tab-panel.js","sourceRoot":"","sources":["../../../src/components/tabs/tab-panel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,gCAAgC,CAAC;AASxD,MAAqB,oBAAqB,SAAQ,UAAU;IAKnD,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,oBAAoB,CAAC,CAAC;IAC1C,CAAC;IAIe,iBAAiB;QAC/B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;QAClE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;QACvD,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC;gBACvB,iBAAiB,oBAAoB,CAAC,SAAS,EAAE,EAAE,CAAC;IACxD,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA,eAAe,CAAC;IAC7B,CAAC;;AAtBsB,4BAAO,GAAG,eAAe,CAAC;AAC1B,2BAAM,GAAG,MAAM,CAAC;AAOf,8BAAS,GAAG,aAAa,EAAE,CAAC;eATjC,oBAAoB","sourcesContent":["import { LitElement, html } from 'lit';\n\nimport { registerComponent } from '../common/definitions/register.js';\nimport { createCounter } from '../common/util.js';\nimport { styles } from './themes/tab-panel.base.css.js';\n\n/**\n * Represents the content of a tab\n *\n * @element igc-tab-panel\n *\n * @slot - Renders the content.\n */\nexport default class IgcTabPanelComponent extends LitElement {\n public static readonly tagName = 'igc-tab-panel';\n public static override styles = styles;\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcTabPanelComponent);\n }\n\n private static readonly increment = createCounter();\n\n public override connectedCallback() {\n super.connectedCallback();\n this.setAttribute('role', 'tabpanel');\n this.tabIndex = this.hasAttribute('tabindex') ? this.tabIndex : 0;\n this.slot = this.slot.length > 0 ? this.slot : 'panel';\n this.id =\n this.getAttribute('id') ||\n `igc-tab-panel-${IgcTabPanelComponent.increment()}`;\n }\n\n protected override render() {\n return html`<slot></slot>`;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-tab-panel': IgcTabPanelComponent;\n }\n}\n"]}
|
package/components/tabs/tab.js
CHANGED
|
@@ -7,12 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var IgcTabComponent_1;
|
|
8
8
|
import { LitElement, html } from 'lit';
|
|
9
9
|
import { property, query } from 'lit/decorators.js';
|
|
10
|
-
import { styles as shared } from './themes/shared/tab/tab.common.css.js';
|
|
11
|
-
import { all } from './themes/tab-themes.js';
|
|
12
|
-
import { styles } from './themes/tab.base.css.js';
|
|
13
10
|
import { themes } from '../../theming/theming-decorator.js';
|
|
14
11
|
import { registerComponent } from '../common/definitions/register.js';
|
|
15
12
|
import { createCounter } from '../common/util.js';
|
|
13
|
+
import { styles as shared } from './themes/shared/tab/tab.common.css.js';
|
|
14
|
+
import { all } from './themes/tab-themes.js';
|
|
15
|
+
import { styles } from './themes/tab.base.css.js';
|
|
16
16
|
let IgcTabComponent = IgcTabComponent_1 = class IgcTabComponent extends LitElement {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
@@ -21,7 +21,7 @@ let IgcTabComponent = IgcTabComponent_1 = class IgcTabComponent extends LitEleme
|
|
|
21
21
|
this.disabled = false;
|
|
22
22
|
}
|
|
23
23
|
static register() {
|
|
24
|
-
registerComponent(
|
|
24
|
+
registerComponent(IgcTabComponent_1);
|
|
25
25
|
}
|
|
26
26
|
connectedCallback() {
|
|
27
27
|
super.connectedCallback();
|
|
@@ -68,7 +68,7 @@ __decorate([
|
|
|
68
68
|
property({ type: Boolean, reflect: true })
|
|
69
69
|
], IgcTabComponent.prototype, "disabled", void 0);
|
|
70
70
|
IgcTabComponent = IgcTabComponent_1 = __decorate([
|
|
71
|
-
themes(all
|
|
71
|
+
themes(all)
|
|
72
72
|
], IgcTabComponent);
|
|
73
73
|
export default IgcTabComponent;
|
|
74
74
|
//# sourceMappingURL=tab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../src/components/tabs/tab.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"tab.js","sourceRoot":"","sources":["../../../src/components/tabs/tab.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,GAAG,EAAE,MAAM,wBAAwB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAiBnC,IAAM,eAAe,uBAArB,MAAM,eAAgB,SAAQ,UAAU;IAAxC;;QAmBN,UAAK,GAAG,EAAE,CAAC;QAOX,aAAQ,GAAG,KAAK,CAAC;QAOjB,aAAQ,GAAG,KAAK,CAAC;IAmC1B,CAAC;IA/DQ,MAAM,CAAC,QAAQ;QACpB,iBAAiB,CAAC,iBAAe,CAAC,CAAC;IACrC,CAAC;IA4Be,iBAAiB;QAC/B,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,EAAE;YACL,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,WAAW,iBAAe,CAAC,SAAS,EAAE,EAAE,CAAC;IACxE,CAAC;IAGe,KAAK,CAAC,OAAsB;QAC1C,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAGe,IAAI;QAClB,IAAI,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC;IAClB,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA;;;;wBAIS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;wBAChC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;mBACrC,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;;;;;;;;KAQtD,CAAC;IACJ,CAAC;;AAlEsB,uBAAO,GAAG,SAAS,AAAZ,CAAa;AACpB,sBAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,AAAnB,CAAoB;AAOzB,yBAAS,GAAG,aAAa,EAAE,AAAlB,CAAmB;AAG5C;IADP,KAAK,CAAC,eAAe,EAAE,IAAI,CAAC;4CACH;AAOnB;IADN,QAAQ,EAAE;8CACO;AAOX;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACnB;AAOjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;iDACnB;AAjCL,eAAe;IADnC,MAAM,CAAC,GAAG,CAAC;GACS,eAAe,CAoEnC;eApEoB,eAAe","sourcesContent":["import { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport { themes } from '../../theming/theming-decorator.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { createCounter } from '../common/util.js';\nimport { styles as shared } from './themes/shared/tab/tab.common.css.js';\nimport { all } from './themes/tab-themes.js';\nimport { styles } from './themes/tab.base.css.js';\n\n/**\n * Represents the tab header.\n *\n * @element igc-tab\n *\n * @slot prefix - Renders before the tab header content.\n * @slot - Renders the tab header content.\n * @slot suffix - Renders after the tab header content.\n *\n * @csspart content - The content wrapper.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n */\n\n@themes(all)\nexport default class IgcTabComponent extends LitElement {\n public static readonly tagName = 'igc-tab';\n public static override styles = [styles, shared];\n\n /* blazorSuppress */\n public static register() {\n registerComponent(IgcTabComponent);\n }\n\n private static readonly increment = createCounter();\n\n @query('[part=\"base\"]', true)\n private tab!: HTMLElement;\n\n /**\n * The id of the tab panel which will be controlled by the tab.\n * @attr\n */\n @property()\n public panel = '';\n\n /**\n * Determines whether the tab is selected.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n /**\n * Determines whether the tab is disabled.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public disabled = false;\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this.id =\n this.getAttribute('id') || `igc-tab-${IgcTabComponent.increment()}`;\n }\n\n /** Sets focus to the tab. */\n public override focus(options?: FocusOptions) {\n this.tab.focus(options);\n }\n\n /** Removes focus from the tab. */\n public override blur() {\n this.tab.blur();\n }\n\n protected override render() {\n return html`\n <div\n part=\"base\"\n role=\"tab\"\n aria-disabled=${this.disabled ? 'true' : 'false'}\n aria-selected=${this.selected ? 'true' : 'false'}\n tabindex=${this.disabled || !this.selected ? -1 : 0}\n >\n <slot name=\"prefix\" part=\"prefix\"></slot>\n <div part=\"content\">\n <slot></slot>\n </div>\n <slot name=\"suffix\" part=\"suffix\"></slot>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-tab': IgcTabComponent;\n }\n}\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { LitElement, nothing } from 'lit';
|
|
2
|
-
import { Ref } from 'lit/directives/ref.js';
|
|
2
|
+
import { type Ref } from 'lit/directives/ref.js';
|
|
3
|
+
import type { Constructor } from '../common/mixins/constructor.js';
|
|
3
4
|
import IgcTabPanelComponent from './tab-panel.js';
|
|
4
5
|
import IgcTabComponent from './tab.js';
|
|
5
|
-
import { Constructor } from '../common/mixins/constructor.js';
|
|
6
6
|
export interface IgcTabsEventMap {
|
|
7
7
|
igcChange: CustomEvent<IgcTabComponent>;
|
|
8
8
|
}
|
package/components/tabs/tabs.js
CHANGED
|
@@ -8,11 +8,6 @@ var IgcTabsComponent_1;
|
|
|
8
8
|
import { LitElement, html, nothing } from 'lit';
|
|
9
9
|
import { eventOptions, property, query, queryAssignedElements, state, } from 'lit/decorators.js';
|
|
10
10
|
import { createRef, ref } from 'lit/directives/ref.js';
|
|
11
|
-
import IgcTabPanelComponent from './tab-panel.js';
|
|
12
|
-
import IgcTabComponent from './tab.js';
|
|
13
|
-
import { styles as shared } from './themes/shared/tabs/tabs.common.css.js';
|
|
14
|
-
import { all } from './themes/tabs-themes.js';
|
|
15
|
-
import { styles } from './themes/tabs.base.css.js';
|
|
16
11
|
import { themes } from '../../theming/theming-decorator.js';
|
|
17
12
|
import IgcIconButtonComponent from '../button/icon-button.js';
|
|
18
13
|
import { addKeybindings, arrowLeft, arrowRight, endKey, homeKey, } from '../common/controllers/key-bindings.js';
|
|
@@ -22,9 +17,14 @@ import { watch } from '../common/decorators/watch.js';
|
|
|
22
17
|
import { registerComponent } from '../common/definitions/register.js';
|
|
23
18
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
24
19
|
import { createCounter, getOffset, isLTR, wrap } from '../common/util.js';
|
|
20
|
+
import IgcTabPanelComponent from './tab-panel.js';
|
|
21
|
+
import IgcTabComponent from './tab.js';
|
|
22
|
+
import { styles as shared } from './themes/shared/tabs/tabs.common.css.js';
|
|
23
|
+
import { all } from './themes/tabs-themes.js';
|
|
24
|
+
import { styles } from './themes/tabs.base.css.js';
|
|
25
25
|
let IgcTabsComponent = IgcTabsComponent_1 = class IgcTabsComponent extends EventEmitterMixin(LitElement) {
|
|
26
26
|
static register() {
|
|
27
|
-
registerComponent(
|
|
27
|
+
registerComponent(IgcTabsComponent_1, IgcTabComponent, IgcTabPanelComponent, IgcIconButtonComponent);
|
|
28
28
|
}
|
|
29
29
|
get _closestActiveTabIndex() {
|
|
30
30
|
const root = this.getRootNode();
|
|
@@ -124,7 +124,8 @@ let IgcTabsComponent = IgcTabsComponent_1 = class IgcTabsComponent extends Event
|
|
|
124
124
|
this.updateScrollButtons();
|
|
125
125
|
}
|
|
126
126
|
updateScrollButtons() {
|
|
127
|
-
const { scrollLeft, offsetWidth } = this.container
|
|
127
|
+
const { scrollLeft, offsetWidth } = this.container;
|
|
128
|
+
const { scrollWidth } = this.wrapper;
|
|
128
129
|
this.disableEndScrollButton =
|
|
129
130
|
scrollWidth <= Math.abs(scrollLeft) + offsetWidth;
|
|
130
131
|
this.disableStartScrollButton = scrollLeft === 0;
|
|
@@ -137,7 +138,9 @@ let IgcTabsComponent = IgcTabsComponent_1 = class IgcTabsComponent extends Event
|
|
|
137
138
|
[this.container, this.wrapper, ...this.tabs].forEach((element) => this.resizeObserver.observe(element));
|
|
138
139
|
}
|
|
139
140
|
updateSelectedTab() {
|
|
140
|
-
this.tabs.forEach((tab) =>
|
|
141
|
+
this.tabs.forEach((tab) => {
|
|
142
|
+
tab.selected = tab === this.activeTab;
|
|
143
|
+
});
|
|
141
144
|
this.panels.forEach((panel) => {
|
|
142
145
|
panel.hidden = panel.id !== this.activeTab?.panel;
|
|
143
146
|
});
|
|
@@ -167,7 +170,8 @@ let IgcTabsComponent = IgcTabsComponent_1 = class IgcTabsComponent extends Event
|
|
|
167
170
|
}
|
|
168
171
|
scrollByTabOffset(direction) {
|
|
169
172
|
const { scrollLeft, offsetWidth } = this.container;
|
|
170
|
-
const LTR = isLTR(this)
|
|
173
|
+
const LTR = isLTR(this);
|
|
174
|
+
const next = direction === 'end';
|
|
171
175
|
const pivot = Math.abs(next ? offsetWidth + scrollLeft : scrollLeft);
|
|
172
176
|
let amount = this.tabs
|
|
173
177
|
.map((tab) => ({
|
|
@@ -316,7 +320,7 @@ __decorate([
|
|
|
316
320
|
eventOptions({ passive: true })
|
|
317
321
|
], IgcTabsComponent.prototype, "handleScroll", null);
|
|
318
322
|
IgcTabsComponent = IgcTabsComponent_1 = __decorate([
|
|
319
|
-
themes(all
|
|
323
|
+
themes(all),
|
|
320
324
|
blazorAdditionalDependencies('IgcTabComponent, IgcTabPanelComponent')
|
|
321
325
|
], IgcTabsComponent);
|
|
322
326
|
export default IgcTabsComponent;
|