igniteui-webcomponents 7.3.1 → 7.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +72 -1
- 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/avatar/themes/avatar.base.css.js +1 -1
- package/components/avatar/themes/avatar.base.css.js.map +1 -1
- package/components/badge/themes/badge.base.css.js +1 -1
- package/components/badge/themes/badge.base.css.js.map +1 -1
- package/components/banner/themes/banner.base.css.js +1 -1
- package/components/banner/themes/banner.base.css.js.map +1 -1
- package/components/banner/themes/shared/banner.indigo.css.js +1 -1
- package/components/banner/themes/shared/banner.indigo.css.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.d.ts +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/breadcrumb/themes/breadcrumbs.base.css.js +3 -0
- 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.d.ts +7 -2
- package/components/calendar/base.js +10 -4
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +6 -3
- package/components/calendar/calendar.js +41 -14
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +5 -8
- package/components/calendar/days-view/days-view.js +7 -16
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +13 -0
- package/components/calendar/helpers.js +15 -0
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/days-view.base.css.js +1 -1
- package/components/calendar/themes/days-view.base.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/calendar.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js +1 -1
- package/components/calendar/themes/shared/bootstrap/days-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js +1 -1
- package/components/calendar/themes/shared/fluent/days-view.fluent.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/calendar.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js +1 -1
- package/components/calendar/themes/shared/indigo/days-view.indigo.css.js.map +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js +1 -1
- package/components/calendar/themes/shared/material/days-view.material.css.js.map +1 -1
- package/components/calendar/themes/year-month-view.base.css.js +1 -1
- package/components/calendar/themes/year-month-view.base.css.js.map +1 -1
- package/components/card/themes/container.base.css.js +1 -1
- package/components/card/themes/container.base.css.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/carousel/themes/carousel.base.css.js +1 -1
- package/components/carousel/themes/carousel.base.css.js.map +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.js +1 -1
- package/components/carousel/themes/shared/carousel.indigo.css.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/themes/chat.base.css.js +1 -1
- package/components/chat/themes/chat.base.css.js.map +1 -1
- package/components/chat/themes/message.base.css.js +1 -1
- package/components/chat/themes/message.base.css.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 +1 -1
- package/components/checkbox/checkbox.js +1 -1
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/themes/checkbox.base.css.js +1 -1
- package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/checkbox/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.fluent.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.indigo.css.js.map +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js +1 -1
- package/components/checkbox/themes/shared/switch/switch.material.css.js.map +1 -1
- package/components/checkbox/themes/switch.base.css.js +1 -1
- package/components/checkbox/themes/switch.base.css.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 +9 -4
- 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/color-picker/themes/color-picker.base.css.js +1 -1
- package/components/color-picker/themes/color-picker.base.css.js.map +1 -1
- package/components/combo/combo.d.ts +18 -20
- package/components/combo/combo.js +8 -2
- 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/combo/themes/combo-item.base.css.js +1 -1
- package/components/combo/themes/combo-item.base.css.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/themes/shared/combo.bootstrap.css.js +1 -1
- package/components/combo/themes/shared/combo.bootstrap.css.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +33 -29
- package/components/date-picker/date-picker.base.js +15 -4
- 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-picker/themes/date-picker.base.css.js +1 -1
- package/components/date-picker/themes/date-picker.base.css.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.base.css.js +1 -1
- package/components/date-range-picker/date-range-picker.base.css.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.base.css.js +1 -1
- package/components/date-range-picker/predefined-ranges-area.base.css.js.map +1 -1
- 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 +39 -37
- package/components/date-time-input/date-time-input.base.js +6 -0
- 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/divider/themes/divider.base.css.js +1 -1
- package/components/divider/themes/divider.base.css.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/dropdown/themes/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
- package/components/file-input/file-input.d.ts +2 -2
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/file-input.base.css.js +1 -1
- package/components/file-input/themes/file-input.base.css.js.map +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.js +1 -1
- package/components/file-input/themes/shared/file-input.bootstrap.css.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.d.ts +3 -3
- package/components/input/input.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/list/themes/item.base.css.js +1 -1
- package/components/list/themes/item.base.css.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/nav-drawer/themes/item.base.css.js +1 -1
- package/components/nav-drawer/themes/item.base.css.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/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.d.ts +1 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js +3 -0
- package/components/progress/themes/linear/shared/linear.progress.bootstrap.css.js.map +1 -0
- package/components/progress/themes/linear/themes.js +3 -2
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/qr-code/qr-code.d.ts +29 -2
- package/components/qr-code/qr-code.js +56 -13
- package/components/qr-code/qr-code.js.map +1 -1
- package/components/qr-code/renderer/export.d.ts +28 -0
- package/components/qr-code/renderer/export.js +120 -0
- package/components/qr-code/renderer/export.js.map +1 -0
- package/components/qr-code/types.d.ts +26 -0
- package/components/qr-code/types.js.map +1 -1
- package/components/radio/radio.d.ts +4 -4
- package/components/radio/radio.js +17 -14
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/radio.base.css.js +1 -1
- package/components/radio/themes/radio.base.css.js.map +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js +1 -1
- package/components/radio/themes/shared/radio.bootstrap.css.js.map +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js +1 -1
- package/components/radio/themes/shared/radio.indigo.css.js.map +1 -1
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +6 -6
- 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 +4 -14
- package/components/select/select.js.map +1 -1
- package/components/select/themes/select.base.css.js +1 -1
- package/components/select/themes/select.base.css.js.map +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js +1 -1
- package/components/select/themes/shared/select.bootstrap.css.js.map +1 -1
- package/components/slider/themes/shared/slider.material.css.js +1 -1
- package/components/slider/themes/shared/slider.material.css.js.map +1 -1
- package/components/slider/themes/slider.base.css.js +1 -1
- package/components/slider/themes/slider.base.css.js.map +1 -1
- package/components/snackbar/themes/snackbar.base.css.js +1 -1
- package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
- package/components/splitter/splitter.d.ts +6 -6
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/themes/splitter.base.css.js +1 -1
- package/components/splitter/themes/splitter.base.css.js.map +1 -1
- package/components/stepper/themes/step/step.base.css.js +1 -1
- package/components/stepper/themes/step/step.base.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -1
- package/components/tabs/themes/tab.base.css.js +1 -1
- package/components/tabs/themes/tab.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +1 -1
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js +1 -1
- package/components/textarea/themes/shared/textarea.bootstrap.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js +1 -1
- package/components/textarea/themes/shared/textarea.common.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js +1 -1
- package/components/textarea/themes/shared/textarea.fluent.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js +1 -1
- package/components/textarea/themes/shared/textarea.indigo.css.js.map +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js +1 -1
- package/components/textarea/themes/shared/textarea.material.css.js.map +1 -1
- package/components/tile-manager/themes/tile.base.css.js +1 -1
- package/components/tile-manager/themes/tile.base.css.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/themes/toast.base.css.js +1 -1
- package/components/toast/themes/toast.base.css.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/themes/tooltip.base.css.js +1 -1
- package/components/tooltip/themes/tooltip.base.css.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/themes/item.base.css.js +1 -1
- package/components/tree/themes/item.base.css.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/themes/validator.base.css.js +1 -1
- package/components/validation-container/themes/validator.base.css.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +10 -12
- package/components/validation-container/validation-container.js +14 -17
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +5 -5
- package/components/virtualization/engine.js.map +1 -1
- package/components/virtualization/virtualization.d.ts +61 -63
- package/components/virtualization/virtualization.js +6 -5
- package/components/virtualization/virtualization.js.map +1 -1
- package/custom-elements.json +16769 -19698
- 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 +56 -55
- package/internals/controllers/aria-projection.js +14 -15
- 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 +6 -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 +8 -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 +24 -80
- 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 +6 -7
- 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 +51 -39
- package/internals/utils/dom.js +1 -2
- 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 +3 -0
- package/skills/igniteui-wc-figma-to-app/SKILL.md +907 -0
- package/skills/igniteui-wc-figma-to-app/references/asset-extraction.md +363 -0
- package/skills/igniteui-wc-figma-to-app/references/design-token-bridge.md +407 -0
- package/skills/igniteui-wc-figma-to-app/references/figma-component-map.md +325 -0
- package/skills/igniteui-wc-figma-to-app/references/mcp-setup.md +409 -0
- package/skills/igniteui-wc-figma-to-app/references/validation-patterns.md +376 -0
- package/skills/igniteui-wc-generate-from-image-design/references/gotchas.md +21 -0
- package/skills/igniteui-wc-integrate-with-framework/SKILL.md +4 -3
- package/skills/igniteui-wc-integrate-with-framework/references/vanilla-js.md +14 -0
- package/skills/igniteui-wc-migrate-grid-lite-to-premium/SKILL.md +12 -2
- 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/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
|
@@ -1,83 +1,60 @@
|
|
|
1
1
|
import type { LitElement, ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/** The value types that `ElementInternals.setFormValue` accepts. */
|
|
3
|
+
export type FormValueType = string | File | FormData | null;
|
|
4
|
+
/** A subset of the ARIA attributes that `ElementInternals` gives. */
|
|
5
|
+
export type ARIAState = {
|
|
5
6
|
[K in keyof ARIAMixin]?: ARIAMixin[K];
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/** Initial ARIA attributes to set on the element internals. */
|
|
10
|
-
initialARIA?: Partial<Record<T, ARIAMixin[T]>>;
|
|
8
|
+
type ElementInternalsConfig = {
|
|
9
|
+
initialARIA?: ARIAState;
|
|
11
10
|
/**
|
|
12
|
-
* ARIA attributes derived from host state
|
|
13
|
-
*
|
|
14
|
-
* have changed.
|
|
11
|
+
* ARIA attributes derived from the host state. It runs on every host
|
|
12
|
+
* update, so keep it cheap; only changed values reach the internals.
|
|
15
13
|
*/
|
|
16
14
|
aria?: () => ARIAState;
|
|
17
15
|
/**
|
|
18
|
-
* Whether
|
|
19
|
-
*
|
|
16
|
+
* Whether the controller also mirrors the internals `role` onto a `role`
|
|
17
|
+
* content attribute of the host element.
|
|
20
18
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* by the controller itself.
|
|
19
|
+
* @remarks
|
|
20
|
+
* Workaround: axe reads content attributes only and does not see
|
|
21
|
+
* `ElementInternals` ARIA. A `role` attribute from the author always wins.
|
|
25
22
|
*/
|
|
26
23
|
reflectRole?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Whether the controller also mirrors the internals `ariaLabel` onto an
|
|
26
|
+
* `aria-label` content attribute of the host element. Same rules as
|
|
27
|
+
* {@link reflectRole}.
|
|
28
|
+
*/
|
|
29
|
+
reflectLabel?: boolean;
|
|
27
30
|
};
|
|
28
31
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
32
|
+
* Manages the `ElementInternals` of a host element.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* The form-related members need a form associated host, that is, one with
|
|
36
|
+
* `static formAssociated = true`.
|
|
31
37
|
*/
|
|
32
38
|
declare class ElementInternalsController implements ReactiveController {
|
|
33
39
|
private readonly _host;
|
|
34
40
|
private readonly _internals;
|
|
35
41
|
private readonly _aria?;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
private _reflectedRole;
|
|
42
|
+
/** Mirrored ARIA properties and the last value this controller wrote. */
|
|
43
|
+
private readonly _reflected;
|
|
39
44
|
/**
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @remarks
|
|
43
|
-
* The host element must be form associated, that is, it should have
|
|
44
|
-
* `static formAssociated = true` in order to return the parent form.
|
|
45
|
+
* The ARIA values this controller last wrote. Each write reaches the
|
|
46
|
+
* accessibility tree, so the controller writes only what changes.
|
|
45
47
|
*/
|
|
48
|
+
private readonly _ariaState;
|
|
49
|
+
/** Returns the closest ancestor `<form>` element, or `null`. */
|
|
46
50
|
get form(): HTMLFormElement | null;
|
|
47
|
-
/**
|
|
48
|
-
* Returns a `ValidityState` object which represents the different validity states
|
|
49
|
-
* the element can be in, with respect to constraint validation.
|
|
50
|
-
*
|
|
51
|
-
* @remarks
|
|
52
|
-
* The host element must be form associated, that is, it should have
|
|
53
|
-
* `static formAssociated = true`.
|
|
54
|
-
*/
|
|
51
|
+
/** Returns the `ValidityState` object of the element. */
|
|
55
52
|
get validity(): ValidityState;
|
|
56
|
-
/**
|
|
57
|
-
* Returns a string containing the validation message of this element.
|
|
58
|
-
*
|
|
59
|
-
* @remarks
|
|
60
|
-
* The host element must be form associated, that is, it should have
|
|
61
|
-
* `static formAssociated = true`.
|
|
62
|
-
*/
|
|
53
|
+
/** Returns the validation message of this element. */
|
|
63
54
|
get validationMessage(): string;
|
|
64
|
-
/**
|
|
65
|
-
* Returns a boolean value which returns true if the element is a submittable element
|
|
66
|
-
* which is a candidate for constraint validation.
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* The host element must be form associated, that is, it should have
|
|
70
|
-
* `static formAssociated = true`.
|
|
71
|
-
*/
|
|
55
|
+
/** Whether the element is submittable and constraint validated. */
|
|
72
56
|
get willValidate(): boolean;
|
|
73
|
-
/**
|
|
74
|
-
* Returns a read-only array of the `<label>` elements associated with the host element, or `null` if there are no associated labels.
|
|
75
|
-
* The association is determined by the `for` attribute of `<label>` elements or by nesting the host element inside a `<label>`.
|
|
76
|
-
*
|
|
77
|
-
* @remarks
|
|
78
|
-
* The host element must be form associated, that is, it should have
|
|
79
|
-
* `static formAssociated = true` in order to return associated labels.
|
|
80
|
-
*/
|
|
57
|
+
/** Returns the `<label>` elements of the host, or `null` when it has none. */
|
|
81
58
|
get labels(): ReadonlyArray<Element> | null;
|
|
82
59
|
constructor(host: ReactiveControllerHost & LitElement, config?: ElementInternalsConfig);
|
|
83
60
|
/** @internal */
|
|
@@ -85,71 +62,43 @@ declare class ElementInternalsController implements ReactiveController {
|
|
|
85
62
|
/** @internal */
|
|
86
63
|
hostUpdate(): void;
|
|
87
64
|
/**
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
* Deferred until the host is connected - custom elements must not gain
|
|
92
|
-
* attributes during construction.
|
|
65
|
+
* Copies an internals ARIA property onto its host content attribute. Waits
|
|
66
|
+
* for the connection, because a custom element must get no attribute while it
|
|
67
|
+
* is constructed.
|
|
93
68
|
*/
|
|
94
|
-
private
|
|
69
|
+
private _reflectAttribute;
|
|
95
70
|
/** Sets ARIA attributes on the element's internals. */
|
|
96
|
-
setARIA
|
|
71
|
+
setARIA(state: ARIAState): void;
|
|
97
72
|
/**
|
|
98
|
-
* Returns an ARIA attribute
|
|
99
|
-
*
|
|
73
|
+
* Returns an ARIA attribute of the internals. Internals-based ARIA leaves no
|
|
74
|
+
* trace in the DOM, so this is the only way to read it back.
|
|
100
75
|
*/
|
|
101
76
|
getARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(name: T): ARIAMixin[T];
|
|
102
|
-
/**
|
|
103
|
-
* Adds or removes a custom state from the element's internals.
|
|
104
|
-
* Custom states can be styled via `:state()` selector in CSS.
|
|
105
|
-
*/
|
|
77
|
+
/** Adds or removes a custom state, which CSS matches with `:state()`. */
|
|
106
78
|
setState(state: string, value: boolean): void;
|
|
107
79
|
/**
|
|
108
|
-
* Sets
|
|
109
|
-
*
|
|
110
|
-
* If value is null, the element won't participate in form submission.
|
|
111
|
-
*
|
|
112
|
-
* @remarks
|
|
113
|
-
* The host element must be form associated, that is, it should have
|
|
114
|
-
* `static formAssociated = true`.
|
|
80
|
+
* Sets the state and the submission value of the host element. A `null`
|
|
81
|
+
* value keeps the element out of the form submission.
|
|
115
82
|
*/
|
|
116
83
|
setFormValue(value: FormValueType, state?: FormValueType): void;
|
|
117
|
-
/**
|
|
118
|
-
* Sets the internal validity state of the host element as well as the validation
|
|
119
|
-
* message.
|
|
120
|
-
*
|
|
121
|
-
* @remarks
|
|
122
|
-
* The host element must be form associated, that is, it should have
|
|
123
|
-
* `static formAssociated = true`.
|
|
124
|
-
*/
|
|
84
|
+
/** Sets the validity state and the validation message of the host. */
|
|
125
85
|
setValidity(flags?: ValidityStateFlags, message?: string): void;
|
|
126
|
-
/**
|
|
127
|
-
* Checks the internal validity of the host element and fires an `invalid` event if
|
|
128
|
-
* the host element fails validation constraints.
|
|
129
|
-
*
|
|
130
|
-
* @remarks
|
|
131
|
-
* The host element must be form associated, that is, it should have
|
|
132
|
-
* `static formAssociated = true`.
|
|
133
|
-
*/
|
|
86
|
+
/** Checks host validity, and sends an `invalid` event on a failure. */
|
|
134
87
|
checkValidity(): boolean;
|
|
135
88
|
/**
|
|
136
|
-
* Checks
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
* @remarks
|
|
140
|
-
* The host element must be form associated, that is, it should have
|
|
141
|
-
* `static formAssociated = true`.
|
|
89
|
+
* Checks host validity and reports the result to the user. It sends an
|
|
90
|
+
* `invalid` event on a failure.
|
|
142
91
|
*/
|
|
143
92
|
reportValidity(): boolean;
|
|
144
93
|
}
|
|
145
|
-
/** Creates
|
|
94
|
+
/** Creates an {@link ElementInternalsController} and adds it to a Lit host. */
|
|
146
95
|
export declare function addInternalsController(host: ReactiveControllerHost & LitElement, config?: ElementInternalsConfig): ElementInternalsController;
|
|
147
96
|
/**
|
|
148
|
-
*
|
|
97
|
+
* The {@link ElementInternalsController} of `element`, or `undefined`.
|
|
149
98
|
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
99
|
+
* @remarks
|
|
100
|
+
* An internal lookup for the components and the specs. The package entry point
|
|
101
|
+
* must not export it. Use it in place of a `@hidden` member on a component.
|
|
153
102
|
*/
|
|
154
103
|
export declare function internalsOf(element: Element): ElementInternalsController | undefined;
|
|
155
104
|
export type { ElementInternalsController };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
const reflectable = {
|
|
2
|
+
role: 'role',
|
|
3
|
+
ariaLabel: 'aria-label',
|
|
4
|
+
};
|
|
1
5
|
const registry = new WeakMap();
|
|
2
6
|
class ElementInternalsController {
|
|
3
7
|
get form() {
|
|
@@ -17,11 +21,17 @@ class ElementInternalsController {
|
|
|
17
21
|
return labels && labels.length > 0 ? Array.from(labels) : null;
|
|
18
22
|
}
|
|
19
23
|
constructor(host, config) {
|
|
20
|
-
this.
|
|
24
|
+
this._reflected = new Map();
|
|
25
|
+
this._ariaState = new Map();
|
|
21
26
|
this._host = host;
|
|
22
27
|
this._internals = this._host.attachInternals();
|
|
23
28
|
this._aria = config?.aria;
|
|
24
|
-
|
|
29
|
+
if (config?.reflectRole) {
|
|
30
|
+
this._reflected.set('role', null);
|
|
31
|
+
}
|
|
32
|
+
if (config?.reflectLabel) {
|
|
33
|
+
this._reflected.set('ariaLabel', null);
|
|
34
|
+
}
|
|
25
35
|
if (config?.initialARIA) {
|
|
26
36
|
this.setARIA(config.initialARIA);
|
|
27
37
|
}
|
|
@@ -29,30 +39,47 @@ class ElementInternalsController {
|
|
|
29
39
|
host.addController(this);
|
|
30
40
|
}
|
|
31
41
|
hostConnected() {
|
|
32
|
-
this.
|
|
42
|
+
for (const name of this._reflected.keys()) {
|
|
43
|
+
this._reflectAttribute(name);
|
|
44
|
+
}
|
|
33
45
|
}
|
|
34
46
|
hostUpdate() {
|
|
35
47
|
if (this._aria) {
|
|
36
48
|
this.setARIA(this._aria.call(this._host));
|
|
37
49
|
}
|
|
38
50
|
}
|
|
39
|
-
|
|
51
|
+
_reflectAttribute(name) {
|
|
40
52
|
const host = this._host;
|
|
41
|
-
if (!
|
|
53
|
+
if (!host.isConnected) {
|
|
42
54
|
return;
|
|
43
55
|
}
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
|
|
56
|
+
const attribute = reflectable[name];
|
|
57
|
+
const value = this._internals[name];
|
|
58
|
+
const current = host.getAttribute(attribute);
|
|
59
|
+
if (current !== null && current !== this._reflected.get(name)) {
|
|
47
60
|
return;
|
|
48
61
|
}
|
|
49
|
-
|
|
50
|
-
|
|
62
|
+
if (current !== value) {
|
|
63
|
+
value === null
|
|
64
|
+
? host.removeAttribute(attribute)
|
|
65
|
+
: host.setAttribute(attribute, value);
|
|
66
|
+
}
|
|
67
|
+
this._reflected.set(name, value);
|
|
51
68
|
}
|
|
52
69
|
setARIA(state) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
70
|
+
const internals = this._internals;
|
|
71
|
+
for (const key in state) {
|
|
72
|
+
const name = key;
|
|
73
|
+
const value = state[name];
|
|
74
|
+
if (!this._ariaState.has(name) || this._ariaState.get(name) !== value) {
|
|
75
|
+
this._ariaState.set(name, value);
|
|
76
|
+
internals[name] = value;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
for (const name of this._reflected.keys()) {
|
|
80
|
+
if (name in state) {
|
|
81
|
+
this._reflectAttribute(name);
|
|
82
|
+
}
|
|
56
83
|
}
|
|
57
84
|
}
|
|
58
85
|
getARIA(name) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internals.js","sourceRoot":"","sources":["../../../src/internals/controllers/internals.ts"],"names":[],"mappings":"AAsCA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAuC,CAAC;AAMpE,MAAM,0BAA0B;IAgB9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAUD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,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AE,OAAgB;QAC7D,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IAC9C,CAAC;IAUM,aAAa;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,EAAE,CAAC;IACzC,CAAC;IAUM,cAAc;QACnB,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,CAAC;IAC1C,CAAC;CACF;AAGD,MAAM,UAAU,sBAAsB,CACpC,IAAyC,EACzC,MAA+B;IAE/B,OAAO,IAAI,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AASD,MAAM,UAAU,WAAW,CACzB,OAAgB;IAEhB,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\nimport type { FormValueType } from '../mixins/forms/types.js';\n\n/** A subset of the ARIA attributes exposed through `ElementInternals`. */\ntype ARIAState = { [K in keyof ARIAMixin]?: ARIAMixin[K] };\n\n/** Configuration for the ElementInternalsController. */\ntype ElementInternalsConfig<T extends keyof ARIAMixin = keyof ARIAMixin> = {\n /** Initial ARIA attributes to set on the element internals. */\n initialARIA?: Partial<Record<T, ARIAMixin[T]>>;\n /**\n * ARIA attributes derived from host state, recomputed on every host update.\n * Keep the projection cheap - it runs whether or not the properties it reads\n * have changed.\n */\n aria?: () => ARIAState;\n /**\n * Whether to also mirror the internals `role` to a `role` content attribute\n * on the host element.\n *\n * Workaround for axe, which reads content attributes only and does not see\n * `ElementInternals` ARIA. An author-supplied `role` attribute always wins -\n * the controller only writes the attribute when it is absent or was written\n * by the controller itself.\n */\n reflectRole?: boolean;\n};\n\n/**\n * Internal registry resolving a host element to its internals controller.\n *\n * `attachInternals()` throws when called twice on the same element, so a host\n * maps to at most one controller.\n */\nconst registry = new WeakMap<Element, ElementInternalsController>();\n\n/**\n * A Lit ReactiveController to manage `ElementInternals` for a host element.\n * Provides methods to interact with custom element states and ARIA attributes..\n */\nclass ElementInternalsController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _internals: ElementInternals;\n private readonly _aria?: () => ARIAState;\n private readonly _reflectRole: boolean;\n\n /** The last `role` content attribute value written by this controller. */\n private _reflectedRole: string | null = null;\n\n /**\n * Gets the closest ancestor `<form>` element or `null`.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true` in order to return the parent form.\n */\n public get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /**\n * Returns a `ValidityState` object which represents the different validity states\n * the element can be in, with respect to constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validity(): ValidityState {\n return this._internals.validity;\n }\n\n /**\n * Returns a string containing the validation message of this element.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n /**\n * Returns a boolean value which returns true if the element is a submittable element\n * which is a candidate for constraint validation.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /**\n * Returns a read-only array of the `<label>` elements associated with the host element, or `null` if there are no associated labels.\n * The association is determined by the `for` attribute of `<label>` elements or by nesting the host element inside a `<label>`.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true` in order to return associated labels.\n */\n public get labels(): ReadonlyArray<Element> | null {\n const labels = this._internals.labels as NodeListOf<Element> | null;\n return labels && labels.length > 0 ? Array.from(labels) : null;\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n ) {\n this._host = host;\n this._internals = this._host.attachInternals();\n this._aria = config?.aria;\n this._reflectRole = config?.reflectRole ?? false;\n\n if (config?.initialARIA) {\n this.setARIA(config.initialARIA);\n }\n\n registry.set(host, this);\n host.addController(this);\n }\n\n /** @internal */\n public hostConnected(): void {\n this._reflectRoleAttribute();\n }\n\n /** @internal */\n public hostUpdate(): void {\n if (this._aria) {\n this.setARIA(this._aria.call(this._host));\n }\n }\n\n /**\n * Mirrors the internals `role` onto a content attribute on the host, when\n * {@link ElementInternalsConfig.reflectRole} is enabled.\n *\n * Deferred until the host is connected - custom elements must not gain\n * attributes during construction.\n */\n private _reflectRoleAttribute(): void {\n const host = this._host;\n\n if (!(this._reflectRole && host.isConnected)) {\n return;\n }\n\n const role = this._internals.role;\n const current = host.getAttribute('role');\n\n // Write only when the attribute is absent or still holds the value this\n // controller wrote - an attribute changed by the author is theirs to keep.\n if (current !== null && current !== this._reflectedRole) {\n return;\n }\n\n // A cleared role takes its attribute with it, or the host would keep\n // semantics that its internals no longer report.\n role ? host.setAttribute('role', role) : host.removeAttribute('role');\n this._reflectedRole = role;\n }\n\n /** Sets ARIA attributes on the element's internals. */\n public setARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(\n state: Partial<Record<T, ARIAMixin[T]>>\n ): void {\n Object.assign(this._internals, state);\n\n if ('role' in state) {\n this._reflectRoleAttribute();\n }\n }\n\n /**\n * Returns an ARIA attribute set on the element's internals. Internals-based\n * ARIA leaves no trace in the DOM, so this is the only way to read it back.\n */\n public getARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(\n name: T\n ): ARIAMixin[T] {\n return this._internals[name];\n }\n\n /**\n * Adds or removes a custom state from the element's internals.\n * Custom states can be styled via `:state()` selector in CSS.\n */\n public setState(state: string, value: boolean): void {\n value\n ? this._internals.states.add(state)\n : this._internals.states.delete(state);\n }\n\n /**\n * Sets both the state and submission value of internals's target element to value.\n *\n * If value is null, the element won't participate in form submission.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setFormValue(value: FormValueType, state?: FormValueType): void {\n this._internals.setFormValue(value, state);\n }\n\n /**\n * Sets the internal validity state of the host element as well as the validation\n * message.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public setValidity(flags?: ValidityStateFlags, message?: string): void {\n this._internals.setValidity(flags, message);\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Checks the internal validity of the host element and fires an `invalid` event if\n * the host element fails validation constraints.\n *\n * @remarks\n * The host element must be form associated, that is, it should have\n * `static formAssociated = true`.\n */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n}\n\n/** Creates and adds a {@link ElementInternalsController} to a LitElement host. */\nexport function addInternalsController(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n): ElementInternalsController {\n return new ElementInternalsController(host, config);\n}\n\n/**\n * Resolves the {@link ElementInternalsController} of the given element, if it has one.\n *\n * Internal cross-component/spec lookup. Not part of the public API - lives under\n * `#internals` and must not be re-exported from the package entry point. Prefer this\n * over exposing `public` `@hidden @internal` members on component classes.\n */\nexport function internalsOf(\n element: Element\n): ElementInternalsController | undefined {\n return registry.get(element);\n}\n\nexport type { ElementInternalsController };\n"]}
|
|
1
|
+
{"version":3,"file":"internals.js","sourceRoot":"","sources":["../../../src/internals/controllers/internals.ts"],"names":[],"mappings":"AAqCA,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM;IACZ,SAAS,EAAE,YAAY;CACf,CAAC;AAQX,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAuC,CAAC;AASpE,MAAM,0BAA0B;IAc9B,IAAW,IAAI;QACb,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;IAC9B,CAAC;IAGD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC;IAClC,CAAC;IAGD,IAAW,iBAAiB;QAC1B,OAAO,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC;IAC3C,CAAC;IAGD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0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC;AASD,MAAM,UAAU,WAAW,CACzB,OAAgB;IAEhB,OAAO,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["import type {\n LitElement,\n ReactiveController,\n ReactiveControllerHost,\n} from 'lit';\n\n/** The value types that `ElementInternals.setFormValue` accepts. */\nexport type FormValueType = string | File | FormData | null;\n\n/** A subset of the ARIA attributes that `ElementInternals` gives. */\nexport type ARIAState = { [K in keyof ARIAMixin]?: ARIAMixin[K] };\n\ntype ElementInternalsConfig = {\n initialARIA?: ARIAState;\n /**\n * ARIA attributes derived from the host state. It runs on every host\n * update, so keep it cheap; only changed values reach the internals.\n */\n aria?: () => ARIAState;\n /**\n * Whether the controller also mirrors the internals `role` onto a `role`\n * content attribute of the host element.\n *\n * @remarks\n * Workaround: axe reads content attributes only and does not see\n * `ElementInternals` ARIA. A `role` attribute from the author always wins.\n */\n reflectRole?: boolean;\n /**\n * Whether the controller also mirrors the internals `ariaLabel` onto an\n * `aria-label` content attribute of the host element. Same rules as\n * {@link reflectRole}.\n */\n reflectLabel?: boolean;\n};\n\n/** The mirrored internals ARIA properties and their content attributes. */\nconst reflectable = {\n role: 'role',\n ariaLabel: 'aria-label',\n} as const;\n\ntype ReflectableARIA = keyof typeof reflectable;\n\n/**\n * Resolves a host element to its internals controller. `attachInternals()`\n * throws on a second call, so a host has one controller at most.\n */\nconst registry = new WeakMap<Element, ElementInternalsController>();\n\n/**\n * Manages the `ElementInternals` of a host element.\n *\n * @remarks\n * The form-related members need a form associated host, that is, one with\n * `static formAssociated = true`.\n */\nclass ElementInternalsController implements ReactiveController {\n private readonly _host: ReactiveControllerHost & LitElement;\n private readonly _internals: ElementInternals;\n private readonly _aria?: () => ARIAState;\n /** Mirrored ARIA properties and the last value this controller wrote. */\n private readonly _reflected = new Map<ReflectableARIA, string | null>();\n\n /**\n * The ARIA values this controller last wrote. Each write reaches the\n * accessibility tree, so the controller writes only what changes.\n */\n private readonly _ariaState = new Map<keyof ARIAMixin, unknown>();\n\n /** Returns the closest ancestor `<form>` element, or `null`. */\n public get form(): HTMLFormElement | null {\n return this._internals.form;\n }\n\n /** Returns the `ValidityState` object of the element. */\n public get validity(): ValidityState {\n return this._internals.validity;\n }\n\n /** Returns the validation message of this element. */\n public get validationMessage(): string {\n return this._internals.validationMessage;\n }\n\n /** Whether the element is submittable and constraint validated. */\n public get willValidate(): boolean {\n return this._internals.willValidate;\n }\n\n /** Returns the `<label>` elements of the host, or `null` when it has none. */\n public get labels(): ReadonlyArray<Element> | null {\n const labels = this._internals.labels as NodeListOf<Element> | null;\n return labels && labels.length > 0 ? Array.from(labels) : null;\n }\n\n constructor(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n ) {\n this._host = host;\n this._internals = this._host.attachInternals();\n this._aria = config?.aria;\n\n if (config?.reflectRole) {\n this._reflected.set('role', null);\n }\n if (config?.reflectLabel) {\n this._reflected.set('ariaLabel', null);\n }\n\n if (config?.initialARIA) {\n this.setARIA(config.initialARIA);\n }\n\n registry.set(host, this);\n host.addController(this);\n }\n\n /** @internal */\n public hostConnected(): void {\n for (const name of this._reflected.keys()) {\n this._reflectAttribute(name);\n }\n }\n\n /** @internal */\n public hostUpdate(): void {\n if (this._aria) {\n this.setARIA(this._aria.call(this._host));\n }\n }\n\n /**\n * Copies an internals ARIA property onto its host content attribute. Waits\n * for the connection, because a custom element must get no attribute while it\n * is constructed.\n */\n private _reflectAttribute(name: ReflectableARIA): void {\n const host = this._host;\n\n if (!host.isConnected) {\n return;\n }\n\n const attribute = reflectable[name];\n const value = this._internals[name];\n const current = host.getAttribute(attribute);\n\n // An attribute that the author set or changed stays as the author left it.\n if (current !== null && current !== this._reflected.get(name)) {\n return;\n }\n\n // Only null removes the attribute; an empty string is a valid ARIA value.\n if (current !== value) {\n value === null\n ? host.removeAttribute(attribute)\n : host.setAttribute(attribute, value);\n }\n\n this._reflected.set(name, value);\n }\n\n /** Sets ARIA attributes on the element's internals. */\n public setARIA(state: ARIAState): void {\n // A write through a key of the union needs an index signature.\n const internals = this._internals as unknown as Record<string, unknown>;\n\n for (const key in state) {\n const name = key as keyof ARIAMixin;\n const value = state[name];\n\n if (!this._ariaState.has(name) || this._ariaState.get(name) !== value) {\n this._ariaState.set(name, value);\n internals[name] = value;\n }\n }\n\n // Always reflect a key that the state carries: the internals value alone\n // does not reveal an attribute that the author removed.\n for (const name of this._reflected.keys()) {\n if (name in state) {\n this._reflectAttribute(name);\n }\n }\n }\n\n /**\n * Returns an ARIA attribute of the internals. Internals-based ARIA leaves no\n * trace in the DOM, so this is the only way to read it back.\n */\n public getARIA<T extends keyof ARIAMixin = keyof ARIAMixin>(\n name: T\n ): ARIAMixin[T] {\n return this._internals[name];\n }\n\n /** Adds or removes a custom state, which CSS matches with `:state()`. */\n public setState(state: string, value: boolean): void {\n value\n ? this._internals.states.add(state)\n : this._internals.states.delete(state);\n }\n\n /**\n * Sets the state and the submission value of the host element. A `null`\n * value keeps the element out of the form submission.\n */\n public setFormValue(value: FormValueType, state?: FormValueType): void {\n this._internals.setFormValue(value, state);\n }\n\n /** Sets the validity state and the validation message of the host. */\n public setValidity(flags?: ValidityStateFlags, message?: string): void {\n this._internals.setValidity(flags, message);\n }\n\n /** Checks host validity, and sends an `invalid` event on a failure. */\n public checkValidity(): boolean {\n return this._internals.checkValidity();\n }\n\n /**\n * Checks host validity and reports the result to the user. It sends an\n * `invalid` event on a failure.\n */\n public reportValidity(): boolean {\n return this._internals.reportValidity();\n }\n}\n\n/** Creates an {@link ElementInternalsController} and adds it to a Lit host. */\nexport function addInternalsController(\n host: ReactiveControllerHost & LitElement,\n config?: ElementInternalsConfig\n): ElementInternalsController {\n return new ElementInternalsController(host, config);\n}\n\n/**\n * The {@link ElementInternalsController} of `element`, or `undefined`.\n *\n * @remarks\n * An internal lookup for the components and the specs. The package entry point\n * must not export it. Use it in place of a `@hidden` member on a component.\n */\nexport function internalsOf(\n element: Element\n): ElementInternalsController | undefined {\n return registry.get(element);\n}\n\nexport type { ElementInternalsController };\n"]}
|