myrta-ui 1.1.91 → 1.1.93

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.
@@ -16,9 +16,9 @@ import { OverlayModule, OverlayContainer, FullscreenOverlayContainer } from '@an
16
16
  import { createPopper } from '@popperjs/core';
17
17
  import * as i1$3 from '@ng-select/ng-select';
18
18
  import { NgSelectModule } from '@ng-select/ng-select';
19
- import { Subscription, Subject, timer, EMPTY } from 'rxjs';
19
+ import { Subscription, Subject, timer, fromEvent, EMPTY } from 'rxjs';
20
20
  import { ActiveDescendantKeyManager } from '@angular/cdk/a11y';
21
- import { first, switchMap, map, mergeMap, startWith, distinctUntilChanged, pairwise, catchError } from 'rxjs/operators';
21
+ import { first, switchMap, map, mergeMap, filter, startWith, distinctUntilChanged, pairwise, catchError } from 'rxjs/operators';
22
22
  import * as i2 from '@angular/cdk/layout';
23
23
  import { Fancybox } from 'mrx-gallery-lib';
24
24
  import * as i1$5 from '@angular/common/http';
@@ -1166,56 +1166,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
1166
1166
  args: [TOOLTIP_DATA]
1167
1167
  }] }]; } });
1168
1168
 
1169
- const topPosition = {
1169
+ const topPosition$1 = {
1170
1170
  originX: 'center',
1171
1171
  originY: 'top',
1172
1172
  overlayX: 'center',
1173
1173
  overlayY: 'bottom',
1174
1174
  panelClass: 'top',
1175
1175
  };
1176
- const bottomPosition = {
1176
+ const bottomPosition$1 = {
1177
1177
  originX: 'center',
1178
1178
  originY: 'bottom',
1179
1179
  overlayX: 'center',
1180
1180
  overlayY: 'top',
1181
1181
  panelClass: 'bottom',
1182
1182
  };
1183
- const leftPosition = {
1183
+ const leftPosition$1 = {
1184
1184
  originX: 'start',
1185
1185
  originY: 'center',
1186
1186
  overlayX: 'end',
1187
1187
  overlayY: 'center',
1188
1188
  panelClass: 'start',
1189
1189
  };
1190
- const rightPosition = {
1190
+ const rightPosition$1 = {
1191
1191
  originX: 'end',
1192
1192
  originY: 'center',
1193
1193
  overlayX: 'start',
1194
1194
  overlayY: 'center',
1195
1195
  panelClass: 'end',
1196
1196
  };
1197
- const topStartPosition = {
1197
+ const topStartPosition$1 = {
1198
1198
  originX: 'start',
1199
1199
  originY: 'top',
1200
1200
  overlayX: 'start',
1201
1201
  overlayY: 'bottom',
1202
1202
  panelClass: 'top-start',
1203
1203
  };
1204
- const topEndPosition = {
1204
+ const topEndPosition$1 = {
1205
1205
  originX: 'end',
1206
1206
  originY: 'top',
1207
1207
  overlayX: 'end',
1208
1208
  overlayY: 'bottom',
1209
1209
  panelClass: 'top-end',
1210
1210
  };
1211
- const bottomStartPosition = {
1211
+ const bottomStartPosition$1 = {
1212
1212
  originX: 'start',
1213
1213
  originY: 'bottom',
1214
1214
  overlayX: 'start',
1215
1215
  overlayY: 'top',
1216
1216
  panelClass: 'bottom-start',
1217
1217
  };
1218
- const bottomEndPosition = {
1218
+ const bottomEndPosition$1 = {
1219
1219
  originX: 'end',
1220
1220
  originY: 'bottom',
1221
1221
  overlayX: 'end',
@@ -1223,17 +1223,17 @@ const bottomEndPosition = {
1223
1223
  panelClass: 'bottom-end',
1224
1224
  };
1225
1225
  const positions = [
1226
- topPosition, bottomPosition, leftPosition, rightPosition
1226
+ topPosition$1, bottomPosition$1, leftPosition$1, rightPosition$1
1227
1227
  ];
1228
1228
  const positionStrategy = {
1229
- top: [topPosition, topStartPosition, topEndPosition, bottomPosition, bottomStartPosition, bottomEndPosition, leftPosition, rightPosition],
1230
- bottom: [bottomPosition, bottomStartPosition, bottomEndPosition, topPosition, topStartPosition, topEndPosition, leftPosition, rightPosition],
1231
- left: [leftPosition, rightPosition, topPosition, bottomPosition],
1232
- right: [rightPosition, leftPosition, topPosition, bottomPosition],
1233
- 'top-start': [topStartPosition, topPosition, topEndPosition, bottomStartPosition, bottomPosition, bottomEndPosition],
1234
- 'top-end': [topEndPosition, topPosition, topStartPosition, bottomEndPosition, bottomPosition, bottomStartPosition],
1235
- 'bottom-start': [bottomStartPosition, bottomPosition, bottomEndPosition, topStartPosition, topPosition, topEndPosition],
1236
- 'bottom-end': [bottomEndPosition, bottomPosition, bottomStartPosition, topEndPosition, topPosition, topStartPosition],
1229
+ top: [topPosition$1, topStartPosition$1, topEndPosition$1, bottomPosition$1, bottomStartPosition$1, bottomEndPosition$1, leftPosition$1, rightPosition$1],
1230
+ bottom: [bottomPosition$1, bottomStartPosition$1, bottomEndPosition$1, topPosition$1, topStartPosition$1, topEndPosition$1, leftPosition$1, rightPosition$1],
1231
+ left: [leftPosition$1, rightPosition$1, topPosition$1, bottomPosition$1],
1232
+ right: [rightPosition$1, leftPosition$1, topPosition$1, bottomPosition$1],
1233
+ 'top-start': [topStartPosition$1, topPosition$1, topEndPosition$1, bottomStartPosition$1, bottomPosition$1, bottomEndPosition$1],
1234
+ 'top-end': [topEndPosition$1, topPosition$1, topStartPosition$1, bottomEndPosition$1, bottomPosition$1, bottomStartPosition$1],
1235
+ 'bottom-start': [bottomStartPosition$1, bottomPosition$1, bottomEndPosition$1, topStartPosition$1, topPosition$1, topEndPosition$1],
1236
+ 'bottom-end': [bottomEndPosition$1, bottomPosition$1, bottomStartPosition$1, topEndPosition$1, topPosition$1, topStartPosition$1],
1237
1237
  };
1238
1238
 
1239
1239
  class CdkTooltipDirective {
@@ -5665,7 +5665,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
5665
5665
  }]
5666
5666
  }] });
5667
5667
 
5668
- const maskConfigFunction$7 = () => {
5668
+ const maskConfigFunction$8 = () => {
5669
5669
  return {
5670
5670
  validation: false,
5671
5671
  };
@@ -5684,7 +5684,7 @@ InputTextareaModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", ver
5684
5684
  CharsLeftModule,
5685
5685
  ErrorMessageModule,
5686
5686
  SaveStateModule,
5687
- NgxMaskModule.forRoot(maskConfigFunction$7),
5687
+ NgxMaskModule.forRoot(maskConfigFunction$8),
5688
5688
  AutosizeModule
5689
5689
  ]] });
5690
5690
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputTextareaModule, decorators: [{
@@ -5697,7 +5697,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
5697
5697
  CharsLeftModule,
5698
5698
  ErrorMessageModule,
5699
5699
  SaveStateModule,
5700
- NgxMaskModule.forRoot(maskConfigFunction$7),
5700
+ NgxMaskModule.forRoot(maskConfigFunction$8),
5701
5701
  AutosizeModule
5702
5702
  ],
5703
5703
  exports: [InputTextareaComponent],
@@ -6014,7 +6014,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
6014
6014
  type: Output
6015
6015
  }] } });
6016
6016
 
6017
- const maskConfigFunction$6 = () => {
6017
+ const maskConfigFunction$7 = () => {
6018
6018
  return {
6019
6019
  validation: false,
6020
6020
  };
@@ -6035,7 +6035,7 @@ InputTextModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
6035
6035
  ErrorMessageModule,
6036
6036
  SaveStateModule,
6037
6037
  CdkTooltipModule,
6038
- NgxMaskModule.forRoot(maskConfigFunction$6)
6038
+ NgxMaskModule.forRoot(maskConfigFunction$7)
6039
6039
  ]] });
6040
6040
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputTextModule, decorators: [{
6041
6041
  type: NgModule,
@@ -6048,7 +6048,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
6048
6048
  ErrorMessageModule,
6049
6049
  SaveStateModule,
6050
6050
  CdkTooltipModule,
6051
- NgxMaskModule.forRoot(maskConfigFunction$6)
6051
+ NgxMaskModule.forRoot(maskConfigFunction$7)
6052
6052
  ],
6053
6053
  exports: [InputTextComponent],
6054
6054
  }]
@@ -8531,7 +8531,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8531
8531
  args: ['phoneInput']
8532
8532
  }] } });
8533
8533
 
8534
- const maskConfigFunction$5 = () => {
8534
+ const maskConfigFunction$6 = () => {
8535
8535
  return {
8536
8536
  validation: false,
8537
8537
  };
@@ -8552,7 +8552,7 @@ InputPhoneModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versio
8552
8552
  DropdownModule,
8553
8553
  SaveStateModule,
8554
8554
  ErrorMessageModule,
8555
- NgxMaskModule.forRoot(maskConfigFunction$5)
8555
+ NgxMaskModule.forRoot(maskConfigFunction$6)
8556
8556
  ]] });
8557
8557
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputPhoneModule, decorators: [{
8558
8558
  type: NgModule,
@@ -8566,7 +8566,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8566
8566
  DropdownModule,
8567
8567
  SaveStateModule,
8568
8568
  ErrorMessageModule,
8569
- NgxMaskModule.forRoot(maskConfigFunction$5)
8569
+ NgxMaskModule.forRoot(maskConfigFunction$6)
8570
8570
  ],
8571
8571
  exports: [InputPhoneComponent]
8572
8572
  }]
@@ -8742,7 +8742,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8742
8742
  type: Output
8743
8743
  }] } });
