@anglr/datetime 8.0.0-beta.20240125080204 → 8.0.0-beta.20240125101313

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.
Files changed (99) hide show
  1. package/changelog.md +34 -0
  2. package/es2022/date-fns/src/services/dateFnsDateApi.service.js +6 -7
  3. package/es2022/date-fns/src/services/dateFnsDateApi.service.js.map +1 -1
  4. package/es2022/moment/src/services/momentDateApi.service.js +6 -7
  5. package/es2022/moment/src/services/momentDateApi.service.js.map +1 -1
  6. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js +10 -37
  7. package/es2022/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.js.map +1 -1
  8. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js +4 -5
  9. package/es2022/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -1
  10. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +7 -8
  11. package/es2022/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -1
  12. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +4 -5
  13. package/es2022/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -1
  14. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +4 -5
  15. package/es2022/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -1
  16. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +7 -8
  17. package/es2022/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -1
  18. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +4 -5
  19. package/es2022/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -1
  20. package/es2022/src/directives/withNow/withNow.directive.js +6 -7
  21. package/es2022/src/directives/withNow/withNow.directive.js.map +1 -1
  22. package/es2022/src/directives/withTime/withTime.directive.js +5 -6
  23. package/es2022/src/directives/withTime/withTime.directive.js.map +1 -1
  24. package/es2022/src/directives/withToday/withToday.directive.js +6 -7
  25. package/es2022/src/directives/withToday/withToday.directive.js.map +1 -1
  26. package/es2022/src/misc/enums.js +6 -2
  27. package/es2022/src/misc/enums.js.map +1 -1
  28. package/es2022/src/misc/utils.js +33 -18
  29. package/es2022/src/misc/utils.js.map +1 -1
  30. package/es2022/src/misc/validators.js +12 -8
  31. package/es2022/src/misc/validators.js.map +1 -1
  32. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js +6 -7
  33. package/es2022/src/modules/calendar/components/monthCalendar/monthCalendar.component.js.map +1 -1
  34. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js +5 -6
  35. package/es2022/src/modules/calendar/directives/calendarDayTemplate/calendarDayTemplate.directive.js.map +1 -1
  36. package/es2022/src/modules/calendar/modules/monthCalendar.module.js +5 -6
  37. package/es2022/src/modules/calendar/modules/monthCalendar.module.js.map +1 -1
  38. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js +6 -7
  39. package/es2022/src/modules/calendar/services/eventParser/eventParser.service.js.map +1 -1
  40. package/es2022/src/modules/datePipes.module.js +5 -6
  41. package/es2022/src/modules/datePipes.module.js.map +1 -1
  42. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js +11 -6
  43. package/es2022/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -1
  44. package/es2022/src/modules/dateTime/directives/dateTimeBase.js +5 -6
  45. package/es2022/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  46. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js +6 -7
  47. package/es2022/src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.js.map +1 -1
  48. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +11 -38
  49. package/es2022/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  50. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +8 -9
  51. package/es2022/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  52. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +8 -9
  53. package/es2022/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  54. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +7 -8
  55. package/es2022/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  56. package/es2022/src/modules/dateTime/modules/dateTime.module.js +5 -6
  57. package/es2022/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  58. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +10 -36
  59. package/es2022/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  60. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +5 -6
  61. package/es2022/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -1
  62. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js +6 -7
  63. package/es2022/src/modules/dateTimePicker/components/monthPicker/monthPicker.component.js.map +1 -1
  64. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js +4 -5
  65. package/es2022/src/modules/dateTimePicker/components/rollerTimePicker/rollerTimePicker.component.js.map +1 -1
  66. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js +4 -5
  67. package/es2022/src/modules/dateTimePicker/components/yearPicker/yearPicker.component.js.map +1 -1
  68. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +7 -7
  69. package/es2022/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -1
  70. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js +5 -6
  71. package/es2022/src/modules/dateTimePicker/directives/loopScroll/loopScroll.directive.js.map +1 -1
  72. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js +5 -6
  73. package/es2022/src/modules/dateTimePicker/directives/loopScrollData/loopScrollData.directive.js.map +1 -1
  74. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js +5 -6
  75. package/es2022/src/modules/dateTimePicker/modules/dateTimePicker.module.js.map +1 -1
  76. package/es2022/src/pipes/dateConvert.pipe.js +6 -7
  77. package/es2022/src/pipes/dateConvert.pipe.js.map +1 -1
  78. package/es2022/src/pipes/dateFormat.pipe.js +6 -7
  79. package/es2022/src/pipes/dateFormat.pipe.js.map +1 -1
  80. package/es2022/src/services/datePositionParser/datePositionParser.service.js +4 -5
  81. package/es2022/src/services/datePositionParser/datePositionParser.service.js.map +1 -1
  82. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js +5 -6
  83. package/es2022/src/services/dateTimeRelativeParser/dateTimeRelativeParser.service.js.map +1 -1
  84. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js +6 -7
  85. package/es2022/src/services/dateValueProvider/dateValueProvider.service.js.map +1 -1
  86. package/package.json +31 -31
  87. package/src/directives/buttonDateTimeInput/buttonDateTimeInput.directive.d.ts.map +1 -1
  88. package/src/misc/enums.d.ts +6 -2
  89. package/src/misc/enums.d.ts.map +1 -1
  90. package/src/misc/utils.d.ts +5 -3
  91. package/src/misc/utils.d.ts.map +1 -1
  92. package/src/misc/validators.d.ts +17 -3
  93. package/src/misc/validators.d.ts.map +1 -1
  94. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +5 -1
  95. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -1
  96. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  97. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -1
  98. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -1
  99. package/version.bak +1 -1
@@ -5,15 +5,14 @@ import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Module used for exporting date pipes
7
7
  */
8
- class DatePipesModule {
9
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DatePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.1", ngImport: i0, type: DatePipesModule, declarations: [DateFormatPipe,
8
+ export class DatePipesModule {
9
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DatePipesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.1.1", ngImport: i0, type: DatePipesModule, declarations: [DateFormatPipe,
11
11
  DateConvertPipe], exports: [DateFormatPipe,
12
12
  DateConvertPipe] });
13
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DatePipesModule });
13
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DatePipesModule });
14
14
  }
