@anglr/datetime 5.0.0-beta.20221019093146 → 5.0.0-beta.20221020044622

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 (100) hide show
  1. package/changelog.md +26 -16
  2. package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js +0 -1
  3. package/es2015/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  4. package/es2015/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
  5. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js +221 -0
  6. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -0
  7. package/es2015/src/modules/dateTime/directives/dateTimeBase.js +25 -41
  8. package/es2015/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  9. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +16 -17
  10. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  11. package/es2015/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +10 -13
  12. package/es2015/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  13. package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +9 -11
  14. package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  15. package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +6 -8
  16. package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  17. package/es2015/src/modules/dateTime/directives/index.js +1 -1
  18. package/es2015/src/modules/dateTime/directives/index.js.map +1 -1
  19. package/es2015/src/modules/dateTime/modules/dateTime.module.js +7 -3
  20. package/es2015/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  21. package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +10 -10
  22. package/es2015/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -1
  23. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +11 -13
  24. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  25. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +66 -5
  26. package/es2015/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -1
  27. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +9 -3
  28. package/es2015/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -1
  29. package/es2015/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -1
  30. package/es2015/src/pipes/dateFormat.pipe.js +3 -9
  31. package/es2015/src/pipes/dateFormat.pipe.js.map +1 -1
  32. package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js +0 -1
  33. package/es2020/src/legacy/picker/components/dayPicker/dayPicker.component.js.map +1 -1
  34. package/es2020/src/legacy/picker/misc/datetimePicker.interface.js.map +1 -1
  35. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js +218 -0
  36. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -0
  37. package/es2020/src/modules/dateTime/directives/dateTimeBase.js +25 -41
  38. package/es2020/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  39. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +16 -17
  40. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  41. package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +10 -13
  42. package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  43. package/es2020/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +9 -11
  44. package/es2020/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  45. package/es2020/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +6 -8
  46. package/es2020/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  47. package/es2020/src/modules/dateTime/directives/index.js +1 -1
  48. package/es2020/src/modules/dateTime/directives/index.js.map +1 -1
  49. package/es2020/src/modules/dateTime/modules/dateTime.module.js +7 -3
  50. package/es2020/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  51. package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js +10 -10
  52. package/es2020/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.js.map +1 -1
  53. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +11 -13
  54. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  55. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js +63 -5
  56. package/es2020/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.js.map +1 -1
  57. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js +8 -3
  58. package/es2020/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.js.map +1 -1
  59. package/es2020/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.js.map +1 -1
  60. package/es2020/src/pipes/dateFormat.pipe.js +3 -9
  61. package/es2020/src/pipes/dateFormat.pipe.js.map +1 -1
  62. package/package.json +1 -1
  63. package/src/legacy/picker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  64. package/src/legacy/picker/misc/datetimePicker.interface.d.ts +0 -4
  65. package/src/legacy/picker/misc/datetimePicker.interface.d.ts.map +1 -1
  66. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +120 -0
  67. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -0
  68. package/src/modules/dateTime/directives/dateTimeBase.d.ts +19 -27
  69. package/src/modules/dateTime/directives/dateTimeBase.d.ts.map +1 -1
  70. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +3 -2
  71. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  72. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts +4 -4
  73. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts.map +1 -1
  74. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts +4 -4
  75. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts.map +1 -1
  76. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts +2 -2
  77. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts.map +1 -1
  78. package/src/modules/dateTime/directives/index.d.ts +1 -1
  79. package/src/modules/dateTime/directives/index.d.ts.map +1 -1
  80. package/src/modules/dateTime/modules/dateTime.module.d.ts +7 -6
  81. package/src/modules/dateTime/modules/dateTime.module.d.ts.map +1 -1
  82. package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts +21 -8
  83. package/src/modules/dateTimePicker/components/dateTimePeriodPickerBase.d.ts.map +1 -1
  84. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +4 -5
  85. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -1
  86. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts +24 -0
  87. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.d.ts.map +1 -1
  88. package/src/modules/dateTimePicker/components/dayPicker/dayPicker.component.html +11 -13
  89. package/src/modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive.d.ts.map +1 -1
  90. package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts +16 -8
  91. package/src/modules/dateTimePicker/interfaces/dateTimePicker/dateTimePicker.interface.d.ts.map +1 -1
  92. package/src/pipes/dateFormat.pipe.d.ts +28 -2
  93. package/src/pipes/dateFormat.pipe.d.ts.map +1 -1
  94. package/version.bak +1 -1
  95. package/es2015/src/modules/dateTime/directives/dateTimeRestrictedBase.js +0 -152
  96. package/es2015/src/modules/dateTime/directives/dateTimeRestrictedBase.js.map +0 -1
  97. package/es2020/src/modules/dateTime/directives/dateTimeRestrictedBase.js +0 -149
  98. package/es2020/src/modules/dateTime/directives/dateTimeRestrictedBase.js.map +0 -1
  99. package/src/modules/dateTime/directives/dateTimeRestrictedBase.d.ts +0 -74
  100. package/src/modules/dateTime/directives/dateTimeRestrictedBase.d.ts.map +0 -1
@@ -1,7 +1,7 @@
1
1
  import { __decorate, __metadata } from "tslib";
2
2
  import { Directive, ElementRef, EventEmitter, forwardRef, Inject } from '@angular/core';
3
3
  import { BindThis, isBlank } from '@jscrpt/common';
4
- import { DATE_API, DATE_TIME_INPUT, FORMAT_PROVIDER } from '../../../../misc/tokens';
4
+ import { DATE_API, DATE_TIME_INPUT } from '../../../../misc/tokens';
5
5
  import { formatDateTime, parseDateTime } from '../../../../misc/utils';
6
6
  import { DateValueProvider } from '../../../../services';