8744
8744
 
8745
- const maskConfigFunction$4 = () => {
8745
+ const maskConfigFunction$5 = () => {
8746
8746
  return {
8747
8747
  validation: false,
8748
8748
  };
@@ -8759,7 +8759,7 @@ InputSearchModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", versi
8759
8759
  FormsModule,
8760
8760
  CharsLeftModule,
8761
8761
  ErrorMessageModule,
8762
- NgxMaskModule.forRoot(maskConfigFunction$4),
8762
+ NgxMaskModule.forRoot(maskConfigFunction$5),
8763
8763
  SaveStateModule
8764
8764
  ]] });
8765
8765
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputSearchModule, decorators: [{
@@ -8771,19 +8771,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
8771
8771
  FormsModule,
8772
8772
  CharsLeftModule,
8773
8773
  ErrorMessageModule,
8774
- NgxMaskModule.forRoot(maskConfigFunction$4),
8774
+ NgxMaskModule.forRoot(maskConfigFunction$5),
8775
8775
  SaveStateModule
8776
8776
  ],
8777
8777
  exports: [InputSearchComponent],
8778
8778
  }]
8779
8779
  }] });
8780
8780
 
8781
- var InputDateSizesEnum$1;
8781
+ var InputDateSizesEnum$2;
8782
8782
  (function (InputDateSizesEnum) {
8783
8783
  InputDateSizesEnum["small"] = "mrx-input-date-sm";
8784
8784
  InputDateSizesEnum["medium"] = "mrx-input-date-md";
8785
8785
  InputDateSizesEnum["large"] = "mrx-input-date-lg";
8786
- })(InputDateSizesEnum$1 || (InputDateSizesEnum$1 = {}));
8786
+ })(InputDateSizesEnum$2 || (InputDateSizesEnum$2 = {}));
8787
8787
 
8788
8788
  dayjs.extend(customParseFormat);
8789
8789
  const validateDateModel$1 = (value) => {
@@ -8941,7 +8941,7 @@ const markPosition$2 = (start, end, pattern = 'date') => {
8941
8941
  }
8942
8942
  };
8943
8943
 
8944
- const cleanDate$2 = (value, format) => {
8944
+ const cleanDate$3 = (value, format) => {
8945
8945
  return dayjs(value).format(format);
8946
8946
  };
8947
8947
 
@@ -9097,7 +9097,7 @@ class InputDatepickerComponent {
9097
9097
  return `${this.dateModel.view}${this.timepicker && this.timeModel.view ? ' ' + this.timeModel.view : ''}`;
9098
9098
  }
9099
9099
  get getClasses() {
9100
- return `${InputDateSizesEnum$1[this.size]} ${this.customClasses} ${this.checkValidClasses}`;
9100
+ return `${InputDateSizesEnum$2[this.size]} ${this.customClasses} ${this.checkValidClasses}`;
9101
9101
  }
9102
9102
  get isValidModels() {
9103
9103
  return !this.dateModel.invalid && (this.timepicker ? !this.timeModel.invalid : true);
@@ -9197,7 +9197,7 @@ class InputDatepickerComponent {
9197
9197
  }
9198
9198
  writeValue(outsideValue) {
9199
9199
  if (outsideValue) {
9200
- this.value = cleanDate$2(outsideValue, this.format);
9200
+ this.value = cleanDate$3(outsideValue, this.format);
9201
9201
  this.dateModel = dateModelValueParse$1(outsideValue, this.format);
9202
9202
  this.timeModel = timeModelValueParse$2(outsideValue, this.format);
9203
9203
  if (!this.disableValidation) {
@@ -9299,7 +9299,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
9299
9299
  type: Output
9300
9300
  }] } });
9301
9301
 
9302
- const maskConfigFunction$3 = () => {
9302
+ const maskConfigFunction$4 = () => {
9303
9303
  return {
9304
9304
  validation: false,
9305
9305
  };
@@ -9318,7 +9318,7 @@ InputDatepickerModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", v
9318
9318
  SaveStateModule,
9319
9319
  ErrorMessageModule,
9320
9320
  LabelModule,
9321
- NgxMaskModule.forRoot(maskConfigFunction$3),
9321
+ NgxMaskModule.forRoot(maskConfigFunction$4),
9322
9322
  ]] });
9323
9323
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDatepickerModule, decorators: [{
9324
9324
  type: NgModule,
@@ -9330,13 +9330,725 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
9330
9330
  SaveStateModule,
9331
9331
  ErrorMessageModule,
9332
9332
  LabelModule,
9333
- NgxMaskModule.forRoot(maskConfigFunction$3),
9333
+ NgxMaskModule.forRoot(maskConfigFunction$4),
9334
9334
  ],
9335
9335
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
9336
9336
  exports: [InputDatepickerComponent],
9337
9337
  }]
9338
9338
  }] });
9339
9339
 
