igniteui-webcomponents 7.1.3 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +41 -0
- package/components/banner/banner.d.ts +53 -17
- package/components/banner/banner.js +5 -0
- package/components/banner/banner.js.map +1 -1
- package/components/button/button-base.d.ts +80 -26
- package/components/button/button-base.js +64 -23
- package/components/button/button-base.js.map +1 -1
- package/components/button/button.d.ts +12 -3
- package/components/button/button.js +1 -1
- package/components/button/button.js.map +1 -1
- package/components/button/icon-button.d.ts +25 -9
- package/components/button/icon-button.js +2 -2
- package/components/button/icon-button.js.map +1 -1
- package/components/button-group/themes/shared/button/button.common.css.js +1 -1
- package/components/button-group/themes/shared/button/button.common.css.js.map +1 -1
- package/components/button-group/themes/shared/button/button.indigo.css.js +1 -1
- package/components/button-group/themes/shared/button/button.indigo.css.js.map +1 -1
- package/components/calendar/base.d.ts +5 -4
- package/components/calendar/base.js +3 -2
- package/components/calendar/base.js.map +1 -1
- package/components/calendar/calendar.js +17 -13
- package/components/calendar/calendar.js.map +1 -1
- package/components/calendar/days-view/days-view.d.ts +1 -0
- package/components/calendar/days-view/days-view.js +7 -4
- package/components/calendar/days-view/days-view.js.map +1 -1
- package/components/calendar/helpers.d.ts +1 -1
- package/components/calendar/helpers.js.map +1 -1
- package/components/chat/chat-message.js +8 -8
- package/components/chat/chat-message.js.map +1 -1
- package/components/chat/chat-state.d.ts +3 -1
- package/components/chat/chat-state.js +3 -2
- package/components/chat/chat-state.js.map +1 -1
- package/components/chat/chat.d.ts +5 -1
- package/components/chat/chat.js +14 -4
- package/components/chat/chat.js.map +1 -1
- package/components/checkbox/checkbox.js +1 -0
- package/components/checkbox/checkbox.js.map +1 -1
- package/components/checkbox/switch.js +1 -0
- package/components/checkbox/switch.js.map +1 -1
- package/components/combo/combo.d.ts +1 -0
- package/components/combo/combo.js +7 -0
- package/components/combo/combo.js.map +1 -1
- package/components/combo/controllers/navigation.js +3 -0
- package/components/combo/controllers/navigation.js.map +1 -1
- package/components/common/controllers/command.d.ts +62 -0
- package/components/common/controllers/command.js +25 -0
- package/components/common/controllers/command.js.map +1 -0
- package/components/common/controllers/id-resolver.d.ts +31 -0
- package/components/common/controllers/id-resolver.js +136 -0
- package/components/common/controllers/id-resolver.js.map +1 -0
- package/components/common/i18n/EN/calendar.resources.d.ts +16 -14
- package/components/common/i18n/EN/calendar.resources.js +1 -1
- package/components/common/i18n/EN/calendar.resources.js.map +1 -1
- package/components/common/i18n/EN/chat.resources.d.ts +10 -8
- package/components/common/i18n/EN/chat.resources.js.map +1 -1
- package/components/common/i18n/EN/date-picker.resources.d.ts +8 -0
- package/components/common/i18n/EN/date-picker.resources.js +8 -0
- package/components/common/i18n/EN/date-picker.resources.js.map +1 -0
- package/components/common/i18n/EN/date-range-picker.resources.d.ts +9 -7
- package/components/common/i18n/EN/date-range-picker.resources.js +1 -1
- package/components/common/i18n/EN/date-range-picker.resources.js.map +1 -1
- package/components/common/i18n/i18n-controller.d.ts +14 -11
- package/components/common/i18n/i18n-controller.js +33 -41
- package/components/common/i18n/i18n-controller.js.map +1 -1
- package/components/common/i18n/utils.d.ts +8 -2
- package/components/common/i18n/utils.js +52 -44
- package/components/common/i18n/utils.js.map +1 -1
- package/components/common/mixins/alert.d.ts +47 -9
- package/components/common/mixins/alert.js +55 -12
- package/components/common/mixins/alert.js.map +1 -1
- package/components/common/mixins/forms/associated.js +11 -0
- package/components/common/mixins/forms/associated.js.map +1 -1
- package/components/common/mixins/forms/form-transformers.d.ts +1 -1
- package/components/common/mixins/forms/form-transformers.js.map +1 -1
- package/components/common/mixins/forms/types.d.ts +5 -0
- package/components/common/mixins/forms/types.js.map +1 -1
- package/components/common/mixins/mask-behavior.d.ts +73 -0
- package/components/common/mixins/mask-behavior.js +159 -0
- package/components/common/mixins/mask-behavior.js.map +1 -0
- package/components/common/templates/input-shell.d.ts +24 -0
- package/components/common/templates/input-shell.js +43 -0
- package/components/common/templates/input-shell.js.map +1 -0
- package/components/common/templates/masked-input.d.ts +39 -0
- package/components/common/templates/masked-input.js +37 -0
- package/components/common/templates/masked-input.js.map +1 -0
- package/components/common/util.d.ts +11 -0
- package/components/common/util.js +20 -0
- package/components/common/util.js.map +1 -1
- package/components/date-picker/date-picker.d.ts +6 -4
- package/components/date-picker/date-picker.js +16 -5
- package/components/date-picker/date-picker.js.map +1 -1
- package/components/date-range-picker/date-range-input.d.ts +60 -0
- package/components/date-range-picker/date-range-input.js +251 -0
- package/components/date-range-picker/date-range-input.js.map +1 -0
- package/components/date-range-picker/date-range-mask-parser.d.ts +106 -0
- package/components/date-range-picker/date-range-mask-parser.js +121 -0
- package/components/date-range-picker/date-range-mask-parser.js.map +1 -0
- package/components/date-range-picker/date-range-picker.d.ts +17 -11
- package/components/date-range-picker/date-range-picker.js +89 -61
- package/components/date-range-picker/date-range-picker.js.map +1 -1
- package/components/date-range-picker/predefined-ranges-area.d.ts +4 -4
- package/components/date-range-picker/predefined-ranges-area.js +8 -4
- package/components/date-range-picker/predefined-ranges-area.js.map +1 -1
- package/components/date-range-picker/validators.d.ts +5 -19
- package/components/date-range-picker/validators.js +20 -16
- package/components/date-range-picker/validators.js.map +1 -1
- package/components/date-time-input/date-time-input.base.d.ts +155 -0
- package/components/date-time-input/date-time-input.base.js +275 -0
- package/components/date-time-input/date-time-input.base.js.map +1 -0
- package/components/date-time-input/date-time-input.d.ts +33 -122
- package/components/date-time-input/date-time-input.js +45 -258
- package/components/date-time-input/date-time-input.js.map +1 -1
- package/components/date-time-input/datetime-mask-parser.d.ts +11 -1
- package/components/date-time-input/datetime-mask-parser.js +5 -5
- package/components/date-time-input/datetime-mask-parser.js.map +1 -1
- package/components/dialog/dialog.d.ts +88 -31
- package/components/dialog/dialog.js +29 -31
- package/components/dialog/dialog.js.map +1 -1
- package/components/file-input/file-input.d.ts +1 -1
- package/components/input/input-base.d.ts +2 -10
- package/components/input/input-base.js +11 -57
- package/components/input/input-base.js.map +1 -1
- package/components/input/input.d.ts +1 -1
- package/components/input/input.js +1 -0
- package/components/input/input.js.map +1 -1
- package/components/input/themes/dark/input.shared.css.d.ts +1 -0
- package/components/input/themes/dark/input.shared.css.js +3 -0
- package/components/input/themes/dark/input.shared.css.js.map +1 -0
- package/components/input/themes/light/input.shared.css.js +1 -1
- package/components/input/themes/light/input.shared.css.js.map +1 -1
- package/components/input/themes/shared/input.common.css.js +1 -1
- package/components/input/themes/shared/input.common.css.js.map +1 -1
- package/components/input/themes/shared/input.material.css.js +1 -1
- package/components/input/themes/shared/input.material.css.js.map +1 -1
- package/components/input/themes/themes.js +4 -3
- package/components/input/themes/themes.js.map +1 -1
- package/components/mask-input/mask-input.d.ts +9 -4
- package/components/mask-input/mask-input.js +30 -36
- package/components/mask-input/mask-input.js.map +1 -1
- package/components/nav-drawer/nav-drawer.d.ts +93 -17
- package/components/nav-drawer/nav-drawer.js +148 -21
- 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/shared/container/nav-drawer.common.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.common.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.fluent.css.js.map +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js +1 -1
- package/components/nav-drawer/themes/shared/container/nav-drawer.indigo.css.js.map +1 -1
- package/components/radio/radio.js +1 -0
- package/components/radio/radio.js.map +1 -1
- package/components/snackbar/snackbar.d.ts +9 -5
- package/components/snackbar/snackbar.js +6 -8
- 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/step.d.ts +1 -1
- package/components/stepper/step.js +4 -4
- package/components/stepper/step.js.map +1 -1
- package/components/toast/themes/toast.base.css.js +1 -1
- package/components/toast/themes/toast.base.css.js.map +1 -1
- package/components/toast/toast.d.ts +9 -2
- package/components/toast/toast.js +0 -2
- package/components/toast/toast.js.map +1 -1
- package/components/types.d.ts +4 -0
- package/components/types.js.map +1 -1
- package/custom-elements.json +34882 -28909
- package/igniteui-webcomponents.css-data.json +1 -1
- package/igniteui-webcomponents.html-data.json +1 -1
- package/index.d.ts +5 -2
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/package.json +3 -3
- package/skills/igniteui-wc-choose-components/SKILL.md +3 -6
- package/skills/igniteui-wc-generate-from-image-design/references/component-mapping.md +4 -2
- package/web-types.json +2 -2
- package/components/mask-input/mask-input-base.d.ts +0 -51
- package/components/mask-input/mask-input-base.js +0 -146
- package/components/mask-input/mask-input-base.js.map +0 -1
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import { type ICalendarResourceStrings, type IDateRangePickerResourceStrings } from 'igniteui-i18n-core';
|
|
1
2
|
import { nothing, type TemplateResult } from 'lit';
|
|
2
3
|
import type { DateRangeDescriptor, WeekDays } from '../calendar/types.js';
|
|
3
|
-
import {
|
|
4
|
+
import type { IgcDateRangePickerResourceStrings } from '../common/i18n/EN/date-range-picker.resources.js';
|
|
4
5
|
import { IgcComboBoxBaseLikeComponent } from '../common/mixins/combo-box.js';
|
|
5
6
|
import type { AbstractConstructor } from '../common/mixins/constructor.js';
|
|
6
7
|
import type { ContentOrientation, PickerMode } from '../types.js';
|
|
8
|
+
import { DateRangePosition } from './date-range-mask-parser.js';
|
|
7
9
|
export interface DateRangeValue {
|
|
8
10
|
start: Date | null;
|
|
9
11
|
end: Date | null;
|
|
@@ -20,6 +22,7 @@ export interface IgcDateRangePickerComponentEventMap {
|
|
|
20
22
|
igcChange: CustomEvent<DateRangeValue | null>;
|
|
21
23
|
igcInput: CustomEvent<DateRangeValue | null>;
|
|
22
24
|
}
|
|
25
|
+
export type DateRangePickerResourceStringsType = IDateRangePickerResourceStrings & ICalendarResourceStrings;
|
|
23
26
|
declare const IgcDateRangePickerComponent_base: import("../common/mixins/constructor.js").Constructor<import("../common/mixins/forms/types.js").FormRequiredInterface & import("../common/mixins/forms/types.js").FormAssociatedElementInterface> & import("../common/mixins/constructor.js").Constructor<import("../common/mixins/event-emitter.js").EventEmitterInterface<IgcDateRangePickerComponentEventMap>> & AbstractConstructor<IgcComboBoxBaseLikeComponent>;
|
|
24
27
|
/**
|
|
25
28
|
* The igc-date-range-picker allows the user to select a range of dates.
|
|
@@ -121,13 +124,13 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
121
124
|
static register(): void;
|
|
122
125
|
protected readonly _inputId: string;
|
|
123
126
|
private readonly _themes;
|
|
124
|
-
protected readonly _formValue: import("../common/mixins/forms/form-value.js").FormValue<DateRangeValue | null>;
|
|
127
|
+
protected readonly _formValue: import("../common/mixins/forms/form-value.js").FormValue<import("../types.js").DateRangeValue | null>;
|
|
125
128
|
protected readonly _rootClickController: import("../common/controllers/root-click.js").RootClickController;
|
|
126
129
|
/**
|
|
127
130
|
* For now we use the core validation strings internally only, to avoid mixing with old resources by users.
|
|
128
131
|
* To Do: Update resourceStrings type when the IgcDateRangePickerResourceStrings is changed to IDateRangePickerResourceStrings
|
|
129
132
|
*/
|
|
130
|
-
protected readonly _i18nController: import("../common/i18n/i18n-controller.js").I18nController<IgcDateRangePickerResourceStrings>;
|
|
133
|
+
protected readonly _i18nController: import("../common/i18n/i18n-controller.js").I18nController<IgcDateRangePickerResourceStrings | DateRangePickerResourceStringsType>;
|
|
131
134
|
private _activeDate;
|
|
132
135
|
private _min;
|
|
133
136
|
private _max;
|
|
@@ -143,7 +146,6 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
143
146
|
protected get __validators(): import("../common/validators.js").Validator<IgcDateRangePickerComponent>[];
|
|
144
147
|
private get _isDropDown();
|
|
145
148
|
private get _firstDefinedInRange();
|
|
146
|
-
private _maskedRangeValue;
|
|
147
149
|
private readonly _inputs;
|
|
148
150
|
private readonly _input;
|
|
149
151
|
private readonly _calendar;
|
|
@@ -187,8 +189,8 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
187
189
|
set locale(value: string);
|
|
188
190
|
get locale(): string;
|
|
189
191
|
/** The resource strings of the date range picker. */
|
|
190
|
-
set resourceStrings(value: IgcDateRangePickerResourceStrings);
|
|
191
|
-
get resourceStrings(): IgcDateRangePickerResourceStrings;
|
|
192
|
+
set resourceStrings(value: IgcDateRangePickerResourceStrings | DateRangePickerResourceStringsType);
|
|
193
|
+
get resourceStrings(): IgcDateRangePickerResourceStrings & DateRangePickerResourceStringsType;
|
|
192
194
|
/**
|
|
193
195
|
* Makes the control a readonly field.
|
|
194
196
|
* @attr readonly
|
|
@@ -313,6 +315,10 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
313
315
|
protected createRenderRoot(): HTMLElement | DocumentFragment;
|
|
314
316
|
protected firstUpdated(): void;
|
|
315
317
|
protected formResetCallback(): void;
|
|
318
|
+
/** @internal */
|
|
319
|
+
hasDateParts(): boolean;
|
|
320
|
+
/** @internal */
|
|
321
|
+
hasTimeParts(): boolean;
|
|
316
322
|
/** Clears the input parts of the component of any user input */
|
|
317
323
|
clear(): void;
|
|
318
324
|
/** Selects a date range value in the picker */
|
|
@@ -326,8 +332,10 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
326
332
|
protected _handleDialogClosed(event: Event): void;
|
|
327
333
|
protected _dialogCancel(): void;
|
|
328
334
|
protected _dialogDone(): void;
|
|
329
|
-
protected
|
|
330
|
-
protected
|
|
335
|
+
protected _handleInput(event: CustomEvent<string>): void;
|
|
336
|
+
protected _handleInputChange(event: CustomEvent<Date | null>): void;
|
|
337
|
+
protected _handleDateRangeInput(event: CustomEvent<string>): Promise<void>;
|
|
338
|
+
protected _handleDateRangeInputChange(event: CustomEvent<DateRangeValue | null>): void;
|
|
331
339
|
protected _handleFocusOut({ relatedTarget }: FocusEvent): void;
|
|
332
340
|
protected _handleInputClick(event: Event): void;
|
|
333
341
|
protected _onEscapeKey(): Promise<void>;
|
|
@@ -343,7 +351,6 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
343
351
|
private _getUpdatedDateRange;
|
|
344
352
|
private _delegateInputsValidity;
|
|
345
353
|
private _setDateConstraints;
|
|
346
|
-
private _updateMaskedRangeValue;
|
|
347
354
|
private _setCalendarRangeValues;
|
|
348
355
|
private _swapDates;
|
|
349
356
|
private _shouldCloseCalendarDropdown;
|
|
@@ -356,7 +363,7 @@ export default class IgcDateRangePickerComponent extends IgcDateRangePickerCompo
|
|
|
356
363
|
protected _renderPredefinedRanges(): typeof nothing | TemplateResult<1>;
|
|
357
364
|
protected _renderPicker(id: string): TemplateResult<1>;
|
|
358
365
|
private _renderHelperText;
|
|
359
|
-
protected _renderInput(id: string, picker?:
|
|
366
|
+
protected _renderInput(id: string, picker?: DateRangePosition): TemplateResult<1>;
|
|
360
367
|
private _renderInputs;
|
|
361
368
|
private _renderSingleInput;
|
|
362
369
|
protected render(): TemplateResult<1>;
|
|
@@ -366,5 +373,4 @@ declare global {
|
|
|
366
373
|
'igc-date-range-picker': IgcDateRangePickerComponent;
|
|
367
374
|
}
|
|
368
375
|
}
|
|
369
|
-
type DateRangePickerInput = 'start' | 'end';
|
|
370
376
|
export {};
|
|
@@ -5,9 +5,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
5
5
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
6
|
};
|
|
7
7
|
var IgcDateRangePickerComponent_1;
|
|
8
|
-
import { getDateFormatter } from 'igniteui-i18n-core';
|
|
8
|
+
import { CalendarResourceStringsEN, DateRangePickerResourceStringsEN, getDateFormatter, } from 'igniteui-i18n-core';
|
|
9
9
|
import { html, nothing } from 'lit';
|
|
10
|
-
import { property, query, queryAll, queryAssignedElements,
|
|
10
|
+
import { property, query, queryAll, queryAssignedElements, } from 'lit/decorators.js';
|
|
11
11
|
import { cache } from 'lit/directives/cache.js';
|
|
12
12
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
13
13
|
import { live } from 'lit/directives/live.js';
|
|
@@ -21,8 +21,7 @@ import { blazorAdditionalDependencies } from '../common/decorators/blazorAdditio
|
|
|
21
21
|
import { shadowOptions } from '../common/decorators/shadow-options.js';
|
|
22
22
|
import { watch } from '../common/decorators/watch.js';
|
|
23
23
|
import { registerComponent } from '../common/definitions/register.js';
|
|
24
|
-
import {
|
|
25
|
-
import { addI18nController, formatDisplayDate, getDateTimeFormat, getDefaultDateTimeFormat, } from '../common/i18n/i18n-controller.js';
|
|
24
|
+
import { addI18nController, getDateTimeFormat, getDefaultDateTimeFormat, } from '../common/i18n/i18n-controller.js';
|
|
26
25
|
import { IgcComboBoxBaseLikeComponent } from '../common/mixins/combo-box.js';
|
|
27
26
|
import { EventEmitterMixin } from '../common/mixins/event-emitter.js';
|
|
28
27
|
import { FormAssociatedRequiredMixin } from '../common/mixins/forms/associated-required.js';
|
|
@@ -33,9 +32,10 @@ import IgcDateTimeInputComponent from '../date-time-input/date-time-input.js';
|
|
|
33
32
|
import IgcDialogComponent from '../dialog/dialog.js';
|
|
34
33
|
import IgcFocusTrapComponent from '../focus-trap/focus-trap.js';
|
|
35
34
|
import IgcIconComponent from '../icon/icon.js';
|
|
36
|
-
import IgcInputComponent from '../input/input.js';
|
|
37
35
|
import IgcPopoverComponent from '../popover/popover.js';
|
|
38
36
|
import IgcValidationContainerComponent from '../validation-container/validation-container.js';
|
|
37
|
+
import IgcDateRangeInputComponent from './date-range-input.js';
|
|
38
|
+
import { DateRangePosition } from './date-range-mask-parser.js';
|
|
39
39
|
import { styles } from './date-range-picker.base.css.js';
|
|
40
40
|
import IgcPredefinedRangesAreaComponent from './predefined-ranges-area.js';
|
|
41
41
|
import { styles as shared } from './themes/shared/date-range-picker.common.css.js';
|
|
@@ -47,7 +47,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
47
47
|
static { this.tagName = 'igc-date-range-picker'; }
|
|
48
48
|
static { this.styles = [styles, shared]; }
|
|
49
49
|
static register() {
|
|
50
|
-
registerComponent(IgcDateRangePickerComponent_1, IgcCalendarComponent, IgcDateTimeInputComponent,
|
|
50
|
+
registerComponent(IgcDateRangePickerComponent_1, IgcDateRangeInputComponent, IgcCalendarComponent, IgcDateTimeInputComponent, IgcFocusTrapComponent, IgcIconComponent, IgcPopoverComponent, IgcDialogComponent, IgcValidationContainerComponent, IgcPredefinedRangesAreaComponent);
|
|
51
51
|
}
|
|
52
52
|
get __validators() {
|
|
53
53
|
return dateRangeValidators;
|
|
@@ -61,7 +61,6 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
61
61
|
set value(value) {
|
|
62
62
|
this._formValue.setValueAndFormState(convertToDateRange(value));
|
|
63
63
|
this._setCalendarRangeValues();
|
|
64
|
-
this._updateMaskedRangeValue();
|
|
65
64
|
}
|
|
66
65
|
get value() {
|
|
67
66
|
return this._formValue.value;
|
|
@@ -87,14 +86,12 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
87
86
|
}
|
|
88
87
|
set displayFormat(value) {
|
|
89
88
|
this._displayFormat = value;
|
|
90
|
-
this._updateMaskedRangeValue();
|
|
91
89
|
}
|
|
92
90
|
get displayFormat() {
|
|
93
91
|
return (this._displayFormat ?? this._inputFormat ?? this._defaultDisplayFormat);
|
|
94
92
|
}
|
|
95
93
|
set inputFormat(value) {
|
|
96
94
|
this._inputFormat = value;
|
|
97
|
-
this._updateMaskedRangeValue();
|
|
98
95
|
}
|
|
99
96
|
get inputFormat() {
|
|
100
97
|
return this._inputFormat ?? this._defaultMask;
|
|
@@ -147,7 +144,8 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
147
144
|
onHide: this._handleClosing,
|
|
148
145
|
});
|
|
149
146
|
this._i18nController = addI18nController(this, {
|
|
150
|
-
defaultEN:
|
|
147
|
+
defaultEN: Object.assign({}, DateRangePickerResourceStringsEN, CalendarResourceStringsEN),
|
|
148
|
+
resourceMapName: 'date-range-picker',
|
|
151
149
|
onResourceChange: this._updateDefaultMask,
|
|
152
150
|
});
|
|
153
151
|
this._activeDate = null;
|
|
@@ -157,7 +155,6 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
157
155
|
this._dateConstraints = [];
|
|
158
156
|
this._oldValue = null;
|
|
159
157
|
this._visibleMonths = 2;
|
|
160
|
-
this._maskedRangeValue = '';
|
|
161
158
|
this.customRanges = [];
|
|
162
159
|
this.mode = 'dropdown';
|
|
163
160
|
this.useTwoInputs = false;
|
|
@@ -196,7 +193,16 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
196
193
|
formResetCallback() {
|
|
197
194
|
super.formResetCallback();
|
|
198
195
|
this._setCalendarRangeValues();
|
|
199
|
-
|
|
196
|
+
}
|
|
197
|
+
hasDateParts() {
|
|
198
|
+
return this.useTwoInputs
|
|
199
|
+
? this._inputs[0].hasDateParts()
|
|
200
|
+
: this._input.hasDateParts();
|
|
201
|
+
}
|
|
202
|
+
hasTimeParts() {
|
|
203
|
+
return this.useTwoInputs
|
|
204
|
+
? this._inputs[0].hasTimeParts()
|
|
205
|
+
: this._input.hasTimeParts();
|
|
200
206
|
}
|
|
201
207
|
clear() {
|
|
202
208
|
this._oldValue = this.value;
|
|
@@ -205,6 +211,10 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
205
211
|
this._inputs[0]?.clear();
|
|
206
212
|
this._inputs[1]?.clear();
|
|
207
213
|
}
|
|
214
|
+
else {
|
|
215
|
+
this._input.value = null;
|
|
216
|
+
this._input?.clear();
|
|
217
|
+
}
|
|
208
218
|
}
|
|
209
219
|
select(value) {
|
|
210
220
|
this._select(value);
|
|
@@ -218,11 +228,9 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
218
228
|
_updateDefaultMask() {
|
|
219
229
|
this._defaultMask = getDefaultDateTimeFormat(this.locale);
|
|
220
230
|
this._defaultDisplayFormat = getDateFormatter().getLocaleDateTimeFormat(this.locale);
|
|
221
|
-
this._updateMaskedRangeValue();
|
|
222
231
|
}
|
|
223
232
|
async _updateDateRange() {
|
|
224
233
|
await this._calendar?.updateComplete;
|
|
225
|
-
this._updateMaskedRangeValue();
|
|
226
234
|
this._setCalendarRangeValues();
|
|
227
235
|
this._delegateInputsValidity();
|
|
228
236
|
}
|
|
@@ -258,9 +266,8 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
258
266
|
}
|
|
259
267
|
this._hide(true);
|
|
260
268
|
}
|
|
261
|
-
|
|
269
|
+
_handleInput(event) {
|
|
262
270
|
event.stopPropagation();
|
|
263
|
-
this._setTouchedState();
|
|
264
271
|
if (this.nonEditable) {
|
|
265
272
|
event.preventDefault();
|
|
266
273
|
return;
|
|
@@ -272,13 +279,39 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
272
279
|
newValue ?? this._firstDefinedInRange ?? this._calendar.activeDate;
|
|
273
280
|
this.emitEvent('igcInput', { detail: this.value });
|
|
274
281
|
}
|
|
275
|
-
|
|
282
|
+
_handleInputChange(event) {
|
|
276
283
|
event.stopPropagation();
|
|
277
|
-
this._setTouchedState();
|
|
278
284
|
const input = event.target;
|
|
279
285
|
const newValue = input.value ? CalendarDay.from(input.value).native : null;
|
|
280
286
|
const updatedRange = this._getUpdatedDateRange(input, newValue);
|
|
281
|
-
const { start, end } = this._swapDates(updatedRange)
|
|
287
|
+
const { start, end } = this._swapDates(updatedRange) ?? {
|
|
288
|
+
start: null,
|
|
289
|
+
end: null,
|
|
290
|
+
};
|
|
291
|
+
this._setCalendarRangeValues();
|
|
292
|
+
this.value = { start, end };
|
|
293
|
+
this.emitEvent('igcChange', { detail: this.value });
|
|
294
|
+
}
|
|
295
|
+
async _handleDateRangeInput(event) {
|
|
296
|
+
event.stopPropagation();
|
|
297
|
+
if (this.nonEditable) {
|
|
298
|
+
event.preventDefault();
|
|
299
|
+
return;
|
|
300
|
+
}
|
|
301
|
+
const input = event.target;
|
|
302
|
+
const newValue = input.value;
|
|
303
|
+
this.value = newValue;
|
|
304
|
+
this._calendar.activeDate = newValue?.start;
|
|
305
|
+
this.emitEvent('igcInput', { detail: this.value });
|
|
306
|
+
}
|
|
307
|
+
_handleDateRangeInputChange(event) {
|
|
308
|
+
event.stopPropagation();
|
|
309
|
+
const input = event.target;
|
|
310
|
+
const newValue = input.value;
|
|
311
|
+
const { start, end } = this._swapDates(newValue) ?? {
|
|
312
|
+
start: null,
|
|
313
|
+
end: null,
|
|
314
|
+
};
|
|
282
315
|
this._setCalendarRangeValues();
|
|
283
316
|
this.value = { start, end };
|
|
284
317
|
this.emitEvent('igcChange', { detail: this.value });
|
|
@@ -286,11 +319,6 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
286
319
|
_handleFocusOut({ relatedTarget }) {
|
|
287
320
|
if (!this.contains(relatedTarget)) {
|
|
288
321
|
this._handleBlur();
|
|
289
|
-
const isSameValue = equal(this.value, this._oldValue);
|
|
290
|
-
if (!(this.useTwoInputs || this.readOnly || isSameValue)) {
|
|
291
|
-
this.emitEvent('igcChange', { detail: this.value });
|
|
292
|
-
this._oldValue = this.value;
|
|
293
|
-
}
|
|
294
322
|
}
|
|
295
323
|
}
|
|
296
324
|
_handleInputClick(event) {
|
|
@@ -360,20 +388,6 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
360
388
|
this._dateConstraints =
|
|
361
389
|
createDateConstraints(this.min, this.max, this.disabledDates) ?? [];
|
|
362
390
|
}
|
|
363
|
-
_updateMaskedRangeValue() {
|
|
364
|
-
if (this.useTwoInputs) {
|
|
365
|
-
return;
|
|
366
|
-
}
|
|
367
|
-
if (!isCompleteDateRange(this.value)) {
|
|
368
|
-
this._maskedRangeValue = '';
|
|
369
|
-
return;
|
|
370
|
-
}
|
|
371
|
-
const { start, end } = this.value;
|
|
372
|
-
const displayFormat = getDateTimeFormat(this.displayFormat);
|
|
373
|
-
const startValue = formatDisplayDate(start, this.locale, displayFormat);
|
|
374
|
-
const endValue = formatDisplayDate(end, this.locale, displayFormat);
|
|
375
|
-
this._maskedRangeValue = `${startValue} - ${endValue}`;
|
|
376
|
-
}
|
|
377
391
|
_setCalendarRangeValues() {
|
|
378
392
|
if (!this._calendar) {
|
|
379
393
|
return;
|
|
@@ -413,7 +427,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
413
427
|
this._hide(true);
|
|
414
428
|
}
|
|
415
429
|
}
|
|
416
|
-
_renderClearIcon(picker =
|
|
430
|
+
_renderClearIcon(picker = DateRangePosition.Start) {
|
|
417
431
|
const clearIcon = this.useTwoInputs ? `clear-icon-${picker}` : 'clear-icon';
|
|
418
432
|
return this._firstDefinedInRange
|
|
419
433
|
? html `
|
|
@@ -433,7 +447,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
433
447
|
`
|
|
434
448
|
: nothing;
|
|
435
449
|
}
|
|
436
|
-
_renderCalendarIcon(picker =
|
|
450
|
+
_renderCalendarIcon(picker = DateRangePosition.Start) {
|
|
437
451
|
const defaultIcon = html `
|
|
438
452
|
<igc-icon name="today" collection="default" aria-hidden="true"></igc-icon>
|
|
439
453
|
`;
|
|
@@ -459,7 +473,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
459
473
|
: 'header-date';
|
|
460
474
|
return html `
|
|
461
475
|
<slot name="title" slot="title">
|
|
462
|
-
${this.resourceStrings.
|
|
476
|
+
${this.resourceStrings.calendar_select_date}
|
|
463
477
|
</slot>
|
|
464
478
|
<slot name="header-date" slot=${hasHeaderDate}></slot>
|
|
465
479
|
`;
|
|
@@ -529,7 +543,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
529
543
|
`
|
|
530
544
|
: html `
|
|
531
545
|
<igc-dialog
|
|
532
|
-
aria-label=${ifDefined(this.resourceStrings.
|
|
546
|
+
aria-label=${ifDefined(this.resourceStrings.calendar_select_date)}
|
|
533
547
|
role="dialog"
|
|
534
548
|
?open=${this.open}
|
|
535
549
|
?close-on-outside-click=${!this.keepOpenOnOutsideClick}
|
|
@@ -544,13 +558,14 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
544
558
|
slot="footer"
|
|
545
559
|
@click=${this._dialogCancel}
|
|
546
560
|
variant=${isIndigo ? 'outlined' : 'flat'}
|
|
547
|
-
>${this.resourceStrings
|
|
561
|
+
>${this.resourceStrings
|
|
562
|
+
.date_range_picker_cancel_button}</igc-button
|
|
548
563
|
>
|
|
549
564
|
<igc-button
|
|
550
565
|
slot="footer"
|
|
551
566
|
@click=${this._dialogDone}
|
|
552
567
|
variant=${isIndigo ? 'contained' : 'flat'}
|
|
553
|
-
>${this.resourceStrings.
|
|
568
|
+
>${this.resourceStrings.date_range_picker_done_button}</igc-button
|
|
554
569
|
>
|
|
555
570
|
</igc-dialog>
|
|
556
571
|
`;
|
|
@@ -558,14 +573,18 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
558
573
|
_renderHelperText() {
|
|
559
574
|
return IgcValidationContainerComponent.create(this);
|
|
560
575
|
}
|
|
561
|
-
_renderInput(id, picker =
|
|
576
|
+
_renderInput(id, picker = DateRangePosition.Start) {
|
|
562
577
|
const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;
|
|
563
578
|
const placeholder = picker === 'start' ? this.placeholderStart : this.placeholderEnd;
|
|
564
579
|
const label = picker === 'start' ? this.labelStart : this.labelEnd;
|
|
565
580
|
const format = getDateTimeFormat(this._displayFormat);
|
|
566
581
|
const value = picker === 'start' ? this.value?.start : this.value?.end;
|
|
567
|
-
const prefixes = picker ===
|
|
568
|
-
|
|
582
|
+
const prefixes = picker === DateRangePosition.Start
|
|
583
|
+
? this._startPrefixes
|
|
584
|
+
: this._endPrefixes;
|
|
585
|
+
const suffixes = picker === DateRangePosition.Start
|
|
586
|
+
? this._startSuffixes
|
|
587
|
+
: this._endSuffixes;
|
|
569
588
|
const prefix = isEmpty(prefixes) ? undefined : 'prefix';
|
|
570
589
|
const suffix = isEmpty(suffixes) ? undefined : 'suffix';
|
|
571
590
|
return html `
|
|
@@ -585,8 +604,9 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
585
604
|
.max=${this._max}
|
|
586
605
|
label=${label}
|
|
587
606
|
?invalid=${live(this.invalid)}
|
|
588
|
-
@igcChange=${this.
|
|
589
|
-
@igcInput=${this.
|
|
607
|
+
@igcChange=${this._handleInputChange}
|
|
608
|
+
@igcInput=${this._handleInput}
|
|
609
|
+
@keydown=${this._handleEnterKeydown}
|
|
590
610
|
@click=${this._isDropDown || this.readOnly
|
|
591
611
|
? nothing
|
|
592
612
|
: this._handleInputClick}
|
|
@@ -602,30 +622,41 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
602
622
|
_renderInputs(idStart, idEnd) {
|
|
603
623
|
return html `
|
|
604
624
|
<div part="inputs">
|
|
605
|
-
${this._renderInput(idStart,
|
|
625
|
+
${this._renderInput(idStart, DateRangePosition.Start)}
|
|
606
626
|
<div part="separator">
|
|
607
|
-
<slot name="separator">
|
|
627
|
+
<slot name="separator">
|
|
628
|
+
${this.resourceStrings.date_range_picker_date_separator}
|
|
629
|
+
</slot>
|
|
608
630
|
</div>
|
|
609
|
-
${this._renderInput(idEnd,
|
|
631
|
+
${this._renderInput(idEnd, DateRangePosition.End)}
|
|
610
632
|
</div>
|
|
611
633
|
${this._renderPicker(idStart)} ${this._renderHelperText()}
|
|
612
634
|
`;
|
|
613
635
|
}
|
|
614
636
|
_renderSingleInput(id) {
|
|
637
|
+
const readOnly = !this._isDropDown || this.readOnly || this.nonEditable;
|
|
638
|
+
const format = getDateTimeFormat(this.displayFormat) ?? this._defaultDisplayFormat;
|
|
615
639
|
const prefix = isEmpty(this._prefixes) ? undefined : 'prefix';
|
|
616
640
|
const suffix = isEmpty(this._suffixes) ? undefined : 'suffix';
|
|
617
641
|
return html `
|
|
618
|
-
<igc-input
|
|
642
|
+
<igc-date-range-input
|
|
619
643
|
id=${id}
|
|
644
|
+
.value=${live(this.value)}
|
|
645
|
+
.placeholder=${this.placeholder}
|
|
620
646
|
aria-haspopup="dialog"
|
|
621
|
-
.value=${this._maskedRangeValue}
|
|
622
647
|
label=${this.label}
|
|
623
|
-
|
|
624
|
-
?readonly=${true}
|
|
648
|
+
?readonly=${readOnly}
|
|
625
649
|
?required=${this.required}
|
|
626
650
|
.outlined=${this.outlined}
|
|
627
651
|
?invalid=${live(this.invalid)}
|
|
628
652
|
.disabled=${this.disabled}
|
|
653
|
+
.inputFormat=${live(this.inputFormat)}
|
|
654
|
+
.displayFormat=${live(format)}
|
|
655
|
+
.locale=${live(this.locale)}
|
|
656
|
+
.prompt=${this.prompt}
|
|
657
|
+
@igcInput=${this._handleDateRangeInput}
|
|
658
|
+
@igcChange=${this._handleDateRangeInputChange}
|
|
659
|
+
@keydown=${this._handleEnterKeydown}
|
|
629
660
|
@click=${this._isDropDown || this.readOnly
|
|
630
661
|
? nothing
|
|
631
662
|
: this._handleInputClick}
|
|
@@ -635,7 +666,7 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
635
666
|
<slot name="prefix" slot=${ifDefined(prefix)}></slot>
|
|
636
667
|
${this._renderClearIcon()}
|
|
637
668
|
<slot name="suffix" slot=${ifDefined(suffix)}></slot>
|
|
638
|
-
</igc-input>
|
|
669
|
+
</igc-date-range-input>
|
|
639
670
|
${this._renderHelperText()} ${this._renderPicker(id)}
|
|
640
671
|
`;
|
|
641
672
|
}
|
|
@@ -646,14 +677,11 @@ let IgcDateRangePickerComponent = class IgcDateRangePickerComponent extends Form
|
|
|
646
677
|
: this._renderInputs(`${id}-start`, `${id}-end`))}`;
|
|
647
678
|
}
|
|
648
679
|
};
|
|
649
|
-
__decorate([
|
|
650
|
-
state()
|
|
651
|
-
], IgcDateRangePickerComponent.prototype, "_maskedRangeValue", void 0);
|
|
652
680
|
__decorate([
|
|
653
681
|
queryAll(IgcDateTimeInputComponent.tagName)
|
|
654
682
|
], IgcDateRangePickerComponent.prototype, "_inputs", void 0);
|
|
655
683
|
__decorate([
|
|
656
|
-
query(
|
|
684
|
+
query(IgcDateRangeInputComponent.tagName)
|
|
657
685
|
], IgcDateRangePickerComponent.prototype, "_input", void 0);
|
|
658
686
|
__decorate([
|
|
659
687
|
query(IgcCalendarComponent.tagName)
|