igniteui-webcomponents 7.2.4 → 7.3.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +142 -0
- package/animations/player.js +1 -1
- package/animations/player.js.map +1 -1
- package/animations/view-transition.js +1 -1
- package/animations/view-transition.js.map +1 -1
- package/components/accordion/accordion.d.ts +1 -1
- package/components/accordion/accordion.js +7 -6
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.js +3 -3
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/themes.d.ts +1 -1
- package/components/avatar/themes/themes.js.map +1 -1
- package/components/badge/badge.d.ts +1 -1
- package/components/badge/badge.js +5 -5
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/themes.d.ts +1 -1
- package/components/badge/themes/themes.js.map +1 -1
- package/components/banner/banner.d.ts +2 -2
- package/components/banner/banner.js +8 -8
- package/components/banner/banner.js.map +1 -1
- package/components/banner/themes/themes.d.ts +1 -1
- package/components/banner/themes/themes.js.map +1 -1
- package/components/button/button-base.d.ts +2 -2
- package/components/button/button-base.js +9 -8
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +3 -3
- package/components/button/button.js +2 -2
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.js +3 -3
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/themes.d.ts +1 -1
- package/components/button/themes/button/themes.js.map +1 -1
- package/components/button/themes/icon-button/themes.d.ts +1 -1
- package/components/button/themes/icon-button/themes.js.map +1 -1
- package/components/button-group/button-group.d.ts +42 -21
- package/components/button-group/button-group.js +101 -106
- package/components/button-group/button-group.js.map +1 -1
- package/components/button-group/themes/button.d.ts +1 -1
- package/components/button-group/themes/button.js.map +1 -1
- package/components/button-group/themes/group.d.ts +1 -1
- package/components/button-group/themes/group.js.map +1 -1
- package/components/button-group/toggle-button.d.ts +17 -10
- package/components/button-group/toggle-button.js +28 -13
- package/components/button-group/toggle-button.js.map +1 -1
- package/components/calendar/base.d.ts +29 -10
- package/components/calendar/base.js +12 -15
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.d.ts +39 -8
- package/components/calendar/calendar.js +96 -85
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +49 -22
- package/components/calendar/days-view/days-view.js +102 -163
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +3 -62
- package/components/calendar/helpers.js +6 -110
- package/components/calendar/helpers.js.map +1 -1
- package/components/calendar/months-view/months-view.d.ts +7 -21
- package/components/calendar/months-view/months-view.js +30 -83
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/selection.d.ts +21 -0
- package/components/calendar/selection.js +42 -0
- package/components/calendar/selection.js.map +1 -0
- package/components/calendar/themes/calendar.d.ts +1 -1
- package/components/calendar/themes/calendar.js.map +1 -1
- package/components/calendar/themes/days.d.ts +1 -1
- package/components/calendar/themes/days.js.map +1 -1
- package/components/calendar/themes/year-month.d.ts +1 -1
- package/components/calendar/themes/year-month.js.map +1 -1
- package/components/calendar/types.d.ts +18 -0
- package/components/calendar/types.js.map +1 -1
- package/components/calendar/year-month-view.base.d.ts +44 -0
- package/components/calendar/year-month-view.base.js +89 -0
- package/components/calendar/year-month-view.base.js.map +1 -0
- package/components/calendar/years-view/years-view.d.ts +7 -20
- package/components/calendar/years-view/years-view.js +25 -79
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/card.actions.js +2 -2
- package/components/card/card.actions.js.map +1 -1
- package/components/card/card.content.d.ts +1 -1
- package/components/card/card.content.js +2 -2
- package/components/card/card.content.js.map +1 -1
- package/components/card/card.d.ts +1 -1
- package/components/card/card.header.js +2 -2
- package/components/card/card.header.js.map +1 -1
- package/components/card/card.js +2 -2
- package/components/card/card.js.map +1 -1
- package/components/card/card.media.d.ts +1 -1
- package/components/card/card.media.js +1 -1
- package/components/card/card.media.js.map +1 -1
- package/components/card/themes/actions.d.ts +1 -1
- package/components/card/themes/actions.js.map +1 -1
- package/components/card/themes/container.d.ts +1 -1
- package/components/card/themes/container.js.map +1 -1
- package/components/card/themes/content.d.ts +1 -1
- package/components/card/themes/content.js.map +1 -1
- package/components/card/themes/header.d.ts +1 -1
- package/components/card/themes/header.js.map +1 -1
- package/components/carousel/animations.d.ts +1 -1
- package/components/carousel/animations.js +2 -2
- package/components/carousel/animations.js.map +1 -1
- package/components/carousel/carousel-indicator-container.js +4 -4
- package/components/carousel/carousel-indicator-container.js.map +1 -1
- package/components/carousel/carousel-indicator.d.ts +1 -1
- package/components/carousel/carousel-indicator.js +5 -5
- package/components/carousel/carousel-indicator.js.map +1 -1
- package/components/carousel/carousel-slide.d.ts +1 -1
- package/components/carousel/carousel-slide.js +9 -9
- package/components/carousel/carousel-slide.js.map +1 -1
- package/components/carousel/carousel.d.ts +7 -7
- package/components/carousel/carousel.js +39 -28
- package/components/carousel/carousel.js.map +1 -1
- package/components/carousel/themes/container.d.ts +1 -1
- package/components/carousel/themes/container.js.map +1 -1
- package/components/carousel/themes/indicator-container.d.ts +1 -1
- package/components/carousel/themes/indicator-container.js.map +1 -1
- package/components/chat/chat-input.d.ts +4 -4
- package/components/chat/chat-input.js +9 -8
- package/components/chat/chat-input.js.map +1 -1
- package/components/chat/chat-message.d.ts +1 -1
- package/components/chat/chat-message.js +7 -6
- package/components/chat/chat-message.js.map +1 -1
- package/components/chat/chat-state.d.ts +2 -2
- package/components/chat/chat-state.js +2 -1
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +4 -4
- package/components/chat/chat.js +7 -7
- package/components/chat/chat.js.map +1 -1
- package/components/chat/message-attachments.js +5 -5
- package/components/chat/message-attachments.js.map +1 -1
- package/components/chat/themes/attachments.d.ts +1 -1
- package/components/chat/themes/attachments.js.map +1 -1
- package/components/chat/themes/input.d.ts +1 -1
- package/components/chat/themes/input.js.map +1 -1
- package/components/chat/themes/message.d.ts +1 -1
- package/components/chat/themes/message.js.map +1 -1
- package/components/chat/themes/themes.d.ts +1 -1
- package/components/chat/themes/themes.js.map +1 -1
- package/components/chat/types.d.ts +2 -2
- package/components/chat/types.js.map +1 -1
- package/components/chat/utils.d.ts +1 -1
- package/components/chat/utils.js +3 -3
- package/components/chat/utils.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +7 -7
- package/components/checkbox/checkbox-base.js +7 -7
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.js +7 -6
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +7 -6
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/checkbox-themes.d.ts +1 -1
- package/components/checkbox/themes/checkbox-themes.js.map +1 -1
- package/components/checkbox/themes/switch-themes.d.ts +1 -1
- package/components/checkbox/themes/switch-themes.js.map +1 -1
- package/components/checkbox/validators.d.ts +1 -1
- package/components/checkbox/validators.js +1 -1
- package/components/checkbox/validators.js.map +1 -1
- package/components/chip/chip.d.ts +9 -3
- package/components/chip/chip.js +10 -6
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +1 -1
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/dark/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js +1 -1
- package/components/chip/themes/dark/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js +1 -1
- package/components/chip/themes/dark/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/dark/chip.material.css.js +1 -1
- package/components/chip/themes/dark/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/light/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/light/chip.fluent.css.js +1 -1
- package/components/chip/themes/light/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/light/chip.indigo.css.js +1 -1
- package/components/chip/themes/light/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/light/chip.material.css.js +1 -1
- package/components/chip/themes/light/chip.material.css.js.map +1 -1
- package/components/chip/themes/light/chip.shared.css.js +1 -1
- package/components/chip/themes/light/chip.shared.css.js.map +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js +1 -1
- package/components/chip/themes/shared/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js +1 -1
- package/components/chip/themes/shared/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/themes.d.ts +1 -1
- package/components/chip/themes/themes.js.map +1 -1
- package/components/combo/combo-header.js +2 -2
- package/components/combo/combo-header.js.map +1 -1
- package/components/combo/combo-item.d.ts +0 -2
- package/components/combo/combo-item.js +4 -7
- package/components/combo/combo-item.js.map +1 -1
- package/components/combo/combo.d.ts +84 -27
- package/components/combo/combo.js +194 -157
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/data.d.ts +30 -3
- package/components/combo/controllers/data.js +34 -9
- package/components/combo/controllers/data.js.map +1 -1
- package/components/combo/controllers/navigation.d.ts +8 -2
- package/components/combo/controllers/navigation.js +11 -12
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/combo/operations/filter.d.ts +17 -1
- package/components/combo/operations/filter.js +29 -9
- package/components/combo/operations/filter.js.map +1 -1
- package/components/combo/operations/group.js +1 -1
- package/components/combo/operations/group.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/themes/themes.d.ts +1 -1
- package/components/combo/themes/themes.js.map +1 -1
- package/components/combo/types.d.ts +8 -4
- package/components/combo/types.js.map +1 -1
- package/components/combo/validators.d.ts +1 -1
- package/components/combo/validators.js.map +1 -1
- package/components/date-picker/date-picker.base.d.ts +294 -0
- package/components/date-picker/date-picker.base.js +480 -0
- package/components/date-picker/date-picker.base.js.map +1 -0
- package/components/date-picker/date-picker.d.ts +53 -174
- package/components/date-picker/date-picker.js +88 -399
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/themes.d.ts +1 -1
- package/components/date-picker/themes/themes.js.map +1 -1
- package/components/date-picker/validators.d.ts +1 -1
- package/components/date-picker/validators.js +2 -2
- package/components/date-picker/validators.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +12 -14
- package/components/date-range-picker/date-range-input.js +42 -98
- package/components/date-range-picker/date-range-input.js.map +1 -1
- package/components/date-range-picker/date-range-mask-parser.d.ts +22 -34
- package/components/date-range-picker/date-range-mask-parser.js +38 -69
- package/components/date-range-picker/date-range-mask-parser.js.map +1 -1
- package/components/date-range-picker/date-range-picker.d.ts +97 -191
- package/components/date-range-picker/date-range-picker.js +210 -532
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +2 -2
- package/components/date-range-picker/predefined-ranges-area.js +5 -5
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/themes/ranges-themes.d.ts +1 -1
- package/components/date-range-picker/themes/ranges-themes.js.map +1 -1
- package/components/date-range-picker/themes/themes.d.ts +1 -1
- package/components/date-range-picker/themes/themes.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +1 -1
- package/components/date-range-picker/validators.js +15 -22
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-part.d.ts +18 -1
- package/components/date-time-input/date-part.js +10 -0
- package/components/date-time-input/date-part.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +72 -25
- package/components/date-time-input/date-time-input.base.js +100 -36
- package/components/date-time-input/date-time-input.base.js.map +1 -1
- package/components/date-time-input/date-time-input.d.ts +13 -23
- package/components/date-time-input/date-time-input.js +45 -65
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +45 -109
- package/components/date-time-input/datetime-mask-parser.js +88 -139
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/date-time-input/validators.d.ts +1 -1
- package/components/date-time-input/validators.js +2 -2
- package/components/date-time-input/validators.js.map +1 -1
- package/components/dialog/dialog.d.ts +2 -2
- package/components/dialog/dialog.js +17 -18
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/themes.d.ts +1 -1
- package/components/dialog/themes/themes.js.map +1 -1
- package/components/divider/divider.d.ts +2 -1
- package/components/divider/divider.js +3 -3
- package/components/divider/divider.js.map +1 -1
- package/components/divider/themes/themes.d.ts +1 -1
- package/components/divider/themes/themes.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +10 -3
- package/components/dropdown/dropdown-group.js +21 -5
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown-header.d.ts +2 -2
- package/components/dropdown/dropdown-header.js +7 -2
- package/components/dropdown/dropdown-header.js.map +1 -1
- package/components/dropdown/dropdown-item.d.ts +4 -4
- package/components/dropdown/dropdown-item.js +3 -3
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +75 -32
- package/components/dropdown/dropdown.js +189 -110
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/container.d.ts +1 -1
- package/components/dropdown/themes/container.js.map +1 -1
- package/components/dropdown/themes/group.d.ts +1 -1
- package/components/dropdown/themes/group.js.map +1 -1
- package/components/dropdown/themes/header.d.ts +1 -1
- package/components/dropdown/themes/header.js.map +1 -1
- package/components/dropdown/themes/item.d.ts +1 -1
- package/components/dropdown/themes/item.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +14 -5
- package/components/expansion-panel/expansion-panel.js +10 -9
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/themes.d.ts +1 -1
- package/components/expansion-panel/themes/themes.js.map +1 -1
- package/components/file-input/file-input.d.ts +20 -12
- package/components/file-input/file-input.js +17 -12
- package/components/file-input/file-input.js.map +1 -1
- package/components/file-input/themes/themes.d.ts +1 -1
- package/components/file-input/themes/themes.js.map +1 -1
- package/components/file-input/validators.d.ts +1 -1
- package/components/file-input/validators.js +1 -1
- package/components/file-input/validators.js.map +1 -1
- package/components/focus-trap/focus-trap.js +3 -2
- package/components/focus-trap/focus-trap.js.map +1 -1
- package/components/highlight/highlight.js +2 -2
- package/components/highlight/highlight.js.map +1 -1
- package/components/highlight/service.d.ts +4 -1
- package/components/highlight/service.js +23 -7
- package/components/highlight/service.js.map +1 -1
- package/components/highlight/themes/themes.d.ts +1 -1
- package/components/highlight/themes/themes.js.map +1 -1
- package/components/icon/icon-references.d.ts +3 -2
- package/components/icon/icon-references.js +103 -491
- package/components/icon/icon-references.js.map +1 -1
- package/components/icon/icon-state.broadcast.d.ts +14 -17
- package/components/icon/icon-state.broadcast.js +19 -20
- package/components/icon/icon-state.broadcast.js.map +1 -1
- package/components/icon/icon.d.ts +12 -24
- package/components/icon/icon.js +36 -28
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.d.ts +69 -131
- package/components/icon/icon.registry.js +51 -53
- package/components/icon/icon.registry.js.map +1 -1
- package/components/icon/internal-icons-lib.js +2 -2
- package/components/icon/internal-icons-lib.js.map +1 -1
- package/components/icon/registry/parser.d.ts +15 -3
- package/components/icon/registry/parser.js +36 -11
- package/components/icon/registry/parser.js.map +1 -1
- package/components/icon/registry/types.d.ts +55 -11
- package/components/icon/registry/types.js.map +1 -1
- package/components/icon/themes/icon.base.css.js +1 -1
- package/components/icon/themes/icon.base.css.js.map +1 -1
- package/components/icon/themes/shared/icon.common.css.js +1 -1
- package/components/icon/themes/shared/icon.common.css.js.map +1 -1
- package/components/icon/themes/themes.d.ts +1 -1
- package/components/icon/themes/themes.js.map +1 -1
- package/components/input/input-base.d.ts +10 -25
- package/components/input/input-base.js +14 -23
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +15 -12
- package/components/input/input.js +8 -9
- package/components/input/input.js.map +1 -1
- package/components/input/themes/input.base.css.js +1 -1
- package/components/input/themes/input.base.css.js.map +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js +1 -1
- package/components/input/themes/shared/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/shared/input.common.css.js +1 -1
- package/components/input/themes/shared/input.common.css.js.map +1 -1
- package/components/input/themes/shared/input.fluent.css.js +1 -1
- package/components/input/themes/shared/input.fluent.css.js.map +1 -1
- package/components/input/themes/shared/input.indigo.css.js +1 -1
- package/components/input/themes/shared/input.indigo.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/input/themes/themes.d.ts +1 -1
- package/components/input/themes/themes.js.map +1 -1
- package/components/input/validators.d.ts +1 -1
- package/components/input/validators.js +1 -1
- package/components/input/validators.js.map +1 -1
- package/components/list/list-header.js +3 -3
- package/components/list/list-header.js.map +1 -1
- package/components/list/list-item.js +3 -3
- package/components/list/list-item.js.map +1 -1
- package/components/list/list.js +3 -3
- package/components/list/list.js.map +1 -1
- package/components/list/themes/container.d.ts +1 -1
- package/components/list/themes/container.js.map +1 -1
- package/components/list/themes/header.d.ts +1 -1
- package/components/list/themes/header.js.map +1 -1
- package/components/list/themes/item.d.ts +1 -1
- package/components/list/themes/item.js.map +1 -1
- package/components/mask-input/mask-history.d.ts +99 -0
- package/components/mask-input/mask-history.js +95 -0
- package/components/mask-input/mask-history.js.map +1 -0
- package/components/mask-input/mask-input.d.ts +14 -9
- package/components/mask-input/mask-input.js +20 -24
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.d.ts +20 -2
- package/components/mask-input/mask-parser.js +21 -13
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/mask-input/validators.d.ts +1 -1
- package/components/mask-input/validators.js +1 -1
- package/components/mask-input/validators.js.map +1 -1
- package/components/nav-drawer/nav-drawer-header-item.d.ts +1 -1
- package/components/nav-drawer/nav-drawer-header-item.js +2 -2
- package/components/nav-drawer/nav-drawer-header-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer-item.d.ts +2 -2
- package/components/nav-drawer/nav-drawer-item.js +4 -4
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +3 -3
- package/components/nav-drawer/nav-drawer.js +11 -14
- package/components/nav-drawer/nav-drawer.js.map +1 -1
- package/components/nav-drawer/themes/container.base.css.js +1 -1
- package/components/nav-drawer/themes/container.base.css.js.map +1 -1
- package/components/nav-drawer/themes/container.d.ts +1 -1
- package/components/nav-drawer/themes/container.js +2 -3
- package/components/nav-drawer/themes/container.js.map +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/dark/container/nav-drawer.shared.css.js.map +1 -1
- package/components/nav-drawer/themes/header-item.d.ts +1 -1
- package/components/nav-drawer/themes/header-item.js.map +1 -1
- package/components/nav-drawer/themes/item.d.ts +1 -1
- package/components/nav-drawer/themes/item.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.fluent.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js +1 -1
- package/components/nav-drawer/themes/light/container/nav-drawer.shared.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.bootstrap.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.material.css.js.map +1 -1
- package/components/navbar/navbar.js +2 -2
- package/components/navbar/navbar.js.map +1 -1
- package/components/navbar/themes/themes.d.ts +1 -1
- package/components/navbar/themes/themes.js.map +1 -1
- package/components/popover/popover.d.ts +10 -3
- package/components/popover/popover.js +114 -99
- package/components/popover/popover.js.map +1 -1
- package/components/progress/base.d.ts +1 -1
- package/components/progress/base.js +5 -4
- package/components/progress/base.js.map +1 -1
- package/components/progress/circular-gradient.d.ts +2 -2
- package/components/progress/circular-gradient.js +1 -1
- package/components/progress/circular-gradient.js.map +1 -1
- package/components/progress/circular-progress.d.ts +15 -15
- package/components/progress/circular-progress.js +7 -6
- package/components/progress/circular-progress.js.map +1 -1
- package/components/progress/linear-progress.d.ts +12 -12
- package/components/progress/linear-progress.js +4 -4
- package/components/progress/linear-progress.js.map +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js +1 -1
- package/components/progress/themes/circular/circular.progress.base.css.js.map +1 -1
- package/components/progress/themes/circular/themes.d.ts +1 -1
- package/components/progress/themes/circular/themes.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/themes.d.ts +1 -1
- package/components/progress/themes/linear/themes.js.map +1 -1
- package/components/qr-code/model/encode.d.ts +20 -0
- package/components/qr-code/model/encode.js +166 -0
- package/components/qr-code/model/encode.js.map +1 -0
- package/components/qr-code/model/error-correction.d.ts +15 -0
- package/components/qr-code/model/error-correction.js +1114 -0
- package/components/qr-code/model/error-correction.js.map +1 -0
- package/components/qr-code/model/mask.d.ts +11 -0
- package/components/qr-code/model/mask.js +161 -0
- package/components/qr-code/model/mask.js.map +1 -0
- package/components/qr-code/model/matrix.d.ts +15 -0
- package/components/qr-code/model/matrix.js +277 -0
- package/components/qr-code/model/matrix.js.map +1 -0
- package/components/qr-code/qr-code.d.ts +134 -0
- package/components/qr-code/qr-code.js +221 -0
- package/components/qr-code/qr-code.js.map +1 -0
- package/components/qr-code/renderer/constants.d.ts +26 -0
- package/components/qr-code/renderer/constants.js +5 -0
- package/components/qr-code/renderer/constants.js.map +1 -0
- package/components/qr-code/renderer/corner.d.ts +23 -0
- package/components/qr-code/renderer/corner.js +25 -0
- package/components/qr-code/renderer/corner.js.map +1 -0
- package/components/qr-code/renderer/dots.d.ts +14 -0
- package/components/qr-code/renderer/dots.js +7 -0
- package/components/qr-code/renderer/dots.js.map +1 -0
- package/components/qr-code/renderer/helpers.d.ts +18 -0
- package/components/qr-code/renderer/helpers.js +158 -0
- package/components/qr-code/renderer/helpers.js.map +1 -0
- package/components/qr-code/renderer/image.d.ts +23 -0
- package/components/qr-code/renderer/image.js +29 -0
- package/components/qr-code/renderer/image.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/dark/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.bootstrap.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.fluent.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.indigo.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.material.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.material.css.js.map +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.d.ts +1 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js +3 -0
- package/components/qr-code/themes/light/qr-code.shared.css.js.map +1 -0
- package/components/qr-code/themes/qr-code.base.css.d.ts +1 -0
- package/components/qr-code/themes/qr-code.base.css.js +3 -0
- package/components/qr-code/themes/qr-code.base.css.js.map +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.d.ts +1 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js +3 -0
- package/components/qr-code/themes/shared/qr-code.common.css.js.map +1 -0
- package/components/qr-code/themes/themes.d.ts +2 -0
- package/components/qr-code/themes/themes.js +46 -0
- package/components/qr-code/themes/themes.js.map +1 -0
- package/components/qr-code/types.d.ts +16 -0
- package/components/qr-code/types.js +2 -0
- package/components/qr-code/types.js.map +1 -0
- package/components/radio/controller.d.ts +35 -0
- package/components/radio/controller.js +100 -0
- package/components/radio/controller.js.map +1 -0
- package/components/radio/radio.d.ts +26 -14
- package/components/radio/radio.js +47 -36
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/themes.d.ts +1 -1
- package/components/radio/themes/themes.js.map +1 -1
- package/components/radio/validators.d.ts +1 -1
- package/components/radio/validators.js +5 -3
- package/components/radio/validators.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +19 -10
- package/components/radio-group/radio-group.js +50 -41
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/themes/themes.d.ts +1 -1
- package/components/radio-group/themes/themes.js.map +1 -1
- package/components/rating/rating-symbol.d.ts +1 -1
- package/components/rating/rating-symbol.js +1 -1
- package/components/rating/rating-symbol.js.map +1 -1
- package/components/rating/rating.d.ts +6 -6
- package/components/rating/rating.js +12 -9
- package/components/rating/rating.js.map +1 -1
- package/components/rating/themes/themes.d.ts +1 -1
- package/components/rating/themes/themes.js.map +1 -1
- package/components/resize-container/resize-container.d.ts +4 -4
- package/components/resize-container/resize-container.js +4 -4
- package/components/resize-container/resize-container.js.map +1 -1
- package/components/resize-container/resize-controller.js +2 -2
- package/components/resize-container/resize-controller.js.map +1 -1
- package/components/resize-container/themes/themes.d.ts +1 -1
- package/components/resize-container/themes/themes.js.map +1 -1
- package/components/ripple/ripple.d.ts +1 -1
- package/components/ripple/ripple.js +3 -2
- package/components/ripple/ripple.js.map +1 -1
- package/components/select/select-group.d.ts +9 -2
- package/components/select/select-group.js +21 -5
- package/components/select/select-group.js.map +1 -1
- package/components/select/select-header.d.ts +1 -1
- package/components/select/select-header.js +7 -2
- package/components/select/select-header.js.map +1 -1
- package/components/select/select-item.d.ts +4 -4
- package/components/select/select-item.js +3 -3
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.d.ts +48 -27
- package/components/select/select.js +128 -74
- package/components/select/select.js.map +1 -1
- package/components/select/themes/select.base.css.js +1 -1
- package/components/select/themes/select.base.css.js.map +1 -1
- package/components/select/themes/themes.d.ts +1 -1
- package/components/select/themes/themes.js.map +1 -1
- package/components/select/validators.d.ts +1 -1
- package/components/select/validators.js +1 -1
- package/components/select/validators.js.map +1 -1
- package/components/slider/range-slider.d.ts +2 -2
- package/components/slider/range-slider.js +3 -3
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/slider-base.js +9 -5
- package/components/slider/slider-base.js.map +1 -1
- package/components/slider/slider-label.js +1 -1
- package/components/slider/slider-label.js.map +1 -1
- package/components/slider/slider.d.ts +3 -3
- package/components/slider/slider.js +6 -6
- package/components/slider/slider.js.map +1 -1
- package/components/slider/themes/themes.d.ts +1 -1
- package/components/slider/themes/themes.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +3 -3
- package/components/snackbar/snackbar.js +4 -4
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/themes.d.ts +1 -1
- package/components/snackbar/themes/themes.js.map +1 -1
- package/components/splitter/splitter.d.ts +106 -23
- package/components/splitter/splitter.js +234 -147
- package/components/splitter/splitter.js.map +1 -1
- package/components/splitter/themes/themes.d.ts +1 -1
- package/components/splitter/themes/themes.js.map +1 -1
- package/components/splitter/types.d.ts +14 -3
- package/components/splitter/types.js.map +1 -1
- package/components/stepper/common/animations.d.ts +1 -1
- package/components/stepper/common/animations.js +2 -2
- package/components/stepper/common/animations.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +7 -7
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +5 -5
- package/components/stepper/stepper.js +12 -9
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/themes.d.ts +1 -1
- package/components/stepper/themes/step/themes.js.map +1 -1
- package/components/tabs/tab-dom.d.ts +31 -28
- package/components/tabs/tab-dom.js +84 -34
- package/components/tabs/tab-dom.js.map +1 -1
- package/components/tabs/tab.d.ts +24 -6
- package/components/tabs/tab.js +34 -13
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +36 -22
- package/components/tabs/tabs.js +113 -102
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
- package/components/tabs/themes/tab-themes.d.ts +1 -1
- package/components/tabs/themes/tab-themes.js.map +1 -1
- package/components/tabs/themes/tabs-themes.d.ts +1 -1
- package/components/tabs/themes/tabs-themes.js.map +1 -1
- package/components/tabs/themes/tabs.base.css.js +1 -1
- package/components/tabs/themes/tabs.base.css.js.map +1 -1
- package/components/textarea/textarea.d.ts +19 -14
- package/components/textarea/textarea.js +22 -17
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/themes.d.ts +1 -1
- package/components/textarea/themes/themes.js.map +1 -1
- package/components/textarea/validators.d.ts +1 -1
- package/components/textarea/validators.js +1 -1
- package/components/textarea/validators.js.map +1 -1
- package/components/theme-provider/theme-provider.d.ts +1 -1
- package/components/theme-provider/theme-provider.js +2 -2
- package/components/theme-provider/theme-provider.js.map +1 -1
- package/components/tile-manager/position.d.ts +1 -1
- package/components/tile-manager/position.js +2 -2
- package/components/tile-manager/position.js.map +1 -1
- package/components/tile-manager/resize-state.js +4 -3
- package/components/tile-manager/resize-state.js.map +1 -1
- package/components/tile-manager/themes/container.d.ts +1 -1
- package/components/tile-manager/themes/container.js.map +1 -1
- package/components/tile-manager/themes/tile.d.ts +1 -1
- package/components/tile-manager/themes/tile.js.map +1 -1
- package/components/tile-manager/tile-ghost-util.js +1 -1
- package/components/tile-manager/tile-ghost-util.js.map +1 -1
- package/components/tile-manager/tile-manager.d.ts +1 -1
- package/components/tile-manager/tile-manager.js +7 -7
- package/components/tile-manager/tile-manager.js.map +1 -1
- package/components/tile-manager/tile.d.ts +4 -4
- package/components/tile-manager/tile.js +16 -13
- package/components/tile-manager/tile.js.map +1 -1
- package/components/toast/themes/themes.d.ts +1 -1
- package/components/toast/themes/themes.js.map +1 -1
- package/components/toast/toast.d.ts +1 -1
- package/components/toast/toast.js +3 -3
- package/components/toast/toast.js.map +1 -1
- package/components/tooltip/controller.d.ts +18 -16
- package/components/tooltip/controller.js +62 -41
- package/components/tooltip/controller.js.map +1 -1
- package/components/tooltip/service.d.ts +2 -1
- package/components/tooltip/service.js +10 -15
- package/components/tooltip/service.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.common.css.js.map +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js +1 -1
- package/components/tooltip/themes/shared/tooltip.indigo.css.js.map +1 -1
- package/components/tooltip/themes/themes.d.ts +1 -1
- package/components/tooltip/themes/themes.js.map +1 -1
- package/components/tooltip/themes/tooltip.base.css.js +1 -1
- package/components/tooltip/themes/tooltip.base.css.js.map +1 -1
- package/components/tooltip/tooltip.d.ts +64 -18
- package/components/tooltip/tooltip.js +110 -60
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/tree/themes/container.base.css.js +1 -1
- package/components/tree/themes/container.base.css.js.map +1 -1
- package/components/tree/themes/container.d.ts +1 -1
- package/components/tree/themes/container.js.map +1 -1
- package/components/tree/themes/item.base.css.js +1 -1
- package/components/tree/themes/item.base.css.js.map +1 -1
- package/components/tree/themes/item.d.ts +1 -1
- package/components/tree/themes/item.js.map +1 -1
- package/components/tree/tree-item.d.ts +62 -36
- package/components/tree/tree-item.js +198 -208
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.common.d.ts +16 -1
- package/components/tree/tree.common.js +40 -1
- package/components/tree/tree.common.js.map +1 -1
- package/components/tree/tree.d.ts +21 -14
- package/components/tree/tree.js +64 -72
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.d.ts +39 -29
- package/components/tree/tree.navigation.js +140 -192
- package/components/tree/tree.navigation.js.map +1 -1
- package/components/tree/tree.selection.d.ts +32 -31
- package/components/tree/tree.selection.js +184 -178
- package/components/tree/tree.selection.js.map +1 -1
- package/components/types.js.map +1 -1
- package/components/validation-container/validation-container.d.ts +1 -1
- package/components/validation-container/validation-container.js +7 -6
- package/components/validation-container/validation-container.js.map +1 -1
- package/components/virtualization/engine.d.ts +92 -0
- package/components/virtualization/engine.js +217 -0
- package/components/virtualization/engine.js.map +1 -0
- package/components/virtualization/types.d.ts +53 -0
- package/components/virtualization/types.js +14 -0
- package/components/virtualization/types.js.map +1 -0
- package/components/virtualization/virtualization.d.ts +235 -0
- package/components/virtualization/virtualization.js +474 -0
- package/components/virtualization/virtualization.js.map +1 -0
- package/components/visually-hidden/visually-hidden.js +1 -1
- package/components/visually-hidden/visually-hidden.js.map +1 -1
- package/custom-elements.json +57745 -48130
- package/extras/chat-markdown-renderer.d.ts +1 -1
- package/extras/chat-markdown-renderer.js.map +1 -1
- package/igniteui-webcomponents.css-data.json +2 -2
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +17 -12
- package/index.js +11 -9
- package/index.js.map +1 -1
- package/internals/abort-handler.js.map +1 -0
- package/internals/context.d.ts +39 -0
- package/{components/common → internals}/context.js +2 -1
- package/internals/context.js.map +1 -0
- package/internals/controllers/adopt-styles.d.ts +76 -0
- package/internals/controllers/adopt-styles.js +173 -0
- package/internals/controllers/adopt-styles.js.map +1 -0
- package/internals/controllers/aria-projection.d.ts +144 -0
- package/internals/controllers/aria-projection.js +138 -0
- package/internals/controllers/aria-projection.js.map +1 -0
- package/{components/common → internals}/controllers/async-consumer.js +8 -7
- package/internals/controllers/async-consumer.js.map +1 -0
- package/internals/controllers/command.js.map +1 -0
- package/{components/common → internals}/controllers/drag.js +3 -2
- package/internals/controllers/drag.js.map +1 -0
- package/{components/common → internals}/controllers/focus-ring.js +5 -2
- package/internals/controllers/focus-ring.js.map +1 -0
- package/{components/common → internals}/controllers/fullscreen.js +6 -3
- package/internals/controllers/fullscreen.js.map +1 -0
- package/{components/common → internals}/controllers/gestures.d.ts +1 -1
- package/{components/common → internals}/controllers/gestures.js +4 -4
- package/internals/controllers/gestures.js.map +1 -0
- package/{components/common → internals}/controllers/id-resolver.js +15 -21
- package/internals/controllers/id-resolver.js.map +1 -0
- package/{components/common → internals}/controllers/internals.d.ts +39 -3
- package/{components/common → internals}/controllers/internals.js +28 -0
- package/internals/controllers/internals.js.map +1 -0
- package/{components/common → internals}/controllers/key-bindings.d.ts +3 -6
- package/{components/common → internals}/controllers/key-bindings.js +43 -29
- package/internals/controllers/key-bindings.js.map +1 -0
- package/{components/common → internals}/controllers/mutation-observer.d.ts +3 -2
- package/{components/common → internals}/controllers/mutation-observer.js +24 -22
- package/internals/controllers/mutation-observer.js.map +1 -0
- package/{components/common → internals}/controllers/resize-observer.d.ts +11 -1
- package/{components/common → internals}/controllers/resize-observer.js +13 -2
- package/internals/controllers/resize-observer.js.map +1 -0
- package/{components/common → internals}/controllers/root-click.js +8 -13
- package/internals/controllers/root-click.js.map +1 -0
- package/{components/common → internals}/controllers/root-scroll.d.ts +11 -8
- package/internals/controllers/root-scroll.js +71 -0
- package/internals/controllers/root-scroll.js.map +1 -0
- package/{components/common → internals}/controllers/slot.d.ts +17 -1
- package/{components/common → internals}/controllers/slot.js +18 -6
- package/internals/controllers/slot.js.map +1 -0
- package/internals/date/compare.d.ts +2 -0
- package/internals/date/compare.js +23 -0
- package/internals/date/compare.js.map +1 -0
- package/internals/date/converters.d.ts +18 -0
- package/internals/date/converters.js +73 -0
- package/internals/date/converters.js.map +1 -0
- package/{components/calendar → internals/date}/model.d.ts +6 -3
- package/{components/calendar → internals/date}/model.js +23 -0
- package/internals/date/model.js.map +1 -0
- package/internals/decorators/blazorAdditionalDependencies.js.map +1 -0
- package/internals/decorators/blazorDeepImport.js.map +1 -0
- package/internals/decorators/blazorInclude.js.map +1 -0
- package/internals/decorators/blazorIndirectRender.js.map +1 -0
- package/internals/decorators/blazorSuppressComponent.js.map +1 -0
- package/internals/decorators/shadow-options.js.map +1 -0
- package/internals/decorators/watch.js.map +1 -0
- package/internals/definitions/defineAllComponents.js +153 -0
- package/internals/definitions/defineAllComponents.js.map +1 -0
- package/internals/definitions/defineComponents.js.map +1 -0
- package/internals/definitions/register.js.map +1 -0
- package/{components/common → internals}/i18n/EN/calendar.resources.js +1 -1
- package/internals/i18n/EN/calendar.resources.js.map +1 -0
- package/internals/i18n/EN/chat.resources.js.map +1 -0
- package/internals/i18n/EN/date-picker.resources.js.map +1 -0
- package/internals/i18n/EN/date-range-picker.resources.js.map +1 -0
- package/internals/i18n/i18n-controller.js.map +1 -0
- package/{components/common → internals}/i18n/utils.js +1 -1
- package/internals/i18n/utils.js.map +1 -0
- package/{components/common → internals}/mixins/alert.d.ts +2 -2
- package/{components/common → internals}/mixins/alert.js +3 -3
- package/internals/mixins/alert.js.map +1 -0
- package/{components/common → internals}/mixins/combo-box.d.ts +10 -2
- package/{components/common → internals}/mixins/combo-box.js +9 -4
- package/internals/mixins/combo-box.js.map +1 -0
- package/internals/mixins/constructor.js.map +1 -0
- package/internals/mixins/event-emitter.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated-required.js +10 -19
- package/internals/mixins/forms/associated-required.js.map +1 -0
- package/{components/common → internals}/mixins/forms/associated.js +45 -38
- package/internals/mixins/forms/associated.js.map +1 -0
- package/{components/common → internals}/mixins/forms/form-transformers.d.ts +1 -1
- package/{components/common → internals}/mixins/forms/form-transformers.js +2 -2
- package/internals/mixins/forms/form-transformers.js.map +1 -0
- package/internals/mixins/forms/form-value.js.map +1 -0
- package/{components/common → internals}/mixins/forms/types.d.ts +5 -6
- package/internals/mixins/forms/types.js.map +1 -0
- package/{components/common → internals}/mixins/mask-behavior.d.ts +11 -3
- package/{components/common → internals}/mixins/mask-behavior.js +117 -29
- package/internals/mixins/mask-behavior.js.map +1 -0
- package/{components/common → internals}/mixins/option.d.ts +0 -2
- package/{components/common → internals}/mixins/option.js +1 -4
- package/internals/mixins/option.js.map +1 -0
- package/internals/part-map.js.map +1 -0
- package/{components/common → internals}/templates/input-shell.d.ts +8 -1
- package/{components/common → internals}/templates/input-shell.js +14 -4
- package/internals/templates/input-shell.js.map +1 -0
- package/{components/common → internals}/templates/masked-input.d.ts +8 -4
- package/{components/common → internals}/templates/masked-input.js +4 -3
- package/internals/templates/masked-input.js.map +1 -0
- package/internals/utils/arrays.d.ts +53 -0
- package/internals/utils/arrays.js +31 -0
- package/internals/utils/arrays.js.map +1 -0
- package/internals/utils/dom.d.ts +92 -0
- package/internals/utils/dom.js +143 -0
- package/internals/utils/dom.js.map +1 -0
- package/internals/utils/events.d.ts +41 -0
- package/internals/utils/events.js +37 -0
- package/internals/utils/events.js.map +1 -0
- package/internals/utils/lit.d.ts +8 -0
- package/internals/utils/lit.js +15 -0
- package/internals/utils/lit.js.map +1 -0
- package/internals/utils/math.d.ts +50 -0
- package/internals/utils/math.js +38 -0
- package/internals/utils/math.js.map +1 -0
- package/internals/utils/objects.d.ts +25 -0
- package/internals/utils/objects.js +125 -0
- package/internals/utils/objects.js.map +1 -0
- package/internals/utils/strings.d.ts +44 -0
- package/internals/utils/strings.js +46 -0
- package/internals/utils/strings.js.map +1 -0
- package/internals/utils/types.d.ts +13 -0
- package/internals/utils/types.js +31 -0
- package/internals/utils/types.js.map +1 -0
- package/{components/common → internals}/validators.d.ts +1 -1
- package/{components/common → internals}/validators.js +4 -2
- package/internals/validators.js.map +1 -0
- package/package.json +15 -7
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/themes/light/bootstrap.css +1 -1
- package/themes/light/fluent.css +1 -1
- package/themes/light/indigo.css +1 -1
- package/themes/light/material.css +1 -1
- package/theming/theming-controller.d.ts +2 -2
- package/theming/theming-controller.js.map +1 -1
- package/web-types.json +3 -3
- package/components/calendar/model.js.map +0 -1
- package/components/combo/combo-list.d.ts +0 -11
- package/components/combo/combo-list.js +0 -13
- package/components/combo/combo-list.js.map +0 -1
- package/components/common/abort-handler.js.map +0 -1
- package/components/common/context.d.ts +0 -25
- package/components/common/context.js.map +0 -1
- package/components/common/controllers/adopt-styles.d.ts +0 -124
- package/components/common/controllers/adopt-styles.js +0 -75
- package/components/common/controllers/adopt-styles.js.map +0 -1
- package/components/common/controllers/async-consumer.js.map +0 -1
- package/components/common/controllers/command.js.map +0 -1
- package/components/common/controllers/drag.js.map +0 -1
- package/components/common/controllers/focus-ring.js.map +0 -1
- package/components/common/controllers/fullscreen.js.map +0 -1
- package/components/common/controllers/gestures.js.map +0 -1
- package/components/common/controllers/id-resolver.js.map +0 -1
- package/components/common/controllers/internals.js.map +0 -1
- package/components/common/controllers/key-bindings.js.map +0 -1
- package/components/common/controllers/mutation-observer.js.map +0 -1
- package/components/common/controllers/resize-observer.js.map +0 -1
- package/components/common/controllers/root-click.js.map +0 -1
- package/components/common/controllers/root-scroll.js +0 -63
- package/components/common/controllers/root-scroll.js.map +0 -1
- package/components/common/controllers/slot.js.map +0 -1
- package/components/common/decorators/blazorAdditionalDependencies.js.map +0 -1
- package/components/common/decorators/blazorDeepImport.js.map +0 -1
- package/components/common/decorators/blazorInclude.js.map +0 -1
- package/components/common/decorators/blazorIndirectRender.js.map +0 -1
- package/components/common/decorators/blazorSuppressComponent.js.map +0 -1
- package/components/common/decorators/shadow-options.js.map +0 -1
- package/components/common/decorators/watch.js.map +0 -1
- package/components/common/definitions/defineAllComponents.js +0 -151
- package/components/common/definitions/defineAllComponents.js.map +0 -1
- package/components/common/definitions/defineComponents.js.map +0 -1
- package/components/common/definitions/register.js.map +0 -1
- package/components/common/i18n/EN/calendar.resources.js.map +0 -1
- package/components/common/i18n/EN/chat.resources.js.map +0 -1
- package/components/common/i18n/EN/date-picker.resources.js.map +0 -1
- package/components/common/i18n/EN/date-range-picker.resources.js.map +0 -1
- package/components/common/i18n/i18n-controller.js.map +0 -1
- package/components/common/i18n/utils.js.map +0 -1
- package/components/common/mixins/alert.js.map +0 -1
- package/components/common/mixins/combo-box.js.map +0 -1
- package/components/common/mixins/constructor.js.map +0 -1
- package/components/common/mixins/event-emitter.js.map +0 -1
- package/components/common/mixins/forms/associated-required.js.map +0 -1
- package/components/common/mixins/forms/associated.js.map +0 -1
- package/components/common/mixins/forms/form-transformers.js.map +0 -1
- package/components/common/mixins/forms/form-value.js.map +0 -1
- package/components/common/mixins/forms/types.js.map +0 -1
- package/components/common/mixins/mask-behavior.js.map +0 -1
- package/components/common/mixins/option.js.map +0 -1
- package/components/common/part-map.js.map +0 -1
- package/components/common/templates/input-shell.js.map +0 -1
- package/components/common/templates/masked-input.js.map +0 -1
- package/components/common/util.d.ts +0 -196
- package/components/common/util.js +0 -390
- package/components/common/util.js.map +0 -1
- package/components/common/validators.js.map +0 -1
- package/components/icon/registry/default-map.d.ts +0 -107
- package/components/icon/registry/default-map.js +0 -25
- package/components/icon/registry/default-map.js.map +0 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js +0 -3
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js.map +0 -1
- package/components/radio/utils.d.ts +0 -13
- package/components/radio/utils.js +0 -37
- package/components/radio/utils.js.map +0 -1
- /package/components/{nav-drawer/themes/shared/container/nav-drawer.fluent.css.d.ts → qr-code/themes/dark/qr-code.bootstrap.css.d.ts} +0 -0
- /package/{components/common → internals}/abort-handler.d.ts +0 -0
- /package/{components/common → internals}/abort-handler.js +0 -0
- /package/{components/common → internals}/controllers/async-consumer.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.d.ts +0 -0
- /package/{components/common → internals}/controllers/command.js +0 -0
- /package/{components/common → internals}/controllers/drag.d.ts +0 -0
- /package/{components/common → internals}/controllers/focus-ring.d.ts +0 -0
- /package/{components/common → internals}/controllers/fullscreen.d.ts +0 -0
- /package/{components/common → internals}/controllers/id-resolver.d.ts +0 -0
- /package/{components/common → internals}/controllers/root-click.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorAdditionalDependencies.js +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorDeepImport.js +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorInclude.js +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorIndirectRender.js +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.d.ts +0 -0
- /package/{components/common → internals}/decorators/blazorSuppressComponent.js +0 -0
- /package/{components/common → internals}/decorators/shadow-options.d.ts +0 -0
- /package/{components/common → internals}/decorators/shadow-options.js +0 -0
- /package/{components/common → internals}/decorators/watch.d.ts +0 -0
- /package/{components/common → internals}/decorators/watch.js +0 -0
- /package/{components/common → internals}/definitions/defineAllComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.d.ts +0 -0
- /package/{components/common → internals}/definitions/defineComponents.js +0 -0
- /package/{components/common → internals}/definitions/register.d.ts +0 -0
- /package/{components/common → internals}/definitions/register.js +0 -0
- /package/{components/common → internals}/i18n/EN/calendar.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/chat.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.d.ts +0 -0
- /package/{components/common → internals}/i18n/EN/date-range-picker.resources.js +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.d.ts +0 -0
- /package/{components/common → internals}/i18n/i18n-controller.js +0 -0
- /package/{components/common → internals}/i18n/utils.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.d.ts +0 -0
- /package/{components/common → internals}/mixins/constructor.js +0 -0
- /package/{components/common → internals}/mixins/event-emitter.d.ts +0 -0
- /package/{components/common → internals}/mixins/event-emitter.js +0 -0
- /package/{components/common → internals}/mixins/forms/associated-required.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/associated.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.d.ts +0 -0
- /package/{components/common → internals}/mixins/forms/form-value.js +0 -0
- /package/{components/common → internals}/mixins/forms/types.js +0 -0
- /package/{components/common → internals}/part-map.d.ts +0 -0
- /package/{components/common → internals}/part-map.js +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Finds the first element in the event's composed path that matches the provided predicate, which can be either a string selector or a function.
|
|
3
|
+
*
|
|
4
|
+
* @param predicate - A string representing a CSS selector or a function that takes an Element and returns a boolean indicating a match.
|
|
5
|
+
* @param event - The event whose composed path will be searched for the matching element.
|
|
6
|
+
* @returns The first Element that matches the predicate, or undefined if no match is found.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* // Using a string selector
|
|
11
|
+
* const button = getElementFromPath('button', event);
|
|
12
|
+
* ```
|
|
13
|
+
* ```typescript
|
|
14
|
+
* // Using a predicate function
|
|
15
|
+
* const customElement = getElementFromPath((el) => el.tagName === 'MY-ELEMENT', event);
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function getElementFromPath<K extends keyof HTMLElementTagNameMap>(predicate: K, event: Event): HTMLElementTagNameMap[K] | undefined;
|
|
19
|
+
export declare function getElementFromPath<T extends Element>(predicate: string | ((element: Element) => boolean), event: Event): T | undefined;
|
|
20
|
+
/** Reusable event listener that just stops the propagation of the event. */
|
|
21
|
+
export declare function stopPropagation(event: Event): void;
|
|
22
|
+
/**
|
|
23
|
+
* Returns whether focus has moved outside of the given host element for
|
|
24
|
+
* a `focusout`/`blur` event, that is the element gaining focus is not
|
|
25
|
+
* a descendant of the host.
|
|
26
|
+
*/
|
|
27
|
+
export declare function focusLeftHost(host: Element, event: FocusEvent): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Adds an event listener that holds only a weak reference to the passed
|
|
30
|
+
* `listener`, thus not preventing it from being garbage collected.
|
|
31
|
+
*/
|
|
32
|
+
export declare function addWeakEventListener(element: Element, event: string, listener: EventListenerOrEventListenerObject, options?: AddEventListenerOptions | boolean): void;
|
|
33
|
+
type EventTypeOf<T extends keyof HTMLElementEventMap | keyof WindowEventMap> = (HTMLElementEventMap & WindowEventMap)[T];
|
|
34
|
+
/**
|
|
35
|
+
* Safely adds an event listener to an HTMLElement, automatically handling
|
|
36
|
+
* server-side rendering environments by doing nothing if `isServer` is true.
|
|
37
|
+
* This function also correctly binds the `handler`'s `this` context to the `target` element
|
|
38
|
+
* and ensures proper event type inference.
|
|
39
|
+
*/
|
|
40
|
+
export declare function addSafeEventListener<E extends keyof HTMLElementEventMap | keyof WindowEventMap>(target: HTMLElement, eventName: E, handler: (event: EventTypeOf<E>) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
41
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { isServer } from 'lit';
|
|
2
|
+
import { isElement } from './dom.js';
|
|
3
|
+
import { isEventListenerObject, isString } from './types.js';
|
|
4
|
+
export function getElementFromPath(predicate, event) {
|
|
5
|
+
const func = isString(predicate)
|
|
6
|
+
? (e) => e.matches(predicate)
|
|
7
|
+
: (e) => predicate(e);
|
|
8
|
+
return Iterator.from(event.composedPath()).find((item) => isElement(item) && func(item));
|
|
9
|
+
}
|
|
10
|
+
export function stopPropagation(event) {
|
|
11
|
+
event.stopPropagation();
|
|
12
|
+
}
|
|
13
|
+
export function focusLeftHost(host, event) {
|
|
14
|
+
return !host.contains(event.relatedTarget);
|
|
15
|
+
}
|
|
16
|
+
export function addWeakEventListener(element, event, listener, options) {
|
|
17
|
+
const weakRef = new WeakRef(listener);
|
|
18
|
+
const wrapped = (evt) => {
|
|
19
|
+
const handler = weakRef.deref();
|
|
20
|
+
if (!handler) {
|
|
21
|
+
element.removeEventListener(event, wrapped, options);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
return isEventListenerObject(handler)
|
|
25
|
+
? handler.handleEvent(evt)
|
|
26
|
+
: handler(evt);
|
|
27
|
+
};
|
|
28
|
+
element.addEventListener(event, wrapped, options);
|
|
29
|
+
}
|
|
30
|
+
export function addSafeEventListener(target, eventName, handler, options) {
|
|
31
|
+
if (isServer) {
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
const boundHandler = (event) => handler.call(target, event);
|
|
35
|
+
target.addEventListener(eventName, boundHandler, options);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.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AAO,EAAE,OAAO,CAAC,CAAC;YACrD,OAAO;QACT,CAAC;QAED,OAAO,qBAAqB,CAAC,OAAO,CAAC;YACnC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC;YAC1B,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACnB,CAAC,CAAC;IAEF,OAAO,CAAC,gBAAgB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC;AAWD,MAAM,UAAU,oBAAoB,CAGlC,MAAmB,EACnB,SAAY,EACZ,OAA2C,EAC3C,OAA2C;IAE3C,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAED,MAAM,YAAY,GAAG,CAAC,KAAY,EAAE,EAAE,CACpC,OAAO,CAAC,IAAI,CAAC,MAAM,EAAE,KAAuB,CAAC,CAAC;IAEhD,MAAM,CAAC,gBAAgB,CAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC","sourcesContent":["import { isServer } from 'lit';\nimport { isElement } from './dom.js';\nimport { isEventListenerObject, isString } from './types.js';\n\n/**\n * Finds the first element in the event's composed path that matches the provided predicate, which can be either a string selector or a function.\n *\n * @param predicate - A string representing a CSS selector or a function that takes an Element and returns a boolean indicating a match.\n * @param event - The event whose composed path will be searched for the matching element.\n * @returns The first Element that matches the predicate, or undefined if no match is found.\n *\n * @example\n * ```typescript\n * // Using a string selector\n * const button = getElementFromPath('button', event);\n * ```\n * ```typescript\n * // Using a predicate function\n * const customElement = getElementFromPath((el) => el.tagName === 'MY-ELEMENT', event);\n * ```\n */\nexport function getElementFromPath<K extends keyof HTMLElementTagNameMap>(\n predicate: K,\n event: Event\n): HTMLElementTagNameMap[K] | undefined;\nexport function getElementFromPath<T extends Element>(\n predicate: string | ((element: Element) => boolean),\n event: Event\n): T | undefined;\nexport function getElementFromPath(\n predicate: string | ((element: Element) => boolean),\n event: Event\n) {\n const func = isString(predicate)\n ? (e: Element) => e.matches(predicate)\n : (e: Element) => predicate(e);\n\n return Iterator.from(event.composedPath()).find(\n (item) => isElement(item) && func(item)\n ) as Element | undefined;\n}\n\n/** Reusable event listener that just stops the propagation of the event. */\nexport function stopPropagation(event: Event): void {\n event.stopPropagation();\n}\n\n/**\n * Returns whether focus has moved outside of the given host element for\n * a `focusout`/`blur` event, that is the element gaining focus is not\n * a descendant of the host.\n */\nexport function focusLeftHost(host: Element, event: FocusEvent): boolean {\n return !host.contains(event.relatedTarget as Node | null);\n}\n\n/**\n * Adds an event listener that holds only a weak reference to the passed\n * `listener`, thus not preventing it from being garbage collected.\n */\nexport function addWeakEventListener(\n element: Element,\n event: string,\n listener: EventListenerOrEventListenerObject,\n options?: AddEventListenerOptions | boolean\n): void {\n const weakRef = new WeakRef(listener);\n const wrapped = (evt: Event) => {\n const handler = weakRef.deref();\n\n if (!handler) {\n // The listener has been garbage collected - detach the wrapper as well\n element.removeEventListener(event, wrapped, options);\n return;\n }\n\n return isEventListenerObject(handler)\n ? handler.handleEvent(evt)\n : handler(evt);\n };\n\n element.addEventListener(event, wrapped, options);\n}\n\ntype EventTypeOf<T extends keyof HTMLElementEventMap | keyof WindowEventMap> =\n (HTMLElementEventMap & WindowEventMap)[T];\n\n/**\n * Safely adds an event listener to an HTMLElement, automatically handling\n * server-side rendering environments by doing nothing if `isServer` is true.\n * This function also correctly binds the `handler`'s `this` context to the `target` element\n * and ensures proper event type inference.\n */\nexport function addSafeEventListener<\n E extends keyof HTMLElementEventMap | keyof WindowEventMap,\n>(\n target: HTMLElement,\n eventName: E,\n handler: (event: EventTypeOf<E>) => unknown,\n options?: boolean | AddEventListenerOptions\n): void {\n if (isServer) {\n return;\n }\n\n const boundHandler = (event: Event) =>\n handler.call(target, event as EventTypeOf<E>);\n\n target.addEventListener(eventName, boundHandler, options);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TemplateResult } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* Similar to Lit's `ifDefined` directive except one can check `assertion`
|
|
4
|
+
* and bind a different `value` through this wrapper.
|
|
5
|
+
*/
|
|
6
|
+
export declare function bindIf<T>(assertion: unknown, value: T): NonNullable<T>;
|
|
7
|
+
/** @internal */
|
|
8
|
+
export declare function trimmedHtml(strings: TemplateStringsArray, ...values: unknown[]): TemplateResult;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { html, nothing } from 'lit';
|
|
2
|
+
export function bindIf(assertion, value) {
|
|
3
|
+
return assertion
|
|
4
|
+
? (value ?? nothing)
|
|
5
|
+
: nothing;
|
|
6
|
+
}
|
|
7
|
+
const trimmedCache = new WeakMap();
|
|
8
|
+
export function trimmedHtml(strings, ...values) {
|
|
9
|
+
if (!trimmedCache.has(strings)) {
|
|
10
|
+
const trimmedStrings = strings.map((s) => s.trim().replaceAll('\n', ''));
|
|
11
|
+
trimmedCache.set(strings, Object.assign([...trimmedStrings], { raw: [...strings.raw] }));
|
|
12
|
+
}
|
|
13
|
+
return html(trimmedCache.get(strings), ...values);
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=lit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lit.js","sourceRoot":"","sources":["../../../src/internals/utils/lit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAuB,MAAM,KAAK,CAAC;AAMzD,MAAM,UAAU,MAAM,CAAI,SAAkB,EAAE,KAAQ;IACpD,OAAO,SAAS;QACd,CAAC,CAAC,CAAC,KAAK,IAAK,OAA0B,CAAC;QACxC,CAAC,CAAE,OAA0B,CAAC;AAClC,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,OAAO,EAA8C,CAAC;AAG/E,MAAM,UAAU,WAAW,CACzB,OAA6B,EAC7B,GAAG,MAAiB;IAEpB,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;QAC/B,MAAM,cAAc,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;QACzE,YAAY,CAAC,GAAG,CACd,OAAO,EACP,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,cAAc,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAC9D,CAAC;IACJ,CAAC;IAED,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,OAAO,CAAE,EAAE,GAAG,MAAM,CAAC,CAAC;AACrD,CAAC","sourcesContent":["import { html, nothing, type TemplateResult } from 'lit';\n\n/**\n * Similar to Lit's `ifDefined` directive except one can check `assertion`\n * and bind a different `value` through this wrapper.\n */\nexport function bindIf<T>(assertion: unknown, value: T): NonNullable<T> {\n return assertion\n ? (value ?? (nothing as NonNullable<T>))\n : (nothing as NonNullable<T>);\n}\n\nconst trimmedCache = new WeakMap<TemplateStringsArray, TemplateStringsArray>();\n\n/** @internal */\nexport function trimmedHtml(\n strings: TemplateStringsArray,\n ...values: unknown[]\n): TemplateResult {\n if (!trimmedCache.has(strings)) {\n const trimmedStrings = strings.map((s) => s.trim().replaceAll('\\n', ''));\n trimmedCache.set(\n strings,\n Object.assign([...trimmedStrings], { raw: [...strings.raw] })\n );\n }\n\n return html(trimmedCache.get(strings)!, ...values);\n}\n"]}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Returns `part` as a percentage of `whole`. */
|
|
2
|
+
export declare function asPercent(part: number, whole: number): number;
|
|
3
|
+
/** Clamps the given number between the min and max bounds (inclusive). */
|
|
4
|
+
export declare function clamp(number: number, min: number, max: number): number;
|
|
5
|
+
/** Returns the number of decimal places of the given number. */
|
|
6
|
+
export declare function numberOfDecimals(number: number): number;
|
|
7
|
+
/**
|
|
8
|
+
* Rounds a number to the given order of magnitude (number of decimal places).
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```typescript
|
|
12
|
+
* roundPrecise(3.14159, 2); // 3.14
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export declare function roundPrecise(number: number, magnitude?: number): number;
|
|
16
|
+
/** Returns whether the given value lies between the min and max bounds (inclusive). */
|
|
17
|
+
export declare function numberInRangeInclusive(value: number, min: number, max: number): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Parse the passed `value` as a number or return the `fallback` if it can't be done.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* asNumber('5'); // 5
|
|
24
|
+
* asNumber('3.14'); // 3.14
|
|
25
|
+
* asNumber('five'); // 0
|
|
26
|
+
* asNumber('five', 5); // 5
|
|
27
|
+
* asNumber(undefined, 10); // 10
|
|
28
|
+
* asNumber(null, 10); // 10
|
|
29
|
+
* asNumber(NaN, 10); // 10
|
|
30
|
+
* asNumber(Infinity, 10); // 10
|
|
31
|
+
* asNumber(-Infinity, 10); // 10
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare function asNumber(value: unknown, fallback?: number): number;
|
|
35
|
+
/**
|
|
36
|
+
* Returns the value wrapped between the min and max bounds.
|
|
37
|
+
*
|
|
38
|
+
* If the value is greater than max, returns the min and vice-versa.
|
|
39
|
+
* If the value is between the bounds, it is returned unchanged.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* wrap(1, 4, 2); // 2
|
|
44
|
+
* wrap(1, 4, 5); // 1
|
|
45
|
+
* wrap(1, 4, -1); // 4
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
export declare function wrap(min: number, max: number, value: number): number;
|
|
49
|
+
/** Euclidean modulo — like `%` but the result always has the sign of the divisor. */
|
|
50
|
+
export declare function modulo(n: number, d: number): number;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
export function asPercent(part, whole) {
|
|
2
|
+
return (part / whole) * 100;
|
|
3
|
+
}
|
|
4
|
+
export function clamp(number, min, max) {
|
|
5
|
+
return Math.max(min, Math.min(number, max));
|
|
6
|
+
}
|
|
7
|
+
export function numberOfDecimals(number) {
|
|
8
|
+
if (!Number.isFinite(number) || Number.isInteger(number)) {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
const [mantissa, exponent] = number.toString().split('e-');
|
|
12
|
+
const decimals = mantissa.split('.')[1]?.length ?? 0;
|
|
13
|
+
return exponent ? decimals + Number(exponent) : decimals;
|
|
14
|
+
}
|
|
15
|
+
export function roundPrecise(number, magnitude = 1) {
|
|
16
|
+
const factor = 10 ** magnitude;
|
|
17
|
+
return Math.round(number * factor) / factor;
|
|
18
|
+
}
|
|
19
|
+
export function numberInRangeInclusive(value, min, max) {
|
|
20
|
+
return value >= min && value <= max;
|
|
21
|
+
}
|
|
22
|
+
export function asNumber(value, fallback = 0) {
|
|
23
|
+
const parsed = Number.parseFloat(value);
|
|
24
|
+
return Number.isFinite(parsed) ? parsed : fallback;
|
|
25
|
+
}
|
|
26
|
+
export function wrap(min, max, value) {
|
|
27
|
+
if (value < min) {
|
|
28
|
+
return max;
|
|
29
|
+
}
|
|
30
|
+
if (value > max) {
|
|
31
|
+
return min;
|
|
32
|
+
}
|
|
33
|
+
return value;
|
|
34
|
+
}
|
|
35
|
+
export function modulo(n, d) {
|
|
36
|
+
return ((n % d) + d) % d;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=math.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"math.js","sourceRoot":"","sources":["../../../src/internals/utils/math.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,OAAO,CAAC,IAAI,GAAG,KAAK,CAAC,GAAG,GAAG,CAAC;AAC9B,CAAC;AAGD,MAAM,UAAU,KAAK,CAAC,MAAc,EAAE,GAAW,EAAE,GAAW;IAC5D,OAAO,IAAI,C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I,CAAC,GAAW,EAAE,GAAW,EAAE,KAAa;IAC1D,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IACD,IAAI,KAAK,GAAG,GAAG,EAAE,CAAC;QAChB,OAAO,GAAG,CAAC;IACb,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAGD,MAAM,UAAU,MAAM,CAAC,CAAS,EAAE,CAAS;IACzC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3B,CAAC","sourcesContent":["/** Returns `part` as a percentage of `whole`. */\nexport function asPercent(part: number, whole: number): number {\n return (part / whole) * 100;\n}\n\n/** Clamps the given number between the min and max bounds (inclusive). */\nexport function clamp(number: number, min: number, max: number): number {\n return Math.max(min, Math.min(number, max));\n}\n\n/** Returns the number of decimal places of the given number. */\nexport function numberOfDecimals(number: number): number {\n if (!Number.isFinite(number) || Number.isInteger(number)) {\n return 0;\n }\n\n // Exponential notation, e.g. `1.5e-7` -> 1 mantissa decimal + 7 exponent places\n const [mantissa, exponent] = number.toString().split('e-');\n const decimals = mantissa.split('.')[1]?.length ?? 0;\n\n return exponent ? decimals + Number(exponent) : decimals;\n}\n\n/**\n * Rounds a number to the given order of magnitude (number of decimal places).\n *\n * @example\n * ```typescript\n * roundPrecise(3.14159, 2); // 3.14\n * ```\n */\nexport function roundPrecise(number: number, magnitude = 1): number {\n const factor = 10 ** magnitude;\n return Math.round(number * factor) / factor;\n}\n\n/** Returns whether the given value lies between the min and max bounds (inclusive). */\nexport function numberInRangeInclusive(\n value: number,\n min: number,\n max: number\n) {\n return value >= min && value <= max;\n}\n\n/**\n * Parse the passed `value` as a number or return the `fallback` if it can't be done.\n *\n * @example\n * ```typescript\n * asNumber('5'); // 5\n * asNumber('3.14'); // 3.14\n * asNumber('five'); // 0\n * asNumber('five', 5); // 5\n * asNumber(undefined, 10); // 10\n * asNumber(null, 10); // 10\n * asNumber(NaN, 10); // 10\n * asNumber(Infinity, 10); // 10\n * asNumber(-Infinity, 10); // 10\n * ```\n */\nexport function asNumber(value: unknown, fallback = 0): number {\n const parsed = Number.parseFloat(value as string);\n return Number.isFinite(parsed) ? parsed : fallback;\n}\n\n/**\n * Returns the value wrapped between the min and max bounds.\n *\n * If the value is greater than max, returns the min and vice-versa.\n * If the value is between the bounds, it is returned unchanged.\n *\n * @example\n * ```typescript\n * wrap(1, 4, 2); // 2\n * wrap(1, 4, 5); // 1\n * wrap(1, 4, -1); // 4\n * ```\n */\nexport function wrap(min: number, max: number, value: number) {\n if (value < min) {\n return max;\n }\n if (value > max) {\n return min;\n }\n\n return value;\n}\n\n/** Euclidean modulo — like `%` but the result always has the sign of the divisor. */\nexport function modulo(n: number, d: number) {\n return ((n % d) + d) % d;\n}\n"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Pairs currently being compared, so a cycle terminates without swallowing real differences. */
|
|
2
|
+
type Visited = WeakMap<object, WeakSet<object>>;
|
|
3
|
+
/**
|
|
4
|
+
* Performs a deep structural equality check between two values, handling
|
|
5
|
+
* arrays, Maps, Sets, RegExps, POJOs and circular references.
|
|
6
|
+
*/
|
|
7
|
+
export declare function equal<T>(a: unknown, b: T, visited?: Visited): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Merges the properties of `source` into `target` performing a recursive deep merge over POJOs and arrays.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* This function mutates the `target` object.
|
|
13
|
+
* If that is not the desired outcome, see {@link toMerged} for another approach.
|
|
14
|
+
*/
|
|
15
|
+
export declare function merge<T extends Record<PropertyKey, any>, S extends Record<PropertyKey, any>>(target: T, source: S): T & S;
|
|
16
|
+
/**
|
|
17
|
+
* Just like {@link merge} but it does not mutate the `target` object instead
|
|
18
|
+
* mutating a structured clone of it.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* Since it relies on `structuredClone`, the `target` must not contain
|
|
22
|
+
* non-cloneable values such as functions, DOM nodes or class instances.
|
|
23
|
+
*/
|
|
24
|
+
export declare function toMerged<T extends Record<PropertyKey, any>, S extends Record<PropertyKey, any>>(target: T, source: S): T & S;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { isObject, isPlainObject, isRegExp } from './types.js';
|
|
2
|
+
function isUnsafeProperty(key) {
|
|
3
|
+
return key === '__proto__' || key === 'constructor' || key === 'prototype';
|
|
4
|
+
}
|
|
5
|
+
export function equal(a, b, visited = new WeakMap()) {
|
|
6
|
+
if (Object.is(a, b))
|
|
7
|
+
return true;
|
|
8
|
+
if (!isObject(a) || !isObject(b))
|
|
9
|
+
return false;
|
|
10
|
+
if (a.constructor !== b.constructor)
|
|
11
|
+
return false;
|
|
12
|
+
let pending = visited.get(a);
|
|
13
|
+
if (pending?.has(b))
|
|
14
|
+
return true;
|
|
15
|
+
if (!pending) {
|
|
16
|
+
pending = new WeakSet();
|
|
17
|
+
visited.set(a, pending);
|
|
18
|
+
}
|
|
19
|
+
pending.add(b);
|
|
20
|
+
try {
|
|
21
|
+
return compare(a, b, visited);
|
|
22
|
+
}
|
|
23
|
+
finally {
|
|
24
|
+
pending.delete(b);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function compare(a, b, visited) {
|
|
28
|
+
if (isRegExp(a) && isRegExp(b))
|
|
29
|
+
return a.source === b.source && a.flags === b.flags;
|
|
30
|
+
if (a instanceof Map && b instanceof Map) {
|
|
31
|
+
if (a.size !== b.size)
|
|
32
|
+
return false;
|
|
33
|
+
for (const [keyA, valueA] of a.entries()) {
|
|
34
|
+
let found = false;
|
|
35
|
+
for (const [keyB, valueB] of b.entries()) {
|
|
36
|
+
if (equal(keyA, keyB, visited) && equal(valueA, valueB, visited)) {
|
|
37
|
+
found = true;
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
if (!found)
|
|
42
|
+
return false;
|
|
43
|
+
}
|
|
44
|
+
return true;
|
|
45
|
+
}
|
|
46
|
+
if (a instanceof Set && b instanceof Set) {
|
|
47
|
+
if (a.size !== b.size)
|
|
48
|
+
return false;
|
|
49
|
+
for (const valueA of a) {
|
|
50
|
+
let found = false;
|
|
51
|
+
for (const valueB of b) {
|
|
52
|
+
if (equal(valueA, valueB, visited)) {
|
|
53
|
+
found = true;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (!found)
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
return true;
|
|
61
|
+
}
|
|
62
|
+
if (Array.isArray(a) && Array.isArray(b)) {
|
|
63
|
+
const length = a.length;
|
|
64
|
+
if (length !== b.length)
|
|
65
|
+
return false;
|
|
66
|
+
for (let i = 0; i < length; i++) {
|
|
67
|
+
if (!equal(a[i], b[i], visited))
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
if (a.valueOf !== Object.prototype.valueOf)
|
|
73
|
+
return a.valueOf() === b.valueOf();
|
|
74
|
+
if (a.toString !== Object.prototype.toString)
|
|
75
|
+
return a.toString() === b.toString();
|
|
76
|
+
const aKeys = Object.keys(a);
|
|
77
|
+
const bKeys = Object.keys(b);
|
|
78
|
+
if (aKeys.length !== bKeys.length)
|
|
79
|
+
return false;
|
|
80
|
+
for (const key of aKeys) {
|
|
81
|
+
if (!Object.hasOwn(b, key))
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
for (const key of aKeys) {
|
|
85
|
+
if (!equal(a[key], b[key], visited))
|
|
86
|
+
return false;
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
export function merge(target, source) {
|
|
91
|
+
const sourceKeys = Object.keys(source);
|
|
92
|
+
const length = sourceKeys.length;
|
|
93
|
+
for (let i = 0; i < length; i++) {
|
|
94
|
+
const key = sourceKeys[i];
|
|
95
|
+
if (isUnsafeProperty(key)) {
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
const sourceValue = source[key];
|
|
99
|
+
const targetValue = target[key];
|
|
100
|
+
if (Array.isArray(sourceValue)) {
|
|
101
|
+
if (Array.isArray(targetValue)) {
|
|
102
|
+
target[key] = merge(targetValue, sourceValue);
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
target[key] = merge([], sourceValue);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
else if (isPlainObject(sourceValue)) {
|
|
109
|
+
if (isPlainObject(targetValue)) {
|
|
110
|
+
target[key] = merge(targetValue, sourceValue);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
target[key] = merge({}, sourceValue);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else if (targetValue === undefined || sourceValue !== undefined) {
|
|
117
|
+
target[key] = sourceValue;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
return target;
|
|
121
|
+
}
|
|
122
|
+
export function toMerged(target, source) {
|
|
123
|
+
return merge(structuredClone(target), source);
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=objects.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objects.js","sourceRoot":"","sources":["../../../src/internals/utils/objects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE/D,SAAS,gBAAgB,CAAC,GAAgB;IACxC,OAAO,GAAG,KAAK,WAAW,IAAI,GAAG,KAAK,aAAa,IAAI,GAAG,KAAK,WAAW,CAAC;AAC7E,CAAC;AASD,MAAM,UAAU,KAAK,CACnB,CAAU,EACV,CAAI,EACJ,UAAmB,IAAI,OAAO,EAAE;IAGhC,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAEjC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,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AC;QAE1B,IAAI,gBAAgB,CAAC,GAAG,CAAC,EAAE,CAAC;YAC1B,SAAS;QACX,CAAC;QAED,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAChC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAEhC,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;YAC/B,IAAI,KAAK,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;aAAM,IAAI,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;YACtC,IAAI,aAAa,CAAC,WAAW,CAAC,EAAE,CAAC;gBAC/B,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;YAChD,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;YACvC,CAAC;QACH,CAAC;aAAM,IAAI,WAAW,KAAK,SAAS,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAClE,MAAM,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC;QAC5B,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAUD,MAAM,UAAU,QAAQ,CAGtB,MAAS,EAAE,MAAS;IACpB,OAAO,KAAK,CAAC,eAAe,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAChD,CAAC","sourcesContent":["import { isObject, isPlainObject, isRegExp } from './types.js';\n\nfunction isUnsafeProperty(key: PropertyKey) {\n return key === '__proto__' || key === 'constructor' || key === 'prototype';\n}\n\n/** Pairs currently being compared, so a cycle terminates without swallowing real differences. */\ntype Visited = WeakMap<object, WeakSet<object>>;\n\n/**\n * Performs a deep structural equality check between two values, handling\n * arrays, Maps, Sets, RegExps, POJOs and circular references.\n */\nexport function equal<T>(\n a: unknown,\n b: T,\n visited: Visited = new WeakMap()\n): boolean {\n // Early return\n if (Object.is(a, b)) return true;\n\n if (!isObject(a) || !isObject(b)) return false;\n if (a.constructor !== b.constructor) return false;\n\n // Circular references. This tracks the *pair*, not the two objects separately: the Map and Set\n // comparisons below probe candidates they expect to fail, and marking those objects on their own\n // would make a later comparison of the same pair short circuit to `true`.\n let pending = visited.get(a);\n if (pending?.has(b)) return true;\n\n if (!pending) {\n pending = new WeakSet();\n visited.set(a, pending);\n }\n pending.add(b);\n\n try {\n return compare(a, b, visited);\n } finally {\n // Always release the pair, including on the early returns in `compare`.\n pending.delete(b);\n }\n}\n\nfunction compare(a: object, b: object, visited: Visited): boolean {\n // RegExp\n if (isRegExp(a) && isRegExp(b))\n return a.source === b.source && a.flags === b.flags;\n\n // Maps\n if (a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) return false;\n for (const [keyA, valueA] of a.entries()) {\n let found = false;\n for (const [keyB, valueB] of b.entries()) {\n if (equal(keyA, keyB, visited) && equal(valueA, valueB, visited)) {\n found = true;\n break;\n }\n }\n if (!found) return false;\n }\n return true;\n }\n\n // Sets\n if (a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) return false;\n for (const valueA of a) {\n let found = false;\n for (const valueB of b) {\n if (equal(valueA, valueB, visited)) {\n found = true;\n break;\n }\n }\n if (!found) return false;\n }\n return true;\n }\n\n // Arrays\n if (Array.isArray(a) && Array.isArray(b)) {\n const length = a.length;\n if (length !== b.length) return false;\n for (let i = 0; i < length; i++) {\n if (!equal(a[i], b[i], visited)) return false;\n }\n return true;\n }\n\n // toPrimitive\n if (a.valueOf !== Object.prototype.valueOf)\n return a.valueOf() === b.valueOf();\n // Strings based\n if (a.toString !== Object.prototype.toString)\n return a.toString() === b.toString();\n\n const aKeys = Object.keys(a);\n const bKeys = Object.keys(b);\n if (aKeys.length !== bKeys.length) return false;\n\n for (const key of aKeys) {\n if (!Object.hasOwn(b, key)) return false;\n }\n\n for (const key of aKeys) {\n if (!equal(a[key as keyof typeof a], b[key as keyof typeof b], visited))\n return false;\n }\n\n return true;\n}\n\n/**\n * Merges the properties of `source` into `target` performing a recursive deep merge over POJOs and arrays.\n *\n * @remarks\n * This function mutates the `target` object.\n * If that is not the desired outcome, see {@link toMerged} for another approach.\n */\nexport function merge<\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(target: T, source: S): T & S {\n const sourceKeys = Object.keys(source) as Array<keyof S>;\n const length = sourceKeys.length;\n\n for (let i = 0; i < length; i++) {\n const key = sourceKeys[i];\n\n if (isUnsafeProperty(key)) {\n continue;\n }\n\n const sourceValue = source[key];\n const targetValue = target[key];\n\n if (Array.isArray(sourceValue)) {\n if (Array.isArray(targetValue)) {\n target[key] = merge(targetValue, sourceValue);\n } else {\n target[key] = merge([], sourceValue);\n }\n } else if (isPlainObject(sourceValue)) {\n if (isPlainObject(targetValue)) {\n target[key] = merge(targetValue, sourceValue);\n } else {\n target[key] = merge({}, sourceValue);\n }\n } else if (targetValue === undefined || sourceValue !== undefined) {\n target[key] = sourceValue;\n }\n }\n\n return target;\n}\n\n/**\n * Just like {@link merge} but it does not mutate the `target` object instead\n * mutating a structured clone of it.\n *\n * @remarks\n * Since it relies on `structuredClone`, the `target` must not contain\n * non-cloneable values such as functions, DOM nodes or class instances.\n */\nexport function toMerged<\n T extends Record<PropertyKey, any>,\n S extends Record<PropertyKey, any>,\n>(target: T, source: S): T & S {\n return merge(structuredClone(target), source);\n}\n"]}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds a string from format specifiers and replacement parameters.
|
|
3
|
+
* Will coerce non-string parameters to their string representations.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```typescript
|
|
7
|
+
* formatString('{0} says "{1}".', 'John', 'Hello'); // 'John says "Hello".'
|
|
8
|
+
* formatString('{1} is greater than {0}', 0, 1); // '1 is greater than 0'
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare function formatString(template: string, ...params: unknown[]): string;
|
|
12
|
+
/**
|
|
13
|
+
* Splits a string into its words, treating whitespace, `-`, `_` and
|
|
14
|
+
* camelCase boundaries as separators.
|
|
15
|
+
*/
|
|
16
|
+
export declare function splitToWords(text: string): string[];
|
|
17
|
+
/** Converts a string to kebab-case. */
|
|
18
|
+
export declare function toKebabCase(text: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Escapes any potential regex syntax characters in a string, and returns a new string
|
|
21
|
+
* that can be safely used as a literal pattern for the `RegExp()` constructor.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Substitute with `RegExp.escape` once it has enough support:
|
|
25
|
+
*
|
|
26
|
+
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape#browser_compatibility
|
|
27
|
+
*/
|
|
28
|
+
export declare function escapeRegex(value: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Creates a generator of monotonically increasing DOM ids based on the given prefix.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const nextId = createIdGenerator('radio');
|
|
35
|
+
* nextId(); // 'radio-1'
|
|
36
|
+
* nextId(); // 'radio-2'
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
export declare function createIdGenerator(prefix: string): () => string;
|
|
40
|
+
/**
|
|
41
|
+
* Generates a unique string ID of the specified size using a URL-friendly alphabet.
|
|
42
|
+
* The default size is 21 characters, which provides a very low probability of collisions.
|
|
43
|
+
*/
|
|
44
|
+
export declare function nanoid(size?: number): string;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export function formatString(template, ...params) {
|
|
2
|
+
const length = params.length;
|
|
3
|
+
return template.replace(/{(\d+)}/g, (match, index) => index >= length ? match : `${params[index]}`);
|
|
4
|
+
}
|
|
5
|
+
export function splitToWords(text) {
|
|
6
|
+
const input = text.replaceAll(/[^a-zA-Z0-9\s-_]/g, '');
|
|
7
|
+
if (/[\s-_]+/.test(input))
|
|
8
|
+
return input.split(/[\s-_]+/);
|
|
9
|
+
return input.split(/(?=[A-Z])+/);
|
|
10
|
+
}
|
|
11
|
+
export function toKebabCase(text) {
|
|
12
|
+
const input = text.trim();
|
|
13
|
+
return splitToWords(input).join('-').toLowerCase();
|
|
14
|
+
}
|
|
15
|
+
export function escapeRegex(value) {
|
|
16
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
17
|
+
}
|
|
18
|
+
export function createIdGenerator(prefix) {
|
|
19
|
+
let id = 0;
|
|
20
|
+
return () => `${prefix}-${++id}`;
|
|
21
|
+
}
|
|
22
|
+
let pool;
|
|
23
|
+
let poolOffset;
|
|
24
|
+
const urlAlphabet = 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';
|
|
25
|
+
function fillPool(bytes) {
|
|
26
|
+
if (!pool || pool.length < bytes) {
|
|
27
|
+
pool = new Uint8Array(new ArrayBuffer(bytes * 128));
|
|
28
|
+
crypto.getRandomValues(pool);
|
|
29
|
+
poolOffset = 0;
|
|
30
|
+
}
|
|
31
|
+
else if (poolOffset + bytes > pool.length) {
|
|
32
|
+
crypto.getRandomValues(pool);
|
|
33
|
+
poolOffset = 0;
|
|
34
|
+
}
|
|
35
|
+
poolOffset += bytes;
|
|
36
|
+
}
|
|
37
|
+
export function nanoid(size = 21) {
|
|
38
|
+
const bytes = size | 0;
|
|
39
|
+
fillPool(bytes);
|
|
40
|
+
let id = '';
|
|
41
|
+
for (let i = poolOffset - bytes; i < poolOffset; i++) {
|
|
42
|
+
id += urlAlphabet[pool[i] & 63];
|
|
43
|
+
}
|
|
44
|
+
return id;
|
|
45
|
+
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CAAC;AAClC,IAAI,UAAkB,CAAC;AACvB,MAAM,WAAW,GACf,kEAAkE,CAAC;AAErE,SAAS,QAAQ,CAAC,KAAa;IAC7B,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,MAAM,GAAG,KAAK,EAAE,CAAC;QACjC,IAAI,GAAG,IAAI,UAAU,CAAC,IAAI,WAAW,CAAC,KAAK,GAAG,GAAG,CAAC,CAAC,CAAC;QACpD,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7B,UAAU,GAAG,CAAC,CAAC;IACjB,CAAC;SAAM,IAAI,UAAU,GAAG,KAAK,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QAC5C,MAAM,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;QAC7B,UAAU,GAAG,CAAC,CAAC;IACjB,CAAC;IACD,UAAU,IAAI,KAAK,CAAC;AACtB,CAAC;AAMD,MAAM,UAAU,MAAM,CAAC,IAAI,GAAG,EAAE;IAC9B,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,CAAC;IAEhB,IAAI,EAAE,GAAG,EAAE,CAAC;IACZ,KAAK,IAAI,CAAC,GAAG,UAAU,GAAG,KAAK,EAAE,CAAC,GAAG,UAAU,EAAE,CAAC,EAAE,EAAE,CAAC;QACrD,EAAE,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;IAClC,CAAC;IAED,OAAO,EAAE,CAAC;AACZ,CAAC","sourcesContent":["/**\n * Builds a string from format specifiers and replacement parameters.\n * Will coerce non-string parameters to their string representations.\n *\n * @example\n * ```typescript\n * formatString('{0} says \"{1}\".', 'John', 'Hello'); // 'John says \"Hello\".'\n * formatString('{1} is greater than {0}', 0, 1); // '1 is greater than 0'\n * ```\n */\nexport function formatString(template: string, ...params: unknown[]): string {\n const length = params.length;\n\n return template.replace(/{(\\d+)}/g, (match: string, index: number) =>\n index >= length ? match : `${params[index]}`\n );\n}\n\n/**\n * Splits a string into its words, treating whitespace, `-`, `_` and\n * camelCase boundaries as separators.\n */\nexport function splitToWords(text: string) {\n const input = text.replaceAll(/[^a-zA-Z0-9\\s-_]/g, '');\n if (/[\\s-_]+/.test(input)) return input.split(/[\\s-_]+/);\n return input.split(/(?=[A-Z])+/);\n}\n\n/** Converts a string to kebab-case. */\nexport function toKebabCase(text: string): string {\n const input = text.trim();\n return splitToWords(input).join('-').toLowerCase();\n}\n\n/**\n * Escapes any potential regex syntax characters in a string, and returns a new string\n * that can be safely used as a literal pattern for the `RegExp()` constructor.\n *\n * @remarks\n * Substitute with `RegExp.escape` once it has enough support:\n *\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/escape#browser_compatibility\n */\nexport function escapeRegex(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\n/**\n * Creates a generator of monotonically increasing DOM ids based on the given prefix.\n *\n * @example\n * ```typescript\n * const nextId = createIdGenerator('radio');\n * nextId(); // 'radio-1'\n * nextId(); // 'radio-2'\n * ```\n */\nexport function createIdGenerator(prefix: string): () => string {\n let id = 0;\n return () => `${prefix}-${++id}`;\n}\n\nlet pool: Uint8Array<ArrayBuffer>;\nlet poolOffset: number;\nconst urlAlphabet =\n 'useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict';\n\nfunction fillPool(bytes: number): void {\n if (!pool || pool.length < bytes) {\n pool = new Uint8Array(new ArrayBuffer(bytes * 128));\n crypto.getRandomValues(pool);\n poolOffset = 0;\n } else if (poolOffset + bytes > pool.length) {\n crypto.getRandomValues(pool);\n poolOffset = 0;\n }\n poolOffset += bytes;\n}\n\n/**\n * Generates a unique string ID of the specified size using a URL-friendly alphabet.\n * The default size is 21 characters, which provides a very low probability of collisions.\n */\nexport function nanoid(size = 21): string {\n const bytes = size | 0;\n fillPool(bytes);\n\n let id = '';\n for (let i = poolOffset - bytes; i < poolOffset; i++) {\n id += urlAlphabet[pool[i] & 63];\n }\n\n return id;\n}\n"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** Returns whether the value is not `undefined`. Note that `null` is considered defined. */
|
|
2
|
+
export declare function isDefined<T = unknown>(value: T): value is T & ({} | null);
|
|
3
|
+
export declare function isFunction(value: unknown): value is CallableFunction;
|
|
4
|
+
export declare function isString(value: unknown): value is string;
|
|
5
|
+
export declare function isObject(value: unknown): value is object;
|
|
6
|
+
/** Returns whether the value is a plain object (POJO) — created via `{}`, `new Object()` or `Object.create(null)`. */
|
|
7
|
+
export declare function isPlainObject(value: unknown): value is Record<PropertyKey, unknown>;
|
|
8
|
+
export declare function isRegExp(value: unknown): value is RegExp;
|
|
9
|
+
export declare function isEventListenerObject(x: unknown): x is EventListenerObject;
|
|
10
|
+
/** Required utility type for specific props */
|
|
11
|
+
export type RequiredProps<T, K extends keyof T> = T & {
|
|
12
|
+
[P in K]-?: T[P];
|
|
13
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export function isDefined(value) {
|
|
2
|
+
return value !== undefined;
|
|
3
|
+
}
|
|
4
|
+
export function isFunction(value) {
|
|
5
|
+
return typeof value === 'function';
|
|
6
|
+
}
|
|
7
|
+
export function isString(value) {
|
|
8
|
+
return typeof value === 'string';
|
|
9
|
+
}
|
|
10
|
+
export function isObject(value) {
|
|
11
|
+
return value != null && typeof value === 'object';
|
|
12
|
+
}
|
|
13
|
+
export function isPlainObject(value) {
|
|
14
|
+
if (!isObject(value)) {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
const proto = Object.getPrototypeOf(value);
|
|
18
|
+
const hasObjectPrototype = proto === null ||
|
|
19
|
+
proto === Object.prototype ||
|
|
20
|
+
Object.getPrototypeOf(proto) === null;
|
|
21
|
+
return hasObjectPrototype
|
|
22
|
+
? Object.prototype.toString.call(value) === '[object Object]'
|
|
23
|
+
: false;
|
|
24
|
+
}
|
|
25
|
+
export function isRegExp(value) {
|
|
26
|
+
return value instanceof RegExp;
|
|
27
|
+
}
|
|
28
|
+
export function isEventListenerObject(x) {
|
|
29
|
+
return isObject(x) && 'handleEvent' in x;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/internals/utils/types.ts"],"names":[],"mappings":"AACA,MAAM,UAAU,SAAS,CAAc,KAAQ;IAC7C,OAAO,KAAK,KAAK,SAAS,CAAC;AAC7B,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC;AACnC,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC;AACpD,CAAC;AAGD,MAAM,UAAU,aAAa,CAC3B,KAAc;IAEd,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC,KAAK,CAAmC,CAAC;IAE7E,MAAM,kBAAkB,GACtB,KAAK,KAAK,IAAI;QACd,KAAK,KAAK,MAAM,CAAC,SAAS;QAC1B,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC;IAExC,OAAO,kBAAkB;QACvB,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,iBAAiB;QAC7D,CAAC,CAAC,KAAK,CAAC;AACZ,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAAc;IACrC,OAAO,KAAK,YAAY,MAAM,CAAC;AACjC,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,CAAU;IAC9C,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,aAAa,IAAI,CAAC,CAAC;AAC3C,CAAC","sourcesContent":["/** Returns whether the value is not `undefined`. Note that `null` is considered defined. */\nexport function isDefined<T = unknown>(value: T) {\n return value !== undefined;\n}\n\nexport function isFunction(value: unknown): value is CallableFunction {\n return typeof value === 'function';\n}\n\nexport function isString(value: unknown): value is string {\n return typeof value === 'string';\n}\n\nexport function isObject(value: unknown): value is object {\n return value != null && typeof value === 'object';\n}\n\n/** Returns whether the value is a plain object (POJO) — created via `{}`, `new Object()` or `Object.create(null)`. */\nexport function isPlainObject(\n value: unknown\n): value is Record<PropertyKey, unknown> {\n if (!isObject(value)) {\n return false;\n }\n\n const proto = Object.getPrototypeOf(value) as typeof Object.prototype | null;\n\n const hasObjectPrototype =\n proto === null ||\n proto === Object.prototype ||\n Object.getPrototypeOf(proto) === null;\n\n return hasObjectPrototype\n ? Object.prototype.toString.call(value) === '[object Object]'\n : false;\n}\n\nexport function isRegExp(value: unknown): value is RegExp {\n return value instanceof RegExp;\n}\n\nexport function isEventListenerObject(x: unknown): x is EventListenerObject {\n return isObject(x) && 'handleEvent' in x;\n}\n\n/** Required utility type for specific props */\nexport type RequiredProps<T, K extends keyof T> = T & {\n [P in K]-?: T[P];\n};\n"]}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ValidationResourceStringsEN } from 'igniteui-i18n-core';
|
|
2
|
-
import { CalendarDay } from '
|
|
3
|
-
import { asNumber,
|
|
2
|
+
import { CalendarDay } from './date/model.js';
|
|
3
|
+
import { asNumber, numberOfDecimals, roundPrecise } from './utils/math.js';
|
|
4
|
+
import { formatString } from './utils/strings.js';
|
|
5
|
+
import { isDefined } from './utils/types.js';
|
|
4
6
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
|
|
5
7
|
export const requiredValidator = {
|
|
6
8
|
key: 'valueMissing',
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/internals/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAY7C,MAAM,UAAU,GACd,sIAAsI,CAAC;AAEzI,MAAM,CAAC,MAAM,iBAAiB,GAGzB;IACH,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,2BAA2B,CAAC,yBAA0B;IAC/D,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;CAC9D,CAAC;AAEF,MAAM,CAAC,MAAM,wBAAwB,GAGhC;IACH,GAAG,EAAE,cAAc;IACnB,OAAO,EAAE,2BAA2B,CAAC,yBAA0B;IAC/D,OAAO,EAAE,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;CAChE,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAG1B;IACH,GAAG,EAAE,UAAU;IACf,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CACzB,YAAY,CACV,2BAA2B,CAAC,2BAA4B,EACxD,S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,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;CAC7D,CAAC","sourcesContent":["import { ValidationResourceStringsEN } from 'igniteui-i18n-core';\nimport { CalendarDay } from './date/model.js';\nimport { asNumber, numberOfDecimals, roundPrecise } from './utils/math.js';\nimport { formatString } from './utils/strings.js';\nimport { isDefined } from './utils/types.js';\n\ntype ValidatorHandler<T> = (host: T) => boolean;\ntype ValidatorMessageFormat<T> = (host: T) => string;\n\n/** @hidden */\nexport interface Validator<T = any> {\n key: keyof ValidityStateFlags;\n message: string | ValidatorMessageFormat<T>;\n isValid: ValidatorHandler<T>;\n}\n\nconst emailRegex =\n /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n\nexport const requiredValidator: Validator<{\n required: boolean;\n value?: unknown;\n}> = {\n key: 'valueMissing',\n message: ValidationResourceStringsEN.required_validation_error!,\n isValid: ({ required, value }) => (required ? !!value : true),\n};\n\nexport const requiredBooleanValidator: Validator<{\n required: boolean;\n checked: boolean;\n}> = {\n key: 'valueMissing',\n message: ValidationResourceStringsEN.required_validation_error!,\n isValid: ({ required, checked }) => (required ? checked : true),\n};\n\nexport const minLengthValidator: Validator<{\n minLength?: number;\n value: string;\n}> = {\n key: 'tooShort',\n message: ({ minLength }) =>\n formatString(\n ValidationResourceStringsEN.min_length_validation_error!,\n minLength\n ),\n isValid: ({ minLength, value }) =>\n minLength && value ? value.length >= asNumber(minLength) : true,\n};\n\nexport const maxLengthValidator: Validator<{\n maxLength?: number;\n value: string;\n}> = {\n key: 'tooLong',\n message: ({ maxLength }) =>\n formatString(\n ValidationResourceStringsEN.max_length_validation_error!,\n maxLength\n ),\n isValid: ({ maxLength, value }) =>\n maxLength && value ? value.length <= asNumber(maxLength) : true,\n};\n\nexport const patternValidator: Validator<{ pattern?: string; value: string }> =\n {\n key: 'patternMismatch',\n message: ValidationResourceStringsEN.pattern_validation_error!,\n isValid: ({ pattern, value }) =>\n pattern && value ? new RegExp(pattern, 'u').test(value) : true,\n };\n\nexport const minValidator: Validator<{\n min?: number;\n value: number | string;\n}> = {\n key: 'rangeUnderflow',\n message: ({ min }) =>\n formatString(ValidationResourceStringsEN.min_validation_error!, min),\n isValid: ({ min, value }) =>\n isDefined(value) && value !== '' && isDefined(min)\n ? asNumber(value) >= asNumber(min)\n : true,\n};\n\nexport const maxValidator: Validator<{\n max?: number;\n value: number | string;\n}> = {\n key: 'rangeOverflow',\n message: ({ max }) =>\n formatString(ValidationResourceStringsEN.max_validation_error!, max),\n isValid: ({ max, value }) =>\n isDefined(value) && value !== '' && isDefined(max)\n ? asNumber(value) <= asNumber(max)\n : true,\n};\n\nexport const stepValidator: Validator<{\n min?: number;\n step?: number;\n value: number | string;\n}> = {\n key: 'stepMismatch',\n message: 'Value does not conform to step constraint',\n isValid: ({ min, step, value }) => {\n if (isDefined(value) && value !== '' && isDefined(step)) {\n const _value = asNumber(value) - asNumber(min);\n const _step = asNumber(step);\n const magnitude = numberOfDecimals(_step) + 1;\n const rem = roundPrecise(\n Math.abs(_value - _step * Math.round(_value / _step)),\n magnitude\n );\n\n return !rem;\n }\n return true;\n },\n};\n\nexport const emailValidator: Validator<{ value: string }> = {\n key: 'typeMismatch',\n message: ValidationResourceStringsEN.email_validation_error!,\n isValid: ({ value }) => (value ? emailRegex.test(value) : true),\n};\n\nexport const urlValidator: Validator<{ value: string }> = {\n key: 'typeMismatch',\n message: ValidationResourceStringsEN.url_validation_error!,\n isValid: ({ value }) => (value ? URL.canParse(value) : true),\n};\n\nexport const minDateValidator: Validator<{\n value?: Date | null;\n min?: Date | null;\n}> = {\n key: 'rangeUnderflow',\n message: ({ min }) =>\n formatString(ValidationResourceStringsEN.min_validation_error!, min),\n isValid: ({ value, min }) =>\n value && min ? CalendarDay.compare(value, min) >= 0 : true,\n};\n\nexport const maxDateValidator: Validator<{\n value?: Date | null;\n max?: Date | null;\n}> = {\n key: 'rangeOverflow',\n message: ({ max }) =>\n formatString(ValidationResourceStringsEN.max_validation_error!, max),\n isValid: ({ value, max }) =>\n value && max ? CalendarDay.compare(value, max) <= 0 : true,\n};\n"]}
|