9340
+ function formatDate(date, format) {
9341
+ const pad = (n) => n.toString().padStart(2, '0');
9342
+ const map = {
9343
+ 'DD': pad(date.getDate()),
9344
+ 'MM': pad(date.getMonth() + 1),
9345
+ 'YYYY': date.getFullYear().toString()
9346
+ };
9347
+ return format.replace(/DD|MM|YYYY/g, match => map[match]);
9348
+ }
9349
+ function toOutputFormat(date) {
9350
+ const pad = (n) => n.toString().padStart(2, '0');
9351
+ return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;
9352
+ }
9353
+ function isValidDate(date) {
9354
+ return date instanceof Date && !isNaN(date.getTime());
9355
+ }
9356
+ function getDaysInMonth(year, month) {
9357
+ return new Date(year, month + 1, 0).getDate();
9358
+ }
9359
+ function isDateInRange(date, minDate, maxDate) {
9360
+ const min = minDate ? cleanDate$2(minDate) : null;
9361
+ const max = maxDate ? cleanDate$2(maxDate) : null;
9362
+ return (!min || date >= min) && (!max || date <= max);
9363
+ }
9364
+ function clampDate(date, minDate, maxDate) {
9365
+ const min = minDate ? cleanDate$2(minDate) : null;
9366
+ const max = maxDate ? cleanDate$2(maxDate) : null;
9367
+ if (min && date < min)
9368
+ return new Date(min);
9369
+ if (max && date > max)
9370
+ return new Date(max);
9371
+ return date;
9372
+ }
9373
+ function getRangeErrorMessage(date, minDate, maxDate) {
9374
+ const min = minDate ? cleanDate$2(minDate) : null;
9375
+ const max = maxDate ? cleanDate$2(maxDate) : null;
9376
+ if (min && date < min)
9377
+ return 'Дата меньше минимальной';
9378
+ if (max && date > max)
9379
+ return 'Дата больше максимальной';
9380
+ return '';
9381
+ }
9382
+ function parseInputDate(dateStr) {
9383
+ if (dateStr) {
9384
+ const [year, month, day] = dateStr.split('-').map(Number);
9385
+ const date = new Date(year, month - 1, day);
9386
+ return isValidDate(date) ? date : null;
9387
+ }
9388
+ else {
9389
+ return null;
9390
+ }
9391
+ }
9392
+ function adjustInvalidDate(year, month, day) {
9393
+ const maxDays = getDaysInMonth(year, month);
9394
+ if (day > maxDays) {
9395
+ month += 1;
9396
+ if (month > 11) {
9397
+ month = 0;
9398
+ year += 1;
9399
+ }
9400
+ day = 1;
9401
+ }
9402
+ year = Math.min(Math.max(year, 1900), 9999);
9403
+ month = Math.min(Math.max(month, 0), 11);
9404
+ return { year, month, day };
9405
+ }
9406
+ const cleanDate$2 = (date) => {
9407
+ return new Date(new Date(date).setHours(0, 0, 0, 0));
9408
+ };
9409
+
9410
+ class DateCalendarComponent {
9411
+ constructor(_detector) {
9412
+ this._detector = _detector;
9413
+ this.selectedDate = null;
9414
+ this.dateSelected = new EventEmitter();
9415
+ this.close = new EventEmitter();
9416
+ this.currentMonth = new Date().getMonth();
9417
+ this.currentYear = new Date().getFullYear();
9418
+ this.view = 'days';
9419
+ this.monthNames = [
9420
+ 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь',
9421
+ 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь'
9422
+ ];
9423
+ this.daysOfWeek = ['ПН', 'ВТ', 'СР', 'ЧТ', 'ПТ', 'СБ', 'ВС'];
9424
+ this.months = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11];
9425
+ this._minDate = null;
9426
+ this._maxDate = null;
9427
+ this._minDateStr = null;
9428
+ this._maxDateStr = null;
9429
+ this.calendarDaysCache = null;
9430
+ }
9431
+ ngOnInit() {
9432
+ if (this.selectedDate) {
9433
+ this.currentMonth = this.selectedDate.getMonth();
9434
+ this.currentYear = this.selectedDate.getFullYear();
9435
+ }
9436
+ this.updateDateBounds();
9437
+ }
9438
+ set minDate(value) {
9439
+ if (this._minDateStr !== value) {
9440
+ this._minDateStr = value;
9441
+ this.updateDateBounds();
9442
+ this._detector.markForCheck();
9443
+ }
9444
+ }
9445
+ get minDate() {
9446
+ return this._minDateStr;
9447
+ }
9448
+ set maxDate(value) {
9449
+ if (this._maxDateStr !== value) {
9450
+ this._maxDateStr = value;
9451
+ this.updateDateBounds();
9452
+ this._detector.markForCheck();
9453
+ }
9454
+ }
9455
+ get maxDate() {
9456
+ return this._maxDateStr;
9457
+ }
9458
+ updateDateBounds() {
9459
+ this._minDate = this._minDateStr ? cleanDate$2(this._minDateStr) : null;
9460
+ this._maxDate = this._maxDateStr ? cleanDate$2(this._maxDateStr) : null;
9461
+ }
9462
+ get headerText() {
9463
+ switch (this.view) {
9464
+ case 'days':
9465
+ return `${this.monthNames[this.currentMonth]} ${this.currentYear}`;
9466
+ case 'months':
9467
+ return `${this.currentYear}`;
9468
+ default:
9469
+ return 'Выберите год';
9470
+ }
9471
+ }
9472
+ switchView() {
9473
+ this.view = this.view === 'days' ? 'months' : this.view === 'months' ? 'years' : 'days';
9474
+ this._detector.markForCheck();
9475
+ }
9476
+ getCalendarDays() {
9477
+ if (this.calendarDaysCache?.month === this.currentMonth && this.calendarDaysCache?.year === this.currentYear) {
9478
+ return this.calendarDaysCache.days;
9479
+ }
9480
+ const daysInMonth = new Date(this.currentYear, this.currentMonth + 1, 0).getDate();
9481
+ const prevMonthDays = new Date(this.currentYear, this.currentMonth, 0).getDate();
9482
+ const days = [];
9483
+ const prevDaysCount = 2;
9484
+ const prevMonth = this.currentMonth === 0 ? 11 : this.currentMonth - 1;
9485
+ const prevYear = this.currentMonth === 0 ? this.currentYear - 1 : this.currentYear;
9486
+ const nextMonth = this.currentMonth === 11 ? 0 : this.currentMonth + 1;
9487
+ const nextYear = this.currentMonth === 11 ? this.currentYear + 1 : this.currentYear;
9488
+ for (let i = 0; i < prevDaysCount; i++) {
9489
+ days.push({ day: prevMonthDays - prevDaysCount + 1 + i, month: prevMonth, year: prevYear });
9490
+ }
9491
+ for (let i = 1; i <= daysInMonth; i++) {
9492
+ days.push({ day: i, month: this.currentMonth, year: this.currentYear });
9493
+ }
9494
+ const remainingDays = 35 - days.length;
9495
+ for (let i = 1; i <= remainingDays; i++) {
9496
+ days.push({ day: i, month: nextMonth, year: nextYear });
9497
+ }
9498
+ this.calendarDaysCache = { month: this.currentMonth, year: this.currentYear, days };
9499
+ return days;
9500
+ }
9501
+ getYears() {
9502
+ const centerYear = this.selectedDate?.getFullYear() ?? this.currentYear;
9503
+ const startYear = centerYear - 5;
9504
+ return Array.from({ length: 12 }, (_, i) => startYear + i);
9505
+ }
9506
+ isSelected(day) {
9507
+ if (!this.selectedDate)
9508
+ return false;
9509
+ return (day.day === this.selectedDate.getDate() &&
9510
+ day.month === this.selectedDate.getMonth() &&
9511
+ day.year === this.selectedDate.getFullYear());
9512
+ }
9513
+ isMonthSelected(month) {
9514
+ return this.selectedDate?.getMonth() === month && this.selectedDate?.getFullYear() === this.currentYear;
9515
+ }
9516
+ isYearSelected(year) {
9517
+ return this.selectedDate?.getFullYear() === year;
9518
+ }
9519
+ isDateEnabled(day) {
9520
+ const date = new Date(day.year, day.month, day.day);
9521
+ return ((!this._minDate || date >= this._minDate) &&
9522
+ (!this._maxDate || date <= this._maxDate));
9523
+ }
9524
+ isMonthDisabled(month) {
9525
+ if (!this._minDate && !this._maxDate)
9526
+ return false;
9527
+ const startOfMonth = new Date(this.currentYear, month, 1);
9528
+ const endOfMonth = new Date(this.currentYear, month + 1, 0);
9529
+ return ((!!this._minDate && !isNaN(this._minDate.getTime()) && endOfMonth < this._minDate) ||
9530
+ (!!this._maxDate && !isNaN(this._maxDate.getTime()) && startOfMonth > this._maxDate));
9531
+ }
9532
+ isYearDisabled(year) {
9533
+ if (!this._minDate && !this._maxDate)
9534
+ return false;
9535
+ const minYear = this._minDate && !isNaN(this._minDate.getTime()) ? this._minDate.getFullYear() : null;
9536
+ const maxYear = this._maxDate && !isNaN(this._maxDate.getTime()) ? this._maxDate.getFullYear() : null;
9537
+ return (minYear !== null && year < minYear) || (maxYear !== null && year > maxYear);
9538
+ }
9539
+ selectDate(day) {
9540
+ if (!this.isDateEnabled(day))
9541
+ return;
9542
+ const date = new Date(day.year, day.month, day.day);
9543
+ this.dateSelected.emit(date);
9544
+ const needsUpdate = day.month !== this.currentMonth || day.year !== this.currentYear;
9545
+ if (needsUpdate) {
9546
+ setTimeout(() => {
9547
+ this.currentMonth = day.month;
9548
+ this.currentYear = day.year;
9549
+ this._detector.markForCheck();
9550
+ });
9551
+ }
9552
+ }
9553
+ selectMonth(month) {
9554
+ if (this.isMonthDisabled(month))
9555
+ return;
9556
+ setTimeout(() => {
9557
+ this.currentMonth = month;
9558
+ this.view = 'days';
9559
+ this._detector.markForCheck();
9560
+ });
9561
+ }
9562
+ selectYear(year) {
9563
+ if (this.isYearDisabled(year))
9564
+ return;
9565
+ setTimeout(() => {
9566
+ this.currentYear = year;
9567
+ this.view = 'months';
9568
+ this._detector.markForCheck();
9569
+ });
9570
+ }
9571
+ changeMonth(offset) {
9572
+ let newMonth = this.currentMonth + offset;
9573
+ let newYear = this.currentYear;
9574
+ if (newMonth < 0) {
9575
+ newMonth = 11;
9576
+ newYear--;
9577
+ }
9578
+ else if (newMonth > 11) {
9579
+ newMonth = 0;
9580
+ newYear++;
9581
+ }
9582
+ this.currentMonth = newMonth;
9583
+ this.currentYear = newYear;
9584
+ this._detector.markForCheck();
9585
+ }
9586
+ changeYearRange(offset) {
9587
+ this.currentYear += offset * 12;
9588
+ this._detector.markForCheck();
9589
+ }
9590
+ isPreviousMonthDisabled() {
9591
+ if (!this._minDate)
9592
+ return false;
9593
+ return new Date(this.currentYear, this.currentMonth, 0) < this._minDate;
9594
+ }
9595
+ isNextMonthDisabled() {
9596
+ if (!this._maxDate)
9597
+ return false;
9598
+ return new Date(this.currentYear, this.currentMonth + 1, 1) > this._maxDate;
9599
+ }
9600
+ isPreviousYearRangeDisabled() {
9601
+ if (!this._minDate)
9602
+ return false;
9603
+ return this.getYears()[0] <= this._minDate.getFullYear();
9604
+ }
9605
+ isNextYearRangeDisabled() {
9606
+ if (!this._maxDate)
9607
+ return false;
9608
+ return this.getYears()[this.getYears().length - 1] >= this._maxDate.getFullYear();
9609
+ }
9610
+ }
9611
+ DateCalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateCalendarComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
9612
+ DateCalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: DateCalendarComponent, selector: "mrx-date-calendar", inputs: { selectedDate: "selectedDate", minDate: "minDate", maxDate: "maxDate" }, outputs: { dateSelected: "dateSelected", close: "close" }, ngImport: i0, template: "<div class=\"mrx-calendar\">\r\n <div class=\"mrx-calendar-header\">\r\n <button\r\n *ngIf=\"view === 'days'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isPreviousMonthDisabled()\"\r\n (click)=\"changeMonth(-1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-left icon-font-16\"></span>\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'years'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isPreviousYearRangeDisabled()\"\r\n (click)=\"changeYearRange(-1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-left icon-font-16\"></span>\r\n </button>\r\n\r\n <button class=\"mrx-calendar-header__button\" (click)=\"switchView()\">\r\n {{ headerText }}\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'days'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isNextMonthDisabled()\"\r\n (click)=\"changeMonth(1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-right icon-font-16\"></span>\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'years'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isNextYearRangeDisabled()\"\r\n (click)=\"changeYearRange(1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-right icon-font-16\"></span>\r\n </button>\r\n </div>\r\n\r\n <div class=\"mrx-calendar-body\">\r\n <ng-container [ngSwitch]=\"view\">\r\n <ng-container *ngSwitchCase=\"'years'\">\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--years\">\r\n <div\r\n *ngFor=\"let year of getYears()\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--year\"\r\n [class.selected]=\"isYearSelected(year)\"\r\n [class.disabled]=\"isYearDisabled(year)\"\r\n [class.hoverable]=\"!isYearDisabled(year)\"\r\n (click)=\"selectYear(year)\"\r\n >\r\n {{ year }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'months'\">\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--months\">\r\n <div\r\n *ngFor=\"let month of months\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--month\"\r\n [class.selected]=\"isMonthSelected(month)\"\r\n [class.disabled]=\"isMonthDisabled(month)\"\r\n [class.hoverable]=\"!isMonthDisabled(month)\"\r\n (click)=\"selectMonth(month)\"\r\n >\r\n {{ monthNames[month] }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--days\">\r\n <div *ngFor=\"let day of daysOfWeek\" class=\"mrx-calendar-body__grid__label\">\r\n {{ day }}\r\n </div>\r\n\r\n <div\r\n *ngFor=\"let day of getCalendarDays()\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--day\"\r\n [class.selected]=\"isSelected(day)\"\r\n [class.other-month]=\"day.month !== currentMonth\"\r\n [class.disabled]=\"!isDateEnabled(day)\"\r\n [class.hoverable]=\"isDateEnabled(day)\"\r\n (click)=\"selectDate(day)\"\r\n >\r\n {{ day.day }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: [".mrx-calendar{width:272px;border-radius:4px;background-color:var(--brand-bg-tertiary-default, #FFF);box-shadow:0 1px 4px #3a3a3a4d}.mrx-calendar-header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--neutral-bg-divider, #DBDFE5)}.mrx-calendar-header__button{border:none;border-radius:4px;background-color:transparent;padding:6px 12px;text-align:center;flex-grow:1;font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);color:var(--neutral-text-primary, #262626);cursor:pointer;transition:background-color .3s}.mrx-calendar-header__button:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-header__chevron{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border:none;border-radius:4px;background-color:transparent;cursor:pointer;transition:background-color .3s}.mrx-calendar-header__chevron:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-header__chevron:disabled{cursor:default}.mrx-calendar-header__chevron:disabled:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}.mrx-calendar-body{padding:8px 12px}.mrx-calendar-body__grid--days{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:4px;gap:4px;text-align:center}.mrx-calendar-body__grid--months{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px;text-align:center}.mrx-calendar-body__grid--years{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px;text-align:center;max-height:190px;overflow-y:auto}.mrx-calendar-body__grid__label{display:flex;justify-content:center;align-items:center;width:32px;height:32px;font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);color:var(--brand-text-accent, #003780)}.mrx-calendar-body__grid__item{display:flex;justify-content:center;align-items:center;border-radius:4px;font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);color:var(--neutral-text-primary, #262626);transition:background-color .3s}.mrx-calendar-body__grid__item--day{width:32px;height:32px}.mrx-calendar-body__grid__item--month,.mrx-calendar-body__grid__item--year{height:32px}.mrx-calendar-body__grid__item.hoverable{cursor:pointer}.mrx-calendar-body__grid__item.hoverable:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-body__grid__item.selected{background-color:var(--brand-bg-primary-default, #2A6AB8);color:var(--neutral-text-inverse, #FFF)}.mrx-calendar-body__grid__item.selected:hover{background-color:var(--brand-bg-primary-hover, #0F54AA)}.mrx-calendar-body__grid__item.other-month{background-color:transparent;color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.other-month.selected{background-color:var(--brand-bg-secondary-default, #EDF5FF);color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.other-month.selected:hover{background-color:var(--brand-bg-secondary-hover, #BED6F1)}.mrx-calendar-body__grid__item.other-month:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}.mrx-calendar-body__grid__item.disabled{background-color:transparent;color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.disabled:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgSwitch, selector: "[ngSwitch]", inputs: ["ngSwitch"] }, { type: i1$1.NgSwitchCase, selector: "[ngSwitchCase]", inputs: ["ngSwitchCase"] }, { type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i1$1.NgSwitchDefault, selector: "[ngSwitchDefault]" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
9613
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: DateCalendarComponent, decorators: [{
9614
+ type: Component,
9615
+ args: [{ selector: 'mrx-date-calendar', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mrx-calendar\">\r\n <div class=\"mrx-calendar-header\">\r\n <button\r\n *ngIf=\"view === 'days'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isPreviousMonthDisabled()\"\r\n (click)=\"changeMonth(-1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-left icon-font-16\"></span>\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'years'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isPreviousYearRangeDisabled()\"\r\n (click)=\"changeYearRange(-1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-left icon-font-16\"></span>\r\n </button>\r\n\r\n <button class=\"mrx-calendar-header__button\" (click)=\"switchView()\">\r\n {{ headerText }}\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'days'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isNextMonthDisabled()\"\r\n (click)=\"changeMonth(1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-right icon-font-16\"></span>\r\n </button>\r\n\r\n <button\r\n *ngIf=\"view === 'years'\"\r\n class=\"mrx-calendar-header__chevron\"\r\n [disabled]=\"isNextYearRangeDisabled()\"\r\n (click)=\"changeYearRange(1)\"\r\n >\r\n <span class=\"mrx-icon icon-chevron-right icon-font-16\"></span>\r\n </button>\r\n </div>\r\n\r\n <div class=\"mrx-calendar-body\">\r\n <ng-container [ngSwitch]=\"view\">\r\n <ng-container *ngSwitchCase=\"'years'\">\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--years\">\r\n <div\r\n *ngFor=\"let year of getYears()\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--year\"\r\n [class.selected]=\"isYearSelected(year)\"\r\n [class.disabled]=\"isYearDisabled(year)\"\r\n [class.hoverable]=\"!isYearDisabled(year)\"\r\n (click)=\"selectYear(year)\"\r\n >\r\n {{ year }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchCase=\"'months'\">\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--months\">\r\n <div\r\n *ngFor=\"let month of months\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--month\"\r\n [class.selected]=\"isMonthSelected(month)\"\r\n [class.disabled]=\"isMonthDisabled(month)\"\r\n [class.hoverable]=\"!isMonthDisabled(month)\"\r\n (click)=\"selectMonth(month)\"\r\n >\r\n {{ monthNames[month] }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngSwitchDefault>\r\n <div class=\"mrx-calendar-body__grid mrx-calendar-body__grid--days\">\r\n <div *ngFor=\"let day of daysOfWeek\" class=\"mrx-calendar-body__grid__label\">\r\n {{ day }}\r\n </div>\r\n\r\n <div\r\n *ngFor=\"let day of getCalendarDays()\"\r\n class=\"mrx-calendar-body__grid__item mrx-calendar-body__grid__item--day\"\r\n [class.selected]=\"isSelected(day)\"\r\n [class.other-month]=\"day.month !== currentMonth\"\r\n [class.disabled]=\"!isDateEnabled(day)\"\r\n [class.hoverable]=\"isDateEnabled(day)\"\r\n (click)=\"selectDate(day)\"\r\n >\r\n {{ day.day }}\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </div>\r\n</div>\r\n", styles: [".mrx-calendar{width:272px;border-radius:4px;background-color:var(--brand-bg-tertiary-default, #FFF);box-shadow:0 1px 4px #3a3a3a4d}.mrx-calendar-header{display:flex;justify-content:space-between;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--neutral-bg-divider, #DBDFE5)}.mrx-calendar-header__button{border:none;border-radius:4px;background-color:transparent;padding:6px 12px;text-align:center;flex-grow:1;font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);color:var(--neutral-text-primary, #262626);cursor:pointer;transition:background-color .3s}.mrx-calendar-header__button:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-header__chevron{display:flex;justify-content:center;align-items:center;width:32px;height:32px;border:none;border-radius:4px;background-color:transparent;cursor:pointer;transition:background-color .3s}.mrx-calendar-header__chevron:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-header__chevron:disabled{cursor:default}.mrx-calendar-header__chevron:disabled:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}.mrx-calendar-body{padding:8px 12px}.mrx-calendar-body__grid--days{display:grid;grid-template-columns:repeat(7,1fr);grid-gap:4px;gap:4px;text-align:center}.mrx-calendar-body__grid--months{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px;text-align:center}.mrx-calendar-body__grid--years{display:grid;grid-template-columns:repeat(3,1fr);grid-gap:8px;gap:8px;text-align:center;max-height:190px;overflow-y:auto}.mrx-calendar-body__grid__label{display:flex;justify-content:center;align-items:center;width:32px;height:32px;font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height);color:var(--brand-text-accent, #003780)}.mrx-calendar-body__grid__item{display:flex;justify-content:center;align-items:center;border-radius:4px;font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height);color:var(--neutral-text-primary, #262626);transition:background-color .3s}.mrx-calendar-body__grid__item--day{width:32px;height:32px}.mrx-calendar-body__grid__item--month,.mrx-calendar-body__grid__item--year{height:32px}.mrx-calendar-body__grid__item.hoverable{cursor:pointer}.mrx-calendar-body__grid__item.hoverable:hover{background-color:var(--brand-bg-tertiary-hover, #EDF5FF)}.mrx-calendar-body__grid__item.selected{background-color:var(--brand-bg-primary-default, #2A6AB8);color:var(--neutral-text-inverse, #FFF)}.mrx-calendar-body__grid__item.selected:hover{background-color:var(--brand-bg-primary-hover, #0F54AA)}.mrx-calendar-body__grid__item.other-month{background-color:transparent;color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.other-month.selected{background-color:var(--brand-bg-secondary-default, #EDF5FF);color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.other-month.selected:hover{background-color:var(--brand-bg-secondary-hover, #BED6F1)}.mrx-calendar-body__grid__item.other-month:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}.mrx-calendar-body__grid__item.disabled{background-color:transparent;color:var(--neutral-text-tertiary, #71767E)}.mrx-calendar-body__grid__item.disabled:hover{background-color:var(--neutral-bg-island-default, #F8F9FA)}\n"] }]
9616
+ }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { selectedDate: [{
9617
+ type: Input
9618
+ }], dateSelected: [{
9619
+ type: Output
9620
+ }], close: [{
9621
+ type: Output
9622
+ }], minDate: [{
9623
+ type: Input
9624
+ }], maxDate: [{
9625
+ type: Input
9626
+ }] } });
9627
+
9628
+ var InputDateSizesEnum$1;
9629
+ (function (InputDateSizesEnum) {
9630
+ InputDateSizesEnum["small"] = "mrx-input-date-sm";
9631
+ InputDateSizesEnum["medium"] = "mrx-input-date-md";
9632
+ InputDateSizesEnum["large"] = "mrx-input-date-lg";
9633
+ })(InputDateSizesEnum$1 || (InputDateSizesEnum$1 = {}));
9634
+
9635
+ const topPosition = {
9636
+ originX: 'center',
9637
+ originY: 'top',
9638
+ overlayX: 'center',
9639
+ overlayY: 'bottom',
9640
+ panelClass: 'top',
9641
+ };
9642
+ const bottomPosition = {
9643
+ originX: 'center',
9644
+ originY: 'bottom',
9645
+ overlayX: 'center',
9646
+ overlayY: 'top',
9647
+ panelClass: 'bottom',
9648
+ };
9649
+ const leftPosition = {
9650
+ originX: 'start',
9651
+ originY: 'center',
9652
+ overlayX: 'end',
9653
+ overlayY: 'center',
9654
+ panelClass: 'start',
9655
+ };
9656
+ const rightPosition = {
9657
+ originX: 'end',
9658
+ originY: 'center',
9659
+ overlayX: 'start',
9660
+ overlayY: 'center',
9661
+ panelClass: 'end',
9662
+ };
9663
+ const topStartPosition = {
9664
+ originX: 'start',
9665
+ originY: 'top',
9666
+ overlayX: 'start',
9667
+ overlayY: 'bottom',
9668
+ panelClass: 'top-start',
9669
+ };
9670
+ const topEndPosition = {
9671
+ originX: 'end',
9672
+ originY: 'top',
9673
+ overlayX: 'end',
9674
+ overlayY: 'bottom',
9675
+ panelClass: 'top-end',
9676
+ };
9677
+ const bottomStartPosition = {
9678
+ originX: 'start',
9679
+ originY: 'bottom',
9680
+ overlayX: 'start',
9681
+ overlayY: 'top',
9682
+ panelClass: 'bottom-start',
9683
+ };
9684
+ const bottomEndPosition = {
9685
+ originX: 'end',
9686
+ originY: 'bottom',
9687
+ overlayX: 'end',
9688
+ overlayY: 'top',
9689
+ panelClass: 'bottom-end',
9690
+ };
9691
+ var PositionEnum;
9692
+ (function (PositionEnum) {
9693
+ PositionEnum["Top"] = "top";
9694
+ PositionEnum["Bottom"] = "bottom";
9695
+ PositionEnum["Left"] = "left";
9696
+ PositionEnum["Right"] = "right";
9697
+ PositionEnum["TopStart"] = "top-start";
9698
+ PositionEnum["TopEnd"] = "top-end";
9699
+ PositionEnum["BottomStart"] = "bottom-start";
9700
+ PositionEnum["BottomEnd"] = "bottom-end";
9701
+ })(PositionEnum || (PositionEnum = {}));
9702
+ const PositionStrategyEnum = {
9703
+ [PositionEnum.Top]: [topPosition, bottomPosition, leftPosition, rightPosition],
9704
+ [PositionEnum.Bottom]: [bottomPosition, topPosition, leftPosition, rightPosition],
9705
+ [PositionEnum.Left]: [leftPosition, rightPosition, topPosition, bottomPosition],
9706
+ [PositionEnum.Right]: [rightPosition, leftPosition, topPosition, bottomPosition],
9707
+ [PositionEnum.TopStart]: [topStartPosition, topPosition, bottomStartPosition, bottomPosition],
9708
+ [PositionEnum.TopEnd]: [topEndPosition, topPosition, bottomEndPosition, bottomPosition],
9709
+ [PositionEnum.BottomStart]: [bottomStartPosition, bottomPosition, topStartPosition, topPosition],
9710
+ [PositionEnum.BottomEnd]: [bottomEndPosition, bottomPosition, topEndPosition, topPosition],
9711
+ };
9712
+
9713
+ class InputDateComponent {
9714
+ constructor(_overlay, _detector, _elementRef) {
9715
+ this._overlay = _overlay;
9716
+ this._detector = _detector;
9717
+ this._elementRef = _elementRef;
9718
+ this._overlayRef = null;
9719
+ this.displayValue = '';
9720
+ this.selectedDate = null;
9721
+ this.mask = '';
9722
+ this.errorMessage = null;
9723
+ // SAVE STATE
9724
+ this.uuid = v4();
9725
+ this.fields = [];
9726
+ this.format = 'DD.MM.YYYY';
9727
+ this.minDate = null;
9728
+ this.maxDate = null;
9729
+ this.isSilentValidation = true;
9730
+ this.isManualInput = true;
9731
+ this.closeAfterSelect = true;
9732
+ this.required = false;
9733
+ this.size = 'large';
9734
+ this.customClasses = '';
9735
+ this.disabled = false;
9736
+ this.readonly = false;
9737
+ this.placeholder = 'дд.мм.гггг';
9738
+ this.popupPosition = 'bottom-start';
9739
+ this.invalid = false;
9740
+ this.invalidMessage = '';
9741
+ this.checkInvalid = null;
9742
+ this.changed = new EventEmitter();
9743
+ this.modelChange = new EventEmitter();
9744
+ this.blurred = new EventEmitter();
9745
+ this.onChange = () => { };
9746
+ this.onTouched = () => { };
9747
+ }
9748
+ ngOnInit() {
9749
+ this.mask = this.format.replace(/[DMY]/g, '0');
9750
+ }
9751
+ ngOnDestroy() {
9752
+ this._clickSubscription?.unsubscribe();
9753
+ this.closeCalendar();
9754
+ }
9755
+ get checkValidClasses() {
9756
+ if (!this.required) {
9757
+ return '';
9758
+ }
9759
+ else {
9760
+ return this.checkInvalid === false ? 'mrx-input-checked-success' : this.checkInvalid === true ? 'mrx-input-checked-error' : '';
9761
+ }
9762
+ }
9763
+ get getClasses() {
9764
+ return `${InputDateSizesEnum$1[this.size]} ${this.customClasses} ${this.checkValidClasses}`;
9765
+ }
9766
+ get isViewCleanIcon() {
9767
+ return !!this.dateInput?.nativeElement.value;
9768
+ }
9769
+ writeValue(value) {
9770
+ const date = parseInputDate(value);
9771
+ if (date && isDateInRange(date, this.minDate, this.maxDate)) {
9772
+ this.selectedDate = date;
9773
+ this.displayValue = formatDate(date, this.format);
9774
+ this.errorMessage = null;
9775
+ }
9776
+ else if (this.isSilentValidation && date) {
9777
+ const clampedDate = clampDate(date, this.minDate, this.maxDate);
9778
+ this.selectedDate = clampedDate;
9779
+ this.displayValue = formatDate(clampedDate, this.format);
9780
+ this.errorMessage = null;
9781
+ }
9782
+ else {
9783
+ this.selectedDate = null;
9784
+ this.displayValue = date ? formatDate(date, this.format) : '';
9785
+ this.errorMessage = date ? getRangeErrorMessage(date, this.minDate, this.maxDate) : null;
9786
+ }
9787
+ this._detector.markForCheck();
9788
+ }
9789
+ registerOnChange(fn) {
9790
+ this.onChange = fn;
9791
+ }
9792
+ registerOnTouched(fn) {
9793
+ this.onTouched = fn;
9794
+ }
9795
+ setDisabledState(isDisabled) {
9796
+ this.disabled = isDisabled;
9797
+ this._detector.markForCheck();
9798
+ }
9799
+ set value(value) {
9800
+ const date = parseInputDate(value);
9801
+ if (date && isDateInRange(date, this.minDate, this.maxDate)) {
9802
+ this.selectedDate = date;
9803
+ this.displayValue = formatDate(date, this.format);
9804
+ this.errorMessage = null;
9805
+ this.updateValue(value);
9806
+ }
9807
+ else if (this.isSilentValidation && date) {
9808
+ const clampedDate = clampDate(date, this.minDate, this.maxDate);
9809
+ this.selectedDate = clampedDate;
9810
+ this.displayValue = formatDate(clampedDate, this.format);
9811
+ this.errorMessage = null;
9812
+ const clampedValue = toOutputFormat(clampedDate);
9813
+ this.updateValue(clampedValue);
9814
+ }
9815
+ else {
9816
+ this.selectedDate = null;
9817
+ this.displayValue = date ? formatDate(date, this.format) : '';
9818
+ this.errorMessage = date ? getRangeErrorMessage(date, this.minDate, this.maxDate) : null;
9819
+ }
9820
+ this._detector.markForCheck();
9821
+ }
9822
+ onInput(event) {
9823
+ const inputElement = event.target;
9824
+ const inputValue = inputElement.value;
9825
+ this.processInput(inputValue);
9826
+ }
9827
+ processInput(inputValue) {
9828
+ this.displayValue = inputValue;
9829
+ this.errorMessage = null;
9830
+ if (inputValue.length === this.format.length) {
9831
+ const separator = this.format.match(/[^DMY]/)?.[0] || '.';
9832
+ const regex = new RegExp(`^(\\d{2})${separator}(\\d{2})${separator}(\\d{4})$`);
9833
+ const match = inputValue.match(regex);
9834
+ if (!match)
9835
+ return;
9836
+ let day, month, year;
9837
+ if (this.format.startsWith('DD')) {
9838
+ [day, month, year] = [match[1], match[2], match[3]].map(Number);
9839
+ }
9840
+ else if (this.format.startsWith('MM')) {
9841
+ [month, day, year] = [match[1], match[2], match[3]].map(Number);
9842
+ }
9843
+ else {
9844
+ [year, month, day] = [match[1], match[2], match[3]].map(Number);
9845
+ }
9846
+ month -= 1;
9847
+ let date = new Date(year, month, day);
9848
+ if (isValidDate(date) && isDateInRange(date, this.minDate, this.maxDate)) {
9849
+ this.selectedDate = date;
9850
+ this.updateValue(toOutputFormat(date));
9851
+ }
9852
+ else {
9853
+ const { year: adjYear, month: adjMonth, day: adjDay } = adjustInvalidDate(year, month, day);
9854
+ date = new Date(adjYear, adjMonth, adjDay);
9855
+ if (isDateInRange(date, this.minDate, this.maxDate)) {
9856
+ this.selectedDate = date;
9857
+ this.displayValue = formatDate(date, this.format);
9858
+ this.updateValue(toOutputFormat(date));
9859
+ }
9860
+ else if (this.isSilentValidation) {
9861
+ const clampedDate = clampDate(date, this.minDate, this.maxDate);
9862
+ this.selectedDate = clampedDate;
9863
+ this.displayValue = formatDate(clampedDate, this.format);
9864
+ this.updateValue(toOutputFormat(clampedDate));
9865
+ }
9866
+ else {
9867
+ this.selectedDate = null;
9868
+ this.errorMessage = getRangeErrorMessage(date, this.minDate, this.maxDate);
9869
+ }
9870
+ }
9871
+ }
9872
+ this._detector.markForCheck();
9873
+ }
9874
+ onBlur() {
9875
+ this.onTouched();
9876
+ if (this.displayValue.length > 0 && this.displayValue.length < this.format.length) {
9877
+ this.displayValue = '';
9878
+ this.selectedDate = null;
9879
+ this.updateValue('');
9880
+ this.errorMessage = null;
9881
+ }
9882
+ this._detector.markForCheck();
9883
+ }
9884
+ openCalendar() {
9885
+ if (this.disabled || this._overlayRef)
9886
+ return;
9887
+ const positionStrategy = this._overlay
9888
+ .position()
9889
+ .flexibleConnectedTo(this.dateInput)
9890
+ .withPositions(PositionStrategyEnum[this.popupPosition]);
9891
+ this._overlayRef = this._overlay.create({
9892
+ positionStrategy,
9893
+ hasBackdrop: false
9894
+ });
9895
+ const portal = new ComponentPortal(DateCalendarComponent);
9896
+ const componentRef = this._overlayRef.attach(portal);
9897
+ componentRef.instance.selectedDate = this.selectedDate;
9898
+ componentRef.instance.minDate = this.minDate;
9899
+ componentRef.instance.maxDate = this.maxDate;
9900
+ componentRef.instance.dateSelected.subscribe((date) => this.onDateSelected(date));
9901
+ componentRef.instance.close.subscribe(() => this.closeCalendar());
9902
+ this._clickSubscription = fromEvent(document, 'click')
9903
+ .pipe(filter((event) => {
9904
+ const clickTarget = event.target;
9905
+ return (!!this._overlayRef &&
9906
+ !this._overlayRef.overlayElement.contains(clickTarget) &&
9907
+ !this._elementRef.nativeElement.contains(clickTarget));
9908
+ }))
9909
+ .subscribe(() => this.closeCalendar());
9910
+ }
9911
+ onDateSelected(date) {
9912
+ const clampedDate = clampDate(date, this.minDate, this.maxDate);
9913
+ this.selectedDate = clampedDate;
9914
+ this.displayValue = formatDate(clampedDate, this.format);
9915
+ this.errorMessage = null;
9916
+ this.updateValue(toOutputFormat(clampedDate));
9917
+ if (this.closeAfterSelect) {
9918
+ this.closeCalendar();
9919
+ }
9920
+ this._detector.markForCheck();
9921
+ }
9922
+ closeCalendar() {
9923
+ if (this._overlayRef) {
9924
+ this._overlayRef.dispose();
9925
+ this._overlayRef = null;
9926
+ }
9927
+ this.errorMessage = null;
9928
+ }
9929
+ clickToIconCalendar() {
9930
+ this.openCalendar();
9931
+ }
9932
+ clickToIconClear() {
9933
+ this.displayValue = '';
9934
+ this.selectedDate = null;
9935
+ this.errorMessage = null;
9936
+ this.updateValue('');
9937
+ this.closeCalendar();
9938
+ this._detector.markForCheck();
9939
+ }
9940
+ updateValue(insideValue) {
9941
+ this.changed.emit(insideValue);
9942
+ this.modelChange.emit({ value: insideValue, id: this.uuid });
9943
+ this.onChange(insideValue);
9944
+ this.onTouched();
9945
+ }
9946
+ }
9947
+ InputDateComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateComponent, deps: [{ token: i1$2.Overlay }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
9948
+ InputDateComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.4.0", type: InputDateComponent, selector: "mrx-input-date", inputs: { fields: "fields", format: "format", minDate: "minDate", maxDate: "maxDate", isSilentValidation: "isSilentValidation", isManualInput: "isManualInput", closeAfterSelect: "closeAfterSelect", required: "required", size: "size", customClasses: "customClasses", disabled: "disabled", readonly: "readonly", placeholder: "placeholder", popupPosition: "popupPosition", invalid: "invalid", invalidMessage: "invalidMessage", checkInvalid: "checkInvalid" }, outputs: { changed: "changed", modelChange: "modelChange", blurred: "blurred" }, providers: [
9949
+ {
9950
+ provide: NG_VALUE_ACCESSOR,
9951
+ useExisting: forwardRef(() => InputDateComponent),
9952
+ multi: true
9953
+ }
9954
+ ], viewQueries: [{ propertyName: "dateInput", first: true, predicate: ["dateInput"], descendants: true }], ngImport: i0, template: "<div\r\n class=\"mrx-input-date\"\r\n [class.mrx-input-error]=\"invalid\"\r\n [class.mrx-input-readonly]=\"readonly\"\r\n [class]=\"getClasses\"\r\n>\r\n <div class=\"mrx-input-date__wrapper\">\r\n <input\r\n #dateInput\r\n type=\"text\"\r\n autocomplete=\"nope\"\r\n class=\"mrx-input-date__input mrx-input-date__date\"\r\n [ngModel]=\"displayValue\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"!isManualInput\"\r\n [mask]=\"mask\"\r\n [leadZeroDateTime]=\"true\"\r\n [dropSpecialCharacters]=\"false\"\r\n [placeholder]=\"placeholder\"\r\n (click)=\"openCalendar()\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <div class=\"mrx-input-date__icons\" *ngIf=\"!disabled\">\r\n <span\r\n *ngIf=\"isViewCleanIcon\"\r\n class=\"mrx-icon icon-close\"\r\n (click)=\"clickToIconClear()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n\r\n <span\r\n class=\"mrx-icon icon-calendar\"\r\n (click)=\"clickToIconCalendar()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n </div>\r\n </div>\r\n\r\n <mrx-error-message *ngIf=\"invalid\" [invalidMessage]=\"invalidMessage\"></mrx-error-message>\r\n <mrx-error-message *ngIf=\"!invalid && errorMessage\" [invalidMessage]=\"errorMessage\"></mrx-error-message>\r\n\r\n <mrx-save-state [id]=\"uuid\" [fields]=\"fields\"></mrx-save-state>\r\n</div>\r\n", styles: [".mrx-input-date{width:100%;position:relative}.mrx-input-date .mrx-input-date__wrapper{position:relative}.mrx-input-date .mrx-input-date__input{border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1);color:var(--neutral-text-primary);width:100%;transition:outline-width .2s,border .2s}.mrx-input-date .mrx-input-date__input:focus,.mrx-input-date .mrx-input-date__input:active{outline:var(--neutral-bg-island-default) solid var(--border-width-focused)}.mrx-input-date .mrx-input-date__input:hover{border:var(--border-width-default) solid var(--neutral-bg-stroke-hover)}.mrx-input-date .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled);color:var(--neutral-text-tertiary)}.mrx-input-date.mrx-input-date-lg .mrx-input-date__input{padding:calc(var(--spacing-3) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-4) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-md .mrx-input-date__input{padding:calc(var(--spacing-2) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-3) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-sm .mrx-input-date__input{padding:calc(var(--spacing-2) - var(--border-width-default)) calc(var(--spacing-2) - var(--border-width-default));font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height)}.mrx-input-date.mrx-input-date.mrx-input-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default);background-color:var(--system-bg-negative-secondary)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input{background-color:var(--system-bg-positive-secondary);border-color:var(--system-bg-controls-positive-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date .mrx-input-date__icons{position:absolute;top:0;right:0;display:flex;align-items:center}.mrx-input-date.mrx-input-date .mrx-input-date__icons-item,.mrx-input-date.mrx-input-date .mrx-input-date__icons .mrx-icon{cursor:pointer}.mrx-input-date.mrx-input-date.mrx-input-date-lg .mrx-icon{margin-top:calc(var(--spacing-3) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-md .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-sm .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-2)}\n"], components: [{ type: ErrorMessageComponent, selector: "mrx-error-message", inputs: ["invalid", "invalidMessage", "customClasses"] }, { type: SaveStateComponent, selector: "mrx-save-state", inputs: ["type", "fields", "id"] }], directives: [{ type: i4.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i1$7.MaskDirective, selector: "input[mask], textarea[mask]", inputs: ["mask", "specialCharacters", "patterns", "prefix", "suffix", "thousandSeparator", "decimalMarker", "dropSpecialCharacters", "hiddenInput", "showMaskTyped", "placeHolderCharacter", "shownMaskExpression", "showTemplate", "clearIfNotMatch", "validation", "separatorLimit", "allowNegativeNumbers", "leadZeroDateTime", "triggerOnMaskChange"], outputs: ["maskFilled"], exportAs: ["mask", "ngxMask"] }, { type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
9955
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateComponent, decorators: [{
9956
+ type: Component,
9957
+ args: [{ selector: 'mrx-input-date', changeDetection: ChangeDetectionStrategy.OnPush, providers: [
9958
+ {
9959
+ provide: NG_VALUE_ACCESSOR,
9960
+ useExisting: forwardRef(() => InputDateComponent),
9961
+ multi: true
9962
+ }
9963
+ ], template: "<div\r\n class=\"mrx-input-date\"\r\n [class.mrx-input-error]=\"invalid\"\r\n [class.mrx-input-readonly]=\"readonly\"\r\n [class]=\"getClasses\"\r\n>\r\n <div class=\"mrx-input-date__wrapper\">\r\n <input\r\n #dateInput\r\n type=\"text\"\r\n autocomplete=\"nope\"\r\n class=\"mrx-input-date__input mrx-input-date__date\"\r\n [ngModel]=\"displayValue\"\r\n [disabled]=\"disabled\"\r\n [readOnly]=\"!isManualInput\"\r\n [mask]=\"mask\"\r\n [leadZeroDateTime]=\"true\"\r\n [dropSpecialCharacters]=\"false\"\r\n [placeholder]=\"placeholder\"\r\n (click)=\"openCalendar()\"\r\n (input)=\"onInput($event)\"\r\n (blur)=\"onBlur()\"\r\n />\r\n\r\n <div class=\"mrx-input-date__icons\" *ngIf=\"!disabled\">\r\n <span\r\n *ngIf=\"isViewCleanIcon\"\r\n class=\"mrx-icon icon-close\"\r\n (click)=\"clickToIconClear()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n\r\n <span\r\n class=\"mrx-icon icon-calendar\"\r\n (click)=\"clickToIconCalendar()\"\r\n [class.icon-font-16]=\"size === 'small'\"\r\n [class.icon-font-24]=\"size === 'medium' || size === 'large'\"\r\n ></span>\r\n </div>\r\n </div>\r\n\r\n <mrx-error-message *ngIf=\"invalid\" [invalidMessage]=\"invalidMessage\"></mrx-error-message>\r\n <mrx-error-message *ngIf=\"!invalid && errorMessage\" [invalidMessage]=\"errorMessage\"></mrx-error-message>\r\n\r\n <mrx-save-state [id]=\"uuid\" [fields]=\"fields\"></mrx-save-state>\r\n</div>\r\n", styles: [".mrx-input-date{width:100%;position:relative}.mrx-input-date .mrx-input-date__wrapper{position:relative}.mrx-input-date .mrx-input-date__input{border:var(--border-width-default) solid var(--neutral-bg-stroke-default);border-radius:var(--border-radius-1);color:var(--neutral-text-primary);width:100%;transition:outline-width .2s,border .2s}.mrx-input-date .mrx-input-date__input:focus,.mrx-input-date .mrx-input-date__input:active{outline:var(--neutral-bg-island-default) solid var(--border-width-focused)}.mrx-input-date .mrx-input-date__input:hover{border:var(--border-width-default) solid var(--neutral-bg-stroke-hover)}.mrx-input-date .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled);color:var(--neutral-text-tertiary)}.mrx-input-date.mrx-input-date-lg .mrx-input-date__input{padding:calc(var(--spacing-3) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-4) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-md .mrx-input-date__input{padding:calc(var(--spacing-2) + var(--spacing-half) - var(--border-width-default)) calc(var(--spacing-3) - var(--border-width-default));font-family:var(--body-md-font-family);font-size:var(--body-md-font-size);font-weight:var(--body-md-font-weight);line-height:var(--body-md-line-height)}.mrx-input-date.mrx-input-date-sm .mrx-input-date__input{padding:calc(var(--spacing-2) - var(--border-width-default)) calc(var(--spacing-2) - var(--border-width-default));font-family:var(--body-sm-font-family);font-size:var(--body-sm-font-size);font-weight:var(--body-sm-font-weight);line-height:var(--body-sm-line-height)}.mrx-input-date.mrx-input-date.mrx-input-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input{border-color:var(--system-bg-controls-negative-default);background-color:var(--system-bg-negative-secondary)}.mrx-input-date.mrx-input-date.mrx-input-checked-error .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input{background-color:var(--system-bg-positive-secondary);border-color:var(--system-bg-controls-positive-default)}.mrx-input-date.mrx-input-date.mrx-input-checked-success .mrx-input-date__input:disabled{background-color:var(--neutral-bg-disabled, #EEF0F4);border-color:var(--neutral-bg-stroke-default)}.mrx-input-date.mrx-input-date .mrx-input-date__icons{position:absolute;top:0;right:0;display:flex;align-items:center}.mrx-input-date.mrx-input-date .mrx-input-date__icons-item,.mrx-input-date.mrx-input-date .mrx-input-date__icons .mrx-icon{cursor:pointer}.mrx-input-date.mrx-input-date.mrx-input-date-lg .mrx-icon{margin-top:calc(var(--spacing-3) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-md .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-3)}.mrx-input-date.mrx-input-date.mrx-input-date-sm .mrx-icon{margin-top:calc(var(--spacing-2) - var(--border-width-default));margin-right:var(--spacing-2)}\n"] }]
9964
+ }], ctorParameters: function () { return [{ type: i1$2.Overlay }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { fields: [{
9965
+ type: Input
9966
+ }], format: [{
9967
+ type: Input
9968
+ }], minDate: [{
9969
+ type: Input
9970
+ }], maxDate: [{
9971
+ type: Input
9972
+ }], isSilentValidation: [{
9973
+ type: Input
9974
+ }], isManualInput: [{
9975
+ type: Input
9976
+ }], closeAfterSelect: [{
9977
+ type: Input
9978
+ }], required: [{
9979
+ type: Input
9980
+ }], size: [{
9981
+ type: Input
9982
+ }], customClasses: [{
9983
+ type: Input
9984
+ }], disabled: [{
9985
+ type: Input
9986
+ }], readonly: [{
9987
+ type: Input
9988
+ }], placeholder: [{
9989
+ type: Input
9990
+ }], popupPosition: [{
9991
+ type: Input
9992
+ }], invalid: [{
9993
+ type: Input
9994
+ }], invalidMessage: [{
9995
+ type: Input
9996
+ }], checkInvalid: [{
9997
+ type: Input
9998
+ }], changed: [{
9999
+ type: Output
10000
+ }], modelChange: [{
10001
+ type: Output
10002
+ }], blurred: [{
10003
+ type: Output
10004
+ }], dateInput: [{
10005
+ type: ViewChild,
10006
+ args: ['dateInput']
10007
+ }] } });
10008
+
10009
+ const maskConfigFunction$3 = () => {
10010
+ return {
10011
+ validation: false,
10012
+ };
10013
+ };
10014
+ class InputDateModule {
10015
+ }
10016
+ InputDateModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10017
+ InputDateModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateModule, declarations: [InputDateComponent,
10018
+ DateCalendarComponent], imports: [CommonModule,
10019
+ FormsModule,
10020
+ ErrorMessageModule,
10021
+ LabelModule,
10022
+ SaveStateModule, i1$7.NgxMaskModule], exports: [InputDateComponent] });
10023
+ InputDateModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateModule, imports: [[
10024
+ CommonModule,
10025
+ FormsModule,
10026
+ ErrorMessageModule,
10027
+ LabelModule,
10028
+ SaveStateModule,
10029
+ NgxMaskModule.forRoot(maskConfigFunction$3)
10030
+ ]] });
10031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImport: i0, type: InputDateModule, decorators: [{
10032
+ type: NgModule,
10033
+ args: [{
10034
+ declarations: [
10035
+ InputDateComponent,
10036
+ DateCalendarComponent
10037
+ ],
10038
+ imports: [
10039
+ CommonModule,
10040
+ FormsModule,
10041
+ ErrorMessageModule,
10042
+ LabelModule,
10043
+ SaveStateModule,
10044
+ NgxMaskModule.forRoot(maskConfigFunction$3)
10045
+ ],
10046
+ exports: [
10047
+ InputDateComponent
10048
+ ]
10049
+ }]
10050
+ }] });
10051
+
9340
10052
  var InputDateTimeSizesEnum;