15
- export { DatePipesModule };
16
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DatePipesModule, decorators: [{
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DatePipesModule, decorators: [{
17
16
  type: NgModule,
18
17
  args: [{
19
18
  declarations: [
@@ -1 +1 @@
1
- {"version":3,"file":"datePipes.module.js","sourceRoot":"","sources":["../../../src/modules/datePipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;;AAExD;;GAEG;AACH,MAaa,eAAe;uGAAf,eAAe;wGAAf,eAAe,iBATpB,cAAc;YACd,eAAe,aAIf,cAAc;YACd,eAAe;wGAGV,eAAe;;SAAf,eAAe;2FAAf,eAAe;kBAb3B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,cAAc;wBACd,eAAe;qBAClB;oBACD,OAAO,EACP;wBACI,cAAc;wBACd,eAAe;qBAClB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateConvertPipe} from '../pipes/dateConvert.pipe';\nimport {DateFormatPipe} from '../pipes/dateFormat.pipe';\n\n/**\n * Module used for exporting date pipes\n */\n@NgModule(\n{\n declarations:\n [\n DateFormatPipe,\n DateConvertPipe,\n ],\n exports:\n [\n DateFormatPipe,\n DateConvertPipe,\n ]\n})\nexport class DatePipesModule\n{\n}"]}
1
+ {"version":3,"file":"datePipes.module.js","sourceRoot":"","sources":["../../../src/modules/datePipes.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,eAAe,EAAC,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;;AAExD;;GAEG;AAcH,MAAM,OAAO,eAAe;uGAAf,eAAe;wGAAf,eAAe,iBATpB,cAAc;YACd,eAAe,aAIf,cAAc;YACd,eAAe;wGAGV,eAAe;;2FAAf,eAAe;kBAb3B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,cAAc;wBACd,eAAe;qBAClB;oBACD,OAAO,EACP;wBACI,cAAc;wBACd,eAAe;qBAClB;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateConvertPipe} from '../pipes/dateConvert.pipe';\nimport {DateFormatPipe} from '../pipes/dateFormat.pipe';\n\n/**\n * Module used for exporting date pipes\n */\n@NgModule(\n{\n declarations:\n [\n DateFormatPipe,\n DateConvertPipe,\n ],\n exports:\n [\n DateFormatPipe,\n DateConvertPipe,\n ]\n})\nexport class DatePipesModule\n{\n}"]}
@@ -10,7 +10,7 @@ import * as i0 from "@angular/core";
10
10
  /**
11
11
  * Directive that holds shared data for date time, like formats, restrictions
12
12
  */
13
- class DateTimeSADirective {
13
+ export class DateTimeSADirective {
14
14
  //######################### protected properties #########################
15
15
  /**
16
16
  * Subject used for emitting changes in max date time value
@@ -113,6 +113,10 @@ class DateTimeSADirective {
113
113
  this.ɵcustomFormat = value;
114
114
  this.customFormatChangesSubject.next();
115
115
  }
116
+ /**
117
+ * Represents data format that is used as value of date time when `DateTimeValueFormat.DataString` is set to `valueFormat`
118
+ */
119
+ dataFormat;
116
120
  /**
117
121
  * Gets or sets max allowed date for date time
118
122
  */
@@ -212,7 +216,7 @@ class DateTimeSADirective {
212
216
  * @param setter - Action used for setting value
213
217
  */
214
218
  setMinMaxValue(value, setter) {
215
- const val = this.dateApi.getValue(value, this.customFormat);
219
+ const val = this.dateApi.getValue(value, this.dataFormat ?? this.customFormat);
216
220
  if (val.isValid()) {
217
221
  setter(val.value);
218
222
  }
@@ -243,8 +247,8 @@ class DateTimeSADirective {
243
247
  * Custom input type for `minDateTime` input
244
248
  */
245
249
  static ngAcceptInputType_minDateTime;
246
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
247
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeSADirective, isStandalone: true, selector: "[dateTime]", inputs: { valueFormat: "valueFormat", format: "format", customFormat: "customFormat", maxDateTime: "maxDateTime", minDateTime: "minDateTime" }, ngImport: i0 });
250
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
251
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeSADirective, isStandalone: true, selector: "[dateTime]", inputs: { valueFormat: "valueFormat", format: "format", customFormat: "customFormat", dataFormat: "dataFormat", maxDateTime: "maxDateTime", minDateTime: "minDateTime" }, ngImport: i0 });
248
252
  }
249
253
  __decorate([
250
254
  BindThis,
@@ -258,8 +262,7 @@ __decorate([
258
262
  __metadata("design:paramtypes", [Object]),
259
263
  __metadata("design:returntype", void 0)
260
264
  ], DateTimeSADirective.prototype, "maxDateSet", null);
261
- export { DateTimeSADirective };
262
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeSADirective, decorators: [{
265
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeSADirective, decorators: [{
263
266
  type: Directive,
264
267
  args: [{
265
268
  selector: '[dateTime]',
@@ -271,6 +274,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
271
274
  type: Input
272
275
  }], customFormat: [{
273
276
  type: Input
277
+ }], dataFormat: [{
278
+ type: Input
274
279
  }], maxDateTime: [{
275
280
  type: Input
276
281
  }], minDateTime: [{
@@ -1 +1 @@
1
- {"version":3,"file":"dateTime.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTime/dateTime.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AAClE,OAAO,EAAU,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAa,OAAO,EAAe,MAAM,MAAM,CAAC;AAGvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EA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CAAC,KAAK,CAAC,CAAC;SACrB;aAED;YACI,MAAM,CAAC,IAAI,CAAC,CAAC;SAChB;IACL,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED,wEAAwE;IAExE;;OAEG;IACI,MAAM,CAAC,6BAA6B,CAAuD;IAElG;;OAEG;IACI,MAAM,CAAC,6BAA6B,CAAyB;IAEpE;;OAEG;IACI,MAAM,CAAC,6BAA6B,CAAyB;uGA9U3D,mBAAmB;2FAAnB,mBAAmB;;AA2QlB;IADT,QAAQ;;;;qDAMR;AAOS;IADT,QAAQ;;;;qDAMR;SA5RQ,mBAAmB;2FAAnB,mBAAmB;kBAL/B,SAAS;mBACV;oBACI,QAAQ,EAAE,YAAY;oBACtB,UAAU,EAAE,IAAI;iBACnB;8BAiGc,WAAW;sBADrB,KAAK;gBAqBK,MAAM;sBADhB,KAAK;gBAeK,YAAY;sBADtB,KAAK;gBAeK,WAAW;sBADrB,KAAK;gBAsDK,WAAW;sBADrB,KAAK;gBAuEI,UAAU,MAYV,UAAU","sourcesContent":["import {Directive, inject, Input, OnDestroy} from '@angular/core';\nimport {Action1, BindThis, isBlank, isString} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {getSingleDateTimeValue} from '../../../../misc/utils';\nimport {DateApi, DateValue} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Directive that holds shared data for date time, like formats, restrictions\n */\n@Directive(\n{\n selector: '[dateTime]',\n standalone: true,\n})\nexport class DateTimeSADirective<TDate = unknown> implements OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting changes in max date time value\n */\n protected maxDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in min date time value\n */\n protected minDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in custom format value\n */\n protected customFormatChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subscription for max date instance value changes\n */\n protected maxDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Subscription for min date instance value changes\n */\n protected minDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Max allowed value of date time\n */\n protected ɵmaxDateTime: TDate|undefined|null;\n\n /**\n * Min allowed value of date time\n */\n protected ɵminDateTime: TDate|undefined|null;\n\n /**\n * Date time value format which is being worked with in this date time\n */\n protected ɵvalueFormat: DateTimeValueFormat = DateTimeValueFormat.DateInstance;\n\n /**\n * Format of string representation of date\n */\n protected ɵformat: keyof FormatProvider = 'date';\n\n /**\n * Date api instance, used for date time manipulation\n */\n protected dateApi: DateApi<TDate> = inject(DATE_API) as DateApi<TDate>;\n\n /**\n * Provider for available formats\n */\n protected formatProvider: FormatProvider = inject(FORMAT_PROVIDER);\n\n /**\n * Custom format string representation of date\n */\n protected ɵcustomFormat: string = this.dateApi.getFormat(this.formatProvider[this.ɵformat]);\n\n //######################### public properties #########################\n\n /**\n * Occurs when there are changes in max date time value\n */\n public get maxDateTimeChanges(): Observable<void>\n {\n return this.maxDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in min date time value\n */\n public get minDateTimeChanges(): Observable<void>\n {\n return this.minDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in custom format value\n */\n public get customFormatChanges(): Observable<void>\n {\n return this.customFormatChangesSubject.asObservable();\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets date time value format which is being worked with in this date time\n */\n @Input()\n public get valueFormat(): DateTimeValueFormat\n {\n return this.ɵvalueFormat;\n }\n public set valueFormat(value: DateTimeValueFormat)\n {\n if(isString(value))\n {\n this.ɵvalueFormat = DateTimeValueFormat[value] as unknown as DateTimeValueFormat;\n\n return;\n }\n\n this.ɵvalueFormat = value;\n }\n\n /**\n * Gets or sets format of string representation of date\n */\n @Input()\n public get format(): keyof FormatProvider\n {\n return this.ɵformat;\n }\n public set format(value: keyof FormatProvider)\n {\n this.ɵformat = value;\n this.customFormat = this.dateApi.getFormat(this.formatProvider[value]);\n }\n\n /**\n * Gets or sets custom format string representation of date\n */\n @Input()\n public get customFormat(): string\n {\n return this.ɵcustomFormat;\n }\n public set customFormat(value: string)\n {\n this.ɵcustomFormat = value;\n this.customFormatChangesSubject.next();\n }\n\n /**\n * Gets or sets max allowed date for date time\n */\n @Input()\n public get maxDateTime(): TDate|undefined|null\n {\n return this.ɵmaxDateTime;\n }\n public set maxDateTime(value: TDate|undefined|null)\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.maxDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.maxDateInstanceChange = value.valueChange.subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.maxDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n val = v;\n }\n \n this.setMinMaxValue(val, this.maxDateSet);\n }\n\n /**\n * Gets or sets min allowed date for date time\n */\n @Input()\n public get minDateTime(): TDate|undefined|null\n {\n return this.ɵminDateTime;\n }\n public set minDateTime(value: TDate|undefined|null)\n {\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.minDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.minDateInstanceChange = value.valueChange.subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.minDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.minDateSet(null);\n\n return;\n }\n\n val = v;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets min date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected minDateSet(value: TDate|undefined|null): void\n {\n this.ɵminDateTime = value;\n this.minDateTimeChangesSubject.next();\n this.onMinDateTimeChange();\n }\n\n /**\n * Sets max date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected maxDateSet(value: TDate|undefined|null): void\n {\n this.ɵmaxDateTime = value;\n this.maxDateTimeChangesSubject.next();\n this.onMaxDateTimeChange();\n }\n\n /**\n * Sets min or max date time value\n * @param value - Value to be set\n * @param setter - Action used for setting value\n */\n protected setMinMaxValue(value: DateValue|TDate, setter: Action1<TDate|undefined|null>): void\n {\n const val = this.dateApi.getValue(value, this.customFormat);\n\n if(val.isValid())\n {\n setter(val.value);\n }\n else\n {\n setter(null);\n }\n }\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `valueFormat` input\n */\n public static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat|DateTimeValueFormat;\n\n /**\n * Custom input type for `maxDateTime` input\n */\n public static ngAcceptInputType_maxDateTime: DateValue|DateTimeBase;\n\n /**\n * Custom input type for `minDateTime` input\n */\n public static ngAcceptInputType_minDateTime: DateValue|DateTimeBase;\n}"]}
1
+ {"version":3,"file":"dateTime.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTime/dateTime.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAY,MAAM,eAAe,CAAC;AAClE,OAAO,EAAU,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAa,OAAO,EAAe,MAAM,MAAM,CAAC;AAGvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,sBAAsB,EAAC,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAMH,MAAM,OAAO,mBAAmB;IAE5B,0EAA0E;IAE1E;;OAEG;IACO,yBAAyB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEzE;;OAEG;IACO,yBAAyB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEzE;;OAEG;IACO,0BAA0B,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAE1E;;OAEG;IACO,qBAAqB,CAA8B;IAE7D;;OAEG;IACO,qBAAqB,CAA8B;IAE7D;;OAEG;IACO,YAAY,CAAuB;IAE7C;;OAEG;IACO,YAAY,CAAuB;IAE7C;;OAEG;IACO,YAAY,GAAwB,mBAAmB,CAAC,YAAY,CAAC;IAE/E;;OAEG;IACO,OAAO,GAAyB,MAAM,CAAC;IAEjD;;OAEG;IACO,OAAO,GAAmB,MAAM,CAAC,QAAQ,CAAmB,CAAC;IAEvE;;OAEG;IACO,cAAc,GAAmB,MAAM,CAAC,eAAe,CAAC,CAAC;IAEnE;;OAEG;IACO,aAAa,GAAW,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,I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String} from '@jscrpt/common';\nimport {Observable, Subject, Subscription} from 'rxjs';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {getSingleDateTimeValue} from '../../../../misc/utils';\nimport {DateApi, DateValue} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Directive that holds shared data for date time, like formats, restrictions\n */\n@Directive(\n{\n selector: '[dateTime]',\n standalone: true,\n})\nexport class DateTimeSADirective<TDate = unknown> implements OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting changes in max date time value\n */\n protected maxDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in min date time value\n */\n protected minDateTimeChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting changes in custom format value\n */\n protected customFormatChangesSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subscription for max date instance value changes\n */\n protected maxDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Subscription for min date instance value changes\n */\n protected minDateInstanceChange: Subscription|undefined|null;\n\n /**\n * Max allowed value of date time\n */\n protected ɵmaxDateTime: TDate|undefined|null;\n\n /**\n * Min allowed value of date time\n */\n protected ɵminDateTime: TDate|undefined|null;\n\n /**\n * Date time value format which is being worked with in this date time\n */\n protected ɵvalueFormat: DateTimeValueFormat = DateTimeValueFormat.DateInstance;\n\n /**\n * Format of string representation of date\n */\n protected ɵformat: keyof FormatProvider = 'date';\n\n /**\n * Date api instance, used for date time manipulation\n */\n protected dateApi: DateApi<TDate> = inject(DATE_API) as DateApi<TDate>;\n\n /**\n * Provider for available formats\n */\n protected formatProvider: FormatProvider = inject(FORMAT_PROVIDER);\n\n /**\n * Custom format string representation of date\n */\n protected ɵcustomFormat: string = this.dateApi.getFormat(this.formatProvider[this.ɵformat]);\n\n //######################### public properties #########################\n\n /**\n * Occurs when there are changes in max date time value\n */\n public get maxDateTimeChanges(): Observable<void>\n {\n return this.maxDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in min date time value\n */\n public get minDateTimeChanges(): Observable<void>\n {\n return this.minDateTimeChangesSubject.asObservable();\n }\n\n /**\n * Occurs when there are changes in custom format value\n */\n public get customFormatChanges(): Observable<void>\n {\n return this.customFormatChangesSubject.asObservable();\n }\n\n //######################### public properties - inputs #########################\n\n /**\n * Gets or sets date time value format which is being worked with in this date time\n */\n @Input()\n public get valueFormat(): DateTimeValueFormat\n {\n return this.ɵvalueFormat;\n }\n public set valueFormat(value: DateTimeValueFormat)\n {\n if(isString(value))\n {\n this.ɵvalueFormat = DateTimeValueFormat[value] as unknown as DateTimeValueFormat;\n\n return;\n }\n\n this.ɵvalueFormat = value;\n }\n\n /**\n * Gets or sets format of string representation of date\n */\n @Input()\n public get format(): keyof FormatProvider\n {\n return this.ɵformat;\n }\n public set format(value: keyof FormatProvider)\n {\n this.ɵformat = value;\n this.customFormat = this.dateApi.getFormat(this.formatProvider[value]);\n }\n\n /**\n * Gets or sets custom format string representation of date\n */\n @Input()\n public get customFormat(): string\n {\n return this.ɵcustomFormat;\n }\n public set customFormat(value: string)\n {\n this.ɵcustomFormat = value;\n this.customFormatChangesSubject.next();\n }\n\n /**\n * Represents data format that is used as value of date time when `DateTimeValueFormat.DataString` is set to `valueFormat`\n */\n @Input()\n public dataFormat: string|undefined|null;\n\n /**\n * Gets or sets max allowed date for date time\n */\n @Input()\n public get maxDateTime(): TDate|undefined|null\n {\n return this.ɵmaxDateTime;\n }\n public set maxDateTime(value: TDate|undefined|null)\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.maxDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.maxDateInstanceChange = value.valueChange.subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.maxDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.maxDateSet(null);\n\n return;\n }\n\n val = v;\n }\n \n this.setMinMaxValue(val, this.maxDateSet);\n }\n\n /**\n * Gets or sets min allowed date for date time\n */\n @Input()\n public get minDateTime(): TDate|undefined|null\n {\n return this.ɵminDateTime;\n }\n public set minDateTime(value: TDate|undefined|null)\n {\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n\n if(isBlank(value))\n {\n this.minDateSet(value);\n\n return;\n }\n\n let val: DateTimeInputOutputValue<TDate> = value;\n\n if(value instanceof DateTimeBase)\n {\n this.minDateInstanceChange = value.valueChange.subscribe(() =>\n {\n const val = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(val))\n {\n this.minDateSet(null);\n\n return;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n });\n\n const v = getSingleDateTimeValue<TDate>(value.value);\n\n if(isBlank(v))\n {\n this.minDateSet(null);\n\n return;\n }\n\n val = v;\n }\n\n this.setMinMaxValue(val, this.minDateSet);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.maxDateInstanceChange?.unsubscribe();\n this.maxDateInstanceChange = null;\n\n this.minDateInstanceChange?.unsubscribe();\n this.minDateInstanceChange = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets min date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected minDateSet(value: TDate|undefined|null): void\n {\n this.ɵminDateTime = value;\n this.minDateTimeChangesSubject.next();\n this.onMinDateTimeChange();\n }\n\n /**\n * Sets max date time and notifies about changes\n * @param value - Value to be set\n */\n @BindThis\n protected maxDateSet(value: TDate|undefined|null): void\n {\n this.ɵmaxDateTime = value;\n this.maxDateTimeChangesSubject.next();\n this.onMaxDateTimeChange();\n }\n\n /**\n * Sets min or max date time value\n * @param value - Value to be set\n * @param setter - Action used for setting value\n */\n protected setMinMaxValue(value: DateValue|TDate, setter: Action1<TDate|undefined|null>): void\n {\n const val = this.dateApi.getValue(value, this.dataFormat ?? this.customFormat);\n\n if(val.isValid())\n {\n setter(val.value);\n }\n else\n {\n setter(null);\n }\n }\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n\n //######################### ng language server #########################\n \n /**\n * Custom input type for `valueFormat` input\n */\n public static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat|DateTimeValueFormat;\n\n /**\n * Custom input type for `maxDateTime` input\n */\n public static ngAcceptInputType_maxDateTime: DateValue|DateTimeBase;\n\n /**\n * Custom input type for `minDateTime` input\n */\n public static ngAcceptInputType_minDateTime: DateValue|DateTimeBase;\n}"]}
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
5
5
  /**
6
6
  * Base class for date time directives, contains basic shared data
7
7
  */
8
- class DateTimeBase {
8
+ export class DateTimeBase {
9
9
  //######################### protected properties #########################
10
10
  /**
11
11
  * Subscriptions created during initialization
@@ -56,11 +56,10 @@ class DateTimeBase {
56
56
  */
57
57
  onMinDateTimeChange() {
58
58
  }
59
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
60
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeBase, ngImport: i0 });
59
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeBase, deps: [], target: i0.ɵɵFactoryTarget.Directive });
60
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeBase, ngImport: i0 });
61
61
  }
62
- export { DateTimeBase };
63
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeBase, decorators: [{
62
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeBase, decorators: [{
64
63
  type: Directive
65
- }], ctorParameters: function () { return []; } });
64
+ }], ctorParameters: () => [] });
66
65
  //# sourceMappingURL=dateTimeBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/directives/dateTimeBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;;AAElE;;GAEG;AACH,MACa,YAAY;IAErB,0EAA0E;IAE1E;;OAEG;IACO,iBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE/D;;OAEG;IACO,MAAM,CAAiD;IAEjE;;OAEG;IACO,YAAY,GAA+B,MAAM,CAAC,CAAA,mBAA0B,CAAA,CAAC,CAAC;IAExF,8GAA8G;IAE9G;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,KAAK,CAAC,KAAqD;QAElE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,WAAW,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAElE,iEAAiE;IACjE;QAEI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACjH,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;uGArEQ,YAAY;2FAAZ,YAAY;;SAAZ,YAAY;2FAAZ,YAAY;kBADxB,SAAS","sourcesContent":["import {Directive, EventEmitter, inject, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../misc/types';\nimport {DateTimeSADirective} from './dateTime/dateTime.directive';\n\n/**\n * Base class for date time directives, contains basic shared data\n */\n@Directive()\nexport class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue\n */\n protected ɵValue: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Instance of date time shared data, like formats and restrictions\n */\n protected dateTimeData: DateTimeSADirective<TDate> = inject(DateTimeSADirective<TDate>);\n\n //######################### public properties - implementation of DateTimeInputValue #########################\n\n /**\n * @inheritdoc\n */\n public get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n this.ɵValue = value;\n }\n\n /**\n * @inheritdoc\n */\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor()\n {\n this.initSubscriptions.add(this.dateTimeData.maxDateTimeChanges.subscribe(() => this.onMaxDateTimeChange()));\n this.initSubscriptions.add(this.dateTimeData.minDateTimeChanges.subscribe(() => this.onMinDateTimeChange()));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n}\n"]}
1
+ {"version":3,"file":"dateTimeBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/directives/dateTimeBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,YAAY,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,mBAAmB,EAAC,MAAM,+BAA+B,CAAC;;AAElE;;GAEG;AAEH,MAAM,OAAO,YAAY;IAErB,0EAA0E;IAE1E;;OAEG;IACO,iBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE/D;;OAEG;IACO,MAAM,CAAiD;IAEjE;;OAEG;IACO,YAAY,GAA+B,MAAM,CAAC,CAAA,mBAA0B,CAAA,CAAC,CAAC;IAExF,8GAA8G;IAE9G;;OAEG;IACH,IAAW,KAAK;QAEZ,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAW,KAAK,CAAC,KAAqD;QAElE,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACxB,CAAC;IAED;;OAEG;IACI,WAAW,GAAuB,IAAI,YAAY,EAAQ,CAAC;IAElE,iEAAiE;IACjE;QAEI,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;QAC7G,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IACjH,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED,uEAAuE;IAEvE;;OAEG;IACO,mBAAmB;IAE7B,CAAC;IAED;;OAEG;IACO,mBAAmB;IAE7B,CAAC;uGArEQ,YAAY;2FAAZ,YAAY;;2FAAZ,YAAY;kBADxB,SAAS","sourcesContent":["import {Directive, EventEmitter, inject, OnDestroy} from '@angular/core';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../misc/types';\nimport {DateTimeSADirective} from './dateTime/dateTime.directive';\n\n/**\n * Base class for date time directives, contains basic shared data\n */\n@Directive()\nexport class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate>, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n /**\n * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue\n */\n protected ɵValue: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Instance of date time shared data, like formats and restrictions\n */\n protected dateTimeData: DateTimeSADirective<TDate> = inject(DateTimeSADirective<TDate>);\n\n //######################### public properties - implementation of DateTimeInputValue #########################\n\n /**\n * @inheritdoc\n */\n public get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n this.ɵValue = value;\n }\n\n /**\n * @inheritdoc\n */\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor()\n {\n this.initSubscriptions.add(this.dateTimeData.maxDateTimeChanges.subscribe(() => this.onMaxDateTimeChange()));\n this.initSubscriptions.add(this.dateTimeData.minDateTimeChanges.subscribe(() => this.onMinDateTimeChange()));\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### protected methods #########################\n\n /**\n * Called whenever max date time restriction changes\n */\n protected onMaxDateTimeChange(): void\n {\n }\n\n /**\n * Called whenever min date time restriction changes\n */\n protected onMinDateTimeChange(): void\n {\n }\n}\n"]}
@@ -6,7 +6,7 @@ import * as i0 from "@angular/core";
6
6
  /**
7
7
  * Control value accessor that is used for getting and setting value for date time
8
8
  */
9
- class DateTimeControlValueAccessorSADirective {
9
+ export class DateTimeControlValueAccessorSADirective {
10
10
  input;
11
11
  //######################### protected properties #########################
12
12
  /**
@@ -49,8 +49,8 @@ class DateTimeControlValueAccessorSADirective {
49
49
  setDisabledState(isDisabled) {
50
50
  this.input.disabled = isDisabled;
51
51
  }
52
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, deps: [{ token: DATE_TIME_INPUT }], target: i0.ɵɵFactoryTarget.Directive });
53
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeControlValueAccessorSADirective, isStandalone: true, selector: "[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]", providers: [
52
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, deps: [{ token: DATE_TIME_INPUT }], target: i0.ɵɵFactoryTarget.Directive });
53
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeControlValueAccessorSADirective, isStandalone: true, selector: "[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]", providers: [
54
54
  {
55
55
  provide: NG_VALUE_ACCESSOR,
56
56
  useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),
@@ -58,8 +58,7 @@ class DateTimeControlValueAccessorSADirective {
58
58
  },
59
59
  ], ngImport: i0 });
60
60
  }
61
- export { DateTimeControlValueAccessorSADirective };
62
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, decorators: [{
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeControlValueAccessorSADirective, decorators: [{
63
62
  type: Directive,
64
63
  args: [{
65
64
  selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',
@@ -72,8 +71,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
72
71
  ],
73
72
  standalone: true,
74
73
  }]
75
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
74
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
76
75
  type: Inject,
77
76
  args: [DATE_TIME_INPUT]
78
- }] }]; } });
77
+ }] }] });
79
78
  //# sourceMappingURL=dateTimeControlValueAccessor.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACzF,OAAO,EAAuB,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;;AAGxD;;GAEG;AACH,MAca,uCAAuC;IAUD;IAR/C,0EAA0E;IAE1E;;OAEG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,GAAG,EAAE,wCAAwC,CAAC;4BACtE,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\n\n/**\n * Control value accessor that is used for getting and setting value for date time\n */\n@Directive(\n{\n selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class DateTimeControlValueAccessorSADirective<TDate = unknown> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.input.value = value;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: DateTimeInputOutputValue<TDate>|undefined|null) => void): void\n {\n this.initSubscriptions.add(this.input.valueChange.subscribe(() => fn(this.input.value)));\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.initSubscriptions.add(this.input.focus.subscribe(() => fn()));\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.input.disabled = isDisabled;\n }\n}"]}
1
+ {"version":3,"file":"dateTimeControlValueAccessor.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACzF,OAAO,EAAuB,iBAAiB,EAAC,MAAM,gBAAgB,CAAC;AACvE,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAGlC,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAC;;AAGxD;;GAEG;AAeH,MAAM,OAAO,uCAAuC;IAUD;IAR/C,0EAA0E;IAE1E;;OAEG;IACO,iBAAiB,GAAiB,IAAI,YAAY,EAAE,CAAC;IAE/D,iEAAiE;IACjE,YAA+C,KAA2B;QAA3B,UAAK,GAAL,KAAK,CAAsB;IAE1E,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,iBAAiB,CAAC,WAAW,EAAE,CAAC;IACzC,CAAC;IAED,6GAA6G;IAE7G;;OAEG;IACI,UAAU,CAAC,KAAqD;QAEnE,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC;IAC7B,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,EAAkE;QAEtF,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACI,iBAAiB,CAAC,EAAc;QAEnC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC;IACvE,CAAC;IAED;;OAEG;IACI,gBAAgB,CAAC,UAAmB;QAEvC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,UAAU,CAAC;IACrC,CAAC;uGAxDQ,uCAAuC,kBAU5B,eAAe;2FAV1B,uCAAuC,sHAVhD;YAEI;gBACI,OAAO,EAAE,iBAAiB;gBAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,uCAAuC,CAAC;gBACtE,KAAK,EAAE,IAAI;aACd;SACJ;;2FAGQ,uCAAuC;kBAdnD,SAAS;mBACV;oBACI,QAAQ,EAAE,yEAAyE;oBACnF,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,iBAAiB;4BAC1B,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,wCAAwC,CAAC;4BACtE,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\n\n/**\n * Control value accessor that is used for getting and setting value for date time\n */\n@Directive(\n{\n selector: '[dateTime][formControlName],[dateTime][formControl],[dateTime][ngModel]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => DateTimeControlValueAccessorSADirective),\n multi: true,\n },\n ],\n standalone: true,\n})\nexport class DateTimeControlValueAccessorSADirective<TDate = unknown> implements ControlValueAccessor, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Subscriptions created during initialization\n */\n protected initSubscriptions: Subscription = new Subscription();\n\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>)\n {\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.initSubscriptions.unsubscribe();\n }\n\n //######################### public methods - implementation of ControlValueAccessor #########################\n\n /**\n * @inheritdoc\n */\n public writeValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.input.value = value;\n }\n\n /**\n * @inheritdoc\n */\n public registerOnChange(fn: (data: DateTimeInputOutputValue<TDate>|undefined|null) => void): void\n {\n this.initSubscriptions.add(this.input.valueChange.subscribe(() => fn(this.input.value)));\n }\n\n /**\n * @inheritdoc\n */\n public registerOnTouched(fn: () => void): void\n {\n this.initSubscriptions.add(this.input.focus.subscribe(() => fn()));\n }\n\n /**\n * @inheritdoc\n */\n public setDisabledState(isDisabled: boolean): void\n {\n this.input.disabled = isDisabled;\n }\n}"]}
@@ -1,8 +1,8 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Directive, ElementRef, EventEmitter, forwardRef, Inject } from '@angular/core';
3
- import { BindThis, isBlank } from '@jscrpt/common';
3
+ import { BindThis } from '@jscrpt/common';
4
4
  import { DATE_API, DATE_TIME_INPUT } from '../../../../misc/tokens';
5
- import { formatDateTime, parseDateTime } from '../../../../misc/utils';
5
+ import { formatDateTime, getInternalValue } from '../../../../misc/utils';
6
6
  import { DateValueProvider } from '../../../../services';
7
7
  import { DateTimeBase } from '../dateTimeBase';
8
8
  import * as i0 from "@angular/core";
@@ -11,7 +11,7 @@ import * as i1 from "../../../../services";
11
11
  /**
12
12
  * Directive that is used for setting up date time input
13
13
  */
14
- class DateTimeInputSADirective extends DateTimeBase {
14
+ export class DateTimeInputSADirective extends DateTimeBase {
15
15
  elementRef;
16
16
  dateApi;
17
17
  valueProvider;
@@ -39,7 +39,7 @@ class DateTimeInputSADirective extends DateTimeBase {
39
39
  set value(value) {
40
40
  //accepts all available formats
41
41
  this.setInternalValue(value);
42
- this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
42
+ this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
43
43
  //not range value
44
44
  if (!Array.isArray(this.internalValue)) {
45
45
  this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);
@@ -97,33 +97,7 @@ class DateTimeInputSADirective extends DateTimeBase {
97
97
  * @param value - Value to be set
98
98
  */
99
99
  setInternalValue(value) {
100
- this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);
101
- if (isBlank(this.internalValue)) {
102
- return;
103
- }
104
- //update for specified format, round
105
- //ranged value
106
- if (Array.isArray(this.internalValue)) {
107
- const [from, to] = this.internalValue;
108
- if (from) {
109
- const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;
110
- if (val) {
111
- this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);
112
- }
113
- }
114
- if (to) {
115
- const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;
116
- if (val) {
117
- this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);
118
- }
119
- }
120
- }
121
- else {
122
- const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;
123
- if (val) {
124
- this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);
125
- }
126
- }
100
+ this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider);
127
101
  }
128
102
  /**
129
103
  * Handles input event on input
@@ -136,7 +110,7 @@ class DateTimeInputSADirective extends DateTimeBase {
136
110
  return;
137
111
  }
138
112
  this.setInternalValue(this.rawValue);
139
- this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
113
+ this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
140
114
  this.valueChange.next();
141
115
  }
142
116
  /**
@@ -153,8 +127,8 @@ class DateTimeInputSADirective extends DateTimeBase {
153
127
  handleBlur(event) {
154
128
  this.blur.emit(event);
155
129
  }
156
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeInputSADirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
157
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeInputSADirective, isStandalone: true, selector: "input[dateTime][dateTimeInput]", providers: [
130
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeInputSADirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
131
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeInputSADirective, isStandalone: true, selector: "input[dateTime][dateTimeInput]", providers: [
158
132
  {
159
133
  provide: DATE_TIME_INPUT,
160
134
  useExisting: forwardRef(() => DateTimeInputSADirective),
@@ -179,8 +153,7 @@ __decorate([
179
153
  __metadata("design:paramtypes", [FocusEvent]),
180
154
  __metadata("design:returntype", void 0)
181
155
  ], DateTimeInputSADirective.prototype, "handleBlur", null);
182
- export { DateTimeInputSADirective };
183
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeInputSADirective, decorators: [{
156
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeInputSADirective, decorators: [{
184
157
  type: Directive,
185
158
  args: [{
186
159
  selector: 'input[dateTime][dateTimeInput]',
@@ -193,8 +166,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
193
166
  standalone: true,
194
167
  exportAs: 'dateTime',
195
168
  }]
196
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
169
+ }], ctorParameters: () => [{ type: i0.ElementRef }, { type: undefined, decorators: [{
197
170
  type: Inject,
198
171
  args: [DATE_API]
199
- }] }, { type: i1.DateValueProvider }]; }, propDecorators: { handleInput: [], handleFocus: [], handleBlur: [] } });
172
+ }] }, { type: i1.DateValueProvider }], propDecorators: { handleInput: [], handleFocus: [], handleBlur: [] } });
200
173
  //# sourceMappingURL=dateTimeInput.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AACH,MAca,wBAA0C,SAAQ,YAAmB;IA8ExD;IACkB;IAClB;IA9EtB,0EAA0E;IAE1E;;OAEG;IACO,aAAa,CAA4C;IAEnE,yGAAyG;IAEzG;;OAEG;IACH,IAAW,QAAQ;QAEf,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC;IAC/C,CAAC;IACD,IAAW,QAAQ,CAAC,KAA4B;QAE5C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;IACtD,CAA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AC,YAAY,CAAC,CAAC;QAEhH,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IAEO,WAAW,CAAC,KAAiB;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;uGApMQ,wBAAwB,4CA+Eb,QAAQ;2FA/EnB,wBAAwB,6EAVjC;YAEI;gBACI,OAAO,EAAE,eAAe;gBACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;aAC1D;SACJ;;AAoKS;IADT,QAAQ;;;;2DAiBR;AAOS;IADT,QAAQ;;qCACoB,UAAU;;2DAGtC;AAOS;IADT,QAAQ;;qCACmB,UAAU;;0DAGrC;SApMQ,wBAAwB;2FAAxB,wBAAwB;kBAdpC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBAC1D;qBACJ;oBACD,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;4EAiFlB,WAAW,MAuBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //update for specified format, round\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,wBAA0C,SAAQ,YAAmB;IA8ExD;IACkB;IAClB;IA9EtB,0EAA0E;IAE1E;;OAEG;IACO,aAAa,CAA4C;IAEnE,yGAAyG;IAEzG;;OAEG;IACH,IAAW,QAAQ;QAEf,OAAO,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,CAAC;IAC/C,CAAC;IACD,IAAW,QAAQ,CAAC,KAA4B;QAE5C,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;IACtD,CAAC;IAED;;OAEG;IACH,IAAoB,KAAK;QAErB,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IACD,IAAoB,KAAK,CAAC,K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AI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IAEO,WAAW,CAAC,KAAiB;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;uGA1JQ,wBAAwB,4CA+Eb,QAAQ;2FA/EnB,wBAAwB,6EAVjC;YAEI;gBACI,OAAO,EAAE,eAAe;gBACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;aAC1D;SACJ;;AA0HS;IADT,QAAQ;;;;2DAiBR;AAOS;IADT,QAAQ;;qCACoB,UAAU;;2DAGtC;AAOS;IADT,QAAQ;;qCACmB,UAAU;;0DAGrC;2FA1JQ,wBAAwB;kBAdpC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBAC1D;qBACJ;oBACD,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;yEAuClB,WAAW,MAuBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, getInternalValue} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = getInternalValue(value, this.dateApi, this.dateTimeData, this.valueProvider);\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time max value
9
9
  */
10
- class DateTimeMaxValidatorSADirective extends DateTimeBase {
10
+ export class DateTimeMaxValidatorSADirective extends DateTimeBase {
11
11
  dateApi;
12
12
  //######################### private fields #########################
13
13
  /**
@@ -24,7 +24,7 @@ class DateTimeMaxValidatorSADirective extends DateTimeBase {
24
24
  * Initialize component
25
25
  */
26
26
  ngOnInit() {
27
- this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
27
+ this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
28
28
  }
29
29
  //######################### public methods - implementation of Validator #########################
30
30
  /**
@@ -40,10 +40,10 @@ class DateTimeMaxValidatorSADirective extends DateTimeBase {
40
40
  * @inheritdoc
41
41
  */
42
42
  onMaxDateTimeChange() {
43
- this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
43
+ this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
44
44
  }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeMaxValidatorSADirective, isStandalone: true, selector: "[dateTime][maxDateTime][validate]", providers: [
45
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeMaxValidatorSADirective, isStandalone: true, selector: "[dateTime][maxDateTime][validate]", providers: [
47
47
  {
48
48
  provide: NG_VALIDATORS,
49
49
  useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),
@@ -51,8 +51,7 @@ class DateTimeMaxValidatorSADirective extends DateTimeBase {
51
51
  },
52
52
  ], usesInheritance: true, ngImport: i0 });
53
53
  }
54
- export { DateTimeMaxValidatorSADirective };
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMaxValidatorSADirective, decorators: [{
56
55
  type: Directive,
57
56
  args: [{
58
57
  selector: '[dateTime][maxDateTime][validate]',
@@ -65,8 +64,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
65
64
  ],
66
65
  standalone: true,
67
66
  }]
68
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
67
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
69
68
  type: Inject,
70
69
  args: [DATE_API]
71
- }] }]; } });
70
+ }] }] });
72
71
  //# sourceMappingURL=dateTimeMaxValidator.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeMaxValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AACH,MAca,+BAAiD,SAAQ,YAAmB;IAU7C;IARxC,oEAAoE;IAEpE;;OAEG;IACK,UAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAE7C,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;IAG/D,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACvJ,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACvJ,CAAC;uGA7CQ,+BAA+B,kBAUpB,QAAQ;2FAVnB,+BAA+B,gFAVxC;YAEI;gBACI,OAAO,EAAE,aAAa;gBACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;gBAC9D,KAAK,EAAE,IAAI;aACd;SACJ;;SAGQ,+BAA+B;2FAA/B,+BAA+B;kBAd3C,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMaxValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time max value\n */\n@Directive(\n{\n selector: '[dateTime][maxDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMaxValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeMaxValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC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FAGQ,+BAA+B;kBAd3C,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMaxValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time max value\n */\n@Directive(\n{\n selector: '[dateTime][maxDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMaxValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMaxValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMaxDateTimeChange(): void\n {\n this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}
