igniteui-webcomponents 4.11.1 → 5.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +67 -0
- package/README.md +168 -110
- package/components/accordion/accordion.d.ts +2 -2
- package/components/accordion/accordion.js +25 -35
- package/components/accordion/accordion.js.map +1 -1
- package/components/avatar/avatar.d.ts +1 -3
- package/components/avatar/avatar.js +1 -3
- package/components/avatar/avatar.js.map +1 -1
- package/components/avatar/themes/avatar.base.css.js +1 -1
- package/components/avatar/themes/avatar.base.css.js.map +1 -1
- package/components/badge/badge.d.ts +2 -1
- package/components/badge/badge.js.map +1 -1
- package/components/badge/themes/badge.base.css.js +1 -1
- package/components/badge/themes/badge.base.css.js.map +1 -1
- package/components/button/button-base.d.ts +3 -4
- package/components/button/button-base.js +1 -9
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +3 -7
- package/components/button/button.js +4 -5
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.d.ts +2 -2
- package/components/button/icon-button.js +0 -3
- package/components/button/icon-button.js.map +1 -1
- package/components/button/themes/button/button.base.css.js +1 -1
- package/components/button/themes/button/button.base.css.js.map +1 -1
- package/components/button/themes/icon-button/icon-button.base.css.js +1 -1
- package/components/button/themes/icon-button/icon-button.base.css.js.map +1 -1
- package/components/button-group/themes/button.base.css.js +1 -1
- package/components/button-group/themes/button.base.css.js.map +1 -1
- package/components/button-group/themes/group.base.css.js +1 -1
- package/components/button-group/themes/group.base.css.js.map +1 -1
- package/components/calendar/base.d.ts +65 -0
- package/components/calendar/base.js +150 -0
- package/components/calendar/base.js.map +1 -0
- package/components/calendar/calendar.d.ts +113 -61
- package/components/calendar/calendar.js +417 -514
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +43 -46
- package/components/calendar/days-view/days-view.js +269 -340
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +30 -0
- package/components/calendar/helpers.js +99 -0
- package/components/calendar/helpers.js.map +1 -0
- package/components/calendar/model.d.ts +55 -0
- package/components/calendar/model.js +94 -0
- package/components/calendar/model.js.map +1 -0
- package/components/calendar/months-view/months-view.d.ts +12 -12
- package/components/calendar/months-view/months-view.js +72 -79
- package/components/calendar/months-view/months-view.js.map +1 -1
- package/components/calendar/themes/calendar.base.css.js +1 -1
- package/components/calendar/themes/calendar.base.css.js.map +1 -1
- package/components/calendar/types.d.ts +16 -0
- package/components/calendar/types.js +10 -0
- package/components/calendar/types.js.map +1 -0
- package/components/calendar/years-view/years-view.d.ts +13 -12
- package/components/calendar/years-view/years-view.js +58 -73
- package/components/calendar/years-view/years-view.js.map +1 -1
- package/components/card/themes/card.actions.base.css.js +1 -1
- package/components/card/themes/card.actions.base.css.js.map +1 -1
- package/components/card/themes/card.content.base.css.js +1 -1
- package/components/card/themes/card.content.base.css.js.map +1 -1
- package/components/card/themes/card.header.base.css.js +1 -1
- package/components/card/themes/card.header.base.css.js.map +1 -1
- package/components/card/themes/card.media.base.css.js +1 -1
- package/components/card/themes/card.media.base.css.js.map +1 -1
- package/components/card/themes/container.base.css.js +1 -1
- package/components/card/themes/container.base.css.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +8 -5
- package/components/checkbox/checkbox-base.js +8 -15
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/checkbox/checkbox.d.ts +2 -4
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.d.ts +1 -3
- package/components/checkbox/switch.js.map +1 -1
- package/components/checkbox/themes/checkbox.base.css.js +1 -1
- package/components/checkbox/themes/checkbox.base.css.js.map +1 -1
- package/components/checkbox/themes/switch.base.css.js +1 -1
- package/components/checkbox/themes/switch.base.css.js.map +1 -1
- package/components/checkbox/validators.d.ts +3 -0
- package/components/checkbox/validators.js +5 -0
- package/components/checkbox/validators.js.map +1 -0
- package/components/chip/chip.d.ts +4 -3
- package/components/chip/chip.js +11 -19
- 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/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/combo/combo.d.ts +36 -54
- package/components/combo/combo.js +36 -59
- package/components/combo/combo.js.map +1 -1
- package/components/combo/themes/combo-header.base.css.js +1 -1
- package/components/combo/themes/combo-header.base.css.js.map +1 -1
- package/components/combo/themes/combo-item.base.css.js +1 -1
- package/components/combo/themes/combo-item.base.css.js.map +1 -1
- package/components/combo/themes/combo.base.css.js +1 -1
- package/components/combo/themes/combo.base.css.js.map +1 -1
- package/components/combo/types.d.ts +2 -2
- package/components/combo/types.js.map +1 -1
- package/components/combo/validators.d.ts +3 -0
- package/components/combo/validators.js +9 -0
- package/components/combo/validators.js.map +1 -0
- package/components/common/controllers/key-bindings.d.ts +1 -0
- package/components/common/controllers/key-bindings.js.map +1 -1
- package/components/common/controllers/mutation-observer.d.ts +1 -0
- package/components/common/controllers/mutation-observer.js.map +1 -1
- package/components/common/controllers/root-click.d.ts +4 -2
- package/components/common/controllers/root-click.js +13 -7
- package/components/common/controllers/root-click.js.map +1 -1
- package/components/common/definitions/defineAllComponents.js +0 -2
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/localization/intl-formatters.d.ts +17 -0
- package/components/common/localization/intl-formatters.js +46 -0
- package/components/common/localization/intl-formatters.js.map +1 -0
- package/components/common/mixins/alert.d.ts +3 -3
- package/components/common/mixins/alert.js +6 -4
- package/components/common/mixins/alert.js.map +1 -1
- package/components/common/mixins/combo-box.d.ts +4 -3
- package/components/common/mixins/combo-box.js +16 -10
- package/components/common/mixins/combo-box.js.map +1 -1
- package/components/common/mixins/form-associated.d.ts +1 -1
- package/components/common/mixins/form-associated.js +4 -2
- package/components/common/mixins/form-associated.js.map +1 -1
- package/components/common/util.d.ts +26 -0
- package/components/common/util.js +34 -0
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +7 -10
- package/components/date-picker/date-picker.js +16 -33
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/date-picker.base.css.js +1 -1
- package/components/date-picker/themes/date-picker.base.css.js.map +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js +1 -1
- package/components/date-picker/themes/shared/date-picker.common.css.js.map +1 -1
- package/components/date-picker/validators.d.ts +3 -0
- package/components/date-picker/validators.js +15 -0
- package/components/date-picker/validators.js.map +1 -0
- package/components/date-time-input/date-time-input.d.ts +3 -22
- package/components/date-time-input/date-time-input.js +8 -36
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/date-util.js +3 -1
- package/components/date-time-input/date-util.js.map +1 -1
- package/components/date-time-input/validators.d.ts +3 -0
- package/components/date-time-input/validators.js +18 -0
- package/components/date-time-input/validators.js.map +1 -0
- package/components/dialog/dialog.d.ts +12 -25
- package/components/dialog/dialog.js +55 -77
- package/components/dialog/dialog.js.map +1 -1
- package/components/dialog/themes/dialog.base.css.js +1 -1
- package/components/dialog/themes/dialog.base.css.js.map +1 -1
- package/components/dialog/themes/shared/dialog.common.css.js +1 -1
- package/components/dialog/themes/shared/dialog.common.css.js.map +1 -1
- package/components/divider/divider.js.map +1 -1
- package/components/divider/themes/divider.base.css.js +1 -1
- package/components/divider/themes/divider.base.css.js.map +1 -1
- package/components/dropdown/dropdown-group.d.ts +1 -1
- package/components/dropdown/dropdown-group.js +5 -3
- package/components/dropdown/dropdown-group.js.map +1 -1
- package/components/dropdown/dropdown.d.ts +4 -11
- package/components/dropdown/dropdown.js +10 -23
- package/components/dropdown/dropdown.js.map +1 -1
- package/components/dropdown/themes/dropdown-group.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-group.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown-header.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-header.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js +1 -1
- package/components/dropdown/themes/dropdown-item.base.css.js.map +1 -1
- package/components/dropdown/themes/dropdown.base.css.js +1 -1
- package/components/dropdown/themes/dropdown.base.css.js.map +1 -1
- package/components/expansion-panel/expansion-panel.d.ts +10 -10
- package/components/expansion-panel/expansion-panel.js +39 -39
- package/components/expansion-panel/expansion-panel.js.map +1 -1
- package/components/expansion-panel/themes/expansion-panel.base.css.js +1 -1
- package/components/expansion-panel/themes/expansion-panel.base.css.js.map +1 -1
- package/components/icon/icon-references.d.ts +28 -0
- package/components/icon/icon-references.js +151 -0
- package/components/icon/icon-references.js.map +1 -0
- package/components/icon/icon-state.broadcast.d.ts +10 -0
- package/components/icon/icon-state.broadcast.js +36 -0
- package/components/icon/icon-state.broadcast.js.map +1 -0
- package/components/icon/icon.d.ts +3 -3
- package/components/icon/icon.js +13 -7
- package/components/icon/icon.js.map +1 -1
- package/components/icon/icon.registry.d.ts +14 -14
- package/components/icon/icon.registry.js +70 -26
- package/components/icon/icon.registry.js.map +1 -1
- package/components/icon/internal-icons-lib.d.ts +2 -2
- package/components/icon/internal-icons-lib.js +2 -2
- package/components/icon/internal-icons-lib.js.map +1 -1
- package/components/icon/registry/default-map.d.ts +12 -0
- package/components/icon/registry/default-map.js +31 -0
- package/components/icon/registry/default-map.js.map +1 -0
- package/components/icon/registry/parser.d.ts +6 -0
- package/components/icon/registry/parser.js +21 -0
- package/components/icon/registry/parser.js.map +1 -0
- package/components/icon/registry/types.d.ts +34 -0
- package/components/icon/registry/types.js +7 -0
- package/components/icon/registry/types.js.map +1 -0
- package/components/icon/themes/icon.base.css.js +1 -1
- package/components/icon/themes/icon.base.css.js.map +1 -1
- package/components/input/input-base.d.ts +8 -21
- package/components/input/input-base.js +12 -41
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +3 -29
- package/components/input/input.js +4 -78
- 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/validators.d.ts +4 -0
- package/components/input/validators.js +30 -0
- package/components/input/validators.js.map +1 -0
- package/components/list/list.d.ts +1 -3
- package/components/list/list.js +1 -2
- package/components/list/list.js.map +1 -1
- package/components/list/themes/container.base.css.js +1 -1
- package/components/list/themes/container.base.css.js.map +1 -1
- package/components/mask-input/mask-input-base.d.ts +3 -2
- package/components/mask-input/mask-input-base.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +1 -4
- package/components/mask-input/mask-input.js +7 -17
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/mask-input/validators.d.ts +3 -0
- package/components/mask-input/validators.js +11 -0
- package/components/mask-input/validators.js.map +1 -0
- package/components/nav-drawer/nav-drawer-item.d.ts +1 -5
- package/components/nav-drawer/nav-drawer-item.js +9 -10
- package/components/nav-drawer/nav-drawer-item.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +4 -3
- package/components/nav-drawer/nav-drawer.js +18 -7
- 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/header-item.base.css.js +1 -1
- package/components/nav-drawer/themes/header-item.base.css.js.map +1 -1
- package/components/nav-drawer/themes/item.base.css.js +1 -1
- package/components/nav-drawer/themes/item.base.css.js.map +1 -1
- package/components/navbar/themes/navbar.base.css.js +1 -1
- package/components/navbar/themes/navbar.base.css.js.map +1 -1
- package/components/popover/themes/light/popover.base.css.js +1 -1
- package/components/popover/themes/light/popover.base.css.js.map +1 -1
- package/components/progress/base.d.ts +2 -1
- package/components/progress/base.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/linear/linear.progress.base.css.js +1 -1
- package/components/progress/themes/linear/linear.progress.base.css.js.map +1 -1
- package/components/radio/radio.d.ts +9 -9
- package/components/radio/radio.js +17 -31
- package/components/radio/radio.js.map +1 -1
- package/components/radio/themes/radio.base.css.js +1 -1
- package/components/radio/themes/radio.base.css.js.map +1 -1
- package/components/radio/validators.d.ts +3 -0
- package/components/radio/validators.js +13 -0
- package/components/radio/validators.js.map +1 -0
- package/components/radio-group/radio-group.base.css.js +1 -1
- package/components/radio-group/radio-group.base.css.js.map +1 -1
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/rating/rating.d.ts +1 -9
- package/components/rating/rating.js +6 -16
- package/components/rating/rating.js.map +1 -1
- package/components/rating/themes/rating-symbol.base.css.js +1 -1
- package/components/rating/themes/rating-symbol.base.css.js.map +1 -1
- package/components/rating/themes/rating.base.css.js +1 -1
- package/components/rating/themes/rating.base.css.js.map +1 -1
- package/components/ripple/ripple.material.css.js +1 -1
- package/components/ripple/ripple.material.css.js.map +1 -1
- package/components/select/select.d.ts +5 -33
- package/components/select/select.js +23 -66
- 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/validators.d.ts +3 -0
- package/components/select/validators.js +5 -0
- package/components/select/validators.js.map +1 -0
- package/components/slider/range-slider.d.ts +0 -16
- package/components/slider/range-slider.js +0 -18
- package/components/slider/range-slider.js.map +1 -1
- package/components/slider/themes/slider.base.css.js +1 -1
- package/components/slider/themes/slider.base.css.js.map +1 -1
- package/components/snackbar/snackbar.js +3 -7
- package/components/snackbar/snackbar.js.map +1 -1
- package/components/snackbar/themes/snackbar.base.css.js +1 -1
- package/components/snackbar/themes/snackbar.base.css.js.map +1 -1
- package/components/stepper/themes/step/step.base.css.js +1 -1
- package/components/stepper/themes/step/step.base.css.js.map +1 -1
- package/components/stepper/themes/stepper/stepper.base.css.js +1 -1
- package/components/stepper/themes/stepper/stepper.base.css.js.map +1 -1
- package/components/stepper/themes/stepper/stepper.bootstrap.css.js +1 -1
- package/components/stepper/themes/stepper/stepper.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/stepper/stepper.fluent.css.js +1 -1
- package/components/stepper/themes/stepper/stepper.fluent.css.js.map +1 -1
- package/components/stepper/themes/stepper/stepper.indigo.css.js +1 -1
- package/components/stepper/themes/stepper/stepper.indigo.css.js.map +1 -1
- package/components/tabs/tabs.js +2 -3
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/tab.base.css.js +1 -1
- package/components/tabs/themes/tab.base.css.js.map +1 -1
- package/components/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 +13 -16
- package/components/textarea/textarea.js +10 -12
- package/components/textarea/textarea.js.map +1 -1
- package/components/textarea/themes/textarea.base.css.js +1 -1
- package/components/textarea/themes/textarea.base.css.js.map +1 -1
- package/components/textarea/validators.d.ts +3 -0
- package/components/textarea/validators.js +7 -0
- package/components/textarea/validators.js.map +1 -0
- package/components/toast/themes/toast.base.css.js +1 -1
- package/components/toast/themes/toast.base.css.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/item.base.css.js +1 -1
- package/components/tree/themes/item.base.css.js.map +1 -1
- package/components/tree/tree-item.d.ts +4 -4
- package/components/tree/tree-item.js +11 -23
- package/components/tree/tree-item.js.map +1 -1
- package/components/tree/tree.d.ts +3 -4
- package/components/tree/tree.js +1 -37
- package/components/tree/tree.js.map +1 -1
- package/components/types.d.ts +3 -0
- package/components/types.js +2 -0
- package/components/types.js.map +1 -0
- package/custom-elements.json +30658 -31327
- package/igniteui-webcomponents.css-data.json +5 -928
- package/igniteui-webcomponents.html-data.json +4 -2699
- package/index.d.ts +5 -4
- package/index.js +2 -3
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/theming/config.js +3 -3
- package/theming/config.js.map +1 -1
- package/theming/theming-controller.d.ts +4 -6
- package/theming/theming-controller.js +30 -34
- package/theming/theming-controller.js.map +1 -1
- package/theming/theming-decorator.d.ts +29 -11
- package/theming/theming-decorator.js +21 -7
- package/theming/theming-decorator.js.map +1 -1
- package/theming/theming-event.js.map +1 -1
- package/theming/types.d.ts +5 -0
- package/theming/types.js.map +1 -1
- package/theming/utils.d.ts +1 -1
- package/theming/utils.js +8 -8
- package/theming/utils.js.map +1 -1
- package/web-types.json +12 -7621
- package/components/calendar/common/calendar-base.d.ts +0 -40
- package/components/calendar/common/calendar-base.js +0 -118
- package/components/calendar/common/calendar-base.js.map +0 -1
- package/components/calendar/common/calendar.model.d.ts +0 -128
- package/components/calendar/common/calendar.model.js +0 -246
- package/components/calendar/common/calendar.model.js.map +0 -1
- package/components/calendar/common/utils.d.ts +0 -12
- package/components/calendar/common/utils.js +0 -54
- package/components/calendar/common/utils.js.map +0 -1
- package/components/common/decorators/alternateName.d.ts +0 -7
- package/components/common/decorators/alternateName.js +0 -4
- package/components/common/decorators/alternateName.js.map +0 -1
- package/components/common/decorators/blazorSuppress.d.ts +0 -5
- package/components/common/decorators/blazorSuppress.js +0 -4
- package/components/common/decorators/blazorSuppress.js.map +0 -1
- package/components/common/decorators/blazorTwoWayBind.d.ts +0 -7
- package/components/common/decorators/blazorTwoWayBind.js +0 -4
- package/components/common/decorators/blazorTwoWayBind.js.map +0 -1
- package/components/common/mixins/sizable.d.ts +0 -13
- package/components/common/mixins/sizable.js +0 -27
- package/components/common/mixins/sizable.js.map +0 -1
- package/components/form/form.d.ts +0 -48
- package/components/form/form.js +0 -158
- package/components/form/form.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class DefaultMap<T, U> {
|
|
2
|
+
private _defaultValue;
|
|
3
|
+
private _map;
|
|
4
|
+
constructor(defaultValue: () => U);
|
|
5
|
+
getOrCreate(key: T): U;
|
|
6
|
+
get(key: T): U | undefined;
|
|
7
|
+
set(key: T, value: U): void;
|
|
8
|
+
has(key: T): boolean;
|
|
9
|
+
toMap(): Map<T, U>;
|
|
10
|
+
entries(): IterableIterator<[T, U]>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createIconDefaultMap<T, U>(): DefaultMap<T, Map<T, U>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export class DefaultMap {
|
|
2
|
+
constructor(defaultValue) {
|
|
3
|
+
this._map = new Map();
|
|
4
|
+
this._defaultValue = defaultValue;
|
|
5
|
+
}
|
|
6
|
+
getOrCreate(key) {
|
|
7
|
+
if (!this._map.has(key)) {
|
|
8
|
+
this._map.set(key, this._defaultValue());
|
|
9
|
+
}
|
|
10
|
+
return this._map.get(key);
|
|
11
|
+
}
|
|
12
|
+
get(key) {
|
|
13
|
+
return this._map.get(key);
|
|
14
|
+
}
|
|
15
|
+
set(key, value) {
|
|
16
|
+
this._map.set(key, value);
|
|
17
|
+
}
|
|
18
|
+
has(key) {
|
|
19
|
+
return this._map.has(key);
|
|
20
|
+
}
|
|
21
|
+
toMap() {
|
|
22
|
+
return this._map;
|
|
23
|
+
}
|
|
24
|
+
entries() {
|
|
25
|
+
return this._map.entries();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function createIconDefaultMap() {
|
|
29
|
+
return new DefaultMap(() => new Map());
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=default-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-map.js","sourceRoot":"","sources":["../../../../src/components/icon/registry/default-map.ts"],"names":[],"mappings":"AACA,MAAM,OAAO,UAAU;IAIrB,YAAY,YAAqB;QAFzB,SAAI,GAAG,IAAI,GAAG,EAAQ,CAAC;QAG7B,IAAI,CAAC,aAAa,GAAG,YAAY,CAAC;IACpC,CAAC;IAEM,WAAW,CAAC,GAAM;QACvB,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACxB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC;QAC3C,CAAC;QAED,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAM,CAAC;IACjC,CAAC;IAEM,GAAG,CAAC,GAAM;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAEM,GAAG,CAAC,GAAM,EAAE,KAAQ;QACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC5B,CAAC;IAEM,GAAG,CAAC,GAAM;QACf,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC;IAEM,KAAK;QACV,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;IAC7B,CAAC;CACF;AAED,MAAM,UAAU,oBAAoB;IAClC,OAAO,IAAI,UAAU,CAAe,GAAG,EAAE,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;AACvD,CAAC","sourcesContent":["/* blazorSuppress */\nexport class DefaultMap<T, U> {\n private _defaultValue: () => U;\n private _map = new Map<T, U>();\n\n constructor(defaultValue: () => U) {\n this._defaultValue = defaultValue;\n }\n\n public getOrCreate(key: T) {\n if (!this._map.has(key)) {\n this._map.set(key, this._defaultValue());\n }\n\n return this._map.get(key) as U;\n }\n\n public get(key: T) {\n return this._map.get(key);\n }\n\n public set(key: T, value: U) {\n this._map.set(key, value);\n }\n\n public has(key: T) {\n return this._map.has(key);\n }\n\n public toMap() {\n return this._map;\n }\n\n public entries() {\n return this._map.entries();\n }\n}\n\nexport function createIconDefaultMap<T, U>() {\n return new DefaultMap<T, Map<T, U>>(() => new Map());\n}\n"]}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export class SvgIconParser {
|
|
2
|
+
constructor() {
|
|
3
|
+
this._parser = new DOMParser();
|
|
4
|
+
}
|
|
5
|
+
parse(svgString) {
|
|
6
|
+
const root = this._parser.parseFromString(svgString, 'image/svg+xml');
|
|
7
|
+
const svg = root.querySelector('svg');
|
|
8
|
+
const error = root.querySelector('parsererror');
|
|
9
|
+
if (error || !svg) {
|
|
10
|
+
throw new Error('SVG element not found or malformed SVG string.');
|
|
11
|
+
}
|
|
12
|
+
const title = svg.querySelector('title')?.textContent ?? '';
|
|
13
|
+
svg.setAttribute('fit', '');
|
|
14
|
+
svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');
|
|
15
|
+
return {
|
|
16
|
+
svg: svg.outerHTML,
|
|
17
|
+
title,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/components/icon/registry/parser.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,aAAa;IAGxB;QACE,IAAI,CAAC,OAAO,GAAG,IAAI,SAAS,EAAE,CAAC;IACjC,CAAC;IAEM,KAAK,CAAC,SAAiB;QAC5B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACtE,MAAM,GAAG,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;QACtC,MAAM,KAAK,GAAG,IAAI,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC;QAEhD,IAAI,KAAK,IAAI,CAAC,GAAG,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;QACpE,CAAC;QAED,MAAM,KAAK,GAAG,GAAG,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,WAAW,IAAI,EAAE,CAAC;QAE5D,GAAG,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QAC5B,GAAG,CAAC,YAAY,CAAC,qBAAqB,EAAE,eAAe,CAAC,CAAC;QAEzD,OAAO;YACL,GAAG,EAAE,GAAG,CAAC,SAAS;YAClB,KAAK;SACN,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { SvgIcon } from './types.js';\n\n/* blazorSuppress */\nexport class SvgIconParser {\n private _parser: DOMParser;\n\n constructor() {\n this._parser = new DOMParser();\n }\n\n public parse(svgString: string): SvgIcon {\n const root = this._parser.parseFromString(svgString, 'image/svg+xml');\n const svg = root.querySelector('svg');\n const error = root.querySelector('parsererror');\n\n if (error || !svg) {\n throw new Error('SVG element not found or malformed SVG string.');\n }\n\n const title = svg.querySelector('title')?.textContent ?? '';\n\n svg.setAttribute('fit', '');\n svg.setAttribute('preserveAspectRatio', 'xMidYMid meet');\n\n return {\n svg: svg.outerHTML,\n title,\n };\n }\n}\n"]}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Theme } from '../../../theming/types.js';
|
|
2
|
+
import type { DefaultMap } from './default-map.js';
|
|
3
|
+
export type IconsCollection<T> = DefaultMap<string, Map<string, T>>;
|
|
4
|
+
export type IconCallback = (name: string, collection: string) => void;
|
|
5
|
+
export type IconThemeKey = Theme | 'default';
|
|
6
|
+
export type SvgIcon = {
|
|
7
|
+
svg: string;
|
|
8
|
+
title?: string;
|
|
9
|
+
};
|
|
10
|
+
export type IconReference = {
|
|
11
|
+
alias: IconMeta;
|
|
12
|
+
target: Map<IconThemeKey, IconMeta>;
|
|
13
|
+
};
|
|
14
|
+
export type IconReferencePair = {
|
|
15
|
+
alias: IconMeta;
|
|
16
|
+
target: IconMeta;
|
|
17
|
+
overwrite: boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare enum ActionType {
|
|
20
|
+
SyncState = 0,
|
|
21
|
+
RegisterIcon = 1,
|
|
22
|
+
UpdateIconReference = 2
|
|
23
|
+
}
|
|
24
|
+
/** @ignore */
|
|
25
|
+
export interface BroadcastIconsChangeMessage {
|
|
26
|
+
actionType: ActionType;
|
|
27
|
+
collections?: Map<string, Map<string, SvgIcon>>;
|
|
28
|
+
references?: Map<string, Map<string, IconMeta>>;
|
|
29
|
+
}
|
|
30
|
+
export interface IconMeta {
|
|
31
|
+
name: string;
|
|
32
|
+
collection: string;
|
|
33
|
+
external?: boolean;
|
|
34
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export var ActionType;
|
|
2
|
+
(function (ActionType) {
|
|
3
|
+
ActionType[ActionType["SyncState"] = 0] = "SyncState";
|
|
4
|
+
ActionType[ActionType["RegisterIcon"] = 1] = "RegisterIcon";
|
|
5
|
+
ActionType[ActionType["UpdateIconReference"] = 2] = "UpdateIconReference";
|
|
6
|
+
})(ActionType || (ActionType = {}));
|
|
7
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/icon/registry/types.ts"],"names":[],"mappings":"AA0BA,MAAM,CAAN,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,qDAAa,CAAA;IACb,2DAAgB,CAAA;IAChB,yEAAuB,CAAA;AACzB,CAAC,EAJW,UAAU,KAAV,UAAU,QAIrB","sourcesContent":["import type { Theme } from '../../../theming/types.js';\nimport type { DefaultMap } from './default-map.js';\n\n// Exported internal types\n\nexport type IconsCollection<T> = DefaultMap<string, Map<string, T>>;\n\nexport type IconCallback = (name: string, collection: string) => void;\nexport type IconThemeKey = Theme | 'default';\n\nexport type SvgIcon = {\n svg: string;\n title?: string;\n};\n\nexport type IconReference = {\n alias: IconMeta;\n target: Map<IconThemeKey, IconMeta>;\n};\n\nexport type IconReferencePair = {\n alias: IconMeta;\n target: IconMeta;\n overwrite: boolean;\n};\n\nexport enum ActionType {\n SyncState = 0,\n RegisterIcon = 1,\n UpdateIconReference = 2,\n}\n\n/** @ignore */\nexport interface BroadcastIconsChangeMessage {\n actionType: ActionType;\n collections?: Map<string, Map<string, SvgIcon>>;\n references?: Map<string, Map<string, IconMeta>>;\n}\n\n// Exported public types\n\nexport interface IconMeta {\n name: string;\n collection: string;\n external?: boolean;\n}\n"]}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { css } from 'lit';
|
|
2
|
-
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size);scrollbar-color:var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background)}:host
|
|
2
|
+
export const styles = css `:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size);scrollbar-color:var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background)}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size);height:var(--ig-scrollbar-size);background:var(--ig-scrollbar-track-background)}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background)}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}igc-icon,svg{width:1em;height:1em}:host([mirrored]){-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}`;
|
|
3
3
|
//# sourceMappingURL=icon.base.css.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.base.css.js","sourceRoot":"","sources":["../../../../src/components/icon/themes/icon.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,msCAAmsC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size);scrollbar-color:var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background)}:host
|
|
1
|
+
{"version":3,"file":"icon.base.css.js","sourceRoot":"","sources":["../../../../src/components/icon/themes/icon.base.css.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA,msCAAmsC,CAAC","sourcesContent":["import { css } from 'lit';\n\nexport const styles = css`:host{--is-large: clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-large, 3), 1);--is-medium: min( clamp(0, (var(--component-size, 1) + 1) - var(--ig-size-medium, 2), 1), clamp(0, var(--ig-size-large, 3) - var(--component-size, 1), 1) );--is-small: clamp(0, var(--ig-size-medium) - var(--component-size, 1), 1);position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;scrollbar-width:var(--ig-scrollbar-size);scrollbar-color:var(--ig-scrollbar-thumb-background) var(--ig-scrollbar-track-background)}:host ::-webkit-scrollbar{width:var(--ig-scrollbar-size);height:var(--ig-scrollbar-size);background:var(--ig-scrollbar-track-background)}:host ::-webkit-scrollbar-thumb{background:var(--ig-scrollbar-thumb-background)}:host *,:host *::before,:host *::after{-webkit-box-sizing:border-box;box-sizing:border-box}:host([hidden]),[hidden]{display:none !important}:host{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}igc-icon,svg{width:1em;height:1em}:host([mirrored]){-webkit-transform:scaleX(-1);-ms-transform:scaleX(-1);transform:scaleX(-1)}`;\n"]}
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { LitElement, type TemplateResult } from 'lit';
|
|
2
|
-
import { themeSymbol } from '../../theming/theming-decorator.js';
|
|
3
2
|
import type { Constructor } from '../common/mixins/constructor.js';
|
|
3
|
+
import type { RangeTextSelectMode, SelectionRangeDirection } from '../types.js';
|
|
4
4
|
export interface IgcInputEventMap {
|
|
5
5
|
igcInput: CustomEvent<string>;
|
|
6
6
|
igcChange: CustomEvent<string>;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
focus: FocusEvent;
|
|
8
|
+
blur: FocusEvent;
|
|
9
9
|
}
|
|
10
|
-
declare const IgcInputBaseComponent_base: Constructor<import("../common/mixins/form-associated-required.js").FormRequiredInterface & import("../common/mixins/form-associated.js").FormAssociatedElementInterface> & Constructor<import("../common/mixins/
|
|
10
|
+
declare const IgcInputBaseComponent_base: Constructor<import("../common/mixins/form-associated-required.js").FormRequiredInterface & import("../common/mixins/form-associated.js").FormAssociatedElementInterface> & Constructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcInputEventMap>> & Constructor<LitElement>;
|
|
11
11
|
export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponent_base {
|
|
12
|
-
private readonly [themeSymbol];
|
|
13
12
|
protected static shadowRootOptions: {
|
|
14
13
|
delegatesFocus: boolean;
|
|
15
14
|
mode: ShadowRootMode;
|
|
@@ -25,6 +24,7 @@ export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponen
|
|
|
25
24
|
protected prefixes: Array<HTMLElement>;
|
|
26
25
|
protected suffixes: Array<HTMLElement>;
|
|
27
26
|
protected helperText: Array<HTMLElement>;
|
|
27
|
+
protected get _isMaterial(): boolean;
|
|
28
28
|
/**
|
|
29
29
|
* Whether the control will have outlined appearance.
|
|
30
30
|
* @attr
|
|
@@ -35,14 +35,6 @@ export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponen
|
|
|
35
35
|
* @attr readonly
|
|
36
36
|
*/
|
|
37
37
|
readOnly: boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Makes the control a readonly field.
|
|
40
|
-
* @prop
|
|
41
|
-
*
|
|
42
|
-
* @deprecated since v4.4.0. Use the `readOnly` property instead.
|
|
43
|
-
*/
|
|
44
|
-
set readonly(value: boolean);
|
|
45
|
-
get readonly(): boolean;
|
|
46
38
|
/**
|
|
47
39
|
* The placeholder attribute of the control.
|
|
48
40
|
* @attr
|
|
@@ -53,27 +45,22 @@ export declare abstract class IgcInputBaseComponent extends IgcInputBaseComponen
|
|
|
53
45
|
* @attr
|
|
54
46
|
*/
|
|
55
47
|
label: string;
|
|
56
|
-
|
|
57
|
-
connectedCallback(): void;
|
|
58
|
-
disconnectedCallback(): void;
|
|
48
|
+
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
59
49
|
/** Sets focus on the control. */
|
|
60
50
|
focus(options?: FocusOptions): void;
|
|
61
51
|
/** Removes focus from the control. */
|
|
62
52
|
blur(): void;
|
|
63
53
|
protected abstract renderInput(): TemplateResult;
|
|
64
|
-
protected handleSlotChange: () => void;
|
|
65
54
|
protected resolvePartNames(base: string): {
|
|
66
55
|
[x: string]: boolean;
|
|
67
56
|
prefixed: boolean;
|
|
68
57
|
suffixed: boolean;
|
|
69
58
|
filled: boolean;
|
|
70
59
|
};
|
|
71
|
-
protected handleFocus(): void;
|
|
72
|
-
protected handleBlur(): void;
|
|
73
60
|
/** Sets the text selection range of the control */
|
|
74
|
-
setSelectionRange(start: number, end: number, direction?:
|
|
61
|
+
setSelectionRange(start: number, end: number, direction?: SelectionRangeDirection): void;
|
|
75
62
|
/** Replaces the selected text in the input. */
|
|
76
|
-
setRangeText(replacement: string, start: number, end: number, selectMode?:
|
|
63
|
+
setRangeText(replacement: string, start: number, end: number, selectMode?: RangeTextSelectMode): void;
|
|
77
64
|
private renderPrefix;
|
|
78
65
|
private renderSuffix;
|
|
79
66
|
private renderLabel;
|
|
@@ -7,38 +7,28 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
var IgcInputBaseComponent_1;
|
|
8
8
|
import { LitElement, html, nothing } from 'lit';
|
|
9
9
|
import { property, query, queryAssignedElements } from 'lit/decorators.js';
|
|
10
|
-
import {
|
|
11
|
-
import { alternateName } from '../common/decorators/alternateName.js';
|
|
10
|
+
import { getThemeController, themes } from '../../theming/theming-decorator.js';
|
|
12
11
|
import { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';
|
|
13
12
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
14
13
|
import { FormAssociatedRequiredMixin } from '../common/mixins/form-associated-required.js';
|
|
15
|
-
import { SizableMixin } from '../common/mixins/sizable.js';
|
|
16
14
|
import { createCounter, partNameMap } from '../common/util.js';
|
|
17
15
|
import { styles } from './themes/input.base.css.js';
|
|
18
16
|
import { styles as shared } from './themes/shared/input.common.css.js';
|
|
19
17
|
import { all } from './themes/themes.js';
|
|
20
|
-
let IgcInputBaseComponent = IgcInputBaseComponent_1 = class IgcInputBaseComponent extends FormAssociatedRequiredMixin(
|
|
21
|
-
set readonly(value) {
|
|
22
|
-
this.readOnly = value;
|
|
23
|
-
}
|
|
24
|
-
get readonly() {
|
|
25
|
-
return this.readOnly;
|
|
26
|
-
}
|
|
18
|
+
let IgcInputBaseComponent = IgcInputBaseComponent_1 = class IgcInputBaseComponent extends FormAssociatedRequiredMixin(EventEmitterMixin(LitElement)) {
|
|
27
19
|
constructor() {
|
|
28
|
-
super();
|
|
20
|
+
super(...arguments);
|
|
29
21
|
this.inputId = `input-${IgcInputBaseComponent_1.increment()}`;
|
|
30
22
|
this.outlined = false;
|
|
31
23
|
this.readOnly = false;
|
|
32
|
-
this.handleSlotChange = () => this.requestUpdate();
|
|
33
|
-
this.size = 'medium';
|
|
34
24
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.shadowRoot.addEventListener('slotchange', this.handleSlotChange);
|
|
25
|
+
get _isMaterial() {
|
|
26
|
+
return getThemeController(this)?.theme === 'material';
|
|
38
27
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
createRenderRoot() {
|
|
29
|
+
const root = super.createRenderRoot();
|
|
30
|
+
root.addEventListener('slotchange', () => this.requestUpdate());
|
|
31
|
+
return root;
|
|
42
32
|
}
|
|
43
33
|
focus(options) {
|
|
44
34
|
this.input.focus(options);
|
|
@@ -54,12 +44,6 @@ let IgcInputBaseComponent = IgcInputBaseComponent_1 = class IgcInputBaseComponen
|
|
|
54
44
|
filled: !!this.value,
|
|
55
45
|
};
|
|
56
46
|
}
|
|
57
|
-
handleFocus() {
|
|
58
|
-
this.emitEvent('igcFocus');
|
|
59
|
-
}
|
|
60
|
-
handleBlur() {
|
|
61
|
-
this.emitEvent('igcBlur');
|
|
62
|
-
}
|
|
63
47
|
setSelectionRange(start, end, direction = 'none') {
|
|
64
48
|
this.input.setSelectionRange(start, end, direction);
|
|
65
49
|
}
|
|
@@ -110,11 +94,7 @@ let IgcInputBaseComponent = IgcInputBaseComponent_1 = class IgcInputBaseComponen
|
|
|
110
94
|
</div>`;
|
|
111
95
|
}
|
|
112
96
|
render() {
|
|
113
|
-
return
|
|
114
|
-
${this[themeSymbol] === 'material'
|
|
115
|
-
? this.renderMaterial()
|
|
116
|
-
: this.renderStandard()}
|
|
117
|
-
`;
|
|
97
|
+
return this._isMaterial ? this.renderMaterial() : this.renderStandard();
|
|
118
98
|
}
|
|
119
99
|
};
|
|
120
100
|
IgcInputBaseComponent.shadowRootOptions = {
|
|
@@ -141,24 +121,15 @@ __decorate([
|
|
|
141
121
|
__decorate([
|
|
142
122
|
property({ type: Boolean, reflect: true, attribute: 'readonly' })
|
|
143
123
|
], IgcInputBaseComponent.prototype, "readOnly", void 0);
|
|
144
|
-
__decorate([
|
|
145
|
-
property({ attribute: false })
|
|
146
|
-
], IgcInputBaseComponent.prototype, "readonly", null);
|
|
147
124
|
__decorate([
|
|
148
125
|
property()
|
|
149
126
|
], IgcInputBaseComponent.prototype, "placeholder", void 0);
|
|
150
127
|
__decorate([
|
|
151
128
|
property()
|
|
152
129
|
], IgcInputBaseComponent.prototype, "label", void 0);
|
|
153
|
-
__decorate([
|
|
154
|
-
alternateName('focusComponent')
|
|
155
|
-
], IgcInputBaseComponent.prototype, "focus", null);
|
|
156
|
-
__decorate([
|
|
157
|
-
alternateName('blurComponent')
|
|
158
|
-
], IgcInputBaseComponent.prototype, "blur", null);
|
|
159
130
|
IgcInputBaseComponent = IgcInputBaseComponent_1 = __decorate([
|
|
160
|
-
|
|
161
|
-
|
|
131
|
+
blazorDeepImport,
|
|
132
|
+
themes(all, { exposeController: true })
|
|
162
133
|
], IgcInputBaseComponent);
|
|
163
134
|
export { IgcInputBaseComponent };
|
|
164
135
|
//# sourceMappingURL=input-base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-base.js","sourceRoot":"","sources":["../../../src/components/input/input-base.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAAE,UAAU,EAAuB,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE3E,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAE5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAC3F,OAAO,EAAE,YAAY,EAAE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E,IAAI,EAAE,OAAO,EAAE,CAAC;uDACnB;AAOjB;IADN,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;uDAC1C;AAUxB;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;qDAG9B;AAWM;IADN,QAAQ,EAAE;0DACiB;AAOrB;IADN,QAAQ,EAAE;oDACW;AAmBN;IADf,aAAa,CAAC,gBAAgB,CAAC;kDAG/B;AAIe;IADf,aAAa,CAAC,eAAe,CAAC;iDAG9B;AAtGmB,qBAAqB;IAF1C,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC;IACjB,gBAAgB;GACK,qBAAqB,CAsM1C","sourcesContent":["import { LitElement, type TemplateResult, html, nothing } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { themeSymbol, themes } from '../../theming/theming-decorator.js';\nimport type { Theme } from '../../theming/types.js';\nimport { alternateName } from '../common/decorators/alternateName.js';\nimport { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/form-associated-required.js';\nimport { SizableMixin } from '../common/mixins/sizable.js';\nimport { createCounter, partNameMap } from '../common/util.js';\nimport { styles } from './themes/input.base.css.js';\nimport { styles as shared } from './themes/shared/input.common.css.js';\nimport { all } from './themes/themes.js';\n\nexport interface IgcInputEventMap {\n /* alternateName: inputOcurred */\n igcInput: CustomEvent<string>;\n /* blazorSuppress */\n igcChange: CustomEvent<string>;\n igcFocus: CustomEvent<void>;\n igcBlur: CustomEvent<void>;\n}\n\n@themes(all, true)\n@blazorDeepImport\nexport abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin(\n SizableMixin(\n EventEmitterMixin<IgcInputEventMap, Constructor<LitElement>>(LitElement)\n )\n) {\n private declare readonly [themeSymbol]: Theme;\n\n protected static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n public static styles = [styles, shared];\n private static readonly increment = createCounter();\n\n protected inputId = `input-${IgcInputBaseComponent.increment()}`;\n\n /* blazorSuppress */\n /** The value attribute of the control. */\n public abstract value: string | Date | null;\n\n @query('input')\n protected input!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'prefix' })\n protected prefixes!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'suffix' })\n protected suffixes!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /* blazorCSSuppress */\n /**\n * Makes the control a readonly field.\n * @prop\n *\n * @deprecated since v4.4.0. Use the `readOnly` property instead.\n */\n @property({ attribute: false })\n public set readonly(value: boolean) {\n this.readOnly = value;\n }\n\n public get readonly() {\n return this.readOnly;\n }\n\n /**\n * The placeholder attribute of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The label for the control.\n * @attr\n */\n @property()\n public label!: string;\n\n constructor() {\n super();\n this.size = 'medium';\n }\n\n public override connectedCallback() {\n super.connectedCallback();\n this.shadowRoot!.addEventListener('slotchange', this.handleSlotChange);\n }\n\n public override disconnectedCallback() {\n this.shadowRoot!.removeEventListener('slotchange', this.handleSlotChange);\n super.disconnectedCallback();\n }\n\n /** Sets focus on the control. */\n @alternateName('focusComponent')\n public override focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /** Removes focus from the control. */\n @alternateName('blurComponent')\n public override blur() {\n this.input.blur();\n }\n\n protected abstract renderInput(): TemplateResult;\n protected handleSlotChange = () => this.requestUpdate();\n\n protected resolvePartNames(base: string) {\n return {\n [base]: true,\n prefixed: this.prefixes.length > 0,\n suffixed: this.suffixes.length > 0,\n filled: !!this.value,\n };\n }\n\n protected handleFocus() {\n this.emitEvent('igcFocus');\n }\n\n protected handleBlur() {\n this.emitEvent('igcBlur');\n }\n\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start: number,\n end: number,\n direction: 'backward' | 'forward' | 'none' = 'none'\n ) {\n this.input.setSelectionRange(start, end, direction);\n }\n\n /** Replaces the selected text in the input. */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: 'select' | 'start' | 'end' | 'preserve' = 'preserve'\n ) {\n this.input.setRangeText(replacement, start, end, selectMode);\n }\n\n private renderPrefix() {\n return html`<div part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </div>`;\n }\n\n private renderSuffix() {\n return html`<div part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </div>`;\n }\n\n private renderLabel() {\n return this.label\n ? html`<label part=\"label\" for=\"${this.inputId}\"> ${this.label} </label>`\n : nothing;\n }\n\n private renderMaterial() {\n return html`\n <div\n part=\"${partNameMap({\n ...this.resolvePartNames('container'),\n labelled: this.label,\n })}\"\n >\n <div part=\"start\">${this.renderPrefix()}</div>\n ${this.renderInput()}\n <div part=\"notch\">${this.renderLabel()}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${this.renderSuffix()}</div>\n </div>\n <div part=\"helper-text\" .hidden=\"${this.helperText.length === 0}\">\n <slot name=\"helper-text\"></slot>\n </div>\n `;\n }\n\n private renderStandard() {\n return html`${this.renderLabel()}\n <div part=\"${partNameMap(this.resolvePartNames('container'))}\">\n ${this.renderPrefix()} ${this.renderInput()} ${this.renderSuffix()}\n </div>\n <div part=\"helper-text\" .hidden=\"${this.helperText.length === 0}\">\n <slot name=\"helper-text\"></slot>\n </div>`;\n }\n\n protected override render() {\n return html`\n ${this[themeSymbol] === 'material'\n ? this.renderMaterial()\n : this.renderStandard()}\n `;\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"input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,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;uDAC1C;AAOjB;IADN,QAAQ,EAAE;0DACiB;AAOrB;IADN,QAAQ,EAAE;oDACW;AA3DF,qBAAqB;IAF1C,gBAAgB;IAChB,MAAM,CAAC,GAAG,EAAE,EAAE,gBAAgB,EAAE,IAAI,EAAE,CAAC;GAClB,qBAAqB,CAgK1C","sourcesContent":["import { LitElement, type TemplateResult, html, nothing } from 'lit';\nimport { property, query, queryAssignedElements } from 'lit/decorators.js';\n\nimport { getThemeController, themes } from '../../theming/theming-decorator.js';\nimport { blazorDeepImport } from '../common/decorators/blazorDeepImport.js';\nimport type { Constructor } from '../common/mixins/constructor.js';\nimport { EventEmitterMixin } from '../common/mixins/event-emitter.js';\nimport { FormAssociatedRequiredMixin } from '../common/mixins/form-associated-required.js';\nimport { createCounter, partNameMap } from '../common/util.js';\nimport type { RangeTextSelectMode, SelectionRangeDirection } from '../types.js';\nimport { styles } from './themes/input.base.css.js';\nimport { styles as shared } from './themes/shared/input.common.css.js';\nimport { all } from './themes/themes.js';\n\nexport interface IgcInputEventMap {\n /* alternateName: inputOcurred */\n igcInput: CustomEvent<string>;\n /* blazorSuppress */\n igcChange: CustomEvent<string>;\n // For analyzer meta only:\n focus: FocusEvent;\n blur: FocusEvent;\n}\n\n@blazorDeepImport\n@themes(all, { exposeController: true })\nexport abstract class IgcInputBaseComponent extends FormAssociatedRequiredMixin(\n EventEmitterMixin<IgcInputEventMap, Constructor<LitElement>>(LitElement)\n) {\n protected static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n\n public static styles = [styles, shared];\n private static readonly increment = createCounter();\n\n protected inputId = `input-${IgcInputBaseComponent.increment()}`;\n\n /* blazorSuppress */\n /** The value attribute of the control. */\n public abstract value: string | Date | null;\n\n @query('input')\n protected input!: HTMLInputElement;\n\n @queryAssignedElements({ slot: 'prefix' })\n protected prefixes!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'suffix' })\n protected suffixes!: Array<HTMLElement>;\n\n @queryAssignedElements({ slot: 'helper-text' })\n protected helperText!: Array<HTMLElement>;\n\n protected get _isMaterial() {\n return getThemeController(this)?.theme === 'material';\n }\n\n /**\n * Whether the control will have outlined appearance.\n * @attr\n */\n @property({ reflect: true, type: Boolean })\n public outlined = false;\n\n /**\n * Makes the control a readonly field.\n * @attr readonly\n */\n @property({ type: Boolean, reflect: true, attribute: 'readonly' })\n public readOnly = false;\n\n /**\n * The placeholder attribute of the control.\n * @attr\n */\n @property()\n public placeholder!: string;\n\n /**\n * The label for the control.\n * @attr\n */\n @property()\n public label!: string;\n\n protected override createRenderRoot() {\n const root = super.createRenderRoot();\n root.addEventListener('slotchange', () => this.requestUpdate());\n return root;\n }\n\n /* alternateName: focusComponent */\n /** Sets focus on the control. */\n public override focus(options?: FocusOptions) {\n this.input.focus(options);\n }\n\n /* alternateName: blurComponent */\n /** Removes focus from the control. */\n public override blur() {\n this.input.blur();\n }\n\n protected abstract renderInput(): TemplateResult;\n\n protected resolvePartNames(base: string) {\n return {\n [base]: true,\n prefixed: this.prefixes.length > 0,\n suffixed: this.suffixes.length > 0,\n filled: !!this.value,\n };\n }\n\n /** Sets the text selection range of the control */\n public setSelectionRange(\n start: number,\n end: number,\n direction: SelectionRangeDirection = 'none'\n ) {\n this.input.setSelectionRange(start, end, direction);\n }\n\n /** Replaces the selected text in the input. */\n public setRangeText(\n replacement: string,\n start: number,\n end: number,\n selectMode: RangeTextSelectMode = 'preserve'\n ) {\n this.input.setRangeText(replacement, start, end, selectMode);\n }\n\n private renderPrefix() {\n return html`<div part=\"prefix\">\n <slot name=\"prefix\"></slot>\n </div>`;\n }\n\n private renderSuffix() {\n return html`<div part=\"suffix\">\n <slot name=\"suffix\"></slot>\n </div>`;\n }\n\n private renderLabel() {\n return this.label\n ? html`<label part=\"label\" for=\"${this.inputId}\"> ${this.label} </label>`\n : nothing;\n }\n\n private renderMaterial() {\n return html`\n <div\n part=\"${partNameMap({\n ...this.resolvePartNames('container'),\n labelled: this.label,\n })}\"\n >\n <div part=\"start\">${this.renderPrefix()}</div>\n ${this.renderInput()}\n <div part=\"notch\">${this.renderLabel()}</div>\n <div part=\"filler\"></div>\n <div part=\"end\">${this.renderSuffix()}</div>\n </div>\n <div part=\"helper-text\" .hidden=\"${this.helperText.length === 0}\">\n <slot name=\"helper-text\"></slot>\n </div>\n `;\n }\n\n private renderStandard() {\n return html`${this.renderLabel()}\n <div part=\"${partNameMap(this.resolvePartNames('container'))}\">\n ${this.renderPrefix()} ${this.renderInput()} ${this.renderSuffix()}\n </div>\n <div part=\"helper-text\" .hidden=\"${this.helperText.length === 0}\">\n <slot name=\"helper-text\"></slot>\n </div>`;\n }\n\n protected override render() {\n return this._isMaterial ? this.renderMaterial() : this.renderStandard();\n }\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RangeTextSelectMode } from '../types.js';
|
|
2
2
|
import { IgcInputBaseComponent } from './input-base.js';
|
|
3
3
|
/**
|
|
4
4
|
* @element igc-input
|
|
@@ -9,8 +9,6 @@ import { IgcInputBaseComponent } from './input-base.js';
|
|
|
9
9
|
*
|
|
10
10
|
* @fires igcInput - Emitted when the control input receives user input.
|
|
11
11
|
* @fires igcChange - Emitted when the control's checked state changes.
|
|
12
|
-
* @fires igcFocus - Emitted when the control gains focus.
|
|
13
|
-
* @fires igcBlur - Emitted when the control loses focus.
|
|
14
12
|
*
|
|
15
13
|
* @csspart container - The main wrapper that holds all main input elements.
|
|
16
14
|
* @csspart input - The native input element.
|
|
@@ -23,7 +21,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
23
21
|
static readonly tagName = "igc-input";
|
|
24
22
|
static register(): void;
|
|
25
23
|
private get isStringType();
|
|
26
|
-
protected
|
|
24
|
+
protected get __validators(): import("../common/validators.js").Validator<IgcInputComponent>[];
|
|
27
25
|
protected _value: string;
|
|
28
26
|
/**
|
|
29
27
|
* The value of the control.
|
|
@@ -36,14 +34,6 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
36
34
|
* @attr
|
|
37
35
|
*/
|
|
38
36
|
type: 'email' | 'number' | 'password' | 'search' | 'tel' | 'text' | 'url';
|
|
39
|
-
/**
|
|
40
|
-
* The input mode attribute of the control.
|
|
41
|
-
* @prop
|
|
42
|
-
*
|
|
43
|
-
* @deprecated since v4.10.0. Use `inputMode` property instead.
|
|
44
|
-
*/
|
|
45
|
-
set inputmode(value: string);
|
|
46
|
-
get inputmode(): string;
|
|
47
37
|
/**
|
|
48
38
|
* The input mode attribute of the control.
|
|
49
39
|
* See [relevant MDN article](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode)
|
|
@@ -60,27 +50,11 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
60
50
|
* @attr minlength
|
|
61
51
|
*/
|
|
62
52
|
minLength: number;
|
|
63
|
-
/**
|
|
64
|
-
* The minlength attribute of the control.
|
|
65
|
-
* @prop
|
|
66
|
-
*
|
|
67
|
-
* @deprecated since v4.4.0. Use the `minLength` property instead.
|
|
68
|
-
*/
|
|
69
|
-
set minlength(value: number);
|
|
70
|
-
get minlength(): number;
|
|
71
53
|
/**
|
|
72
54
|
* The maximum string length of the control.
|
|
73
55
|
* @attr maxlength
|
|
74
56
|
*/
|
|
75
57
|
maxLength: number;
|
|
76
|
-
/**
|
|
77
|
-
* The maxlength attribute of the control.
|
|
78
|
-
* @prop
|
|
79
|
-
*
|
|
80
|
-
* @deprecated since v4.4.0. Use the `maxLength` property instead.
|
|
81
|
-
*/
|
|
82
|
-
set maxlength(value: number);
|
|
83
|
-
get maxlength(): number;
|
|
84
58
|
/**
|
|
85
59
|
* The min attribute of the control.
|
|
86
60
|
* @attr
|
|
@@ -121,7 +95,7 @@ export default class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
121
95
|
/** @hidden */
|
|
122
96
|
connectedCallback(): void;
|
|
123
97
|
/** Replaces the selected text in the input. */
|
|
124
|
-
setRangeText(replacement: string, start: number, end: number, selectMode?:
|
|
98
|
+
setRangeText(replacement: string, start: number, end: number, selectMode?: RangeTextSelectMode): void;
|
|
125
99
|
/** Selects all text within the input. */
|
|
126
100
|
select(): void;
|
|
127
101
|
/** Increments the numeric value of the input by one or more steps. */
|
|
@@ -11,59 +11,11 @@ import { live } from 'lit/directives/live.js';
|
|
|
11
11
|
import { watch } from '../common/decorators/watch.js';
|
|
12
12
|
import { registerComponent } from '../common/definitions/register.js';
|
|
13
13
|
import { partNameMap } from '../common/util.js';
|
|
14
|
-
import { emailValidator, maxLengthValidator, maxValidator, minLengthValidator, minValidator, patternValidator, requiredNumberValidator, requiredValidator, stepValidator, urlValidator, } from '../common/validators.js';
|
|
15
14
|
import { IgcInputBaseComponent } from './input-base.js';
|
|
15
|
+
import { numberValidators, stringValidators } from './validators.js';
|
|
16
16
|
class IgcInputComponent extends IgcInputBaseComponent {
|
|
17
17
|
constructor() {
|
|
18
18
|
super(...arguments);
|
|
19
|
-
this.validators = [
|
|
20
|
-
{
|
|
21
|
-
...requiredValidator,
|
|
22
|
-
isValid: () => this.isStringType
|
|
23
|
-
? requiredValidator.isValid(this)
|
|
24
|
-
: requiredNumberValidator.isValid(this),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
...minLengthValidator,
|
|
28
|
-
isValid: () => this.isStringType ? minLengthValidator.isValid(this) : true,
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
...maxLengthValidator,
|
|
32
|
-
isValid: () => this.isStringType ? maxLengthValidator.isValid(this) : true,
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
...minValidator,
|
|
36
|
-
isValid: () => (this.isStringType ? true : minValidator.isValid(this)),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
...maxValidator,
|
|
40
|
-
isValid: () => (this.isStringType ? true : maxValidator.isValid(this)),
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
...stepValidator,
|
|
44
|
-
isValid: () => (this.isStringType ? true : stepValidator.isValid(this)),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
...patternValidator,
|
|
48
|
-
isValid: () => this.isStringType ? patternValidator.isValid(this) : true,
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
key: 'typeMismatch',
|
|
52
|
-
isValid: () => {
|
|
53
|
-
switch (this.type) {
|
|
54
|
-
case 'email':
|
|
55
|
-
return emailValidator.isValid(this);
|
|
56
|
-
case 'url':
|
|
57
|
-
return urlValidator.isValid(this);
|
|
58
|
-
default:
|
|
59
|
-
return true;
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
message: () => (this.type === 'email'
|
|
63
|
-
? emailValidator.message
|
|
64
|
-
: urlValidator.message),
|
|
65
|
-
},
|
|
66
|
-
];
|
|
67
19
|
this._value = '';
|
|
68
20
|
this.type = 'text';
|
|
69
21
|
this.validateOnly = false;
|
|
@@ -75,6 +27,9 @@ class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
75
27
|
get isStringType() {
|
|
76
28
|
return this.type !== 'number';
|
|
77
29
|
}
|
|
30
|
+
get __validators() {
|
|
31
|
+
return this.isStringType ? stringValidators : numberValidators;
|
|
32
|
+
}
|
|
78
33
|
set value(value) {
|
|
79
34
|
this._value = value ?? '';
|
|
80
35
|
this.setFormValue(value ? value : null);
|
|
@@ -84,24 +39,6 @@ class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
84
39
|
get value() {
|
|
85
40
|
return this._value;
|
|
86
41
|
}
|
|
87
|
-
set inputmode(value) {
|
|
88
|
-
this.inputMode = value;
|
|
89
|
-
}
|
|
90
|
-
get inputmode() {
|
|
91
|
-
return this.inputMode;
|
|
92
|
-
}
|
|
93
|
-
set minlength(value) {
|
|
94
|
-
this.minLength = value;
|
|
95
|
-
}
|
|
96
|
-
get minlength() {
|
|
97
|
-
return this.minLength;
|
|
98
|
-
}
|
|
99
|
-
set maxlength(value) {
|
|
100
|
-
this.maxLength = value;
|
|
101
|
-
}
|
|
102
|
-
get maxlength() {
|
|
103
|
-
return this.maxLength;
|
|
104
|
-
}
|
|
105
42
|
constraintsChanged() {
|
|
106
43
|
this.updateValidity();
|
|
107
44
|
}
|
|
@@ -135,11 +72,9 @@ class IgcInputComponent extends IgcInputBaseComponent {
|
|
|
135
72
|
}
|
|
136
73
|
handleFocus() {
|
|
137
74
|
this._dirty = true;
|
|
138
|
-
super.handleFocus();
|
|
139
75
|
}
|
|
140
76
|
handleBlur() {
|
|
141
77
|
this.checkValidity();
|
|
142
|
-
super.handleBlur();
|
|
143
78
|
}
|
|
144
79
|
renderInput() {
|
|
145
80
|
return html `
|
|
@@ -180,9 +115,6 @@ __decorate([
|
|
|
180
115
|
__decorate([
|
|
181
116
|
property({ reflect: true })
|
|
182
117
|
], IgcInputComponent.prototype, "type", void 0);
|
|
183
|
-
__decorate([
|
|
184
|
-
property({ attribute: false })
|
|
185
|
-
], IgcInputComponent.prototype, "inputmode", null);
|
|
186
118
|
__decorate([
|
|
187
119
|
property({ attribute: 'inputmode' })
|
|
188
120
|
], IgcInputComponent.prototype, "inputMode", void 0);
|
|
@@ -192,15 +124,9 @@ __decorate([
|
|
|
192
124
|
__decorate([
|
|
193
125
|
property({ type: Number, attribute: 'minlength' })
|
|
194
126
|
], IgcInputComponent.prototype, "minLength", void 0);
|
|
195
|
-
__decorate([
|
|
196
|
-
property({ attribute: false })
|
|
197
|
-
], IgcInputComponent.prototype, "minlength", null);
|
|
198
127
|
__decorate([
|
|
199
128
|
property({ type: Number, attribute: 'maxlength' })
|
|
200
129
|
], IgcInputComponent.prototype, "maxLength", void 0);
|
|
201
|
-
__decorate([
|
|
202
|
-
property({ attribute: false })
|
|
203
|
-
], IgcInputComponent.prototype, "maxlength", null);
|
|
204
130
|
__decorate([
|
|
205
131
|
property()
|
|
206
132
|
], IgcInputComponent.prototype, "min", void 0);
|