igniteui-webcomponents 4.8.1 → 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 +24 -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/dark/button.material.css.js +1 -1
- package/components/button/themes/button/dark/button.material.css.js.map +1 -1
- package/components/button/themes/button/light/button.material.css.js +1 -1
- package/components/button/themes/button/light/button.material.css.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 +3 -3
- package/components/calendar/calendar.js +19 -22
- 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.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/calendar.d.ts +1 -1
- package/components/calendar/themes/calendar.js +3 -2
- package/components/calendar/themes/calendar.js.map +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/dark/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/dark/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js +1 -1
- package/components/calendar/themes/dark/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/days-view.base.css.js +1 -1
- package/components/calendar/themes/days-view.base.css.js.map +1 -1
- package/components/calendar/themes/days.d.ts +1 -1
- package/components/calendar/themes/days.js +3 -2
- package/components/calendar/themes/days.js.map +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/light/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/light/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.material.css.js +1 -1
- package/components/calendar/themes/light/calendar.material.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/year-month-view.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/year-month-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/year-month-view.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/year-month-view.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +3 -0
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -0
- package/components/calendar/themes/shared/indigo/year-month-view.indigo.css.d.ts +1 -0
- package/components/calendar/themes/shared/indigo/year-month-view.indigo.css.js +3 -0
- package/components/calendar/themes/shared/indigo/year-month-view.indigo.css.js.map +1 -0
- package/components/calendar/themes/shared/material/calendar.material.css.d.ts +1 -0
- package/components/calendar/themes/shared/material/calendar.material.css.js +3 -0
- package/components/calendar/themes/shared/material/calendar.material.css.js.map +1 -0
- package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
- package/components/calendar/themes/shared/material/year-month-view.material.css.js +1 -1
- package/components/calendar/themes/shared/material/year-month-view.material.css.js.map +1 -1
- package/components/calendar/themes/year-month-view.base.css.js +1 -1
- package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
- package/components/calendar/themes/year-month.d.ts +1 -1
- package/components/calendar/themes/year-month.js +3 -2
- 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 +3 -5
- 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/shared/switch/switch.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.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 +5 -5
- 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/list/themes/shared/item/list-item.bootstrap.css.js +1 -1
- package/components/list/themes/shared/item/list-item.bootstrap.css.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 +7 -0
- package/components/nav-drawer/themes/item.js.map +1 -1
- package/components/nav-drawer/themes/shared/item/item.bootstrap.css.d.ts +1 -0
- package/components/nav-drawer/themes/shared/item/item.bootstrap.css.js +3 -0
- package/components/nav-drawer/themes/shared/item/item.bootstrap.css.js.map +1 -0
- 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 +22 -18
- 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/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.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/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/themes/light/bootstrap.css +1 -1
- package/themes/light/fluent.css +1 -1
- package/themes/light/indigo.css +1 -1
- package/themes/light/material.css +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
- package/components/calendar/themes/shared/material/calendar.common.css.js +0 -3
- package/components/calendar/themes/shared/material/calendar.common.css.js.map +0 -1
- /package/components/calendar/themes/shared/{material/calendar.common.css.d.ts → indigo/days-view.indigo.css.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/combo-box.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"combo-box.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/combo-box.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAUvC,MAAM,OAAgB,4BAA6B,SAAQ,UAAU;IAArE;;QAcS,qBAAgB,GAAG,KAAK,CAAC;Q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AK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,KAAK,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAChD,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,qBAAqB,CAEnC,KAAU,EAAE,IAAO;IACnB,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpC,KAAK,IAAI,CAAC,GAAG,OAAO,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;YACvB,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAEtC,KAAU;IACV,MAAM,YAAY,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAE1E,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,KAAK,YAAY,EAAE,CAAC;YAC1B,IAAI,CAAC,QAAQ,GAAG,KAAK,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,YAAY,CAAC;AACtB,CAAC","sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { iterNodes } from '../util.js';\nimport type { UnpackCustomEvent } from './event-emitter.js';\n\ninterface IgcBaseComboBoxEventMap {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n}\n\nexport abstract class IgcBaseComboBoxLikeComponent extends LitElement {\n public declare emitEvent: <\n K extends keyof IgcBaseComboBoxEventMap,\n D extends UnpackCustomEvent<IgcBaseComboBoxEventMap[K]>,\n >(\n event: K,\n eventInitDict?: CustomEventInit<D>\n ) => boolean;\n\n /**\n * Whether the component dropdown should be kept open on selection.\n * @attr keep-open-on-select\n */\n @property({ type: Boolean, reflect: true, attribute: 'keep-open-on-select' })\n public keepOpenOnSelect = false;\n\n /**\n * Whether the component dropdown should be kept open on clicking outside of it.\n * @attr keep-open-on-outside-click\n */\n @property({\n type: Boolean,\n reflect: true,\n attribute: 'keep-open-on-outside-click',\n })\n public keepOpenOnOutsideClick = false;\n\n /**\n * Sets the open state of the component.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public open = false;\n\n protected emitClosing() {\n return this.emitEvent('igcClosing', { cancelable: true });\n }\n\n protected emitClosed() {\n return this.emitEvent('igcClosed');\n }\n\n protected emitOpening() {\n return this.emitEvent('igcOpening', { cancelable: true });\n }\n\n protected emitOpened() {\n return this.emitEvent('igcOpened');\n }\n\n protected handleAnchorClick() {\n this.open ? this._hide(true) : this._show(true);\n }\n\n protected async _hide(emitEvent = false) {\n if (!this.open || (emitEvent && !this.emitClosing())) {\n return false;\n }\n\n this.open = false;\n\n if (emitEvent) {\n await this.updateComplete;\n return this.emitClosed();\n }\n\n return false;\n }\n\n protected async _show(emitEvent = false) {\n if (this.open || (emitEvent && !this.emitOpening())) {\n return false;\n }\n\n this.open = true;\n\n if (emitEvent) {\n await this.updateComplete;\n return this.emitOpened();\n }\n\n return false;\n }\n\n /** Shows the component. */\n public show() {\n this._show();\n }\n\n /** Hides the component. */\n public hide() {\n this._hide();\n }\n\n /** Toggles the open state of the component. */\n public toggle() {\n this.open ? this.hide() : this.show();\n }\n}\n\nexport function getItems<T extends HTMLElement>(root: Node, tagName: string) {\n return iterNodes<T>(root, 'SHOW_ELEMENT', (item) => item.matches(tagName));\n}\n\nexport function getActiveItems<T extends HTMLElement & { disabled: boolean }>(\n root: Node,\n tagName: string\n) {\n return iterNodes<T>(\n root,\n 'SHOW_ELEMENT',\n (item) => item.matches(tagName) && !item.disabled\n );\n}\n\nexport function getNextActiveItem<\n T extends HTMLElement & { disabled: boolean },\n>(items: T[], from: T) {\n const current = items.indexOf(from);\n\n for (let i = current + 1; i < items.length; i++) {\n if (!items[i].disabled) {\n return items[i];\n }\n }\n\n return items[current];\n}\n\nexport function getPreviousActiveItem<\n T extends HTMLElement & { disabled: boolean },\n>(items: T[], from: T) {\n const current = items.indexOf(from);\n\n for (let i = current - 1; i >= 0; i--) {\n if (!items[i].disabled) {\n return items[i];\n }\n }\n\n return items[current];\n}\n\nexport function setInitialSelectionState<\n T extends HTMLElement & { selected: boolean },\n>(items: T[]) {\n const lastSelected = items.filter((item) => item.selected).at(-1) ?? null;\n\n for (const item of items) {\n if (item !== lastSelected) {\n item.selected = false;\n }\n }\n\n return lastSelected;\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type Constructor<T =
|
|
2
|
-
export type AbstractConstructor<T =
|
|
1
|
+
export type Constructor<T = object> = new (...args: any[]) => T;
|
|
2
|
+
export type AbstractConstructor<T = object> = abstract new (...args: any[]) => T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/constructor.ts"],"names":[],"mappings":"","sourcesContent":["export type Constructor<T =
|
|
1
|
+
{"version":3,"file":"constructor.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/constructor.ts"],"names":[],"mappings":"","sourcesContent":["export type Constructor<T = object> = new (...args: any[]) => T;\n\nexport type AbstractConstructor<T = object> = abstract new (\n ...args: any[]\n) => T;\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
2
2
|
import type { AbstractConstructor, Constructor } from './constructor';
|
|
3
3
|
export type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never;
|
|
4
4
|
export declare class EventEmitterInterface<E> {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event-emitter.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/event-emitter.ts"],"names":[],"mappings":"AAuCA,MAAM,UAAU,iBAAiB,CAC/B,UAAa;IAEb,MAAM,mBAAoB,SAAQ,UAAU;QAY1B,gBAAgB,CAC9B,IAAY,EACZ,QAA4C,EAC5C,OAA2C;YAE3C,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;QAae,mBAAmB,CACjC,IAAY,EACZ,QAA4C,EAC5C,OAAwC;YAExC,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;QAKM,SAAS,CACd,IAAO,EACP,aAAkC;YAElC,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,WAAW,CACb,IAAc,EACd,MAAM,CAAC,MAAM,CACX;gBACE,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,EAAE;aACX,EACD,aAAa,CACd,CACF,CACF,CAAC;QACJ,CAAC;KACF;IACD,OAAO,mBAAgE,CAAC;AAC1E,CAAC","sourcesContent":["import { LitElement } from 'lit';\n\nimport type { AbstractConstructor, Constructor } from './constructor';\n\nexport type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never;\n\nexport declare class EventEmitterInterface<E> {\n public addEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n public addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void;\n public removeEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n public removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void;\n public emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(\n type: K,\n eventInitDict?: CustomEventInit<D>\n ): boolean;\n}\n\nexport function EventEmitterMixin<E, T extends AbstractConstructor<LitElement>>(\n superClass: T\n): Constructor<EventEmitterInterface<E>> & T;\nexport function EventEmitterMixin<E, T extends Constructor<LitElement>>(\n superClass: T\n) {\n class EventEmitterElement extends superClass {\n /**\n * @private\n */\n public override addEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n public override addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void {\n super.addEventListener(type, listener, options);\n }\n\n /**\n * @private\n */\n public override removeEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n public override removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void {\n super.removeEventListener(type, listener, options);\n }\n\n /**\n * @private\n */\n public emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(\n type: K,\n eventInitDict?: CustomEventInit<D>\n ): boolean {\n return this.dispatchEvent(\n new CustomEvent<D>(\n type as string,\n Object.assign(\n {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail: {},\n },\n eventInitDict\n )\n )\n );\n }\n }\n return EventEmitterElement as Constructor<EventEmitterInterface<E>> & T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"event-emitter.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/event-emitter.ts"],"names":[],"mappings":"AAuCA,MAAM,UAAU,iBAAiB,CAC/B,UAAa;IAEb,MAAM,mBAAoB,SAAQ,UAAU;QAY1B,gBAAgB,CAC9B,IAAY,EACZ,QAA4C,EAC5C,OAA2C;YAE3C,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QAClD,CAAC;QAae,mBAAmB,CACjC,IAAY,EACZ,QAA4C,EAC5C,OAAwC;YAExC,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC;QACrD,CAAC;QAKM,SAAS,CACd,IAAO,EACP,aAAkC;YAElC,OAAO,IAAI,CAAC,aAAa,CACvB,IAAI,WAAW,CACb,IAAc,EACd,MAAM,CAAC,MAAM,CACX;gBACE,OAAO,EAAE,IAAI;gBACb,UAAU,EAAE,KAAK;gBACjB,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE,EAAE;aACX,EACD,aAAa,CACd,CACF,CACF,CAAC;QACJ,CAAC;KACF;IACD,OAAO,mBAAgE,CAAC;AAC1E,CAAC","sourcesContent":["import type { LitElement } from 'lit';\n\nimport type { AbstractConstructor, Constructor } from './constructor';\n\nexport type UnpackCustomEvent<T> = T extends CustomEvent<infer U> ? U : never;\n\nexport declare class EventEmitterInterface<E> {\n public addEventListener<K extends keyof M, M extends E & HTMLElementEventMap>(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n public addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void;\n public removeEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n public removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void;\n public emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(\n type: K,\n eventInitDict?: CustomEventInit<D>\n ): boolean;\n}\n\nexport function EventEmitterMixin<E, T extends AbstractConstructor<LitElement>>(\n superClass: T\n): Constructor<EventEmitterInterface<E>> & T;\nexport function EventEmitterMixin<E, T extends Constructor<LitElement>>(\n superClass: T\n) {\n class EventEmitterElement extends superClass {\n /**\n * @private\n */\n public override addEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | AddEventListenerOptions\n ): void;\n public override addEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | AddEventListenerOptions\n ): void {\n super.addEventListener(type, listener, options);\n }\n\n /**\n * @private\n */\n public override removeEventListener<\n K extends keyof M,\n M extends E & HTMLElementEventMap,\n >(\n type: K,\n listener: (this: HTMLElement, ev: M[K]) => any,\n options?: boolean | EventListenerOptions\n ): void;\n public override removeEventListener(\n type: string,\n listener: EventListenerOrEventListenerObject,\n options?: boolean | EventListenerOptions\n ): void {\n super.removeEventListener(type, listener, options);\n }\n\n /**\n * @private\n */\n public emitEvent<K extends keyof E, D extends UnpackCustomEvent<E[K]>>(\n type: K,\n eventInitDict?: CustomEventInit<D>\n ): boolean {\n return this.dispatchEvent(\n new CustomEvent<D>(\n type as string,\n Object.assign(\n {\n bubbles: true,\n cancelable: false,\n composed: true,\n detail: {},\n },\n eventInitDict\n )\n )\n );\n }\n }\n return EventEmitterElement as Constructor<EventEmitterInterface<E>> & T;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
2
2
|
import type { Constructor } from './constructor.js';
|
|
3
|
-
import { FormAssociatedElementInterface } from './form-associated.js';
|
|
3
|
+
import { type FormAssociatedElementInterface } from './form-associated.js';
|
|
4
4
|
export declare class FormRequiredInterface {
|
|
5
5
|
protected requiredChange(): void;
|
|
6
6
|
/**
|
|
@@ -5,8 +5,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
import { property } from 'lit/decorators.js';
|
|
8
|
-
import { FormAssociatedMixin, } from './form-associated.js';
|
|
9
8
|
import { watch } from '../decorators/watch.js';
|
|
9
|
+
import { FormAssociatedMixin, } from './form-associated.js';
|
|
10
10
|
export function FormAssociatedRequiredMixin(superClass) {
|
|
11
11
|
class FormAssociatedRequiredElement extends FormAssociatedMixin(superClass) {
|
|
12
12
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-associated-required.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/form-associated-required.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"form-associated-required.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/form-associated-required.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAE/C,OAAO,EAEL,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAgB9B,MAAM,UAAU,2BAA2B,CACzC,UAAa;IAEb,MAAM,6BAA8B,SAAQ,mBAAmB,CAAC,UAAU,CAAC;QAA3E;;YAMS,aAAQ,GAAG,KAAK,CAAC;QAO1B,CAAC;QAJW,cAAc;YACtB,IAAI,CAAC,cAAc,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,CAAC;KACF;IAPQ;QADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;mEACnB;IAGd;QADT,KAAK,CAAC,UAAU,EAAE,EAAE,oBAAoB,EAAE,IAAI,EAAE,CAAC;uEAIjD;IAGH,OAAO,6BAGJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { watch } from '../decorators/watch.js';\nimport type { Constructor } from './constructor.js';\nimport {\n type FormAssociatedElementInterface,\n FormAssociatedMixin,\n} from './form-associated.js';\n\nexport declare class FormRequiredInterface {\n protected requiredChange(): void;\n\n /**\n * Makes the control a required field in a form context.\n * @attr\n */\n public required: boolean;\n}\n\n/**\n * Turns the passed class element into a Form Associated Custom Element with\n * additional `required` attribute.\n */\nexport function FormAssociatedRequiredMixin<T extends Constructor<LitElement>>(\n superClass: T\n) {\n class FormAssociatedRequiredElement extends FormAssociatedMixin(superClass) {\n /**\n * Makes the control a required field in a form context.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public required = false;\n\n @watch('required', { waitUntilFirstUpdate: true })\n protected requiredChange() {\n this.updateValidity();\n this.invalid = !this.checkValidity();\n }\n }\n\n return FormAssociatedRequiredElement as unknown as Constructor<\n FormRequiredInterface & FormAssociatedElementInterface\n > &\n T;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
import type { Constructor } from './constructor';
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
3
2
|
import type { Validator } from '../validators.js';
|
|
3
|
+
import type { Constructor } from './constructor';
|
|
4
4
|
export declare class FormAssociatedElementInterface {
|
|
5
5
|
static readonly formAssociated: boolean;
|
|
6
6
|
private __internals;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-associated.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/form-associated.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA0H7C,MAAM,UAAU,mBAAmB,CACjC,UAAa;IAE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AO,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,CAAC;;IAvNsB,oCAAc,GAAG,IAAI,AAAP,CAAQ;IAyBtC;QADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACP;IAmCrB;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDAI1C;IAaD;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAI1C;IA2IH,OAAO,qBACJ,CAAC;AACN,CAAC","sourcesContent":["import { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { Constructor } from './constructor';\nimport type { Validator } from '../validators.js';\n\nexport declare class FormAssociatedElementInterface {\n public static readonly formAssociated: boolean;\n\n private __internals: ElementInternals;\n protected validators: Validator[];\n protected _disabled: boolean;\n protected _invalid: boolean;\n protected _dirty: boolean;\n\n /**\n * The default value of the control at \"creation\" time.\n *\n * @remarks\n * This is set by default on `connectedCallback` through the `setDefaultValue` call.\n * It expects the component to have either a `checked` or a `value` property and binds it to the initial value of the\n * respective property.\n *\n * In use-cases where additional customization is required, make sure to override the `setDefaultValue` method.\n */\n protected _defaultValue: unknown;\n\n /**\n * Applies the {@link FormAssociatedElementInterface.invalid | `invalid`} attribute on the control and the associated styles\n * if the element has completed the first update cycle or it has been interacted with by the user.\n *\n * Usually, it should be called after {@link FormAssociatedElementInterface.updateValidity | `updateValidity()`}\n */\n protected setInvalidState(): void;\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected updateValidity(message?: string): void;\n\n /**\n * Saves the initial value/checked state of the control.\n *\n * Called on connectedCallback.\n */\n protected setDefaultValue(): void;\n\n /**\n * Called when the parent form is reset.\n *\n * Restores the initially bound value/checked state of the control.\n */\n protected restoreDefaultValue(): void;\n\n protected setFormValue(\n value: string | File | FormData | null,\n state?: string | File | FormData | null | undefined\n ): void;\n protected setValidity(\n flags?: ValidityStateFlags | undefined,\n message?: string | undefined,\n anchor?: HTMLElement | undefined\n ): void;\n\n protected formResetCallback(): void;\n protected formDisabledCallback(state: boolean): void;\n protected formStateRestoreCallback(\n state: string | FormData | File,\n mode: 'autocomplete' | 'restore'\n ): void;\n\n /**\n * The disabled state of the component\n * @attr [disabled=false]\n */\n public disabled: boolean;\n\n /**\n * Control the validity of the control.\n * @attr\n */\n public invalid: boolean;\n\n /**\n * The name attribute of the control.\n * @attr\n */\n public name: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null;\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState;\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string;\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean;\n\n /** Checks for validity of the control and emits the invalid event if it invalid. */\n public checkValidity(): boolean;\n\n /** Checks for validity of the control and shows the browser message if it invalid. */\n public reportValidity(): boolean;\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string): void;\n}\n\n/**\n * Turns the passed class element into a Form Associated Custom Element.\n */\nexport function FormAssociatedMixin<T extends Constructor<LitElement>>(\n superClass: T\n) {\n class FormAssociatedElement extends superClass {\n public static readonly formAssociated = true;\n\n private __internals: ElementInternals;\n protected validators: Validator[] = [];\n protected _disabled = false;\n protected _invalid = false;\n protected _dirty = false;\n\n /**\n * The default value of the control at \"creation\" time.\n *\n * @remarks\n * This is set by default on `connectedCallback` through the `setDefaultValue` call.\n * It expects the component to have either a `checked` or a `value` property and binds it to the initial value of the\n * respective property.\n *\n * In use-cases where additional customization is required, make sure to override the `setDefaultValue` method.\n */\n protected _defaultValue: unknown;\n\n /**\n * The name attribute of the control.\n * @attr\n */\n @property({ reflect: true })\n public name!: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null {\n return this.__internals.form;\n }\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState {\n return this.__internals.validity;\n }\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string {\n return this.__internals.validationMessage;\n }\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean {\n return this.__internals.willValidate;\n }\n\n /**\n * The disabled state of the component\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set disabled(value: boolean) {\n this._disabled = value;\n this.toggleAttribute('disabled', Boolean(this._disabled));\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Control the validity of the control.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set invalid(value: boolean) {\n this._invalid = value;\n this.toggleAttribute('invalid', Boolean(this._invalid));\n }\n\n public get invalid(): boolean {\n return this._invalid;\n }\n\n constructor(...args: any[]) {\n super(args);\n this.__internals = this.attachInternals();\n this.addEventListener('invalid', this.handleInvalid);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this._dirty = false;\n this.setDefaultValue();\n }\n\n /**\n * Saves the initial value/checked state of the control.\n *\n * Called on connectedCallback.\n */\n protected setDefaultValue() {\n if ('checked' in this) {\n this._defaultValue = this.checked;\n } else if ('value' in this) {\n this._defaultValue = this.value;\n }\n }\n\n /**\n * Called when the parent form is reset.\n *\n * Restores the initially bound value/checked state of the control.\n */\n protected restoreDefaultValue() {\n if ('checked' in this) {\n this.checked = this._defaultValue;\n } else if ('value' in this) {\n this.value = this._defaultValue;\n }\n }\n\n protected handleInvalid = (event: Event) => {\n event.preventDefault();\n this.invalid = true;\n };\n\n protected setFormValue(\n value: string | File | FormData | null,\n state?: string | File | FormData | null | undefined\n ) {\n this.__internals.setFormValue(value, state || value);\n }\n\n protected setValidity(\n flags?: ValidityStateFlags | undefined,\n message?: string | undefined,\n anchor?: HTMLElement | undefined\n ) {\n this.__internals.setValidity(flags, message, anchor);\n }\n\n protected formResetCallback() {\n this.restoreDefaultValue();\n this._dirty = false;\n\n // Apply any changes happening during form reset synchronously\n this.performUpdate();\n\n this.invalid = false;\n }\n\n protected formDisabledCallback(state: boolean) {\n this._disabled = state;\n this.requestUpdate();\n }\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected updateValidity(message?: string) {\n const validity: ValidityStateFlags = {};\n let validationMessage = '';\n\n for (const validator of this.validators) {\n const isValid = validator.isValid(this);\n\n validity[validator.key] = !isValid;\n\n if (!isValid) {\n validationMessage =\n typeof validator.message === 'function'\n ? validator.message(this)\n : validator.message;\n }\n }\n\n if (message) {\n validity.customError = true;\n validationMessage = message;\n }\n\n this.__internals.setValidity(validity, validationMessage);\n }\n\n /**\n * Applies the {@link FormAssociatedElementInterface.invalid | `invalid`} attribute on the control and the associated styles\n * if the element has completed the first update cycle or it has been interacted with by the user.\n *\n * Usually, it should be called after {@link FormAssociatedElementInterface.updateValidity | `updateValidity()`}\n */\n protected setInvalidState() {\n if (this.hasUpdated || this._dirty) {\n this.invalid = !this.checkValidity();\n }\n }\n\n /** Checks for validity of the control and shows the browser message if it invalid. */\n public reportValidity() {\n return this.__internals.reportValidity();\n }\n\n /** Checks for validity of the control and emits the invalid event if it invalid. */\n public checkValidity() {\n return this.__internals.checkValidity();\n }\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string) {\n this.updateValidity(message);\n this.invalid = !this.checkValidity();\n }\n }\n\n return FormAssociatedElement as unknown as Constructor<FormAssociatedElementInterface> &\n T;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"form-associated.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/form-associated.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AA0H7C,MAAM,UAAU,mBAAmB,CACjC,UAAa;IAEb,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,GAAG,CAAC,IAAI,CAAC,aAAa,EAAE,CAAC;QACvC,CAAC;;IAvNsB,oCAAc,GAAG,IAAI,AAAP,CAAQ;IAyBtC;QADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;uDACP;IAmCrB;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDAI1C;IAaD;QADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAI1C;IA2IH,OAAO,qBACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport type { Validator } from '../validators.js';\nimport type { Constructor } from './constructor';\n\nexport declare class FormAssociatedElementInterface {\n public static readonly formAssociated: boolean;\n\n private __internals: ElementInternals;\n protected validators: Validator[];\n protected _disabled: boolean;\n protected _invalid: boolean;\n protected _dirty: boolean;\n\n /**\n * The default value of the control at \"creation\" time.\n *\n * @remarks\n * This is set by default on `connectedCallback` through the `setDefaultValue` call.\n * It expects the component to have either a `checked` or a `value` property and binds it to the initial value of the\n * respective property.\n *\n * In use-cases where additional customization is required, make sure to override the `setDefaultValue` method.\n */\n protected _defaultValue: unknown;\n\n /**\n * Applies the {@link FormAssociatedElementInterface.invalid | `invalid`} attribute on the control and the associated styles\n * if the element has completed the first update cycle or it has been interacted with by the user.\n *\n * Usually, it should be called after {@link FormAssociatedElementInterface.updateValidity | `updateValidity()`}\n */\n protected setInvalidState(): void;\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected updateValidity(message?: string): void;\n\n /**\n * Saves the initial value/checked state of the control.\n *\n * Called on connectedCallback.\n */\n protected setDefaultValue(): void;\n\n /**\n * Called when the parent form is reset.\n *\n * Restores the initially bound value/checked state of the control.\n */\n protected restoreDefaultValue(): void;\n\n protected setFormValue(\n value: string | File | FormData | null,\n state?: string | File | FormData | null | undefined\n ): void;\n protected setValidity(\n flags?: ValidityStateFlags | undefined,\n message?: string | undefined,\n anchor?: HTMLElement | undefined\n ): void;\n\n protected formResetCallback(): void;\n protected formDisabledCallback(state: boolean): void;\n protected formStateRestoreCallback(\n state: string | FormData | File,\n mode: 'autocomplete' | 'restore'\n ): void;\n\n /**\n * The disabled state of the component\n * @attr [disabled=false]\n */\n public disabled: boolean;\n\n /**\n * Control the validity of the control.\n * @attr\n */\n public invalid: boolean;\n\n /**\n * The name attribute of the control.\n * @attr\n */\n public name: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null;\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState;\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string;\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean;\n\n /** Checks for validity of the control and emits the invalid event if it invalid. */\n public checkValidity(): boolean;\n\n /** Checks for validity of the control and shows the browser message if it invalid. */\n public reportValidity(): boolean;\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string): void;\n}\n\n/**\n * Turns the passed class element into a Form Associated Custom Element.\n */\nexport function FormAssociatedMixin<T extends Constructor<LitElement>>(\n superClass: T\n) {\n class FormAssociatedElement extends superClass {\n public static readonly formAssociated = true;\n\n private __internals: ElementInternals;\n protected validators: Validator[] = [];\n protected _disabled = false;\n protected _invalid = false;\n protected _dirty = false;\n\n /**\n * The default value of the control at \"creation\" time.\n *\n * @remarks\n * This is set by default on `connectedCallback` through the `setDefaultValue` call.\n * It expects the component to have either a `checked` or a `value` property and binds it to the initial value of the\n * respective property.\n *\n * In use-cases where additional customization is required, make sure to override the `setDefaultValue` method.\n */\n protected _defaultValue: unknown;\n\n /**\n * The name attribute of the control.\n * @attr\n */\n @property({ reflect: true })\n public name!: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null {\n return this.__internals.form;\n }\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState {\n return this.__internals.validity;\n }\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string {\n return this.__internals.validationMessage;\n }\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean {\n return this.__internals.willValidate;\n }\n\n /**\n * The disabled state of the component\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set disabled(value: boolean) {\n this._disabled = value;\n this.toggleAttribute('disabled', Boolean(this._disabled));\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Control the validity of the control.\n *\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public set invalid(value: boolean) {\n this._invalid = value;\n this.toggleAttribute('invalid', Boolean(this._invalid));\n }\n\n public get invalid(): boolean {\n return this._invalid;\n }\n\n constructor(...args: any[]) {\n super(args);\n this.__internals = this.attachInternals();\n this.addEventListener('invalid', this.handleInvalid);\n }\n\n public override connectedCallback(): void {\n super.connectedCallback();\n this._dirty = false;\n this.setDefaultValue();\n }\n\n /**\n * Saves the initial value/checked state of the control.\n *\n * Called on connectedCallback.\n */\n protected setDefaultValue() {\n if ('checked' in this) {\n this._defaultValue = this.checked;\n } else if ('value' in this) {\n this._defaultValue = this.value;\n }\n }\n\n /**\n * Called when the parent form is reset.\n *\n * Restores the initially bound value/checked state of the control.\n */\n protected restoreDefaultValue() {\n if ('checked' in this) {\n this.checked = this._defaultValue;\n } else if ('value' in this) {\n this.value = this._defaultValue;\n }\n }\n\n protected handleInvalid = (event: Event) => {\n event.preventDefault();\n this.invalid = true;\n };\n\n protected setFormValue(\n value: string | File | FormData | null,\n state?: string | File | FormData | null | undefined\n ) {\n this.__internals.setFormValue(value, state || value);\n }\n\n protected setValidity(\n flags?: ValidityStateFlags | undefined,\n message?: string | undefined,\n anchor?: HTMLElement | undefined\n ) {\n this.__internals.setValidity(flags, message, anchor);\n }\n\n protected formResetCallback() {\n this.restoreDefaultValue();\n this._dirty = false;\n\n // Apply any changes happening during form reset synchronously\n this.performUpdate();\n\n this.invalid = false;\n }\n\n protected formDisabledCallback(state: boolean) {\n this._disabled = state;\n this.requestUpdate();\n }\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected updateValidity(message?: string) {\n const validity: ValidityStateFlags = {};\n let validationMessage = '';\n\n for (const validator of this.validators) {\n const isValid = validator.isValid(this);\n\n validity[validator.key] = !isValid;\n\n if (!isValid) {\n validationMessage =\n typeof validator.message === 'function'\n ? validator.message(this)\n : validator.message;\n }\n }\n\n if (message) {\n validity.customError = true;\n validationMessage = message;\n }\n\n this.__internals.setValidity(validity, validationMessage);\n }\n\n /**\n * Applies the {@link FormAssociatedElementInterface.invalid | `invalid`} attribute on the control and the associated styles\n * if the element has completed the first update cycle or it has been interacted with by the user.\n *\n * Usually, it should be called after {@link FormAssociatedElementInterface.updateValidity | `updateValidity()`}\n */\n protected setInvalidState() {\n if (this.hasUpdated || this._dirty) {\n this.invalid = !this.checkValidity();\n }\n }\n\n /** Checks for validity of the control and shows the browser message if it invalid. */\n public reportValidity() {\n return this.__internals.reportValidity();\n }\n\n /** Checks for validity of the control and emits the invalid event if it invalid. */\n public checkValidity() {\n return this.__internals.checkValidity();\n }\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string) {\n this.updateValidity(message);\n this.invalid = !this.checkValidity();\n }\n }\n\n return FormAssociatedElement as unknown as Constructor<FormAssociatedElementInterface> &\n T;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sizable.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/sizable.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"sizable.js","sourceRoot":"","sources":["../../../../src/components/common/mixins/sizable.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAc/C,MAAM,CAAC,MAAM,YAAY,GAAG,CAC1B,UAAa,EACb,EAAE;IACF,MAAM,cAAe,SAAQ,UAAU;QAAvC;;YASS,SAAI,GAAiC,OAAO,CAAC;QAStD,CAAC;QANW,UAAU;YAClB,IAAI,CAAC,KAAK,CAAC,WAAW,CACpB,kBAAkB,EAClB,gCAAgC,IAAI,CAAC,IAAI,IAAI,CAC9C,CAAC;QACJ,CAAC;KACF;IATQ;QADN,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;gDACwB;IAG1C;QADT,KAAK,CAAC,MAAM,CAAC;oDAMb;IAEH,OAAO,cAAmD,CAAC;AAC7D,CAAC,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\n\nimport { watch } from '../decorators/watch.js';\nimport type { Constructor } from './constructor';\n\nexport declare class SizableInterface {\n /**\n * Determines the size of the component.\n * @attr\n * @type {\"small\" | \"medium\" | \"large\"}\n *\n * @deprecated since v4.5.0. Use the `--ig-size` CSS custom property instead.\n */\n public size: 'small' | 'medium' | 'large';\n}\n\nexport const SizableMixin = <T extends Constructor<LitElement>>(\n superClass: T\n) => {\n class SizableElement extends superClass {\n /**\n * Determines the size of the component.\n * @attr\n * @type {\"small\" | \"medium\" | \"large\"}\n *\n * @deprecated since v4.5.0. Use the `--ig-size` CSS custom property instead.\n */\n @property({ reflect: true })\n public size: 'small' | 'medium' | 'large' = 'large';\n\n @watch('size')\n protected updateSize() {\n this.style.setProperty(\n '--component-size',\n `var(--ig-size, var(--ig-size-${this.size}))`\n );\n }\n }\n return SizableElement as Constructor<SizableInterface> & T;\n};\n"]}
|
|
@@ -25,13 +25,15 @@ export declare function createCounter(): () => number;
|
|
|
25
25
|
export declare function isLTR(element: HTMLElement): boolean;
|
|
26
26
|
/**
|
|
27
27
|
* Builds a string from format specifiers and replacement parameters.
|
|
28
|
+
* Will coerce non-string parameters to their string representations.
|
|
28
29
|
*
|
|
29
30
|
* @example
|
|
30
31
|
* ```typescript
|
|
31
|
-
*
|
|
32
|
+
* formatString('{0} says "{1}".', 'John', 'Hello'); // 'John says "Hello".'
|
|
33
|
+
* formatString('{1} is greater than {0}', 0, 1); // '1 is greater than 0'
|
|
32
34
|
* ```
|
|
33
35
|
*/
|
|
34
|
-
export declare function
|
|
36
|
+
export declare function formatString(template: string, ...params: unknown[]): string;
|
|
35
37
|
/**
|
|
36
38
|
* Parse the passed `value` as a number or return the `fallback` if it can't be done.
|
|
37
39
|
*
|
|
@@ -17,7 +17,7 @@ export function getOffset(element, parent) {
|
|
|
17
17
|
}
|
|
18
18
|
export function createCounter() {
|
|
19
19
|
let i = 0;
|
|
20
|
-
return
|
|
20
|
+
return () => {
|
|
21
21
|
i++;
|
|
22
22
|
return i;
|
|
23
23
|
};
|
|
@@ -25,27 +25,19 @@ export function createCounter() {
|
|
|
25
25
|
export function isLTR(element) {
|
|
26
26
|
return getComputedStyle(element).getPropertyValue('direction') === 'ltr';
|
|
27
27
|
}
|
|
28
|
-
export function
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return match;
|
|
32
|
-
}
|
|
33
|
-
const value = params[index];
|
|
34
|
-
if (typeof value !== 'number' && !value) {
|
|
35
|
-
return '';
|
|
36
|
-
}
|
|
37
|
-
return value;
|
|
38
|
-
});
|
|
28
|
+
export function formatString(template, ...params) {
|
|
29
|
+
const length = params.length;
|
|
30
|
+
return template.replace(/{(\d+)}/g, (match, index) => index >= length ? match : `${params[index]}`);
|
|
39
31
|
}
|
|
40
32
|
export function asNumber(value, fallback = 0) {
|
|
41
|
-
const parsed = parseFloat(value);
|
|
42
|
-
return isNaN(parsed) ? fallback : parsed;
|
|
33
|
+
const parsed = Number.parseFloat(value);
|
|
34
|
+
return Number.isNaN(parsed) ? fallback : parsed;
|
|
43
35
|
}
|
|
44
36
|
export function wrap(min, max, value) {
|
|
45
37
|
if (value < min) {
|
|
46
38
|
return max;
|
|
47
39
|
}
|
|
48
|
-
|
|
40
|
+
if (value > max) {
|
|
49
41
|
return min;
|
|
50
42
|
}
|
|
51
43
|
return value;
|
|
@@ -58,8 +50,8 @@ export function* iterNodes(root, whatToShow, filter) {
|
|
|
58
50
|
return;
|
|
59
51
|
}
|
|
60
52
|
const iter = globalThis.document.createTreeWalker(root, NodeFilter[whatToShow ?? 'SHOW_ALL']);
|
|
61
|
-
let node;
|
|
62
|
-
while (
|
|
53
|
+
let node = iter.nextNode();
|
|
54
|
+
while (node) {
|
|
63
55
|
if (filter) {
|
|
64
56
|
if (filter(node)) {
|
|
65
57
|
yield node;
|
|
@@ -68,6 +60,7 @@ export function* iterNodes(root, whatToShow, filter) {
|
|
|
68
60
|
else {
|
|
69
61
|
yield node;
|
|
70
62
|
}
|
|
63
|
+
node = iter.nextNode();
|
|
71
64
|
}
|
|
72
65
|
}
|
|
73
66
|
export function getElementByIdFromRoot(root, id) {
|
|
@@ -91,7 +84,12 @@ export function groupBy(array, key) {
|
|
|
91
84
|
for (const item of array) {
|
|
92
85
|
const category = _get(item);
|
|
93
86
|
const group = result[category];
|
|
94
|
-
Array.isArray(group)
|
|
87
|
+
if (Array.isArray(group)) {
|
|
88
|
+
group.push(item);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
result[category] = [item];
|
|
92
|
+
}
|
|
95
93
|
}
|
|
96
94
|
return result;
|
|
97
95
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../../src/components/common/util.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,YAA0B,EAAE,EAAE;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC;SAC7B,MAAM,CAAC,CAAC,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AC;AACrE,CAAC;AAED,MAAM,UAAU,OAAO,CAAI,KAAU,EAAE,GAAiC;IACtE,MAAM,MAAM,GAAwB,EAAE,CAAC;IACvC,MAAM,IAAI,GAAG,OAAO,GAAG,KAAK,UAAU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAO,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAEtE,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QAC5B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC;QAE/B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACzB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnB,CAAC;aAAM,CAAC;YACN,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["export interface PartNameInfo {\n readonly [name: string]: string | boolean | number;\n}\n\nexport const partNameMap = (partNameInfo: PartNameInfo) => {\n return Object.keys(partNameInfo)\n .filter((key) => partNameInfo[key])\n .join(' ');\n};\n\nexport const asPercent = (part: number, whole: number) => (part / whole) * 100;\n\nexport const clamp = (number: number, min: number, max: number) =>\n Math.max(min, Math.min(number, max));\n\n/**\n *\n * Returns an element's offset relative to its parent. Similar to element.offsetTop and element.offsetLeft, except the\n * parent doesn't have to be positioned relative or absolute.\n *\n * Work around for the following issues in Chromium based browsers:\n *\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1330819\n * https://bugs.chromium.org/p/chromium/issues/detail?id=1334556\n *\n */\nexport function getOffset(element: HTMLElement, parent: HTMLElement) {\n const { top, left, bottom, right } = element.getBoundingClientRect();\n const {\n top: pTop,\n left: pLeft,\n bottom: pBottom,\n right: pRight,\n } = parent.getBoundingClientRect();\n\n return {\n top: Math.round(top - pTop),\n left: Math.round(left - pLeft),\n right: Math.round(right - pRight),\n bottom: Math.round(bottom - pBottom),\n };\n}\n\nexport function createCounter() {\n let i = 0;\n return () => {\n i++;\n return i;\n };\n}\n\nexport function isLTR(element: HTMLElement) {\n return getComputedStyle(element).getPropertyValue('direction') === 'ltr';\n}\n\n/**\n * Builds a string from format specifiers and replacement parameters.\n * Will coerce non-string parameters to their string representations.\n *\n * @example\n * ```typescript\n * formatString('{0} says \"{1}\".', 'John', 'Hello'); // 'John says \"Hello\".'\n * formatString('{1} is greater than {0}', 0, 1); // '1 is greater than 0'\n * ```\n */\nexport function formatString(template: string, ...params: unknown[]): string {\n const length = params.length;\n\n return template.replace(/{(\\d+)}/g, (match: string, index: number) =>\n index >= length ? match : `${params[index]}`\n );\n}\n\n/**\n * Parse the passed `value` as a number or return the `fallback` if it can't be done.\n *\n * @example\n * ```typescript\n * asNumber('5'); // 5\n * asNumber('3.14'); // 3.14\n * asNumber('five'); // 0\n * asNUmber('five', 5); // 5\n * ```\n */\nexport function asNumber(value: unknown, fallback = 0) {\n const parsed = Number.parseFloat(value as string);\n return Number.isNaN(parsed) ? fallback : parsed;\n}\n\n/**\n * Returns the value wrapped between the min and max bounds.\n *\n * If the value is greater than max, returns the min and vice-versa.\n * If the value is between the bounds, it is returned unchanged.\n *\n * @example\n * ```typescript\n * wrap(1, 4, 2); // 2\n * wrap(1, 4, 5); // 1\n * wrap(1, 4, -1); // 4\n * ```\n */\nexport function wrap(min: number, max: number, value: number) {\n if (value < min) {\n return max;\n }\n if (value > max) {\n return min;\n }\n\n return value;\n}\n\nexport function isDefined<T = unknown>(value: T) {\n return value !== undefined;\n}\n\nexport function* iterNodes<T = Node>(\n root: Node,\n whatToShow?: keyof typeof NodeFilter,\n filter?: (node: T) => boolean\n): Generator<T> {\n if (!isDefined(globalThis.document)) {\n return;\n }\n\n const iter = globalThis.document.createTreeWalker(\n root,\n NodeFilter[whatToShow ?? 'SHOW_ALL']\n );\n\n let node = iter.nextNode() as T;\n\n while (node) {\n if (filter) {\n if (filter(node)) {\n yield node;\n }\n } else {\n yield node;\n }\n\n node = iter.nextNode() as T;\n }\n}\n\nexport function getElementByIdFromRoot(root: HTMLElement, id: string) {\n return (root.getRootNode() as Document | ShadowRoot).getElementById(id);\n}\n\nexport function isElement(node: unknown): node is Element {\n return node instanceof Node && node.nodeType === Node.ELEMENT_NODE;\n}\n\nexport function getElementsFromEventPath<T extends Element>(event: Event) {\n return event.composedPath().filter((item) => isElement(item)) as T[];\n}\n\nexport function findElementFromEventPath<T extends Element>(\n predicate: string | ((element: Element) => boolean),\n event: Event\n) {\n const func =\n typeof predicate === 'string'\n ? (e: Element) => e.matches(predicate)\n : (e: Element) => predicate(e);\n\n return getElementsFromEventPath(event).find(func) as T | undefined;\n}\n\nexport function groupBy<T>(array: T[], key: keyof T | ((item: T) => any)) {\n const result: Record<string, T[]> = {};\n const _get = typeof key === 'function' ? key : (item: T) => item[key];\n\n for (const item of array) {\n const category = _get(item);\n const group = result[category];\n\n if (Array.isArray(group)) {\n group.push(item);\n } else {\n result[category] = [item];\n }\n }\n\n return result;\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import validatorMessages from './localization/validation-en.js';
|
|
2
|
-
import { asNumber,
|
|
2
|
+
import { asNumber, formatString, isDefined } from './util.js';
|
|
3
3
|
export const requiredValidator = {
|
|
4
4
|
key: 'valueMissing',
|
|
5
5
|
message: validatorMessages.required,
|
|
@@ -17,12 +17,12 @@ export const requiredBooleanValidator = {
|
|
|
17
17
|
};
|
|
18
18
|
export const minLengthValidator = {
|
|
19
19
|
key: 'tooShort',
|
|
20
|
-
message: ({ minLength }) =>
|
|
20
|
+
message: ({ minLength }) => formatString(validatorMessages.minLength, minLength),
|
|
21
21
|
isValid: ({ minLength, value }) => minLength ? value.length >= minLength : true,
|
|
22
22
|
};
|
|
23
23
|
export const maxLengthValidator = {
|
|
24
24
|
key: 'tooLong',
|
|
25
|
-
message: ({ maxLength }) =>
|
|
25
|
+
message: ({ maxLength }) => formatString(validatorMessages.maxLength, maxLength),
|
|
26
26
|
isValid: ({ maxLength, value }) => maxLength ? value.length <= maxLength : true,
|
|
27
27
|
};
|
|
28
28
|
export const patternValidator = {
|
|
@@ -32,14 +32,14 @@ export const patternValidator = {
|
|
|
32
32
|
};
|
|
33
33
|
export const minValidator = {
|
|
34
34
|
key: 'rangeUnderflow',
|
|
35
|
-
message: ({ min }) =>
|
|
35
|
+
message: ({ min }) => formatString(validatorMessages.min, min),
|
|
36
36
|
isValid: ({ min, value }) => isDefined(min)
|
|
37
37
|
? isDefined(value) && asNumber(value) >= asNumber(min)
|
|
38
38
|
: true,
|
|
39
39
|
};
|
|
40
40
|
export const maxValidator = {
|
|
41
41
|
key: 'rangeOverflow',
|
|
42
|
-
message: ({ max }) =>
|
|
42
|
+
message: ({ max }) => formatString(validatorMessages.max, max),
|
|
43
43
|
isValid: ({ max, value }) => isDefined(max)
|
|
44
44
|
? isDefined(value) && asNumber(value) <= asNumber(max)
|
|
45
45
|
: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/components/common/validators.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/components/common/validators.ts"],"names":[],"mappings":"AAAA,OAAO,iBAAiB,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAW9D,MAAM,CAAC,MAAM,iBAAiB,GAGzB;IACH,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,iBAAiB,CAAC,QAAQ;IACnC,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAA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Ac;IACnB,OAAO,EAAE,2CAA2C;IACpD,OAAO,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,EAAE,CAChC,SAAS,CAAC,IAAI,CAAC;QACb,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;QAC7D,CAAC,CAAC,IAAI;CACX,CAAC;AAEF,MAAM,UAAU,GACd,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,cAAc,GAAiC;IAC1D,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,iBAAiB,CAAC,KAAK;IAChC,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;CAC/C,CAAC;AAEF,MAAM,CAAC,MAAM,YAAY,GAAiC;IACxD,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,iBAAiB,CAAC,GAAG;IAC9B,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC;CAC5C,CAAC","sourcesContent":["import validatorMessages from './localization/validation-en.js';\nimport { asNumber, formatString, isDefined } from './util.js';\n\ntype ValidatorHandler<T> = (host: T) => boolean;\ntype ValidatorMessageFormat<T> = (host: T) => string;\n\nexport interface Validator<T = any> {\n key: keyof ValidityStateFlags;\n message: string | ValidatorMessageFormat<T>;\n isValid: ValidatorHandler<T>;\n}\n\nexport const requiredValidator: Validator<{\n required: boolean;\n value?: string;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\n isValid: ({ required, value }) => (required ? !!value : true),\n};\n\nexport const requiredNumberValidator: Validator<{\n required: boolean;\n value?: number | string;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\n isValid: ({ required, value }) => (required ? isDefined(value) : true),\n};\n\nexport const requiredBooleanValidator: Validator<{\n required: boolean;\n checked: boolean;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\n isValid: ({ required, checked }) => (required ? checked : true),\n};\n\nexport const minLengthValidator: Validator<{\n minLength: number;\n value: string;\n}> = {\n key: 'tooShort',\n message: ({ minLength }) =>\n formatString(validatorMessages.minLength, minLength),\n isValid: ({ minLength, value }) =>\n minLength ? value.length >= minLength : true,\n};\n\nexport const maxLengthValidator: Validator<{\n maxLength: number;\n value: string;\n}> = {\n key: 'tooLong',\n message: ({ maxLength }) =>\n formatString(validatorMessages.maxLength, maxLength),\n isValid: ({ maxLength, value }) =>\n maxLength ? value.length <= maxLength : true,\n};\n\nexport const patternValidator: Validator<{ pattern: string; value: string }> = {\n key: 'patternMismatch',\n message: validatorMessages.pattern,\n isValid: ({ pattern, value }) =>\n pattern ? new RegExp(pattern, 'u').test(value) : true,\n};\n\nexport const minValidator: Validator<{\n min: number | string;\n value: number | string;\n}> = {\n key: 'rangeUnderflow',\n message: ({ min }) => formatString(validatorMessages.min, min),\n isValid: ({ min, value }) =>\n isDefined(min)\n ? isDefined(value) && asNumber(value) >= asNumber(min)\n : true,\n};\n\nexport const maxValidator: Validator<{\n max: number | string;\n value: number | string;\n}> = {\n key: 'rangeOverflow',\n message: ({ max }) => formatString(validatorMessages.max, max),\n isValid: ({ max, value }) =>\n isDefined(max)\n ? isDefined(value) && asNumber(value) <= asNumber(max)\n : true,\n};\n\nexport const stepValidator: Validator<{\n min: number | string;\n step: number | string;\n value: number | string;\n}> = {\n key: 'stepMismatch',\n message: 'Value does not conform to step constraint',\n isValid: ({ min, step, value }) =>\n isDefined(step)\n ? (asNumber(value) - asNumber(min)) % asNumber(step, 1) === 0\n : true,\n};\n\nconst emailRegex =\n /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\nexport const emailValidator: Validator<{ value: string }> = {\n key: 'typeMismatch',\n message: validatorMessages.email,\n isValid: ({ value }) => emailRegex.test(value),\n};\n\nexport const urlValidator: Validator<{ value: string }> = {\n key: 'typeMismatch',\n message: validatorMessages.url,\n isValid: ({ value }) => URL.canParse(value),\n};\n"]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import type { AbstractConstructor } from '../common/mixins/constructor.js';
|
|
2
|
+
import type { Validator } from '../common/validators.js';
|
|
3
|
+
import type { IgcInputEventMap } from '../input/input-base.js';
|
|
4
|
+
import { IgcMaskInputBaseComponent, type MaskRange } from '../mask-input/mask-input-base.js';
|
|
5
|
+
import { DatePart, type DatePartDeltas } from './date-util.js';
|
|
6
6
|
export interface IgcDateTimeInputEventMap extends Omit<IgcInputEventMap, 'igcChange'> {
|
|
7
7
|
igcChange: CustomEvent<Date | null>;
|
|
8
8
|
}
|