7
7
  import { DateTimeBase } from '../dateTimeBase';
@@ -13,9 +13,10 @@ import * as i1 from "../../../../services";
13
13
  */
14
14
  export class DateTimeInputDirective extends DateTimeBase {
15
15
  //######################### constructors #########################
16
- constructor(elementRef, dateApi, formatProvider, valueProvider) {
17
- super(dateApi, formatProvider);
16
+ constructor(elementRef, dateApi, valueProvider) {
17
+ super();
18
18
  this.elementRef = elementRef;
19
+ this.dateApi = dateApi;
19
20
  this.valueProvider = valueProvider;
20
21
  /**
21
22
  * @inheritdoc
@@ -49,10 +50,10 @@ export class DateTimeInputDirective extends DateTimeBase {
49
50
  var _a;
50
51
  //accepts all available formats
51
52
  this.setInternalValue(value);
52
- this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);
53
+ this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
53
54
  //not range value
54
55
  if (!Array.isArray(this.internalValue)) {
55
- this.rawValue = (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.format(this.customFormat);
56
+ this.rawValue = (_a = this.internalValue) === null || _a === void 0 ? void 0 : _a.format(this.dateTimeData.customFormat);
56
57
  }
57
58
  else {
58
59
  //TODO: add support for ranges
@@ -78,6 +79,7 @@ export class DateTimeInputDirective extends DateTimeBase {
78
79
  * Called when component is destroyed
79
80
  */
80
81
  ngOnDestroy() {
82
+ super.ngOnDestroy();
81
83
  this.elementRef.nativeElement.removeEventListener('input', this.handleInput);
82
84
  this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);
83
85
  this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);
@@ -88,7 +90,7 @@ export class DateTimeInputDirective extends DateTimeBase {
88
90
  * @param value - Value to be set
89
91
  */
90
92
  setInternalValue(value) {
91
- this.internalValue = parseDateTime(value, this.dateApi, null, this.customFormat);
93
+ this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);
92
94
  if (isBlank(this.internalValue)) {
93
95
  return;
94
96
  }
@@ -96,22 +98,22 @@ export class DateTimeInputDirective extends DateTimeBase {
96
98
  if (Array.isArray(this.internalValue)) {
97
99
  const [from, to] = this.internalValue;
98
100
  if (from) {
99
- const val = this.valueProvider.getValue(from.value, this.customFormat).from;
101
+ const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;
100
102
  if (val) {
101
- this.internalValue[0] = this.dateApi.getValue(val, this.customFormat);
103
+ this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);
102
104
  }
103
105
  }
104
106
  if (to) {
105
- const val = this.valueProvider.getValue(to.value, this.customFormat).to;
107
+ const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;
106
108
  if (val) {
107
- this.internalValue[1] = this.dateApi.getValue(val, this.customFormat);
109
+ this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);
108
110
  }
109
111
  }
110
112
  }
111
113
  else {
112
- const val = this.valueProvider.getValue(this.internalValue.value, this.customFormat).from;
114
+ const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;
113
115
  if (val) {
114
- this.internalValue = this.dateApi.getValue(val, this.customFormat);
116
+ this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);
115
117
  }
116
118
  }
117
119
  }
@@ -126,7 +128,7 @@ export class DateTimeInputDirective extends DateTimeBase {
126
128
  return;
127
129
  }
128
130
  this.setInternalValue(this.rawValue);
129
- this.ɵValue = formatDateTime(this.internalValue, this.valueFormat, this.customFormat);
131
+ this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
130
132
  this.valueChange.next();
131
133
  }
132
134
  /**
@@ -144,7 +146,7 @@ export class DateTimeInputDirective extends DateTimeBase {
144
146
  this.blur.emit(event);
145
147
  }
146
148
  }
147
- DateTimeInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeInputDirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: FORMAT_PROVIDER }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
149
+ DateTimeInputDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeInputDirective, deps: [{ token: i0.ElementRef }, { token: DATE_API }, { token: i1.DateValueProvider }], target: i0.ɵɵFactoryTarget.Directive });
148
150
  DateTimeInputDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimeInputDirective, selector: "input[dateTime][dateTimeInput]", providers: [
149
151
  {
150
152
  provide: DATE_TIME_INPUT,
@@ -184,8 +186,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
184
186
  }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: undefined, decorators: [{
185
187
  type: Inject,
186
188
  args: [DATE_API]
187
- }] }, { type: undefined, decorators: [{
188
- type: Inject,
189
- args: [FORMAT_PROVIDER]
190
189
  }] }, { type: i1.DateValueProvider }]; }, propDecorators: { handleInput: [], handleFocus: [], handleBlur: [] } });
191
190
  //# 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,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAEnF,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,MAAM,OAAO,sBAAwC,SAAQ,YAAmB;IA6E5E,kEAAkE;IAClE,YAAsB,UAAwC,EAChC,OAAuB,EAChB,cAA8B,EAC7C,aAAuC;QAEzD,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QALb,eAAU,GAAV,UAAU,CAA8B;QAGxC,kBAAa,GAAb,aAAa,CAA0B;QAd7D;;WAEG;QACI,UAAK,GAA6B,IAAI,YAAY,EAAc,CAAC;QAExE;;WAEG;QACI,SAAI,GAA6B,IAAI,YAAY,EAAc,CAAC;QAUnE,IAAI,CAAC,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;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;mHAjMQ,sBAAsB,4CA+EX,QAAQ,aACR,eAAe;uGAhF1B,sBAAsB,yDAT/B;QAEI;YACI,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,sBAAsB,CAAC;SACxD;KACJ;;IA+JA,QAAQ;;;;yDAiBR;;IAMA,QAAQ;;qCACoB,UAAU;;yDAGtC;;IAMA,QAAQ;;qCACmB,UAAU;;wDAGrC;2FAjMQ,sBAAsB;kBAblC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;yBACxD;qBACJ;oBACD,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,eAAe;4EA6EzB,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, FormatProvider} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT, FORMAT_PROVIDER} 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(() => DateTimeInputDirective),\n },\n ],\n exportAs: 'dateTime',\n})\nexport class DateTimeInputDirective<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.valueFormat, this.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.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) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super(dateApi, formatProvider);\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 ngOnDestroy(): void\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.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\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.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.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.valueFormat, this.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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J;;IAgKA,QAAQ;;;;yDAiBR;;IAMA,QAAQ;;qCACoB,UAAU;;yDAGtC;;IAMA,QAAQ;;qCACmB,UAAU;;wDAGrC;2FAlMQ,sBAAsB;kBAblC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,uBAAuB,CAAC;yBACxD;qBACJ;oBACD,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;4EA+ElB,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(() => DateTimeInputDirective),\n },\n ],\n exportAs: 'dateTime',\n})\nexport class DateTimeInputDirective<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 //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,29 +1,29 @@
1
1
  import { Directive, forwardRef, Inject } from '@angular/core';
2
2
  import { NG_VALIDATORS } from '@angular/forms';
3
- import { DATE_API, FORMAT_PROVIDER } from '../../../../misc/tokens';
4
- import { datetimeMaxValidator, datetimeValidator } from '../../../../misc/validators';
5
- import { DateTimeRestrictedBase } from '../dateTimeRestrictedBase';
3
+ import { DATE_API } from '../../../../misc/tokens';
4
+ import { datetimeMaxValidator } from '../../../../misc/validators';
5
+ import { DateTimeBase } from '../dateTimeBase';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time max value
9
9
  */
