igniteui-webcomponents 7.2.3 → 7.3.0-beta.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 +156 -0
- package/animations/player.d.ts +4 -11
- package/animations/player.js +4 -10
- package/animations/player.js.map +1 -1
- package/animations/view-transition.d.ts +44 -0
- package/animations/view-transition.js +81 -0
- package/animations/view-transition.js.map +1 -0
- package/components/accordion/accordion.d.ts +1 -1
- package/components/accordion/accordion.js +7 -6
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.js +10 -10
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/themes.d.ts +1 -1
- package/components/avatar/themes/themes.js.map +1 -1
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/badge.js +5 -5
- 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/banner/banner.d.ts +2 -2
- package/components/banner/banner.js +8 -8
- package/components/banner/banner.js.map +1 -1
- package/components/banner/themes/themes.d.ts +1 -1
- package/components/banner/themes/themes.js.map +1 -1
- package/components/button/button-base.d.ts +2 -2
- package/components/button/button-base.js +15 -12
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +3 -3
- package/components/button/button.js +2 -2
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.js +12 -12
- 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.d.ts +42 -21
- package/components/button-group/button-group.js +101 -106
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/button.d.ts +1 -1
- package/components/button-group/themes/button.js.map +1 -1
- package/components/button-group/themes/group.d.ts +1 -1
- package/components/button-group/themes/group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +17 -10
- package/components/button-group/toggle-button.js +28 -13
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/base.d.ts +29 -10
- package/components/calendar/base.js +12 -15
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +39 -8
- package/components/calendar/calendar.js +96 -85
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +49 -22
- package/components/calendar/days-view/days-view.js +102 -163
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +3 -62
- package/components/calendar/helpers.js +6 -110
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/months-view/months-view.d.ts +7 -21
- package/components/calendar/months-view/months-view.js +30 -83
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/selection.d.ts +21 -0
- package/components/calendar/selection.js +42 -0
- package/components/calendar/selection.js.map +1 -0
- 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/types.d.ts +18 -0
- package/components/calendar/types.js.map +1 -1
- package/components/calendar/year-month-view.base.d.ts +44 -0
- package/components/calendar/year-month-view.base.js +89 -0
- package/components/calendar/year-month-view.base.js.map +1 -0
- package/components/calendar/years-view/years-view.d.ts +7 -20
- package/components/calendar/years-view/years-view.js +25 -79
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.actions.js +2 -2
- package/components/card/card.actions.js.map +1 -1
- package/components/card/card.content.d.ts +1 -1
- package/components/card/card.content.js +2 -2
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.d.ts +1 -1
- package/components/card/card.header.js +2 -2
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +2 -2
- package/components/card/card.js.map +1 -1
- package/components/card/card.media.d.ts +1 -1
- package/components/card/card.media.js +1 -1
- 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/carousel/animations.d.ts +1 -1
- package/components/carousel/animations.js +2 -2
- package/components/carousel/animations.js.map +1 -1
- package/components/carousel/carousel-indicator-container.js +4 -4
- package/components/carousel/carousel-indicator-container.js.map +1 -1
- package/components/carousel/carousel-indicator.d.ts +1 -1
- package/components/carousel/carousel-indicator.js +5 -5
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -1
- package/components/carousel/carousel-slide.js +9 -9
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +7 -7
- package/components/carousel/carousel.js +40 -30
- package/components/carousel/carousel.js.map +1 -1
- package/components/carousel/themes/container.d.ts +1 -1
- package/components/carousel/themes/container.js.map +1 -1
- package/components/carousel/themes/indicator-container.d.ts +1 -1
- package/components/carousel/themes/indicator-container.js.map +1 -1
- package/components/chat/chat-input.d.ts +4 -4
- package/components/chat/chat-input.js +13 -12
- package/components/chat/chat-input.js.map +1 -1
- package/components/chat/chat-message.d.ts +1 -1
- package/components/chat/chat-message.js +7 -6
- package/components/chat/chat-message.js.map +1 -1
- package/components/chat/chat-state.d.ts +2 -2
- package/components/chat/chat-state.js +2 -1
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +4 -4
- package/components/chat/chat.js +13 -13
- package/components/chat/chat.js.map +1 -1
- package/components/chat/message-attachments.js +5 -5
- package/components/chat/message-attachments.js.map +1 -1
- package/components/chat/themes/attachments.d.ts +1 -1
- package/components/chat/themes/attachments.js.map +1 -1
- package/components/chat/themes/input.d.ts +1 -1
- package/components/chat/themes/input.js.map +1 -1
- package/components/chat/themes/message.d.ts +1 -1
- package/components/chat/themes/message.js.map +1 -1
- package/components/chat/themes/themes.d.ts +1 -1
- package/components/chat/themes/themes.js.map +1 -1
- package/components/chat/types.d.ts +2 -2
- package/components/chat/types.js.map +1 -1
- package/components/chat/utils.d.ts +1 -1
- package/components/chat/utils.js +3 -3
- package/components/chat/utils.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +7 -7
- package/components/checkbox/checkbox-base.js +7 -7
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +7 -6
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +7 -6
- 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/checkbox/validators.d.ts +1 -1
- package/components/checkbox/validators.js +1 -1
- package/components/checkbox/validators.js.map +1 -1
- package/components/chip/chip.d.ts +9 -3
- package/components/chip/chip.js +10 -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/dark/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/dark/chip.material.css.js +1 -1
- package/components/chip/themes/dark/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/light/chip.fluent.css.js +1 -1
- package/components/chip/themes/light/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/light/chip.indigo.css.js +1 -1
- package/components/chip/themes/light/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/light/chip.material.css.js +1 -1
- package/components/chip/themes/light/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.shared.css.js +1 -1
- package/components/chip/themes/light/chip.shared.css.js.map +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.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 +2 -2
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.d.ts +0 -2
- package/components/combo/combo-item.js +4 -7
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo.d.ts +84 -26
- package/components/combo/combo.js +197 -152
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +30 -3
- package/components/combo/controllers/data.js +34 -9
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +8 -2
- package/components/combo/controllers/navigation.js +11 -12
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/operations/filter.d.ts +17 -1
- package/components/combo/operations/filter.js +29 -9
- package/components/combo/operations/filter.js.map +1 -1
- package/components/combo/operations/group.js +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 +8 -4
- package/components/combo/types.js.map +1 -1
- package/components/combo/validators.d.ts +1 -1
- package/components/combo/validators.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +294 -0
- package/components/date-picker/date-picker.base.js +480 -0
- package/components/date-picker/date-picker.base.js.map +1 -0
- package/components/date-picker/date-picker.d.ts +52 -172
- package/components/date-picker/date-picker.js +88 -393
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/themes.d.ts +1 -1
- package/components/date-picker/themes/themes.js.map +1 -1
- package/components/date-picker/validators.d.ts +1 -1
- package/components/date-picker/validators.js +2 -2
- package/components/date-picker/validators.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +12 -14
- package/components/date-range-picker/date-range-input.js +42 -98
- package/components/date-range-picker/date-range-input.js.map +1 -1
- package/components/date-range-picker/date-range-mask-parser.d.ts +22 -34
- package/components/date-range-picker/date-range-mask-parser.js +38 -69
- package/components/date-range-picker/date-range-mask-parser.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +98 -191
- package/components/date-range-picker/date-range-picker.js +210 -530
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +2 -2
- package/components/date-range-picker/predefined-ranges-area.js +5 -5
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/themes/ranges-themes.d.ts +1 -1
- package/components/date-range-picker/themes/ranges-themes.js.map +1 -1
- package/components/date-range-picker/themes/themes.d.ts +1 -1
- package/components/date-range-picker/themes/themes.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +1 -1
- package/components/date-range-picker/validators.js +15 -22
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-part.d.ts +18 -1
- package/components/date-time-input/date-part.js +10 -0
- package/components/date-time-input/date-part.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +74 -12
- package/components/date-time-input/date-time-input.base.js +99 -27
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +13 -23
- package/components/date-time-input/date-time-input.js +45 -65
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +45 -109
- package/components/date-time-input/datetime-mask-parser.js +88 -139
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/date-time-input/validators.d.ts +1 -1
- package/components/date-time-input/validators.js +2 -2
- package/components/date-time-input/validators.js.map +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +21 -22
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/themes.d.ts +1 -1
- package/components/dialog/themes/themes.js.map +1 -1
- package/components/divider/divider.d.ts +2 -1
- package/components/divider/divider.js +3 -3
- package/components/divider/divider.js.map +1 -1
- package/components/divider/themes/themes.d.ts +1 -1
- package/components/divider/themes/themes.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +10 -3
- package/components/dropdown/dropdown-group.js +21 -5
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +2 -2
- package/components/dropdown/dropdown-header.js +7 -2
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +4 -4
- package/components/dropdown/dropdown-item.js +3 -3
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +75 -32
- package/components/dropdown/dropdown.js +189 -110
- 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.d.ts +14 -5
- package/components/expansion-panel/expansion-panel.js +10 -9
- 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/file-input/file-input.d.ts +20 -12
- package/components/file-input/file-input.js +17 -12
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/themes.d.ts +1 -1
- package/components/file-input/themes/themes.js.map +1 -1
- package/components/file-input/validators.d.ts +1 -1
- package/components/file-input/validators.js +1 -1
- package/components/file-input/validators.js.map +1 -1
- package/components/focus-trap/focus-trap.js +3 -2
- package/components/focus-trap/focus-trap.js.map +1 -1
- package/components/highlight/highlight.js +2 -2
- package/components/highlight/highlight.js.map +1 -1
- package/components/highlight/service.d.ts +4 -1
- package/components/highlight/service.js +23 -7
- package/components/highlight/service.js.map +1 -1
- package/components/highlight/themes/themes.d.ts +1 -1
- package/components/highlight/themes/themes.js.map +1 -1
- package/components/icon/icon-references.d.ts +3 -2
- package/components/icon/icon-references.js +103 -491
- package/components/icon/icon-references.js.map +1 -1
- package/components/icon/icon-state.broadcast.d.ts +14 -17
- package/components/icon/icon-state.broadcast.js +19 -20
- package/components/icon/icon-state.broadcast.js.map +1 -1
- package/components/icon/icon.d.ts +14 -25
- package/components/icon/icon.js +37 -24
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.d.ts +69 -131
- package/components/icon/icon.registry.js +51 -53
- package/components/icon/icon.registry.js.map +1 -1
- package/components/icon/internal-icons-lib.js +2 -2
- package/components/icon/internal-icons-lib.js.map +1 -1
- package/components/icon/registry/parser.d.ts +15 -3
- package/components/icon/registry/parser.js +36 -11
- package/components/icon/registry/parser.js.map +1 -1
- package/components/icon/registry/types.d.ts +55 -11
- package/components/icon/registry/types.js.map +1 -1
- package/components/icon/themes/icon.base.css.js +1 -1
- package/components/icon/themes/icon.base.css.js.map +1 -1
- package/components/icon/themes/shared/icon.common.css.js +1 -1
- package/components/icon/themes/shared/icon.common.css.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 +12 -12
- package/components/input/input-base.js +13 -15
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +15 -12
- package/components/input/input.js +8 -8
- package/components/input/input.js.map +1 -1
- package/components/input/themes/input.base.css.js +1 -1
- package/components/input/themes/input.base.css.js.map +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.common.css.js +1 -1
- package/components/input/themes/shared/input.common.css.js.map +1 -1
- package/components/input/themes/shared/input.fluent.css.js +1 -1
- package/components/input/themes/shared/input.fluent.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/input/themes/themes.d.ts +1 -1
- package/components/input/themes/themes.js.map +1 -1
- package/components/input/validators.d.ts +1 -1
- package/components/input/validators.js +1 -1
- package/components/input/validators.js.map +1 -1
- package/components/list/list-header.js +3 -3
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.js +3 -3
- package/components/list/list-item.js.map +1 -1
- package/components/list/list.js +3 -3
- 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-history.d.ts +99 -0
- package/components/mask-input/mask-history.js +95 -0
- package/components/mask-input/mask-history.js.map +1 -0
- package/components/mask-input/mask-input.d.ts +14 -9
- package/components/mask-input/mask-input.js +20 -23
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.d.ts +20 -2
- package/components/mask-input/mask-parser.js +21 -13
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/mask-input/validators.d.ts +1 -1
- package/components/mask-input/validators.js +1 -1
- package/components/mask-input/validators.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.d.ts +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +2 -2
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.d.ts +2 -2
- package/components/nav-drawer/nav-drawer-item.js +4 -4
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +3 -3
- package/components/nav-drawer/nav-drawer.js +11 -14
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/nav-drawer/themes/container.d.ts +1 -1
- package/components/nav-drawer/themes/container.js +2 -3
- package/components/nav-drawer/themes/container.js.map +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.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/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js.map +1 -1
- package/components/navbar/navbar.js +2 -2
- 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 +10 -3
- package/components/popover/popover.js +114 -99
- package/components/popover/popover.js.map +1 -1
- package/components/progress/base.d.ts +1 -1
- package/components/progress/base.js +5 -4
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-gradient.d.ts +2 -2
- package/components/progress/circular-gradient.js +1 -1
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.d.ts +15 -15
- package/components/progress/circular-progress.js +7 -6
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.d.ts +12 -12
- package/components/progress/linear-progress.js +4 -4
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.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/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.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/qr-code/model/encode.d.ts +20 -0
- package/components/qr-code/model/encode.js +166 -0
- package/components/qr-code/model/encode.js.map +1 -0
- package/components/qr-code/model/error-correction.d.ts +15 -0
- package/components/qr-code/model/error-correction.js +1114 -0
- package/components/qr-code/model/error-correction.js.map +1 -0
- package/components/qr-code/model/mask.d.ts +11 -0
- package/components/qr-code/model/mask.js +161 -0
- package/components/qr-code/model/mask.js.map +1 -0
- package/components/qr-code/model/matrix.d.ts +15 -0
- package/components/qr-code/model/matrix.js +277 -0
- package/components/qr-code/model/matrix.js.map +1 -0
- package/components/qr-code/qr-code.d.ts +134 -0
- package/components/qr-code/qr-code.js +221 -0
- package/components/qr-code/qr-code.js.map +1 -0
- package/components/qr-code/renderer/constants.d.ts +26 -0
- package/components/qr-code/renderer/constants.js +5 -0
- package/components/qr-code/renderer/constants.js.map +1 -0
- package/components/qr-code/renderer/corner.d.ts +23 -0
- package/components/qr-code/renderer/corner.js +25 -0
- package/components/qr-code/renderer/corner.js.map +1 -0
- package/components/qr-code/renderer/dots.d.ts +14 -0
- package/components/qr-code/renderer/dots.js +7 -0
- package/components/qr-code/renderer/dots.js.map +1 -0
- package/components/qr-code/renderer/helpers.d.ts +18 -0
- package/components/qr-code/renderer/helpers.js +158 -0
- package/components/qr-code/renderer/helpers.js.map +1 -0
- package/components/qr-code/renderer/image.d.ts +23 -0
- package/components/qr-code/renderer/image.js +29 -0
- package/components/qr-code/renderer/image.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js.map +1 -0
- package/components/qr-code/themes/qr-code.base.css.d.ts +1 -0
- package/components/qr-code/themes/qr-code.base.css.js +3 -0
- package/components/qr-code/themes/qr-code.base.css.js.map +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.d.ts +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js +3 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js.map +1 -0
- package/components/qr-code/themes/themes.d.ts +2 -0
- package/components/qr-code/themes/themes.js +46 -0
- package/components/qr-code/themes/themes.js.map +1 -0
- package/components/qr-code/types.d.ts +16 -0
- package/components/qr-code/types.js +2 -0
- package/components/qr-code/types.js.map +1 -0
- package/components/radio/controller.d.ts +35 -0
- package/components/radio/controller.js +100 -0
- package/components/radio/controller.js.map +1 -0
- package/components/radio/radio.d.ts +26 -14
- package/components/radio/radio.js +47 -36
- 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/validators.d.ts +1 -1
- package/components/radio/validators.js +5 -3
- package/components/radio/validators.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +19 -10
- package/components/radio-group/radio-group.js +50 -41
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/themes/themes.d.ts +1 -1
- package/components/radio-group/themes/themes.js.map +1 -1
- package/components/rating/rating-symbol.d.ts +1 -1
- package/components/rating/rating-symbol.js +1 -1
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.d.ts +6 -6
- package/components/rating/rating.js +12 -9
- 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/resize-container/resize-container.d.ts +4 -4
- package/components/resize-container/resize-container.js +4 -4
- package/components/resize-container/resize-container.js.map +1 -1
- package/components/resize-container/resize-controller.js +2 -2
- package/components/resize-container/resize-controller.js.map +1 -1
- package/components/resize-container/themes/themes.d.ts +1 -1
- package/components/resize-container/themes/themes.js.map +1 -1
- package/components/ripple/ripple.d.ts +1 -1
- package/components/ripple/ripple.js +3 -2
- package/components/ripple/ripple.js.map +1 -1
- package/components/select/select-group.d.ts +9 -2
- package/components/select/select-group.js +21 -5
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-header.d.ts +1 -1
- package/components/select/select-header.js +7 -2
- package/components/select/select-header.js.map +1 -1
- package/components/select/select-item.d.ts +4 -4
- package/components/select/select-item.js +3 -3
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.d.ts +49 -22
- package/components/select/select.js +132 -67
- package/components/select/select.js.map +1 -1
- package/components/select/themes/select.base.css.js +1 -1
- package/components/select/themes/select.base.css.js.map +1 -1
- package/components/select/themes/themes.d.ts +1 -1
- package/components/select/themes/themes.js.map +1 -1
- package/components/select/validators.d.ts +1 -1
- package/components/select/validators.js +1 -1
- package/components/select/validators.js.map +1 -1
- package/components/slider/range-slider.d.ts +2 -2
- package/components/slider/range-slider.js +8 -8
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.js +18 -14
- 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 +3 -3
- package/components/slider/slider.js +6 -6
- 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 +3 -3
- package/components/snackbar/snackbar.js +8 -8
- 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/splitter/splitter.d.ts +106 -23
- package/components/splitter/splitter.js +234 -147
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/themes/themes.d.ts +1 -1
- package/components/splitter/themes/themes.js.map +1 -1
- package/components/splitter/types.d.ts +14 -3
- package/components/splitter/types.js.map +1 -1
- package/components/stepper/common/animations.d.ts +1 -1
- package/components/stepper/common/animations.js +2 -2
- package/components/stepper/common/animations.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +7 -7
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +5 -5
- package/components/stepper/stepper.js +12 -9
- 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-dom.d.ts +31 -28
- package/components/tabs/tab-dom.js +84 -34
- package/components/tabs/tab-dom.js.map +1 -1
- package/components/tabs/tab.d.ts +24 -6
- package/components/tabs/tab.js +34 -13
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +36 -22
- package/components/tabs/tabs.js +118 -88
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.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/tabs/themes/tabs.base.css.js +1 -1
- package/components/tabs/themes/tabs.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +19 -14
- package/components/textarea/textarea.js +22 -16
- 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/textarea/validators.d.ts +1 -1
- package/components/textarea/validators.js +1 -1
- package/components/textarea/validators.js.map +1 -1
- package/components/theme-provider/theme-provider.d.ts +1 -1
- package/components/theme-provider/theme-provider.js +2 -2
- package/components/theme-provider/theme-provider.js.map +1 -1
- package/components/tile-manager/position.d.ts +1 -1
- package/components/tile-manager/position.js +2 -2
- package/components/tile-manager/position.js.map +1 -1
- package/components/tile-manager/resize-state.js +4 -3
- package/components/tile-manager/resize-state.js.map +1 -1
- package/components/tile-manager/themes/container.d.ts +1 -1
- package/components/tile-manager/themes/container.js.map +1 -1
- package/components/tile-manager/themes/tile.d.ts +1 -1
- package/components/tile-manager/themes/tile.js.map +1 -1
- package/components/tile-manager/tile-ghost-util.js +1 -1
- package/components/tile-manager/tile-ghost-util.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +1 -1
- package/components/tile-manager/tile-manager.js +7 -7
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +4 -4
- package/components/tile-manager/tile.js +29 -25
- package/components/tile-manager/tile.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.d.ts +1 -1
- package/components/toast/toast.js +3 -3
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.d.ts +18 -16
- package/components/tooltip/controller.js +62 -41
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/service.d.ts +2 -1
- package/components/tooltip/service.js +10 -15
- package/components/tooltip/service.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js.map +1 -1
- package/components/tooltip/themes/themes.d.ts +1 -1
- package/components/tooltip/themes/themes.js.map +1 -1
- package/components/tooltip/themes/tooltip.base.css.js +1 -1
- package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
- package/components/tooltip/tooltip.d.ts +64 -18
- package/components/tooltip/tooltip.js +112 -62
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/tree/themes/container.base.css.js +1 -1
- package/components/tree/themes/container.base.css.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.base.css.js +1 -1
- package/components/tree/themes/item.base.css.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.d.ts +62 -36
- package/components/tree/tree-item.js +223 -233
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.common.d.ts +16 -1
- package/components/tree/tree.common.js +40 -1
- package/components/tree/tree.common.js.map +1 -1
- package/components/tree/tree.d.ts +21 -14
- package/components/tree/tree.js +64 -72
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +39 -29
- package/components/tree/tree.navigation.js +140 -192
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.d.ts +32 -31
- package/components/tree/tree.selection.js +184 -178
- package/components/tree/tree.selection.js.map +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +33 -6
- package/components/validation-container/validation-container.js +81 -70
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +92 -0
- package/components/virtualization/engine.js +217 -0
- package/components/virtualization/engine.js.map +1 -0
- package/components/virtualization/types.d.ts +53 -0
- package/components/virtualization/types.js +14 -0
- package/components/virtualization/types.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +235 -0
- package/components/virtualization/virtualization.js +474 -0
- package/components/virtualization/virtualization.js.map +1 -0
- package/components/visually-hidden/visually-hidden.js +1 -1
- package/components/visually-hidden/visually-hidden.js.map +1 -1
- package/custom-elements.json +57500 -47242
- package/extras/chat-markdown-renderer.d.ts +1 -1
- package/extras/chat-markdown-renderer.js.map +1 -1
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +20 -15
- package/index.js +11 -9
- package/index.js.map +1 -1
- package/internals/abort-handler.js.map +1 -0
- package/internals/context.d.ts +39 -0
- package/{components/common → internals}/context.js +2 -1
- package/internals/context.js.map +1 -0
- package/internals/controllers/adopt-styles.d.ts +76 -0
- package/internals/controllers/adopt-styles.js +173 -0
- package/internals/controllers/adopt-styles.js.map +1 -0
- package/internals/controllers/aria-projection.d.ts +144 -0
- package/internals/controllers/aria-projection.js +138 -0
- package/internals/controllers/aria-projection.js.map +1 -0
- package/{components/common → internals}/controllers/async-consumer.js +8 -7
- package/internals/controllers/async-consumer.js.map +1 -0
- package/internals/controllers/command.js.map +1 -0
- package/{components/common → internals}/controllers/drag.js +3 -2
- package/internals/controllers/drag.js.map +1 -0
- package/{components/common → internals}/controllers/focus-ring.js +5 -2
- package/internals/controllers/focus-ring.js.map +1 -0
- package/{components/common → internals}/controllers/fullscreen.js +6 -3
- package/internals/controllers/fullscreen.js.map +1 -0
- package/{components/common → internals}/controllers/gestures.d.ts +1 -1
- package/{components/common → internals}/controllers/gestures.js +4 -4
- package/internals/controllers/gestures.js.map +1 -0
- package/{components/common → internals}/controllers/id-resolver.js +15 -21
- package/internals/controllers/id-resolver.js.map +1 -0
- package/{components/common → internals}/controllers/internals.d.ts +48 -3
- package/{components/common → internals}/controllers/internals.js +32 -0
- package/internals/controllers/internals.js.map +1 -0
- package/{components/common → internals}/controllers/key-bindings.d.ts +3 -6
- package/{components/common → internals}/controllers/key-bindings.js +43 -29
- package/internals/controllers/key-bindings.js.map +1 -0
- package/{components/common → internals}/controllers/mutation-observer.d.ts +5 -4
- package/internals/controllers/mutation-observer.js +74 -0
- package/internals/controllers/mutation-observer.js.map +1 -0
- package/{components/common → internals}/controllers/resize-observer.d.ts +11 -1
- package/{components/common → internals}/controllers/resize-observer.js +13 -2
- package/internals/controllers/resize-observer.js.map +1 -0
- package/{components/common → internals}/controllers/root-click.js +8 -13
- package/internals/controllers/root-click.js.map +1 -0
- package/{components/common → internals}/controllers/root-scroll.d.ts +11 -8
- package/internals/controllers/root-scroll.js +71 -0
- package/internals/controllers/root-scroll.js.map +1 -0
- package/{components/common → internals}/controllers/slot.d.ts +18 -2
- package/{components/common → internals}/controllers/slot.js +21 -6
- package/internals/controllers/slot.js.map +1 -0
- package/internals/date/compare.d.ts +2 -0
- package/internals/date/compare.js +23 -0
- package/internals/date/compare.js.map +1 -0
- package/internals/date/converters.d.ts +18 -0
- package/internals/date/converters.js +73 -0
- package/internals/date/converters.js.map +1 -0
- package/{components/calendar → internals/date}/model.d.ts +6 -3
- package/{components/calendar → internals/date}/model.js +23 -0
- package/internals/date/model.js.map +1 -0
- package/internals/decorators/blazorAdditionalDependencies.js.map +1 -0
- package/internals/decorators/blazorDeepImport.js.map +1 -0
- package/internals/decorators/blazorInclude.js.map +1 -0
- package/internals/decorators/blazorIndirectRender.js.map +1 -0
- package/internals/decorators/blazorSuppressComponent.js.map +1 -0
- package/internals/decorators/shadow-options.js.map +1 -0
- package/internals/decorators/watch.js.map +1 -0
- package/internals/definitions/defineAllComponents.js +153 -0
- package/internals/definitions/defineAllComponents.js.map +1 -0
- package/internals/definitions/defineComponents.js.map +1 -0
- package/internals/definitions/register.js.map +1 -0
- package/{components/common → internals}/i18n/EN/calendar.resources.js +1 -1
- package/internals/i18n/EN/calendar.resources.js.map +1 -0
- package/internals/i18n/EN/chat.resources.js.map +1 -0
- package/internals/i18n/EN/date-picker.resources.js.map +1 -0
- package/internals/i18n/EN/date-range-picker.resources.js.map +1 -0
- package/internals/i18n/i18n-controller.js.map +1 -0
- package/{components/common → internals}/i18n/utils.js +1 -1
- package/internals/i18n/utils.js.map +1 -0
- package/{components/common → internals}/mixins/alert.d.ts +2 -2
- package/{components/common → internals}/mixins/alert.js +3 -3
- package/internals/mixins/alert.js.map +1 -0
- package/{components/common → internals}/mixins/combo-box.d.ts +10 -2
- package/{components/common → internals}/mixins/combo-box.js +9 -4
- package/internals/mixins/combo-box.js.map +1 -0
- package/internals/mixins/constructor.js.map +1 -0
- package/internals/mixins/event-emitter.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated-required.js +10 -19
- package/internals/mixins/forms/associated-required.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated.d.ts +1 -1
- package/{components/common → internals}/mixins/forms/associated.js +66 -51
- package/internals/mixins/forms/associated.js.map +1 -0
- package/{components/common → internals}/mixins/forms/form-transformers.d.ts +1 -1
- package/{components/common → internals}/mixins/forms/form-transformers.js +2 -2
- package/internals/mixins/forms/form-transformers.js.map +1 -0
- package/internals/mixins/forms/form-value.js.map +1 -0
- package/{components/common → internals}/mixins/forms/types.d.ts +7 -7
- package/internals/mixins/forms/types.js.map +1 -0
- package/{components/common → internals}/mixins/mask-behavior.d.ts +11 -3
- package/{components/common → internals}/mixins/mask-behavior.js +117 -29
- package/internals/mixins/mask-behavior.js.map +1 -0
- package/{components/common → internals}/mixins/option.d.ts +0 -2
- package/{components/common → internals}/mixins/option.js +1 -4
- package/internals/mixins/option.js.map +1 -0
- package/internals/part-map.js.map +1 -0
- package/{components/common → internals}/templates/input-shell.d.ts +8 -1
- package/{components/common → internals}/templates/input-shell.js +14 -4
- package/internals/templates/input-shell.js.map +1 -0
- package/{components/common → internals}/templates/masked-input.d.ts +8 -2
- package/{components/common → internals}/templates/masked-input.js +5 -3
- package/internals/templates/masked-input.js.map +1 -0
- package/internals/utils/arrays.d.ts +53 -0
- package/internals/utils/arrays.js +31 -0
- package/internals/utils/arrays.js.map +1 -0
- package/internals/utils/dom.d.ts +92 -0
- package/internals/utils/dom.js +143 -0
- package/internals/utils/dom.js.map +1 -0
- package/internals/utils/events.d.ts +41 -0
- package/internals/utils/events.js +37 -0
- package/internals/utils/events.js.map +1 -0
- package/internals/utils/lit.d.ts +8 -0
- package/internals/utils/lit.js +15 -0
- package/internals/utils/lit.js.map +1 -0
- package/internals/utils/math.d.ts +50 -0
- package/internals/utils/math.js +38 -0
- package/internals/utils/math.js.map +1 -0
- package/internals/utils/objects.d.ts +25 -0
- package/internals/utils/objects.js +125 -0
- package/internals/utils/objects.js.map +1 -0
- package/internals/utils/strings.d.ts +44 -0
- package/internals/utils/strings.js +46 -0
- package/internals/utils/strings.js.map +1 -0
- package/internals/utils/types.d.ts +13 -0
- package/internals/utils/types.js +31 -0
- package/internals/utils/types.js.map +1 -0
- package/{components/common → internals}/validators.d.ts +1 -1
- package/{components/common → internals}/validators.js +4 -2
- package/internals/validators.js.map +1 -0
- package/package.json +15 -7
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +15 -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/theming-controller.d.ts +2 -2
- package/theming/theming-controller.js.map +1 -1
- package/web-types.json +3 -3
- package/components/calendar/model.js.map +0 -1
- package/components/combo/combo-list.d.ts +0 -11
- package/components/combo/combo-list.js +0 -13
- package/components/combo/combo-list.js.map +0 -1
- package/components/common/abort-handler.js.map +0 -1
- package/components/common/context.d.ts +0 -25
- package/components/common/context.js.map +0 -1
- package/components/common/controllers/adopt-styles.d.ts +0 -124
- package/components/common/controllers/adopt-styles.js +0 -75
- package/components/common/controllers/adopt-styles.js.map +0 -1
- package/components/common/controllers/async-consumer.js.map +0 -1
- package/components/common/controllers/command.js.map +0 -1
- package/components/common/controllers/drag.js.map +0 -1
- package/components/common/controllers/focus-ring.js.map +0 -1
- package/components/common/controllers/fullscreen.js.map +0 -1
- package/components/common/controllers/gestures.js.map +0 -1
- package/components/common/controllers/id-resolver.js.map +0 -1
- package/components/common/controllers/internals.js.map +0 -1
- package/components/common/controllers/key-bindings.js.map +0 -1
- package/components/common/controllers/mutation-observer.js +0 -69
- package/components/common/controllers/mutation-observer.js.map +0 -1
- package/components/common/controllers/resize-observer.js.map +0 -1
- package/components/common/controllers/root-click.js.map +0 -1
- package/components/common/controllers/root-scroll.js +0 -63
- package/components/common/controllers/root-scroll.js.map +0 -1
- package/components/common/controllers/slot.js.map +0 -1
- package/components/common/decorators/blazorAdditionalDependencies.js.map +0 -1
- package/components/common/decorators/blazorDeepImport.js.map +0 -1
- package/components/common/decorators/blazorInclude.js.map +0 -1
- package/components/common/decorators/blazorIndirectRender.js.map +0 -1
- package/components/common/decorators/blazorSuppressComponent.js.map +0 -1
- package/components/common/decorators/shadow-options.js.map +0 -1
- package/components/common/decorators/watch.js.map +0 -1
- package/components/common/definitions/defineAllComponents.js +0 -151
- package/components/common/definitions/defineAllComponents.js.map +0 -1
- package/components/common/definitions/defineComponents.js.map +0 -1
- package/components/common/definitions/register.js.map +0 -1
- package/components/common/i18n/EN/calendar.resources.js.map +0 -1
- package/components/common/i18n/EN/chat.resources.js.map +0 -1
- package/components/common/i18n/EN/date-picker.resources.js.map +0 -1
- package/components/common/i18n/EN/date-range-picker.resources.js.map +0 -1
- package/components/common/i18n/i18n-controller.js.map +0 -1
- package/components/common/i18n/utils.js.map +0 -1
- package/components/common/mixins/alert.js.map +0 -1
- package/components/common/mixins/combo-box.js.map +0 -1
- package/components/common/mixins/constructor.js.map +0 -1
- package/components/common/mixins/event-emitter.js.map +0 -1
- package/components/common/mixins/forms/associated-required.js.map +0 -1
- package/components/common/mixins/forms/associated.js.map +0 -1
- package/components/common/mixins/forms/form-transformers.js.map +0 -1
- package/components/common/mixins/forms/form-value.js.map +0 -1
- package/components/common/mixins/forms/types.js.map +0 -1
- package/components/common/mixins/mask-behavior.js.map +0 -1
- package/components/common/mixins/option.js.map +0 -1
- package/components/common/part-map.js.map +0 -1
- package/components/common/templates/input-shell.js.map +0 -1
- package/components/common/templates/masked-input.js.map +0 -1
- package/components/common/util.d.ts +0 -196
- package/components/common/util.js +0 -390
- package/components/common/util.js.map +0 -1
- package/components/common/validators.js.map +0 -1
- package/components/icon/registry/default-map.d.ts +0 -107
- package/components/icon/registry/default-map.js +0 -25
- package/components/icon/registry/default-map.js.map +0 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js +0 -3
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js.map +0 -1
- package/components/radio/utils.d.ts +0 -13
- package/components/radio/utils.js +0 -37
- package/components/radio/utils.js.map +0 -1
- /package/components/{nav-drawer/themes/shared/container/nav-drawer.fluent.css.d.ts → qr-code/themes/dark/qr-code.bootstrap.css.d.ts} +0 -0
- /package/{components/common → internals}/abort-handler.d.ts +0 -0
- /package/{components/common → internals}/abort-handler.js +0 -0
- /package/{components/common → internals}/controllers/async-consumer.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.js +0 -0
- /package/{components/common → internals}/controllers/drag.d.ts +0 -0
- /package/{components/common → internals}/controllers/focus-ring.d.ts +0 -0
- /package/{components/common → internals}/controllers/fullscreen.d.ts +0 -0
- /package/{components/common → internals}/controllers/id-resolver.d.ts +0 -0
- /package/{components/common → internals}/controllers/root-click.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.js +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.js +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.js +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.js +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.js +0 -0
- /package/{components/common → internals}/decorators/shadow-options.d.ts +0 -0
- /package/{components/common → internals}/decorators/shadow-options.js +0 -0
- /package/{components/common → internals}/decorators/watch.d.ts +0 -0
- /package/{components/common → internals}/decorators/watch.js +0 -0
- /package/{components/common → internals}/definitions/defineAllComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.js +0 -0
- /package/{components/common → internals}/definitions/register.d.ts +0 -0
- /package/{components/common → internals}/definitions/register.js +0 -0
- /package/{components/common → internals}/i18n/EN/calendar.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.d.ts +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.js +0 -0
- /package/{components/common → internals}/i18n/utils.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.js +0 -0
- /package/{components/common → internals}/mixins/event-emitter.d.ts +0 -0
- /package/{components/common → internals}/mixins/event-emitter.js +0 -0
- /package/{components/common → internals}/mixins/forms/associated-required.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.js +0 -0
- /package/{components/common → internals}/mixins/forms/types.js +0 -0
- /package/{components/common → internals}/part-map.d.ts +0 -0
- /package/{components/common → internals}/part-map.js +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Themes } from '
|
|
1
|
+
import type { Themes } from '#theming/types.js';
|
|
2
2
|
export declare const all: Themes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/components/list/themes/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAEzE,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE,GAAG,CAAA;MACV,SAAS;GACZ;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,SAAS,EAAE,GAAG,CAAA;MACV,SAAS;GACZ;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,GAAG,GAAW,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC","sourcesContent":["import { css } from 'lit';\n\nimport type { Themes } from '
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../../src/components/list/themes/item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAI1B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAEzE,MAAM,KAAK,GAAG;IACZ,SAAS,EAAE,GAAG,CAAA;MACV,SAAS;GACZ;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;CACF,CAAC;AAEF,MAAM,IAAI,GAAG;IACX,SAAS,EAAE,GAAG,CAAA;MACV,SAAS;GACZ;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;IACD,MAAM,EAAE,GAAG,CAAA;MACP,MAAM;GACT;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// Shared Styles\nimport { styles as bootstrap } from './shared/item/list-item.bootstrap.css.js';\nimport { styles as fluent } from './shared/item/list-item.fluent.css.js';\nimport { styles as indigo } from './shared/item/list-item.indigo.css.js';\n\nconst light = {\n bootstrap: css`\n ${bootstrap}\n `,\n fluent: css`\n ${fluent}\n `,\n indigo: css`\n ${indigo}\n `,\n};\n\nconst dark = {\n bootstrap: css`\n ${bootstrap}\n `,\n fluent: css`\n ${fluent}\n `,\n indigo: css`\n ${indigo}\n `,\n};\n\nexport const all: Themes = { light, dark };\n"]}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/** A snapshot of the editor state as it was *before* an edit was applied. */
|
|
2
|
+
type MaskHistoryState = {
|
|
3
|
+
value: string;
|
|
4
|
+
start: number;
|
|
5
|
+
end: number;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* The granularity an edit contributes to the history.
|
|
9
|
+
*
|
|
10
|
+
* The three granular kinds coalesce, so a run of typed characters or of deletions
|
|
11
|
+
* collapses into a single step. Everything else - paste, drop, cut, composition,
|
|
12
|
+
* auto-fill, spinning a date part, `setRangeText` - is `atomic` and gets its own step.
|
|
13
|
+
*/
|
|
14
|
+
type MaskEditKind = 'insert' | 'delete-backward' | 'delete-forward' | 'atomic';
|
|
15
|
+
/** Resolves the identity of the mask pattern the snapshots were taken against. */
|
|
16
|
+
type MaskSignature = () => string;
|
|
17
|
+
/**
|
|
18
|
+
* The undo/redo history of a masked editor.
|
|
19
|
+
*
|
|
20
|
+
* Masked text is rendered through `.value=${live(...)}`, so every edit reassigns the
|
|
21
|
+
* native input's value - which wipes the browser's own undo stack. This replaces it.
|
|
22
|
+
*
|
|
23
|
+
* It holds no timers: a run is coalesced purely from the caret geometry, so the same
|
|
24
|
+
* sequence of edits always produces the same sequence of steps.
|
|
25
|
+
*
|
|
26
|
+
* The history is self-invalidating rather than instrumented. Anything that moves the
|
|
27
|
+
* masked text without going through it - a programmatic `value`, `clear()`, a form reset -
|
|
28
|
+
* is caught by comparing against the text it last observed, and a changed mask pattern is
|
|
29
|
+
* caught by the signature. That is why no call site has to announce those changes.
|
|
30
|
+
*
|
|
31
|
+
* @hidden
|
|
32
|
+
*/
|
|
33
|
+
declare class MaskHistory {
|
|
34
|
+
private readonly _signature;
|
|
35
|
+
private readonly _undoStack;
|
|
36
|
+
private readonly _redoStack;
|
|
37
|
+
private _lastKind;
|
|
38
|
+
private _lastCaret;
|
|
39
|
+
private _lastValue;
|
|
40
|
+
private _pattern;
|
|
41
|
+
/**
|
|
42
|
+
* The state the most recent traversal restored.
|
|
43
|
+
*
|
|
44
|
+
* Holding `Ctrl + Z` fires faster than the caret can be written back to the DOM, so the
|
|
45
|
+
* live selection is not a trustworthy counterpart entry for the opposite stack. The
|
|
46
|
+
* state we know we just restored is.
|
|
47
|
+
*/
|
|
48
|
+
private _lastRestored;
|
|
49
|
+
constructor(signature: MaskSignature);
|
|
50
|
+
get canUndo(): boolean;
|
|
51
|
+
get canRedo(): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A run continues only while the caret stays where the previous edit left it, which is
|
|
54
|
+
* what makes a click or an arrow key break it without any extra hook. Replacing a
|
|
55
|
+
* selection is always a deliberate edit of its own.
|
|
56
|
+
*/
|
|
57
|
+
private _shouldCoalesce;
|
|
58
|
+
private _clear;
|
|
59
|
+
/**
|
|
60
|
+
* Drops everything the history holds when the mask pattern changed or the text moved
|
|
61
|
+
* behind our back. Returns whether the snapshots are still usable.
|
|
62
|
+
*/
|
|
63
|
+
private _validate;
|
|
64
|
+
/**
|
|
65
|
+
* Records the state an edit is about to overwrite. Must be called *before* the mask is
|
|
66
|
+
* mutated, and only once the edit is known to change something.
|
|
67
|
+
*/
|
|
68
|
+
record(kind: MaskEditKind, state: MaskHistoryState): void;
|
|
69
|
+
/**
|
|
70
|
+
* Reports the state an edit settled on, so that the next {@link record} can tell
|
|
71
|
+
* whether it continues the run.
|
|
72
|
+
*/
|
|
73
|
+
settle(value: string, caret: number): void;
|
|
74
|
+
/**
|
|
75
|
+
* Reconciles the history with the editor's current text, typically on focus where a
|
|
76
|
+
* date editor swaps the display format back for the input format. An unchanged
|
|
77
|
+
* document keeps its history, a changed one drops it, and either way the run ends.
|
|
78
|
+
*/
|
|
79
|
+
resync(value: string): void;
|
|
80
|
+
/** Steps one edit back, handing `current` to the redo stack. */
|
|
81
|
+
undo(current: MaskHistoryState): MaskHistoryState | null;
|
|
82
|
+
/** Steps one edit forward, handing `current` back to the undo stack. */
|
|
83
|
+
redo(current: MaskHistoryState): MaskHistoryState | null;
|
|
84
|
+
private _step;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Creates a {@link MaskHistory} for a masked editor.
|
|
88
|
+
*
|
|
89
|
+
* @param signature - resolves the identity of the mask pattern the snapshots are taken
|
|
90
|
+
* against. A callback rather than a value because the history is created by the mask
|
|
91
|
+
* behavior mixin, whose fields initialize *before* the parser of the concrete component.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const history = createMaskHistory(() => `${parser.mask} ${parser.prompt}`);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
export declare function createMaskHistory(signature: MaskSignature): MaskHistory;
|
|
99
|
+
export type { MaskEditKind, MaskHistory, MaskHistoryState, MaskSignature };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
const MAX_HISTORY_SIZE = 100;
|
|
2
|
+
class MaskHistory {
|
|
3
|
+
constructor(signature) {
|
|
4
|
+
this._undoStack = [];
|
|
5
|
+
this._redoStack = [];
|
|
6
|
+
this._lastKind = null;
|
|
7
|
+
this._lastCaret = -1;
|
|
8
|
+
this._lastValue = '';
|
|
9
|
+
this._pattern = '';
|
|
10
|
+
this._lastRestored = null;
|
|
11
|
+
this._signature = signature;
|
|
12
|
+
}
|
|
13
|
+
get canUndo() {
|
|
14
|
+
return this._undoStack.length > 0;
|
|
15
|
+
}
|
|
16
|
+
get canRedo() {
|
|
17
|
+
return this._redoStack.length > 0;
|
|
18
|
+
}
|
|
19
|
+
_shouldCoalesce(kind, state) {
|
|
20
|
+
if (kind === 'atomic' ||
|
|
21
|
+
kind !== this._lastKind ||
|
|
22
|
+
!this.canUndo ||
|
|
23
|
+
state.start !== state.end) {
|
|
24
|
+
return false;
|
|
25
|
+
}
|
|
26
|
+
return kind === 'insert'
|
|
27
|
+
? state.start === this._lastCaret
|
|
28
|
+
: state.end === this._lastCaret;
|
|
29
|
+
}
|
|
30
|
+
_clear() {
|
|
31
|
+
this._undoStack.length = 0;
|
|
32
|
+
this._redoStack.length = 0;
|
|
33
|
+
this._lastKind = null;
|
|
34
|
+
this._lastCaret = -1;
|
|
35
|
+
this._lastRestored = null;
|
|
36
|
+
}
|
|
37
|
+
_validate(value) {
|
|
38
|
+
const pattern = this._signature();
|
|
39
|
+
const stale = pattern !== this._pattern || (this.canUndo && value !== this._lastValue);
|
|
40
|
+
if (stale) {
|
|
41
|
+
this._pattern = pattern;
|
|
42
|
+
this._clear();
|
|
43
|
+
this._lastValue = value;
|
|
44
|
+
}
|
|
45
|
+
return !stale;
|
|
46
|
+
}
|
|
47
|
+
record(kind, state) {
|
|
48
|
+
this._validate(state.value);
|
|
49
|
+
this._redoStack.length = 0;
|
|
50
|
+
this._lastRestored = null;
|
|
51
|
+
if (!this._shouldCoalesce(kind, state)) {
|
|
52
|
+
this._undoStack.push({ ...state });
|
|
53
|
+
if (this._undoStack.length > MAX_HISTORY_SIZE) {
|
|
54
|
+
this._undoStack.shift();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
this._lastKind = kind;
|
|
58
|
+
}
|
|
59
|
+
settle(value, caret) {
|
|
60
|
+
this._lastValue = value;
|
|
61
|
+
this._lastCaret = caret;
|
|
62
|
+
}
|
|
63
|
+
resync(value) {
|
|
64
|
+
this._validate(value);
|
|
65
|
+
this._lastValue = value;
|
|
66
|
+
this._lastKind = null;
|
|
67
|
+
this._lastCaret = -1;
|
|
68
|
+
this._lastRestored = null;
|
|
69
|
+
}
|
|
70
|
+
undo(current) {
|
|
71
|
+
return this._step(this._undoStack, this._redoStack, current);
|
|
72
|
+
}
|
|
73
|
+
redo(current) {
|
|
74
|
+
return this._step(this._redoStack, this._undoStack, current);
|
|
75
|
+
}
|
|
76
|
+
_step(from, to, current) {
|
|
77
|
+
if (!this._validate(current.value)) {
|
|
78
|
+
return null;
|
|
79
|
+
}
|
|
80
|
+
const state = from.pop();
|
|
81
|
+
if (!state) {
|
|
82
|
+
return null;
|
|
83
|
+
}
|
|
84
|
+
to.push(this._lastRestored ?? { ...current });
|
|
85
|
+
this._lastKind = null;
|
|
86
|
+
this._lastValue = state.value;
|
|
87
|
+
this._lastCaret = state.start;
|
|
88
|
+
this._lastRestored = { ...state };
|
|
89
|
+
return state;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
export function createMaskHistory(signature) {
|
|
93
|
+
return new MaskHistory(signature);
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=mask-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-history.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-history.ts"],"names":[],"mappings":"AAmBA,MAAM,gBAAgB,GAAG,GAAG,CAAC;AAkB7B,MAAM,WAAW;IAmBf,YAAY,SAAwB;QAjBnB,eA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;IAC5B,CAAC;IAGM,IAAI,CAAC,OAAyB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAGM,IAAI,CAAC,OAAyB;QACnC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC/D,CAAC;IAEO,KAAK,CACX,IAAwB,EACxB,EAAsB,EACtB,OAAyB;QAIzB,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;YACnC,OAAO,IAAI,CAAC;QACd,CAAC;QAED,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAEzB,IAAI,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,IAAI,CAAC;QACd,CAAC;QAED,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;QAG9C,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC;QAC9B,IAAI,CAAC,aAAa,GAAG,EAAE,GAAG,KAAK,EAAE,CAAC;QAElC,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAcD,MAAM,UAAU,iBAAiB,CAAC,SAAwB;IACxD,OAAO,IAAI,WAAW,CAAC,SAAS,CAAC,CAAC;AACpC,CAAC","sourcesContent":["/** A snapshot of the editor state as it was *before* an edit was applied. */\ntype MaskHistoryState = {\n value: string;\n start: number;\n end: number;\n};\n\n/**\n * The granularity an edit contributes to the history.\n *\n * The three granular kinds coalesce, so a run of typed characters or of deletions\n * collapses into a single step. Everything else - paste, drop, cut, composition,\n * auto-fill, spinning a date part, `setRangeText` - is `atomic` and gets its own step.\n */\ntype MaskEditKind = 'insert' | 'delete-backward' | 'delete-forward' | 'atomic';\n\n/** Resolves the identity of the mask pattern the snapshots were taken against. */\ntype MaskSignature = () => string;\n\nconst MAX_HISTORY_SIZE = 100;\n\n/**\n * The undo/redo history of a masked editor.\n *\n * Masked text is rendered through `.value=${live(...)}`, so every edit reassigns the\n * native input's value - which wipes the browser's own undo stack. This replaces it.\n *\n * It holds no timers: a run is coalesced purely from the caret geometry, so the same\n * sequence of edits always produces the same sequence of steps.\n *\n * The history is self-invalidating rather than instrumented. Anything that moves the\n * masked text without going through it - a programmatic `value`, `clear()`, a form reset -\n * is caught by comparing against the text it last observed, and a changed mask pattern is\n * caught by the signature. That is why no call site has to announce those changes.\n *\n * @hidden\n */\nclass MaskHistory {\n private readonly _signature: MaskSignature;\n private readonly _undoStack: MaskHistoryState[] = [];\n private readonly _redoStack: MaskHistoryState[] = [];\n\n private _lastKind: MaskEditKind | null = null;\n private _lastCaret = -1;\n private _lastValue = '';\n private _pattern = '';\n\n /**\n * The state the most recent traversal restored.\n *\n * Holding `Ctrl + Z` fires faster than the caret can be written back to the DOM, so the\n * live selection is not a trustworthy counterpart entry for the opposite stack. The\n * state we know we just restored is.\n */\n private _lastRestored: MaskHistoryState | null = null;\n\n constructor(signature: MaskSignature) {\n this._signature = signature;\n }\n\n public get canUndo(): boolean {\n return this._undoStack.length > 0;\n }\n\n public get canRedo(): boolean {\n return this._redoStack.length > 0;\n }\n\n /**\n * A run continues only while the caret stays where the previous edit left it, which is\n * what makes a click or an arrow key break it without any extra hook. Replacing a\n * selection is always a deliberate edit of its own.\n */\n private _shouldCoalesce(\n kind: MaskEditKind,\n state: MaskHistoryState\n ): boolean {\n if (\n kind === 'atomic' ||\n kind !== this._lastKind ||\n !this.canUndo ||\n state.start !== state.end\n ) {\n return false;\n }\n\n return kind === 'insert'\n ? state.start === this._lastCaret\n : state.end === this._lastCaret;\n }\n\n private _clear(): void {\n this._undoStack.length = 0;\n this._redoStack.length = 0;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /**\n * Drops everything the history holds when the mask pattern changed or the text moved\n * behind our back. Returns whether the snapshots are still usable.\n */\n private _validate(value: string): boolean {\n const pattern = this._signature();\n const stale =\n pattern !== this._pattern || (this.canUndo && value !== this._lastValue);\n\n if (stale) {\n this._pattern = pattern;\n this._clear();\n this._lastValue = value;\n }\n\n return !stale;\n }\n\n /**\n * Records the state an edit is about to overwrite. Must be called *before* the mask is\n * mutated, and only once the edit is known to change something.\n */\n public record(kind: MaskEditKind, state: MaskHistoryState): void {\n this._validate(state.value);\n this._redoStack.length = 0;\n this._lastRestored = null;\n\n if (!this._shouldCoalesce(kind, state)) {\n this._undoStack.push({ ...state });\n\n if (this._undoStack.length > MAX_HISTORY_SIZE) {\n this._undoStack.shift();\n }\n }\n\n this._lastKind = kind;\n }\n\n /**\n * Reports the state an edit settled on, so that the next {@link record} can tell\n * whether it continues the run.\n */\n public settle(value: string, caret: number): void {\n this._lastValue = value;\n this._lastCaret = caret;\n }\n\n /**\n * Reconciles the history with the editor's current text, typically on focus where a\n * date editor swaps the display format back for the input format. An unchanged\n * document keeps its history, a changed one drops it, and either way the run ends.\n */\n public resync(value: string): void {\n this._validate(value);\n\n this._lastValue = value;\n this._lastKind = null;\n this._lastCaret = -1;\n this._lastRestored = null;\n }\n\n /** Steps one edit back, handing `current` to the redo stack. */\n public undo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._undoStack, this._redoStack, current);\n }\n\n /** Steps one edit forward, handing `current` back to the undo stack. */\n public redo(current: MaskHistoryState): MaskHistoryState | null {\n return this._step(this._redoStack, this._undoStack, current);\n }\n\n private _step(\n from: MaskHistoryState[],\n to: MaskHistoryState[],\n current: MaskHistoryState\n ): MaskHistoryState | null {\n // Traversing a history whose document has moved on would restore text belonging to a\n // value the component no longer holds.\n if (!this._validate(current.value)) {\n return null;\n }\n\n const state = from.pop();\n\n if (!state) {\n return null;\n }\n\n to.push(this._lastRestored ?? { ...current });\n\n // Typing after an undo must not extend the step that was just restored.\n this._lastKind = null;\n this._lastValue = state.value;\n this._lastCaret = state.start;\n this._lastRestored = { ...state };\n\n return state;\n }\n}\n\n/**\n * Creates a {@link MaskHistory} for a masked editor.\n *\n * @param signature - resolves the identity of the mask pattern the snapshots are taken\n * against. A callback rather than a value because the history is created by the mask\n * behavior mixin, whose fields initialize *before* the parser of the concrete component.\n *\n * @example\n * ```ts\n * const history = createMaskHistory(() => `${parser.mask} ${parser.prompt}`);\n * ```\n */\nexport function createMaskHistory(signature: MaskSignature): MaskHistory {\n return new MaskHistory(signature);\n}\n\nexport type { MaskEditKind, MaskHistory, MaskHistoryState, MaskSignature };\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type MaskSelection } from '
|
|
1
|
+
import { type MaskSelection } from '#internals/mixins/mask-behavior.js';
|
|
2
2
|
import { IgcInputBaseComponent } from '../input/input-base.js';
|
|
3
3
|
import type { MaskInputValueMode } from '../types.js';
|
|
4
4
|
import { MaskParser } from './mask-parser.js';
|
|
5
5
|
export type { MaskSelection };
|
|
6
|
-
declare const IgcMaskInputComponent_base: import("
|
|
6
|
+
declare const IgcMaskInputComponent_base: import("../../internals/mixins/constructor.js").AbstractConstructor<import("#internals/mixins/mask-behavior.js").MaskBehaviorElementInterface> & typeof IgcInputBaseComponent;
|
|
7
7
|
/**
|
|
8
8
|
* A masked input is an input field where a developer can control user input and format the visible value,
|
|
9
9
|
* based on configurable rules
|
|
@@ -33,10 +33,10 @@ export default class IgcMaskInputComponent extends IgcMaskInputComponent_base {
|
|
|
33
33
|
static styles: import("lit").CSSResult[];
|
|
34
34
|
static register(): void;
|
|
35
35
|
protected readonly _parser: MaskParser;
|
|
36
|
-
protected get __validators(): import("
|
|
37
|
-
protected readonly _themes: import("
|
|
38
|
-
protected readonly _slots: import("
|
|
39
|
-
protected readonly _formValue: import("
|
|
36
|
+
protected get __validators(): import("../../internals/validators.js").Validator<IgcMaskInputComponent>[];
|
|
37
|
+
protected readonly _themes: import("#theming/theming-controller.js").ThemingController;
|
|
38
|
+
protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "prefix" | "[default]" | "suffix" | "helper-text" | "value-missing" | "custom-error" | "bad-input">;
|
|
39
|
+
protected readonly _formValue: import("#internals/mixins/forms/form-value.js").FormValue<string>;
|
|
40
40
|
protected get _isRawMode(): boolean;
|
|
41
41
|
/**
|
|
42
42
|
* Dictates the behavior when retrieving the value of the control:
|
|
@@ -52,7 +52,7 @@ export default class IgcMaskInputComponent extends IgcMaskInputComponent_base {
|
|
|
52
52
|
/**
|
|
53
53
|
* The value of the input.
|
|
54
54
|
*
|
|
55
|
-
* Regardless of the currently set `value-mode`, an empty value
|
|
55
|
+
* Regardless of the currently set `value-mode`, an empty value returns an empty string.
|
|
56
56
|
*
|
|
57
57
|
* @attr
|
|
58
58
|
*/
|
|
@@ -79,8 +79,13 @@ export default class IgcMaskInputComponent extends IgcMaskInputComponent_base {
|
|
|
79
79
|
protected _handleFocus(): Promise<void>;
|
|
80
80
|
protected _handleBlur(): void;
|
|
81
81
|
protected _handleChange(): void;
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
/**
|
|
83
|
+
* Commits straight to the form value instead of going through the `value` setter: the
|
|
84
|
+
* setter re-applies the parser, and `apply(parse(x))` left-packs the text - a mask with
|
|
85
|
+
* an interior hole such as `1_2-___` would collapse to `12_-___`.
|
|
86
|
+
*/
|
|
87
|
+
protected _commitMaskedValue(value: string): void;
|
|
88
|
+
protected _emitInputEvent(): void;
|
|
84
89
|
protected _syncValueFromMask(): void;
|
|
85
90
|
private _updateMaskedValue;
|
|
86
91
|
/** Returns whether the current masked input is valid according to the mask pattern. */
|
|
@@ -5,12 +5,12 @@ 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 {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
8
|
+
import { addSlotController, setSlots } from '#internals/controllers/slot.js';
|
|
9
|
+
import { registerComponent } from '#internals/definitions/register.js';
|
|
10
|
+
import { createFormValueState } from '#internals/mixins/forms/form-value.js';
|
|
11
|
+
import { MaskBehaviorMixin, } from '#internals/mixins/mask-behavior.js';
|
|
12
|
+
import { renderMaskedNativeInput } from '#internals/templates/masked-input.js';
|
|
13
|
+
import { addThemingController } from '#theming/theming-controller.js';
|
|
14
14
|
import { IgcInputBaseComponent } from '../input/input-base.js';
|
|
15
15
|
import { styles } from '../input/themes/input.base.css.js';
|
|
16
16
|
import { styles as shared } from '../input/themes/shared/input.common.css.js';
|
|
@@ -94,9 +94,12 @@ export default class IgcMaskInputComponent extends MaskBehaviorMixin(IgcInputBas
|
|
|
94
94
|
}
|
|
95
95
|
if (!this._formValue.value) {
|
|
96
96
|
this._maskedValue = this._parser.emptyMask;
|
|
97
|
+
this._historyResync();
|
|
97
98
|
await this.updateComplete;
|
|
98
99
|
this.select();
|
|
100
|
+
return;
|
|
99
101
|
}
|
|
102
|
+
this._historyResync();
|
|
100
103
|
}
|
|
101
104
|
_handleBlur() {
|
|
102
105
|
this._focused = false;
|
|
@@ -107,22 +110,16 @@ export default class IgcMaskInputComponent extends MaskBehaviorMixin(IgcInputBas
|
|
|
107
110
|
this._setTouchedState();
|
|
108
111
|
this.emitEvent('igcChange', { detail: this.value });
|
|
109
112
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
this.
|
|
113
|
-
this.
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
async _updateInput(text, { start, end }) {
|
|
117
|
-
const result = this._parser.replace(this._maskedValue, text, start, end);
|
|
118
|
-
this._maskedValue = result.value;
|
|
119
|
-
this._formValue.setValueAndFormState(this._parser.parse(this._maskedValue));
|
|
120
|
-
this.requestUpdate();
|
|
121
|
-
if (start !== this.mask.length) {
|
|
122
|
-
this.emitEvent('igcInput', { detail: this.value });
|
|
113
|
+
_commitMaskedValue(value) {
|
|
114
|
+
this._maskedValue = value;
|
|
115
|
+
this._formValue.setValueAndFormState(this._parser.parse(value));
|
|
116
|
+
if (!this._focused) {
|
|
117
|
+
this._updateMaskedValue();
|
|
123
118
|
}
|
|
124
|
-
|
|
125
|
-
|
|
119
|
+
}
|
|
120
|
+
_emitInputEvent() {
|
|
121
|
+
this._setTouchedState();
|
|
122
|
+
this.emitEvent('igcInput', { detail: this.value });
|
|
126
123
|
}
|
|
127
124
|
_syncValueFromMask() {
|
|
128
125
|
this.value = this._parser.parse(this._maskedValue);
|
|
@@ -137,7 +134,6 @@ export default class IgcMaskInputComponent extends MaskBehaviorMixin(IgcInputBas
|
|
|
137
134
|
}
|
|
138
135
|
_renderInput() {
|
|
139
136
|
const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';
|
|
140
|
-
const hasHelperText = this._slots.hasAssignedElements('helper-text');
|
|
141
137
|
return renderMaskedNativeInput({
|
|
142
138
|
id: this._inputId,
|
|
143
139
|
partNames: this._resolvePartNames('input'),
|
|
@@ -149,8 +145,9 @@ export default class IgcMaskInputComponent extends MaskBehaviorMixin(IgcInputBas
|
|
|
149
145
|
autofocus: this.autofocus,
|
|
150
146
|
inputMode: this.inputMode,
|
|
151
147
|
tabindex: hasNegativeTabIndex ? -1 : undefined,
|
|
152
|
-
|
|
148
|
+
aria: this._ariaTarget.resolveBindings(),
|
|
153
149
|
onInput: this._handleInput,
|
|
150
|
+
onBeforeInput: this._handleBeforeInput,
|
|
154
151
|
onFocus: this._handleFocus,
|
|
155
152
|
onBlur: this._handleBlur,
|
|
156
153
|
onClick: this._handleClick,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mask-input.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,M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AAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,kBAAkB,EAAE,IAAI,CAAC,uBAAuB;YAChD,gBAAgB,EAAE,IAAI,CAAC,qBAAqB;YAC5C,QAAQ,EAAE,IAAI,CAAC,aAAa;YAC5B,WAAW,EAAE,IAAI,CAAC,gBAAgB;YAClC,WAAW,EAAE,IAAI,CAAC,gBAAgB;SACnC,CAAC,CAAC;IACL,CAAC;;AAzLM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;wDACO;AAW7C;IADC,QAAQ,EAAE;kDAMV;AAkBD;IADC,QAAQ,EAAE;iDAMV;AAaD;IADC,QAAQ,EAAE;mDAMV","sourcesContent":["import { property } from 'lit/decorators.js';\nimport { addThemingController } from '../../theming/theming-controller.js';\nimport { addSlotController, setSlots } from '../common/controllers/slot.js';\nimport { registerComponent } from '../common/definitions/register.js';\nimport { createFormValueState } from '../common/mixins/forms/form-value.js';\nimport {\n MaskBehaviorMixin,\n type MaskSelection,\n} from '../common/mixins/mask-behavior.js';\nimport { renderMaskedNativeInput } from '../common/templates/masked-input.js';\nimport { IgcInputBaseComponent } from '../input/input-base.js';\nimport { styles } from '../input/themes/input.base.css.js';\nimport { styles as shared } from '../input/themes/shared/input.common.css.js';\nimport { all } from '../input/themes/themes.js';\nimport type { MaskInputValueMode } from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { MaskParser } from './mask-parser.js';\nimport { maskValidators } from './validators.js';\n\nexport type { MaskSelection };\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'value-missing',\n 'bad-input',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/* blazorIndirectRender */\n/**\n * A masked input is an input field where a developer can control user input and format the visible value,\n * based on configurable rules\n *\n * @element igc-mask-input\n *\n * @slot prefix - Renders content before the input\n * @slot suffix - Renders content after the input\n * @slot helper-text - Renders content below the input\n * @slot value-missing - Renders content when the required validation fails.\n * @slot bad-input - Renders content when a required mask pattern validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcInput - Emitted when the control receives user input\n * @fires igcChange - Emitted when an alteration of the control's value is committed by the user\n *\n * @csspart container - The main wrapper that holds all main input elements\n * @csspart input - The native input element\n * @csspart label - The native label element\n * @csspart prefix - The prefix wrapper\n * @csspart suffix - The suffix wrapper\n * @csspart helper-text - The helper text wrapper\n */\n\nexport default class IgcMaskInputComponent extends MaskBehaviorMixin(\n IgcInputBaseComponent\n) {\n public static readonly tagName = 'igc-mask-input';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcMaskInputComponent, IgcValidationContainerComponent);\n }\n\n //#region Internal attributes and properties\n\n protected override readonly _parser = new MaskParser();\n\n protected override get __validators() {\n return maskValidators;\n }\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: '',\n transformers: {\n setFormValue: (value) =>\n this._isRawMode ? value || null : this._maskedValue || null,\n },\n });\n\n protected get _isRawMode(): boolean {\n return this.valueMode === 'raw';\n }\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Dictates the behavior when retrieving the value of the control:\n *\n * - `raw`: Returns clean input (e.g. \"5551234567\")\n * - `withFormatting`: Returns with mask formatting (e.g. \"(555) 123-4567\")\n *\n * Empty values always return an empty string, regardless of the value mode.\n * @attr value-mode\n * @default 'raw'\n */\n @property({ attribute: 'value-mode' })\n public valueMode: MaskInputValueMode = 'raw';\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the input.\n *\n * Regardless of the currently set `value-mode`, an empty value will return an empty string.\n *\n * @attr\n */\n @property()\n public set value(string: string) {\n const value = string ?? '';\n this._maskedValue = this._parser.apply(value);\n this._updateMaskedValue();\n this._formValue.setValueAndFormState(value);\n }\n\n public get value(): string {\n const value = this._formValue.value;\n\n if (this._isRawMode) {\n return value;\n }\n return value ? this._maskedValue : value;\n }\n\n /**\n * The masked pattern of the component.\n *\n * @attr\n * @default 'CCCCCCCCCC'\n */\n @property()\n public override set mask(value: string) {\n super.mask = value;\n if (this.value) {\n this._maskedValue = this._parser.apply(this._formValue.value);\n }\n }\n\n public override get mask(): string {\n return super.mask;\n }\n\n /**\n * The prompt symbol to use for unfilled parts of the mask pattern.\n *\n * @attr\n * @default '_'\n */\n @property()\n public override set prompt(value: string) {\n super.prompt = value;\n if (this.value) {\n this._maskedValue = this._parser.apply(this._formValue.value);\n }\n }\n\n public override get prompt(): string {\n return super.prompt;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleDragEnter(): void {\n if (!this._focused && !this._formValue.value) {\n this._maskedValue = this._parser.emptyMask;\n }\n }\n\n protected _handleDragLeave(): void {\n if (!this._focused) {\n this._updateMaskedValue();\n }\n }\n\n protected async _handleFocus(): Promise<void> {\n this._focused = true;\n\n if (this.readOnly) {\n return;\n }\n\n if (!this._formValue.value) {\n // In case of empty value, select the whole mask\n this._maskedValue = this._parser.emptyMask;\n\n await this.updateComplete;\n this.select();\n }\n }\n\n protected override _handleBlur(): void {\n this._focused = false;\n this._updateMaskedValue();\n super._handleBlur();\n }\n\n protected _handleChange(): void {\n this._setTouchedState();\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n //#endregion\n\n //#region Internal methods\n\n protected override _restoreDefaultValue(): void {\n const value = this.defaultValue as string;\n\n this._maskedValue = this._parser.apply(value);\n this._updateMaskedValue();\n this._formValue.setValueAndFormState(value);\n }\n\n protected override async _updateInput(\n text: string,\n { start, end }: MaskSelection\n ): Promise<void> {\n const result = this._parser.replace(this._maskedValue, text, start, end);\n\n this._maskedValue = result.value;\n this._formValue.setValueAndFormState(this._parser.parse(this._maskedValue));\n this.requestUpdate();\n\n if (start !== this.mask.length) {\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n await this.updateComplete;\n this._input?.setSelectionRange(result.end, result.end);\n }\n\n protected override _syncValueFromMask(): void {\n this.value = this._parser.parse(this._maskedValue);\n }\n\n private _updateMaskedValue(): void {\n if (this._isEmptyMask) {\n this._maskedValue = '';\n }\n }\n\n //#endregion\n\n //#region Public methods\n\n /* blazorSuppress */\n /** Returns whether the current masked input is valid according to the mask pattern. */\n public isValidMaskPattern(): boolean {\n return this._parser.isValidString(this._maskedValue);\n }\n\n //#endregion\n\n protected override _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n const hasHelperText = this._slots.hasAssignedElements('helper-text');\n\n return renderMaskedNativeInput({\n id: this._inputId,\n partNames: this._resolvePartNames('input'),\n name: this.name,\n value: this._maskedValue,\n placeholder: this.placeholder ?? this._parser.escapedMask,\n readOnly: this.readOnly,\n disabled: this.disabled,\n autofocus: this.autofocus,\n inputMode: this.inputMode,\n tabindex: hasNegativeTabIndex ? -1 : undefined,\n ariaDescribedBy: hasHelperText ? 'helper-text' : undefined,\n onInput: this._handleInput,\n onFocus: this._handleFocus,\n onBlur: this._handleBlur,\n onClick: this._handleClick,\n onSetMaskSelection: this._setMaskSelection,\n onCompositionStart: this._handleCompositionStart,\n onCompositionEnd: this._handleCompositionEnd,\n onChange: this._handleChange,\n onDragEnter: this._handleDragEnter,\n onDragLeave: this._handleDragLeave,\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-mask-input': IgcMaskInputComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"mask-input.js","sourceRoot":"","sources":["../../../src/components/mask-input/mask-input.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MA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C,WAAW,IAAI,IAAI,CAAC,OAAO,CAAC,WAAW;YACzD,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS;YAC9C,IAAI,EAAE,IAAI,CAAC,WAAW,CAAC,eAAe,EAAE;YACxC,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,aAAa,EAAE,IAAI,CAAC,kBAAkB;YACtC,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,MAAM,EAAE,IAAI,CAAC,WAAW;YACxB,OAAO,EAAE,IAAI,CAAC,YAAY;YAC1B,kBAAkB,EAAE,IAAI,CAAC,iBAAiB;YAC1C,kBAAkB,EAAE,IAAI,CAAC,uBAAuB;YAChD,gBAAgB,EAAE,IAAI,CAAC,qBAAqB;YAC5C,QAAQ,EAAE,IAAI,CAAC,aAAa;YAC5B,WAAW,EAAE,IAAI,CAAC,gBAAgB;YAClC,WAAW,EAAE,IAAI,CAAC,gBAAgB;SACnC,CAAC,CAAC;IACL,CAAC;;AAxLM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;wDACO;AAW7C;IADC,QAAQ,EAAE;kDAMV;AAkBD;IADC,QAAQ,EAAE;iDAMV;AAaD;IADC,QAAQ,EAAE;mDAMV","sourcesContent":["import { property } from 'lit/decorators.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport {\n MaskBehaviorMixin,\n type MaskSelection,\n} from '#internals/mixins/mask-behavior.js';\nimport { renderMaskedNativeInput } from '#internals/templates/masked-input.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport { IgcInputBaseComponent } from '../input/input-base.js';\nimport { styles } from '../input/themes/input.base.css.js';\nimport { styles as shared } from '../input/themes/shared/input.common.css.js';\nimport { all } from '../input/themes/themes.js';\nimport type { MaskInputValueMode } from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport { MaskParser } from './mask-parser.js';\nimport { maskValidators } from './validators.js';\n\nexport type { MaskSelection };\n\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'value-missing',\n 'bad-input',\n 'custom-error',\n 'invalid'\n);\n\n/* blazorSupportsVisualChildren */\n/* blazorIndirectRender */\n/**\n * A masked input is an input field where a developer can control user input and format the visible value,\n * based on configurable rules\n *\n * @element igc-mask-input\n *\n * @slot prefix - Renders content before the input\n * @slot suffix - Renders content after the input\n * @slot helper-text - Renders content below the input\n * @slot value-missing - Renders content when the required validation fails.\n * @slot bad-input - Renders content when a required mask pattern validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n *\n * @fires igcInput - Emitted when the control receives user input\n * @fires igcChange - Emitted when an alteration of the control's value is committed by the user\n *\n * @csspart container - The main wrapper that holds all main input elements\n * @csspart input - The native input element\n * @csspart label - The native label element\n * @csspart prefix - The prefix wrapper\n * @csspart suffix - The suffix wrapper\n * @csspart helper-text - The helper text wrapper\n */\n\nexport default class IgcMaskInputComponent extends MaskBehaviorMixin(\n IgcInputBaseComponent\n) {\n public static readonly tagName = 'igc-mask-input';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(IgcMaskInputComponent, IgcValidationContainerComponent);\n }\n\n //#region Internal attributes and properties\n\n protected override readonly _parser = new MaskParser();\n\n protected override get __validators() {\n return maskValidators;\n }\n\n protected override readonly _themes = addThemingController(this, all);\n\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: '',\n transformers: {\n setFormValue: (value) =>\n this._isRawMode ? value || null : this._maskedValue || null,\n },\n });\n\n protected get _isRawMode(): boolean {\n return this.valueMode === 'raw';\n }\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Dictates the behavior when retrieving the value of the control:\n *\n * - `raw`: Returns clean input (e.g. \"5551234567\")\n * - `withFormatting`: Returns with mask formatting (e.g. \"(555) 123-4567\")\n *\n * Empty values always return an empty string, regardless of the value mode.\n * @attr value-mode\n * @default 'raw'\n */\n @property({ attribute: 'value-mode' })\n public valueMode: MaskInputValueMode = 'raw';\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the input.\n *\n * Regardless of the currently set `value-mode`, an empty value returns an empty string.\n *\n * @attr\n */\n @property()\n public set value(string: string) {\n const value = string ?? '';\n this._maskedValue = this._parser.apply(value);\n this._updateMaskedValue();\n this._formValue.setValueAndFormState(value);\n }\n\n public get value(): string {\n const value = this._formValue.value;\n\n if (this._isRawMode) {\n return value;\n }\n return value ? this._maskedValue : value;\n }\n\n /**\n * The masked pattern of the component.\n *\n * @attr\n * @default 'CCCCCCCCCC'\n */\n @property()\n public override set mask(value: string) {\n super.mask = value;\n if (this.value) {\n this._maskedValue = this._parser.apply(this._formValue.value);\n }\n }\n\n public override get mask(): string {\n return super.mask;\n }\n\n /**\n * The prompt symbol to use for unfilled parts of the mask pattern.\n *\n * @attr\n * @default '_'\n */\n @property()\n public override set prompt(value: string) {\n super.prompt = value;\n if (this.value) {\n this._maskedValue = this._parser.apply(this._formValue.value);\n }\n }\n\n public override get prompt(): string {\n return super.prompt;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleDragEnter(): void {\n if (!this._focused && !this._formValue.value) {\n this._maskedValue = this._parser.emptyMask;\n }\n }\n\n protected _handleDragLeave(): void {\n if (!this._focused) {\n this._updateMaskedValue();\n }\n }\n\n protected async _handleFocus(): Promise<void> {\n this._focused = true;\n\n if (this.readOnly) {\n return;\n }\n\n if (!this._formValue.value) {\n // In case of empty value, select the whole mask\n this._maskedValue = this._parser.emptyMask;\n this._historyResync();\n\n await this.updateComplete;\n this.select();\n return;\n }\n\n this._historyResync();\n }\n\n protected override _handleBlur(): void {\n this._focused = false;\n this._updateMaskedValue();\n super._handleBlur();\n }\n\n protected _handleChange(): void {\n this._setTouchedState();\n this.emitEvent('igcChange', { detail: this.value });\n }\n\n //#endregion\n\n //#region Internal methods\n\n /**\n * Commits straight to the form value instead of going through the `value` setter: the\n * setter re-applies the parser, and `apply(parse(x))` left-packs the text - a mask with\n * an interior hole such as `1_2-___` would collapse to `12_-___`.\n */\n protected override _commitMaskedValue(value: string): void {\n this._maskedValue = value;\n this._formValue.setValueAndFormState(this._parser.parse(value));\n\n // Reachable unfocused only through `setRangeText`, where an emptied mask must read\n // as an empty document - as it does after a blur - rather than a row of prompts.\n if (!this._focused) {\n this._updateMaskedValue();\n }\n }\n\n protected override _emitInputEvent(): void {\n this._setTouchedState();\n this.emitEvent('igcInput', { detail: this.value });\n }\n\n protected override _syncValueFromMask(): void {\n this.value = this._parser.parse(this._maskedValue);\n }\n\n private _updateMaskedValue(): void {\n if (this._isEmptyMask) {\n this._maskedValue = '';\n }\n }\n\n //#endregion\n\n //#region Public methods\n\n /* blazorSuppress */\n /** Returns whether the current masked input is valid according to the mask pattern. */\n public isValidMaskPattern(): boolean {\n return this._parser.isValidString(this._maskedValue);\n }\n\n //#endregion\n\n protected override _renderInput() {\n const hasNegativeTabIndex = this.getAttribute('tabindex') === '-1';\n\n return renderMaskedNativeInput({\n id: this._inputId,\n partNames: this._resolvePartNames('input'),\n name: this.name,\n value: this._maskedValue,\n placeholder: this.placeholder ?? this._parser.escapedMask,\n readOnly: this.readOnly,\n disabled: this.disabled,\n autofocus: this.autofocus,\n inputMode: this.inputMode,\n tabindex: hasNegativeTabIndex ? -1 : undefined,\n aria: this._ariaTarget.resolveBindings(),\n onInput: this._handleInput,\n onBeforeInput: this._handleBeforeInput,\n onFocus: this._handleFocus,\n onBlur: this._handleBlur,\n onClick: this._handleClick,\n onSetMaskSelection: this._setMaskSelection,\n onCompositionStart: this._handleCompositionStart,\n onCompositionEnd: this._handleCompositionEnd,\n onChange: this._handleChange,\n onDragEnter: this._handleDragEnter,\n onDragLeave: this._handleDragLeave,\n });\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-mask-input': IgcMaskInputComponent;\n }\n}\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Options for the {@link MaskParser} */
|
|
2
|
-
interface MaskOptions {
|
|
2
|
+
export interface MaskOptions {
|
|
3
3
|
/**
|
|
4
4
|
* The mask format string (e.g., '00/00/0000' for dates, 'AAA-000' for custom IDs).
|
|
5
5
|
*
|
|
@@ -11,7 +11,9 @@ interface MaskOptions {
|
|
|
11
11
|
format?: string;
|
|
12
12
|
/**
|
|
13
13
|
* The character used to prompt for input in unfilled mask positions.
|
|
14
|
-
*
|
|
14
|
+
*
|
|
15
|
+
* Only the first character is used, and a mask flag is rejected in favor of the
|
|
16
|
+
* default - the same rules the `prompt` accessor applies.
|
|
15
17
|
* @default '_'
|
|
16
18
|
*/
|
|
17
19
|
promptCharacter?: string;
|
|
@@ -43,6 +45,12 @@ export declare class MaskParser {
|
|
|
43
45
|
protected _escapedMask: string;
|
|
44
46
|
/** Cached array of required non-literal positions for validation */
|
|
45
47
|
protected _requiredPositions: number[];
|
|
48
|
+
/**
|
|
49
|
+
* Declared without an initializer on purpose. With `useDefineForClassFields: false`
|
|
50
|
+
* nothing is emitted for it, so {@link _invalidate} can safely run from the
|
|
51
|
+
* constructor - before subclass fields exist.
|
|
52
|
+
*/
|
|
53
|
+
private _emptyMask?;
|
|
46
54
|
/**
|
|
47
55
|
* Returns a set of the all the literal positions in the mask.
|
|
48
56
|
* These positions are fixed characters that are not part of the input.
|
|
@@ -78,6 +86,16 @@ export declare class MaskParser {
|
|
|
78
86
|
set prompt(value: string);
|
|
79
87
|
constructor(options?: MaskOptions);
|
|
80
88
|
private _isEscapedFlag;
|
|
89
|
+
/**
|
|
90
|
+
* The pattern the literal parser consumes. Subclasses whose public format is not itself
|
|
91
|
+
* a mask pattern - date formats, for instance - translate it here.
|
|
92
|
+
*/
|
|
93
|
+
protected _toMaskFormat(format: string): string;
|
|
94
|
+
/**
|
|
95
|
+
* Drops everything derived from the mask. Runs on every mask *and* prompt change, and
|
|
96
|
+
* from the constructor, so overrides must not touch fields with initializers.
|
|
97
|
+
*/
|
|
98
|
+
protected _invalidate(): void;
|
|
81
99
|
/**
|
|
82
100
|
* Parses the mask format string to identify literal characters and
|
|
83
101
|
* create the escaped mask. This method is called whenever the mask format changes.
|
|
@@ -28,6 +28,10 @@ const UNICODE_DIGIT_TO_ASCII = new Map(DIGIT_ZERO_CODEPOINTS.flatMap((zeroCodePo
|
|
|
28
28
|
zeroCodePoint + i,
|
|
29
29
|
String.fromCharCode(ASCII_ZERO + i),
|
|
30
30
|
])));
|
|
31
|
+
function normalizePrompt(value, current) {
|
|
32
|
+
const char = value ? value.substring(0, 1) : current;
|
|
33
|
+
return MASK_FLAGS.has(char) ? current : char;
|
|
34
|
+
}
|
|
31
35
|
function replaceUnicodeNumbers(text) {
|
|
32
36
|
const matcher = /\p{Nd}/gu;
|
|
33
37
|
return text.replace(matcher, (digit) => {
|
|
@@ -48,10 +52,6 @@ const MASK_PATTERNS = new Map([
|
|
|
48
52
|
function validate(char, flag) {
|
|
49
53
|
return MASK_PATTERNS.get(flag)?.test(char) ?? false;
|
|
50
54
|
}
|
|
51
|
-
const MaskDefaultOptions = {
|
|
52
|
-
format: DEFAULT_FORMAT,
|
|
53
|
-
promptCharacter: DEFAULT_PROMPT,
|
|
54
|
-
};
|
|
55
55
|
export class MaskParser {
|
|
56
56
|
get literalPositions() {
|
|
57
57
|
return this._literalPositions;
|
|
@@ -60,7 +60,8 @@ export class MaskParser {
|
|
|
60
60
|
return this._escapedMask;
|
|
61
61
|
}
|
|
62
62
|
get emptyMask() {
|
|
63
|
-
|
|
63
|
+
this._emptyMask ??= this.apply();
|
|
64
|
+
return this._emptyMask;
|
|
64
65
|
}
|
|
65
66
|
get mask() {
|
|
66
67
|
return this._options.format;
|
|
@@ -73,25 +74,31 @@ export class MaskParser {
|
|
|
73
74
|
return this._options.promptCharacter;
|
|
74
75
|
}
|
|
75
76
|
set prompt(value) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return;
|
|
79
|
-
}
|
|
80
|
-
this._options.promptCharacter = char;
|
|
77
|
+
this._options.promptCharacter = normalizePrompt(value, this._options.promptCharacter);
|
|
78
|
+
this._invalidate();
|
|
81
79
|
}
|
|
82
80
|
constructor(options) {
|
|
83
81
|
this._literals = new Map();
|
|
84
82
|
this._literalPositions = new Set();
|
|
85
83
|
this._escapedMask = '';
|
|
86
84
|
this._requiredPositions = [];
|
|
87
|
-
this._options = {
|
|
85
|
+
this._options = {
|
|
86
|
+
format: options?.format || DEFAULT_FORMAT,
|
|
87
|
+
promptCharacter: normalizePrompt(options?.promptCharacter, DEFAULT_PROMPT),
|
|
88
|
+
};
|
|
88
89
|
this._parseMaskLiterals();
|
|
89
90
|
}
|
|
90
91
|
_isEscapedFlag(char, nextChar) {
|
|
91
92
|
return char === ESCAPE_CHAR && MASK_FLAGS.has(nextChar);
|
|
92
93
|
}
|
|
94
|
+
_toMaskFormat(format) {
|
|
95
|
+
return format;
|
|
96
|
+
}
|
|
97
|
+
_invalidate() {
|
|
98
|
+
this._emptyMask = undefined;
|
|
99
|
+
}
|
|
93
100
|
_parseMaskLiterals() {
|
|
94
|
-
const mask = this.
|
|
101
|
+
const mask = this._toMaskFormat(this._options.format);
|
|
95
102
|
const length = mask.length;
|
|
96
103
|
const escapedMaskChars = [];
|
|
97
104
|
let currentPos = 0;
|
|
@@ -115,6 +122,7 @@ export class MaskParser {
|
|
|
115
122
|
this._escapedMask = escapedMaskChars.join('');
|
|
116
123
|
this._literalPositions = new Set(this._literals.keys());
|
|
117
124
|
this._requiredPositions = this._computeRequiredPositions();
|
|
125
|
+
this._invalidate();
|
|
118
126
|
}
|
|
119
127
|
_computeRequiredPositions() {
|
|
120
128
|
const literalPositions = this._literalPositions;
|
|
@@ -154,7 +162,7 @@ export class MaskParser {
|
|
|
154
162
|
const length = escapedMask.length;
|
|
155
163
|
const prompt = this.prompt;
|
|
156
164
|
const endBoundary = Math.min(end, length);
|
|
157
|
-
const maskedChars = maskString ? [...maskString] : [...this.
|
|
165
|
+
const maskedChars = maskString ? [...maskString] : [...this.emptyMask];
|
|
158
166
|
const inputChars = Array.from(replaceUnicodeNumbers(value));
|
|
159
167
|
const inputLength = inputChars.length;
|
|
160
168
|
for (let i = start; i < endBoundary; i++) {
|