igniteui-angular 21.0.3 → 21.1.0-alpha.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/LICENSE +1 -0
- package/README.md +5 -6
- package/fesm2022/igniteui-angular-action-strip.mjs +39 -34
- package/fesm2022/igniteui-angular-action-strip.mjs.map +1 -1
- package/fesm2022/igniteui-angular-banner.mjs +64 -59
- package/fesm2022/igniteui-angular-banner.mjs.map +1 -1
- package/fesm2022/igniteui-angular-calendar.mjs +182 -161
- package/fesm2022/igniteui-angular-calendar.mjs.map +1 -1
- package/fesm2022/igniteui-angular-carousel.mjs +7 -3
- package/fesm2022/igniteui-angular-carousel.mjs.map +1 -1
- package/fesm2022/igniteui-angular-chips.mjs +140 -136
- package/fesm2022/igniteui-angular-chips.mjs.map +1 -1
- package/fesm2022/igniteui-angular-combo.mjs +360 -356
- package/fesm2022/igniteui-angular-combo.mjs.map +1 -1
- package/fesm2022/igniteui-angular-core.mjs +420 -618
- package/fesm2022/igniteui-angular-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-date-picker.mjs +124 -32
- package/fesm2022/igniteui-angular-date-picker.mjs.map +1 -1
- package/fesm2022/igniteui-angular-directives.mjs +15 -10
- package/fesm2022/igniteui-angular-directives.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-core.mjs +75 -57
- package/fesm2022/igniteui-angular-grids-core.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-grid.mjs +71 -62
- package/fesm2022/igniteui-angular-grids-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs +51 -6
- package/fesm2022/igniteui-angular-grids-hierarchical-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-pivot-grid.mjs +6 -1
- package/fesm2022/igniteui-angular-grids-pivot-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-grids-tree-grid.mjs +8 -8
- package/fesm2022/igniteui-angular-grids-tree-grid.mjs.map +1 -1
- package/fesm2022/igniteui-angular-input-group.mjs +8 -4
- package/fesm2022/igniteui-angular-input-group.mjs.map +1 -1
- package/fesm2022/igniteui-angular-list.mjs +24 -19
- package/fesm2022/igniteui-angular-list.mjs.map +1 -1
- package/fesm2022/igniteui-angular-paginator.mjs +71 -66
- package/fesm2022/igniteui-angular-paginator.mjs.map +1 -1
- package/fesm2022/igniteui-angular-query-builder.mjs +51 -36
- package/fesm2022/igniteui-angular-query-builder.mjs.map +1 -1
- package/fesm2022/igniteui-angular-time-picker.mjs +50 -8
- package/fesm2022/igniteui-angular-time-picker.mjs.map +1 -1
- package/fesm2022/igniteui-angular-tree.mjs +64 -61
- package/fesm2022/igniteui-angular-tree.mjs.map +1 -1
- package/lib/core/styles/components/calendar/_calendar-theme.scss +2 -0
- package/lib/core/styles/components/grid/_grid-theme.scss +2 -1
- package/lib/core/styles/components/slider/_slider-theme.scss +0 -1
- package/lib/core/styles/components/tabs/_tabs-theme.scss +2 -1
- package/package.json +3 -2
- package/schematics/tsconfig.tsbuildinfo +1 -1
- package/schematics/utils/dependency-handler.js +1 -0
- package/styles/igniteui-angular-dark.css +1 -1
- package/styles/igniteui-angular.css +1 -1
- package/styles/igniteui-bootstrap-dark.css +1 -1
- package/styles/igniteui-bootstrap-light.css +1 -1
- package/styles/igniteui-dark-green.css +1 -1
- package/styles/igniteui-fluent-dark-excel.css +1 -1
- package/styles/igniteui-fluent-dark-word.css +1 -1
- package/styles/igniteui-fluent-dark.css +1 -1
- package/styles/igniteui-fluent-light-excel.css +1 -1
- package/styles/igniteui-fluent-light-word.css +1 -1
- package/styles/igniteui-fluent-light.css +1 -1
- package/styles/igniteui-indigo-dark.css +1 -1
- package/styles/igniteui-indigo-light.css +1 -1
- package/styles/maps/igniteui-angular-dark.css.map +1 -1
- package/styles/maps/igniteui-angular.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-dark.css.map +1 -1
- package/styles/maps/igniteui-bootstrap-light.css.map +1 -1
- package/styles/maps/igniteui-dark-green.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-dark.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-excel.css.map +1 -1
- package/styles/maps/igniteui-fluent-light-word.css.map +1 -1
- package/styles/maps/igniteui-fluent-light.css.map +1 -1
- package/styles/maps/igniteui-indigo-dark.css.map +1 -1
- package/styles/maps/igniteui-indigo-light.css.map +1 -1
- package/types/igniteui-angular-action-strip.d.ts +3 -0
- package/types/igniteui-angular-banner.d.ts +3 -0
- package/types/igniteui-angular-calendar.d.ts +37 -47
- package/types/igniteui-angular-carousel.d.ts +1 -0
- package/types/igniteui-angular-chips.d.ts +2 -0
- package/types/igniteui-angular-combo.d.ts +4 -2
- package/types/igniteui-angular-core.d.ts +152 -397
- package/types/igniteui-angular-date-picker.d.ts +22 -4
- package/types/igniteui-angular-directives.d.ts +8 -4
- package/types/igniteui-angular-grids-core.d.ts +18 -8
- package/types/igniteui-angular-grids-grid.d.ts +9 -7
- package/types/igniteui-angular-grids-hierarchical-grid.d.ts +20 -3
- package/types/igniteui-angular-input-group.d.ts +1 -0
- package/types/igniteui-angular-list.d.ts +3 -0
- package/types/igniteui-angular-paginator.d.ts +3 -0
- package/types/igniteui-angular-query-builder.d.ts +8 -0
- package/types/igniteui-angular-time-picker.d.ts +7 -2
- package/types/igniteui-angular-tree.d.ts +2 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i2 from 'igniteui-angular/core';
|
|
2
|
-
import { PickerInteractionMode, PickerHeaderOrientation, IgxPickerToggleComponent, IgxPickerClearComponent, DateRangePickerResourceStringsEN, CalendarDay, DateTimeUtil, IgxOverlayService, PlatformUtil, PickerCalendarOrientation, getCurrentResourceStrings, DatePickerResourceStringsEN, AutoPositionStrategy, AbsoluteScrollStrategy, isDate, isDateInRanges, DateRangeType, IgxPickerActionsDirective, clamp, parseDate, calendarRange } from 'igniteui-angular/core';
|
|
2
|
+
import { PickerInteractionMode, I18N_FORMATTER, PickerHeaderOrientation, DEFAULT_LOCALE, onResourceChangeHandle, IgxPickerToggleComponent, IgxPickerClearComponent, DateRangePickerResourceStringsEN, CalendarDay, DateTimeUtil, IgxOverlayService, PlatformUtil, PickerCalendarOrientation, getCurrentResourceStrings, DatePickerResourceStringsEN, AutoPositionStrategy, AbsoluteScrollStrategy, isDate, isDateInRanges, DateRangeType, IgxPickerActionsDirective, clamp, parseDate, calendarRange } from 'igniteui-angular/core';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { inject, ElementRef, LOCALE_ID, EventEmitter, booleanAttribute, ViewChild, ContentChildren, Output, Input, Directive, ChangeDetectionStrategy, Component, HostListener, HostBinding, Injector, Renderer2, ChangeDetectorRef, ViewContainerRef, ContentChild, Pipe, TemplateRef, NgModule } from '@angular/core';
|
|
5
5
|
import { NgControl, NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
|
|
@@ -12,10 +12,49 @@ import { takeUntil, filter } from 'rxjs/operators';
|
|
|
12
12
|
import { IgxButtonDirective, IgxRippleDirective, IgxDividerDirective, IgxDateTimeEditorDirective, IgxTextSelectionDirective } from 'igniteui-angular/directives';
|
|
13
13
|
import { IgxIconComponent } from 'igniteui-angular/icon';
|
|
14
14
|
import { fadeOut, fadeIn } from 'igniteui-angular/animations';
|
|
15
|
-
import {
|
|
15
|
+
import { getCurrentI18n } from 'igniteui-i18n-core';
|
|
16
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
16
17
|
import { IgxChipComponent } from 'igniteui-angular/chips';
|
|
17
18
|
|
|
18
19
|
class PickerBaseDirective {
|
|
20
|
+
/**
|
|
21
|
+
* The editor's input mask.
|
|
22
|
+
*
|
|
23
|
+
* @remarks
|
|
24
|
+
* Also used as a placeholder when none is provided.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```html
|
|
28
|
+
* <igx-date-picker inputFormat="dd/MM/yy"></igx-date-picker>
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
set inputFormat(value) {
|
|
32
|
+
this._inputFormat = value;
|
|
33
|
+
}
|
|
34
|
+
;
|
|
35
|
+
get inputFormat() {
|
|
36
|
+
return this._inputFormat;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The format used to display the picker's value when it's not being edited.
|
|
40
|
+
*
|
|
41
|
+
* @remarks
|
|
42
|
+
* Uses Angular's DatePipe.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```html
|
|
46
|
+
* <igx-date-picker displayFormat="EE/M/yy"></igx-date-picker>
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
*/
|
|
50
|
+
set displayFormat(value) {
|
|
51
|
+
this._displayFormat = value;
|
|
52
|
+
}
|
|
53
|
+
;
|
|
54
|
+
get displayFormat() {
|
|
55
|
+
return this._displayFormat ?? this._inputFormat;
|
|
56
|
+
}
|
|
57
|
+
;
|
|
19
58
|
/**
|
|
20
59
|
* @example
|
|
21
60
|
* ```html
|
|
@@ -27,21 +66,15 @@ class PickerBaseDirective {
|
|
|
27
66
|
* If not set, defaults to applciation's locale..
|
|
28
67
|
*/
|
|
29
68
|
get locale() {
|
|
30
|
-
return this._locale;
|
|
69
|
+
return this._locale || this._defaultLocale;
|
|
31
70
|
}
|
|
32
71
|
/**
|
|
33
72
|
* Sets the `locale` of the date-picker.
|
|
34
73
|
* Expects a valid BCP 47 language tag.
|
|
35
74
|
*/
|
|
36
75
|
set locale(value) {
|
|
37
|
-
this._locale = value;
|
|
38
|
-
|
|
39
|
-
try {
|
|
40
|
-
getLocaleFirstDayOfWeek(this._locale);
|
|
41
|
-
}
|
|
42
|
-
catch (e) {
|
|
43
|
-
this._locale = this._localeId;
|
|
44
|
-
}
|
|
76
|
+
this._locale = this.i18nFormatter.verifyLocale(value);
|
|
77
|
+
this.updateResources();
|
|
45
78
|
}
|
|
46
79
|
/**
|
|
47
80
|
* Gets the start day of the week.
|
|
@@ -49,7 +82,7 @@ class PickerBaseDirective {
|
|
|
49
82
|
* If not set, defaults to the first day of the week for the application locale.
|
|
50
83
|
*/
|
|
51
84
|
get weekStart() {
|
|
52
|
-
return this._weekStart ?? getLocaleFirstDayOfWeek(this.
|
|
85
|
+
return this._weekStart ?? this.i18nFormatter.getLocaleFirstDayOfWeek(this.locale);
|
|
53
86
|
}
|
|
54
87
|
/**
|
|
55
88
|
* Sets the start day of the week.
|
|
@@ -105,6 +138,7 @@ class PickerBaseDirective {
|
|
|
105
138
|
this.element = inject(ElementRef);
|
|
106
139
|
this._localeId = inject(LOCALE_ID);
|
|
107
140
|
this._inputGroupType = inject(IGX_INPUT_GROUP_TYPE, { optional: true });
|
|
141
|
+
this.i18nFormatter = inject(I18N_FORMATTER);
|
|
108
142
|
/**
|
|
109
143
|
* Sets the `placeholder` of the picker's input.
|
|
110
144
|
*
|
|
@@ -191,7 +225,7 @@ class PickerBaseDirective {
|
|
|
191
225
|
this.closed = new EventEmitter();
|
|
192
226
|
this._collapsed = true;
|
|
193
227
|
this._destroy$ = new Subject();
|
|
194
|
-
this.
|
|
228
|
+
this.initLocale();
|
|
195
229
|
}
|
|
196
230
|
/** @hidden @internal */
|
|
197
231
|
ngAfterViewInit() {
|
|
@@ -225,6 +259,16 @@ class PickerBaseDirective {
|
|
|
225
259
|
components.changes.pipe(takeUntil(this._destroy$))
|
|
226
260
|
.subscribe(() => subscribeToClick(components));
|
|
227
261
|
}
|
|
262
|
+
initLocale() {
|
|
263
|
+
this._defaultLocale = getCurrentI18n();
|
|
264
|
+
this._locale = this._localeId !== DEFAULT_LOCALE ? this._localeId : this._locale;
|
|
265
|
+
onResourceChangeHandle(this._destroy$, this.onResourceChange, this);
|
|
266
|
+
}
|
|
267
|
+
onResourceChange(args) {
|
|
268
|
+
this._defaultLocale = args.detail.newLocale;
|
|
269
|
+
this.updateResources();
|
|
270
|
+
}
|
|
271
|
+
updateResources() { }
|
|
228
272
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PickerBaseDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
229
273
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "21.0.2", type: PickerBaseDirective, isStandalone: true, inputs: { inputFormat: "inputFormat", displayFormat: "displayFormat", placeholder: "placeholder", mode: "mode", headerOrientation: "headerOrientation", hideHeader: ["hideHeader", "hideHeader", booleanAttribute], overlaySettings: "overlaySettings", disabled: ["disabled", "disabled", booleanAttribute], locale: "locale", weekStart: "weekStart", outlet: "outlet", type: "type", tabIndex: "tabIndex" }, outputs: { opening: "opening", opened: "opened", closing: "closing", closed: "closed" }, queries: [{ propertyName: "toggleComponents", predicate: IgxPickerToggleComponent, descendants: true }, { propertyName: "clearComponents", predicate: IgxPickerClearComponent, descendants: true }, { propertyName: "prefixes", predicate: IgxPrefixDirective, descendants: true }, { propertyName: "suffixes", predicate: IgxSuffixDirective, descendants: true }], viewQueries: [{ propertyName: "inputGroup", first: true, predicate: IgxInputGroupComponent, descendants: true }], ngImport: i0 }); }
|
|
230
274
|
}
|
|
@@ -527,6 +571,7 @@ class IgxDatePickerComponent extends PickerBaseDirective {
|
|
|
527
571
|
this._renderer = inject(Renderer2);
|
|
528
572
|
this.platform = inject(PlatformUtil);
|
|
529
573
|
this.cdr = inject(ChangeDetectorRef);
|
|
574
|
+
this._i18nFormatter = inject(I18N_FORMATTER);
|
|
530
575
|
/**
|
|
531
576
|
* Gets/Sets the number of month views displayed.
|
|
532
577
|
*
|
|
@@ -638,7 +683,7 @@ class IgxDatePickerComponent extends PickerBaseDirective {
|
|
|
638
683
|
this.updateValidity();
|
|
639
684
|
this.inputGroup.isRequired = this.required;
|
|
640
685
|
};
|
|
641
|
-
this.
|
|
686
|
+
this.initLocale();
|
|
642
687
|
}
|
|
643
688
|
/** @hidden @internal */
|
|
644
689
|
get required() {
|
|
@@ -856,7 +901,6 @@ class IgxDatePickerComponent extends PickerBaseDirective {
|
|
|
856
901
|
/** @hidden @internal */
|
|
857
902
|
ngOnInit() {
|
|
858
903
|
this._ngControl = this._injector.get(NgControl, null);
|
|
859
|
-
this.locale = this.locale || this._localeId;
|
|
860
904
|
}
|
|
861
905
|
/** @hidden @internal */
|
|
862
906
|
ngAfterViewInit() {
|
|
@@ -1060,6 +1104,9 @@ class IgxDatePickerComponent extends PickerBaseDirective {
|
|
|
1060
1104
|
componentInstance.calendarClose.pipe(takeUntil(this._destroy$)).subscribe(() => this.close());
|
|
1061
1105
|
componentInstance.todaySelection.pipe(takeUntil(this._destroy$)).subscribe(() => this.selectToday());
|
|
1062
1106
|
}
|
|
1107
|
+
updateResources() {
|
|
1108
|
+
this._resourceStrings = getCurrentResourceStrings(DatePickerResourceStringsEN, false, this._locale);
|
|
1109
|
+
}
|
|
1063
1110
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: IgxDatePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1064
1111
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: IgxDatePickerComponent, isStandalone: true, selector: "igx-date-picker", inputs: { hideOutsideDays: ["hideOutsideDays", "hideOutsideDays", booleanAttribute], displayMonthsCount: "displayMonthsCount", orientation: "orientation", showWeekNumbers: ["showWeekNumbers", "showWeekNumbers", booleanAttribute], activeDate: "activeDate", formatter: "formatter", todayButtonLabel: "todayButtonLabel", cancelButtonLabel: "cancelButtonLabel", spinLoop: ["spinLoop", "spinLoop", booleanAttribute], spinDelta: "spinDelta", outlet: "outlet", id: "id", formatViews: "formatViews", disabledDates: "disabledDates", specialDates: "specialDates", calendarFormat: "calendarFormat", value: "value", minValue: "minValue", maxValue: "maxValue", resourceStrings: "resourceStrings", readOnly: ["readOnly", "readOnly", booleanAttribute] }, outputs: { valueChange: "valueChange", validationFailed: "validationFailed" }, host: { listeners: { "keydown": "onKeyDown($event)" }, properties: { "attr.id": "this.id" } }, providers: [
|
|
1065
1112
|
{ provide: NG_VALUE_ACCESSOR, useExisting: IgxDatePickerComponent, multi: true },
|
|
@@ -1183,6 +1230,9 @@ const IGX_DATE_PICKER_DIRECTIVES = [
|
|
|
1183
1230
|
|
|
1184
1231
|
/** @hidden @internal */
|
|
1185
1232
|
class DateRangePickerFormatPipe {
|
|
1233
|
+
constructor() {
|
|
1234
|
+
this.i18nFormatter = inject(I18N_FORMATTER);
|
|
1235
|
+
}
|
|
1186
1236
|
transform(values, appliedFormat, locale, formatter) {
|
|
1187
1237
|
if (!values || !values.start && !values.end) {
|
|
1188
1238
|
return '';
|
|
@@ -1197,8 +1247,8 @@ class DateRangePickerFormatPipe {
|
|
|
1197
1247
|
if (!isDate(end)) {
|
|
1198
1248
|
end = DateTimeUtil.parseIsoDate(end);
|
|
1199
1249
|
}
|
|
1200
|
-
const startDate =
|
|
1201
|
-
const endDate =
|
|
1250
|
+
const startDate = this.i18nFormatter.formatDate(start, appliedFormat, locale);
|
|
1251
|
+
const endDate = this.i18nFormatter.formatDate(end, appliedFormat, locale);
|
|
1202
1252
|
let formatted;
|
|
1203
1253
|
if (start) {
|
|
1204
1254
|
formatted = `${startDate} - `;
|
|
@@ -1460,6 +1510,40 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1460
1510
|
}
|
|
1461
1511
|
return this._cancelButtonText;
|
|
1462
1512
|
}
|
|
1513
|
+
/**
|
|
1514
|
+
* The format used when editable inputs are not focused.
|
|
1515
|
+
*
|
|
1516
|
+
* @remarks
|
|
1517
|
+
* Uses Angular's DatePipe.
|
|
1518
|
+
*
|
|
1519
|
+
* @example
|
|
1520
|
+
* ```html
|
|
1521
|
+
* <igx-date-range-picker displayFormat="EE/M/yy"></igx-date-range-picker>
|
|
1522
|
+
* ```
|
|
1523
|
+
*
|
|
1524
|
+
*/
|
|
1525
|
+
set displayFormat(value) {
|
|
1526
|
+
super.displayFormat = value;
|
|
1527
|
+
}
|
|
1528
|
+
get displayFormat() {
|
|
1529
|
+
return super.displayFormat;
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* The expected user input format and placeholder.
|
|
1533
|
+
*
|
|
1534
|
+
* @example
|
|
1535
|
+
* ```html
|
|
1536
|
+
* <igx-date-range-picker inputFormat="dd/MM/yy"></igx-date-range-picker>
|
|
1537
|
+
* ```
|
|
1538
|
+
*/
|
|
1539
|
+
set inputFormat(value) {
|
|
1540
|
+
super.inputFormat = value;
|
|
1541
|
+
}
|
|
1542
|
+
;
|
|
1543
|
+
get inputFormat() {
|
|
1544
|
+
// We need to get default input format because igxDateRangePicker is not using igxDateTimeEditor, but a plain input ???
|
|
1545
|
+
return this._inputFormat ?? DateTimeUtil.getDefaultInputFormat(this.locale, this.i18nFormatter);
|
|
1546
|
+
}
|
|
1463
1547
|
/**
|
|
1464
1548
|
* The minimum value in a valid range.
|
|
1465
1549
|
*
|
|
@@ -1528,7 +1612,7 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1528
1612
|
* An accessor that returns the resource strings.
|
|
1529
1613
|
*/
|
|
1530
1614
|
get resourceStrings() {
|
|
1531
|
-
return this._resourceStrings;
|
|
1615
|
+
return this._resourceStrings || this._defaultResourceStrings;
|
|
1532
1616
|
}
|
|
1533
1617
|
/** @hidden @internal */
|
|
1534
1618
|
get dateSeparator() {
|
|
@@ -1539,8 +1623,11 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1539
1623
|
}
|
|
1540
1624
|
/** @hidden @internal */
|
|
1541
1625
|
get appliedFormat() {
|
|
1542
|
-
|
|
1543
|
-
|
|
1626
|
+
// Resolve display format since it can be custom specified one like short, long, shortDate, longDate and etc.
|
|
1627
|
+
const formatOptions = this.i18nFormatter.getFormatOptions(this.displayFormat);
|
|
1628
|
+
return formatOptions
|
|
1629
|
+
? this.i18nFormatter.getLocaleDateTimeFormat(this.locale, false, formatOptions)
|
|
1630
|
+
: this.displayFormat ?? this.inputFormat;
|
|
1544
1631
|
}
|
|
1545
1632
|
/**
|
|
1546
1633
|
* Gets/Sets the date which is shown in the calendar picker and is highlighted.
|
|
@@ -1565,21 +1652,15 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1565
1652
|
* If not set, defaults to application's locale.
|
|
1566
1653
|
*/
|
|
1567
1654
|
get locale() {
|
|
1568
|
-
return this._locale;
|
|
1655
|
+
return this._locale || this._defaultLocale;
|
|
1569
1656
|
}
|
|
1570
1657
|
/**
|
|
1571
1658
|
* Sets the `locale` of the date-picker.
|
|
1572
1659
|
* Expects a valid BCP 47 language tag.
|
|
1573
1660
|
*/
|
|
1574
1661
|
set locale(value) {
|
|
1575
|
-
this._locale = value;
|
|
1576
|
-
|
|
1577
|
-
try {
|
|
1578
|
-
getLocaleFirstDayOfWeek(this._locale);
|
|
1579
|
-
}
|
|
1580
|
-
catch (e) {
|
|
1581
|
-
this._locale = this._localeId;
|
|
1582
|
-
}
|
|
1662
|
+
this._locale = this.i18nFormatter.verifyLocale(value);
|
|
1663
|
+
this.updateResources();
|
|
1583
1664
|
if (this.hasProjectedInputs) {
|
|
1584
1665
|
this.updateInputLocale();
|
|
1585
1666
|
this.updateDisplayFormat();
|
|
@@ -1725,7 +1806,8 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1725
1806
|
this.valueChange = new EventEmitter();
|
|
1726
1807
|
/** @hidden @internal */
|
|
1727
1808
|
this.cssClass = 'igx-date-range-picker';
|
|
1728
|
-
this._resourceStrings =
|
|
1809
|
+
this._resourceStrings = null;
|
|
1810
|
+
this._defaultResourceStrings = getCurrentResourceStrings(DateRangePickerResourceStringsEN);
|
|
1729
1811
|
this._doneButtonText = null;
|
|
1730
1812
|
this._cancelButtonText = null;
|
|
1731
1813
|
this._dateSeparator = null;
|
|
@@ -1762,7 +1844,7 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1762
1844
|
}
|
|
1763
1845
|
this.setRequiredToInputs();
|
|
1764
1846
|
};
|
|
1765
|
-
this.
|
|
1847
|
+
this.initLocale();
|
|
1766
1848
|
}
|
|
1767
1849
|
/** @hidden @internal */
|
|
1768
1850
|
onKeyDown(event) {
|
|
@@ -1932,7 +2014,6 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
1932
2014
|
/** @hidden */
|
|
1933
2015
|
ngOnInit() {
|
|
1934
2016
|
this._ngControl = this._injector.get(NgControl, null);
|
|
1935
|
-
this.locale = this.locale || this._localeId;
|
|
1936
2017
|
}
|
|
1937
2018
|
/** @hidden */
|
|
1938
2019
|
ngAfterViewInit() {
|
|
@@ -2345,8 +2426,19 @@ class IgxDateRangePickerComponent extends PickerBaseDirective {
|
|
|
2345
2426
|
this.projectedInputs.forEach(i => {
|
|
2346
2427
|
const input = i;
|
|
2347
2428
|
input.dateTimeEditor.locale = this.locale;
|
|
2429
|
+
input.dateTimeEditor.updateMask();
|
|
2348
2430
|
});
|
|
2349
2431
|
}
|
|
2432
|
+
onResourceChange(args) {
|
|
2433
|
+
super.onResourceChange(args);
|
|
2434
|
+
if (args.detail.oldLocale !== args.detail.newLocale && this.hasProjectedInputs) {
|
|
2435
|
+
this.updateInputLocale();
|
|
2436
|
+
this.updateDisplayFormat();
|
|
2437
|
+
}
|
|
2438
|
+
}
|
|
2439
|
+
updateResources() {
|
|
2440
|
+
this._defaultResourceStrings = getCurrentResourceStrings(DateRangePickerResourceStringsEN, false, this._locale);
|
|
2441
|
+
}
|
|
2350
2442
|
_initializeCalendarContainer(componentInstance) {
|
|
2351
2443
|
this._calendar = componentInstance.calendar;
|
|
2352
2444
|
this._calendar.hasHeader = !this.isDropdown && !this.hideHeader;
|