10
- export class DateTimeMaxValidatorDirective extends DateTimeRestrictedBase {
10
+ export class DateTimeMaxValidatorDirective extends DateTimeBase {
11
11
  //######################### constructor #########################
12
- constructor(dateApi, formatProvider) {
13
- super(dateApi, formatProvider);
12
+ constructor(dateApi) {
13
+ super();
14
+ this.dateApi = dateApi;
14
15
  //######################### private fields #########################
15
16
  /**
16
17
  * Function used for validations
17
18
  */
18
19
  this._validator = () => null;
19
- this._validator = datetimeValidator(dateApi, null, null);
20
20
  }
21
21
  //######################### public methods - implementation of OnInit #########################
22
22
  /**
23
23
  * Initialize component
24
24
  */
25
25
  ngOnInit() {
26
- this._validator = datetimeMaxValidator(this.dateApi, this.maxDateTime, this.valueFormat, this.customFormat);
26
+ this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
27
27
  }
28
28
  //######################### public methods - implementation of Validator #########################
29
29
  /**
@@ -39,10 +39,10 @@ export class DateTimeMaxValidatorDirective extends DateTimeRestrictedBase {
39
39
  * @inheritdoc
40
40
  */
41
41
  onMaxDateTimeChange() {
42
- this._validator = datetimeMaxValidator(this.dateApi, this.maxDateTime, this.valueFormat, this.customFormat);
42
+ this._validator = datetimeMaxValidator(this.dateApi, this.dateTimeData.maxDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
43
43
  }
44
44
  }
45
- DateTimeMaxValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeMaxValidatorDirective, deps: [{ token: DATE_API }, { token: FORMAT_PROVIDER }], target: i0.ɵɵFactoryTarget.Directive });
45
+ DateTimeMaxValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeMaxValidatorDirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
46
46
  DateTimeMaxValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimeMaxValidatorDirective, selector: "[dateTime][maxDateTime][validate]", providers: [
47
47
  {
48
48
  provide: NG_VALIDATORS,
@@ -65,8 +65,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
65
65
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
66
66
  type: Inject,
67
67
  args: [DATE_API]
68
- }] }, { type: undefined, decorators: [{
69
- type: Inject,
70
- args: [FORMAT_PROVIDER]
71
68
  }] }]; } });
72
69
  //# 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;AAGxG,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAE,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAEpF,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;;AAEjE;;GAEG;AAcH,MAAM,OAAO,6BAA+C,SAAQ,sBAA6B;IAS7F,iEAAiE;IACjE,YAA8B,OAAuB,EAChB,cAA8B;QAE/D,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAXnC,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;QAOzC,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;IAC7D,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChH,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,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChH,CAAC;;0HA/CQ,6BAA6B,kBAUlB,QAAQ,aACR,eAAe;8GAX1B,6BAA6B,4DATtC;QAEI;YACI,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;YAC5D,KAAK,EAAE,IAAI;SACd;KACJ;2FAEQ,6BAA6B;kBAbzC,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;0BAWgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {datetimeMaxValidator, datetimeValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeRestrictedBase} from '../dateTimeRestrictedBase';\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(() => DateTimeMaxValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeMaxValidatorDirective<TDate = unknown> extends DateTimeRestrictedBase<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) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,)\n {\n super(dateApi, formatProvider);\n this._validator = datetimeValidator(dateApi, null, null);\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.maxDateTime, this.valueFormat, this.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.maxDateTime, this.valueFormat, this.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,MAAM,yBAAyB,CAAC;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AAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;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(() => DateTimeMaxValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeMaxValidatorDirective<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,16 +1,17 @@
1
1
  import { Directive, forwardRef, Inject } from '@angular/core';
2
2
  import { NG_VALIDATORS } from '@angular/forms';
3
- import { DATE_API, FORMAT_PROVIDER } from '../../../../misc/tokens';
3
+ import { DATE_API } from '../../../../misc/tokens';
4
4
  import { datetimeMinValidator } from '../../../../misc/validators';
