igniteui-webcomponents 7.3.2 → 7.4.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 +87 -0
- package/animations/easings.d.ts +21 -31
- package/animations/easings.js +21 -34
- package/animations/easings.js.map +1 -1
- package/animations/player.d.ts +8 -16
- package/animations/player.js +5 -8
- package/animations/player.js.map +1 -1
- package/animations/view-transition.d.ts +10 -10
- package/animations/view-transition.js +26 -37
- package/animations/view-transition.js.map +1 -1
- package/components/breadcrumb/breadcrumb.d.ts +74 -0
- package/components/breadcrumb/breadcrumb.js +107 -0
- package/components/breadcrumb/breadcrumb.js.map +1 -0
- package/components/breadcrumb/breadcrumbs.d.ts +60 -0
- package/components/breadcrumb/breadcrumbs.js +50 -0
- package/components/breadcrumb/breadcrumbs.js.map +1 -0
- package/components/breadcrumb/themes/breadcrumb.base.css.js +3 -0
- package/components/breadcrumb/themes/breadcrumb.base.css.js.map +1 -0
- package/components/breadcrumb/themes/breadcrumbs.base.css.d.ts +1 -0
- package/components/{resize-container/themes/resize-container.base.css.js → breadcrumb/themes/breadcrumbs.base.css.js} +2 -2
- package/components/breadcrumb/themes/breadcrumbs.base.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/dark/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.d.ts +1 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.js +3 -0
- package/components/breadcrumb/themes/light/breadcrumb.shared.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.bootstrap.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.common.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.fluent.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.indigo.css.js.map +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.d.ts +1 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.js +3 -0
- package/components/breadcrumb/themes/shared/breadcrumb.material.css.js.map +1 -0
- package/components/breadcrumb/themes/themes.d.ts +2 -0
- package/components/breadcrumb/themes/themes.js +50 -0
- package/components/breadcrumb/themes/themes.js.map +1 -0
- package/components/button/button.d.ts +0 -2
- package/components/button/button.js.map +1 -1
- package/components/button-group/button-group.d.ts +42 -12
- package/components/button-group/button-group.js +82 -34
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +6 -1
- package/components/button-group/toggle-button.js +28 -2
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/base.js +2 -1
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +2 -3
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +2 -2
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/carousel/carousel-indicator.js +1 -0
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -1
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +3 -3
- package/components/carousel/carousel.js.map +1 -1
- package/components/chat/chat-input.d.ts +1 -2
- package/components/chat/chat-input.js +1 -1
- package/components/chat/chat-input.js.map +1 -1
- package/components/chat/chat-state.d.ts +8 -9
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +1 -3
- package/components/chat/chat.js +2 -2
- package/components/chat/chat.js.map +1 -1
- package/components/chat/message-attachments.d.ts +6 -15
- package/components/chat/message-attachments.js.map +1 -1
- package/components/chat/utils.d.ts +0 -1
- package/components/chat/utils.js +1 -1
- package/components/chat/utils.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +3 -1
- package/components/checkbox/checkbox-base.js +4 -0
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +4 -12
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +1 -8
- package/components/checkbox/switch.js.map +1 -1
- package/components/chip/chip.d.ts +2 -2
- package/components/chip/chip.js.map +1 -1
- package/components/color-picker/color-picker.d.ts +35 -34
- package/components/color-picker/color-picker.js +12 -7
- package/components/color-picker/color-picker.js.map +1 -1
- package/components/color-picker/common.d.ts +0 -2
- package/components/color-picker/common.js +2 -2
- package/components/color-picker/common.js.map +1 -1
- package/components/color-picker/converters.js.map +1 -1
- package/components/color-picker/picker-canvas.js.map +1 -1
- package/components/combo/combo.d.ts +24 -24
- package/components/combo/combo.js +21 -26
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +7 -10
- package/components/combo/controllers/data.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +22 -27
- package/components/date-picker/date-picker.base.js +9 -3
- package/components/date-picker/date-picker.base.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +1 -1
- package/components/date-picker/date-picker.js +5 -3
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +0 -2
- package/components/date-range-picker/date-range-input.js +0 -6
- package/components/date-range-picker/date-range-input.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +22 -31
- package/components/date-range-picker/date-range-picker.js +7 -7
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/i18n.d.ts +21 -0
- package/components/date-range-picker/i18n.js +10 -0
- package/components/date-range-picker/i18n.js.map +1 -0
- package/components/date-range-picker/predefined-ranges-area.d.ts +3 -3
- package/components/date-range-picker/predefined-ranges-area.js +2 -5
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +0 -4
- package/components/date-range-picker/validators.js +4 -4
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +42 -40
- package/components/date-time-input/date-time-input.base.js +9 -5
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +1 -11
- package/components/date-time-input/date-time-input.js +0 -6
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +0 -10
- package/components/date-time-input/datetime-mask-parser.js +1 -1
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/dialog/dialog.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +2 -10
- package/components/dropdown/dropdown-group.js +2 -27
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +17 -23
- package/components/dropdown/dropdown.js +5 -17
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/file-input/file-input.d.ts +7 -2
- package/components/file-input/file-input.js +4 -0
- package/components/file-input/file-input.js.map +1 -1
- package/components/icon/icon.d.ts +1 -1
- package/components/icon/icon.registry.d.ts +6 -6
- package/components/icon/icon.registry.js.map +1 -1
- package/components/input/input-base.d.ts +2 -2
- package/components/input/input-base.js +3 -5
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +3 -3
- package/components/input/input.js.map +1 -1
- package/components/mask-input/mask-history.d.ts +22 -18
- package/components/mask-input/mask-history.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +1 -1
- package/components/mask-input/mask-parser.d.ts +11 -13
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/popover/popover.d.ts +45 -34
- package/components/popover/popover.js +54 -122
- package/components/popover/popover.js.map +1 -1
- package/components/popover/position/arrow.d.ts +19 -0
- package/components/popover/position/arrow.js +33 -0
- package/components/popover/position/arrow.js.map +1 -0
- package/components/popover/position/floating.d.ts +40 -0
- package/components/popover/position/floating.js +146 -0
- package/components/popover/position/floating.js.map +1 -0
- package/components/popover/position/native.d.ts +45 -0
- package/components/popover/position/native.js +158 -0
- package/components/popover/position/native.js.map +1 -0
- package/components/popover/position/strategy.d.ts +37 -0
- package/components/popover/position/strategy.js +21 -0
- package/components/popover/position/strategy.js.map +1 -0
- package/components/popover/position/types.d.ts +26 -0
- package/components/popover/position/types.js +15 -0
- package/components/popover/position/types.js.map +1 -0
- package/components/popover/themes/light/popover.base.css.js +1 -1
- package/components/popover/themes/light/popover.base.css.js.map +1 -1
- package/components/progress/circular-progress.d.ts +0 -5
- package/components/progress/circular-progress.js.map +1 -1
- package/components/qr-code/qr-code.d.ts +1 -1
- package/components/radio/radio.d.ts +6 -4
- package/components/radio/radio.js +24 -25
- package/components/radio/radio.js.map +1 -1
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +9 -6
- package/components/rating/rating.js +17 -18
- package/components/rating/rating.js.map +1 -1
- package/components/select/select-group.d.ts +5 -10
- package/components/select/select-group.js +10 -34
- package/components/select/select-group.js.map +1 -1
- package/components/select/select.d.ts +12 -20
- package/components/select/select.js +5 -15
- package/components/select/select.js.map +1 -1
- package/components/slider/range-slider.d.ts +0 -1
- package/components/slider/range-slider.js +6 -11
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.d.ts +4 -1
- package/components/slider/slider-base.js +20 -18
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider.d.ts +2 -0
- package/components/slider/slider.js +5 -1
- package/components/slider/slider.js.map +1 -1
- package/components/splitter/splitter.d.ts +6 -6
- package/components/splitter/splitter.js.map +1 -1
- package/components/textarea/textarea.d.ts +2 -5
- package/components/textarea/textarea.js +3 -5
- package/components/textarea/textarea.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +6 -7
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +3 -3
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/toast.d.ts +0 -2
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/service.js +4 -5
- package/components/tooltip/service.js.map +1 -1
- package/components/tooltip/tooltip.d.ts +34 -13
- package/components/tooltip/tooltip.js +8 -4
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/tree/tree-item.d.ts +6 -6
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +5 -6
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.js.map +1 -1
- package/components/types.d.ts +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/validation-container.js +2 -1
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +40 -9
- package/components/virtualization/engine.js +126 -61
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/recycle.d.ts +13 -0
- package/components/virtualization/recycle.js +152 -0
- package/components/virtualization/recycle.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +84 -65
- package/components/virtualization/virtualization.js +20 -16
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +18455 -19551
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +3 -1
- package/index.js +2 -0
- package/index.js.map +1 -1
- package/internals/abort-handler.d.ts +13 -25
- package/internals/abort-handler.js +4 -6
- package/internals/abort-handler.js.map +1 -1
- package/internals/context.d.ts +13 -7
- package/internals/context.js +2 -1
- package/internals/context.js.map +1 -1
- package/internals/controllers/adopt-styles.d.ts +19 -20
- package/internals/controllers/adopt-styles.js +3 -8
- package/internals/controllers/adopt-styles.js.map +1 -1
- package/internals/controllers/aria-projection.d.ts +100 -61
- package/internals/controllers/aria-projection.js +81 -31
- package/internals/controllers/aria-projection.js.map +1 -1
- package/internals/controllers/async-consumer.js.map +1 -1
- package/internals/controllers/command.d.ts +15 -30
- package/internals/controllers/command.js +2 -7
- package/internals/controllers/command.js.map +1 -1
- package/internals/controllers/context-provider.d.ts +7 -13
- package/internals/controllers/context-provider.js.map +1 -1
- package/internals/controllers/focus-ring.d.ts +10 -30
- package/internals/controllers/focus-ring.js +6 -12
- package/internals/controllers/focus-ring.js.map +1 -1
- package/internals/controllers/fullscreen.d.ts +7 -23
- package/internals/controllers/fullscreen.js +3 -9
- package/internals/controllers/fullscreen.js.map +1 -1
- package/internals/controllers/gestures.d.ts +10 -29
- package/internals/controllers/gestures.js +1 -3
- package/internals/controllers/gestures.js.map +1 -1
- package/internals/controllers/group.d.ts +13 -30
- package/internals/controllers/group.js.map +1 -1
- package/internals/controllers/host-listeners.d.ts +28 -0
- package/internals/controllers/host-listeners.js +27 -0
- package/internals/controllers/host-listeners.js.map +1 -0
- package/internals/controllers/id-resolver.d.ts +8 -9
- package/internals/controllers/id-resolver.js +6 -14
- package/internals/controllers/id-resolver.js.map +1 -1
- package/internals/controllers/internals.d.ts +53 -104
- package/internals/controllers/internals.js +40 -13
- package/internals/controllers/internals.js.map +1 -1
- package/internals/controllers/key-bindings.d.ts +61 -158
- package/internals/controllers/key-bindings.js +68 -67
- package/internals/controllers/key-bindings.js.map +1 -1
- package/internals/controllers/keys.d.ts +32 -0
- package/internals/controllers/keys.js +20 -0
- package/internals/controllers/keys.js.map +1 -0
- package/internals/controllers/mutation-observer.d.ts +14 -37
- package/internals/controllers/mutation-observer.js +1 -1
- package/internals/controllers/mutation-observer.js.map +1 -1
- package/internals/controllers/resize-observer.d.ts +9 -19
- package/internals/controllers/resize-observer.js.map +1 -1
- package/internals/controllers/root-click.d.ts +11 -42
- package/internals/controllers/root-click.js +4 -6
- package/internals/controllers/root-click.js.map +1 -1
- package/internals/controllers/roving-focus.d.ts +16 -35
- package/internals/controllers/roving-focus.js.map +1 -1
- package/internals/controllers/slot.d.ts +25 -54
- package/internals/controllers/slot.js +6 -6
- package/internals/controllers/slot.js.map +1 -1
- package/internals/controllers/toggle.d.ts +44 -48
- package/internals/controllers/toggle.js.map +1 -1
- package/internals/date/compare.js.map +1 -1
- package/internals/date/converters.d.ts +10 -7
- package/internals/date/converters.js.map +1 -1
- package/internals/date/model.d.ts +9 -16
- package/internals/date/model.js +22 -25
- package/internals/date/model.js.map +1 -1
- package/internals/decorators/blazorAdditionalDependencies.d.ts +4 -2
- package/internals/decorators/blazorAdditionalDependencies.js.map +1 -1
- package/internals/decorators/blazorDeepImport.d.ts +1 -3
- package/internals/decorators/blazorDeepImport.js.map +1 -1
- package/internals/decorators/blazorInclude.d.ts +3 -2
- package/internals/decorators/blazorInclude.js.map +1 -1
- package/internals/decorators/blazorIndirectRender.d.ts +1 -3
- package/internals/decorators/blazorIndirectRender.js.map +1 -1
- package/internals/decorators/blazorSuppressComponent.d.ts +1 -3
- package/internals/decorators/blazorSuppressComponent.js.map +1 -1
- package/internals/decorators/coerced-property.d.ts +14 -20
- package/internals/decorators/coerced-property.js.map +1 -1
- package/internals/decorators/shadow-options.d.ts +2 -5
- package/internals/decorators/shadow-options.js.map +1 -1
- package/internals/definitions/defineAllComponents.js +2 -0
- package/internals/definitions/defineAllComponents.js.map +1 -1
- package/internals/directives/drag.d.ts +51 -81
- package/internals/directives/drag.js +27 -89
- package/internals/directives/drag.js.map +1 -1
- package/internals/directives/pointer-operation.d.ts +75 -0
- package/internals/directives/pointer-operation.js +92 -0
- package/internals/directives/pointer-operation.js.map +1 -0
- package/internals/directives/resize.d.ts +36 -64
- package/internals/directives/resize.js +18 -85
- package/internals/directives/resize.js.map +1 -1
- package/internals/i18n/EN/calendar.resources.d.ts +8 -2
- package/internals/i18n/EN/calendar.resources.js +2 -2
- package/internals/i18n/EN/calendar.resources.js.map +1 -1
- package/internals/i18n/EN/chat.resources.d.ts +8 -2
- package/internals/i18n/EN/chat.resources.js +3 -10
- package/internals/i18n/EN/chat.resources.js.map +1 -1
- package/internals/i18n/EN/date-picker.resources.d.ts +6 -4
- package/internals/i18n/EN/date-picker.resources.js +1 -7
- package/internals/i18n/EN/date-picker.resources.js.map +1 -1
- package/internals/i18n/EN/date-range-picker.resources.d.ts +9 -2
- package/internals/i18n/EN/date-range-picker.resources.js +2 -2
- package/internals/i18n/EN/date-range-picker.resources.js.map +1 -1
- package/internals/i18n/i18n-controller.d.ts +44 -46
- package/internals/i18n/i18n-controller.js +46 -33
- package/internals/i18n/i18n-controller.js.map +1 -1
- package/internals/i18n/utils.d.ts +9 -4
- package/internals/i18n/utils.js +4 -27
- package/internals/i18n/utils.js.map +1 -1
- package/internals/mixins/alert.d.ts +10 -25
- package/internals/mixins/alert.js.map +1 -1
- package/internals/mixins/combo-box.d.ts +21 -11
- package/internals/mixins/combo-box.js +16 -22
- package/internals/mixins/combo-box.js.map +1 -1
- package/internals/mixins/event-emitter.js +9 -11
- package/internals/mixins/event-emitter.js.map +1 -1
- package/internals/mixins/forms/associated-required.d.ts +4 -4
- package/internals/mixins/forms/associated-required.js.map +1 -1
- package/internals/mixins/forms/associated.d.ts +4 -2
- package/internals/mixins/forms/associated.js +42 -19
- package/internals/mixins/forms/associated.js.map +1 -1
- package/internals/mixins/forms/form-transformers.js.map +1 -1
- package/internals/mixins/forms/types.d.ts +27 -78
- package/internals/mixins/forms/types.js.map +1 -1
- package/internals/mixins/group.d.ts +18 -0
- package/internals/mixins/group.js +37 -0
- package/internals/mixins/group.js.map +1 -0
- package/internals/mixins/i18n.d.ts +10 -16
- package/internals/mixins/i18n.js.map +1 -1
- package/internals/mixins/mask-behavior.d.ts +8 -22
- package/internals/mixins/mask-behavior.js +1 -2
- package/internals/mixins/mask-behavior.js.map +1 -1
- package/internals/mixins/option.d.ts +1 -2
- package/internals/mixins/option.js +2 -1
- package/internals/mixins/option.js.map +1 -1
- package/internals/part-map.d.ts +4 -2
- package/internals/part-map.js +1 -1
- package/internals/part-map.js.map +1 -1
- package/internals/templates/input-shell.d.ts +8 -17
- package/internals/templates/input-shell.js +4 -1
- package/internals/templates/input-shell.js.map +1 -1
- package/internals/templates/masked-input.d.ts +7 -8
- package/internals/templates/masked-input.js.map +1 -1
- package/internals/templates/slotted-icon.d.ts +7 -12
- package/internals/templates/slotted-icon.js.map +1 -1
- package/internals/templates/toggle-shell.d.ts +19 -19
- package/internals/templates/toggle-shell.js +12 -8
- package/internals/templates/toggle-shell.js.map +1 -1
- package/internals/timing.d.ts +5 -14
- package/internals/timing.js.map +1 -1
- package/internals/utils/arrays.d.ts +21 -21
- package/internals/utils/arrays.js +14 -0
- package/internals/utils/arrays.js.map +1 -1
- package/internals/utils/dom.d.ts +53 -41
- package/internals/utils/dom.js +3 -4
- package/internals/utils/dom.js.map +1 -1
- package/internals/utils/events.d.ts +29 -16
- package/internals/utils/events.js +9 -1
- package/internals/utils/events.js.map +1 -1
- package/internals/utils/lit.d.ts +5 -2
- package/internals/utils/lit.js.map +1 -1
- package/internals/utils/math.d.ts +8 -6
- package/internals/utils/math.js.map +1 -1
- package/internals/utils/objects.d.ts +3 -20
- package/internals/utils/objects.js +1 -39
- package/internals/utils/objects.js.map +1 -1
- package/internals/utils/strings.d.ts +9 -11
- package/internals/utils/strings.js.map +1 -1
- package/internals/utils/types.d.ts +16 -3
- package/internals/utils/types.js +3 -0
- package/internals/utils/types.js.map +1 -1
- package/internals/validators.d.ts +9 -8
- package/internals/validators.js +12 -6
- package/internals/validators.js.map +1 -1
- package/package.json +1 -1
- package/skills/README.md +4 -3
- package/skills/igniteui-wc-choose-components/SKILL.md +2 -1
- package/skills/igniteui-wc-customize-component-theme/SKILL.md +2 -1
- package/skills/igniteui-wc-figma-to-app/SKILL.md +328 -0
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +343 -0
- package/skills/igniteui-wc-figma-to-app/references/design-provenance.md +199 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +489 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +370 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-exploration.md +222 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +363 -0
- package/skills/igniteui-wc-figma-to-app/references/project-setup.md +105 -0
- package/skills/igniteui-wc-figma-to-app/references/theme-generation.md +180 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +370 -0
- package/skills/igniteui-wc-generate-from-image-design/SKILL.md +2 -1
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +3 -3
- package/skills/igniteui-wc-grids/SKILL.md +133 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +2 -1
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +2 -1
- package/skills/igniteui-wc-optimize-bundle-size/SKILL.md +2 -1
- package/theming/config.d.ts +14 -5
- package/theming/config.js +38 -18
- package/theming/config.js.map +1 -1
- package/theming/context.d.ts +1 -23
- package/theming/context.js.map +1 -1
- package/theming/theming-controller.d.ts +2 -32
- package/theming/theming-controller.js +15 -21
- package/theming/theming-controller.js.map +1 -1
- package/theming/theming-event.d.ts +0 -7
- package/theming/theming-event.js +0 -13
- package/theming/theming-event.js.map +1 -1
- package/theming/types.d.ts +1 -8
- package/theming/types.js.map +1 -1
- package/web-types.json +3 -3
- package/animations/presets/slide/index.d.ts +0 -3
- package/animations/presets/slide/index.js +0 -16
- package/animations/presets/slide/index.js.map +0 -1
- package/components/resize-container/themes/resize-container.base.css.js.map +0 -1
- package/internals/controllers/root-scroll.d.ts +0 -31
- package/internals/controllers/root-scroll.js +0 -71
- package/internals/controllers/root-scroll.js.map +0 -1
- package/theming/utils.d.ts +0 -11
- package/theming/utils.js +0 -20
- package/theming/utils.js.map +0 -1
- /package/components/{resize-container/themes/resize-container.base.css.d.ts → breadcrumb/themes/breadcrumb.base.css.d.ts} +0 -0
|
@@ -59,20 +59,17 @@ export declare class DataState<T extends object> implements ReactiveController {
|
|
|
59
59
|
* Called during the update lifecycle to batch changes.
|
|
60
60
|
*/
|
|
61
61
|
private _runPipelineIfDirty;
|
|
62
|
-
/**
|
|
63
|
-
* Initial indexing of the data - converts raw data items into ComboRecord format with metadata.
|
|
64
|
-
*/
|
|
62
|
+
/** Converts the raw data items into {@link ComboRecord} objects. */
|
|
65
63
|
private _index;
|
|
66
64
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
65
|
+
* Filters and groups the indexed source, then numbers the visible options
|
|
66
|
+
* again, so that the `aria-posinset` and `aria-setsize` pair of the list
|
|
67
|
+
* skips the group headers.
|
|
70
68
|
*
|
|
71
69
|
* @remarks
|
|
72
|
-
* `position` is derived view state and
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
* allocation to each keystroke.
|
|
70
|
+
* `position` is derived view state, and the records belong only to this
|
|
71
|
+
* controller. Each run computes the field before a read, so it is numbered in
|
|
72
|
+
* place. A copy per run would add one allocation to each keystroke.
|
|
76
73
|
*/
|
|
77
74
|
private _apply;
|
|
78
75
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sourceRoot":"","sources":["../../../../src/components/combo/controllers/data.ts"],"names":[],"mappings":"AAEA,OAAO,mBAAmB,MAAM,yBAAyB,CAAC;AAC1D,OAAO,kBAAkB,MAAM,wBAAwB,CAAC;AAUxD,MAAM,OAAO,SAAS;IA2BpB,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAGD,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAMD,IAAW,cAAc;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC/D,CAAC;IAMD,IAAW,UAAU,CAAC,KAAa;QACjC,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,EAAE,CAAC;YAC/B,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;YACzB,IAAI,CAAC,UAAU,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;IAGD,IAAW,UAAU;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAGD,IAAW,gBAAgB;QACzB,OAAO,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC;IACrC,CA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E,CAAC;gBACnB,MAAM,CAAC,QAAQ,GAAG,EAAE,QAAQ,CAAC;YAC/B,CAAC;QACH,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAE3B,OAAO,MAAM,CAAC;IAChB,CAAC;IASM,YAAY,CAAC,MAAc;QAChC,IAAI,CAAC,gBAAgB,GAAG,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAClD,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAKM,UAAU;QACf,IAAI,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;CAGF","sourcesContent":["import type { ReactiveController } from 'lit';\n\nimport FilterDataOperation from '../operations/filter.js';\nimport GroupDataOperation from '../operations/group.js';\nimport type {\n ComboHost,\n ComboRecord,\n FilteringOptions,\n GroupingOptions,\n Keys,\n} from '../types.js';\n\n/* blazorSuppress */\nexport class DataState<T extends object> implements ReactiveController {\n //#region Internal state\n private readonly _host: ComboHost<T>;\n private readonly _filtering = new FilterDataOperation<T>();\n private readonly _grouping = new GroupDataOperation<T>();\n private _compareCollator: Intl.Collator;\n\n /** The data source, indexed into records. See {@link _isSourceOutdated}. */\n private _indexed: ComboRecord<T>[] = [];\n private _source?: T[];\n\n private _dataState: ComboRecord<T>[] = [];\n private _itemCount = 0;\n private _searchTerm = '';\n private _dirty = true;\n\n //#endregion\n\n //#region Public state accessors\n\n /**\n * The current state of the data in the combo component.\n *\n * @remarks\n * The collection is shared with the virtualized list and may be the cached\n * indexed source itself, so it is handed out as read-only.\n */\n public get dataState(): readonly ComboRecord<T>[] {\n return this._dataState;\n }\n\n /** The number of selectable options in {@link dataState}, excluding group headers. */\n public get itemCount(): number {\n return this._itemCount;\n }\n\n /**\n * The index in {@link dataState} of the first selectable option,\n * or `-1` when there are none.\n */\n public get firstItemIndex(): number {\n return this._dataState.findIndex((record) => !record.header);\n }\n\n /**\n * Sets the current search term used for filtering the data.\n * Triggers a data pipeline run if the value changes.\n */\n public set searchTerm(value: string) {\n if (this._searchTerm !== value) {\n this._searchTerm = value;\n this.invalidate();\n }\n }\n\n /** The current search term used for filtering the data. */\n public get searchTerm(): string {\n return this._searchTerm;\n }\n\n /** The current filtering options for the combo component. */\n public get filteringOptions(): FilteringOptions<T> {\n return this._host.filteringOptions;\n }\n\n /** The current grouping options for the combo component. */\n public get groupingOptions(): GroupingOptions<T> {\n return {\n valueKey: this._host.valueKey,\n displayKey: this._host.displayKey,\n groupKey: this._host.groupKey as Keys<T>,\n direction: this._host.groupSorting,\n };\n }\n\n /** The current collator used for comparing values. */\n public get compareCollator(): Intl.Collator {\n return this._compareCollator;\n }\n\n //#endregion\n\n //#region Lifecycle and pipeline management\n\n constructor(host: ComboHost<T>) {\n this._host = host;\n this._host.addController(this);\n this._compareCollator = new Intl.Collator(this._host.locale);\n }\n\n /**\n * Lit lifecycle hook - runs before rendering.\n * Executes pipeline if any changes were batched.\n * @internal\n */\n public hostUpdate(): void {\n // A change to the data array in place notifies neither Lit nor\n // `invalidate()`, so a changed length is found here and marks the pipeline\n // dirty. A replaced element of the same length stays unknown and needs a\n // new `data` array.\n if (this._isSourceOutdated()) {\n this._dirty = true;\n }\n\n this._runPipelineIfDirty();\n }\n\n /** Whether the indexed source no longer matches the host's data array. */\n private _isSourceOutdated(): boolean {\n const data = this._host.data;\n return this._source !== data || this._indexed.length !== data.length;\n }\n\n /**\n * Marks the data state as dirty, triggering a pipeline run before next render.\n * This batches multiple changes into a single pipeline execution.\n */\n private _markDirty(): void {\n if (!this._dirty) {\n this._dirty = true;\n this._host.requestUpdate();\n }\n }\n\n /**\n * Executes the data pipeline if marked dirty.\n * Called during the update lifecycle to batch changes.\n */\n private _runPipelineIfDirty(): void {\n if (!this._dirty) {\n return;\n }\n\n // The `value` and `header` of a record are fixed for a data item, so the\n // indexed source is built again only if it no longer agrees with the data of\n // the host. A filter-only run, which each keystroke starts, uses it again\n // and allocates no records. Only the derived `position` changes per run.\n // See `_apply`.\n if (this._isSourceOutdated()) {\n this._source = this._host.data;\n this._indexed = this._index(this._source);\n }\n\n this._dataState = this._apply(this._indexed);\n this._dirty = false;\n }\n\n //#endregion\n\n //#region Internal pipeline operations\n\n /** Converts the raw data items into {@link ComboRecord} objects. */\n private _index(data: T[]): ComboRecord<T>[] {\n return data.map((item, index) => ({\n value: item,\n header: false,\n position: index + 1,\n }));\n }\n\n /**\n * Filters and groups the indexed source, then numbers the visible options\n * again, so that the `aria-posinset` and `aria-setsize` pair of the list\n * skips the group headers.\n *\n * @remarks\n * `position` is derived view state, and the records belong only to this\n * controller. Each run computes the field before a read, so it is numbered in\n * place. A copy per run would add one allocation to each keystroke.\n */\n private _apply(records: ComboRecord<T>[]): ComboRecord<T>[] {\n const result = this._grouping.apply(\n this._filtering.apply(records, this),\n this\n );\n\n let position = 0;\n\n for (const record of result) {\n if (!record.header) {\n record.position = ++position;\n }\n }\n\n this._itemCount = position;\n\n return result;\n }\n\n //#endregion\n\n //#region Public API for host component\n\n /**\n * Updates the collator when locale changes.\n */\n public updateLocale(locale: string): void {\n this._compareCollator = new Intl.Collator(locale);\n this._markDirty();\n }\n\n /**\n * Marks data as dirty when host properties that affect data change.\n */\n public invalidate(): void {\n this._markDirty();\n }\n\n //#endregion\n}\n"]}
|
|
@@ -25,7 +25,7 @@ export interface IgcPickerBaseEventMap<T> {
|
|
|
25
25
|
/** The parts of the calendar which the pickers re-export to their own consumers. */
|
|
26
26
|
export declare const calendarExportParts: "header, header-title, header-date, content: calendar-content, navigation, months-navigation,\n years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,\n days-view, months-view, years-view, days-row, months-row, years-row, label: calendar-label,\n label-inner: calendar-label-inner, week-number, week-number-inner, date,\n date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,\n month, month-inner, year, year-inner, selected, current";
|
|
27
27
|
/** The components rendered by the picker chrome of every picker. */
|
|
28
|
-
export declare const pickerDependencies: (typeof IgcIconComponent | typeof
|
|
28
|
+
export declare const pickerDependencies: (typeof IgcIconComponent | typeof IgcPopoverComponent | typeof IgcValidationContainerComponent | typeof IgcCalendarComponent | typeof IgcFocusTrapComponent | typeof IgcDialogComponent)[];
|
|
29
29
|
/**
|
|
30
30
|
* The subset of the slot controller which the base picker queries.
|
|
31
31
|
* Kept structural so that each picker can declare its own set of slot names.
|
|
@@ -66,17 +66,15 @@ export declare abstract class IgcDatePickerBaseComponent<T extends Date | DateRa
|
|
|
66
66
|
/** The theming controller of the concrete picker. */
|
|
67
67
|
protected abstract readonly _themes: ThemingController;
|
|
68
68
|
/**
|
|
69
|
-
* The localization controller of the
|
|
70
|
-
*
|
|
69
|
+
* The localization controller of the picker. Only the locale is shared,
|
|
70
|
+
* because the resource strings differ between the pickers.
|
|
71
71
|
*/
|
|
72
72
|
protected abstract readonly _i18nController: {
|
|
73
73
|
locale: string;
|
|
74
74
|
};
|
|
75
75
|
/**
|
|
76
|
-
* The current value of the picker.
|
|
77
|
-
*
|
|
78
|
-
* The public `value` is declared by the concrete pickers, since its type,
|
|
79
|
-
* converter and form state differ between them.
|
|
76
|
+
* The current value of the picker. Each picker declares its own public
|
|
77
|
+
* `value`, because the type, the converter and the form state differ.
|
|
80
78
|
*/
|
|
81
79
|
protected abstract get _value(): T | null;
|
|
82
80
|
protected abstract set _value(value: T | null);
|
|
@@ -89,28 +87,25 @@ export declare abstract class IgcDatePickerBaseComponent<T extends Date | DateRa
|
|
|
89
87
|
/** The localized label of the calendar picker. */
|
|
90
88
|
protected abstract get _selectDateLabel(): string | undefined;
|
|
91
89
|
/**
|
|
92
|
-
* The editor the
|
|
93
|
-
*
|
|
94
|
-
*
|
|
90
|
+
* The editor that gets the ARIA state of the host: the name of the host and
|
|
91
|
+
* `aria-haspopup="dialog"`. Both must reach the native input that assistive
|
|
92
|
+
* technology reads.
|
|
95
93
|
*/
|
|
96
94
|
protected abstract get _projectionTarget(): Element | null;
|
|
97
95
|
/** Moves focus to the editor of the picker. */
|
|
98
96
|
protected abstract _focusInput(): void;
|
|
99
97
|
/** Restores focus to the editor after a value has been selected in the calendar. */
|
|
100
98
|
protected abstract _focusAndSelectInput(): void;
|
|
101
|
-
/**
|
|
102
|
-
* Resolves the value of the picker from the dates selected in the calendar, which come
|
|
103
|
-
* in ascending order.
|
|
104
|
-
*/
|
|
99
|
+
/** The value of the picker for `dates`, which the calendar gives in ascending order. */
|
|
105
100
|
protected abstract _valueFromCalendarSelection(dates: Date[]): T | null;
|
|
106
101
|
/** The value reflected in the calendar when it is in single selection mode. */
|
|
107
102
|
protected get _calendarValue(): Date | null;
|
|
108
103
|
/** The values reflected in the calendar when it is in range selection mode. */
|
|
109
104
|
protected get _calendarValues(): Date[] | null;
|
|
110
105
|
/**
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
106
|
+
* The active date for the first render, if the picker holds a value but no
|
|
107
|
+
* active date. The calendar then owns its active date and `activeDate` reads
|
|
108
|
+
* it back, so this is read one time.
|
|
114
109
|
*/
|
|
115
110
|
protected get _defaultActiveDate(): Date | null;
|
|
116
111
|
/** The title of the calendar icon, if the picker provides one. */
|
|
@@ -263,13 +258,14 @@ export declare abstract class IgcDatePickerBaseComponent<T extends Date | DateRa
|
|
|
263
258
|
protected _setDateConstraints(): void;
|
|
264
259
|
protected _shouldCloseCalendarDropdown(): Promise<void>;
|
|
265
260
|
/**
|
|
266
|
-
* Points the calendar at the first defined of `dates`,
|
|
267
|
-
* active date
|
|
261
|
+
* Points the calendar at the first defined date of `dates`, and keeps the
|
|
262
|
+
* current active date if there is none. Does nothing before the calendar
|
|
263
|
+
* renders.
|
|
268
264
|
*/
|
|
269
265
|
protected _setCalendarActiveDate(...dates: (Date | null | undefined)[]): void;
|
|
270
266
|
/**
|
|
271
|
-
*
|
|
272
|
-
*
|
|
267
|
+
* Writes the value of the picker back onto the calendar. A read-only picker
|
|
268
|
+
* must do this itself, because the binding has nothing to commit again.
|
|
273
269
|
*/
|
|
274
270
|
protected _restoreCalendarSelection(): Promise<void>;
|
|
275
271
|
/** Emits `igcChange` if the value has moved away from the last committed one. */
|
|
@@ -285,16 +281,15 @@ export declare abstract class IgcDatePickerBaseComponent<T extends Date | DateRa
|
|
|
285
281
|
protected _handleCalendarChangeEvent(event: CustomEvent<Date | Date[]>): Promise<void>;
|
|
286
282
|
protected _handleDialogClosing(event: Event): void;
|
|
287
283
|
protected _handleDialogClosed(event: Event): void;
|
|
288
|
-
protected _renderClearIcon(part?: string): typeof nothing
|
|
284
|
+
protected _renderClearIcon(part?: string): TemplateResult<1> | typeof nothing;
|
|
289
285
|
protected _renderCalendarIcon(suffix?: string): TemplateResult<1>;
|
|
290
286
|
/**
|
|
291
|
-
* The content
|
|
292
|
-
*
|
|
293
|
-
*
|
|
294
|
-
* e.g. `-start` and `-end`.
|
|
287
|
+
* The content for an editor of the picker: its icons and its prefix and
|
|
288
|
+
* suffix slots. The suffix identifies the editor if the picker renders more
|
|
289
|
+
* than one, for example `-start` and `-end`.
|
|
295
290
|
*/
|
|
296
291
|
protected _renderEditorSlots(suffix?: string): TemplateResult<1>;
|
|
297
|
-
protected _renderCalendarSlots(): typeof nothing
|
|
292
|
+
protected _renderCalendarSlots(): TemplateResult<1> | typeof nothing;
|
|
298
293
|
protected _renderCalendar(id: string): TemplateResult<1>;
|
|
299
294
|
protected _renderActions(): TemplateResult<1>;
|
|
300
295
|
/** The content rendered inside the popover/dialog of the picker. */
|
|
@@ -159,9 +159,9 @@ export class IgcDatePickerBaseComponent extends FormAssociatedRequiredMixin(Even
|
|
|
159
159
|
target: () => this._projectionTarget,
|
|
160
160
|
state: () => ({
|
|
161
161
|
hasPopup: 'dialog',
|
|
162
|
-
labelledBy: this._internals.labels,
|
|
163
162
|
describedBy: this._helperText ? [this._helperText] : null,
|
|
164
163
|
}),
|
|
164
|
+
hasOwnLabel: () => Boolean(this.label),
|
|
165
165
|
});
|
|
166
166
|
addSafeEventListener(this, 'focusout', this._handleFocusOut);
|
|
167
167
|
addKeybindings(this, {
|
|
@@ -328,7 +328,7 @@ export class IgcDatePickerBaseComponent extends FormAssociatedRequiredMixin(Even
|
|
|
328
328
|
`;
|
|
329
329
|
}
|
|
330
330
|
_renderCalendar(id) {
|
|
331
|
-
const hideHeader = this._isDropDown
|
|
331
|
+
const hideHeader = this._isDropDown || this.hideHeader;
|
|
332
332
|
const isInert = !this.open || this.disabled;
|
|
333
333
|
return html `
|
|
334
334
|
<igc-calendar
|
|
@@ -378,7 +378,13 @@ export class IgcDatePickerBaseComponent extends FormAssociatedRequiredMixin(Even
|
|
|
378
378
|
const isDisabled = !this.open || this.disabled;
|
|
379
379
|
return this._isDropDown
|
|
380
380
|
? html `
|
|
381
|
-
<igc-popover
|
|
381
|
+
<igc-popover
|
|
382
|
+
?open=${this.open}
|
|
383
|
+
anchor=${id}
|
|
384
|
+
flip
|
|
385
|
+
.scrollStrategy=${this.scrollStrategy}
|
|
386
|
+
@igcPopoverScrollClose=${this._handleClosing}
|
|
387
|
+
>
|
|
382
388
|
<igc-focus-trap ?disabled=${isDisabled}>
|
|
383
389
|
${this._renderPickerContent(id)}
|
|
384
390
|
</igc-focus-trap>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.base.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EA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AE,SAAS,EAAE,mBAAmB,EAAE,CAAC;mEAC5C;AAQxB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;mEAC5C;AAW/B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;2DAGrC","sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addAriaProjector } from '#internals/controllers/aria-projection.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n escapeKey,\n} from '#internals/controllers/key-bindings.js';\nimport { addRootClickController } from '#internals/controllers/root-click.js';\nimport { convertToDate } from '#internals/date/converters.js';\nimport { coercedProperty } from '#internals/decorators/coerced-property.js';\nimport { IgcComboBoxBaseLikeComponent } from '#internals/mixins/combo-box.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '#internals/mixins/forms/associated-required.js';\nimport { renderSlottedIcon } from '#internals/templates/slotted-icon.js';\nimport { asArray } from '#internals/utils/arrays.js';\nimport {\n addSafeEventListener,\n focusLeftHost,\n getElementFromPath,\n} from '#internals/utils/events.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { equal } from '#internals/utils/objects.js';\nimport type { ThemingController } from '#theming/theming-controller.js';\nimport IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';\nimport {\n createDateConstraints,\n getLocaleWeekStart,\n} from '../calendar/helpers.js';\nimport type {\n CalendarHeaderOrientation,\n CalendarSelection,\n DateRangeDescriptor,\n WeekDays,\n} from '../calendar/types.js';\nimport IgcDialogComponent from '../dialog/dialog.js';\nimport IgcFocusTrapComponent from '../focus-trap/focus-trap.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport type {\n ContentOrientation,\n DateRangeValue,\n PickerMode,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\n\n/**\n * The events emitted by a picker driven by a calendar.\n * `T` is the value type of the picker - a single date or a date range.\n */\nexport interface IgcPickerBaseEventMap<T> {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<T | null>;\n igcInput: CustomEvent<T | null>;\n}\n\n/** The parts of the calendar which the pickers re-export to their own consumers. */\nexport const calendarExportParts =\n `header, header-title, header-date, content: calendar-content, navigation, months-navigation,\n years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,\n days-view, months-view, years-view, days-row, months-row, years-row, label: calendar-label,\n label-inner: calendar-label-inner, week-number, week-number-inner, date,\n date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,\n month, month-inner, year, year-inner, selected, current` as const;\n\n/** Stable identity for \"no range\", so that the calendar binding is committed only once. */\nconst emptyValues: Date[] = [];\n\n/** The components rendered by the picker chrome of every picker. */\nexport const pickerDependencies = [\n IgcCalendarComponent,\n IgcDialogComponent,\n IgcFocusTrapComponent,\n IgcIconComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent,\n];\n\n/**\n * The subset of the slot controller which the base picker queries.\n * Kept structural so that each picker can declare its own set of slot names.\n */\ntype PickerSlots = {\n hasAssignedElements(slot: string): boolean;\n};\n\n/* blazorIndirectRender */\n/* omitModule */\n/**\n * Common behavior for the pickers which drive an `igc-calendar` from an editor -\n * {@link IgcDatePickerComponent} and {@link IgcDateRangePickerComponent}.\n *\n * It owns the calendar and editor facing properties, the open/close plumbing and the\n * picker chrome - calendar, popover/dialog, icons and actions. The value itself, its\n * form state and the editors are left to the concrete pickers.\n */\nexport abstract class IgcDatePickerBaseComponent<\n T extends Date | DateRangeValue,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcPickerBaseEventMap<Date | DateRangeValue>,\n AbstractConstructor<IgcComboBoxBaseLikeComponent>\n >(IgcComboBoxBaseLikeComponent)\n) {\n //#region Internal state and properties\n\n protected _oldValue: T | null = null;\n\n protected _activeDate: Date | null = null;\n protected _min: Date | null = null;\n protected _max: Date | null = null;\n protected _dateConstraints: DateRangeDescriptor[] = [];\n protected _displayFormat?: string;\n protected _inputFormat?: string;\n protected _visibleMonths = 1;\n private _weekStart?: WeekDays;\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n { onHide: this._handleClosing }\n );\n\n @query(IgcCalendarComponent.tagName)\n protected readonly _calendar!: IgcCalendarComponent;\n\n @query('#helper-text')\n protected readonly _helperText!: IgcValidationContainerComponent | null;\n\n protected get _isDropDown(): boolean {\n return this.mode === 'dropdown';\n }\n\n protected get _isMaterial(): boolean {\n return this._themes.theme === 'material';\n }\n\n /** Dialog mode is always read-only, the rest depends on the configuration. */\n protected get _isEditorReadOnly(): boolean {\n return !this._isDropDown || this.readOnly || this.nonEditable;\n }\n\n //#endregion\n\n //#region Abstract members\n\n /** The id of the editor the picker is anchored to. */\n protected abstract readonly _inputId: string;\n\n /** The slots of the concrete picker. */\n protected abstract readonly _slots: PickerSlots;\n\n /** The theming controller of the concrete picker. */\n protected abstract readonly _themes: ThemingController;\n\n /**\n * The localization controller of the concrete picker.\n * Only the locale is shared - the resource strings differ per picker.\n */\n protected abstract readonly _i18nController: { locale: string };\n\n /**\n * The current value of the picker.\n *\n * The public `value` is declared by the concrete pickers, since its type,\n * converter and form state differ between them.\n */\n protected abstract get _value(): T | null;\n protected abstract set _value(value: T | null);\n\n /** Clears any user input left in the editor(s) of the picker. */\n protected abstract _clearEditors(): void;\n\n /** Whether the picker holds a value. */\n protected abstract get _hasValue(): boolean;\n\n /** The selection mode of the underlying calendar. */\n protected abstract get _calendarSelection(): CalendarSelection;\n\n /** The localized label of the calendar picker. */\n protected abstract get _selectDateLabel(): string | undefined;\n\n /**\n * The editor the host's ARIA state is projected onto - its associated\n * labels and the `aria-haspopup=\"dialog\"` semantics of the picker, both of\n * which must land on the native input assistive technology reports.\n */\n protected abstract get _projectionTarget(): Element | null;\n\n /** Moves focus to the editor of the picker. */\n protected abstract _focusInput(): void;\n\n /** Restores focus to the editor after a value has been selected in the calendar. */\n protected abstract _focusAndSelectInput(): void;\n\n /**\n * Resolves the value of the picker from the dates selected in the calendar, which come\n * in ascending order.\n */\n protected abstract _valueFromCalendarSelection(dates: Date[]): T | null;\n\n //#endregion\n\n //#region Overridable hooks\n\n /** The value reflected in the calendar when it is in single selection mode. */\n protected get _calendarValue(): Date | null {\n return null;\n }\n\n /** The values reflected in the calendar when it is in range selection mode. */\n protected get _calendarValues(): Date[] | null {\n return null;\n }\n\n /**\n * Seeds the active date of the calendar on the initial render, when the picker holds\n * a value but no explicit active date. From then on the calendar owns its active date\n * and `activeDate` reads it back, so this is consulted once.\n */\n protected get _defaultActiveDate(): Date | null {\n return this._calendarValue;\n }\n\n /** The title of the calendar icon, if the picker provides one. */\n protected get _calendarIconTitle(): string | undefined {\n return undefined;\n }\n\n /** The accessible name of the picker in dialog mode. */\n protected get _dialogLabel(): string | undefined {\n return this._selectDateLabel;\n }\n\n /** The format the editor(s) fall back to when no display format is set. */\n protected get _defaultDisplayFormat(): string | undefined {\n return undefined;\n }\n\n /** The format the editor(s) fall back to when no input format is set. */\n protected get _defaultInputFormat(): string | undefined {\n return undefined;\n }\n\n /** Whether the current calendar selection is complete enough to close the picker. */\n protected _canCloseOnSelect(): boolean {\n return true;\n }\n\n /** Invoked when the picker is dismissed through the Escape key. */\n protected _handleDismiss(): void {}\n\n /** Invoked when focus has left the picker for good. */\n protected _onBlur(): void {}\n\n /** Invoked when the dialog of the picker is closing, before the picker is hidden. */\n protected _onDialogClosing(): void {}\n\n /** Invoked when the picker is toggled, before the update is awaited. */\n protected _syncCalendarOnToggle(): void {}\n\n /** Whether a selection made in the calendar commits the value of the picker right away. */\n protected _commitsCalendarSelection(): boolean {\n return true;\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /**\n * Determines whether the calendar is opened in a dropdown or a modal dialog.\n * @attr mode\n * @default dropdown\n */\n @property()\n public mode: PickerMode = 'dropdown';\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /**\n * Whether to allow typing in the input.\n * @attr non-editable\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'non-editable' })\n public nonEditable = false;\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * The label of the picker.\n * @attr label\n */\n @property()\n public label!: string;\n\n /**\n * The prompt symbol to use for unfilled parts of the mask.\n * @attr\n * @default _\n */\n @property()\n public prompt = '_';\n\n /**\n * Format to display the value in when not editing.\n * Defaults to the locale format if not set.\n * @attr display-format\n */\n @property({ attribute: 'display-format' })\n public set displayFormat(value: string) {\n this._displayFormat = value;\n }\n\n public get displayFormat(): string {\n return (this._displayFormat ?? this._defaultDisplayFormat)!;\n }\n\n /**\n * The date format to apply on the input.\n * Defaults to the current locale Intl.DateTimeFormat\n * @attr input-format\n */\n @property({ attribute: 'input-format' })\n public set inputFormat(value: string) {\n this._inputFormat = value;\n }\n\n public get inputFormat(): string {\n return (this._inputFormat ?? this._defaultInputFormat)!;\n }\n\n /**\n * The locale used to format the display value and to resolve the\n * component's resource strings. 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 minimum value required for the picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set min(value: Date | string | null | undefined) {\n this._min = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get min(): Date | null {\n return this._min;\n }\n\n /**\n * The maximum value required for the picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set max(value: Date | string | null | undefined) {\n this._max = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get max(): Date | null {\n return this._max;\n }\n\n /** Gets/sets disabled dates. */\n @property({ attribute: false })\n @coercedProperty<DateRangeDescriptor[], IgcDatePickerBaseComponent<T>>({\n onChange: ({ host }) => {\n host._setDateConstraints();\n host._validate();\n },\n })\n public disabledDates: DateRangeDescriptor[] = [];\n\n /** Gets/sets special dates. */\n @property({ attribute: false })\n public specialDates!: DateRangeDescriptor[];\n\n /**\n * Gets/Sets the date which is shown in the calendar picker and is highlighted.\n * By default it is the current date.\n */\n @property({ attribute: 'active-date', converter: convertToDate })\n public set activeDate(value: Date | string | null | undefined) {\n this._activeDate = convertToDate(value);\n }\n\n public get activeDate(): Date {\n return this._activeDate ?? this._calendar?.activeDate;\n }\n\n /**\n * The number of months displayed in the calendar.\n * @attr visible-months\n * @default 1\n */\n @property({ type: Number, attribute: 'visible-months' })\n public set visibleMonths(value: number) {\n this._visibleMonths = value;\n }\n\n public get visibleMonths(): number {\n return this._visibleMonths;\n }\n\n /**\n * The orientation of the calendar header.\n * @attr header-orientation\n * @default horizontal\n */\n @property({ attribute: 'header-orientation', reflect: true })\n public headerOrientation: CalendarHeaderOrientation = 'horizontal';\n\n /**\n * The orientation of the multiple months displayed in the calendar's days view.\n * @attr\n * @default horizontal\n */\n @property()\n public orientation: ContentOrientation = 'horizontal';\n\n /**\n * Determines whether the calendar hides its header.\n * @attr hide-header\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-header' })\n public hideHeader = false;\n\n /**\n * Controls the visibility of the dates that do not belong to the current month.\n * @attr hide-outside-days\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outside-days' })\n public hideOutsideDays = false;\n\n /**\n * Whether to show the number of the week in the calendar.\n * @attr show-week-numbers\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'show-week-numbers' })\n public showWeekNumbers = false;\n\n /**\n * Sets the start day of the week for the calendar.\n *\n * @remarks\n * When not set, the week starts on the first day of the week of the current {@link locale}.\n * Setting `undefined` returns to the locale value.\n * @attr week-start\n */\n @property({ attribute: 'week-start' })\n public set weekStart(value: WeekDays | undefined) {\n this._weekStart = value ?? undefined;\n }\n\n public get weekStart(): WeekDays {\n return this._weekStart ?? getLocaleWeekStart(this.locale);\n }\n\n //#endregion\n\n //#region Life-cycle hooks\n\n constructor() {\n super();\n\n // Projects the host's labels and popup semantics onto the native input\n // inside the editor (see ProjectedARIA for why the host cannot publish\n // these itself).\n addAriaProjector(this, {\n target: () => this._projectionTarget,\n state: () => ({\n hasPopup: 'dialog',\n labelledBy: this._internals.labels,\n describedBy: this._helperText ? [this._helperText] : null,\n }),\n });\n\n addSafeEventListener(this, 'focusout', this._handleFocusOut);\n\n addKeybindings(this, {\n skip: () => this.disabled || this.readOnly,\n })\n .set([altKey, arrowDown], this._handleAnchorClick)\n .set([altKey, arrowUp], this._onEscapeKey)\n .set(escapeKey, this._onEscapeKey);\n }\n\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n\n if (changedProperties.has('open')) {\n this._rootClickController.update();\n\n if (this.open) {\n this._oldValue = this._value;\n }\n }\n }\n\n //#endregion\n\n //#region Internal API\n\n protected _setDateConstraints(): void {\n this._dateConstraints =\n createDateConstraints(this._min, this._max, this.disabledDates) ?? [];\n }\n\n protected async _shouldCloseCalendarDropdown(): Promise<void> {\n if (this.keepOpenOnSelect || !this._canCloseOnSelect()) {\n return;\n }\n\n if (await this._hide(true)) {\n this._focusAndSelectInput();\n }\n }\n\n /**\n * Points the calendar at the first defined of `dates`, keeping its current\n * active date when none is. A no-op until the calendar is rendered.\n */\n protected _setCalendarActiveDate(\n ...dates: (Date | null | undefined)[]\n ): void {\n if (this._calendar) {\n this._calendar.activeDate =\n dates.find(Boolean) ?? this._calendar.activeDate;\n }\n }\n\n /**\n * Pushes the value of the picker back onto the calendar, which a read-only picker has\n * to do directly - the binding is left with nothing to re-commit.\n */\n protected async _restoreCalendarSelection(): Promise<void> {\n await this._calendar.updateComplete;\n\n if (this._calendarSelection === 'single') {\n this._calendar.value = this._calendarValue;\n } else {\n this._calendar.values = this._calendarValues ?? emptyValues;\n }\n }\n\n /** Emits `igcChange` if the value has moved away from the last committed one. */\n protected _emitChangeIfDirty(): void {\n if (!equal(this._value, this._oldValue)) {\n this.emitEvent('igcChange', { detail: this._value });\n this._oldValue = this._value;\n }\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Clears the editor(s) of the picker of any user input. */\n public clear(): void {\n this._oldValue = this._value;\n this._value = null;\n this._clearEditors();\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _onEscapeKey(): Promise<void> {\n if (await this._hide(true)) {\n this._handleDismiss();\n this._focusInput();\n }\n }\n\n protected override async _handleAnchorClick(): Promise<void> {\n super._handleAnchorClick();\n this._syncCalendarOnToggle();\n await this.updateComplete;\n this._calendar[focusActiveDate]({ preventScroll: true });\n }\n\n protected _handleInputClick(event: Event): void {\n if (getElementFromPath('input', event)) {\n // Open only if the click originates from the underlying input\n this._handleAnchorClick();\n }\n }\n\n protected _handleCalendarIconSlotPointerDown(event: PointerEvent): void {\n // Keeps the `delegatesFocus` of the host from focusing the editor, which would enter\n // an invalid state on blur as focus moves on to the calendar.\n event.preventDefault();\n }\n\n protected _handleFocusOut(event: FocusEvent): void {\n if (focusLeftHost(this, event)) {\n this._handleBlur();\n this._onBlur();\n }\n }\n\n protected _handleClosing(): void {\n this._hide(true);\n }\n\n protected async _handleCalendarChangeEvent(\n event: CustomEvent<Date | Date[]>\n ): Promise<void> {\n event.stopPropagation();\n this._setTouchedState();\n\n if (this.readOnly) {\n await this._restoreCalendarSelection();\n return;\n }\n\n this._value = this._valueFromCalendarSelection(asArray(event.detail));\n\n if (this._commitsCalendarSelection()) {\n this.emitEvent('igcChange', { detail: this._value });\n }\n\n this._shouldCloseCalendarDropdown();\n }\n\n protected _handleDialogClosing(event: Event): void {\n event.stopPropagation();\n this._onDialogClosing();\n this._hide(true);\n }\n\n protected _handleDialogClosed(event: Event): void {\n event.stopPropagation();\n }\n\n //#endregion\n\n //#region Rendering\n\n protected _renderClearIcon(part = 'clear-icon') {\n return this._hasValue\n ? html`\n <span\n slot=\"suffix\"\n part=${part}\n @click=${bindIf(!this.readOnly, this.clear)}\n >\n ${renderSlottedIcon({ slot: part, icon: 'input_clear' })}\n </span>\n `\n : nothing;\n }\n\n protected _renderCalendarIcon(suffix = '') {\n const part = `${this.open ? 'calendar-icon-open' : 'calendar-icon'}${suffix}`;\n\n return html`\n <span\n slot=\"prefix\"\n part=${part}\n @pointerdown=${this._handleCalendarIconSlotPointerDown}\n @click=${bindIf(!this.readOnly, this._handleAnchorClick)}\n >\n ${renderSlottedIcon({\n slot: part,\n icon: 'today',\n title: this._calendarIconTitle,\n })}\n </span>\n `;\n }\n\n /**\n * The content projected into an editor of the picker - its icons and prefix/suffix slots.\n *\n * The suffix distinguishes the editors of a picker which renders more than one,\n * e.g. `-start` and `-end`.\n */\n protected _renderEditorSlots(suffix = '') {\n const prefixSlot = `prefix${suffix}`;\n const suffixSlot = `suffix${suffix}`;\n\n return html`\n ${this._renderCalendarIcon(suffix)}\n <slot\n name=${prefixSlot}\n slot=${bindIf(this._slots.hasAssignedElements(prefixSlot), 'prefix')}\n ></slot>\n ${this._renderClearIcon(`clear-icon${suffix}`)}\n <slot\n name=${suffixSlot}\n slot=${bindIf(this._slots.hasAssignedElements(suffixSlot), 'suffix')}\n ></slot>\n `;\n }\n\n protected _renderCalendarSlots() {\n if (this._isDropDown) {\n return nothing;\n }\n\n const hasHeaderDate = this._slots.hasAssignedElements('header-date');\n\n return html`\n <slot name=\"title\" slot=\"title\">${this._selectDateLabel}</slot>\n <slot\n name=\"header-date\"\n slot=${bindIf(hasHeaderDate, 'header-date')}\n ></slot>\n `;\n }\n\n protected _renderCalendar(id: string) {\n const hideHeader = this._isDropDown ? true : this.hideHeader;\n const isInert = !this.open || this.disabled;\n\n return html`\n <igc-calendar\n aria-labelledby=${id}\n role=\"dialog\"\n selection=${this._calendarSelection}\n .inert=${isInert}\n ?show-week-numbers=${this.showWeekNumbers}\n ?hide-outside-days=${this.hideOutsideDays}\n ?hide-header=${hideHeader}\n .activeDate=${this.activeDate ?? this._defaultActiveDate}\n .value=${this._calendarValue}\n .values=${this._calendarValues ?? emptyValues}\n .headerOrientation=${this.headerOrientation}\n .orientation=${this.orientation}\n .visibleMonths=${this._visibleMonths}\n .locale=${this.locale}\n .disabledDates=${this._dateConstraints}\n .specialDates=${this.specialDates}\n .weekStart=${this.weekStart}\n @igcChange=${this._handleCalendarChangeEvent}\n exportparts=${calendarExportParts}\n >\n ${this._renderCalendarSlots()}\n </igc-calendar>\n `;\n }\n\n protected _renderActions() {\n const hasActions = this._slots.hasAssignedElements('actions');\n\n // If in dialog mode use the dialog footer slot\n return html`\n <div\n part=\"actions\"\n ?hidden=${!hasActions}\n slot=${bindIf(!this._isDropDown && hasActions, 'footer')}\n >\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n /** The content rendered inside the popover/dialog of the picker. */\n protected _renderPickerContent(id: string) {\n return html`${this._renderCalendar(id)}${this._renderActions()}`;\n }\n\n /** Additional content rendered in the dialog of the picker. */\n protected _renderDialogFooter(): TemplateResult | typeof nothing {\n return nothing;\n }\n\n protected _renderPicker(id: string) {\n const isDisabled = !this.open || this.disabled;\n\n return this._isDropDown\n ? html`\n <igc-popover ?open=${this.open} anchor=${id} flip shift>\n <igc-focus-trap ?disabled=${isDisabled}>\n ${this._renderPickerContent(id)}\n </igc-focus-trap>\n </igc-popover>\n `\n : html`\n <igc-dialog\n aria-label=${ifDefined(this._dialogLabel)}\n role=\"dialog\"\n ?open=${this.open}\n ?close-on-outside-click=${!this.keepOpenOnOutsideClick}\n hide-default-action\n @igcClosing=${this._handleDialogClosing}\n @igcClosed=${this._handleDialogClosed}\n exportparts=\"base: dialog-base, title, footer, overlay\"\n >\n ${this._renderPickerContent(id)}${this._renderDialogFooter()}\n </igc-dialog>\n `;\n }\n\n //#endregion\n}\n"]}
|
|
1
|
+
{"version":3,"file":"date-picker.base.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.base.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAA4C,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAC7E,OAAO,EACL,cAAc,EACd,MAAM,EACN,SAAS,EACT,OAAO,EACP,SAAS,GACV,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,2CAA2C,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAE9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EACL,oBAAoB,EACpB,aAAa,EACb,kBAAkB,GACnB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,6BAA6B,CAAC;AAEpD,OAAO,oBAAoB,EAAE,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAChF,OAAO,EACL,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,wBAAwB,CAAC;AAOhC,OAAO,kBAAkB,MAAM,qBAAqB,CAAC;AACr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E,CAAC;QACnB,CAAC;KACF,CAAC;iEAC+C;AAI1C;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;gEACa;AAO5C;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;4DAGhE;AAYD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;+DAGvD;AAYM;IADN,QAAQ,CAAC,EAAE,SAAS,EAAE,oBAAoB,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qEACM;AAQ5D;IADN,QAAQ,EAAE;+DAC2C;AAQ/C;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;8DAC3C;AAQnB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;mEAC5C;AAQxB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,mBAAmB,EAAE,CAAC;mEAC5C;AAW/B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;2DAGrC","sourcesContent":["import { html, nothing, type PropertyValues, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addAriaProjector } from '#internals/controllers/aria-projection.js';\nimport {\n addKeybindings,\n altKey,\n arrowDown,\n arrowUp,\n escapeKey,\n} from '#internals/controllers/key-bindings.js';\nimport { addRootClickController } from '#internals/controllers/root-click.js';\nimport { convertToDate } from '#internals/date/converters.js';\nimport { coercedProperty } from '#internals/decorators/coerced-property.js';\nimport { IgcComboBoxBaseLikeComponent } from '#internals/mixins/combo-box.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '#internals/mixins/forms/associated-required.js';\nimport { renderSlottedIcon } from '#internals/templates/slotted-icon.js';\nimport { asArray } from '#internals/utils/arrays.js';\nimport {\n addSafeEventListener,\n focusLeftHost,\n getElementFromPath,\n} from '#internals/utils/events.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { equal } from '#internals/utils/objects.js';\nimport type { ThemingController } from '#theming/theming-controller.js';\nimport IgcCalendarComponent, { focusActiveDate } from '../calendar/calendar.js';\nimport {\n createDateConstraints,\n getLocaleWeekStart,\n} from '../calendar/helpers.js';\nimport type {\n CalendarHeaderOrientation,\n CalendarSelection,\n DateRangeDescriptor,\n WeekDays,\n} from '../calendar/types.js';\nimport IgcDialogComponent from '../dialog/dialog.js';\nimport IgcFocusTrapComponent from '../focus-trap/focus-trap.js';\nimport IgcIconComponent from '../icon/icon.js';\nimport IgcPopoverComponent from '../popover/popover.js';\nimport type {\n ContentOrientation,\n DateRangeValue,\n PickerMode,\n} from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\n\n/**\n * The events emitted by a picker driven by a calendar.\n * `T` is the value type of the picker - a single date or a date range.\n */\nexport interface IgcPickerBaseEventMap<T> {\n igcOpening: CustomEvent<void>;\n igcOpened: CustomEvent<void>;\n igcClosing: CustomEvent<void>;\n igcClosed: CustomEvent<void>;\n igcChange: CustomEvent<T | null>;\n igcInput: CustomEvent<T | null>;\n}\n\n/** The parts of the calendar which the pickers re-export to their own consumers. */\nexport const calendarExportParts =\n `header, header-title, header-date, content: calendar-content, navigation, months-navigation,\n years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,\n days-view, months-view, years-view, days-row, months-row, years-row, label: calendar-label,\n label-inner: calendar-label-inner, week-number, week-number-inner, date,\n date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,\n month, month-inner, year, year-inner, selected, current` as const;\n\n/** Stable identity for \"no range\", so that the calendar binding is committed only once. */\nconst emptyValues: Date[] = [];\n\n/** The components rendered by the picker chrome of every picker. */\nexport const pickerDependencies = [\n IgcCalendarComponent,\n IgcDialogComponent,\n IgcFocusTrapComponent,\n IgcIconComponent,\n IgcPopoverComponent,\n IgcValidationContainerComponent,\n];\n\n/**\n * The subset of the slot controller which the base picker queries.\n * Kept structural so that each picker can declare its own set of slot names.\n */\ntype PickerSlots = {\n hasAssignedElements(slot: string): boolean;\n};\n\n/* blazorIndirectRender */\n/* omitModule */\n/**\n * Common behavior for the pickers which drive an `igc-calendar` from an editor -\n * {@link IgcDatePickerComponent} and {@link IgcDateRangePickerComponent}.\n *\n * It owns the calendar and editor facing properties, the open/close plumbing and the\n * picker chrome - calendar, popover/dialog, icons and actions. The value itself, its\n * form state and the editors are left to the concrete pickers.\n */\nexport abstract class IgcDatePickerBaseComponent<\n T extends Date | DateRangeValue,\n> extends FormAssociatedRequiredMixin(\n EventEmitterMixin<\n IgcPickerBaseEventMap<Date | DateRangeValue>,\n AbstractConstructor<IgcComboBoxBaseLikeComponent>\n >(IgcComboBoxBaseLikeComponent)\n) {\n //#region Internal state and properties\n\n protected _oldValue: T | null = null;\n\n protected _activeDate: Date | null = null;\n protected _min: Date | null = null;\n protected _max: Date | null = null;\n protected _dateConstraints: DateRangeDescriptor[] = [];\n protected _displayFormat?: string;\n protected _inputFormat?: string;\n protected _visibleMonths = 1;\n private _weekStart?: WeekDays;\n\n protected override readonly _rootClickController = addRootClickController(\n this,\n { onHide: this._handleClosing }\n );\n\n @query(IgcCalendarComponent.tagName)\n protected readonly _calendar!: IgcCalendarComponent;\n\n @query('#helper-text')\n protected readonly _helperText!: IgcValidationContainerComponent | null;\n\n protected get _isDropDown(): boolean {\n return this.mode === 'dropdown';\n }\n\n protected get _isMaterial(): boolean {\n return this._themes.theme === 'material';\n }\n\n /** Dialog mode is always read-only, the rest depends on the configuration. */\n protected get _isEditorReadOnly(): boolean {\n return !this._isDropDown || this.readOnly || this.nonEditable;\n }\n\n //#endregion\n\n //#region Abstract members\n\n /** The id of the editor the picker is anchored to. */\n protected abstract readonly _inputId: string;\n\n /** The slots of the concrete picker. */\n protected abstract readonly _slots: PickerSlots;\n\n /** The theming controller of the concrete picker. */\n protected abstract readonly _themes: ThemingController;\n\n /**\n * The localization controller of the picker. Only the locale is shared,\n * because the resource strings differ between the pickers.\n */\n protected abstract readonly _i18nController: { locale: string };\n\n /**\n * The current value of the picker. Each picker declares its own public\n * `value`, because the type, the converter and the form state differ.\n */\n protected abstract get _value(): T | null;\n protected abstract set _value(value: T | null);\n\n /** Clears any user input left in the editor(s) of the picker. */\n protected abstract _clearEditors(): void;\n\n /** Whether the picker holds a value. */\n protected abstract get _hasValue(): boolean;\n\n /** The selection mode of the underlying calendar. */\n protected abstract get _calendarSelection(): CalendarSelection;\n\n /** The localized label of the calendar picker. */\n protected abstract get _selectDateLabel(): string | undefined;\n\n /**\n * The editor that gets the ARIA state of the host: the name of the host and\n * `aria-haspopup=\"dialog\"`. Both must reach the native input that assistive\n * technology reads.\n */\n protected abstract get _projectionTarget(): Element | null;\n\n /** Moves focus to the editor of the picker. */\n protected abstract _focusInput(): void;\n\n /** Restores focus to the editor after a value has been selected in the calendar. */\n protected abstract _focusAndSelectInput(): void;\n\n /** The value of the picker for `dates`, which the calendar gives in ascending order. */\n protected abstract _valueFromCalendarSelection(dates: Date[]): T | null;\n\n //#endregion\n\n //#region Overridable hooks\n\n /** The value reflected in the calendar when it is in single selection mode. */\n protected get _calendarValue(): Date | null {\n return null;\n }\n\n /** The values reflected in the calendar when it is in range selection mode. */\n protected get _calendarValues(): Date[] | null {\n return null;\n }\n\n /**\n * The active date for the first render, if the picker holds a value but no\n * active date. The calendar then owns its active date and `activeDate` reads\n * it back, so this is read one time.\n */\n protected get _defaultActiveDate(): Date | null {\n return this._calendarValue;\n }\n\n /** The title of the calendar icon, if the picker provides one. */\n protected get _calendarIconTitle(): string | undefined {\n return undefined;\n }\n\n /** The accessible name of the picker in dialog mode. */\n protected get _dialogLabel(): string | undefined {\n return this._selectDateLabel;\n }\n\n /** The format the editor(s) fall back to when no display format is set. */\n protected get _defaultDisplayFormat(): string | undefined {\n return undefined;\n }\n\n /** The format the editor(s) fall back to when no input format is set. */\n protected get _defaultInputFormat(): string | undefined {\n return undefined;\n }\n\n /** Whether the current calendar selection is complete enough to close the picker. */\n protected _canCloseOnSelect(): boolean {\n return true;\n }\n\n /** Invoked when the picker is dismissed through the Escape key. */\n protected _handleDismiss(): void {}\n\n /** Invoked when focus has left the picker for good. */\n protected _onBlur(): void {}\n\n /** Invoked when the dialog of the picker is closing, before the picker is hidden. */\n protected _onDialogClosing(): void {}\n\n /** Invoked when the picker is toggled, before the update is awaited. */\n protected _syncCalendarOnToggle(): void {}\n\n /** Whether a selection made in the calendar commits the value of the picker right away. */\n protected _commitsCalendarSelection(): boolean {\n return true;\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /**\n * Determines whether the calendar is opened in a dropdown or a modal dialog.\n * @attr mode\n * @default dropdown\n */\n @property()\n public mode: PickerMode = 'dropdown';\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /**\n * Whether to allow typing in the input.\n * @attr non-editable\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'non-editable' })\n public nonEditable = false;\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n * @default false\n */\n @property({ type: Boolean, reflect: true })\n public outlined = false;\n\n /**\n * The label of the picker.\n * @attr label\n */\n @property()\n public label!: string;\n\n /**\n * The prompt symbol to use for unfilled parts of the mask.\n * @attr\n * @default _\n */\n @property()\n public prompt = '_';\n\n /**\n * Format to display the value in when not editing.\n * Defaults to the locale format if not set.\n * @attr display-format\n */\n @property({ attribute: 'display-format' })\n public set displayFormat(value: string) {\n this._displayFormat = value;\n }\n\n public get displayFormat(): string {\n return (this._displayFormat ?? this._defaultDisplayFormat)!;\n }\n\n /**\n * The date format to apply on the input.\n * Defaults to the current locale Intl.DateTimeFormat\n * @attr input-format\n */\n @property({ attribute: 'input-format' })\n public set inputFormat(value: string) {\n this._inputFormat = value;\n }\n\n public get inputFormat(): string {\n return (this._inputFormat ?? this._defaultInputFormat)!;\n }\n\n /**\n * The locale used to format the display value and to resolve the\n * component's resource strings. 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 minimum value required for the picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set min(value: Date | string | null | undefined) {\n this._min = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get min(): Date | null {\n return this._min;\n }\n\n /**\n * The maximum value required for the picker to remain valid.\n * @attr\n */\n @property({ converter: convertToDate })\n public set max(value: Date | string | null | undefined) {\n this._max = convertToDate(value);\n this._setDateConstraints();\n this._validate();\n }\n\n public get max(): Date | null {\n return this._max;\n }\n\n /** Gets/sets disabled dates. */\n @property({ attribute: false })\n @coercedProperty<DateRangeDescriptor[], IgcDatePickerBaseComponent<T>>({\n onChange: ({ host }) => {\n host._setDateConstraints();\n host._validate();\n },\n })\n public disabledDates: DateRangeDescriptor[] = [];\n\n /** Gets/sets special dates. */\n @property({ attribute: false })\n public specialDates!: DateRangeDescriptor[];\n\n /**\n * Gets/Sets the date which is shown in the calendar picker and is highlighted.\n * By default it is the current date.\n */\n @property({ attribute: 'active-date', converter: convertToDate })\n public set activeDate(value: Date | string | null | undefined) {\n this._activeDate = convertToDate(value);\n }\n\n public get activeDate(): Date {\n return this._activeDate ?? this._calendar?.activeDate;\n }\n\n /**\n * The number of months displayed in the calendar.\n * @attr visible-months\n * @default 1\n */\n @property({ type: Number, attribute: 'visible-months' })\n public set visibleMonths(value: number) {\n this._visibleMonths = value;\n }\n\n public get visibleMonths(): number {\n return this._visibleMonths;\n }\n\n /**\n * The orientation of the calendar header.\n * @attr header-orientation\n * @default horizontal\n */\n @property({ attribute: 'header-orientation', reflect: true })\n public headerOrientation: CalendarHeaderOrientation = 'horizontal';\n\n /**\n * The orientation of the multiple months displayed in the calendar's days view.\n * @attr\n * @default horizontal\n */\n @property()\n public orientation: ContentOrientation = 'horizontal';\n\n /**\n * Determines whether the calendar hides its header.\n * @attr hide-header\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-header' })\n public hideHeader = false;\n\n /**\n * Controls the visibility of the dates that do not belong to the current month.\n * @attr hide-outside-days\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-outside-days' })\n public hideOutsideDays = false;\n\n /**\n * Whether to show the number of the week in the calendar.\n * @attr show-week-numbers\n * @default false\n */\n @property({ type: Boolean, reflect: true, attribute: 'show-week-numbers' })\n public showWeekNumbers = false;\n\n /**\n * Sets the start day of the week for the calendar.\n *\n * @remarks\n * When not set, the week starts on the first day of the week of the current {@link locale}.\n * Setting `undefined` returns to the locale value.\n * @attr week-start\n */\n @property({ attribute: 'week-start' })\n public set weekStart(value: WeekDays | undefined) {\n this._weekStart = value ?? undefined;\n }\n\n public get weekStart(): WeekDays {\n return this._weekStart ?? getLocaleWeekStart(this.locale);\n }\n\n //#endregion\n\n //#region Life-cycle hooks\n\n constructor() {\n super();\n\n // Projects the name and the popup semantics of the host onto the native\n // input of the editor. See ProjectedARIA.\n addAriaProjector(this, {\n target: () => this._projectionTarget,\n state: () => ({\n hasPopup: 'dialog',\n describedBy: this._helperText ? [this._helperText] : null,\n }),\n hasOwnLabel: () => Boolean(this.label),\n });\n\n addSafeEventListener(this, 'focusout', this._handleFocusOut);\n\n addKeybindings(this, {\n skip: () => this.disabled || this.readOnly,\n })\n .set([altKey, arrowDown], this._handleAnchorClick)\n .set([altKey, arrowUp], this._onEscapeKey)\n .set(escapeKey, this._onEscapeKey);\n }\n\n protected override willUpdate(changedProperties: PropertyValues<this>): void {\n super.willUpdate(changedProperties);\n\n if (changedProperties.has('open')) {\n this._rootClickController.update();\n\n if (this.open) {\n this._oldValue = this._value;\n }\n }\n }\n\n //#endregion\n\n //#region Internal API\n\n protected _setDateConstraints(): void {\n this._dateConstraints =\n createDateConstraints(this._min, this._max, this.disabledDates) ?? [];\n }\n\n protected async _shouldCloseCalendarDropdown(): Promise<void> {\n if (this.keepOpenOnSelect || !this._canCloseOnSelect()) {\n return;\n }\n\n if (await this._hide(true)) {\n this._focusAndSelectInput();\n }\n }\n\n /**\n * Points the calendar at the first defined date of `dates`, and keeps the\n * current active date if there is none. Does nothing before the calendar\n * renders.\n */\n protected _setCalendarActiveDate(\n ...dates: (Date | null | undefined)[]\n ): void {\n if (this._calendar) {\n this._calendar.activeDate =\n dates.find(Boolean) ?? this._calendar.activeDate;\n }\n }\n\n /**\n * Writes the value of the picker back onto the calendar. A read-only picker\n * must do this itself, because the binding has nothing to commit again.\n */\n protected async _restoreCalendarSelection(): Promise<void> {\n await this._calendar.updateComplete;\n\n if (this._calendarSelection === 'single') {\n this._calendar.value = this._calendarValue;\n } else {\n this._calendar.values = this._calendarValues ?? emptyValues;\n }\n }\n\n /** Emits `igcChange` if the value has moved away from the last committed one. */\n protected _emitChangeIfDirty(): void {\n if (!equal(this._value, this._oldValue)) {\n this.emitEvent('igcChange', { detail: this._value });\n this._oldValue = this._value;\n }\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Clears the editor(s) of the picker of any user input. */\n public clear(): void {\n this._oldValue = this._value;\n this._value = null;\n this._clearEditors();\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected async _onEscapeKey(): Promise<void> {\n if (await this._hide(true)) {\n this._handleDismiss();\n this._focusInput();\n }\n }\n\n protected override async _handleAnchorClick(): Promise<void> {\n super._handleAnchorClick();\n this._syncCalendarOnToggle();\n await this.updateComplete;\n this._calendar[focusActiveDate]({ preventScroll: true });\n }\n\n protected _handleInputClick(event: Event): void {\n if (getElementFromPath('input', event)) {\n // Open only if the click originates from the underlying input\n this._handleAnchorClick();\n }\n }\n\n protected _handleCalendarIconSlotPointerDown(event: PointerEvent): void {\n // Keeps the `delegatesFocus` of the host from focusing the editor, which would enter\n // an invalid state on blur as focus moves on to the calendar.\n event.preventDefault();\n }\n\n protected _handleFocusOut(event: FocusEvent): void {\n if (focusLeftHost(this, event)) {\n this._handleBlur();\n this._onBlur();\n }\n }\n\n protected _handleClosing(): void {\n this._hide(true);\n }\n\n protected async _handleCalendarChangeEvent(\n event: CustomEvent<Date | Date[]>\n ): Promise<void> {\n event.stopPropagation();\n this._setTouchedState();\n\n if (this.readOnly) {\n await this._restoreCalendarSelection();\n return;\n }\n\n this._value = this._valueFromCalendarSelection(asArray(event.detail));\n\n if (this._commitsCalendarSelection()) {\n this.emitEvent('igcChange', { detail: this._value });\n }\n\n this._shouldCloseCalendarDropdown();\n }\n\n protected _handleDialogClosing(event: Event): void {\n event.stopPropagation();\n this._onDialogClosing();\n this._hide(true);\n }\n\n protected _handleDialogClosed(event: Event): void {\n event.stopPropagation();\n }\n\n //#endregion\n\n //#region Rendering\n\n protected _renderClearIcon(part = 'clear-icon') {\n return this._hasValue\n ? html`\n <span\n slot=\"suffix\"\n part=${part}\n @click=${bindIf(!this.readOnly, this.clear)}\n >\n ${renderSlottedIcon({ slot: part, icon: 'input_clear' })}\n </span>\n `\n : nothing;\n }\n\n protected _renderCalendarIcon(suffix = '') {\n const part = `${this.open ? 'calendar-icon-open' : 'calendar-icon'}${suffix}`;\n\n return html`\n <span\n slot=\"prefix\"\n part=${part}\n @pointerdown=${this._handleCalendarIconSlotPointerDown}\n @click=${bindIf(!this.readOnly, this._handleAnchorClick)}\n >\n ${renderSlottedIcon({\n slot: part,\n icon: 'today',\n title: this._calendarIconTitle,\n })}\n </span>\n `;\n }\n\n /**\n * The content for an editor of the picker: its icons and its prefix and\n * suffix slots. The suffix identifies the editor if the picker renders more\n * than one, for example `-start` and `-end`.\n */\n protected _renderEditorSlots(suffix = '') {\n const prefixSlot = `prefix${suffix}`;\n const suffixSlot = `suffix${suffix}`;\n\n return html`\n ${this._renderCalendarIcon(suffix)}\n <slot\n name=${prefixSlot}\n slot=${bindIf(this._slots.hasAssignedElements(prefixSlot), 'prefix')}\n ></slot>\n ${this._renderClearIcon(`clear-icon${suffix}`)}\n <slot\n name=${suffixSlot}\n slot=${bindIf(this._slots.hasAssignedElements(suffixSlot), 'suffix')}\n ></slot>\n `;\n }\n\n protected _renderCalendarSlots() {\n if (this._isDropDown) {\n return nothing;\n }\n\n const hasHeaderDate = this._slots.hasAssignedElements('header-date');\n\n return html`\n <slot name=\"title\" slot=\"title\">${this._selectDateLabel}</slot>\n <slot\n name=\"header-date\"\n slot=${bindIf(hasHeaderDate, 'header-date')}\n ></slot>\n `;\n }\n\n protected _renderCalendar(id: string) {\n const hideHeader = this._isDropDown || this.hideHeader;\n const isInert = !this.open || this.disabled;\n\n return html`\n <igc-calendar\n aria-labelledby=${id}\n role=\"dialog\"\n selection=${this._calendarSelection}\n .inert=${isInert}\n ?show-week-numbers=${this.showWeekNumbers}\n ?hide-outside-days=${this.hideOutsideDays}\n ?hide-header=${hideHeader}\n .activeDate=${this.activeDate ?? this._defaultActiveDate}\n .value=${this._calendarValue}\n .values=${this._calendarValues ?? emptyValues}\n .headerOrientation=${this.headerOrientation}\n .orientation=${this.orientation}\n .visibleMonths=${this._visibleMonths}\n .locale=${this.locale}\n .disabledDates=${this._dateConstraints}\n .specialDates=${this.specialDates}\n .weekStart=${this.weekStart}\n @igcChange=${this._handleCalendarChangeEvent}\n exportparts=${calendarExportParts}\n >\n ${this._renderCalendarSlots()}\n </igc-calendar>\n `;\n }\n\n protected _renderActions() {\n const hasActions = this._slots.hasAssignedElements('actions');\n\n // If in dialog mode use the dialog footer slot\n return html`\n <div\n part=\"actions\"\n ?hidden=${!hasActions}\n slot=${bindIf(!this._isDropDown && hasActions, 'footer')}\n >\n <slot name=\"actions\"></slot>\n </div>\n `;\n }\n\n /** The content rendered inside the popover/dialog of the picker. */\n protected _renderPickerContent(id: string) {\n return html`${this._renderCalendar(id)}${this._renderActions()}`;\n }\n\n /** Additional content rendered in the dialog of the picker. */\n protected _renderDialogFooter(): TemplateResult | typeof nothing {\n return nothing;\n }\n\n protected _renderPicker(id: string) {\n const isDisabled = !this.open || this.disabled;\n\n return this._isDropDown\n ? html`\n <igc-popover\n ?open=${this.open}\n anchor=${id}\n flip\n .scrollStrategy=${this.scrollStrategy}\n @igcPopoverScrollClose=${this._handleClosing}\n >\n <igc-focus-trap ?disabled=${isDisabled}>\n ${this._renderPickerContent(id)}\n </igc-focus-trap>\n </igc-popover>\n `\n : html`\n <igc-dialog\n aria-label=${ifDefined(this._dialogLabel)}\n role=\"dialog\"\n ?open=${this.open}\n ?close-on-outside-click=${!this.keepOpenOnOutsideClick}\n hide-default-action\n @igcClosing=${this._handleDialogClosing}\n @igcClosed=${this._handleDialogClosed}\n exportparts=\"base: dialog-base, title, footer, overlay\"\n >\n ${this._renderPickerContent(id)}${this._renderDialogFooter()}\n </igc-dialog>\n `;\n }\n\n //#endregion\n}\n"]}
|
|
@@ -93,7 +93,7 @@ export default class IgcDatePickerComponent extends IgcDatePickerComponent_base
|
|
|
93
93
|
protected get __validators(): import("../../internals/validators.js").Validator<IgcDatePickerComponent>[];
|
|
94
94
|
protected readonly _inputId: string;
|
|
95
95
|
protected readonly _themes: import("#theming/theming-controller.js").ThemingController;
|
|
96
|
-
protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "title" | "prefix" | "
|
|
96
|
+
protected readonly _slots: import("#internals/controllers/slot.js").SlotController<"invalid" | "title" | "prefix" | "[default]" | "actions" | "suffix" | "helper-text" | "value-missing" | "range-overflow" | "range-underflow" | "custom-error" | "clear-icon" | "calendar-icon-open" | "calendar-icon" | "header-date" | "bad-input">;
|
|
97
97
|
/**
|
|
98
98
|
* For now we use the core validation strings internally only, to avoid mixing with old resources by users.
|
|
99
99
|
* To Do: Update resourceStrings type when the IgcCalendarResourceStrings is changed to ICalendarResourceStrings
|
|
@@ -15,6 +15,7 @@ import { blazorAdditionalDependencies } from '#internals/decorators/blazorAdditi
|
|
|
15
15
|
import { shadowOptions } from '#internals/decorators/shadow-options.js';
|
|
16
16
|
import { registerComponent } from '#internals/definitions/register.js';
|
|
17
17
|
import { addI18nController, getDateTimeFormat, } from '#internals/i18n/i18n-controller.js';
|
|
18
|
+
import { datePickerResourcesMap } from '#internals/i18n/utils.js';
|
|
18
19
|
import { EventEmitterMixin } from '#internals/mixins/event-emitter.js';
|
|
19
20
|
import { FormValueDateTimeTransformers } from '#internals/mixins/forms/form-transformers.js';
|
|
20
21
|
import { createFormValueState } from '#internals/mixins/forms/form-value.js';
|
|
@@ -23,6 +24,7 @@ import { bindIf } from '#internals/utils/lit.js';
|
|
|
23
24
|
import { createIdGenerator } from '#internals/utils/strings.js';
|
|
24
25
|
import { addThemingController } from '#theming/theming-controller.js';
|
|
25
26
|
import IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';
|
|
27
|
+
import IgcValidationContainerComponent from '../validation-container/validation-container.js';
|
|
26
28
|
import { IgcDatePickerBaseComponent, pickerDependencies, } from './date-picker.base.js';
|
|
27
29
|
import { styles } from './themes/date-picker.base.css.js';
|
|
28
30
|
import { styles as shared } from './themes/shared/date-picker.common.css.js';
|
|
@@ -40,7 +42,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends EventEmitterMi
|
|
|
40
42
|
});
|
|
41
43
|
this._i18nController = addI18nController(this, {
|
|
42
44
|
defaultEN: Object.assign({}, DatePickerResourceStringsEN, CalendarResourceStringsEN),
|
|
43
|
-
|
|
45
|
+
resourceMap: datePickerResourcesMap,
|
|
44
46
|
});
|
|
45
47
|
this._formValue = createFormValueState(this, {
|
|
46
48
|
initialValue: null,
|
|
@@ -200,7 +202,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends EventEmitterMi
|
|
|
200
202
|
@igcInput=${this._handleInputEvent}
|
|
201
203
|
@keydown=${this._handleEnterKeydown}
|
|
202
204
|
@click=${bindIf(hasClickHandler, this._handleInputClick)}
|
|
203
|
-
exportparts="input, label, prefix, suffix"
|
|
205
|
+
exportparts="container, input, label, prefix, suffix"
|
|
204
206
|
>
|
|
205
207
|
${this._renderEditorSlots()}
|
|
206
208
|
</igc-date-time-input>
|
|
@@ -211,7 +213,7 @@ let IgcDatePickerComponent = class IgcDatePickerComponent extends EventEmitterMi
|
|
|
211
213
|
return html `
|
|
212
214
|
${this._isMaterial ? nothing : this._renderLabel(id)}
|
|
213
215
|
${this._renderInput(id)} ${this._renderPicker(id)}
|
|
214
|
-
${
|
|
216
|
+
${IgcValidationContainerComponent.create(this)}
|
|
215
217
|
`;
|
|
216
218
|
}
|
|
217
219
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAG5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,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1B,MAAM,CAAC,eAAe,EAAE,IAAI,CAAC,iBAAiB,CAAC;;;UAGtD,IAAI,CAAC,kBAAkB,EAAE;;KAE9B,CAAC;IACJ,CAAC;IAEkB,MAAM;QACvB,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC;QAEpC,OAAO,IAAI,CAAA;QACP,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/C,IAAI,CAAC,0BAA0B,EAAE;KACpC,CAAC;IACJ,CAAC;;AAtRgB;IADhB,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC;sDACW;AAuGpD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;mDAGtC;AAWM;IADN,QAAQ,EAAE;2DACiB;AAM5B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6DAK9B;AA/KkB,sBAAsB;IAJ1C,4BAA4B,CAC3B,uFAAuF,CACxF;IACA,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GACnB,sBAAsB,CA0U1C;eA1UoB,sBAAsB","sourcesContent":["import {\n CalendarResourceStringsEN,\n DatePickerResourceStringsEN,\n type ICalendarResourceStrings,\n type IDatePickerResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, nothing, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { convertToDate } from '#internals/date/converters.js';\nimport { blazorAdditionalDependencies } from '#internals/decorators/blazorAdditionalDependencies.js';\nimport { shadowOptions } from '#internals/decorators/shadow-options.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { IgcCalendarResourceStrings } from '#internals/i18n/EN/calendar.resources.js';\nimport {\n addI18nController,\n getDateTimeFormat,\n} from '#internals/i18n/i18n-controller.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormValueDateTimeTransformers } from '#internals/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { firstOf } from '#internals/utils/arrays.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type { CalendarSelection } from '../calendar/types.js';\nimport type { DatePart } from '../date-time-input/date-part.js';\nimport IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';\nimport type { RangeTextSelectMode, SelectionRangeDirection } from '../types.js';\nimport {\n IgcDatePickerBaseComponent,\n type IgcPickerBaseEventMap,\n pickerDependencies,\n} from './date-picker.base.js';\nimport { styles } from './themes/date-picker.base.css.js';\nimport { styles as shared } from './themes/shared/date-picker.common.css.js';\nimport { all } from './themes/themes.js';\nimport { datePickerValidators } from './validators.js';\n\nexport type IgcDatePickerComponentEventMap = IgcPickerBaseEventMap<Date>;\n\nconst nextId = createIdGenerator('date-picker');\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'bad-input',\n 'value-missing',\n 'range-overflow',\n 'range-underflow',\n 'custom-error',\n 'invalid',\n 'title',\n 'header-date',\n 'clear-icon',\n 'calendar-icon',\n 'calendar-icon-open',\n 'actions'\n);\ntype DatePickerResourceStringsType = IDatePickerResourceStrings &\n ICalendarResourceStrings;\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * The date picker is a feature rich component used for entering a date through manual text input or\n * choosing date values from a calendar dialog that pops up.\n *\n * @element igc-date-picker\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after the input.\n * @slot helper-text - Renders content below the input.\n * @slot bad-input - Renders content when the value is in the disabledDates ranges.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n * @slot title - Renders content in the calendar title.\n * @slot header-date - Renders content instead of the current date/range in the calendar header.\n * @slot clear-icon - Renders a clear icon template.\n * @slot calendar-icon - Renders the icon/content for the calendar picker.\n * @slot calendar-icon-open - Renders the icon/content for the picker in open state.\n * @slot actions - Renders content in the action part of the picker in open state.\n *\n * @fires igcOpening - Emitted just before the calendar popover is shown.\n * @fires igcOpened - Emitted after the calendar popover is shown.\n * @fires igcClosing - Emitted just before the calendar popover is hidden.\n * @fires igcClosed - Emitted after the calendar popover is hidden.\n * @fires igcChange - Emitted when the user modifies and commits the elements's value.\n * @fires igcInput - Emitted when when the user types in the element.\n *\n * @csspart label - The label wrapper that renders content above the target input.\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart calendar-icon - The calendar icon wrapper for closed state.\n * @csspart calendar-icon-open - The calendar icon wrapper for opened state.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart actions - The actions wrapper.\n * @csspart helper-text - The helper-text wrapper that renders content below the target input.\n * @csspart header - The calendar header element.\n * @csspart header-title - The calendar header title element.\n * @csspart header-date - The calendar header date element.\n * @csspart calendar-content - The calendar content element which contains the views and navigation elements.\n * @csspart navigation - The calendar navigation container element.\n * @csspart months-navigation - The calendar months navigation button element.\n * @csspart years-navigation - The calendar years navigation button element.\n * @csspart years-range - The calendar years range element.\n * @csspart navigation-buttons - The calendar navigation buttons container.\n * @csspart navigation-button - The calendar previous/next navigation button.\n * @csspart days-view-container - The calendar days view container element.\n * @csspart days-view - The calendar days view element.\n * @csspart months-view - The calendar months view element.\n * @csspart years-view - The calendar years view element.\n * @csspart days-row - The calendar days row element.\n * @csspart calendar-label - The calendar week header label element.\n * @csspart week-number - The calendar week number element.\n * @csspart week-number-inner - The calendar week number inner element.\n * @csspart date - The calendar date element.\n * @csspart date-inner - The calendar date inner element.\n * @csspart first - The calendar first selected date element in range selection.\n * @csspart last - The calendar last selected date element in range selection.\n * @csspart inactive - The calendar inactive date element.\n * @csspart hidden - The calendar hidden date element.\n * @csspart weekend - The calendar weekend date element.\n * @csspart range - The calendar range selected element.\n * @csspart special - The calendar special date element.\n * @csspart disabled - The calendar disabled date element.\n * @csspart single - The calendar single selected date element.\n * @csspart preview - The calendar range selection preview date element.\n * @csspart month - The calendar month element.\n * @csspart month-inner - The calendar month inner element.\n * @csspart year - The calendar year element.\n * @csspart year-inner - The calendar year inner element.\n * @csspart selected - The calendar selected state for element(s). Applies to date, month and year elements.\n * @csspart current - The calendar current state for element(s). Applies to date, month and year elements.\n */\n@blazorAdditionalDependencies(\n 'IgcCalendarComponent, IgcDateTimeInputComponent, IgcDialogComponent, IgcIconComponent'\n)\n@shadowOptions({ delegatesFocus: true })\nexport default class IgcDatePickerComponent extends EventEmitterMixin<\n IgcDatePickerComponentEventMap,\n AbstractConstructor<IgcDatePickerBaseComponent<Date>>\n>(IgcDatePickerBaseComponent) {\n public static readonly tagName = 'igc-date-picker';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcDatePickerComponent,\n IgcDateTimeInputComponent,\n ...pickerDependencies\n );\n }\n\n //#region Private properties and state\n\n protected override get __validators() {\n return datePickerValidators;\n }\n\n protected override readonly _inputId = nextId();\n protected override readonly _themes = addThemingController(this, all);\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n /**\n * For now we use the core validation strings internally only, to avoid mixing with old resources by users.\n * To Do: Update resourceStrings type when the IgcCalendarResourceStrings is changed to ICalendarResourceStrings\n */\n protected override readonly _i18nController = addI18nController<\n IgcCalendarResourceStrings | DatePickerResourceStringsType\n >(this, {\n defaultEN: Object.assign(\n {},\n DatePickerResourceStringsEN,\n CalendarResourceStringsEN\n ),\n resourceMapName: 'date-picker',\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueDateTimeTransformers,\n });\n\n @query(IgcDateTimeInputComponent.tagName)\n private readonly _input!: IgcDateTimeInputComponent;\n\n //#endregion\n\n //#region Base class hooks\n\n protected override get _value(): Date | null {\n return this.value;\n }\n\n protected override set _value(value: Date | null) {\n this.value = value;\n }\n\n protected override get _hasValue(): boolean {\n return this.value !== null;\n }\n\n protected override get _calendarSelection(): CalendarSelection {\n return 'single';\n }\n\n protected override get _calendarValue(): Date | null {\n return this.value;\n }\n\n protected override get _selectDateLabel(): string | undefined {\n return this.resourceStrings.calendar_select_date;\n }\n\n protected override get _calendarIconTitle(): string | undefined {\n return this.value\n ? this.resourceStrings.date_picker_change_date\n : this.resourceStrings.date_picker_choose_date;\n }\n\n protected override get _dialogLabel(): string | undefined {\n return this._calendarIconTitle;\n }\n\n protected override get _defaultDisplayFormat(): string | undefined {\n return this._input?.displayFormat;\n }\n\n protected override get _defaultInputFormat(): string | undefined {\n return this._input?.inputFormat;\n }\n\n protected override get _projectionTarget() {\n return this._input ?? null;\n }\n\n protected override _focusInput(): void {\n this._input.focus();\n }\n\n protected override _focusAndSelectInput(): void {\n this._input.focus();\n this._input.select();\n }\n\n protected override _syncCalendarOnToggle(): void {\n this._setCalendarActiveDate(this.value);\n }\n\n protected override _clearEditors(): void {\n this._input?.clear();\n }\n\n protected override _valueFromCalendarSelection(dates: Date[]): Date | null {\n return firstOf(dates) ?? null;\n }\n\n /**\n * A committed edit in the input already emits `igcChange` on its own, so only a\n * value which the picker itself has changed is left to notify about here.\n */\n protected override _onBlur(): void {\n if (this._isEditorReadOnly) {\n this._emitChangeIfDirty();\n }\n }\n\n protected override _onDialogClosing(): void {\n this._oldValue = this.value;\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the picker.\n *\n * Only ever holds a committed value. While the user is typing in the input, the\n * intermediate state stays in the editor and is committed - together with an\n * `igcChange` event - when the edit is committed on blur. Use the `igcInput` event\n * to observe the value as it is being typed.\n *\n * @attr\n */\n @property({ converter: convertToDate })\n public set value(value: Date | string | null | undefined) {\n this._formValue.setValueAndFormState(value as Date | null);\n }\n\n public get value(): Date | null {\n return this._formValue.value;\n }\n\n /**\n * The placeholder text of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(\n value: IgcCalendarResourceStrings | DatePickerResourceStringsType\n ) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IgcCalendarResourceStrings &\n DatePickerResourceStringsType {\n return this._i18nController.resourceStrings;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleInputChangeEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._commitValue(\n (event.target as IgcDateTimeInputComponent).value,\n 'igcChange'\n );\n }\n\n protected _handleInputEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.nonEditable) {\n event.preventDefault();\n return;\n }\n\n const draft = (event.target as IgcDateTimeInputComponent)._uncommittedValue;\n\n this._calendar.activeDate = draft ?? this._calendar.activeDate;\n this.emitEvent('igcInput', { detail: draft });\n }\n\n //#endregion\n\n //#region Form associated overrides\n\n protected override formResetCallback(): void {\n super.formResetCallback();\n\n // The inner editor is not associated with the outer form (shadow\n // boundary), so the browser never resets it. Since it runs its own\n // constraint validation against the forwarded `required`/`min`/`max`,\n // a touched editor would otherwise keep its invalid styles after the\n // form reset.\n this._input?.['formResetCallback']();\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Increments the passed in date part */\n public stepUp(datePart?: DatePart, delta?: number): void {\n this._input.stepUp(datePart, delta);\n }\n\n /** Decrements the passed in date part */\n public stepDown(datePart?: DatePart, delta?: number): void {\n this._input.stepDown(datePart, delta);\n }\n\n /** Selects the text in the input of the component */\n public select(): void {\n this._input.select();\n }\n\n /* blazorSuppress */\n /** Sets the text selection range in the input of the component */\n public setSelectionRange(\n start: number,\n end: number,\n direction?: SelectionRangeDirection\n ): void {\n this._input.setSelectionRange(start, end, direction);\n }\n\n /* blazorSuppress */\n /* Replaces the selected text in the input and re-applies the mask */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n mode?: RangeTextSelectMode\n ): void {\n this._input.setRangeText(replacement, start, end, mode);\n this.value = this._input.value;\n }\n\n //#endregion\n\n //#region Render methods\n\n private _renderLabel(id: string) {\n const isDisabled = this._isDropDown || this.readOnly;\n\n return this.label\n ? html`\n <label\n part=\"label\"\n for=${id}\n @click=${bindIf(!isDisabled, this._handleAnchorClick)}\n >\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n protected _renderInput(id: string) {\n const format = getDateTimeFormat(this._displayFormat);\n const hasClickHandler = !(this._isDropDown || this.readOnly);\n\n return html`\n <igc-date-time-input\n id=${id}\n label=${bindIf(this._isMaterial, this.label)}\n input-format=${ifDefined(this._inputFormat)}\n display-format=${ifDefined(format)}\n ?disabled=${this.disabled}\n ?readonly=${this._isEditorReadOnly}\n ?required=${this.required}\n .value=${this.value}\n .locale=${this.locale}\n .prompt=${this.prompt}\n .outlined=${this.outlined}\n .placeholder=${this.placeholder}\n .min=${this.min}\n .max=${this.max}\n .invalid=${this.invalid}\n @igcChange=${this._handleInputChangeEvent}\n @igcInput=${this._handleInputEvent}\n @keydown=${this._handleEnterKeydown}\n @click=${bindIf(hasClickHandler, this._handleInputClick)}\n exportparts=\"input, label, prefix, suffix\"\n >\n ${this._renderEditorSlots()}\n </igc-date-time-input>\n `;\n }\n\n protected override render(): TemplateResult {\n const id = this.id || this._inputId;\n\n return html`\n ${this._isMaterial ? nothing : this._renderLabel(id)}\n ${this._renderInput(id)} ${this._renderPicker(id)}\n ${this._renderValidationContainer()}\n `;\n }\n\n //#endregion\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-date-picker': IgcDatePickerComponent;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"date-picker.js","sourceRoot":"","sources":["../../../src/components/date-picker/date-picker.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EACL,yBAAyB,EACzB,2BAA2B,GAG5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,uDAAuD,CAAC;AACrG,OAAO,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AACxE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAEvE,OAAO,EACL,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8CAA8C,CAAC;AAC7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,yBAAyB,MAAM,uCAAuC,CAAC;AAE9E,OAAO,+BAA+B,MAA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,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAClD,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QAC/C,+BAA+B,CAAC,MAAM,CAAC,IAAI,CAAC;KAC/C,CAAC;IACJ,CAAC;;AArRgB;IADhB,KAAK,CAAC,yBAAyB,CAAC,OAAO,CAAC;sDACW;AAuGpD;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;mDAGtC;AAWM;IADN,QAAQ,EAAE;2DACiB;AAM5B;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;6DAK9B;AA/KkB,sBAAsB;IAJ1C,4BAA4B,CAC3B,uFAAuF,CACxF;IACA,aAAa,CAAC,EAAE,cAAc,EAAE,IAAI,EAAE,CAAC;GACnB,sBAAsB,CAyU1C;eAzUoB,sBAAsB","sourcesContent":["import {\n CalendarResourceStringsEN,\n DatePickerResourceStringsEN,\n type ICalendarResourceStrings,\n type IDatePickerResourceStrings,\n} from 'igniteui-i18n-core';\nimport { html, nothing, type TemplateResult } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { addSlotController, setSlots } from '#internals/controllers/slot.js';\nimport { convertToDate } from '#internals/date/converters.js';\nimport { blazorAdditionalDependencies } from '#internals/decorators/blazorAdditionalDependencies.js';\nimport { shadowOptions } from '#internals/decorators/shadow-options.js';\nimport { registerComponent } from '#internals/definitions/register.js';\nimport type { IgcCalendarResourceStrings } from '#internals/i18n/EN/calendar.resources.js';\nimport {\n addI18nController,\n getDateTimeFormat,\n} from '#internals/i18n/i18n-controller.js';\nimport { datePickerResourcesMap } from '#internals/i18n/utils.js';\nimport type { AbstractConstructor } from '#internals/mixins/constructor.js';\nimport { EventEmitterMixin } from '#internals/mixins/event-emitter.js';\nimport { FormValueDateTimeTransformers } from '#internals/mixins/forms/form-transformers.js';\nimport { createFormValueState } from '#internals/mixins/forms/form-value.js';\nimport { firstOf } from '#internals/utils/arrays.js';\nimport { bindIf } from '#internals/utils/lit.js';\nimport { createIdGenerator } from '#internals/utils/strings.js';\nimport { addThemingController } from '#theming/theming-controller.js';\nimport type { CalendarSelection } from '../calendar/types.js';\nimport type { DatePart } from '../date-time-input/date-part.js';\nimport IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';\nimport type { RangeTextSelectMode, SelectionRangeDirection } from '../types.js';\nimport IgcValidationContainerComponent from '../validation-container/validation-container.js';\nimport {\n IgcDatePickerBaseComponent,\n type IgcPickerBaseEventMap,\n pickerDependencies,\n} from './date-picker.base.js';\nimport { styles } from './themes/date-picker.base.css.js';\nimport { styles as shared } from './themes/shared/date-picker.common.css.js';\nimport { all } from './themes/themes.js';\nimport { datePickerValidators } from './validators.js';\n\nexport type IgcDatePickerComponentEventMap = IgcPickerBaseEventMap<Date>;\n\nconst nextId = createIdGenerator('date-picker');\nconst Slots = setSlots(\n 'prefix',\n 'suffix',\n 'helper-text',\n 'bad-input',\n 'value-missing',\n 'range-overflow',\n 'range-underflow',\n 'custom-error',\n 'invalid',\n 'title',\n 'header-date',\n 'clear-icon',\n 'calendar-icon',\n 'calendar-icon-open',\n 'actions'\n);\ntype DatePickerResourceStringsType = IDatePickerResourceStrings &\n ICalendarResourceStrings;\n\n/* blazorIndirectRender */\n/* blazorSupportsVisualChildren */\n/**\n * The date picker is a feature rich component used for entering a date through manual text input or\n * choosing date values from a calendar dialog that pops up.\n *\n * @element igc-date-picker\n *\n * @slot prefix - Renders content before the input.\n * @slot suffix - Renders content after the input.\n * @slot helper-text - Renders content below the input.\n * @slot bad-input - Renders content when the value is in the disabledDates ranges.\n * @slot value-missing - Renders content when the required validation fails.\n * @slot range-overflow - Renders content when the max validation fails.\n * @slot range-underflow - Renders content when the min validation fails.\n * @slot custom-error - Renders content when setCustomValidity(message) is set.\n * @slot invalid - Renders content when the component is in invalid state (validity.valid = false).\n * @slot title - Renders content in the calendar title.\n * @slot header-date - Renders content instead of the current date/range in the calendar header.\n * @slot clear-icon - Renders a clear icon template.\n * @slot calendar-icon - Renders the icon/content for the calendar picker.\n * @slot calendar-icon-open - Renders the icon/content for the picker in open state.\n * @slot actions - Renders content in the action part of the picker in open state.\n *\n * @fires igcOpening - Emitted just before the calendar popover is shown.\n * @fires igcOpened - Emitted after the calendar popover is shown.\n * @fires igcClosing - Emitted just before the calendar popover is hidden.\n * @fires igcClosed - Emitted after the calendar popover is hidden.\n * @fires igcChange - Emitted when the user modifies and commits the elements's value.\n * @fires igcInput - Emitted when when the user types in the element.\n *\n * @csspart label - The label wrapper that renders content above the target input.\n * @csspart container - The main wrapper that holds all main input elements.\n * @csspart input - The native input element.\n * @csspart prefix - The prefix wrapper.\n * @csspart suffix - The suffix wrapper.\n * @csspart calendar-icon - The calendar icon wrapper for closed state.\n * @csspart calendar-icon-open - The calendar icon wrapper for opened state.\n * @csspart clear-icon - The clear icon wrapper.\n * @csspart actions - The actions wrapper.\n * @csspart helper-text - The helper-text wrapper that renders content below the target input.\n * @csspart header - The calendar header element.\n * @csspart header-title - The calendar header title element.\n * @csspart header-date - The calendar header date element.\n * @csspart calendar-content - The calendar content element which contains the views and navigation elements.\n * @csspart navigation - The calendar navigation container element.\n * @csspart months-navigation - The calendar months navigation button element.\n * @csspart years-navigation - The calendar years navigation button element.\n * @csspart years-range - The calendar years range element.\n * @csspart navigation-buttons - The calendar navigation buttons container.\n * @csspart navigation-button - The calendar previous/next navigation button.\n * @csspart days-view-container - The calendar days view container element.\n * @csspart days-view - The calendar days view element.\n * @csspart months-view - The calendar months view element.\n * @csspart years-view - The calendar years view element.\n * @csspart days-row - The calendar days row element.\n * @csspart calendar-label - The calendar week header label element.\n * @csspart week-number - The calendar week number element.\n * @csspart week-number-inner - The calendar week number inner element.\n * @csspart date - The calendar date element.\n * @csspart date-inner - The calendar date inner element.\n * @csspart first - The calendar first selected date element in range selection.\n * @csspart last - The calendar last selected date element in range selection.\n * @csspart inactive - The calendar inactive date element.\n * @csspart hidden - The calendar hidden date element.\n * @csspart weekend - The calendar weekend date element.\n * @csspart range - The calendar range selected element.\n * @csspart special - The calendar special date element.\n * @csspart disabled - The calendar disabled date element.\n * @csspart single - The calendar single selected date element.\n * @csspart preview - The calendar range selection preview date element.\n * @csspart month - The calendar month element.\n * @csspart month-inner - The calendar month inner element.\n * @csspart year - The calendar year element.\n * @csspart year-inner - The calendar year inner element.\n * @csspart selected - The calendar selected state for element(s). Applies to date, month and year elements.\n * @csspart current - The calendar current state for element(s). Applies to date, month and year elements.\n */\n@blazorAdditionalDependencies(\n 'IgcCalendarComponent, IgcDateTimeInputComponent, IgcDialogComponent, IgcIconComponent'\n)\n@shadowOptions({ delegatesFocus: true })\nexport default class IgcDatePickerComponent extends EventEmitterMixin<\n IgcDatePickerComponentEventMap,\n AbstractConstructor<IgcDatePickerBaseComponent<Date>>\n>(IgcDatePickerBaseComponent) {\n public static readonly tagName = 'igc-date-picker';\n public static styles = [styles, shared];\n\n /* blazorSuppress */\n public static register(): void {\n registerComponent(\n IgcDatePickerComponent,\n IgcDateTimeInputComponent,\n ...pickerDependencies\n );\n }\n\n //#region Private properties and state\n\n protected override get __validators() {\n return datePickerValidators;\n }\n\n protected override readonly _inputId = nextId();\n protected override readonly _themes = addThemingController(this, all);\n protected override readonly _slots = addSlotController(this, {\n slots: Slots,\n });\n\n /**\n * For now we use the core validation strings internally only, to avoid mixing with old resources by users.\n * To Do: Update resourceStrings type when the IgcCalendarResourceStrings is changed to ICalendarResourceStrings\n */\n protected override readonly _i18nController = addI18nController<\n IgcCalendarResourceStrings | DatePickerResourceStringsType\n >(this, {\n defaultEN: Object.assign(\n {},\n DatePickerResourceStringsEN,\n CalendarResourceStringsEN\n ),\n resourceMap: datePickerResourcesMap,\n });\n\n protected override readonly _formValue = createFormValueState(this, {\n initialValue: null,\n transformers: FormValueDateTimeTransformers,\n });\n\n @query(IgcDateTimeInputComponent.tagName)\n private readonly _input!: IgcDateTimeInputComponent;\n\n //#endregion\n\n //#region Base class hooks\n\n protected override get _value(): Date | null {\n return this.value;\n }\n\n protected override set _value(value: Date | null) {\n this.value = value;\n }\n\n protected override get _hasValue(): boolean {\n return this.value !== null;\n }\n\n protected override get _calendarSelection(): CalendarSelection {\n return 'single';\n }\n\n protected override get _calendarValue(): Date | null {\n return this.value;\n }\n\n protected override get _selectDateLabel(): string | undefined {\n return this.resourceStrings.calendar_select_date;\n }\n\n protected override get _calendarIconTitle(): string | undefined {\n return this.value\n ? this.resourceStrings.date_picker_change_date\n : this.resourceStrings.date_picker_choose_date;\n }\n\n protected override get _dialogLabel(): string | undefined {\n return this._calendarIconTitle;\n }\n\n protected override get _defaultDisplayFormat(): string | undefined {\n return this._input?.displayFormat;\n }\n\n protected override get _defaultInputFormat(): string | undefined {\n return this._input?.inputFormat;\n }\n\n protected override get _projectionTarget() {\n return this._input ?? null;\n }\n\n protected override _focusInput(): void {\n this._input.focus();\n }\n\n protected override _focusAndSelectInput(): void {\n this._input.focus();\n this._input.select();\n }\n\n protected override _syncCalendarOnToggle(): void {\n this._setCalendarActiveDate(this.value);\n }\n\n protected override _clearEditors(): void {\n this._input?.clear();\n }\n\n protected override _valueFromCalendarSelection(dates: Date[]): Date | null {\n return firstOf(dates) ?? null;\n }\n\n /**\n * A committed edit in the input already emits `igcChange` on its own, so only a\n * value which the picker itself has changed is left to notify about here.\n */\n protected override _onBlur(): void {\n if (this._isEditorReadOnly) {\n this._emitChangeIfDirty();\n }\n }\n\n protected override _onDialogClosing(): void {\n this._oldValue = this.value;\n }\n\n //#endregion\n\n //#region Public properties and attributes\n\n /* @tsTwoWayProperty(true, \"igcChange\", \"detail\", false) */\n /**\n * The value of the picker.\n *\n * Only ever holds a committed value. While the user is typing in the input, the\n * intermediate state stays in the editor and is committed - together with an\n * `igcChange` event - when the edit is committed on blur. Use the `igcInput` event\n * to observe the value as it is being typed.\n *\n * @attr\n */\n @property({ converter: convertToDate })\n public set value(value: Date | string | null | undefined) {\n this._formValue.setValueAndFormState(value as Date | null);\n }\n\n public get value(): Date | null {\n return this._formValue.value;\n }\n\n /**\n * The placeholder text of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The resource strings for localization.\n */\n @property({ attribute: false })\n public set resourceStrings(\n value: IgcCalendarResourceStrings | DatePickerResourceStringsType\n ) {\n this._i18nController.resourceStrings = value;\n }\n\n public get resourceStrings(): IgcCalendarResourceStrings &\n DatePickerResourceStringsType {\n return this._i18nController.resourceStrings;\n }\n\n //#endregion\n\n //#region Event handlers\n\n protected _handleInputChangeEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._commitValue(\n (event.target as IgcDateTimeInputComponent).value,\n 'igcChange'\n );\n }\n\n protected _handleInputEvent(event: CustomEvent<Date>): void {\n event.stopPropagation();\n\n this._setTouchedState();\n\n if (this.nonEditable) {\n event.preventDefault();\n return;\n }\n\n const draft = (event.target as IgcDateTimeInputComponent)._uncommittedValue;\n\n this._calendar.activeDate = draft ?? this._calendar.activeDate;\n this.emitEvent('igcInput', { detail: draft });\n }\n\n //#endregion\n\n //#region Form associated overrides\n\n protected override formResetCallback(): void {\n super.formResetCallback();\n\n // The shadow boundary keeps the inner editor out of the outer form, so the\n // browser never resets it. It runs its own constraint validation against the\n // forwarded `required`, `min` and `max`, so a touched editor would keep its\n // invalid styles after a form reset.\n this._input?.['formResetCallback']();\n }\n\n //#endregion\n\n //#region Public methods\n\n /** Increments the passed in date part */\n public stepUp(datePart?: DatePart, delta?: number): void {\n this._input.stepUp(datePart, delta);\n }\n\n /** Decrements the passed in date part */\n public stepDown(datePart?: DatePart, delta?: number): void {\n this._input.stepDown(datePart, delta);\n }\n\n /** Selects the text in the input of the component */\n public select(): void {\n this._input.select();\n }\n\n /* blazorSuppress */\n /** Sets the text selection range in the input of the component */\n public setSelectionRange(\n start: number,\n end: number,\n direction?: SelectionRangeDirection\n ): void {\n this._input.setSelectionRange(start, end, direction);\n }\n\n /* blazorSuppress */\n /* Replaces the selected text in the input and re-applies the mask */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n mode?: RangeTextSelectMode\n ): void {\n this._input.setRangeText(replacement, start, end, mode);\n this.value = this._input.value;\n }\n\n //#endregion\n\n //#region Render methods\n\n private _renderLabel(id: string) {\n const isDisabled = this._isDropDown || this.readOnly;\n\n return this.label\n ? html`\n <label\n part=\"label\"\n for=${id}\n @click=${bindIf(!isDisabled, this._handleAnchorClick)}\n >\n ${this.label}\n </label>\n `\n : nothing;\n }\n\n protected _renderInput(id: string) {\n const format = getDateTimeFormat(this._displayFormat);\n const hasClickHandler = !(this._isDropDown || this.readOnly);\n\n return html`\n <igc-date-time-input\n id=${id}\n label=${bindIf(this._isMaterial, this.label)}\n input-format=${ifDefined(this._inputFormat)}\n display-format=${ifDefined(format)}\n ?disabled=${this.disabled}\n ?readonly=${this._isEditorReadOnly}\n ?required=${this.required}\n .value=${this.value}\n .locale=${this.locale}\n .prompt=${this.prompt}\n .outlined=${this.outlined}\n .placeholder=${this.placeholder}\n .min=${this.min}\n .max=${this.max}\n .invalid=${this.invalid}\n @igcChange=${this._handleInputChangeEvent}\n @igcInput=${this._handleInputEvent}\n @keydown=${this._handleEnterKeydown}\n @click=${bindIf(hasClickHandler, this._handleInputClick)}\n exportparts=\"container, input, label, prefix, suffix\"\n >\n ${this._renderEditorSlots()}\n </igc-date-time-input>\n `;\n }\n\n protected override render(): TemplateResult {\n const id = this.id || this._inputId;\n\n return html`\n ${this._isMaterial ? nothing : this._renderLabel(id)}\n ${this._renderInput(id)} ${this._renderPicker(id)}\n ${IgcValidationContainerComponent.create(this)}\n `;\n }\n\n //#endregion\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'igc-date-picker': IgcDatePickerComponent;\n }\n}\n"]}
|
|
@@ -51,8 +51,6 @@ export default class IgcDateRangeInputComponent extends IgcDateRangeInputCompone
|
|
|
51
51
|
stepUp(datePart?: DateRangePart, delta?: number): void;
|
|
52
52
|
/** Decrements a date/time portion. */
|
|
53
53
|
stepDown(datePart?: DateRangePart, delta?: number): void;
|
|
54
|
-
hasDateParts(): boolean;
|
|
55
|
-
hasTimeParts(): boolean;
|
|
56
54
|
}
|
|
57
55
|
declare global {
|
|
58
56
|
interface HTMLElementTagNameMap {
|