@@ -7,7 +7,7 @@ import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time min value
9
9
  */
10
- class DateTimeMinValidatorSADirective extends DateTimeBase {
10
+ export class DateTimeMinValidatorSADirective extends DateTimeBase {
11
11
  dateApi;
12
12
  //######################### private fields #########################
13
13
  /**
@@ -24,7 +24,7 @@ class DateTimeMinValidatorSADirective extends DateTimeBase {
24
24
  * Initialize component
25
25
  */
26
26
  ngOnInit() {
27
- this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
27
+ this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
28
28
  }
29
29
  //######################### public methods - implementation of Validator #########################
30
30
  /**
@@ -40,10 +40,10 @@ class DateTimeMinValidatorSADirective extends DateTimeBase {
40
40
  * @inheritdoc
41
41
  */
42
42
  onMinDateTimeChange() {
43
- this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
43
+ this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);
44
44
  }
45
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeMinValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
- static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.1", type: DateTimeMinValidatorSADirective, isStandalone: true, selector: "[dateTime][minDateTime][validate]", providers: [
45
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMinValidatorSADirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.1.1", type: DateTimeMinValidatorSADirective, isStandalone: true, selector: "[dateTime][minDateTime][validate]", providers: [
47
47
  {
48
48
  provide: NG_VALIDATORS,
49
49
  useExisting: forwardRef(() => DateTimeMinValidatorSADirective),
@@ -51,8 +51,7 @@ class DateTimeMinValidatorSADirective extends DateTimeBase {
51
51
  },
52
52
  ], usesInheritance: true, ngImport: i0 });