5
- import { DateTimeRestrictedBase } from '../dateTimeRestrictedBase';
5
+ import { DateTimeBase } from '../dateTimeBase';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Applies validator for date time min value
9
9
  */
10
- export class DateTimeMinValidatorDirective extends DateTimeRestrictedBase {
10
+ export class DateTimeMinValidatorDirective extends DateTimeBase {
11
11
  //######################### constructor #########################
12
- constructor(dateApi, formatProvider) {
13
- super(dateApi, formatProvider);
12
+ constructor(dateApi) {
13
+ super();
14
+ this.dateApi = dateApi;
14
15
  //######################### private fields #########################
15
16
  /**
16
17
  * Function used for validations
@@ -22,7 +23,7 @@ export class DateTimeMinValidatorDirective extends DateTimeRestrictedBase {
22
23
  * Initialize component
23
24
  */
24
25
  ngOnInit() {
25
- this._validator = datetimeMinValidator(this.dateApi, this.minDateTime, this.valueFormat, this.customFormat);
26
+ this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
26
27
  }
27
28
  //######################### public methods - implementation of Validator #########################
28
29
  /**
@@ -38,10 +39,10 @@ export class DateTimeMinValidatorDirective extends DateTimeRestrictedBase {
38
39
  * @inheritdoc
39
40
  */
40
41
  onMinDateTimeChange() {
41
- this._validator = datetimeMinValidator(this.dateApi, this.minDateTime, this.valueFormat, this.customFormat);
42
+ this._validator = datetimeMinValidator(this.dateApi, this.dateTimeData.minDateTime, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
42
43
  }
43
44
  }
44
- DateTimeMinValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeMinValidatorDirective, deps: [{ token: DATE_API }, { token: FORMAT_PROVIDER }], target: i0.ɵɵFactoryTarget.Directive });
45
+ DateTimeMinValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeMinValidatorDirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
45
46
  DateTimeMinValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimeMinValidatorDirective, selector: "[dateTime][minDateTime][validate]", providers: [
46
47
  {
47
48
  provide: NG_VALIDATORS,
@@ -64,8 +65,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
64
65
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
65
66
  type: Inject,
66
67
  args: [DATE_API]
67
- }] }, { type: undefined, decorators: [{
68
- type: Inject,
69
- args: [FORMAT_PROVIDER]
70
68
  }] }]; } });
71
69
  //# 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;AAGxG,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,sBAAsB,EAAC,MAAM,2BAA2B,CAAC;;AAEjE;;GAEG;AAcH,MAAM,OAAO,6BAA+C,SAAQ,sBAA6B;IAS7F,iEAAiE;IACjE,YAA8B,OAAuB,EAChB,cAA8B;QAE/D,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAXnC,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAO7C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,oBAAoB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChH,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,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAChH,CAAC;;0HA9CQ,6BAA6B,kBAUlB,QAAQ,aACR,eAAe;8GAX1B,6BAA6B,4DATtC;QAEI;YACI,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,6BAA6B,CAAC;YAC5D,KAAK,EAAE,IAAI;SACd;KACJ;2FAEQ,6BAA6B;kBAbzC,SAAS;mBACV;oBACI,QAAQ,EAAE,mCAAmC;oBAC7C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;0BAWgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {datetimeMinValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeRestrictedBase} from '../dateTimeRestrictedBase';\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(() => DateTimeMinValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeMinValidatorDirective<TDate = unknown> extends DateTimeRestrictedBase<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) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,)\n {\n super(dateApi, formatProvider);\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.minDateTime, this.valueFormat, this.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.minDateTime, this.valueFormat, this.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,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AAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,8BAA8B,CAAC;4BAC5D,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;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(() => DateTimeMinValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeMinValidatorDirective<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,6 +1,6 @@
1
1
  import { Directive, forwardRef, Inject } from '@angular/core';
2
2
  import { NG_VALIDATORS } from '@angular/forms';
3
- import { DATE_API, FORMAT_PROVIDER } from '../../../../misc/tokens';
3
+ import { DATE_API } from '../../../../misc/tokens';
4
4
  import { datetimeValidator } from '../../../../misc/validators';
5
5
  import { DateTimeBase } from '../dateTimeBase';
6
6
  import * as i0 from "@angular/core";
@@ -9,8 +9,9 @@ import * as i0 from "@angular/core";
9
9
  */