9341
10053
  (function (InputDateTimeSizesEnum) {
9342
10054
  InputDateTimeSizesEnum["small"] = "mrx-input-date-sm";
@@ -9626,7 +10338,12 @@ class InputDateTimeComponent {
9626
10338
  if (this.dt) {
9627
10339
  if (changes['maxDate']) {
9628
10340
  this.dt.update({ maxDate: this.maxDate });
9629
- this.value && this.dt.selectDate(dayjs(this.value).toDate(), { updateTime: this.timepicker, silent: true });
10341
+ if (this.value) {
10342
+ this.dt.selectDate(formattingFromModels(this.dateModel, this.timeModel, this.timepicker).toISOString(), {
10343
+ updateTime: this.timepicker,
10344
+ silent: true
10345
+ });
10346
+ }
9630
10347
  if (!this.disableValidate) {
9631
10348
  const invalid = this.innerInvalid;
9632
10349
  const isValid = this.checkingInvalid(this.value, this.maxDate, this.minDate);
@@ -9639,7 +10356,12 @@ class InputDateTimeComponent {
9639
10356
  }
9640
10357
  if (changes['minDate']) {
9641
10358
  this.dt.update({ minDate: this.minDate });
9642
- this.value && this.dt.selectDate(dayjs(this.value).toDate(), { updateTime: this.timepicker, silent: true });
10359
+ if (this.value) {
10360
+ this.dt.selectDate(formattingFromModels(this.dateModel, this.timeModel, this.timepicker).toISOString(), {
10361
+ updateTime: this.timepicker,
10362
+ silent: true
10363
+ });
10364
+ }
9643
10365
  if (!this.disableValidate) {
9644
10366
  const invalid = this.innerInvalid;
9645
10367
  const isValid = this.checkingInvalid(this.value, this.maxDate, this.minDate);
@@ -9672,26 +10394,6 @@ class InputDateTimeComponent {
9672
10394
  return this.checkInvalid === false ? 'mrx-input-checked-success' : this.checkInvalid === true ? 'mrx-input-checked-error' : '';
9673
10395
  }
9674
10396
  }
9675
- _getDateFromTimezone(date) {
9676
- if (!date) {
9677
- return date;
9678
- }
9679
- if (this.timezone !== 'default') {
9680
- const utcTime = dayjs.utc(date);
9681
- const localOffsetMinutes = dayjs().utcOffset();
9682
- const moscowOffsetMinutes = dayjs().tz(this.timezone).utcOffset();
9683
- const offsetDifferenceMinutes = localOffsetMinutes - moscowOffsetMinutes;
9684
- if (offsetDifferenceMinutes >= 0) {
9685
- return utcTime.subtract(offsetDifferenceMinutes, 'minute').toISOString();
9686
- }
9687
- else {
9688
- return utcTime.add(Math.abs(offsetDifferenceMinutes), 'minute').toISOString();
9689
- }
9690
- }
9691
- else {
9692
- return date;
9693
- }
9694
- }
9695
10397
  _checkExtraTime() {
9696
10398
  if (this.addMaxTime && !this.timepicker) {
9697
10399
  this.timeModel.hour = '23';
@@ -9742,14 +10444,6 @@ class InputDateTimeComponent {
9742
10444
  }
9743
10445
  }
9744
10446
  }
9745
- dateFormattingOutput(value) {
9746
- if (value) {
9747
- return dayjs(value).toISOString();
9748
- }
9749
- else {
9750
- return '';
9751
- }
9752
- }
9753
10447
  invalidMessageOn(message) {
9754
10448
  this.innerInvalid = true;
9755
10449
  this.innerInvalidMessage = message;
@@ -18910,5 +19604,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.4.0", ngImpor
18910
19604
  * Generated bundle index. Do not edit.
18911
19605
  */
18912
19606
 
18913
- export { AlertColorClasses, AlertComponent, AlertIconClasses, AlertModule, BadgeColorClassesEnum, BadgeComponent, BadgeGroupComponent, BadgeSizeEnum, BadgeTagTypeClassesEnum, BadgeTargetTypesEnum, BadgeTypeEnum, BadgesModule, BreadcrumbsComponent, BreadcrumbsModule, BreadcrumbsTypeEnum, ButtonColorsEnum, ButtonComponent, ButtonIconPositionEnum, ButtonModule, ButtonSizesEnum, ButtonTypesEnum, CdkTooltipDirective, CdkTooltipModule, CharsLeftComponent, CharsLeftModule, CheckboxComponent, CheckboxGroupComponent, CheckboxGroupModule, CheckboxModule, ColumnComponent, ContentWrapperComponent, ContentWrapperModule, ContentWrapperTypeEnum, ContextMenuAttachDirective, ContextMenuComponent, ContextMenuContentComponent, ContextMenuFixedService, ContextMenuItemDirective, ContextMenuModule, ContextMenuService, ControlsItemComponent, ControlsVisibilityEnum, ControlsWrapperComponent, ControlsWrapperModule, CountriesISO, CountriesRusLabel, CountryISO, CurrencyModule, CurrencyPipe, DateFormatModule, DateFormatPipe, DateTimeFormatPipe, DefaultPagerSettings, DocumentEditorComponent, DocumentEditorModule, DropdownComponent, DropdownModule, EditorComponent, EditorModule, ErrorMessageComponent, ErrorMessageModule, FileUploadService, FormulaEditorComponent, FormulaEditorModule, GalleryComponent, GalleryModule, HideAfterClickDirective, HintErrorMessageComponent, HintErrorMessageModule, IconButtonComponent, IconButtonModule, IconButtonSizeEnum, IconButtonStateEnum, IconButtonTypeEnum, InputDateSizesEnum$1 as InputDateSizesEnum, InputDateTimeComponent, InputDateTimeModule, InputDatepickerComponent, InputDatepickerModule, InputEditorModeEnum, InputFileComponent, InputFileImageComponent, InputFileImageModule, InputFileImageTypeEnum, InputFileModule, InputNumberComponent, InputNumberModule, InputNumberSizesEnum, InputOptComponent, InputOptModule, InputPasswordComponent, InputPasswordModule, InputPasswordSizesEnum, InputPhoneComponent, InputPhoneModule, InputSearchComponent, InputSearchModule, InputSearchSizesEnum, InputSelectComponent, InputSelectModule, InputSelectSizeEnum, InputTelComponent, InputTelModule, InputTelSizesEnum, InputTextComponent, InputTextIconColorEnum, InputTextModule, InputTextSizesEnum, InputTextareaComponent, InputTextareaModule, InputTextareaSizesEnum, InputTimepickerComponent, InputTimepickerModule, JsonEditorComponent, JsonEditorModule, JsonEditorOptions, LabelComponent, LabelModule, LinkComponent, LinkModule, LinkSizesEnum, LinkTargetTypesEnum, LinkTypesEnum, LoaderColorEnum, LoaderComponent, LoaderModule, LoaderSizesEnum, ModalAlignButtonsEnum, ModalColorEnum, ModalComponent, ModalModule, ModalSizesEnum, MrxAutoSaveActionsEnum, MrxAutosaveService, MrxFormValidator, NgxOtpBehavior, PagesNavComponent, PagesNavEnum, PagesNavModule, PaginatorComponent, PaginatorModule, PaginatorPositionCss, PdfViewerComponent, PdfViewerComponentModule, PhoneFormatModule, PhoneFormatPipe, PopupComponent, PopupItemComponent, PopupModule, PopupTriggerDirective, PreviewEnum, ProgressClasses, ProgressComponent, ProgressModule, RadioComponent, RadioGroupComponent, RadioGroupModule, RadioModule, RadioTypesEnum, RatingComponent, RatingModule, RatingSizesEnum, RatingValueSizesEnum, RatingWrapperSizesEnum, SafeModule, SafePipe, SaveStateComponent, SaveStateModule, SaveStoreModule, StepperClasses, StepperComponent, StepperModule, SwitchComponent, SwitchModule, SwitchSizeEnum, SwitchTypeEnum, TabComponent, TableComponent, TableModule, TableTypeEnum, TabsClasses, TabsGroupComponent, TabsModule, TabsTypesClasses, Timezone$1 as Timezone, Tooltip, TooltipComponent, TooltipModule, TooltipService, TooltipTextPositionEnum, TooltipTriggerComponent, TooltipTriggerEnum, TruncateDirective, TruncateDirectiveModule, TruncateModule, TruncatePipe, TruncateTextComponent, TruncateTextModule, ValidationMethodsEnum, ValidationOptionsEnum, ValidationTypesEnum, WarningMessageComponent, WarningMessageModule, WidgetWrapperComponent, WidgetWrapperModule, autosaveAddId, autosaveError, autosaveErrorFor, autosaveStart, autosaveStartFor, autosaveStop, autosaveStopFor, autosaveSuccess, autosaveSuccessFor, convertBase64ToFile, countryData, dateTimeFormat, formatBytes, formattingDateRange, formattingIsoToString, getBase64FromUrl, getHashCode, sHashCode, selectFields, selectMrxAutoSaveState, sliceDate, toBytes, toDate, toNumberFormat, wordForm };
19607
+ export { AlertColorClasses, AlertComponent, AlertIconClasses, AlertModule, BadgeColorClassesEnum, BadgeComponent, BadgeGroupComponent, BadgeSizeEnum, BadgeTagTypeClassesEnum, BadgeTargetTypesEnum, BadgeTypeEnum, BadgesModule, BreadcrumbsComponent, BreadcrumbsModule, BreadcrumbsTypeEnum, ButtonColorsEnum, ButtonComponent, ButtonIconPositionEnum, ButtonModule, ButtonSizesEnum, ButtonTypesEnum, CdkTooltipDirective, CdkTooltipModule, CharsLeftComponent, CharsLeftModule, CheckboxComponent, CheckboxGroupComponent, CheckboxGroupModule, CheckboxModule, ColumnComponent, ContentWrapperComponent, ContentWrapperModule, ContentWrapperTypeEnum, ContextMenuAttachDirective, ContextMenuComponent, ContextMenuContentComponent, ContextMenuFixedService, ContextMenuItemDirective, ContextMenuModule, ContextMenuService, ControlsItemComponent, ControlsVisibilityEnum, ControlsWrapperComponent, ControlsWrapperModule, CountriesISO, CountriesRusLabel, CountryISO, CurrencyModule, CurrencyPipe, DateFormatModule, DateFormatPipe, DateTimeFormatPipe, DefaultPagerSettings, DocumentEditorComponent, DocumentEditorModule, DropdownComponent, DropdownModule, EditorComponent, EditorModule, ErrorMessageComponent, ErrorMessageModule, FileUploadService, FormulaEditorComponent, FormulaEditorModule, GalleryComponent, GalleryModule, HideAfterClickDirective, HintErrorMessageComponent, HintErrorMessageModule, IconButtonComponent, IconButtonModule, IconButtonSizeEnum, IconButtonStateEnum, IconButtonTypeEnum, InputDateComponent, InputDateModule, InputDateSizesEnum$2 as InputDateSizesEnum, InputDateTimeComponent, InputDateTimeModule, InputDateTimeSizesEnum, InputDatepickerComponent, InputDatepickerModule, InputEditorModeEnum, InputFileComponent, InputFileImageComponent, InputFileImageModule, InputFileImageTypeEnum, InputFileModule, InputNumberComponent, InputNumberModule, InputNumberSizesEnum, InputOptComponent, InputOptModule, InputPasswordComponent, InputPasswordModule, InputPasswordSizesEnum, InputPhoneComponent, InputPhoneModule, InputSearchComponent, InputSearchModule, InputSearchSizesEnum, InputSelectComponent, InputSelectModule, InputSelectSizeEnum, InputTelComponent, InputTelModule, InputTelSizesEnum, InputTextComponent, InputTextIconColorEnum, InputTextModule, InputTextSizesEnum, InputTextareaComponent, InputTextareaModule, InputTextareaSizesEnum, InputTimepickerComponent, InputTimepickerModule, JsonEditorComponent, JsonEditorModule, JsonEditorOptions, LabelComponent, LabelModule, LinkComponent, LinkModule, LinkSizesEnum, LinkTargetTypesEnum, LinkTypesEnum, LoaderColorEnum, LoaderComponent, LoaderModule, LoaderSizesEnum, ModalAlignButtonsEnum, ModalColorEnum, ModalComponent, ModalModule, ModalSizesEnum, MrxAutoSaveActionsEnum, MrxAutosaveService, MrxFormValidator, NgxOtpBehavior, PagesNavComponent, PagesNavEnum, PagesNavModule, PaginatorComponent, PaginatorModule, PaginatorPositionCss, PdfViewerComponent, PdfViewerComponentModule, PhoneFormatModule, PhoneFormatPipe, PopupComponent, PopupItemComponent, PopupModule, PopupTriggerDirective, PreviewEnum, ProgressClasses, ProgressComponent, ProgressModule, RadioComponent, RadioGroupComponent, RadioGroupModule, RadioModule, RadioTypesEnum, RatingComponent, RatingModule, RatingSizesEnum, RatingValueSizesEnum, RatingWrapperSizesEnum, SafeModule, SafePipe, SaveStateComponent, SaveStateModule, SaveStoreModule, StepperClasses, StepperComponent, StepperModule, SwitchComponent, SwitchModule, SwitchSizeEnum, SwitchTypeEnum, TabComponent, TableComponent, TableModule, TableTypeEnum, TabsClasses, TabsGroupComponent, TabsModule, TabsTypesClasses, Timezone$1 as Timezone, Tooltip, TooltipComponent, TooltipModule, TooltipService, TooltipTextPositionEnum, TooltipTriggerComponent, TooltipTriggerEnum, TruncateDirective, TruncateDirectiveModule, TruncateModule, TruncatePipe, TruncateTextComponent, TruncateTextModule, ValidationMethodsEnum, ValidationOptionsEnum, ValidationTypesEnum, WarningMessageComponent, WarningMessageModule, WidgetWrapperComponent, WidgetWrapperModule, autosaveAddId, autosaveError, autosaveErrorFor, autosaveStart, autosaveStartFor, autosaveStop, autosaveStopFor, autosaveSuccess, autosaveSuccessFor, convertBase64ToFile, countryData, dateTimeFormat, formatBytes, formattingDateRange, formattingIsoToString, getBase64FromUrl, getHashCode, sHashCode, selectFields, selectMrxAutoSaveState, sliceDate, toBytes, toDate, toNumberFormat, wordForm };
18914
19608
  //# sourceMappingURL=myrta-ui.mjs.map