53
53
  }
54
- export { DateTimeMinValidatorSADirective };
55
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImport: i0, type: DateTimeMinValidatorSADirective, decorators: [{
54
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.1.1", ngImport: i0, type: DateTimeMinValidatorSADirective, decorators: [{
56
55
  type: Directive,
57
56
  args: [{
58
57
  selector: '[dateTime][minDateTime][validate]',
@@ -65,8 +64,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.1", ngImpor
65
64
  ],
66
65
  standalone: true,
67
66
  }]
68
- }], ctorParameters: function () { return [{ type: undefined, decorators: [{
67
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
69
68
  type: Inject,
70
69
  args: [DATE_API]
71
- }] }]; } });
70
+ }] }] });
72
71
  //# sourceMappingURL=dateTimeMinValidator.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeMinValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AA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;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMinValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time min value\n */\n@Directive(\n{\n selector: '[dateTime][minDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMinValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMinValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeMinValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAeH,MAAM,OAAO,+BAAiD,SAAQ,YAAmB;IAU7C;IARxC,oEAAoE;IAEpE;;OAEG;IACK,UAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAE7C,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;IAG/D,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;IAED,mFAAmF;IAEnF;;OAEG;IACgB,mBAAmB;QAElC,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,EAAE,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;IACrL,CAAC;uGA7CQ,+BAA+B,kBAUpB,QAAQ;2FAVnB,+BAA+B,gFAVxC;YAEI;gBACI,OAAO,EAAE,aAAa;gBACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,+BAA+B,CAAC;gBAC9D,KAAK,EAAE,IAAI;aACd;SACJ;;2FAGQ,+BAA+B;kBAd3C,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,gCAAgC,CAAC;4BAC9D,KAAK,EAAE,IAAI;yBACd;qBACJ;oBACD,UAAU,EAAE,IAAI;iBACnB;;0BAWgB,MAAM;2BAAC,QAAQ","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {DATE_API} from '../../../../misc/tokens';\nimport {datetimeMinValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time min value\n */\n@Directive(\n{\n selector: '[dateTime][minDateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeMinValidatorSADirective),\n multi: true\n },\n ],\n standalone: true,\n})\nexport class DateTimeMinValidatorSADirective<TDate = unknown> extends DateTimeBase<TDate> implements Validator, OnInit\n{\n //######################### private fields #########################\n\n /**\n * Function used for validations\n */\n private _validator: ValidatorFn = () => null;\n\n //######################### constructor #########################\n constructor(@Inject(DATE_API) protected dateApi: DateApi<TDate>,)\n {\n super();\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n\n //######################### public methods - implementation of Validator #########################\n\n /**\n * Validates input and returns validation result\n * @param control - Control that is being validated\n * @returns validation results\n */\n public validate(control: AbstractControl): ValidationErrors|null\n {\n return this._validator(control);\n }\n\n //######################### protected methods - overrides #########################\n\n /**\n * @inheritdoc\n */\n protected override onMinDateTimeChange(): void\n {\n this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat, this.dateTimeData.dataFormat);\n }\n}"]}