igniteui-webcomponents 7.2.4 → 7.3.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +162 -0
- package/animations/player.d.ts +7 -2
- package/animations/player.js +2 -3
- package/animations/player.js.map +1 -1
- package/animations/view-transition.js +1 -1
- package/animations/view-transition.js.map +1 -1
- package/components/accordion/accordion.d.ts +1 -1
- package/components/accordion/accordion.js +11 -22
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.d.ts +0 -1
- package/components/avatar/avatar.js +8 -12
- 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 +2 -4
- package/components/badge/badge.js +9 -13
- 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 +8 -7
- package/components/banner/banner.js +27 -25
- 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 +3 -3
- package/components/button/button-base.js +9 -8
- 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 +3 -3
- 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 +41 -21
- package/components/button-group/button-group.js +95 -105
- 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 +28 -19
- package/components/calendar/base.js +20 -44
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +38 -7
- 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 +8 -22
- 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 +2 -2
- package/components/carousel/carousel-indicator.js +17 -17
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -3
- package/components/carousel/carousel-slide.js +16 -18
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +58 -41
- package/components/carousel/carousel.js +170 -145
- package/components/carousel/carousel.js.map +1 -1
- package/components/carousel/themes/carousel.base.css.js +1 -1
- package/components/carousel/themes/carousel.base.css.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 +28 -27
- 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 -6
- package/components/chat/chat.js +13 -19
- 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.d.ts +3 -5
- package/components/checkbox/checkbox.js +40 -50
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.d.ts +1 -1
- package/components/checkbox/switch.js +30 -40
- 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 -16
- package/components/chip/chip.js +21 -38
- 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 +1 -5
- package/components/combo/combo-item.js +8 -18
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo.d.ts +89 -45
- package/components/combo/combo.js +244 -229
- 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 +297 -0
- package/components/date-picker/date-picker.base.js +473 -0
- package/components/date-picker/date-picker.base.js.map +1 -0
- package/components/date-picker/date-picker.d.ts +53 -174
- package/components/date-picker/date-picker.js +90 -403
- 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 +14 -18
- package/components/date-range-picker/date-range-input.js +39 -126
- 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 +93 -190
- package/components/date-range-picker/date-range-picker.js +208 -543
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +4 -4
- package/components/date-range-picker/predefined-ranges-area.js +8 -10
- 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 +10 -30
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-part.d.ts +20 -2
- package/components/date-time-input/date-part.js +48 -75
- package/components/date-time-input/date-part.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +101 -35
- package/components/date-time-input/date-time-input.base.js +142 -46
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +14 -26
- package/components/date-time-input/date-time-input.js +37 -90
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +53 -109
- package/components/date-time-input/datetime-mask-parser.js +93 -144
- 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 +3 -14
- package/components/date-time-input/validators.js.map +1 -1
- package/components/dialog/dialog.d.ts +8 -9
- package/components/dialog/dialog.js +38 -44
- 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 +3 -5
- package/components/divider/divider.js +11 -20
- 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 +16 -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 +27 -8
- package/components/expansion-panel/expansion-panel.js +33 -43
- 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 +19 -23
- package/components/file-input/file-input.js +21 -34
- 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.d.ts +6 -8
- package/components/highlight/highlight.js +14 -22
- 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 +11 -23
- package/components/icon/icon.js +36 -28
- 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 +10 -25
- package/components/input/input-base.js +14 -23
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +23 -30
- package/components/input/input.js +38 -69
- 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 -26
- 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 +10 -10
- package/components/nav-drawer/nav-drawer.js +23 -37
- 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 +5 -8
- package/components/progress/base.js +25 -48
- 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 +222 -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 +7 -0
- package/components/radio/controller.js +14 -0
- package/components/radio/controller.js.map +1 -0
- package/components/radio/radio.d.ts +30 -18
- package/components/radio/radio.js +90 -89
- 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 +17 -9
- package/components/radio-group/radio-group.js +46 -44
- 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 +30 -18
- package/components/rating/rating.js +90 -81
- 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/default-ghost.js +4 -3
- package/components/resize-container/default-ghost.js.map +1 -1
- package/components/resize-container/resize-container.d.ts +3 -3
- package/components/resize-container/resize-container.js +9 -7
- package/components/resize-container/resize-container.js.map +1 -1
- package/components/resize-container/resize-controller.js +6 -5
- 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 +11 -3
- package/components/select/select-group.js +21 -9
- 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 +48 -28
- package/components/select/select.js +143 -94
- 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 +5 -4
- package/components/slider/range-slider.js +25 -73
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +9 -6
- package/components/slider/slider-base.js +35 -32
- 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 +15 -11
- 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 +4 -4
- 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 +107 -24
- 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 +4 -1
- package/components/stepper/step.js +16 -12
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +5 -16
- package/components/stepper/stepper.js +27 -89
- 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 +36 -14
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +37 -27
- package/components/tabs/tabs.js +118 -129
- 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 +24 -20
- package/components/textarea/textarea.js +25 -27
- 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 +3 -5
- package/components/theme-provider/theme-provider.js +13 -23
- 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 +11 -22
- package/components/tile-manager/tile-manager.js +50 -81
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +14 -22
- package/components/tile-manager/tile.js +66 -80
- 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 +68 -25
- package/components/tooltip/tooltip.js +130 -88
- 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 +198 -208
- 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 +17 -23
- package/components/tree/tree.js +68 -94
- 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 +2 -3
- package/components/validation-container/validation-container.js +7 -6
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +94 -0
- package/components/virtualization/engine.js +217 -0
- package/components/virtualization/engine.js.map +1 -0
- package/components/virtualization/types.d.ts +54 -0
- package/components/virtualization/types.js +14 -0
- package/components/virtualization/types.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +249 -0
- package/components/virtualization/virtualization.js +482 -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 +50649 -38832
- 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 +17 -12
- 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/internals/controllers/context-provider.d.ts +48 -0
- package/internals/controllers/context-provider.js +29 -0
- package/internals/controllers/context-provider.js.map +1 -0
- package/{components/common → internals}/controllers/drag.js +8 -7
- 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 +7 -4
- package/internals/controllers/gestures.js.map +1 -0
- package/internals/controllers/group.d.ts +64 -0
- package/internals/controllers/group.js +104 -0
- package/internals/controllers/group.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 +52 -3
- package/{components/common → internals}/controllers/internals.js +35 -0
- package/internals/controllers/internals.js.map +1 -0
- package/{components/common → internals}/controllers/key-bindings.d.ts +8 -5
- package/{components/common → internals}/controllers/key-bindings.js +46 -29
- package/internals/controllers/key-bindings.js.map +1 -0
- package/{components/common → internals}/controllers/mutation-observer.d.ts +3 -2
- package/{components/common → internals}/controllers/mutation-observer.js +24 -22
- 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/internals/controllers/roving-focus.d.ts +72 -0
- package/internals/controllers/roving-focus.js +61 -0
- package/internals/controllers/roving-focus.js.map +1 -0
- package/{components/common → internals}/controllers/slot.d.ts +25 -1
- package/{components/common → internals}/controllers/slot.js +22 -6
- package/internals/controllers/slot.js.map +1 -0
- package/internals/controllers/toggle.d.ts +96 -0
- package/internals/controllers/toggle.js +65 -0
- package/internals/controllers/toggle.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 +70 -0
- package/internals/date/converters.js.map +1 -0
- package/{components/calendar → internals/date}/model.d.ts +10 -3
- package/{components/calendar → internals/date}/model.js +29 -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/coerced-property.d.ts +47 -0
- package/internals/decorators/coerced-property.js +36 -0
- package/internals/decorators/coerced-property.js.map +1 -0
- package/internals/decorators/shadow-options.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/{components/common → internals}/i18n/i18n-controller.d.ts +22 -3
- package/{components/common → internals}/i18n/i18n-controller.js +28 -6
- 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 +3 -3
- package/{components/common → internals}/mixins/alert.js +8 -6
- package/internals/mixins/alert.js.map +1 -0
- package/{components/common → internals}/mixins/combo-box.d.ts +13 -14
- package/{components/common → internals}/mixins/combo-box.js +15 -36
- 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.js +63 -38
- 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 +25 -7
- package/internals/mixins/forms/types.js.map +1 -0
- package/internals/mixins/i18n.d.ts +31 -0
- package/internals/mixins/i18n.js +36 -0
- package/internals/mixins/i18n.js.map +1 -0
- package/{components/common → internals}/mixins/mask-behavior.d.ts +17 -8
- package/{components/common → internals}/mixins/mask-behavior.js +118 -31
- 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 +5 -6
- 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 -4
- package/{components/common → internals}/templates/masked-input.js +4 -3
- package/internals/templates/masked-input.js.map +1 -0
- package/internals/templates/slotted-icon.d.ts +32 -0
- package/internals/templates/slotted-icon.js +19 -0
- package/internals/templates/slotted-icon.js.map +1 -0
- package/internals/templates/toggle-shell.d.ts +46 -0
- package/internals/templates/toggle-shell.js +38 -0
- package/internals/templates/toggle-shell.js.map +1 -0
- package/internals/timing.d.ts +32 -0
- package/internals/timing.js +20 -0
- package/internals/timing.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 +114 -0
- package/internals/utils/dom.js +157 -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 +24 -1
- package/{components/common → internals}/validators.js +25 -2
- package/internals/validators.js.map +1 -0
- package/package.json +15 -7
- 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 +5 -5
- 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.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.d.ts +0 -5
- package/components/common/decorators/watch.js +0 -19
- 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}/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/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/associated.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,5 +1,5 @@
|
|
|
1
|
-
import { convertToDate, convertToDateRange, getDateFormValue, } from '
|
|
2
|
-
import { asNumber } from '../../
|
|
1
|
+
import { convertToDate, convertToDateRange, getDateFormValue, } from '../../date/converters.js';
|
|
2
|
+
import { asNumber } from '../../utils/math.js';
|
|
3
3
|
export const FormValueDefaultTransformers = {
|
|
4
4
|
setValue: (value) => value || '',
|
|
5
5
|
getValue: (value) => value,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-transformers.js","sourceRoot":"","sources":["../../../../src/internals/mixins/forms/form-transformers.ts"],"names":[],"mappings":"AACA,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AEJ,MAAM,CAAC,MAAM,2BAA2B,GAEpC;IACF,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,SAAS;IACvC,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,SAAS;CAC/C,CAAC","sourcesContent":["import type { DateRangeValue } from '../../../components/types.js';\nimport {\n convertToDate,\n convertToDateRange,\n getDateFormValue,\n} from '../../date/converters.js';\nimport { asNumber } from '../../utils/math.js';\nimport type { FormValueType, IgcFormControl } from './types.js';\n\nexport type FormValueTransformers<T> = {\n setValue: (value: T) => T;\n getValue: (value: T) => T;\n setDefaultValue: (value: T) => T;\n getDefaultValue: (value: T) => T;\n setFormValue: (value: T, host: IgcFormControl) => FormValueType;\n};\n\nexport type FormValueConfig<T> = {\n initialValue: T;\n initialDefaultValue?: T;\n transformers?: Partial<FormValueTransformers<T>>;\n};\n\n// Transformers\n\nexport const FormValueDefaultTransformers: FormValueTransformers<string> = {\n setValue: (value) => value || '',\n getValue: (value) => value,\n setDefaultValue: (value) => value || '',\n getDefaultValue: (value) => value,\n setFormValue: (value, _) => value || null,\n};\n\nexport const FormValueBooleanTransformers: Partial<\n FormValueTransformers<boolean>\n> = {\n setValue: Boolean,\n setDefaultValue: Boolean,\n setFormValue: (checked, host) =>\n checked && 'value' in host ? (host.value as string) || 'on' : null,\n};\n\nexport const FormValueNumberTransformers: Partial<\n FormValueTransformers<number>\n> = {\n setValue: asNumber,\n setDefaultValue: asNumber,\n setFormValue: (value) => value.toString(),\n};\n\nexport const FormValueDateTimeTransformers: Partial<\n FormValueTransformers<Date | null>\n> = {\n setValue: convertToDate,\n setDefaultValue: convertToDate,\n setFormValue: getDateFormValue,\n};\n\nexport const FormValueDateRangeTransformers: Partial<\n FormValueTransformers<DateRangeValue | null>\n> = {\n setValue: convertToDateRange,\n setDefaultValue: convertToDateRange,\n setFormValue: (value, host) => {\n if (!host.name) {\n return null;\n }\n const start = value?.start?.toISOString();\n const end = value?.end?.toISOString();\n\n const formData = new FormData();\n\n if (start) {\n formData.append(`${host.name}-start`, start);\n }\n if (end) {\n formData.append(`${host.name}-end`, end);\n }\n\n return formData;\n },\n};\n\n/* blazorSuppress */\nexport const FormValueFileListTransformers: FormValueTransformers<FileList | null> =\n {\n setValue: (value) => value || null,\n getValue: (value) => value,\n setDefaultValue: (value) => value || null,\n getDefaultValue: (value) => value,\n setFormValue: (files, host) => {\n if (!(host.name && files)) {\n return null;\n }\n\n const formData = new FormData();\n for (const file of files) {\n formData.append(host.name, file);\n }\n\n return formData;\n },\n };\n\nexport const FormValueSelectTransformers: Partial<\n FormValueTransformers<string | undefined>\n> = {\n setValue: (value) => value || undefined,\n setDefaultValue: (value) => value || undefined,\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-value.js","sourceRoot":"","sources":["../../../../src/internals/mixins/forms/form-value.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,4BAA4B,GAE7B,MAAM,wBAAwB,CAAC;AAIhC,MAAM,OAAO,SAAS;aACI,oBAAe,GAAG,eAAwB,CAAC;IASnE,YAAY,IAAoB,EAAE,MAA0B;QAC1D,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC;QAClC,IAAI,CAAC,aAAa,GAAG,MAAM,CAAC,mBAAmB,IAAI,IAAI,CAAC,MAAM,CAAC;QAC/D,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAErD,IAAI,CAAC,aAAa,GAAG;YACnB,GAAG,4BAA4B;YAC/B,GAAG,MAAM,CAAC,YAAY;SACK,CAAC;IAChC,CAAC;IAEM,oBAAoB,CAAC,KAAQ;QAClC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,aAAa,CAAC,IAAI,CACrB,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,CACxD,CAAC;IACJ,CAAC;IAED,IAAW,YAAY,CAAC,KAAQ;QAC9B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;IAED,IAAW,YAAY;QACrB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;IAChE,CAAC;IAED,IAAW,KAAK,CAAC,KAAQ;QACvB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnD,CAAC;IAED,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAClD,CAAC;;AAGH,MAAM,UAAU,oBAAoB,CAClC,IAAgB,EAChB,MAA0B;IAE1B,OAAO,IAAI,SAAS,CAAC,IAAsB,EAAE,MAAM,CAAC,CAAC;AACvD,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport {\n type FormValueConfig,\n FormValueDefaultTransformers,\n type FormValueTransformers,\n} from './form-transformers.js';\nimport type { IgcFormControl } from './types.js';\n\n/* blazorSuppress */\nexport class FormValue<T> {\n private static readonly setFormValueKey = '_setFormValue' as const;\n\n private readonly _host: IgcFormControl;\n private readonly _transformers: FormValueTransformers<T>;\n private readonly _setFormValue: IgcFormControl[typeof FormValue.setFormValueKey];\n\n private _value: T;\n private _defaultValue: T;\n\n constructor(host: IgcFormControl, config: FormValueConfig<T>) {\n this._host = host;\n this._value = config.initialValue;\n this._defaultValue = config.initialDefaultValue ?? this._value;\n this._setFormValue = host[FormValue.setFormValueKey];\n\n this._transformers = {\n ...FormValueDefaultTransformers,\n ...config.transformers,\n } as FormValueTransformers<T>;\n }\n\n public setValueAndFormState(value: T): void {\n this.value = value;\n this._setFormValue.call(\n this._host,\n this._transformers.setFormValue(this.value, this._host)\n );\n }\n\n public set defaultValue(value: T) {\n this._defaultValue = this._transformers.setDefaultValue(value);\n }\n\n public get defaultValue(): T {\n return this._transformers.getDefaultValue(this._defaultValue);\n }\n\n public set value(value: T) {\n this._value = this._transformers.setValue(value);\n }\n\n public get value(): T {\n return this._transformers.getValue(this._value);\n }\n}\n\nexport function createFormValueState<T>(\n host: LitElement,\n config: FormValueConfig<T>\n): FormValue<T> {\n return new FormValue(host as IgcFormControl, config);\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type { LitElement } from 'lit';
|
|
1
|
+
import type { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import type { ValidationContainerConfig } from '../../../components/validation-container/validation-container.js';
|
|
2
3
|
import type { ElementInternalsController } from '../../controllers/internals.js';
|
|
3
4
|
import type { Validator } from '../../validators.js';
|
|
4
5
|
export type FormRestoreMode = 'autocomplete' | 'restore';
|
|
5
6
|
export type FormValueType = string | File | FormData | null;
|
|
6
7
|
export type IgcFormControl = LitElement & (FormAssociatedElementInterface | FormAssociatedCheckboxElementInterface);
|
|
7
|
-
declare class BaseFormAssociatedElement {
|
|
8
|
+
export declare class BaseFormAssociatedElement {
|
|
8
9
|
static readonly formAssociated: boolean;
|
|
9
10
|
protected readonly _internals: ElementInternalsController;
|
|
10
11
|
protected readonly _formValue: unknown;
|
|
@@ -25,7 +26,7 @@ declare class BaseFormAssociatedElement {
|
|
|
25
26
|
*/
|
|
26
27
|
invalid: boolean;
|
|
27
28
|
/**
|
|
28
|
-
* The name
|
|
29
|
+
* The name of the control, submitted with the form data.
|
|
29
30
|
* @attr
|
|
30
31
|
*/
|
|
31
32
|
name: string;
|
|
@@ -62,9 +63,21 @@ declare class BaseFormAssociatedElement {
|
|
|
62
63
|
* regards to its value.
|
|
63
64
|
*/
|
|
64
65
|
protected _setTouchedState(): void;
|
|
66
|
+
/**
|
|
67
|
+
* Sets the **touched** state of the component and emits `eventName` - the pair every
|
|
68
|
+
* user-interaction handler must apply when it responds to input.
|
|
69
|
+
*
|
|
70
|
+
* The host must compose the event-emitter mixin somewhere in its heritage.
|
|
71
|
+
*/
|
|
72
|
+
protected _emitTouchedEvent(eventName: string, init?: CustomEventInit): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Renders a validation container bound to the component, projecting its helper-text
|
|
75
|
+
* and validation message slots.
|
|
76
|
+
*/
|
|
77
|
+
protected _renderValidationContainer(config?: ValidationContainerConfig): TemplateResult;
|
|
65
78
|
/**
|
|
66
79
|
* Sets the default value of the component.
|
|
67
|
-
* Called in `attributeChangedCallback`(i.e. when the `value` attribute of the control is set).
|
|
80
|
+
* Called in `attributeChangedCallback` (i.e. when the `value` attribute of the control is set).
|
|
68
81
|
*/
|
|
69
82
|
protected _setDefaultValue(current: string | null): void;
|
|
70
83
|
/**
|
|
@@ -108,9 +121,9 @@ declare class BaseFormAssociatedElement {
|
|
|
108
121
|
* This is not implemented currently.
|
|
109
122
|
*/
|
|
110
123
|
protected formStateRestoreCallback(state: FormValueType, mode: FormRestoreMode): void;
|
|
111
|
-
/** Checks for validity of the control and emits the invalid event if it invalid. */
|
|
124
|
+
/** Checks for validity of the control and emits the invalid event if it's invalid. */
|
|
112
125
|
checkValidity(): boolean;
|
|
113
|
-
/** Checks for validity of the control and shows the browser message if it invalid. */
|
|
126
|
+
/** Checks for validity of the control and shows the browser message if it's invalid. */
|
|
114
127
|
reportValidity(): boolean;
|
|
115
128
|
/**
|
|
116
129
|
* Sets a custom validation message for the control.
|
|
@@ -122,6 +135,12 @@ export declare class FormAssociatedElementInterface extends BaseFormAssociatedEl
|
|
|
122
135
|
/** The initial value of the component. */
|
|
123
136
|
set defaultValue(value: unknown);
|
|
124
137
|
get defaultValue(): unknown;
|
|
138
|
+
/**
|
|
139
|
+
* Commits a user-initiated value change: sets the **touched** state **before** assigning
|
|
140
|
+
* to the public `value` setter, so the validation cycle the setter runs applies invalid
|
|
141
|
+
* styling in the same pass, then emits `eventName` with the coerced value as `detail`.
|
|
142
|
+
*/
|
|
143
|
+
protected _commitValue(value: unknown, eventName: string): boolean;
|
|
125
144
|
}
|
|
126
145
|
export declare class FormAssociatedCheckboxElementInterface extends BaseFormAssociatedElement {
|
|
127
146
|
/** The initial checked state of the component. */
|
|
@@ -140,4 +159,3 @@ export declare class FormRequiredInterface {
|
|
|
140
159
|
}
|
|
141
160
|
export declare const InternalInvalidEvent = "igc-form-internal-invalid";
|
|
142
161
|
export declare const InternalResetEvent = "igc-form-internal-reset";
|
|
143
|
-
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/internals/mixins/forms/types.ts"],"names":[],"mappings":"AAkNA,MAAM,CAAC,MAAM,oBAAoB,GAAG,2BAA2B,CAAC;AAChE,MAAM,CAAC,MAAM,kBAAkB,GAAG,yBAAyB,CAAC","sourcesContent":["import type { LitElement, TemplateResult } from 'lit';\nimport type { ValidationContainerConfig } from '../../../components/validation-container/validation-container.js';\nimport type { ElementInternalsController } from '../../controllers/internals.js';\nimport type { Validator } from '../../validators.js';\n\nexport type FormRestoreMode = 'autocomplete' | 'restore';\nexport type FormValueType = string | File | FormData | null;\nexport type IgcFormControl = LitElement &\n (FormAssociatedElementInterface | FormAssociatedCheckboxElementInterface);\n\nexport declare class BaseFormAssociatedElement {\n public static readonly formAssociated: boolean;\n\n //#region Properties\n\n protected readonly _internals: ElementInternalsController;\n protected readonly _formValue: unknown;\n\n protected _pristine: boolean;\n protected _disabled: boolean;\n protected _invalid: boolean;\n\n protected get __validators(): Validator[];\n\n /**\n * The disabled state of the component.\n * @attr\n * @default false\n */\n public disabled: boolean;\n\n /**\n * Sets the control into invalid state (visual state only).\n * @attr\n * @default false\n */\n public invalid: boolean;\n\n /**\n * The name of the control, submitted with the form data.\n * @attr\n */\n public name: string;\n\n /** Returns the HTMLFormElement associated with this element. */\n public get form(): HTMLFormElement | null;\n\n /**\n * Returns a ValidityState object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n */\n public get validity(): ValidityState;\n\n /** A string containing the validation message of this element. */\n public get validationMessage(): string;\n\n /**\n * A boolean value which returns true if the element is a submittable element\n * that is a candidate for constraint validation.\n */\n public get willValidate(): boolean;\n\n //#endregion\n\n //#region Methods\n\n /**\n * Default implementation for handling the `Enter` key press on the component.\n * Checks if the component is inside a form and if so, submits it.\n */\n protected _handleEnterKeydown(event: KeyboardEvent): void;\n\n /**\n * Sets the **touched** state of the component and invokes {@link BaseFormAssociatedElement._validate | `_validate()`} method.\n *\n * As the naming of the method suggests, this should be invoked either on **blur** or **focusout**, depending\n * on the DOM structure and how focus state is managed by the component.\n */\n protected _handleBlur(): void;\n\n /**\n * Sets the **touched** state of the component and **DOES NOT** invoke {@link BaseFormAssociatedElement._validate | `_validate()`} method.\n *\n * This should be called whenever a user interaction triggers a response, usually an event, from the component in\n * regards to its value.\n */\n protected _setTouchedState(): void;\n\n /**\n * Sets the **touched** state of the component and emits `eventName` - the pair every\n * user-interaction handler must apply when it responds to input.\n *\n * The host must compose the event-emitter mixin somewhere in its heritage.\n */\n protected _emitTouchedEvent(\n eventName: string,\n init?: CustomEventInit\n ): boolean;\n\n /**\n * Renders a validation container bound to the component, projecting its helper-text\n * and validation message slots.\n */\n protected _renderValidationContainer(\n config?: ValidationContainerConfig\n ): TemplateResult;\n\n /**\n * Sets the default value of the component.\n * Called in `attributeChangedCallback` (i.e. when the `value` attribute of the control is set).\n */\n protected _setDefaultValue(current: string | null): void;\n\n /**\n * Called when the associated parent form is reset.\n */\n protected _restoreDefaultValue(): void;\n\n /**\n * Executes the component validators and updates the internal validity state.\n */\n protected _validate(message?: string): void;\n\n /**\n * Sets the component's submission value and state.\n */\n protected _setFormValue(value: FormValueType, state?: FormValueType): void;\n\n /**\n * Called by the browser when it associates/disassociates the component with/from a given form element.\n * Receives the form element as a parameter.\n *\n * @remarks\n * This is not implemented currently.\n */\n protected formAssociatedCallback(form: HTMLFormElement): void;\n\n /**\n * Called whenever the component or a parent `fieldset` elements are disabled.\n * Receives the current disabled state.\n */\n protected formDisabledCallback(state: boolean): void;\n\n /**\n * Called when the form is reset.\n * Resets the component value/checked state to the default one, internal state and validation.\n *\n * @remarks\n * The default implementation calls {@link BaseFormAssociatedElement._restoreDefaultValue | `_restoreDefaultValue`}.\n * If additional customization is needed, it is better to override that method instead of this callback.\n */\n protected formResetCallback(): void;\n\n /**\n * Called when the browser attempts to automatically fill out the component.\n *\n * @remarks\n * This is not implemented currently.\n */\n protected formStateRestoreCallback(\n state: FormValueType,\n mode: FormRestoreMode\n ): void;\n\n /** Checks for validity of the control and emits the invalid event if it's invalid. */\n public checkValidity(): boolean;\n\n /** Checks for validity of the control and shows the browser message if it's invalid. */\n public reportValidity(): boolean;\n\n /**\n * Sets a custom validation message for the control.\n * As long as `message` is not empty, the control is considered invalid.\n */\n public setCustomValidity(message: string): void;\n\n //#endregion\n}\n\nexport declare class FormAssociatedElementInterface extends BaseFormAssociatedElement {\n /** The initial value of the component. */\n public set defaultValue(value: unknown);\n public get defaultValue(): unknown;\n\n /**\n * Commits a user-initiated value change: sets the **touched** state **before** assigning\n * to the public `value` setter, so the validation cycle the setter runs applies invalid\n * styling in the same pass, then emits `eventName` with the coerced value as `detail`.\n */\n protected _commitValue(value: unknown, eventName: string): boolean;\n}\n\nexport declare class FormAssociatedCheckboxElementInterface extends BaseFormAssociatedElement {\n /** The initial checked state of the component. */\n public set defaultChecked(value: boolean);\n public get defaultChecked(): boolean;\n}\n\nexport declare class FormRequiredInterface {\n protected _required: boolean;\n\n /**\n * When set, makes the component a required field for validation.\n * @attr\n * @default false\n */\n public set required(value: boolean);\n public get required(): boolean;\n}\n\nexport const InternalInvalidEvent = 'igc-form-internal-invalid';\nexport const InternalResetEvent = 'igc-form-internal-reset';\n"]}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { LitElement } from 'lit';
|
|
2
|
+
import { type I18nController, type I18nControllerConfig } from '../i18n/i18n-controller.js';
|
|
3
|
+
import type { AbstractConstructor } from './constructor.js';
|
|
4
|
+
export declare class I18nInterface<T extends object, TGet extends T = Required<T>> {
|
|
5
|
+
protected readonly _i18nController: I18nController<T>;
|
|
6
|
+
set locale(value: string);
|
|
7
|
+
get locale(): string;
|
|
8
|
+
set resourceStrings(value: T);
|
|
9
|
+
get resourceStrings(): TGet;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Mixes in the localization surface of a component - the `locale` and
|
|
13
|
+
* `resourceStrings` reactive properties forwarding to an i18n controller
|
|
14
|
+
* created with the passed configuration.
|
|
15
|
+
*
|
|
16
|
+
* The controller is exposed as the protected `_i18nController` for hosts
|
|
17
|
+
* that need direct access.
|
|
18
|
+
*
|
|
19
|
+
* `TGet` is the type of the resolved strings. It defaults to `Required<T>`,
|
|
20
|
+
* because the controller merges the full `defaultEN` set under any overrides,
|
|
21
|
+
* so every key resolves even though the resource interfaces declare them
|
|
22
|
+
* optional. Components that still accept a deprecated component-specific
|
|
23
|
+
* resource shape override it: `T` is the union of the two shapes accepted,
|
|
24
|
+
* `TGet` their intersection.
|
|
25
|
+
*
|
|
26
|
+
* The base class must be the first argument - the manifest analyzer resolves
|
|
27
|
+
* the superclass of an `extends Mixin(...)` clause from the first argument,
|
|
28
|
+
* and a leading config object would sever the inheritance chain in the
|
|
29
|
+
* manifest (dropping every inherited public member from the docs).
|
|
30
|
+
*/
|
|
31
|
+
export declare function I18nMixin<T extends object, B extends AbstractConstructor<LitElement>, TGet extends T = Required<T>>(superClass: B, config: I18nControllerConfig<T>): AbstractConstructor<I18nInterface<T, TGet>> & B;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { property } from 'lit/decorators.js';
|
|
8
|
+
import { addI18nController, } from '../i18n/i18n-controller.js';
|
|
9
|
+
export function I18nMixin(superClass, config) {
|
|
10
|
+
class I18nElement extends superClass {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments);
|
|
13
|
+
this._i18nController = addI18nController(this, config);
|
|
14
|
+
}
|
|
15
|
+
set locale(value) {
|
|
16
|
+
this._i18nController.locale = value;
|
|
17
|
+
}
|
|
18
|
+
get locale() {
|
|
19
|
+
return this._i18nController.locale;
|
|
20
|
+
}
|
|
21
|
+
set resourceStrings(value) {
|
|
22
|
+
this._i18nController.resourceStrings = value;
|
|
23
|
+
}
|
|
24
|
+
get resourceStrings() {
|
|
25
|
+
return this._i18nController.resourceStrings;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
__decorate([
|
|
29
|
+
property()
|
|
30
|
+
], I18nElement.prototype, "locale", null);
|
|
31
|
+
__decorate([
|
|
32
|
+
property({ attribute: false })
|
|
33
|
+
], I18nElement.prototype, "resourceStrings", null);
|
|
34
|
+
return I18nElement;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","sourceRoot":"","sources":["../../../src/internals/mixins/i18n.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EACL,iBAAiB,GAGlB,MAAM,4BAA4B,CAAC;AAkCpC,MAAM,UAAU,SAAS,CAIvB,UAAa,EAAE,MAA+B;IAC9C,MAAe,WAAY,SAAQ,UAAU;QAA7C;;YACqB,oBAAe,GAAG,iBAAiB,CAAI,IAAI,EAAE,MAAM,CAAC,CAAC;QA2B1E,CAAC;QAnBC,IAAW,MAAM,CAAC,KAAa;YAC7B,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,KAAK,CAAC;QACtC,CAAC;QAED,IAAW,MAAM;YACf,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;QACrC,CAAC;QAMD,IAAW,eAAe,CAAC,KAAQ;YACjC,IAAI,CAAC,eAAe,CAAC,eAAe,GAAG,KAAK,CAAC;QAC/C,CAAC;QAED,IAAW,eAAe;YACxB,OAAO,IAAI,CAAC,eAAe,CAAC,eAAuB,CAAC;QACtD,CAAC;KACF;IAnBC;QADC,QAAQ,EAAE;6CAGV;IAUD;QADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;sDAG9B;IAMH,OAAO,WACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport {\n addI18nController,\n type I18nController,\n type I18nControllerConfig,\n} from '../i18n/i18n-controller.js';\nimport type { AbstractConstructor } from './constructor.js';\n\nexport declare class I18nInterface<\n T extends object,\n TGet extends T = Required<T>,\n> {\n protected readonly _i18nController: I18nController<T>;\n public set locale(value: string);\n public get locale(): string;\n public set resourceStrings(value: T);\n public get resourceStrings(): TGet;\n}\n\n/**\n * Mixes in the localization surface of a component - the `locale` and\n * `resourceStrings` reactive properties forwarding to an i18n controller\n * created with the passed configuration.\n *\n * The controller is exposed as the protected `_i18nController` for hosts\n * that need direct access.\n *\n * `TGet` is the type of the resolved strings. It defaults to `Required<T>`,\n * because the controller merges the full `defaultEN` set under any overrides,\n * so every key resolves even though the resource interfaces declare them\n * optional. Components that still accept a deprecated component-specific\n * resource shape override it: `T` is the union of the two shapes accepted,\n * `TGet` their intersection.\n *\n * The base class must be the first argument - the manifest analyzer resolves\n * the superclass of an `extends Mixin(...)` clause from the first argument,\n * and a leading config object would sever the inheritance chain in the\n * manifest (dropping every inherited public member from the docs).\n */\nexport function I18nMixin<\n T extends object,\n B extends AbstractConstructor<LitElement>,\n TGet extends T = Required<T>,\n>(superClass: B, config: I18nControllerConfig<T>) {\n abstract class I18nElement extends superClass {\n protected readonly _i18nController = addI18nController<T>(this, config);\n\n /**\n * The locale used to resolve the component's resource strings.\n * Falls back to the global locale when not set.\n * @attr locale\n */\n @property()\n public set locale(value: string) {\n this._i18nController.locale = value;\n }\n\n public get locale(): string {\n return this._i18nController.locale;\n }\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(value: T) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): TGet {\n return this._i18nController.resourceStrings as TGet;\n }\n }\n return I18nElement as unknown as AbstractConstructor<I18nInterface<T, TGet>> &\n B;\n}\n"]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LitElement } from 'lit';
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
2
|
+
import { type MaskEditKind, type MaskHistory } from '../../components/mask-input/mask-history.js';
|
|
3
|
+
import type { MaskParser } from '../../components/mask-input/mask-parser.js';
|
|
4
|
+
import type { RangeTextSelectMode, SelectionRangeDirection } from '../../components/types.js';
|
|
4
5
|
import type { AbstractConstructor } from './constructor.js';
|
|
5
6
|
export type MaskSelection = {
|
|
6
7
|
start: number;
|
|
@@ -22,8 +23,10 @@ export declare class MaskBehaviorElementInterface {
|
|
|
22
23
|
protected _compositionStart: number;
|
|
23
24
|
protected _focused: boolean;
|
|
24
25
|
protected _maskedValue: string;
|
|
26
|
+
protected readonly _history: MaskHistory;
|
|
25
27
|
protected get _inputSelection(): MaskSelection;
|
|
26
28
|
protected get _isEmptyMask(): boolean;
|
|
29
|
+
protected get _historyText(): string;
|
|
27
30
|
/**
|
|
28
31
|
* Makes the control a readonly field.
|
|
29
32
|
* @attr readonly
|
|
@@ -44,12 +47,17 @@ export declare class MaskBehaviorElementInterface {
|
|
|
44
47
|
get prompt(): string;
|
|
45
48
|
set prompt(value: string);
|
|
46
49
|
protected _handleInput(event: InputEvent): Promise<void>;
|
|
50
|
+
protected _handleBeforeInput(event: InputEvent): void;
|
|
47
51
|
protected _updateInput(text: string, range: MaskSelection): Promise<void>;
|
|
52
|
+
protected _commitMaskedValue(value: string): void;
|
|
48
53
|
protected _emitInputEvent(): void;
|
|
49
54
|
protected _setMaskSelection(event: Event): void;
|
|
50
55
|
protected _handleCompositionStart(): void;
|
|
51
56
|
protected _handleCompositionEnd(event: CompositionEvent): void;
|
|
52
57
|
protected _handleClick(): void;
|
|
58
|
+
protected _recordHistory(kind: MaskEditKind, next: string, caret: number, selection?: MaskSelection): void;
|
|
59
|
+
protected _historyStep(direction: 'undo' | 'redo'): Promise<void>;
|
|
60
|
+
protected _historyResync(): void;
|
|
53
61
|
/** Sets the text selection range of the control. */
|
|
54
62
|
setSelectionRange(start?: number, end?: number, direction?: SelectionRangeDirection): void;
|
|
55
63
|
/** Replaces the selected text in the control and re-applies the mask. */
|
|
@@ -60,14 +68,15 @@ export declare class MaskBehaviorElementInterface {
|
|
|
60
68
|
* composition handling, range text replacement) to a LitElement-derived class.
|
|
61
69
|
*
|
|
62
70
|
* The host class is expected to provide:
|
|
63
|
-
* - `_input`
|
|
64
|
-
* - `_parser`
|
|
65
|
-
* - `_setTouchedState`
|
|
66
|
-
* - `
|
|
67
|
-
* - `
|
|
71
|
+
* - `_input` - the native `<input>` element (typically via `@query('input')`).
|
|
72
|
+
* - `_parser` - a {@link MaskParser} (or subclass) instance.
|
|
73
|
+
* - `_setTouchedState` - from `FormAssociatedMixin`.
|
|
74
|
+
* - `_emitTouchedEvent` - from `FormAssociatedMixin`.
|
|
75
|
+
* - `emitEvent` - from `EventEmitterMixin`.
|
|
76
|
+
* - `select` - from the host base.
|
|
68
77
|
*
|
|
69
78
|
* The host class must implement `_syncValueFromMask` to bridge the masked
|
|
70
79
|
* text back into its public `value`. It is called by the default
|
|
71
|
-
* `
|
|
80
|
+
* `_commitMaskedValue` implementation.
|
|
72
81
|
*/
|
|
73
82
|
export declare function MaskBehaviorMixin<T extends AbstractConstructor<LitElement>>(superClass: T): AbstractConstructor<MaskBehaviorElementInterface> & T;
|
|
@@ -5,16 +5,19 @@ 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, state } from 'lit/decorators.js';
|
|
8
|
+
import { createMaskHistory, } from '../../components/mask-input/mask-history.js';
|
|
9
|
+
import { addKeybindings, ctrlKey, metaKey, shiftKey, } from '../controllers/key-bindings.js';
|
|
10
|
+
const MaskEditKinds = new Map([
|
|
11
|
+
['insertText', 'insert'],
|
|
12
|
+
['deleteContentBackward', 'delete-backward'],
|
|
13
|
+
['deleteContentForward', 'delete-forward'],
|
|
14
|
+
['deleteByCut', 'atomic'],
|
|
15
|
+
['insertFromPaste', 'atomic'],
|
|
16
|
+
['insertFromDrop', 'atomic'],
|
|
17
|
+
['', 'atomic'],
|
|
18
|
+
]);
|
|
8
19
|
export function MaskBehaviorMixin(superClass) {
|
|
9
20
|
class MaskBehaviorElement extends superClass {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments);
|
|
12
|
-
this._maskSelection = { start: 0, end: 0 };
|
|
13
|
-
this._compositionStart = 0;
|
|
14
|
-
this._focused = false;
|
|
15
|
-
this._maskedValue = '';
|
|
16
|
-
this.readOnly = false;
|
|
17
|
-
}
|
|
18
21
|
get _inputSelection() {
|
|
19
22
|
return {
|
|
20
23
|
start: this._input?.selectionStart || 0,
|
|
@@ -24,6 +27,32 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
24
27
|
get _isEmptyMask() {
|
|
25
28
|
return this._maskedValue === this._parser.emptyMask;
|
|
26
29
|
}
|
|
30
|
+
get _historyText() {
|
|
31
|
+
return this._maskedValue || this._parser.emptyMask;
|
|
32
|
+
}
|
|
33
|
+
constructor(...args) {
|
|
34
|
+
super(...args);
|
|
35
|
+
this._maskSelection = { start: 0, end: 0 };
|
|
36
|
+
this._compositionStart = 0;
|
|
37
|
+
this._history = createMaskHistory(() => `${this._parser.mask} ${this._parser.prompt}`);
|
|
38
|
+
this._focused = false;
|
|
39
|
+
this._maskedValue = '';
|
|
40
|
+
this.readOnly = false;
|
|
41
|
+
const step = (direction) => (event) => {
|
|
42
|
+
if (!event.isComposing) {
|
|
43
|
+
this._historyStep(direction);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
addKeybindings(this, {
|
|
47
|
+
skip: () => this.readOnly,
|
|
48
|
+
bindingDefaults: { repeat: true },
|
|
49
|
+
})
|
|
50
|
+
.set([ctrlKey, 'z'], step('undo'))
|
|
51
|
+
.set([metaKey, 'z'], step('undo'))
|
|
52
|
+
.set([ctrlKey, 'y'], step('redo'))
|
|
53
|
+
.set([ctrlKey, shiftKey, 'z'], step('redo'))
|
|
54
|
+
.set([metaKey, shiftKey, 'z'], step('redo'));
|
|
55
|
+
}
|
|
27
56
|
set mask(value) {
|
|
28
57
|
this._parser.mask = value;
|
|
29
58
|
}
|
|
@@ -40,42 +69,58 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
40
69
|
const value = this._input?.value ?? '';
|
|
41
70
|
const { start, end } = this._maskSelection;
|
|
42
71
|
const deletePosition = this._parser.getNextNonLiteralPosition(end) + 1;
|
|
72
|
+
if (inputType === 'historyUndo' || inputType === 'historyRedo') {
|
|
73
|
+
return this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');
|
|
74
|
+
}
|
|
75
|
+
if (inputType === 'deleteContentBackward' && isComposing) {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const kind = MaskEditKinds.get(inputType ?? '');
|
|
79
|
+
if (kind === undefined) {
|
|
80
|
+
if (!isComposing) {
|
|
81
|
+
this.requestUpdate();
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
43
85
|
this._setTouchedState();
|
|
44
86
|
switch (inputType) {
|
|
45
|
-
case 'deleteContentForward':
|
|
46
|
-
this._updateInput('', { start, end: deletePosition });
|
|
47
|
-
|
|
48
|
-
|
|
87
|
+
case 'deleteContentForward': {
|
|
88
|
+
await this._updateInput('', { start, end: deletePosition }, kind);
|
|
89
|
+
this._input?.setSelectionRange(deletePosition, deletePosition);
|
|
90
|
+
this._history.settle(this._historyText, deletePosition);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
49
93
|
case 'deleteContentBackward':
|
|
50
|
-
if (isComposing)
|
|
51
|
-
return;
|
|
52
94
|
return this._updateInput('', {
|
|
53
95
|
start: this._parser.getPreviousNonLiteralPosition(this._inputSelection.start + 1),
|
|
54
96
|
end,
|
|
55
|
-
});
|
|
97
|
+
}, kind);
|
|
56
98
|
case 'deleteByCut':
|
|
57
|
-
return this._updateInput('', this._maskSelection);
|
|
99
|
+
return this._updateInput('', this._maskSelection, kind);
|
|
58
100
|
case 'insertText':
|
|
59
|
-
return this._updateInput(value.substring(start, this._inputSelection.end), this._maskSelection);
|
|
101
|
+
return this._updateInput(value.substring(start, this._inputSelection.end), this._maskSelection, kind);
|
|
60
102
|
case 'insertFromPaste':
|
|
61
103
|
return this._updateInput(value.substring(start, this._inputSelection.end), {
|
|
62
104
|
start,
|
|
63
105
|
end: this._inputSelection.start,
|
|
64
|
-
});
|
|
106
|
+
}, kind);
|
|
65
107
|
case 'insertFromDrop':
|
|
66
|
-
return this._updateInput(value.substring(this._inputSelection.start, this._inputSelection.end), { ...this._inputSelection }
|
|
108
|
+
return this._updateInput(value.substring(this._inputSelection.start, this._inputSelection.end), { ...this._inputSelection }, kind, {
|
|
109
|
+
start: this._inputSelection.start,
|
|
110
|
+
end: this._inputSelection.start,
|
|
111
|
+
});
|
|
67
112
|
case undefined:
|
|
68
113
|
case '':
|
|
69
114
|
return this._updateInput(this._parser.parse(value.substring(start, this._inputSelection.end)), {
|
|
70
115
|
start,
|
|
71
116
|
end: this._inputSelection.end,
|
|
72
|
-
});
|
|
117
|
+
}, kind, { start, end: start });
|
|
73
118
|
}
|
|
74
119
|
}
|
|
75
|
-
async _updateInput(text, range) {
|
|
120
|
+
async _updateInput(text, range, kind = 'atomic', caretBefore) {
|
|
76
121
|
const { value, end } = this._parser.replace(this._maskedValue, text, range.start, range.end);
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
122
|
+
this._recordHistory(kind, value, end, caretBefore ?? this._maskSelection);
|
|
123
|
+
this._commitMaskedValue(value);
|
|
79
124
|
this.requestUpdate();
|
|
80
125
|
if (range.start !== this._parser.mask.length) {
|
|
81
126
|
this._emitInputEvent();
|
|
@@ -83,9 +128,12 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
83
128
|
await this.updateComplete;
|
|
84
129
|
this._input?.setSelectionRange(end, end);
|
|
85
130
|
}
|
|
131
|
+
_commitMaskedValue(value) {
|
|
132
|
+
this._maskedValue = value;
|
|
133
|
+
this._syncValueFromMask();
|
|
134
|
+
}
|
|
86
135
|
_emitInputEvent() {
|
|
87
|
-
this.
|
|
88
|
-
this.emitEvent('igcInput', { detail: this._maskedValue });
|
|
136
|
+
this._emitTouchedEvent('igcInput', { detail: this._maskedValue });
|
|
89
137
|
}
|
|
90
138
|
_setMaskSelection(event) {
|
|
91
139
|
this._maskSelection = this._inputSelection;
|
|
@@ -97,10 +145,7 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
97
145
|
this._compositionStart = this._inputSelection.start;
|
|
98
146
|
}
|
|
99
147
|
_handleCompositionEnd({ data }) {
|
|
100
|
-
this._updateInput(data, {
|
|
101
|
-
start: this._compositionStart,
|
|
102
|
-
end: this._inputSelection.end,
|
|
103
|
-
});
|
|
148
|
+
this._updateInput(data, { start: this._compositionStart, end: this._inputSelection.end }, 'atomic', { start: this._compositionStart, end: this._compositionStart });
|
|
104
149
|
}
|
|
105
150
|
_handleClick() {
|
|
106
151
|
const { selectionStart: start, selectionEnd: end } = this._input ?? {
|
|
@@ -111,6 +156,47 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
111
156
|
this.select();
|
|
112
157
|
}
|
|
113
158
|
}
|
|
159
|
+
_handleBeforeInput(event) {
|
|
160
|
+
const { inputType } = event;
|
|
161
|
+
if (inputType !== 'historyUndo' && inputType !== 'historyRedo') {
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
event.preventDefault();
|
|
165
|
+
if (!this.readOnly) {
|
|
166
|
+
this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
_recordHistory(kind, next, caret, selection = this._inputSelection) {
|
|
170
|
+
const previous = this._historyText;
|
|
171
|
+
if (next !== previous) {
|
|
172
|
+
this._history.record(kind, { value: previous, ...selection });
|
|
173
|
+
}
|
|
174
|
+
this._history.settle(next, caret);
|
|
175
|
+
}
|
|
176
|
+
_historyResync() {
|
|
177
|
+
this._history.resync(this._historyText);
|
|
178
|
+
}
|
|
179
|
+
async _historyStep(direction) {
|
|
180
|
+
if (this.readOnly) {
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const current = {
|
|
184
|
+
value: this._historyText,
|
|
185
|
+
...this._inputSelection,
|
|
186
|
+
};
|
|
187
|
+
const state = direction === 'undo'
|
|
188
|
+
? this._history.undo(current)
|
|
189
|
+
: this._history.redo(current);
|
|
190
|
+
if (!state) {
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
this._setTouchedState();
|
|
194
|
+
this._commitMaskedValue(state.value);
|
|
195
|
+
this.requestUpdate();
|
|
196
|
+
this._emitInputEvent();
|
|
197
|
+
await this.updateComplete;
|
|
198
|
+
this.setSelectionRange(state.start, state.end);
|
|
199
|
+
}
|
|
114
200
|
setSelectionRange(start, end, direction = 'none') {
|
|
115
201
|
this._input?.setSelectionRange(start ?? null, end ?? null, direction);
|
|
116
202
|
this._maskSelection = { start: start ?? 0, end: end ?? 0 };
|
|
@@ -120,8 +206,9 @@ export function MaskBehaviorMixin(superClass) {
|
|
|
120
206
|
const _start = start ?? current.start;
|
|
121
207
|
const _end = end ?? current.end;
|
|
122
208
|
const result = this._parser.replace(this._maskedValue || this._parser.emptyMask, replacement, _start, _end);
|
|
123
|
-
|
|
124
|
-
this.
|
|
209
|
+
const next = this._parser.apply(this._parser.parse(result.value));
|
|
210
|
+
this._recordHistory('atomic', next, _start, current);
|
|
211
|
+
this._commitMaskedValue(next);
|
|
125
212
|
this.updateComplete.then(() => {
|
|
126
213
|
switch (selectMode) {
|
|
127
214
|
case 'select':
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mask-behavior.js","sourceRoot":"","sources":["../../../src/internals/mixins/mask-behavior.ts"],"names":[],"mappings":";;;;;;AACA,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EACL,iBAAiB,GAIlB,MAAM,6CAA6C,CAAC;AAMrD,OAAO,EACL,cAAc,EACd,OAAO,EACP,OAAO,EACP,QAAQ,GACT,MAAM,gCAAgC,CAAC;AAcxC,MAAM,aAAa,GAAG,IAAI,GAAG,CAAuB;IAClD,CAAC,YAAY,EAAE,QAAQ,CAAC;IACxB,CAAC,uBAAuB,EAAE,iBAAiB,CAAC;IAC5C,CAAC,sBAAsB,EAAE,gBAAgB,CAAC;IAC1C,CAAC,aAAa,EAAE,QAAQ,CAAC;IACzB,CAAC,iBAAiB,EAAE,QAAQ,CAAC;IAC7B,CAAC,gBAAgB,EAAE,QAAQ,CAAC;IAC5B,CAAC,EAAE,EAAE,QAAQ,CAAC;CACf,CAAC,CAAC;AA6HH,MAAM,UAAU,iBAAiB,CAC/B,UAAa;IAEb,MAAe,mBAAoB,SAAQ,UAAU;QAsCnD,IAAc,eAAe;YAC3B,OAAO;gBACL,KAAK,EAAE,IAAI,CAAC,MAAM,EAAE,cAAc,IAAI,CAAC;gBACvC,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,YAAY,IAAI,CAAC;aACpC,CAAC;QACJ,CAAC;QAGD,IAAc,YAAY;YACxB,OAAO,IAAI,CAAC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F,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;YAElE,IAAI,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACrD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAE9B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE;gBAC5B,QAAQ,UAAU,EAAE,CAAC;oBACnB,KAAK,QAAQ;wBACX,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;wBACrC,MAAM;oBACR,KAAK,OAAO;wBACV,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;wBACvC,MAAM;oBACR,KAAK,KAAK;wBACR,IAAI,CAAC,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;wBACnC,MAAM;oBACR;wBACE,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;gBACvD,CAAC;YACH,CAAC,CAAC,CAAC;QACL,CAAC;KAGF;IAnbW;QADT,KAAK,EAAE;yDACmB;IAGjB;QADT,KAAK,EAAE;6DACoB;IA+DrB;QADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;yDACnB;IAQxB;QADC,QAAQ,EAAE;mDAGV;IAaD;QADC,QAAQ,EAAE;qDAGV;IA0VH,OAAO,mBACJ,CAAC;AACN,CAAC","sourcesContent":["import type { LitElement } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport {\n createMaskHistory,\n type MaskEditKind,\n type MaskHistory,\n type MaskHistoryState,\n} from '../../components/mask-input/mask-history.js';\nimport type { MaskParser } from '../../components/mask-input/mask-parser.js';\nimport type {\n RangeTextSelectMode,\n SelectionRangeDirection,\n} from '../../components/types.js';\nimport {\n addKeybindings,\n ctrlKey,\n metaKey,\n shiftKey,\n} from '../controllers/key-bindings.js';\nimport type { AbstractConstructor } from './constructor.js';\n\nexport type MaskSelection = {\n start: number;\n end: number;\n};\n\n/**\n * The `inputType` values the mask editor models, mapped to their undo granularity.\n *\n * Anything absent is a native mutation we do not model - auto-fill is the empty-string\n * entry, `deleteWordBackward` and friends are simply not handled.\n */\nconst MaskEditKinds = new Map<string, MaskEditKind>([\n ['insertText', 'insert'],\n ['deleteContentBackward', 'delete-backward'],\n ['deleteContentForward', 'delete-forward'],\n ['deleteByCut', 'atomic'],\n ['insertFromPaste', 'atomic'],\n ['insertFromDrop', 'atomic'],\n ['', 'atomic'],\n]);\n\n/**\n * Public + protected interface contributed by {@link MaskBehaviorMixin}.\n * Declared as a `declare class` so consumers can see protected members through\n * the cast return type (mirrors the pattern used by the form-associated mixins).\n */\nexport declare class MaskBehaviorElementInterface {\n //#region Required from host\n\n protected readonly _input?: HTMLInputElement;\n protected readonly _parser: MaskParser;\n\n /** Reflects the current parser state into the host's public value. */\n protected _syncValueFromMask(): void;\n\n /** Delegates Enter-key handling to the form-associated base. */\n protected _handleEnterKeydown(event: KeyboardEvent): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection;\n protected _compositionStart: number;\n protected _focused: boolean;\n protected _maskedValue: string;\n protected readonly _history: MaskHistory;\n\n protected get _inputSelection(): MaskSelection;\n protected get _isEmptyMask(): boolean;\n protected get _historyText(): string;\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n * @default false\n */\n public readOnly: boolean;\n\n /**\n * The mask pattern of the component.\n * @attr\n */\n public get mask(): string;\n public set mask(value: string);\n\n /**\n * The prompt symbol to use for unfilled parts of the mask pattern.\n * @attr\n * @default '_'\n */\n public get prompt(): string;\n public set prompt(value: string);\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleInput(event: InputEvent): Promise<void>;\n protected _handleBeforeInput(event: InputEvent): void;\n protected _updateInput(text: string, range: MaskSelection): Promise<void>;\n protected _commitMaskedValue(value: string): void;\n protected _emitInputEvent(): void;\n protected _setMaskSelection(event: Event): void;\n protected _handleCompositionStart(): void;\n protected _handleCompositionEnd(event: CompositionEvent): void;\n protected _handleClick(): void;\n\n //#endregion\n\n //#region Undo/redo\n\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection?: MaskSelection\n ): void;\n\n protected _historyStep(direction: 'undo' | 'redo'): Promise<void>;\n protected _historyResync(): void;\n\n //#endregion\n\n //#region Public methods\n\n /** Sets the text selection range of the control. */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction?: SelectionRangeDirection\n ): void;\n\n /** Replaces the selected text in the control and re-applies the mask. */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void;\n\n //#endregion\n}\n\n/**\n * Adds masked-input behavior (parser-driven editing, selection tracking,\n * composition handling, range text replacement) to a LitElement-derived class.\n *\n * The host class is expected to provide:\n * - `_input` - the native `<input>` element (typically via `@query('input')`).\n * - `_parser` - a {@link MaskParser} (or subclass) instance.\n * - `_setTouchedState` - from `FormAssociatedMixin`.\n * - `_emitTouchedEvent` - from `FormAssociatedMixin`.\n * - `emitEvent` - from `EventEmitterMixin`.\n * - `select` - from the host base.\n *\n * The host class must implement `_syncValueFromMask` to bridge the masked\n * text back into its public `value`. It is called by the default\n * `_commitMaskedValue` implementation.\n */\nexport function MaskBehaviorMixin<T extends AbstractConstructor<LitElement>>(\n superClass: T\n): AbstractConstructor<MaskBehaviorElementInterface> & T {\n abstract class MaskBehaviorElement extends superClass {\n //#region Required from host\n\n protected abstract readonly _input?: HTMLInputElement;\n protected abstract readonly _parser: MaskParser;\n protected abstract _setTouchedState(): void;\n protected abstract _emitTouchedEvent(\n eventName: string,\n init?: CustomEventInit\n ): boolean;\n public abstract select(): void;\n public abstract emitEvent(name: string, init?: CustomEventInit): boolean;\n\n protected abstract _syncValueFromMask(): void;\n protected abstract _handleEnterKeydown(event: KeyboardEvent): void;\n\n //#endregion\n\n //#region Internal state\n\n protected _maskSelection: MaskSelection = { start: 0, end: 0 };\n protected _compositionStart = 0;\n\n /**\n * The signature is the source pattern rather than the escaped one: the date parsers\n * convert a date format into mask flags, so `MM/dd/yyyy` and `dd/MM/yyyy` share an\n * escaped mask of `00/00/0000` while meaning entirely different things.\n */\n protected readonly _history = createMaskHistory(\n () => `${this._parser.mask} ${this._parser.prompt}`\n );\n\n @state()\n protected _focused = false;\n\n @state()\n protected _maskedValue = '';\n\n protected get _inputSelection(): MaskSelection {\n return {\n start: this._input?.selectionStart || 0,\n end: this._input?.selectionEnd || 0,\n };\n }\n\n /** Indicates whether the current mask value is empty. */\n protected get _isEmptyMask(): boolean {\n return this._maskedValue === this._parser.emptyMask;\n }\n\n /**\n * The masked text as the undo history sees it. `igc-mask-input` blanks it on blur and\n * restores the empty mask on focus; both spell the same empty document, so without\n * this normalization every focus of an empty editor would look like a foreign change.\n */\n protected get _historyText(): string {\n return this._maskedValue || this._parser.emptyMask;\n }\n\n //#endregion\n\n //#region Lifecycle\n\n constructor(...args: any[]) {\n super(...args);\n\n // Assigning `input.value` - which every masked edit does - clears the browser's\n // own undo stack, so the standard shortcuts have to be served from `_history`.\n // The IME owns the text until `compositionend`, hence the `isComposing` guard.\n const step =\n (direction: 'undo' | 'redo') =>\n (event: KeyboardEvent): void => {\n if (!event.isComposing) {\n this._historyStep(direction);\n }\n };\n\n addKeybindings(this, {\n skip: () => this.readOnly,\n bindingDefaults: { repeat: true },\n })\n .set([ctrlKey, 'z'], step('undo'))\n .set([metaKey, 'z'], step('undo'))\n .set([ctrlKey, 'y'], step('redo'))\n .set([ctrlKey, shiftKey, 'z'], step('redo'))\n .set([metaKey, shiftKey, 'z'], step('redo'));\n }\n\n //#endregion\n\n //#region Public attributes and properties\n\n /**\n * Makes the control a readonly field.\n *\n * @attr readonly\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public readOnly = false;\n\n /**\n * The mask pattern of the component.\n *\n * @attr\n */\n @property()\n public set mask(value: string) {\n this._parser.mask = value;\n }\n\n public get mask(): string {\n return this._parser.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 set prompt(value: string) {\n this._parser.prompt = value;\n }\n\n public get prompt(): string {\n return this._parser.prompt;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _handleInput({\n inputType,\n isComposing,\n }: InputEvent): Promise<void> {\n const value = this._input?.value ?? '';\n const { start, end } = this._maskSelection;\n const deletePosition = this._parser.getNextNonLiteralPosition(end) + 1;\n\n // Reachable only where `beforeinput` is not cancelable - normally the browser's\n // history commands are intercepted before they ever mutate the input.\n if (inputType === 'historyUndo' || inputType === 'historyRedo') {\n return this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n\n // A composing backspace is handled by the composition events instead.\n if (inputType === 'deleteContentBackward' && isComposing) {\n return;\n }\n\n const kind = MaskEditKinds.get(inputType ?? '');\n\n if (kind === undefined) {\n // A non-modeled mutation has already changed the input's DOM value, so re-render\n // to let the `live()` binding roll it back to the masked text. Never mid-IME\n // though - `insertCompositionText` fires repeatedly there and resetting the value\n // underneath the browser breaks composition outright.\n if (!isComposing) {\n this.requestUpdate();\n }\n return;\n }\n\n this._setTouchedState();\n\n switch (inputType) {\n case 'deleteContentForward': {\n await this._updateInput('', { start, end: deletePosition }, kind);\n this._input?.setSelectionRange(deletePosition, deletePosition);\n // `_updateInput` settled on the parser's cursor, but the caret actually ends up\n // past the deleted character - record that so a run of deletes coalesces.\n this._history.settle(this._historyText, deletePosition);\n return;\n }\n\n case 'deleteContentBackward':\n return this._updateInput(\n '',\n {\n start: this._parser.getPreviousNonLiteralPosition(\n this._inputSelection.start + 1\n ),\n end,\n },\n kind\n );\n\n case 'deleteByCut':\n return this._updateInput('', this._maskSelection, kind);\n\n case 'insertText':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n this._maskSelection,\n kind\n );\n\n case 'insertFromPaste':\n return this._updateInput(\n value.substring(start, this._inputSelection.end),\n {\n start,\n end: this._inputSelection.start,\n },\n kind\n );\n\n case 'insertFromDrop':\n // An external drop is preceded by no `dragstart`, so `_maskSelection` is stale.\n return this._updateInput(\n value.substring(\n this._inputSelection.start,\n this._inputSelection.end\n ),\n { ...this._inputSelection },\n kind,\n {\n start: this._inputSelection.start,\n end: this._inputSelection.start,\n }\n );\n\n // Potential browser auto-fill behavior\n case undefined:\n case '':\n return this._updateInput(\n this._parser.parse(\n value.substring(start, this._inputSelection.end)\n ),\n {\n start,\n end: this._inputSelection.end,\n },\n kind,\n { start, end: start }\n );\n }\n }\n\n /**\n * Default mask-update routine. Re-applies the parser, commits the result through\n * {@link MaskBehaviorElementInterface._commitMaskedValue} and emits an input event\n * when the edit is not at the trailing mask boundary.\n */\n protected async _updateInput(\n text: string,\n range: MaskSelection,\n kind: MaskEditKind = 'atomic',\n caretBefore?: MaskSelection\n ): Promise<void> {\n const { value, end } = this._parser.replace(\n this._maskedValue,\n text,\n range.start,\n range.end\n );\n\n this._recordHistory(kind, value, end, caretBefore ?? this._maskSelection);\n this._commitMaskedValue(value);\n this.requestUpdate();\n\n if (range.start !== this._parser.mask.length) {\n this._emitInputEvent();\n }\n\n await this.updateComplete;\n this._input?.setSelectionRange(end, end);\n }\n\n /**\n * Writes a fully-formed masked text into the component's value pipeline.\n *\n * This is the one step where the leaves genuinely differ - `igc-mask-input` commits\n * straight to its form value, while the date editors keep the text as a draft until\n * blur - so it is also the only thing undo/redo has to delegate.\n */\n protected _commitMaskedValue(value: string): void {\n this._maskedValue = value;\n this._syncValueFromMask();\n }\n\n /**\n * Emits an `igcInput` event with the current masked value as detail.\n * Override to emit a different payload (e.g. the parsed value).\n */\n protected _emitInputEvent(): void {\n this._emitTouchedEvent('igcInput', { detail: this._maskedValue });\n }\n\n protected _setMaskSelection(event: Event): void {\n this._maskSelection = this._inputSelection;\n if (event instanceof KeyboardEvent) {\n this._handleEnterKeydown(event);\n }\n }\n\n protected _handleCompositionStart(): void {\n this._compositionStart = this._inputSelection.start;\n }\n\n protected _handleCompositionEnd({ data }: CompositionEvent): void {\n // The whole composed sequence is one undo step, anchored where it began.\n this._updateInput(\n data,\n { start: this._compositionStart, end: this._inputSelection.end },\n 'atomic',\n { start: this._compositionStart, end: this._compositionStart }\n );\n }\n\n protected _handleClick(): void {\n const { selectionStart: start, selectionEnd: end } = this._input ?? {\n selectionStart: 0,\n selectionEnd: 0,\n };\n\n // Clicking at the end of the input field will select the entire mask\n if (start === end && start === this._maskedValue.length) {\n this.select();\n }\n }\n\n /**\n * Intercepts the browser's own history commands - the Edit and context menus, and\n * the software keyboard on mobile - which never reach the key bindings. The native\n * stack is empty anyway, so letting one through would only de-sync the input's DOM\n * value from the masked text.\n */\n protected _handleBeforeInput(event: InputEvent): void {\n const { inputType } = event;\n\n if (inputType !== 'historyUndo' && inputType !== 'historyRedo') {\n return;\n }\n\n event.preventDefault();\n\n if (!this.readOnly) {\n this._historyStep(inputType === 'historyUndo' ? 'undo' : 'redo');\n }\n }\n\n //#endregion\n\n //#region Undo/redo\n\n /**\n * Snapshots the current masked text before `next` replaces it, then reports where the\n * caret ends up. Must be called *before* the text is committed.\n *\n * Only a real change earns an undo step: a character the mask rejects, a backspace at\n * position zero or a spin that hit a boundary would otherwise leave behind a step\n * that appears to do nothing when undone.\n */\n protected _recordHistory(\n kind: MaskEditKind,\n next: string,\n caret: number,\n selection: MaskSelection = this._inputSelection\n ): void {\n const previous = this._historyText;\n\n if (next !== previous) {\n this._history.record(kind, { value: previous, ...selection });\n }\n\n this._history.settle(next, caret);\n }\n\n /** Reconciles the history with the current masked text. */\n protected _historyResync(): void {\n this._history.resync(this._historyText);\n }\n\n /** Restores the neighboring history state in the given direction. */\n protected async _historyStep(direction: 'undo' | 'redo'): Promise<void> {\n if (this.readOnly) {\n return;\n }\n\n const current: MaskHistoryState = {\n value: this._historyText,\n ...this._inputSelection,\n };\n\n const state =\n direction === 'undo'\n ? this._history.undo(current)\n : this._history.redo(current);\n\n if (!state) {\n return;\n }\n\n this._setTouchedState();\n this._commitMaskedValue(state.value);\n this.requestUpdate();\n\n // Native inputs announce an undo as an `input` event, and the composite hosts\n // (`igc-date-picker`, `igc-date-range-picker`) read the draft value from ours.\n this._emitInputEvent();\n\n await this.updateComplete;\n\n // Through the mixin method, since the input's own keydown handler has already\n // overwritten `_maskSelection` with the caret as it was before the restore.\n this.setSelectionRange(state.start, state.end);\n }\n\n //#endregion\n\n //#region Public methods\n\n /* blazorSuppress */\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start?: number,\n end?: number,\n direction: SelectionRangeDirection = 'none'\n ): void {\n this._input?.setSelectionRange(start ?? null, end ?? null, direction);\n this._maskSelection = { start: start ?? 0, end: end ?? 0 };\n }\n\n /* blazorSuppress */\n /** Replaces the selected text in the control and re-applies the mask */\n public setRangeText(\n replacement: string,\n start?: number,\n end?: number,\n selectMode?: RangeTextSelectMode\n ): void {\n const current = this._inputSelection;\n const _start = start ?? current.start;\n const _end = end ?? current.end;\n\n const result = this._parser.replace(\n this._maskedValue || this._parser.emptyMask,\n replacement,\n _start,\n _end\n );\n const next = this._parser.apply(this._parser.parse(result.value));\n\n this._recordHistory('atomic', next, _start, current);\n this._commitMaskedValue(next);\n\n this.updateComplete.then(() => {\n switch (selectMode) {\n case 'select':\n this.setSelectionRange(_start, _end);\n break;\n case 'start':\n this.setSelectionRange(_start, _start);\n break;\n case 'end':\n this.setSelectionRange(_end, _end);\n break;\n default:\n this.setSelectionRange(current.start, current.end);\n }\n });\n }\n\n //#endregion\n }\n\n return MaskBehaviorElement as unknown as AbstractConstructor<MaskBehaviorElementInterface> &\n T;\n}\n"]}
|
|
@@ -12,6 +12,11 @@ export class IgcBaseOptionLikeComponent extends LitElement {
|
|
|
12
12
|
super(...arguments);
|
|
13
13
|
this._internals = addInternalsController(this, {
|
|
14
14
|
initialARIA: { role: 'option' },
|
|
15
|
+
reflectRole: true,
|
|
16
|
+
aria: () => ({
|
|
17
|
+
ariaDisabled: `${this.disabled}`,
|
|
18
|
+
ariaSelected: `${this.selected}`,
|
|
19
|
+
}),
|
|
15
20
|
});
|
|
16
21
|
this._active = false;
|
|
17
22
|
this._disabled = false;
|
|
@@ -28,14 +33,12 @@ export class IgcBaseOptionLikeComponent extends LitElement {
|
|
|
28
33
|
}
|
|
29
34
|
set disabled(value) {
|
|
30
35
|
this._disabled = Boolean(value);
|
|
31
|
-
this._internals.setARIA({ ariaDisabled: `${this.disabled}` });
|
|
32
36
|
}
|
|
33
37
|
get disabled() {
|
|
34
38
|
return this._disabled;
|
|
35
39
|
}
|
|
36
40
|
set selected(value) {
|
|
37
41
|
this._selected = Boolean(value);
|
|
38
|
-
this._internals.setARIA({ ariaSelected: `${this._selected}` });
|
|
39
42
|
this.active = this.selected;
|
|
40
43
|
}
|
|
41
44
|
get selected() {
|
|
@@ -47,10 +50,6 @@ export class IgcBaseOptionLikeComponent extends LitElement {
|
|
|
47
50
|
get value() {
|
|
48
51
|
return this._value ? this._value : this._contentSlotText;
|
|
49
52
|
}
|
|
50
|
-
connectedCallback() {
|
|
51
|
-
super.connectedCallback();
|
|
52
|
-
this.role = 'option';
|
|
53
|
-
}
|
|
54
53
|
render() {
|
|
55
54
|
return html `
|
|
56
55
|
<section part="prefix">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"option.js","sourceRoot":"","sources":["../../../src/internals/mixins/option.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,MAAM,OAAgB,0BAA2B,SAAQ,UAAU;IAAnE;;QACqB,eAAU,GAAG,s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CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC;IAC3D,CAAC;IAEkB,MAAM;QACvB,OAAO,IAAI,CAAA;;;;;;;;;;KAUV,CAAC;IACJ,CAAC;CACF;AA1EoB;IADlB,kBAAkB,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4DACO;AAW7C;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAG1C;AAWD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAI1C;AAaD;IADC,QAAQ,EAAE;uDAGV","sourcesContent":["import { html, LitElement } from 'lit';\nimport { property, queryAssignedNodes } from 'lit/decorators.js';\nimport { addInternalsController } from '../controllers/internals.js';\n\n/* omitModule */\nexport abstract class IgcBaseOptionLikeComponent extends LitElement {\n protected readonly _internals = addInternalsController(this, {\n initialARIA: { role: 'option' },\n reflectRole: true,\n aria: () => ({\n ariaDisabled: `${this.disabled}`,\n ariaSelected: `${this.selected}`,\n }),\n });\n\n protected _active = false;\n protected _disabled = false;\n protected _selected = false;\n protected _value!: string;\n\n @queryAssignedNodes({ flatten: true })\n protected readonly _content!: Array<Element>;\n\n protected get _contentSlotText(): string {\n return this._content.map((node) => node.textContent).join('');\n }\n\n /**\n * Whether the item is active.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set active(value: boolean) {\n this._active = Boolean(value);\n }\n\n public get active(): boolean {\n return this._active;\n }\n\n /**\n * Whether the item is disabled.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set disabled(value: boolean) {\n this._disabled = Boolean(value);\n }\n\n public get disabled(): boolean {\n return this._disabled;\n }\n\n /**\n * Whether the item is selected.\n * @attr\n */\n @property({ type: Boolean, reflect: true })\n public set selected(value: boolean) {\n this._selected = Boolean(value);\n this.active = this.selected;\n }\n\n public get selected(): boolean {\n return this._selected;\n }\n\n /**\n * The current value of the item.\n * If not specified, the element's text content is used.\n *\n * @attr\n */\n @property()\n public set value(value: string) {\n this._value = value;\n }\n\n public get value(): string {\n return this._value ? this._value : this._contentSlotText;\n }\n\n protected override render() {\n return html`\n <section part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </section>\n <section part=\"content\">\n <slot></slot>\n </section>\n <section part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </section>\n `;\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"part-map.js","sourceRoot":"","sources":["../../src/internals/part-map.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAC/B,OAAO,EAEL,SAAS,EAET,SAAS,EAET,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAM1B,MAAM,gBAAiB,SAAQ,SAAS;IAGtC,YAAY,QAAkB;QAC5B,KAAK,CAAC,QAAQ,CAAC,CAAC;QAEhB,IACE,QAAQ,CAAC,IAAI,KAAK,QAAQ,CAAC,SAAS;YACpC,QAAQ,CAAC,IAAI,KAAK,MAAM;YACvB,QAAQ,CAAC,OAAO,EAAE,MAAiB,GAAG,CAAC,EACxC,CAAC;YACD,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;QACJ,CAAC;IACH,CAAC;IAEe,MAAM,CAAC,WAAwB;QAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC;aAC5B,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;aACjC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,CAAC;IAEe,MAAM,CACpB,IAAmB,EACnB,CAAC,WAAW,CAA4B;QAExC,MAAM,QAAQ,GAAG,IA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\n type DirectiveParameters,\n directive,\n type PartInfo,\n PartType,\n} from 'lit/directive.js';\n\nexport interface PartMapInfo {\n readonly [name: string]: boolean | null | undefined;\n}\n\nclass PartMapDirective extends Directive {\n private _previousParts?: Set<string>;\n\n constructor(partInfo: PartInfo) {\n super(partInfo);\n\n if (\n partInfo.type !== PartType.ATTRIBUTE ||\n partInfo.name !== 'part' ||\n (partInfo.strings?.length as number) > 0\n ) {\n throw new Error(\n '`partMap() can only be used in the `part` attribute and must be the only part in the attribute.'\n );\n }\n }\n\n public override render(partMapInfo: PartMapInfo): string {\n return Object.keys(partMapInfo)\n .filter((key) => partMapInfo[key])\n .join(' ');\n }\n\n public override update(\n part: AttributePart,\n [partMapInfo]: DirectiveParameters<this>\n ) {\n const partList = part.element.part;\n\n if (this._previousParts === undefined) {\n this._previousParts = new Set();\n\n for (const name in partMapInfo) {\n if (partMapInfo[name]) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return this.render(partMapInfo);\n }\n\n for (const name of this._previousParts) {\n if (!(name in partMapInfo) || !partMapInfo[name]) {\n partList.remove(name);\n this._previousParts.delete(name);\n }\n }\n\n for (const name in partMapInfo) {\n const value = !!partMapInfo[name];\n if (value && !this._previousParts.has(name)) {\n partList.add(name);\n this._previousParts.add(name);\n }\n }\n\n return noChange;\n }\n}\n\n/**\n * Similar to Lit's {@link https://lit.dev/docs/templates/directives/#classmap | `classMap`} and\n * {@link https://lit.dev/docs/templates/directives/#stylemap | `styleMap`} but for `part` attributes.\n */\nexport const partMap = directive(PartMapDirective);\nexport type { PartMapDirective };\n"]}
|