igniteui-webcomponents 5.4.1 → 6.0.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 +74 -0
- package/README.md +6 -1
- package/components/avatar/themes/dark/avatar.bootstrap.css.js +1 -1
- package/components/avatar/themes/dark/avatar.bootstrap.css.js.map +1 -1
- package/components/avatar/themes/dark/avatar.fluent.css.js +1 -1
- package/components/avatar/themes/dark/avatar.fluent.css.js.map +1 -1
- package/components/avatar/themes/dark/avatar.material.css.js +1 -1
- package/components/avatar/themes/dark/avatar.material.css.js.map +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/dark/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js +1 -1
- package/components/calendar/themes/light/calendar.fluent.css.js.map +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js +1 -1
- package/components/calendar/themes/light/calendar.shared.css.js.map +1 -1
- package/components/checkbox/checkbox-base.d.ts +0 -2
- package/components/checkbox/checkbox-base.js.map +1 -1
- package/components/chip/chip.d.ts +4 -0
- package/components/chip/chip.js +26 -3
- package/components/chip/chip.js.map +1 -1
- package/components/chip/themes/shared/chip.common.css.js +1 -1
- package/components/chip/themes/shared/chip.common.css.js.map +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js +1 -1
- package/components/chip/themes/shared/chip.indigo.css.js.map +1 -1
- package/components/common/controllers/gestures.d.ts +1 -0
- package/components/common/controllers/gestures.js.map +1 -1
- package/components/common/controllers/resize-observer.d.ts +40 -0
- package/components/common/controllers/resize-observer.js +37 -0
- package/components/common/controllers/resize-observer.js.map +1 -0
- package/components/common/definitions/defineAllComponents.js +0 -2
- package/components/common/definitions/defineAllComponents.js.map +1 -1
- package/components/common/util.d.ts +1 -17
- package/components/common/util.js +10 -10
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +35 -35
- package/components/date-picker/date-picker.js +131 -128
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/dark/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.fluent.css.js.map +1 -1
- package/components/date-picker/themes/light/date-picker.shared.css.js +1 -1
- package/components/date-picker/themes/light/date-picker.shared.css.js.map +1 -1
- package/components/date-time-input/date-time-input.js +1 -1
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/file-input/file-input.d.ts +1 -1
- package/components/file-input/file-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/popover/popover.js +1 -1
- package/components/popover/popover.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/themes/circular/dark/circular.progress.shared.css.js +1 -1
- package/components/progress/themes/circular/dark/circular.progress.shared.css.js.map +1 -1
- package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js +1 -1
- package/components/progress/themes/linear/dark/linear.progress.bootstrap.css.js.map +1 -1
- package/components/progress/themes/linear/dark/linear.progress.shared.css.js +1 -1
- package/components/progress/themes/linear/dark/linear.progress.shared.css.js.map +1 -1
- package/components/radio/radio.d.ts +0 -2
- package/components/radio/radio.js.map +1 -1
- package/components/radio-group/radio-group.d.ts +2 -1
- package/components/radio-group/radio-group.js +23 -10
- package/components/radio-group/radio-group.js.map +1 -1
- package/components/radio-group/themes/dark/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/dark/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/dark/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.material.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/light/radio-group.shared.css.d.ts +1 -0
- package/components/radio-group/themes/light/radio-group.shared.css.js +3 -0
- package/components/radio-group/themes/light/radio-group.shared.css.js.map +1 -0
- package/components/radio-group/themes/radio-group.base.css.d.ts +1 -0
- package/components/radio-group/{radio-group.base.css.js → themes/radio-group.base.css.js} +1 -1
- package/components/radio-group/themes/radio-group.base.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.bootstrap.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.common.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.common.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.common.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.fluent.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.indigo.css.js.map +1 -0
- package/components/radio-group/themes/shared/radio-group.material.css.d.ts +1 -0
- package/components/radio-group/themes/shared/radio-group.material.css.js +3 -0
- package/components/radio-group/themes/shared/radio-group.material.css.js.map +1 -0
- package/components/radio-group/themes/themes.d.ts +2 -0
- package/components/radio-group/themes/themes.js +50 -0
- package/components/radio-group/themes/themes.js.map +1 -0
- package/components/slider/range-slider.d.ts +0 -2
- package/components/slider/range-slider.js.map +1 -1
- package/components/stepper/step.d.ts +1 -1
- package/components/stepper/step.js +3 -2
- package/components/stepper/step.js.map +1 -1
- package/components/stepper/stepper.common.d.ts +0 -4
- package/components/stepper/stepper.common.js.map +1 -1
- package/components/stepper/stepper.d.ts +2 -2
- package/components/stepper/stepper.js +2 -9
- package/components/stepper/stepper.js.map +1 -1
- package/components/stepper/themes/step/dark/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/dark/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.bootstrap.css.js +1 -1
- package/components/stepper/themes/step/light/step.bootstrap.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.fluent.css.js +1 -1
- package/components/stepper/themes/step/light/step.fluent.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.indigo.css.js +1 -1
- package/components/stepper/themes/step/light/step.indigo.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.material.css.js +1 -1
- package/components/stepper/themes/step/light/step.material.css.js.map +1 -1
- package/components/stepper/themes/step/light/step.shared.css.js +1 -1
- package/components/stepper/themes/step/light/step.shared.css.js.map +1 -1
- package/components/tabs/tab-dom.d.ts +66 -0
- package/components/tabs/tab-dom.js +106 -0
- package/components/tabs/tab-dom.js.map +1 -0
- package/components/tabs/tab.d.ts +14 -15
- package/components/tabs/tab.js +27 -22
- package/components/tabs/tab.js.map +1 -1
- package/components/tabs/tabs.d.ts +43 -49
- package/components/tabs/tabs.js +178 -231
- package/components/tabs/tabs.js.map +1 -1
- package/components/tabs/themes/dark/tab.indigo.css.js +1 -1
- package/components/tabs/themes/dark/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/light/tab.indigo.css.js +1 -1
- package/components/tabs/themes/light/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.bootstrap.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.common.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.common.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tab/tab.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tab/tab.material.css.d.ts +1 -0
- package/components/tabs/themes/shared/tab/tab.material.css.js +3 -0
- package/components/tabs/themes/shared/tab/tab.material.css.js.map +1 -0
- package/components/tabs/themes/shared/tabs/tabs.bootstrap.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.bootstrap.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.common.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.common.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.fluent.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js +1 -1
- package/components/tabs/themes/shared/tabs/tabs.indigo.css.js.map +1 -1
- package/components/tabs/themes/shared/tabs/tabs.material.css.d.ts +1 -0
- package/components/tabs/themes/shared/tabs/tabs.material.css.js +3 -0
- package/components/tabs/themes/shared/tabs/tabs.material.css.js.map +1 -0
- package/components/tabs/themes/tab-themes.js +7 -0
- package/components/tabs/themes/tab-themes.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-themes.js +3 -2
- package/components/tabs/themes/tabs-themes.js.map +1 -1
- package/components/tabs/themes/tabs.base.css.js +1 -1
- package/components/tabs/themes/tabs.base.css.js.map +1 -1
- package/components/tabs/themes/tabs.common.css.d.ts +1 -0
- package/components/tabs/themes/tabs.common.css.js +3 -0
- package/components/tabs/themes/tabs.common.css.js.map +1 -0
- package/components/textarea/textarea.d.ts +31 -34
- package/components/textarea/textarea.js +89 -91
- package/components/textarea/textarea.js.map +1 -1
- package/components/tooltip/tooltip.js.map +1 -1
- package/components/types.d.ts +2 -2
- package/components/types.js.map +1 -1
- package/components/validation-container/themes/dark/validator.indigo.css.js +1 -1
- package/components/validation-container/themes/dark/validator.indigo.css.js.map +1 -1
- package/custom-elements.json +873 -616
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +0 -5
- package/index.js +0 -1
- package/index.js.map +1 -1
- package/package.json +4 -3
- package/themes/dark/bootstrap.css +1 -1
- package/themes/dark/fluent.css +1 -1
- package/themes/dark/indigo.css +1 -1
- package/themes/dark/material.css +1 -1
- package/themes/light/bootstrap.css +1 -1
- package/themes/light/fluent.css +1 -1
- package/themes/light/indigo.css +1 -1
- package/themes/light/material.css +1 -1
- package/web-types.json +2 -2
- package/components/radio-group/radio-group.base.css.js.map +0 -1
- package/components/radio-group/radio-group.fluent.css.js +0 -3
- package/components/radio-group/radio-group.fluent.css.js.map +0 -1
- package/components/radio-group/radio-group.indigo.css.js +0 -3
- package/components/radio-group/radio-group.indigo.css.js.map +0 -1
- package/components/radio-group/radio-group.material.css.js +0 -3
- package/components/radio-group/radio-group.material.css.js.map +0 -1
- package/components/tabs/tab-panel.d.ts +0 -21
- package/components/tabs/tab-panel.js +0 -26
- package/components/tabs/tab-panel.js.map +0 -1
- package/components/tabs/themes/tab-panel.base.css.js +0 -3
- package/components/tabs/themes/tab-panel.base.css.js.map +0 -1
- /package/components/radio-group/{radio-group.base.css.d.ts → themes/dark/radio-group.bootstrap.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.fluent.css.d.ts → themes/dark/radio-group.fluent.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.indigo.css.d.ts → themes/dark/radio-group.indigo.css.d.ts} +0 -0
- /package/components/radio-group/{radio-group.material.css.d.ts → themes/dark/radio-group.material.css.d.ts} +0 -0
- /package/components/{tabs/themes/tab-panel.base.css.d.ts → radio-group/themes/light/radio-group.bootstrap.css.d.ts} +0 -0
|
@@ -22,7 +22,7 @@ import { IgcBaseComboBoxLikeComponent } from '../common/mixins/combo-box.js';
|
|
|
22
22
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
23
23
|
import { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';
|
|
24
24
|
import { createFormValueState, defaultDateTimeTransformers, } from '../common/mixins/forms/form-value.js';
|
|
25
|
-
import { createCounter, findElementFromEventPath } from '../common/util.js';
|
|
25
|
+
import { createCounter, findElementFromEventPath, isEmpty, } from '../common/util.js';
|
|
26
26
|
import IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';
|
|
27
27
|
import IgcDialogComponent from '../dialog/dialog.js';
|
|
28
28
|
import IgcFocusTrapComponent from '../focus-trap/focus-trap.js';
|
|
@@ -35,13 +35,13 @@ import { all } from './themes/themes.js';
|
|
|
35
35
|
import { datePickerValidators } from './validators.js';
|
|
36
36
|
const formats = new Set(['short', 'medium', 'long', 'full']);
|
|
37
37
|
let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerComponent extends FormAssociatedRequiredMixin(EventEmitterMixin(IgcBaseComboBoxLikeComponent)) {
|
|
38
|
-
get __validators() {
|
|
39
|
-
return datePickerValidators;
|
|
40
|
-
}
|
|
41
38
|
static register() {
|
|
42
39
|
registerComponent(IgcDatePickerComponent_1, IgcCalendarComponent, IgcDateTimeInputComponent, IgcFocusTrapComponent, IgcIconComponent, IgcPopoverComponent, IgcDialogComponent, IgcValidationContainerComponent);
|
|
43
40
|
}
|
|
44
|
-
get
|
|
41
|
+
get __validators() {
|
|
42
|
+
return datePickerValidators;
|
|
43
|
+
}
|
|
44
|
+
get _isDropDown() {
|
|
45
45
|
return this.mode === 'dropdown';
|
|
46
46
|
}
|
|
47
47
|
get _isMaterialTheme() {
|
|
@@ -62,7 +62,7 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
62
62
|
}
|
|
63
63
|
set min(value) {
|
|
64
64
|
this._min = convertToDate(value);
|
|
65
|
-
this.
|
|
65
|
+
this._setDateConstraints();
|
|
66
66
|
this._updateValidity();
|
|
67
67
|
}
|
|
68
68
|
get min() {
|
|
@@ -70,7 +70,7 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
70
70
|
}
|
|
71
71
|
set max(value) {
|
|
72
72
|
this._max = convertToDate(value);
|
|
73
|
-
this.
|
|
73
|
+
this._setDateConstraints();
|
|
74
74
|
this._updateValidity();
|
|
75
75
|
}
|
|
76
76
|
get max() {
|
|
@@ -78,7 +78,7 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
78
78
|
}
|
|
79
79
|
set disabledDates(dates) {
|
|
80
80
|
this._disabledDates = dates;
|
|
81
|
-
this.
|
|
81
|
+
this._setDateConstraints();
|
|
82
82
|
this._updateValidity();
|
|
83
83
|
}
|
|
84
84
|
get disabledDates() {
|
|
@@ -96,12 +96,12 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
96
96
|
get inputFormat() {
|
|
97
97
|
return this._inputFormat ?? this._input?.inputFormat;
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
_openChange() {
|
|
100
100
|
this._rootClickController.update();
|
|
101
101
|
}
|
|
102
102
|
constructor() {
|
|
103
103
|
super();
|
|
104
|
-
this.
|
|
104
|
+
this._inputId = `date-picker-${IgcDatePickerComponent_1._increment()}`;
|
|
105
105
|
this._activeDate = null;
|
|
106
106
|
this._min = null;
|
|
107
107
|
this._max = null;
|
|
@@ -124,59 +124,64 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
124
124
|
initialValue: null,
|
|
125
125
|
transformers: defaultDateTimeTransformers,
|
|
126
126
|
});
|
|
127
|
-
this.addEventListener('focusin', this.
|
|
128
|
-
this.addEventListener('focusout', this.
|
|
129
|
-
this._rootClickController.update({ hideCallback: this.
|
|
127
|
+
this.addEventListener('focusin', this._handleFocusIn);
|
|
128
|
+
this.addEventListener('focusout', this._handleFocusOut);
|
|
129
|
+
this._rootClickController.update({ hideCallback: this._handleClosing });
|
|
130
130
|
addKeybindings(this, {
|
|
131
|
-
skip: () => this.disabled,
|
|
131
|
+
skip: () => this.disabled || this.readOnly,
|
|
132
132
|
bindingDefaults: { preventDefault: true },
|
|
133
133
|
})
|
|
134
134
|
.set([altKey, arrowDown], this.handleAnchorClick)
|
|
135
|
-
.set([altKey, arrowUp], this.
|
|
136
|
-
.set(escapeKey, this.
|
|
135
|
+
.set([altKey, arrowUp], this._onEscapeKey)
|
|
136
|
+
.set(escapeKey, this._onEscapeKey);
|
|
137
137
|
}
|
|
138
138
|
createRenderRoot() {
|
|
139
139
|
const root = super.createRenderRoot();
|
|
140
140
|
root.addEventListener('slotchange', () => this.requestUpdate());
|
|
141
141
|
return root;
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
this.
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
this.
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
this.
|
|
143
|
+
_setDateConstraints() {
|
|
144
|
+
const dates = [];
|
|
145
|
+
if (this._min) {
|
|
146
|
+
dates.push({
|
|
147
|
+
type: DateRangeType.Before,
|
|
148
|
+
dateRange: [this._min],
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
if (this._max) {
|
|
152
|
+
dates.push({
|
|
153
|
+
type: DateRangeType.After,
|
|
154
|
+
dateRange: [this._max],
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
if (!isEmpty(this._disabledDates ?? [])) {
|
|
158
|
+
dates.push(...this.disabledDates);
|
|
159
|
+
}
|
|
160
|
+
this._dateConstraints = isEmpty(dates) ? undefined : dates;
|
|
158
161
|
}
|
|
159
|
-
|
|
160
|
-
this.
|
|
161
|
-
|
|
162
|
+
async _shouldCloseCalendarDropdown() {
|
|
163
|
+
if (!this.keepOpenOnSelect && (await this._hide(true))) {
|
|
164
|
+
this._input.focus();
|
|
165
|
+
this._input.select();
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
|
-
async
|
|
168
|
+
async _onEscapeKey() {
|
|
164
169
|
if (await this._hide(true)) {
|
|
165
170
|
this._input.focus();
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
|
-
|
|
173
|
+
_handleFocusIn() {
|
|
169
174
|
this._dirty = true;
|
|
170
175
|
}
|
|
171
|
-
|
|
176
|
+
_handleFocusOut({ relatedTarget }) {
|
|
172
177
|
if (!this.contains(relatedTarget)) {
|
|
173
178
|
this.checkValidity();
|
|
174
179
|
}
|
|
175
180
|
}
|
|
176
|
-
|
|
181
|
+
_handlerCalendarIconSlotPointerDown(event) {
|
|
177
182
|
event.preventDefault();
|
|
178
183
|
}
|
|
179
|
-
|
|
184
|
+
_handleInputClick(event) {
|
|
180
185
|
if (findElementFromEventPath('input', event)) {
|
|
181
186
|
this.handleAnchorClick();
|
|
182
187
|
}
|
|
@@ -187,18 +192,12 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
187
192
|
await this.updateComplete;
|
|
188
193
|
this._calendar[focusActiveDate]();
|
|
189
194
|
}
|
|
190
|
-
|
|
191
|
-
if (!this.keepOpenOnSelect && (await this._hide(true))) {
|
|
192
|
-
this._input.focus();
|
|
193
|
-
this._input.select();
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
handleInputChangeEvent(event) {
|
|
195
|
+
_handleInputChangeEvent(event) {
|
|
197
196
|
event.stopPropagation();
|
|
198
197
|
this.value = event.target.value;
|
|
199
198
|
this.emitEvent('igcChange', { detail: this.value });
|
|
200
199
|
}
|
|
201
|
-
async
|
|
200
|
+
async _handleCalendarChangeEvent(event) {
|
|
202
201
|
event.stopPropagation();
|
|
203
202
|
if (this.readOnly) {
|
|
204
203
|
await this._calendar.updateComplete;
|
|
@@ -209,7 +208,7 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
209
208
|
this.emitEvent('igcChange', { detail: this.value });
|
|
210
209
|
this._shouldCloseCalendarDropdown();
|
|
211
210
|
}
|
|
212
|
-
|
|
211
|
+
_handleInputEvent(event) {
|
|
213
212
|
event.stopPropagation();
|
|
214
213
|
if (this.nonEditable) {
|
|
215
214
|
event.preventDefault();
|
|
@@ -218,40 +217,45 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
218
217
|
this.value = event.target.value;
|
|
219
218
|
this.emitEvent('igcInput', { detail: this.value });
|
|
220
219
|
}
|
|
221
|
-
|
|
220
|
+
_handleClosing() {
|
|
222
221
|
this._hide(true);
|
|
223
222
|
}
|
|
224
|
-
|
|
223
|
+
_handleDialogClosing(event) {
|
|
225
224
|
event.stopPropagation();
|
|
226
225
|
this._hide(true);
|
|
227
226
|
}
|
|
228
|
-
|
|
227
|
+
_handleDialogClosed(event) {
|
|
229
228
|
event.stopPropagation();
|
|
230
229
|
}
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
if (this._max) {
|
|
240
|
-
dates.push({
|
|
241
|
-
type: DateRangeType.After,
|
|
242
|
-
dateRange: [this._max],
|
|
243
|
-
});
|
|
244
|
-
}
|
|
245
|
-
if (this._disabledDates?.length) {
|
|
246
|
-
dates.push(...this.disabledDates);
|
|
247
|
-
}
|
|
248
|
-
this._dateConstraints = dates.length ? dates : undefined;
|
|
230
|
+
clear() {
|
|
231
|
+
this.value = null;
|
|
232
|
+
this._input?.clear();
|
|
233
|
+
}
|
|
234
|
+
stepUp(datePart, delta) {
|
|
235
|
+
this._input.stepUp(datePart, delta);
|
|
249
236
|
}
|
|
250
|
-
|
|
237
|
+
stepDown(datePart, delta) {
|
|
238
|
+
this._input.stepDown(datePart, delta);
|
|
239
|
+
}
|
|
240
|
+
select() {
|
|
241
|
+
this._input.select();
|
|
242
|
+
}
|
|
243
|
+
setSelectionRange(start, end, direction) {
|
|
244
|
+
this._input.setSelectionRange(start, end, direction);
|
|
245
|
+
}
|
|
246
|
+
setRangeText(replacement, start, end, mode) {
|
|
247
|
+
this._input.setRangeText(replacement, start, end, mode);
|
|
248
|
+
this.value = this._input.value;
|
|
249
|
+
}
|
|
250
|
+
_renderClearIcon() {
|
|
251
251
|
return !this.value
|
|
252
252
|
? nothing
|
|
253
253
|
: html `
|
|
254
|
-
<span
|
|
254
|
+
<span
|
|
255
|
+
slot="suffix"
|
|
256
|
+
part="clear-icon"
|
|
257
|
+
@click=${this.readOnly ? nothing : this.clear}
|
|
258
|
+
>
|
|
255
259
|
<slot name="clear-icon">
|
|
256
260
|
<igc-icon
|
|
257
261
|
name="input_clear"
|
|
@@ -262,7 +266,7 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
262
266
|
</span>
|
|
263
267
|
`;
|
|
264
268
|
}
|
|
265
|
-
|
|
269
|
+
_renderCalendarIcon() {
|
|
266
270
|
const defaultIcon = html `
|
|
267
271
|
<igc-icon name="today" collection="default" aria-hidden="true"></igc-icon>
|
|
268
272
|
`;
|
|
@@ -271,18 +275,18 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
271
275
|
<span
|
|
272
276
|
slot="prefix"
|
|
273
277
|
part=${state}
|
|
274
|
-
@pointerdown=${this.
|
|
275
|
-
@click=${this.handleAnchorClick}
|
|
278
|
+
@pointerdown=${this._handlerCalendarIconSlotPointerDown}
|
|
279
|
+
@click=${this.readOnly ? nothing : this.handleAnchorClick}
|
|
276
280
|
>
|
|
277
281
|
<slot name=${state}>${defaultIcon}</slot>
|
|
278
282
|
</span>
|
|
279
283
|
`;
|
|
280
284
|
}
|
|
281
|
-
|
|
282
|
-
if (this.
|
|
285
|
+
_renderCalendarSlots() {
|
|
286
|
+
if (this._isDropDown) {
|
|
283
287
|
return nothing;
|
|
284
288
|
}
|
|
285
|
-
const hasHeaderDate = this.
|
|
289
|
+
const hasHeaderDate = isEmpty(this._headerSlotItems) ? '' : 'header-date';
|
|
286
290
|
return html `
|
|
287
291
|
<slot name="title" slot="title">
|
|
288
292
|
${this.resourceStrings.selectDate}
|
|
@@ -290,8 +294,8 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
290
294
|
<slot name="header-date" slot=${hasHeaderDate}></slot>
|
|
291
295
|
`;
|
|
292
296
|
}
|
|
293
|
-
|
|
294
|
-
const hideHeader = this.
|
|
297
|
+
_renderCalendar(id) {
|
|
298
|
+
const hideHeader = this._isDropDown ? true : this.hideHeader;
|
|
295
299
|
return html `
|
|
296
300
|
<igc-calendar
|
|
297
301
|
aria-labelledby=${id}
|
|
@@ -309,35 +313,32 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
309
313
|
.disabledDates=${this._dateConstraints}
|
|
310
314
|
.specialDates=${this.specialDates}
|
|
311
315
|
.weekStart=${this.weekStart}
|
|
312
|
-
@igcChange=${this.
|
|
316
|
+
@igcChange=${this._handleCalendarChangeEvent}
|
|
313
317
|
exportparts="header, header-title, header-date, content: calendar-content, navigation, months-navigation,
|
|
314
318
|
years-navigation, years-range, navigation-buttons, navigation-button, days-view-container,
|
|
315
319
|
days-view, months-view, years-view, days-row, label: calendar-label, week-number, week-number-inner, date,
|
|
316
320
|
date-inner, first, last, inactive, hidden, weekend, range, special, disabled, single, preview,
|
|
317
321
|
month, month-inner, year, year-inner, selected, current"
|
|
318
322
|
>
|
|
319
|
-
${this.
|
|
323
|
+
${this._renderCalendarSlots()}
|
|
320
324
|
</igc-calendar>
|
|
321
325
|
`;
|
|
322
326
|
}
|
|
323
|
-
|
|
324
|
-
const
|
|
327
|
+
_renderActions() {
|
|
328
|
+
const hasActions = !isEmpty(this._actions);
|
|
329
|
+
const slot = this._isDropDown || hasActions ? undefined : 'footer';
|
|
325
330
|
return html `
|
|
326
|
-
<div
|
|
327
|
-
part="actions"
|
|
328
|
-
?hidden=${!this.actions.length}
|
|
329
|
-
slot=${ifDefined(slot)}
|
|
330
|
-
>
|
|
331
|
+
<div part="actions" ?hidden=${!hasActions} slot=${ifDefined(slot)}>
|
|
331
332
|
<slot name="actions"></slot>
|
|
332
333
|
</div>
|
|
333
334
|
`;
|
|
334
335
|
}
|
|
335
|
-
|
|
336
|
-
return this.
|
|
336
|
+
_renderPicker(id) {
|
|
337
|
+
return this._isDropDown
|
|
337
338
|
? html `
|
|
338
339
|
<igc-popover ?open=${this.open} anchor=${id} flip shift>
|
|
339
340
|
<igc-focus-trap ?disabled=${!this.open || this.disabled}>
|
|
340
|
-
${this.
|
|
341
|
+
${this._renderCalendar(id)}${this._renderActions()}
|
|
341
342
|
</igc-focus-trap>
|
|
342
343
|
</igc-popover>
|
|
343
344
|
`
|
|
@@ -348,32 +349,38 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
348
349
|
?open=${this.open}
|
|
349
350
|
?close-on-outside-click=${!this.keepOpenOnOutsideClick}
|
|
350
351
|
hide-default-action
|
|
351
|
-
@igcClosing=${this.
|
|
352
|
-
@igcClosed=${this.
|
|
352
|
+
@igcClosing=${this._handleDialogClosing}
|
|
353
|
+
@igcClosed=${this._handleDialogClosed}
|
|
353
354
|
exportparts="base: dialog-base, title, footer, overlay"
|
|
354
355
|
>
|
|
355
|
-
${this.
|
|
356
|
+
${this._renderCalendar(id)}${this._renderActions()}
|
|
356
357
|
</igc-dialog>
|
|
357
358
|
`;
|
|
358
359
|
}
|
|
359
|
-
|
|
360
|
+
_renderLabel(id) {
|
|
361
|
+
const isDisabled = this._isDropDown || this.readOnly;
|
|
360
362
|
return this.label
|
|
361
|
-
? html
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
363
|
+
? html `
|
|
364
|
+
<label
|
|
365
|
+
part="label"
|
|
366
|
+
for=${id}
|
|
367
|
+
@click=${isDisabled ? nothing : this.handleAnchorClick}
|
|
368
|
+
>
|
|
369
|
+
${this.label}
|
|
370
|
+
</label>
|
|
371
|
+
`
|
|
367
372
|
: nothing;
|
|
368
373
|
}
|
|
369
|
-
|
|
374
|
+
_renderHelperText() {
|
|
370
375
|
return IgcValidationContainerComponent.create(this);
|
|
371
376
|
}
|
|
372
|
-
|
|
377
|
+
_renderInput(id) {
|
|
373
378
|
const format = formats.has(this._displayFormat)
|
|
374
379
|
? `${this._displayFormat}Date`
|
|
375
380
|
: this._displayFormat;
|
|
376
|
-
const readOnly = !this.
|
|
381
|
+
const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;
|
|
382
|
+
const prefix = isEmpty(this._prefixes) ? undefined : 'prefix';
|
|
383
|
+
const suffix = isEmpty(this._suffixes) ? undefined : 'suffix';
|
|
377
384
|
return html `
|
|
378
385
|
<igc-date-time-input
|
|
379
386
|
id=${id}
|
|
@@ -392,29 +399,25 @@ let IgcDatePickerComponent = IgcDatePickerComponent_1 = class IgcDatePickerCompo
|
|
|
392
399
|
.min=${this.min}
|
|
393
400
|
.max=${this.max}
|
|
394
401
|
.invalid=${live(this.invalid)}
|
|
395
|
-
@igcChange=${this.
|
|
396
|
-
@igcInput=${this.
|
|
397
|
-
@click=${this.
|
|
402
|
+
@igcChange=${this._handleInputChangeEvent}
|
|
403
|
+
@igcInput=${this._handleInputEvent}
|
|
404
|
+
@click=${this._isDropDown || this.readOnly
|
|
405
|
+
? nothing
|
|
406
|
+
: this._handleInputClick}
|
|
398
407
|
exportparts="input, label, prefix, suffix"
|
|
399
408
|
>
|
|
400
|
-
${this.
|
|
401
|
-
<slot
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
></slot>
|
|
405
|
-
${this.renderClearIcon()}
|
|
406
|
-
<slot
|
|
407
|
-
name="suffix"
|
|
408
|
-
slot=${ifDefined(!this.suffixes.length ? undefined : 'suffix')}
|
|
409
|
-
></slot>
|
|
409
|
+
${this._renderCalendarIcon()}
|
|
410
|
+
<slot name="prefix" slot=${ifDefined(prefix)}></slot>
|
|
411
|
+
${this._renderClearIcon()}
|
|
412
|
+
<slot name="suffix" slot=${ifDefined(suffix)}></slot>
|
|
410
413
|
</igc-date-time-input>
|
|
411
414
|
`;
|
|
412
415
|
}
|
|
413
416
|
render() {
|
|
414
|
-
const id = this.id || this.
|
|
417
|
+
const id = this.id || this._inputId;
|
|
415
418
|
return html `
|
|
416
|
-
${!this._isMaterialTheme ? this.
|
|
417
|
-
${this.
|
|
419
|
+
${!this._isMaterialTheme ? this._renderLabel(id) : nothing}
|
|
420
|
+
${this._renderInput(id)}${this._renderPicker(id)}${this._renderHelperText()}
|
|
418
421
|
`;
|
|
419
422
|
}
|
|
420
423
|
};
|
|
@@ -424,7 +427,7 @@ IgcDatePickerComponent.shadowRootOptions = {
|
|
|
424
427
|
...LitElement.shadowRootOptions,
|
|
425
428
|
delegatesFocus: true,
|
|
426
429
|
};
|
|
427
|
-
IgcDatePickerComponent.
|
|
430
|
+
IgcDatePickerComponent._increment = createCounter();
|
|
428
431
|
__decorate([
|
|
429
432
|
query(IgcDateTimeInputComponent.tagName)
|
|
430
433
|
], IgcDatePickerComponent.prototype, "_input", void 0);
|
|
@@ -433,16 +436,16 @@ __decorate([
|
|
|
433
436
|
], IgcDatePickerComponent.prototype, "_calendar", void 0);
|
|
434
437
|
__decorate([
|
|
435
438
|
queryAssignedElements({ slot: 'prefix' })
|
|
436
|
-
], IgcDatePickerComponent.prototype, "
|
|
439
|
+
], IgcDatePickerComponent.prototype, "_prefixes", void 0);
|
|
437
440
|
__decorate([
|
|
438
441
|
queryAssignedElements({ slot: 'suffix' })
|
|
439
|
-
], IgcDatePickerComponent.prototype, "
|
|
442
|
+
], IgcDatePickerComponent.prototype, "_suffixes", void 0);
|
|
440
443
|
__decorate([
|
|
441
444
|
queryAssignedElements({ slot: 'actions' })
|
|
442
|
-
], IgcDatePickerComponent.prototype, "
|
|
445
|
+
], IgcDatePickerComponent.prototype, "_actions", void 0);
|
|
443
446
|
__decorate([
|
|
444
447
|
queryAssignedElements({ slot: 'header-date' })
|
|
445
|
-
], IgcDatePickerComponent.prototype, "
|
|
448
|
+
], IgcDatePickerComponent.prototype, "_headerSlotItems", void 0);
|
|
446
449
|
__decorate([
|
|
447
450
|
property({ type: Boolean, reflect: true })
|
|
448
451
|
], IgcDatePickerComponent.prototype, "open", void 0);
|
|
@@ -515,12 +518,12 @@ __decorate([
|
|
|
515
518
|
__decorate([
|
|
516
519
|
property({ attribute: false })
|
|
517
520
|
], IgcDatePickerComponent.prototype, "resourceStrings", void 0);
|
|
518
|
-
__decorate([
|
|
519
|
-
watch('open')
|
|
520
|
-
], IgcDatePickerComponent.prototype, "openChange", null);
|
|
521
521
|
__decorate([
|
|
522
522
|
property({ attribute: 'week-start' })
|
|
523
523
|
], IgcDatePickerComponent.prototype, "weekStart", void 0);
|
|
524
|
+
__decorate([
|
|
525
|
+
watch('open')
|
|
526
|
+
], IgcDatePickerComponent.prototype, "_openChange", null);
|
|
524
527
|
IgcDatePickerComponent = IgcDatePickerComponent_1 = __decorate([
|
|
525
528
|
themes(all, { exposeController: true }),
|
|
526
529
|
blazorAdditionalDependencies('IgcCalendarComponent, IgcDateTimeInputComponent, IgcDialogComponent, IgcIconComponent')
|