igniteui-webcomponents 4.3.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +49 -0
- package/animations/presets/fade/index.d.ts +2 -2
- package/animations/presets/fade/index.js +4 -6
- package/animations/presets/fade/index.js.map +1 -1
- package/animations/presets/grow/index.d.ts +2 -2
- package/animations/presets/grow/index.js +8 -10
- package/animations/presets/grow/index.js.map +1 -1
- package/animations/presets/index.d.ts +1 -0
- package/animations/presets/index.js +1 -0
- package/animations/presets/index.js.map +1 -1
- package/animations/presets/slide/index.d.ts +3 -0
- package/animations/presets/slide/index.js +16 -0
- package/animations/presets/slide/index.js.map +1 -0
- package/components/avatar/avatar.js +5 -2
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/{light/avatar.base.css.js → avatar.base.css.js} +2 -20
- package/components/avatar/themes/avatar.base.css.js.map +1 -0
- package/components/avatar/themes/dark/{avatar.base.bootstrap.css.js → avatar.bootstrap.css.js} +1 -1
- package/components/avatar/themes/dark/avatar.bootstrap.css.js.map +1 -0
- package/components/avatar/themes/dark/avatar.fluent.css.d.ts +1 -0
- package/components/avatar/themes/dark/avatar.fluent.css.js +3 -0
- package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -0
- package/components/avatar/themes/dark/avatar.indigo.css.d.ts +1 -0
- package/components/avatar/themes/dark/avatar.indigo.css.js +3 -0
- package/components/avatar/themes/dark/avatar.indigo.css.js.map +1 -0
- package/components/avatar/themes/dark/avatar.material.css.d.ts +1 -0
- package/components/avatar/themes/dark/avatar.material.css.js +3 -0
- package/components/avatar/themes/dark/avatar.material.css.js.map +1 -0
- package/components/avatar/themes/light/avatar.bootstrap.css.js +17 -3
- package/components/avatar/themes/light/avatar.bootstrap.css.js.map +1 -1
- package/components/avatar/themes/light/avatar.fluent.css.d.ts +1 -0
- package/components/avatar/themes/light/avatar.fluent.css.js +27 -0
- package/components/avatar/themes/light/avatar.fluent.css.js.map +1 -0
- package/components/avatar/themes/light/avatar.indigo.css.d.ts +1 -0
- package/components/avatar/themes/light/avatar.indigo.css.js +27 -0
- package/components/avatar/themes/light/avatar.indigo.css.js.map +1 -0
- package/components/avatar/themes/light/avatar.material.css.d.ts +1 -0
- package/components/avatar/themes/light/avatar.material.css.js +27 -0
- package/components/avatar/themes/light/avatar.material.css.js.map +1 -0
- package/components/button/button-base.d.ts +14 -6
- package/components/button/button-base.js +51 -18
- package/components/button/button-base.js.map +1 -1
- package/components/button/themes/button/light/button.base.css.js +4 -4
- package/components/button/themes/button/light/button.base.css.js.map +1 -1
- package/components/button/themes/button/light/button.bootstrap.css.js +64 -32
- package/components/button/themes/button/light/button.bootstrap.css.js.map +1 -1
- package/components/button/themes/button/light/button.fluent.css.js +75 -40
- package/components/button/themes/button/light/button.fluent.css.js.map +1 -1
- package/components/button/themes/button/light/button.indigo.css.js +86 -42
- package/components/button/themes/button/light/button.indigo.css.js.map +1 -1
- package/components/button/themes/button/light/button.material.css.js +88 -38
- package/components/button/themes/button/light/button.material.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.base.css.js +2 -1
- package/components/button/themes/icon-button/light/icon-button.base.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js +12 -7
- package/components/button/themes/icon-button/light/icon-button.bootstrap.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.fluent.css.js +4 -3
- package/components/button/themes/icon-button/light/icon-button.fluent.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.indigo.css.js +6 -4
- package/components/button/themes/icon-button/light/icon-button.indigo.css.js.map +1 -1
- package/components/button/themes/icon-button/light/icon-button.material.css.js +7 -4
- package/components/button/themes/icon-button/light/icon-button.material.css.js.map +1 -1
- package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js +2 -2
- package/components/calendar/themes/bootstrap/days-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js +2 -2
- package/components/calendar/themes/bootstrap/year-month-view.bootstrap.css.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -0
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/themes/fluent/calendar.fluent.css.js +2 -1
- package/components/calendar/themes/fluent/calendar.fluent.css.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +8 -35
- package/components/checkbox/checkbox-base.js +28 -41
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.d.ts +0 -1
- package/components/checkbox/checkbox.js +5 -16
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.d.ts +0 -2
- package/components/checkbox/switch.js +4 -16
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/light/checkbox.base.css.js +2 -1
- package/components/checkbox/themes/light/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox.bootstrap.css.js +26 -9
- package/components/checkbox/themes/light/checkbox.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox.fluent.css.js +31 -15
- package/components/checkbox/themes/light/checkbox.fluent.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox.indigo.css.js +31 -13
- package/components/checkbox/themes/light/checkbox.indigo.css.js.map +1 -1
- package/components/checkbox/themes/light/checkbox.material.css.js +24 -12
- package/components/checkbox/themes/light/checkbox.material.css.js.map +1 -1
- package/components/checkbox/themes/light/switch.base.css.js +2 -1
- package/components/checkbox/themes/light/switch.base.css.js.map +1 -1
- package/components/checkbox/themes/light/switch.bootstrap.css.js +12 -4
- package/components/checkbox/themes/light/switch.bootstrap.css.js.map +1 -1
- package/components/checkbox/themes/light/switch.fluent.css.js +33 -15
- package/components/checkbox/themes/light/switch.fluent.css.js.map +1 -1
- package/components/checkbox/themes/light/switch.indigo.css.js +26 -11
- package/components/checkbox/themes/light/switch.indigo.css.js.map +1 -1
- package/components/checkbox/themes/light/switch.material.css.js +14 -7
- package/components/checkbox/themes/light/switch.material.css.js.map +1 -1
- package/components/chip/themes/chip.base.css.js +0 -2
- package/components/chip/themes/chip.base.css.js.map +1 -1
- package/components/chip/themes/chip.bootstrap.css.js +2 -2
- package/components/chip/themes/chip.bootstrap.css.js.map +1 -1
- package/components/chip/themes/chip.fluent.css.js +2 -2
- package/components/chip/themes/chip.fluent.css.js.map +1 -1
- package/components/chip/themes/chip.indigo.css.js +2 -2
- package/components/chip/themes/chip.indigo.css.js.map +1 -1
- package/components/chip/themes/chip.material.css.js +2 -2
- package/components/chip/themes/chip.material.css.js.map +1 -1
- package/components/combo/combo.d.ts +7 -32
- package/components/combo/combo.js +57 -49
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/selection.js +1 -3
- package/components/combo/controllers/selection.js.map +1 -1
- package/components/combo/themes/light/combo.bootstrap.css.js +27 -24
- package/components/combo/themes/light/combo.bootstrap.css.js.map +1 -1
- package/components/combo/themes/light/combo.fluent.css.js +27 -24
- package/components/combo/themes/light/combo.fluent.css.js.map +1 -1
- package/components/combo/themes/light/combo.indigo.css.js +26 -23
- package/components/combo/themes/light/combo.indigo.css.js.map +1 -1
- package/components/combo/themes/light/combo.material.css.js +32 -23
- package/components/combo/themes/light/combo.material.css.js.map +1 -1
- package/components/combo/themes/light/item/combo-item.base.css.js +0 -1
- package/components/combo/themes/light/item/combo-item.base.css.js.map +1 -1
- package/components/common/localization/validation-en.d.ts +10 -0
- package/components/common/localization/validation-en.js +10 -0
- package/components/common/localization/validation-en.js.map +1 -0
- package/components/common/mixins/form-associated-required.d.ts +16 -0
- package/components/common/mixins/form-associated-required.js +29 -0
- package/components/common/mixins/form-associated-required.js.map +1 -0
- package/components/common/mixins/form-associated.d.ts +92 -0
- package/components/common/mixins/form-associated.js +151 -0
- package/components/common/mixins/form-associated.js.map +1 -0
- package/components/common/util.d.ts +38 -0
- package/components/common/util.js +34 -0
- package/components/common/util.js.map +1 -1
- package/components/common/validators.d.ts +45 -0
- package/components/common/validators.js +54 -0
- package/components/common/validators.js.map +1 -0
- package/components/date-time-input/date-time-input.d.ts +30 -11
- package/components/date-time-input/date-time-input.js +147 -135
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/date-util.d.ts +1 -0
- package/components/date-time-input/date-util.js +6 -3
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/dialog/dialog.js +1 -1
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/light/dialog.base.css.js +1 -1
- package/components/dialog/themes/light/dialog.base.css.js.map +1 -1
- package/components/dropdown/dropdown-item.js +2 -6
- package/components/dropdown/dropdown-item.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.bootstrap.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.indigo.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.indigo.css.js.map +1 -1
- package/components/dropdown/themes/light/dropdown.material.css.js +1 -1
- package/components/dropdown/themes/light/dropdown.material.css.js.map +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.indigo.css.js.map +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.material.css.js +1 -1
- package/components/dropdown/themes/light/group/dropdown-group.material.css.js.map +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.indigo.css.js.map +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.material.css.js +1 -1
- package/components/dropdown/themes/light/header/dropdown-header.material.css.js.map +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.bootstrap.css.js.map +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.fluent.css.js.map +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.indigo.css.js.map +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.material.css.js +1 -1
- package/components/dropdown/themes/light/item/dropdown-item.material.css.js.map +1 -1
- package/components/expansion-panel/expansion-panel.js +1 -1
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/form/form.d.ts +3 -0
- package/components/form/form.js.map +1 -1
- package/components/icon/icon.base.css.js +0 -8
- package/components/icon/icon.base.css.js.map +1 -1
- package/components/icon/light/icon.bootstrap.css.js +7 -1
- package/components/icon/light/icon.bootstrap.css.js.map +1 -1
- package/components/icon/light/icon.fluent.css.js +7 -1
- package/components/icon/light/icon.fluent.css.js.map +1 -1
- package/components/icon/light/icon.indigo.css.js +7 -1
- package/components/icon/light/icon.indigo.css.js.map +1 -1
- package/components/icon/light/icon.material.css.js +7 -1
- package/components/icon/light/icon.material.css.js.map +1 -1
- package/components/input/input-base.d.ts +10 -20
- package/components/input/input-base.js +19 -20
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +24 -15
- package/components/input/input.js +106 -48
- package/components/input/input.js.map +1 -1
- package/components/input/themes/light/input.base.css.js +0 -3
- package/components/input/themes/light/input.base.css.js.map +1 -1
- package/components/input/themes/light/input.bootstrap.css.js +7 -17
- package/components/input/themes/light/input.bootstrap.css.js.map +1 -1
- package/components/input/themes/light/input.fluent.css.js +6 -19
- package/components/input/themes/light/input.fluent.css.js.map +1 -1
- package/components/input/themes/light/input.indigo.css.js +16 -1
- package/components/input/themes/light/input.indigo.css.js.map +1 -1
- package/components/input/themes/light/input.material.css.js +30 -11
- package/components/input/themes/light/input.material.css.js.map +1 -1
- package/components/list/themes/light/list-header.base.css.js +0 -32
- package/components/list/themes/light/list-header.base.css.js.map +1 -1
- package/components/list/themes/light/list-item.base.css.js +1 -33
- package/components/list/themes/light/list-item.base.css.js.map +1 -1
- package/components/list/themes/light/list-item.bootstrap.css.js +1 -1
- package/components/list/themes/light/list-item.bootstrap.css.js.map +1 -1
- package/components/list/themes/light/list-item.fluent.css.js +1 -1
- package/components/list/themes/light/list-item.fluent.css.js.map +1 -1
- package/components/list/themes/light/list-item.indigo.css.js +1 -1
- package/components/list/themes/light/list-item.indigo.css.js.map +1 -1
- package/components/list/themes/light/list.base.css.js +1 -1
- package/components/list/themes/light/list.base.css.js.map +1 -1
- package/components/list/themes/light/list.bootstrap.css.js +1 -1
- package/components/list/themes/light/list.bootstrap.css.js.map +1 -1
- package/components/mask-input/mask-input-base.d.ts +2 -9
- package/components/mask-input/mask-input-base.js +7 -12
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +5 -6
- package/components/mask-input/mask-input.js +42 -51
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/mask-parser.js +1 -0
- package/components/mask-input/mask-parser.js.map +1 -1
- package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js +2 -2
- package/components/nav-drawer/themes/light/indigo/nav-drawer-item.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js +2 -2
- package/components/nav-drawer/themes/light/indigo/nav-drawer.indigo.css.js.map +1 -1
- package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js +0 -32
- package/components/nav-drawer/themes/light/nav-drawer-header-item.base.css.js.map +1 -1
- package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js +1 -34
- package/components/nav-drawer/themes/light/nav-drawer-item.base.css.js.map +1 -1
- package/components/nav-drawer/themes/light/nav-drawer.base.css.js +1 -1
- package/components/nav-drawer/themes/light/nav-drawer.base.css.js.map +1 -1
- package/components/navbar/themes/light/navbar.bootstrap.css.js +0 -32
- package/components/navbar/themes/light/navbar.bootstrap.css.js.map +1 -1
- package/components/navbar/themes/light/navbar.fluent.css.js +0 -32
- package/components/navbar/themes/light/navbar.fluent.css.js.map +1 -1
- package/components/navbar/themes/light/navbar.indigo.css.js +0 -32
- package/components/navbar/themes/light/navbar.indigo.css.js.map +1 -1
- package/components/navbar/themes/light/navbar.material.css.js +0 -32
- package/components/navbar/themes/light/navbar.material.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js +1 -0
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/progress/themes/linear/linear.progress.indigo.css.js +0 -32
- package/components/progress/themes/linear/linear.progress.indigo.css.js.map +1 -1
- package/components/radio/radio.d.ts +13 -37
- package/components/radio/radio.js +135 -97
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/light/radio.bootstrap.css.js +8 -36
- package/components/radio/themes/light/radio.bootstrap.css.js.map +1 -1
- package/components/radio/themes/light/radio.fluent.css.js +0 -32
- package/components/radio/themes/light/radio.fluent.css.js.map +1 -1
- package/components/radio/themes/light/radio.indigo.css.js +11 -37
- package/components/radio/themes/light/radio.indigo.css.js.map +1 -1
- package/components/radio/themes/light/radio.material.css.js +1 -33
- package/components/radio/themes/light/radio.material.css.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +0 -4
- package/components/radio-group/radio-group.js +3 -54
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/dark/rating.fluent.css.d.ts +1 -0
- package/components/rating/dark/rating.fluent.css.js +3 -0
- package/components/rating/dark/rating.fluent.css.js.map +1 -0
- package/components/rating/rating-symbol.base.css.js +1 -1
- package/components/rating/rating-symbol.base.css.js.map +1 -1
- package/components/rating/rating.base.css.js +8 -4
- package/components/rating/rating.base.css.js.map +1 -1
- package/components/rating/rating.d.ts +10 -11
- package/components/rating/rating.fluent.css.js +13 -7
- package/components/rating/rating.fluent.css.js.map +1 -1
- package/components/rating/rating.js +19 -15
- package/components/rating/rating.js.map +1 -1
- package/components/select/select-item.d.ts +0 -2
- package/components/select/select-item.js +0 -3
- package/components/select/select-item.js.map +1 -1
- package/components/select/select.d.ts +7 -34
- package/components/select/select.js +27 -37
- package/components/select/select.js.map +1 -1
- package/components/select/themes/light/select.base.css.js +1 -0
- package/components/select/themes/light/select.base.css.js.map +1 -1
- package/components/select/themes/light/select.bootstrap.css.js +5 -37
- package/components/select/themes/light/select.bootstrap.css.js.map +1 -1
- package/components/select/themes/light/select.fluent.css.js +5 -37
- package/components/select/themes/light/select.fluent.css.js.map +1 -1
- package/components/select/themes/light/select.indigo.css.js +4 -36
- package/components/select/themes/light/select.indigo.css.js.map +1 -1
- package/components/select/themes/light/select.material.css.js +14 -46
- package/components/select/themes/light/select.material.css.js.map +1 -1
- package/components/slider/slider.d.ts +4 -12
- package/components/slider/slider.js +16 -25
- package/components/slider/slider.js.map +1 -1
- package/components/slider/themes/light/slider.base.css.js +17 -8
- package/components/slider/themes/light/slider.base.css.js.map +1 -1
- package/components/slider/themes/light/slider.fluent.css.js +6 -3
- package/components/slider/themes/light/slider.fluent.css.js.map +1 -1
- package/components/slider/themes/light/slider.indigo.css.js +4 -1
- package/components/slider/themes/light/slider.indigo.css.js.map +1 -1
- package/components/snackbar/snackbar.js +1 -1
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/stepper/animations.d.ts +2 -0
- package/components/stepper/animations.js +22 -0
- package/components/stepper/animations.js.map +1 -0
- package/components/stepper/step.d.ts +17 -8
- package/components/stepper/step.js +29 -0
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.d.ts +19 -3
- package/components/stepper/stepper.js +58 -7
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/light/step.base.css.js +44 -165
- package/components/stepper/themes/step/light/step.base.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.bootstrap.css.js +116 -19
- package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.fluent.css.js +112 -12
- package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.indigo.css.js +112 -25
- package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.material.css.js +112 -4
- package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
- package/components/stepper/themes/stepper/stepper.base.css.js +2 -0
- package/components/stepper/themes/stepper/stepper.base.css.js.map +1 -1
- package/components/toast/toast.js +1 -1
- package/components/toast/toast.js.map +1 -1
- package/components/tree/themes/light/tree-item.base.css.js +0 -3
- package/components/tree/themes/light/tree-item.base.css.js.map +1 -1
- package/components/tree/themes/light/tree-item.bootstrap.css.js +60 -3
- package/components/tree/themes/light/tree-item.bootstrap.css.js.map +1 -1
- package/components/tree/themes/light/tree-item.fluent.css.js +58 -1
- package/components/tree/themes/light/tree-item.fluent.css.js.map +1 -1
- package/components/tree/themes/light/tree-item.indigo.css.js +58 -1
- package/components/tree/themes/light/tree-item.indigo.css.js.map +1 -1
- package/components/tree/themes/light/tree-item.material.css.d.ts +1 -0
- package/components/tree/themes/light/tree-item.material.css.js +58 -0
- package/components/tree/themes/light/tree-item.material.css.js.map +1 -0
- package/components/tree/tree-item.js +8 -6
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.d.ts +0 -6
- package/components/tree/tree.js +0 -4
- package/components/tree/tree.js.map +1 -1
- package/components/tree/tree.navigation.js +3 -2
- package/components/tree/tree.navigation.js.map +1 -1
- package/custom-elements.json +798 -525
- package/package.json +3 -3
- package/themes/dark/bootstrap.css +274 -61
- package/themes/dark/fluent.css +291 -60
- package/themes/dark/indigo.css +508 -3
- package/themes/dark/material.css +244 -54
- package/themes/light/bootstrap.css +5 -2
- package/themes/light/fluent.css +5 -2
- package/themes/light/indigo.css +229 -2
- package/themes/light/material.css +5 -2
- package/vscode-html-custom-data.json +239 -286
- package/components/avatar/themes/dark/avatar.base.bootstrap.css.js.map +0 -1
- package/components/avatar/themes/light/avatar.base.css.js.map +0 -1
- package/components/common/types.d.ts +0 -1
- package/components/common/types.js +0 -2
- package/components/common/types.js.map +0 -1
- /package/components/avatar/themes/{light/avatar.base.css.d.ts → avatar.base.css.d.ts} +0 -0
- /package/components/avatar/themes/dark/{avatar.base.bootstrap.css.d.ts → avatar.bootstrap.css.d.ts} +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import validatorMessages from './localization/validation-en.js';
|
|
2
|
+
import { asNumber, format, isDefined } from './util.js';
|
|
3
|
+
export const requiredValidator = {
|
|
4
|
+
key: 'valueMissing',
|
|
5
|
+
message: validatorMessages.required,
|
|
6
|
+
isValid: ({ required, value }) => (required ? !!value : true),
|
|
7
|
+
};
|
|
8
|
+
export const requiredNumberValidator = {
|
|
9
|
+
key: 'valueMissing',
|
|
10
|
+
message: validatorMessages.required,
|
|
11
|
+
isValid: ({ required, value }) => (required ? isDefined(value) : true),
|
|
12
|
+
};
|
|
13
|
+
export const requiredBooleanValidator = {
|
|
14
|
+
key: 'valueMissing',
|
|
15
|
+
message: validatorMessages.required,
|
|
16
|
+
isValid: ({ required, checked }) => (required ? checked : true),
|
|
17
|
+
};
|
|
18
|
+
export const minLengthValidator = {
|
|
19
|
+
key: 'tooShort',
|
|
20
|
+
message: ({ minLength }) => format(validatorMessages.minLength, `${minLength}`),
|
|
21
|
+
isValid: ({ minLength, value }) => minLength ? value.length >= minLength : true,
|
|
22
|
+
};
|
|
23
|
+
export const maxLengthValidator = {
|
|
24
|
+
key: 'tooLong',
|
|
25
|
+
message: ({ maxLength }) => format(validatorMessages.maxLength, `${maxLength}`),
|
|
26
|
+
isValid: ({ maxLength, value }) => maxLength ? value.length <= maxLength : true,
|
|
27
|
+
};
|
|
28
|
+
export const patternValidator = {
|
|
29
|
+
key: 'patternMismatch',
|
|
30
|
+
message: validatorMessages.pattern,
|
|
31
|
+
isValid: ({ pattern, value }) => pattern ? new RegExp(pattern, 'u').test(value) : true,
|
|
32
|
+
};
|
|
33
|
+
export const minValidator = {
|
|
34
|
+
key: 'rangeUnderflow',
|
|
35
|
+
message: ({ min }) => format(validatorMessages.min, `${min}`),
|
|
36
|
+
isValid: ({ min, value }) => isDefined(min)
|
|
37
|
+
? isDefined(value) && asNumber(value) >= asNumber(min)
|
|
38
|
+
: true,
|
|
39
|
+
};
|
|
40
|
+
export const maxValidator = {
|
|
41
|
+
key: 'rangeOverflow',
|
|
42
|
+
message: ({ max }) => format(validatorMessages.max, `${max}`),
|
|
43
|
+
isValid: ({ max, value }) => isDefined(max)
|
|
44
|
+
? isDefined(value) && asNumber(value) <= asNumber(max)
|
|
45
|
+
: true,
|
|
46
|
+
};
|
|
47
|
+
export const stepValidator = {
|
|
48
|
+
key: 'stepMismatch',
|
|
49
|
+
message: 'Value does not conform to step constraint',
|
|
50
|
+
isValid: ({ min, step, value }) => isDefined(step)
|
|
51
|
+
? (asNumber(value) - asNumber(min)) % asNumber(step, 1) === 0
|
|
52
|
+
: true,
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../src/components/common/validators.ts"],"names":[],"mappings":"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","sourcesContent":["import validatorMessages from './localization/validation-en.js';\nimport { asNumber, format, isDefined } from './util.js';\n\ntype ValidatorHandler<T> = (host: T) => boolean;\ntype ValidatorMessageFormat<T> = (host: T) => string;\n\nexport interface Validator<T = any> {\n key: keyof ValidityStateFlags;\n message: string | ValidatorMessageFormat<T>;\n isValid: ValidatorHandler<T>;\n}\n\nexport const requiredValidator: Validator<{\n required: boolean;\n value?: string;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\n isValid: ({ required, value }) => (required ? !!value : true),\n};\n\nexport const requiredNumberValidator: Validator<{\n required: boolean;\n value?: number | string;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\n isValid: ({ required, value }) => (required ? isDefined(value) : true),\n};\n\nexport const requiredBooleanValidator: Validator<{\n required: boolean;\n checked: boolean;\n}> = {\n key: 'valueMissing',\n message: validatorMessages.required,\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 format(validatorMessages.minLength, `${minLength}`),\n isValid: ({ minLength, value }) =>\n minLength ? value.length >= minLength : true,\n};\n\nexport const maxLengthValidator: Validator<{\n maxLength: number;\n value: string;\n}> = {\n key: 'tooLong',\n message: ({ maxLength }) =>\n format(validatorMessages.maxLength, `${maxLength}`),\n isValid: ({ maxLength, value }) =>\n maxLength ? value.length <= maxLength : true,\n};\n\nexport const patternValidator: Validator<{ pattern: string; value: string }> = {\n key: 'patternMismatch',\n message: validatorMessages.pattern,\n isValid: ({ pattern, value }) =>\n pattern ? new RegExp(pattern, 'u').test(value) : true,\n};\n\nexport const minValidator: Validator<{\n min: number | string;\n value: number | string;\n}> = {\n key: 'rangeUnderflow',\n message: ({ min }) => format(validatorMessages.min, `${min}`),\n isValid: ({ min, value }) =>\n isDefined(min)\n ? isDefined(value) && asNumber(value) >= asNumber(min)\n : true,\n};\n\nexport const maxValidator: Validator<{\n max: number | string;\n value: number | string;\n}> = {\n key: 'rangeOverflow',\n message: ({ max }) => format(validatorMessages.max, `${max}`),\n isValid: ({ max, value }) =>\n isDefined(max)\n ? isDefined(value) && asNumber(value) <= asNumber(max)\n : true,\n};\n\nexport const stepValidator: Validator<{\n min: number | string;\n step: number | string;\n value: number | string;\n}> = {\n key: 'stepMismatch',\n message: 'Value does not conform to step constraint',\n isValid: ({ min, step, value }) =>\n isDefined(step)\n ? (asNumber(value) - asNumber(min)) % asNumber(step, 1) === 0\n : true,\n};\n"]}
|
|
@@ -2,6 +2,7 @@ import { DatePartDeltas, DatePart } from './date-util.js';
|
|
|
2
2
|
import { IgcMaskInputBaseComponent, MaskRange } from '../mask-input/mask-input-base.js';
|
|
3
3
|
import { IgcInputEventMap } from '../input/input-base.js';
|
|
4
4
|
import { AbstractConstructor } from '../common/mixins/constructor.js';
|
|
5
|
+
import { Validator } from '../common/validators.js';
|
|
5
6
|
export interface IgcDateTimeInputEventMap extends Omit<IgcInputEventMap, 'igcChange'> {
|
|
6
7
|
igcChange: CustomEvent<Date | null>;
|
|
7
8
|
}
|
|
@@ -30,6 +31,7 @@ declare const IgcDateTimeInputComponent_base: AbstractConstructor<import("../com
|
|
|
30
31
|
*/
|
|
31
32
|
export default class IgcDateTimeInputComponent extends IgcDateTimeInputComponent_base {
|
|
32
33
|
static readonly tagName = "igc-date-time-input";
|
|
34
|
+
protected validators: Validator<this>[];
|
|
33
35
|
protected _defaultMask: string;
|
|
34
36
|
protected _value: Date | null;
|
|
35
37
|
private _oldValue;
|
|
@@ -48,16 +50,35 @@ export default class IgcDateTimeInputComponent extends IgcDateTimeInputComponent
|
|
|
48
50
|
*/
|
|
49
51
|
get value(): Date | null;
|
|
50
52
|
set value(val: Date | null);
|
|
53
|
+
protected updateFormValue(): void;
|
|
54
|
+
/**
|
|
55
|
+
* The minimum value required for the input to remain valid.
|
|
56
|
+
* @attr
|
|
57
|
+
*/
|
|
58
|
+
min: Date;
|
|
59
|
+
/**
|
|
60
|
+
* The maximum value required for the input to remain valid.
|
|
61
|
+
* @attr
|
|
62
|
+
*/
|
|
63
|
+
max: Date;
|
|
51
64
|
/**
|
|
52
65
|
* The minimum value required for the input to remain valid.
|
|
53
66
|
* @attr min-value
|
|
67
|
+
*
|
|
68
|
+
* @deprecated - since v4.4.0
|
|
69
|
+
* Use the `min` property instead.
|
|
54
70
|
*/
|
|
55
|
-
minValue: Date
|
|
71
|
+
get minValue(): Date;
|
|
72
|
+
set minValue(value: Date);
|
|
56
73
|
/**
|
|
57
74
|
* The maximum value required for the input to remain valid.
|
|
58
75
|
* @attr max-value
|
|
76
|
+
*
|
|
77
|
+
* @deprecated - since v4.4.0
|
|
78
|
+
* Use the `max` property instead.
|
|
59
79
|
*/
|
|
60
|
-
maxValue: Date
|
|
80
|
+
get maxValue(): Date;
|
|
81
|
+
set maxValue(value: Date);
|
|
61
82
|
/**
|
|
62
83
|
* Format to display the value in when not editing.
|
|
63
84
|
* Defaults to the input format if not set.
|
|
@@ -82,18 +103,12 @@ export default class IgcDateTimeInputComponent extends IgcDateTimeInputComponent
|
|
|
82
103
|
protected setDefaultMask(): void;
|
|
83
104
|
protected setDisplayFormat(): void;
|
|
84
105
|
protected promptChange(): void;
|
|
85
|
-
protected
|
|
86
|
-
protected validate(): {} | null;
|
|
106
|
+
protected constraintChange(): void;
|
|
87
107
|
private get hasDateParts();
|
|
88
108
|
private get hasTimeParts();
|
|
89
109
|
private get targetDatePart();
|
|
90
110
|
private get datePartDeltas();
|
|
91
|
-
constructor();
|
|
92
111
|
connectedCallback(): void;
|
|
93
|
-
/** Checks for validity of the control and shows the browser message if it's invalid. */
|
|
94
|
-
reportValidity(): boolean;
|
|
95
|
-
/** Check for validity of the control */
|
|
96
|
-
checkValidity(): boolean;
|
|
97
112
|
/** Increments a date/time portion. */
|
|
98
113
|
stepUp(datePart?: DatePart, delta?: number): void;
|
|
99
114
|
/** Decrements a date/time portion. */
|
|
@@ -116,9 +131,13 @@ export default class IgcDateTimeInputComponent extends IgcDateTimeInputComponent
|
|
|
116
131
|
private isComplete;
|
|
117
132
|
private updateValue;
|
|
118
133
|
private getNewPosition;
|
|
119
|
-
protected handleFocus(): void
|
|
134
|
+
protected handleFocus(): Promise<void>;
|
|
120
135
|
protected handleBlur(): void;
|
|
121
|
-
protected
|
|
136
|
+
protected handleHorizontalArrows(event: KeyboardEvent): void;
|
|
137
|
+
protected handleVerticalArrows(event: KeyboardEvent): Promise<void>;
|
|
138
|
+
protected handleSemicolon(event: KeyboardEvent): void;
|
|
139
|
+
protected keyMap: Map<string, ((event: KeyboardEvent) => void) | ((event: KeyboardEvent) => Promise<void>) | ((event: KeyboardEvent) => void)>;
|
|
140
|
+
protected handleKeydown(e: KeyboardEvent): Promise<void>;
|
|
122
141
|
protected renderInput(): import("lit-html").TemplateResult<1>;
|
|
123
142
|
}
|
|
124
143
|
declare global {
|
|
@@ -12,9 +12,57 @@ import { blazorTwoWayBind } from '../common/decorators/blazorTwoWayBind.js';
|
|
|
12
12
|
import { watch } from '../common/decorators/watch.js';
|
|
13
13
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
14
14
|
import { IgcMaskInputBaseComponent, } from '../mask-input/mask-input-base.js';
|
|
15
|
-
import { partNameMap } from '../common/util.js';
|
|
15
|
+
import { format, partNameMap } from '../common/util.js';
|
|
16
16
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
17
|
+
import messages from '../common/localization/validation-en.js';
|
|
18
|
+
const converter = {
|
|
19
|
+
fromAttribute: (value) => !value ? null : DateTimeUtil.parseIsoDate(value),
|
|
20
|
+
toAttribute: (value) => value.toISOString(),
|
|
21
|
+
};
|
|
17
22
|
class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseComponent) {
|
|
23
|
+
constructor() {
|
|
24
|
+
super(...arguments);
|
|
25
|
+
this.validators = [
|
|
26
|
+
{
|
|
27
|
+
key: 'valueMissing',
|
|
28
|
+
message: messages.required,
|
|
29
|
+
isValid: () => (this.required ? !!this.value : true),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
key: 'rangeUnderflow',
|
|
33
|
+
message: () => format(messages.min, `${this.min}`),
|
|
34
|
+
isValid: () => this.min
|
|
35
|
+
? !DateTimeUtil.lessThanMinValue(this.value || new Date(), this.min, this.hasTimeParts, this.hasDateParts)
|
|
36
|
+
: true,
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: 'rangeOverflow',
|
|
40
|
+
message: () => format(messages.max, `${this.max}`),
|
|
41
|
+
isValid: () => this.max
|
|
42
|
+
? !DateTimeUtil.greaterThanMaxValue(this.value || new Date(), this.max, this.hasTimeParts, this.hasDateParts)
|
|
43
|
+
: true,
|
|
44
|
+
},
|
|
45
|
+
];
|
|
46
|
+
this._value = null;
|
|
47
|
+
this._oldValue = null;
|
|
48
|
+
this._datePartDeltas = {
|
|
49
|
+
date: 1,
|
|
50
|
+
month: 1,
|
|
51
|
+
year: 1,
|
|
52
|
+
hours: 1,
|
|
53
|
+
minutes: 1,
|
|
54
|
+
seconds: 1,
|
|
55
|
+
};
|
|
56
|
+
this.spinLoop = true;
|
|
57
|
+
this.locale = 'en';
|
|
58
|
+
this.keyMap = new Map(Object.entries({
|
|
59
|
+
ArrowLeft: this.handleHorizontalArrows,
|
|
60
|
+
ArrowRight: this.handleHorizontalArrows,
|
|
61
|
+
ArrowUp: this.handleVerticalArrows,
|
|
62
|
+
ArrowDown: this.handleVerticalArrows,
|
|
63
|
+
';': this.handleSemicolon,
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
18
66
|
get inputFormat() {
|
|
19
67
|
return this._inputFormat || this._defaultMask;
|
|
20
68
|
}
|
|
@@ -34,7 +82,26 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
34
82
|
: DateTimeUtil.parseIsoDate(val)
|
|
35
83
|
: null;
|
|
36
84
|
this.updateMask();
|
|
37
|
-
this.
|
|
85
|
+
this.updateFormValue();
|
|
86
|
+
this.updateValidity();
|
|
87
|
+
this.setInvalidState();
|
|
88
|
+
}
|
|
89
|
+
updateFormValue() {
|
|
90
|
+
this._value
|
|
91
|
+
? this.setFormValue(this._value.toISOString())
|
|
92
|
+
: this.setFormValue(null);
|
|
93
|
+
}
|
|
94
|
+
get minValue() {
|
|
95
|
+
return this.min;
|
|
96
|
+
}
|
|
97
|
+
set minValue(value) {
|
|
98
|
+
this.min = value;
|
|
99
|
+
}
|
|
100
|
+
get maxValue() {
|
|
101
|
+
return this.max;
|
|
102
|
+
}
|
|
103
|
+
set maxValue(value) {
|
|
104
|
+
this.max = value;
|
|
38
105
|
}
|
|
39
106
|
setDefaultMask() {
|
|
40
107
|
if (!this._inputFormat) {
|
|
@@ -60,24 +127,8 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
60
127
|
this.parser.prompt = this.prompt;
|
|
61
128
|
}
|
|
62
129
|
}
|
|
63
|
-
|
|
64
|
-
this.
|
|
65
|
-
}
|
|
66
|
-
validate() {
|
|
67
|
-
if (!this.value) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
let errors = {};
|
|
71
|
-
if (this.minValue || this.maxValue) {
|
|
72
|
-
errors = DateTimeUtil.validateMinMax(this.value, this.minValue, this.maxValue, this.hasTimeParts, this.hasDateParts);
|
|
73
|
-
if (Object.keys(errors).length > 0) {
|
|
74
|
-
this.invalid = true;
|
|
75
|
-
}
|
|
76
|
-
else {
|
|
77
|
-
this.invalid = false;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
return errors;
|
|
130
|
+
constraintChange() {
|
|
131
|
+
this.updateValidity();
|
|
81
132
|
}
|
|
82
133
|
get hasDateParts() {
|
|
83
134
|
const parts = this._inputDateParts ||
|
|
@@ -96,7 +147,7 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
96
147
|
get targetDatePart() {
|
|
97
148
|
var _a;
|
|
98
149
|
let result;
|
|
99
|
-
if (this.
|
|
150
|
+
if (this.focused) {
|
|
100
151
|
const partType = (_a = this._inputDateParts.find((p) => p.start <= this.inputSelection.start &&
|
|
101
152
|
this.inputSelection.start <= p.end &&
|
|
102
153
|
p.type !== DateParts.Literal)) === null || _a === void 0 ? void 0 : _a.type;
|
|
@@ -120,73 +171,45 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
120
171
|
get datePartDeltas() {
|
|
121
172
|
return Object.assign({}, this._datePartDeltas, this.spinDelta);
|
|
122
173
|
}
|
|
123
|
-
constructor() {
|
|
124
|
-
super();
|
|
125
|
-
this._oldValue = null;
|
|
126
|
-
this._datePartDeltas = {
|
|
127
|
-
date: 1,
|
|
128
|
-
month: 1,
|
|
129
|
-
year: 1,
|
|
130
|
-
hours: 1,
|
|
131
|
-
minutes: 1,
|
|
132
|
-
seconds: 1,
|
|
133
|
-
};
|
|
134
|
-
this.spinLoop = true;
|
|
135
|
-
this.locale = 'en';
|
|
136
|
-
this.addEventListener('wheel', this.onWheel);
|
|
137
|
-
}
|
|
138
174
|
connectedCallback() {
|
|
139
175
|
super.connectedCallback();
|
|
140
176
|
this.updateDefaultMask();
|
|
141
177
|
this.setMask(this.inputFormat);
|
|
178
|
+
this.updateValidity();
|
|
142
179
|
if (this.value) {
|
|
143
180
|
this.updateMask();
|
|
144
181
|
}
|
|
145
182
|
}
|
|
146
|
-
reportValidity() {
|
|
147
|
-
const state = this._value
|
|
148
|
-
? Object.keys(this.validate()).length === 0
|
|
149
|
-
: this.input.reportValidity();
|
|
150
|
-
this.invalid = !state;
|
|
151
|
-
return state;
|
|
152
|
-
}
|
|
153
|
-
checkValidity() {
|
|
154
|
-
if (this.disabled) {
|
|
155
|
-
return this.input.checkValidity();
|
|
156
|
-
}
|
|
157
|
-
if (!this._value) {
|
|
158
|
-
return !this.required;
|
|
159
|
-
}
|
|
160
|
-
return (this.input.checkValidity() && Object.keys(this.validate()).length === 0);
|
|
161
|
-
}
|
|
162
183
|
stepUp(datePart, delta) {
|
|
163
184
|
const targetPart = datePart || this.targetDatePart;
|
|
164
185
|
if (!targetPart) {
|
|
165
186
|
return;
|
|
166
187
|
}
|
|
188
|
+
const { start, end } = this.inputSelection;
|
|
167
189
|
const newValue = this.trySpinValue(targetPart, delta);
|
|
168
190
|
this.value = newValue;
|
|
169
|
-
this.
|
|
191
|
+
this.updateComplete.then(() => this.input.setSelectionRange(start, end));
|
|
170
192
|
}
|
|
171
193
|
stepDown(datePart, delta) {
|
|
172
194
|
const targetPart = datePart || this.targetDatePart;
|
|
173
195
|
if (!targetPart) {
|
|
174
196
|
return;
|
|
175
197
|
}
|
|
198
|
+
const { start, end } = this.inputSelection;
|
|
176
199
|
const newValue = this.trySpinValue(targetPart, delta, true);
|
|
177
200
|
this.value = newValue;
|
|
178
|
-
this.
|
|
201
|
+
this.updateComplete.then(() => this.input.setSelectionRange(start, end));
|
|
179
202
|
}
|
|
180
203
|
clear() {
|
|
181
204
|
this.maskedValue = '';
|
|
182
205
|
this.value = null;
|
|
183
206
|
}
|
|
184
207
|
updateMask() {
|
|
185
|
-
if (this.
|
|
208
|
+
if (this.focused) {
|
|
186
209
|
this.maskedValue = this.getMaskedValue();
|
|
187
210
|
}
|
|
188
211
|
else {
|
|
189
|
-
if (!
|
|
212
|
+
if (!DateTimeUtil.isValidDate(this.value)) {
|
|
190
213
|
this.maskedValue = '';
|
|
191
214
|
return;
|
|
192
215
|
}
|
|
@@ -204,30 +227,28 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
204
227
|
}
|
|
205
228
|
handleChange() {
|
|
206
229
|
this.emitEvent('igcChange', { detail: this.value });
|
|
207
|
-
this.invalid = !this.checkValidity();
|
|
208
230
|
}
|
|
209
231
|
handleInput() {
|
|
210
232
|
var _a;
|
|
211
233
|
this.emitEvent('igcInput', { detail: (_a = this.value) === null || _a === void 0 ? void 0 : _a.toString() });
|
|
212
234
|
}
|
|
213
235
|
handleDragLeave() {
|
|
214
|
-
if (!this.
|
|
236
|
+
if (!this.focused) {
|
|
215
237
|
this.updateMask();
|
|
216
238
|
}
|
|
217
239
|
}
|
|
218
240
|
handleDragEnter() {
|
|
219
|
-
if (!this.
|
|
241
|
+
if (!this.focused) {
|
|
220
242
|
this.maskedValue = this.getMaskedValue();
|
|
221
243
|
}
|
|
222
244
|
}
|
|
223
245
|
async updateInput(string, range) {
|
|
224
|
-
var _a;
|
|
225
246
|
const { value, end } = this.parser.replace(this.maskedValue, string, range.start, range.end);
|
|
226
247
|
this.maskedValue = value;
|
|
227
248
|
this.updateValue();
|
|
228
249
|
this.requestUpdate();
|
|
229
250
|
if (range.start !== this.inputFormat.length) {
|
|
230
|
-
this.
|
|
251
|
+
this.handleInput();
|
|
231
252
|
}
|
|
232
253
|
await this.updateComplete;
|
|
233
254
|
this.input.setSelectionRange(end, end);
|
|
@@ -274,20 +295,17 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
274
295
|
}
|
|
275
296
|
return newDate;
|
|
276
297
|
}
|
|
277
|
-
onWheel(event) {
|
|
278
|
-
if (!this.
|
|
298
|
+
async onWheel(event) {
|
|
299
|
+
if (!this.focused || this.readonly) {
|
|
279
300
|
return;
|
|
280
301
|
}
|
|
281
|
-
this.selection = this.inputSelection;
|
|
282
302
|
event.preventDefault();
|
|
283
303
|
event.stopPropagation();
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
290
|
-
this.updateComplete.then(() => this.setSelectionRange(this.selection.start, this.selection.end));
|
|
304
|
+
const { start, end } = this.inputSelection;
|
|
305
|
+
event.deltaY > 0 ? this.stepDown() : this.stepUp();
|
|
306
|
+
this.handleInput();
|
|
307
|
+
await this.updateComplete;
|
|
308
|
+
this.setSelectionRange(start, end);
|
|
291
309
|
}
|
|
292
310
|
updateDefaultMask() {
|
|
293
311
|
this._defaultMask = DateTimeUtil.getDefaultMask(this.locale);
|
|
@@ -363,14 +381,22 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
363
381
|
return cursorPos;
|
|
364
382
|
}
|
|
365
383
|
}
|
|
366
|
-
handleFocus() {
|
|
367
|
-
this.
|
|
368
|
-
this._oldValue = this.value;
|
|
384
|
+
async handleFocus() {
|
|
385
|
+
this.focused = true;
|
|
369
386
|
this.updateMask();
|
|
370
|
-
|
|
387
|
+
super.handleFocus();
|
|
388
|
+
if (this.readOnly) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
this._oldValue = this.value;
|
|
392
|
+
if (!this._value) {
|
|
393
|
+
this.maskedValue = this.emptyMask;
|
|
394
|
+
await this.updateComplete;
|
|
395
|
+
this.select();
|
|
396
|
+
}
|
|
371
397
|
}
|
|
372
398
|
handleBlur() {
|
|
373
|
-
this.
|
|
399
|
+
this.focused = false;
|
|
374
400
|
if (!this.isComplete() && this.maskedValue !== this.emptyMask) {
|
|
375
401
|
const parse = this.parseDate(this.maskedValue);
|
|
376
402
|
if (parse) {
|
|
@@ -387,34 +413,35 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
387
413
|
if (this._oldValue !== this.value) {
|
|
388
414
|
this.handleChange();
|
|
389
415
|
}
|
|
390
|
-
this.
|
|
416
|
+
this.checkValidity();
|
|
417
|
+
super.handleBlur();
|
|
391
418
|
}
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
switch (key) {
|
|
396
|
-
case 'ArrowLeft':
|
|
397
|
-
case 'ArrowRight':
|
|
398
|
-
if (e.ctrlKey) {
|
|
399
|
-
e.preventDefault();
|
|
400
|
-
const value = e.target.value;
|
|
401
|
-
const dir = key === 'ArrowRight' ? 1 : 0;
|
|
402
|
-
const pos = this.getNewPosition(value, dir);
|
|
403
|
-
this.setSelectionRange(pos, pos);
|
|
404
|
-
}
|
|
405
|
-
break;
|
|
406
|
-
case 'ArrowUp':
|
|
407
|
-
case 'ArrowDown':
|
|
408
|
-
e.preventDefault();
|
|
409
|
-
key === 'ArrowUp' ? this.stepUp() : this.stepDown();
|
|
410
|
-
this.updateComplete.then(() => this.setSelectionRange(this.selection.start, this.selection.end));
|
|
411
|
-
break;
|
|
412
|
-
case ';':
|
|
413
|
-
if (e.ctrlKey) {
|
|
414
|
-
this.value = new Date();
|
|
415
|
-
}
|
|
416
|
-
break;
|
|
419
|
+
handleHorizontalArrows(event) {
|
|
420
|
+
if (event.ctrlKey) {
|
|
421
|
+
event.preventDefault();
|
|
417
422
|
}
|
|
423
|
+
const position = this.getNewPosition(this.input.value, event.key === 'ArrowRight' ? 1 : 0);
|
|
424
|
+
this.setSelectionRange(position, position);
|
|
425
|
+
}
|
|
426
|
+
async handleVerticalArrows(event) {
|
|
427
|
+
event.preventDefault();
|
|
428
|
+
event.key === 'ArrowUp' ? this.stepUp() : this.stepDown();
|
|
429
|
+
this.handleInput();
|
|
430
|
+
await this.updateComplete;
|
|
431
|
+
this.setSelectionRange(this.selection.start, this.selection.end);
|
|
432
|
+
}
|
|
433
|
+
handleSemicolon(event) {
|
|
434
|
+
if (event.ctrlKey) {
|
|
435
|
+
this.value = new Date();
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
async handleKeydown(e) {
|
|
439
|
+
var _a;
|
|
440
|
+
if (this.readOnly) {
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
super.handleKeydown(e);
|
|
444
|
+
(_a = this.keyMap.get(e.key)) === null || _a === void 0 ? void 0 : _a.call(this, e);
|
|
418
445
|
}
|
|
419
446
|
renderInput() {
|
|
420
447
|
return html `
|
|
@@ -424,15 +451,16 @@ class IgcDateTimeInputComponent extends EventEmitterMixin(IgcMaskInputBaseCompon
|
|
|
424
451
|
name=${ifDefined(this.name)}
|
|
425
452
|
.value=${live(this.maskedValue)}
|
|
426
453
|
.placeholder=${live(this.placeholder || this.emptyMask)}
|
|
427
|
-
?readonly=${this.
|
|
454
|
+
?readonly=${this.readOnly}
|
|
428
455
|
?disabled=${this.disabled}
|
|
429
|
-
?required=${this.required}
|
|
430
|
-
@invalid="${this.handleInvalid}"
|
|
431
456
|
@blur=${this.handleBlur}
|
|
432
457
|
@focus=${this.handleFocus}
|
|
433
458
|
@input=${super.handleInput}
|
|
459
|
+
@wheel=${this.onWheel}
|
|
434
460
|
@keydown=${this.handleKeydown}
|
|
461
|
+
@click=${this.handleClick}
|
|
435
462
|
@cut=${this.handleCut}
|
|
463
|
+
@change=${this.handleChange}
|
|
436
464
|
@compositionstart=${this.handleCompositionStart}
|
|
437
465
|
@compositionend=${this.handleCompositionEnd}
|
|
438
466
|
@dragenter=${this.handleDragEnter}
|
|
@@ -447,32 +475,21 @@ __decorate([
|
|
|
447
475
|
property({ attribute: 'input-format' })
|
|
448
476
|
], IgcDateTimeInputComponent.prototype, "inputFormat", null);
|
|
449
477
|
__decorate([
|
|
450
|
-
property({
|
|
451
|
-
converter: {
|
|
452
|
-
fromAttribute: (value) => !value ? null : DateTimeUtil.parseIsoDate(value),
|
|
453
|
-
toAttribute: (value) => value.toISOString(),
|
|
454
|
-
},
|
|
455
|
-
}),
|
|
478
|
+
property({ converter: converter }),
|
|
456
479
|
blazorTwoWayBind('igcChange', 'detail')
|
|
457
480
|
], IgcDateTimeInputComponent.prototype, "value", null);
|
|
458
481
|
__decorate([
|
|
459
|
-
property({
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
},
|
|
465
|
-
})
|
|
466
|
-
], IgcDateTimeInputComponent.prototype, "minValue", void 0);
|
|
482
|
+
property({ converter: converter })
|
|
483
|
+
], IgcDateTimeInputComponent.prototype, "min", void 0);
|
|
484
|
+
__decorate([
|
|
485
|
+
property({ converter: converter })
|
|
486
|
+
], IgcDateTimeInputComponent.prototype, "max", void 0);
|
|
467
487
|
__decorate([
|
|
468
|
-
property({
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
})
|
|
475
|
-
], IgcDateTimeInputComponent.prototype, "maxValue", void 0);
|
|
488
|
+
property({ attribute: 'min-value', converter: converter })
|
|
489
|
+
], IgcDateTimeInputComponent.prototype, "minValue", null);
|
|
490
|
+
__decorate([
|
|
491
|
+
property({ attribute: 'max-value', converter: converter })
|
|
492
|
+
], IgcDateTimeInputComponent.prototype, "maxValue", null);
|
|
476
493
|
__decorate([
|
|
477
494
|
property({ attribute: 'display-format' })
|
|
478
495
|
], IgcDateTimeInputComponent.prototype, "displayFormat", void 0);
|
|
@@ -495,13 +512,8 @@ __decorate([
|
|
|
495
512
|
watch('prompt', { waitUntilFirstUpdate: true })
|
|
496
513
|
], IgcDateTimeInputComponent.prototype, "promptChange", null);
|
|
497
514
|
__decorate([
|
|
498
|
-
watch('
|
|
499
|
-
watch('
|
|
500
|
-
|
|
501
|
-
], IgcDateTimeInputComponent.prototype, "handleInvalidState", null);
|
|
502
|
-
__decorate([
|
|
503
|
-
watch('maxValue'),
|
|
504
|
-
watch('minValue')
|
|
505
|
-
], IgcDateTimeInputComponent.prototype, "validate", null);
|
|
515
|
+
watch('min', { waitUntilFirstUpdate: true }),
|
|
516
|
+
watch('max', { waitUntilFirstUpdate: true })
|
|
517
|
+
], IgcDateTimeInputComponent.prototype, "constraintChange", null);
|
|
506
518
|
export default IgcDateTimeInputComponent;
|
|
507
519
|
//# sourceMappingURL=date-time-input.js.map
|