10
10
  export class DateTimeValidatorDirective extends DateTimeBase {
11
11
  //######################### constructor #########################
12
- constructor(dateApi, formatProvider) {
13
- super(dateApi, formatProvider);
12
+ constructor(dateApi) {
13
+ super();
14
+ this.dateApi = dateApi;
14
15
  //######################### private fields #########################
15
16
  /**
16
17
  * Function used for validations
@@ -22,7 +23,7 @@ export class DateTimeValidatorDirective extends DateTimeBase {
22
23
  * Initialize component
23
24
  */
24
25
  ngOnInit() {
25
- this._validator = datetimeValidator(this.dateApi, this.valueFormat, this.customFormat);
26
+ this._validator = datetimeValidator(this.dateApi, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);
26
27
  }
27
28
  //######################### public methods - implementation of Validator #########################
28
29
  /**
@@ -34,7 +35,7 @@ export class DateTimeValidatorDirective extends DateTimeBase {
34
35
  return this._validator(control);
35
36
  }
36
37
  }
37
- DateTimeValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeValidatorDirective, deps: [{ token: DATE_API }, { token: FORMAT_PROVIDER }], target: i0.ɵɵFactoryTarget.Directive });
38
+ DateTimeValidatorDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeValidatorDirective, deps: [{ token: DATE_API }], target: i0.ɵɵFactoryTarget.Directive });
38
39
  DateTimeValidatorDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.2.6", type: DateTimeValidatorDirective, selector: "[dateTime][validate]", providers: [
39
40
  {
40
41
  provide: NG_VALIDATORS,
@@ -57,8 +58,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
57
58
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
58
59
  type: Inject,
59
60
  args: [DATE_API]
60
- }] }, { type: undefined, decorators: [{
61
- type: Inject,
62
- args: [FORMAT_PROVIDER]
63
61
  }] }]; } });
64
62
  //# sourceMappingURL=dateTimeValidator.directive.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAoB,UAAU,EAAE,MAAM,EAAS,MAAM,eAAe,CAAC;AACtF,OAAO,EAAkB,aAAa,EAA2C,MAAM,gBAAgB,CAAC;AAGxG,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAcH,MAAM,OAAO,0BAA4C,SAAQ,YAAmB;IAShF,iEAAiE;IACjE,YAA8B,OAAuB,EAChB,cAA8B;QAE/D,KAAK,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC;QAXnC,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAO7C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3F,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;;uHApCQ,0BAA0B,kBAUf,QAAQ,aACR,eAAe;2GAX1B,0BAA0B,+CATnC;QAEI;YACI,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;YACzD,KAAK,EAAE,IAAI;SACd;KACJ;2FAEQ,0BAA0B;kBAbtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;4BACzD,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;0BAWgB,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,eAAe","sourcesContent":["import {Directive, ExistingProvider, forwardRef, Inject, OnInit} from '@angular/core';\nimport {AbstractControl, NG_VALIDATORS, ValidationErrors, Validator, ValidatorFn} from '@angular/forms';\n\nimport {FormatProvider} from '../../../../interfaces';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {datetimeValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time\n */\n@Directive(\n{\n selector: '[dateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeValidatorDirective<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) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,)\n {\n super(dateApi, formatProvider);\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this._validator = datetimeValidator(this.dateApi, this.valueFormat, this.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}"]}
1
+ {"version":3,"file":"dateTimeValidator.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.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,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAcH,MAAM,OAAO,0BAA4C,SAAQ,YAAmB;IAShF,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,KAAK,EAAE,CAAC;QAF4B,YAAO,GAAP,OAAO,CAAgB;QAR/D,oEAAoE;QAEpE;;WAEG;QACK,eAAU,GAAgB,GAAG,EAAE,CAAC,IAAI,CAAC;IAM7C,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,UAAU,GAAG,iBAAiB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;IACrH,CAAC;IAED,kGAAkG;IAElG;;;;OAIG;IACI,QAAQ,CAAC,OAAwB;QAEpC,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IACpC,CAAC;;uHAnCQ,0BAA0B,kBAUf,QAAQ;2GAVnB,0BAA0B,+CATnC;QAEI;YACI,OAAO,EAAE,aAAa;YACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,0BAA0B,CAAC;YACzD,KAAK,EAAE,IAAI;SACd;KACJ;2FAEQ,0BAA0B;kBAbtC,SAAS;mBACV;oBACI,QAAQ,EAAE,sBAAsB;oBAChC,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,aAAa;4BACtB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,2BAA2B,CAAC;4BACzD,KAAK,EAAE,IAAI;yBACd;qBACJ;iBACJ;;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 {datetimeValidator} from '../../../../misc/validators';\nimport {DateApi} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n/**\n * Applies validator for date time\n */\n@Directive(\n{\n selector: '[dateTime][validate]',\n providers:\n [\n <ExistingProvider>\n {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => DateTimeValidatorDirective),\n multi: true\n },\n ],\n})\nexport class DateTimeValidatorDirective<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 = datetimeValidator(this.dateApi, 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}"]}
@@ -1,8 +1,8 @@
1
+ export * from './dateTime/dateTime.directive';
1
2
  export * from './dateTimeBase';
2
3
  export * from './dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive';
3
4
  export * from './dateTimeInput/dateTimeInput.directive';
4
5
  export * from './dateTimeMaxValidator/dateTimeMaxValidator.directive';
5
6
  export * from './dateTimeMinValidator/dateTimeMinValidator.directive';
6
- export * from './dateTimeRestrictedBase';
7
7
  export * from './dateTimeValidator/dateTimeValidator.directive';
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uEAAuE,CAAC;AACtF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,0BAA0B,CAAC;AACzC,cAAc,iDAAiD,CAAC","sourcesContent":["export * from './dateTimeBase';\nexport * from './dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive';\nexport * from './dateTimeInput/dateTimeInput.directive';\nexport * from './dateTimeMaxValidator/dateTimeMaxValidator.directive';\nexport * from './dateTimeMinValidator/dateTimeMinValidator.directive';\nexport * from './dateTimeRestrictedBase';\nexport * from './dateTimeValidator/dateTimeValidator.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAC9C,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uEAAuE,CAAC;AACtF,cAAc,yCAAyC,CAAC;AACxD,cAAc,uDAAuD,CAAC;AACtE,cAAc,uDAAuD,CAAC;AACtE,cAAc,iDAAiD,CAAC","sourcesContent":["export * from './dateTime/dateTime.directive';\nexport * from './dateTimeBase';\nexport * from './dateTimeControlValueAccessor/dateTimeControlValueAccessor.directive';\nexport * from './dateTimeInput/dateTimeInput.directive';\nexport * from './dateTimeMaxValidator/dateTimeMaxValidator.directive';\nexport * from './dateTimeMinValidator/dateTimeMinValidator.directive';\nexport * from './dateTimeValidator/dateTimeValidator.directive';\n"]}
@@ -1,5 +1,5 @@
1
1
  import { NgModule } from '@angular/core';
2
- import { DateTimeControlValueAccessorDirective, DateTimeInputDirective, DateTimeMaxValidatorDirective, DateTimeMinValidatorDirective, DateTimeValidatorDirective } from '../directives';
2
+ import { DateTimeControlValueAccessorDirective, DateTimeDirective, DateTimeInputDirective, DateTimeMaxValidatorDirective, DateTimeMinValidatorDirective, DateTimeValidatorDirective } from '../directives';
3
3
  import * as i0 from "@angular/core";
4
4
  /**
5
5
  * Module for basic date time directives, components, pipes
@@ -7,11 +7,13 @@ import * as i0 from "@angular/core";
7
7
  export class DateTimeModule {
8
8
  }
9
9
  DateTimeModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
10
- DateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimeModule, declarations: [DateTimeControlValueAccessorDirective,
10
+ DateTimeModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.6", ngImport: i0, type: DateTimeModule, declarations: [DateTimeDirective,
11
+ DateTimeControlValueAccessorDirective,
11
12
  DateTimeInputDirective,
12
13
  DateTimeMaxValidatorDirective,
13
14
  DateTimeMinValidatorDirective,
14
- DateTimeValidatorDirective], exports: [DateTimeControlValueAccessorDirective,
15
+ DateTimeValidatorDirective], exports: [DateTimeDirective,
16
+ DateTimeControlValueAccessorDirective,
15
17
  DateTimeInputDirective,
16
18
  DateTimeMaxValidatorDirective,
17
19
  DateTimeMinValidatorDirective,
@@ -21,6 +23,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
21
23
  type: NgModule,
22
24
  args: [{
23
25
  declarations: [
26
+ DateTimeDirective,
24
27
  DateTimeControlValueAccessorDirective,
25
28
  DateTimeInputDirective,
26
29
  DateTimeMaxValidatorDirective,
@@ -28,6 +31,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
28
31
  DateTimeValidatorDirective,
29
32
  ],
30
33
  exports: [
34
+ DateTimeDirective,
31
35
  DateTimeControlValueAccessorDirective,
32
36
  DateTimeInputDirective,
33
37
  DateTimeMaxValidatorDirective,
@@ -1 +1 @@
1
- {"version":3,"file":"dateTime.module.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/modules/dateTime.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,qCAAqC,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,0BAA0B,EAAC,MAAM,eAAe,CAAC;;AAEtL;;GAEG;AAoBH,MAAM,OAAO,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAfnB,qCAAqC;QACrC,sBAAsB;QACtB,6BAA6B;QAC7B,6BAA6B;QAC7B,0BAA0B,aAI1B,qCAAqC;QACrC,sBAAsB;QACtB,6BAA6B;QAC7B,6BAA6B;QAC7B,0BAA0B;4GAGrB,cAAc;2FAAd,cAAc;kBAnB1B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,qCAAqC;wBACrC,sBAAsB;wBACtB,6BAA6B;wBAC7B,6BAA6B;wBAC7B,0BAA0B;qBAC7B;oBACD,OAAO,EACP;wBACI,qCAAqC;wBACrC,sBAAsB;wBACtB,6BAA6B;wBAC7B,6BAA6B;wBAC7B,0BAA0B;qBAC7B;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateTimeControlValueAccessorDirective, DateTimeInputDirective, DateTimeMaxValidatorDirective, DateTimeMinValidatorDirective, DateTimeValidatorDirective} from '../directives';\n\n/**\n * Module for basic date time directives, components, pipes\n */\n@NgModule(\n{\n declarations:\n [\n DateTimeControlValueAccessorDirective,\n DateTimeInputDirective,\n DateTimeMaxValidatorDirective,\n DateTimeMinValidatorDirective,\n DateTimeValidatorDirective,\n ],\n exports:\n [\n DateTimeControlValueAccessorDirective,\n DateTimeInputDirective,\n DateTimeMaxValidatorDirective,\n DateTimeMinValidatorDirective,\n DateTimeValidatorDirective,\n ],\n})\nexport class DateTimeModule\n{\n}"]}
1
+ {"version":3,"file":"dateTime.module.js","sourceRoot":"","sources":["../../../../../src/modules/dateTime/modules/dateTime.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAC;AAEvC,OAAO,EAAC,qCAAqC,EAAE,iBAAiB,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,6BAA6B,EAAE,0BAA0B,EAAC,MAAM,eAAe,CAAC;;AAEzM;;GAEG;AAsBH,MAAM,OAAO,cAAc;;2GAAd,cAAc;4GAAd,cAAc,iBAjBnB,iBAAiB;QACjB,qCAAqC;QACrC,sBAAsB;QACtB,6BAA6B;QAC7B,6BAA6B;QAC7B,0BAA0B,aAI1B,iBAAiB;QACjB,qCAAqC;QACrC,sBAAsB;QACtB,6BAA6B;QAC7B,6BAA6B;QAC7B,0BAA0B;4GAGrB,cAAc;2FAAd,cAAc;kBArB1B,QAAQ;mBACT;oBACI,YAAY,EACZ;wBACI,iBAAiB;wBACjB,qCAAqC;wBACrC,sBAAsB;wBACtB,6BAA6B;wBAC7B,6BAA6B;wBAC7B,0BAA0B;qBAC7B;oBACD,OAAO,EACP;wBACI,iBAAiB;wBACjB,qCAAqC;wBACrC,sBAAsB;wBACtB,6BAA6B;wBAC7B,6BAA6B;wBAC7B,0BAA0B;qBAC7B;iBACJ","sourcesContent":["import {NgModule} from '@angular/core';\n\nimport {DateTimeControlValueAccessorDirective, DateTimeDirective, DateTimeInputDirective, DateTimeMaxValidatorDirective, DateTimeMinValidatorDirective, DateTimeValidatorDirective} from '../directives';\n\n/**\n * Module for basic date time directives, components, pipes\n */\n@NgModule(\n{\n declarations:\n [\n DateTimeDirective,\n DateTimeControlValueAccessorDirective,\n DateTimeInputDirective,\n DateTimeMaxValidatorDirective,\n DateTimeMinValidatorDirective,\n DateTimeValidatorDirective,\n ],\n exports:\n [\n DateTimeDirective,\n DateTimeControlValueAccessorDirective,\n DateTimeInputDirective,\n DateTimeMaxValidatorDirective,\n DateTimeMinValidatorDirective,\n DateTimeValidatorDirective,\n ],\n})\nexport class DateTimeModule\n{\n}"]}
@@ -10,21 +10,21 @@ export class DateTimePeriodPickerBase {
10
10
  */
11
11
  this.valueChangeSubject = new Subject();
12
12
  /**
13
- * Subject used for emitting of go up
13
+ * Subject used for scaling up
14
14
  */
15
- this.goUpSubject = new Subject();
15
+ this.scaleUpSubject = new Subject();
16
16
  /**
17
- * Subject used for emitting of go down
17
+ * Subject used for scaling down
18
18
  */
19
- this.goDownSubject = new Subject();
19
+ this.scaleDownSubject = new Subject();
20
20
  /**
21
21
  * @inheritdoc
22
22
  */
23
- this.canGoUp = false;
23
+ this.canScaleUp = false;
24
24
  /**
25
25
  * @inheritdoc
26
26
  */
27
- this.canGoDown = false;
27
+ this.canScaleDown = false;
28
28
  }
29
29
  /**
30
30
  * @inheritdoc
@@ -35,14 +35,14 @@ export class DateTimePeriodPickerBase {
35
35
  /**
36
36
  * @inheritdoc
37
37
  */
38
- get goUp() {
39
- return this.goUpSubject.asObservable();
38
+ get scaleUp() {
39
+ return this.scaleUpSubject.asObservable();
40
40
  }
41
41
  /**
42
42
  * @inheritdoc
43
43
  */
44
- get goDown() {
45
- return this.goDownSubject.asObservable();
44
+ get scaleDown() {
45
+ return this.scaleDownSubject.asObservable();
46
46
  }
47
47
  }
48
48
  //# sourceMappingURL=dateTimePeriodPickerBase.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimePeriodPickerBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/components/dateTimePeriodPickerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAKzC;;GAEG;AACH,MAAM,OAAgB,wBAAwB;IAA9C;QAEI,0EAA0E;QAE1E;;WAEG;QACO,uBAAkB,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAElE;;WAEG;QACO,gBAAW,GAAmB,IAAI,OAAO,EAAS,CAAC;QAE7D;;WAEG;QACO,kBAAa,GAAmB,IAAI,OAAO,EAAS,CAAC;QAmB/D;;WAEG;QACI,YAAO,GAAY,KAAK,CAAC;QAEhC;;WAEG;QACI,cAAS,GAAY,KAAK,CAAC;IAyBtC,CAAC;IAvBG;;OAEG;IACH,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,IAAI;QAEX,OAAO,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAEb,OAAO,IAAI,CAAC,aAAa,CAAC,YAAY,EAAE,CAAC;IAC7C,CAAC;CACJ","sourcesContent":["import {Observable, Subject} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../misc/types';\nimport {DateTimePicker} from '../interfaces';\n\n/**\n * Base abstract class for each date time period picker\n */\nexport abstract class DateTimePeriodPickerBase<TDate = unknown, TOptions = unknown> implements DateTimePicker<TDate, TOptions>\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting of value changes\n */\n protected valueChangeSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for emitting of go up\n */\n protected goUpSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Subject used for emitting of go down\n */\n protected goDownSubject: Subject<TDate> = new Subject<TDate>();\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * @inheritdoc\n */\n public value: DateTimeObjectValue<TDate>|undefined|null;\n\n /**\n * @inheritdoc\n */\n public options: TOptions|undefined|null;\n\n /**\n * @inheritdoc\n */\n public display: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public canGoUp: boolean = false;\n\n /**\n * @inheritdoc\n */\n public canGoDown: boolean = false;\n\n /**\n * @inheritdoc\n */\n public get valueChange(): Observable<void>\n {\n return this.valueChangeSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get goUp(): Observable<TDate>\n {\n return this.goUpSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get goDown(): Observable<TDate>\n {\n return this.goDownSubject.asObservable();\n }\n}"]}
1
+ {"version":3,"file":"dateTimePeriodPickerBase.js","sourceRoot":"","sources":["../../../../../src/modules/dateTimePicker/components/dateTimePeriodPickerBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,OAAO,EAAC,MAAM,MAAM,CAAC;AAMzC;;GAEG;AACH,MAAM,OAAgB,wBAAwB;IAA9C;QAEI,0EAA0E;QAE1E;;WAEG;QACO,uBAAkB,GAAkB,IAAI,OAAO,EAAQ,CAAC;QAElE;;WAEG;QACO,mBAAc,GAAmB,IAAI,OAAO,EAAS,CAAC;QAEhE;;WAEG;QACO,qBAAgB,GAAmB,IAAI,OAAO,EAAS,CAAC;QAkClE;;WAEG;QACI,eAAU,GAAY,KAAK,CAAC;QAEnC;;WAEG;QACI,iBAAY,GAAY,KAAK,CAAC;IAyBzC,CAAC;IAvBG;;OAEG;IACH,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,kBAAkB,CAAC,YAAY,EAAE,CAAC;IAClD,CAAC;IAED;;OAEG;IACH,IAAW,OAAO;QAEd,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IAC9C,CAAC;IAED;;OAEG;IACH,IAAW,SAAS;QAEhB,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,EAAE,CAAC;IAChD,CAAC;CACJ","sourcesContent":["import {Observable, Subject} from 'rxjs';\n\nimport {DateTimeObjectValue} from '../../../misc/types';\nimport {DateApiObject} from '../../../services';\nimport {DateTimePicker} from '../interfaces';\n\n/**\n * Base abstract class for each date time period picker\n */\nexport abstract class DateTimePeriodPickerBase<TDate = unknown, TOptions = unknown> implements DateTimePicker<TDate, TOptions>\n{\n //######################### protected properties #########################\n\n /**\n * Subject used for emitting of value changes\n */\n protected valueChangeSubject: Subject<void> = new Subject<void>();\n\n /**\n * Subject used for scaling up\n */\n protected scaleUpSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Subject used for scaling down\n */\n protected scaleDownSubject: Subject<TDate> = new Subject<TDate>();\n\n /**\n * Date api instance for displayed date\n */\n protected displayDate: DateApiObject<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimePicker #########################\n\n /**\n * @inheritdoc\n */\n public value: DateTimeObjectValue<TDate>|undefined|null;\n\n /**\n * @inheritdoc\n */\n public options: TOptions|undefined|null;\n\n /**\n * @inheritdoc\n */\n public display: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public maxDate: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public minDate: TDate|undefined|null;\n\n /**\n * @inheritdoc\n */\n public canScaleUp: boolean = false;\n\n /**\n * @inheritdoc\n */\n public canScaleDown: boolean = false;\n\n /**\n * @inheritdoc\n */\n public get valueChange(): Observable<void>\n {\n return this.valueChangeSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get scaleUp(): Observable<TDate>\n {\n return this.scaleUpSubject.asObservable();\n }\n\n /**\n * @inheritdoc\n */\n public get scaleDown(): Observable<TDate>\n {\n return this.scaleDownSubject.asObservable();\n }\n}"]}
@@ -4,9 +4,9 @@ import { extend, isBlank, nameof } from '@jscrpt/common';
4
4
  import { Subscription } from 'rxjs';
5
5
  import { DATE_TIME_PICKER_OPTIONS } from '../../misc/tokens';
6
6
  import { DayPickerSAComponent } from '../dayPicker/dayPicker.component';
7
- import { DATE_API } from '../../../../misc/tokens';
8
7
  import { formatDateTime, parseDateTime } from '../../../../misc/utils';
9
8
  import { DateTimeValueFormat } from '../../../../misc/enums';
9
+ import { DateTimeDirective } from '../../../dateTime/directives';
10
10
  import * as i0 from "@angular/core";
11
11
  /**
12
12
  * Text to be displayed when configuration, options are corrupted
@@ -24,11 +24,11 @@ const defaultOptions = {
24
24
  /**
25
25
  * Component used for displaying date time picker
26
26
  */
27
- export class DateTimePickerComponent {
27
+ export class DateTimePickerComponent extends DateTimeDirective {
28
28
  //######################### constructor #########################
29
- constructor(position, dateApi, options) {
29
+ constructor(position, options) {
30
+ super();
30
31
  this.position = position;
31
- this.dateApi = dateApi;
32
32
  //######################### public properties - outputs #########################
33
33
  /**
34
34
  * @inheritdoc
@@ -76,6 +76,7 @@ export class DateTimePickerComponent {
76
76
  */
77
77
  ngOnDestroy() {
78
78
  var _a, _b;
79
+ super.ngOnDestroy();
79
80
  (_a = this.component) === null || _a === void 0 ? void 0 : _a.destroy();
80
81
  this.component = null;
81
82
  (_b = this.periodChangesSubscription) === null || _b === void 0 ? void 0 : _b.unsubscribe();
@@ -107,12 +108,12 @@ export class DateTimePickerComponent {
107
108
  this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);
108
109
  this.valueChange.emit();
109
110
  }));
110
- this.periodChangesSubscription.add(this.component.instance.goUp.subscribe(date => this.showPicker(this.getUpperType(), date)));
111
- this.periodChangesSubscription.add(this.component.instance.goDown.subscribe(date => this.showPicker(this.getLowerType(), date)));
111
+ this.periodChangesSubscription.add(this.component.instance.scaleUp.subscribe(date => this.showPicker(this.getUpperType(), date)));
112
+ this.periodChangesSubscription.add(this.component.instance.scaleDown.subscribe(date => this.showPicker(this.getLowerType(), date)));
112
113
  }
113
114
  const component = this.component.instance;
114
- component.canGoDown = false,
115
- component.canGoUp = false;
115
+ component.canScaleDown = false,
116
+ component.canScaleUp = false;
116
117
  component.display = displayDate;
117
118
  // component.options
118
119
  //TODO: maybe add support for format!
@@ -151,17 +152,14 @@ export class DateTimePickerComponent {
151
152
  return this.displayedPeriodType;
152
153
  }
153
154
  }
154
- DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: POSITION }, { token: DATE_API }, { token: DATE_TIME_PICKER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
155
- DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerComponent, selector: "date-time-picker", inputs: { value: "value", options: "options" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "pickerContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-container #container></ng-container>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
155
+ DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: POSITION }, { token: DATE_TIME_PICKER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
156
+ DateTimePickerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.6", type: DateTimePickerComponent, selector: "date-time-picker", inputs: { value: "value", options: "options" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "pickerContainer", first: true, predicate: ["container"], descendants: true, read: ViewContainerRef, static: true }], usesInheritance: true, usesOnChanges: true, ngImport: i0, template: "<ng-container #container></ng-container>", changeDetection: i0.ChangeDetectionStrategy.OnPush });
156
157
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
157
158
  type: Component,
158
159
  args: [{ selector: 'date-time-picker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container #container></ng-container>" }]
159
160
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
160
161
  type: Inject,
161
162
  args: [POSITION]
162
- }] }, { type: undefined, decorators: [{
163
- type: Inject,
164
- args: [DATE_API]
165
163
  }] }, { type: undefined, decorators: [{
166
164
  type: Inject,
167
165
  args: [DATE_TIME_PICKER_OPTIONS]