@anglr/datetime 5.0.0-beta.20221019112435 → 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 (63) hide show
  1. package/changelog.md +16 -13
  2. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js +221 -0
  3. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -0
  4. package/es2015/src/modules/dateTime/directives/dateTimeBase.js +25 -41
  5. package/es2015/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  6. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +16 -17
  7. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  8. package/es2015/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +10 -13
  9. package/es2015/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  10. package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +9 -11
  11. package/es2015/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  12. package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +6 -8
  13. package/es2015/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  14. package/es2015/src/modules/dateTime/directives/index.js +1 -1
  15. package/es2015/src/modules/dateTime/directives/index.js.map +1 -1
  16. package/es2015/src/modules/dateTime/modules/dateTime.module.js +7 -3
  17. package/es2015/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  18. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +5 -22
  19. package/es2015/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  20. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js +218 -0
  21. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -0
  22. package/es2020/src/modules/dateTime/directives/dateTimeBase.js +25 -41
  23. package/es2020/src/modules/dateTime/directives/dateTimeBase.js.map +1 -1
  24. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +16 -17
  25. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  26. package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js +10 -13
  27. package/es2020/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.js.map +1 -1
  28. package/es2020/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js +9 -11
  29. package/es2020/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.js.map +1 -1
  30. package/es2020/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js +6 -8
  31. package/es2020/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.js.map +1 -1
  32. package/es2020/src/modules/dateTime/directives/index.js +1 -1
  33. package/es2020/src/modules/dateTime/directives/index.js.map +1 -1
  34. package/es2020/src/modules/dateTime/modules/dateTime.module.js +7 -3
  35. package/es2020/src/modules/dateTime/modules/dateTime.module.js.map +1 -1
  36. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js +5 -22
  37. package/es2020/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +120 -0
  40. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -0
  41. package/src/modules/dateTime/directives/dateTimeBase.d.ts +19 -27
  42. package/src/modules/dateTime/directives/dateTimeBase.d.ts.map +1 -1
  43. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts +3 -2
  44. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  45. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts +4 -4
  46. package/src/modules/dateTime/directives/dateTimeMaxValidator/dateTimeMaxValidator.directive.d.ts.map +1 -1
  47. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts +4 -4
  48. package/src/modules/dateTime/directives/dateTimeMinValidator/dateTimeMinValidator.directive.d.ts.map +1 -1
  49. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts +2 -2
  50. package/src/modules/dateTime/directives/dateTimeValidator/dateTimeValidator.directive.d.ts.map +1 -1
  51. package/src/modules/dateTime/directives/index.d.ts +1 -1
  52. package/src/modules/dateTime/directives/index.d.ts.map +1 -1
  53. package/src/modules/dateTime/modules/dateTime.module.d.ts +7 -6
  54. package/src/modules/dateTime/modules/dateTime.module.d.ts.map +1 -1
  55. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts +6 -8
  56. package/src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.d.ts.map +1 -1
  57. package/version.bak +1 -1
  58. package/es2015/src/modules/dateTime/directives/dateTimeRestrictedBase.js +0 -152
  59. package/es2015/src/modules/dateTime/directives/dateTimeRestrictedBase.js.map +0 -1
  60. package/es2020/src/modules/dateTime/directives/dateTimeRestrictedBase.js +0 -149
  61. package/es2020/src/modules/dateTime/directives/dateTimeRestrictedBase.js.map +0 -1
  62. package/src/modules/dateTime/directives/dateTimeRestrictedBase.d.ts +0 -74
  63. package/src/modules/dateTime/directives/dateTimeRestrictedBase.d.ts.map +0 -1
@@ -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,OAAO,EAAC,oBAAoB,EAAC,MAAM,6BAA6B,CAAC;AAEjE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAE7C;;GAEG;AAcH,MAAM,OAAO,6BAA+C,SAAQ,YAAmB;IASnF,iEAAiE;IACjE,YAAwC,OAAuB;QAE3D,K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{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","source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,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}"]}
@@ -4,10 +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, FORMAT_PROVIDER } from '../../../../misc/tokens';
8
7
  import { formatDateTime, parseDateTime } from '../../../../misc/utils';
9
8
  import { DateTimeValueFormat } from '../../../../misc/enums';
10
- import { DateTimeRestrictedBase } from '../../../dateTime/directives/dateTimeRestrictedBase';
9
+ import { DateTimeDirective } from '../../../dateTime/directives';
11
10
  import * as i0 from "@angular/core";
12
11
  /**
13
12
  * Text to be displayed when configuration, options are corrupted
@@ -25,10 +24,10 @@ const defaultOptions = {
25
24
  /**
26
25
  * Component used for displaying date time picker
27
26
  */
28
- export class DateTimePickerComponent extends DateTimeRestrictedBase {
27
+ export class DateTimePickerComponent extends DateTimeDirective {
29
28
  //######################### constructor #########################
30
- constructor(position, dateApi, formatProvider, options) {
31
- super(dateApi, formatProvider);
29
+ constructor(position, options) {
30
+ super();
32
31
  this.position = position;
33
32
  //######################### public properties - outputs #########################
34
33
  /**
@@ -45,16 +44,6 @@ export class DateTimePickerComponent extends DateTimeRestrictedBase {
45
44
  throw new Error(CORRUPTED_CONFIG_TEXT);
46
45
  }
47
46
  }
48
- //######################### public properties - inputs #########################
49
- /**
50
- * @inheritdoc
51
- */
52
- get value() {
53
- return this.ɵValue;
54
- }
55
- set value(value) {
56
- this.ɵValue = value;
57
- }
58
47
  /**
59
48
  * Options for date time picker
60
49
  */
@@ -160,7 +149,7 @@ export class DateTimePickerComponent extends DateTimeRestrictedBase {
160
149
  return this.displayedPeriodType;
161
150
  }
162
151
  }
163
- DateTimePickerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, deps: [{ token: POSITION }, { token: DATE_API }, { token: FORMAT_PROVIDER }, { token: DATE_TIME_PICKER_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
152
+ 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 });
164
153
  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 });
165
154
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImport: i0, type: DateTimePickerComponent, decorators: [{
166
155
  type: Component,
@@ -168,12 +157,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.6", ngImpor
168
157
  }], ctorParameters: function () { return [{ type: undefined, decorators: [{
169
158
  type: Inject,
170
159
  args: [POSITION]
171
- }] }, { type: undefined, decorators: [{
172
- type: Inject,
173
- args: [DATE_API]
174
- }] }, { type: undefined, decorators: [{
175
- type: Inject,
176
- args: [FORMAT_PROVIDER]
177
160
  }] }, { type: undefined, decorators: [{
178
161
  type: Inject,
179
162
  args: [DATE_TIME_PICKER_OPTIONS]
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimePicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html"],"names":[],"mappings":"AAAA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;sBADxB,KAAK;gBAcK,OAAO;sBADjB,KAAK;gBAqBU,WAAW;sBAD1B,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef, Type, EventEmitter, Output, Input, OnChanges, SimpleChanges, Inject, Optional, OnDestroy, ComponentRef} from '@angular/core';\nimport {Position, POSITION} from '@anglr/common';\nimport {extend, isBlank, nameof} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue, FormatProvider} from '../../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {DATE_TIME_PICKER_OPTIONS} from '../../misc/tokens';\nimport {DayPickerSAComponent} from '../dayPicker/dayPicker.component';\nimport {DateTimePickerOptions} from './dateTimePicker.interface';\nimport {DateTimePicker} from '../../interfaces';\nimport {DateApi} from '../../../../services';\nimport {DATE_API, FORMAT_PROVIDER} from '../../../../misc/tokens';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DateTimeRestrictedBase} from '../../../dateTime/directives/dateTimeRestrictedBase';\n\n/**\n * Text to be displayed when configuration, options are corrupted\n */\nconst CORRUPTED_CONFIG_TEXT = 'DateTime: Corrupted configuration for DateTimePicker!';\n\n/**\n * Default options for date time picker\n */\nconst defaultOptions: DateTimePickerOptions = \n{\n defaultPeriod: 'day',\n periodsDefinition:\n {\n 'day': DayPickerSAComponent,\n },\n};\n\n/**\n * Component used for displaying date time picker\n */\n@Component(\n{\n selector: 'date-time-picker',\n templateUrl: 'dateTimePicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimePickerComponent<TDate = unknown> extends DateTimeRestrictedBase<TDate> implements DateTimeInputValue<TDate>, OnChanges, OnDestroy\n{\n //######################### protected properties #########################\n \n /**\n * Subscription for changes in date time period picker\n */\n protected periodChangesSubscription: Subscription|undefined|null;\n\n /**\n * Options for date time picker\n */\n protected ɵOptions: DateTimePickerOptions<TDate>;\n\n /**\n * Currently displayed period type\n */\n protected displayedPeriodType: Type<DateTimePicker<TDate>>;\n\n /**\n * Name of period which is currently displayed\n */\n protected displayedPeriodName: string;\n\n /**\n * Instance of created date time period picker\n */\n protected component: ComponentRef<DateTimePicker<TDate>>|undefined|null;\n \n //######################### protected properties - children #########################\n\n /**\n * Container used for displaying pickers for specific date time part\n */\n @ViewChild('container', {read: ViewContainerRef, static: true})\n protected pickerContainer: ViewContainerRef|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * @inheritdoc\n */\n @Input()\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 this.ɵValue = value;\n }\n\n /**\n * Options for date time picker\n */\n @Input()\n public get options(): Partial<DateTimePickerOptions<TDate>>\n {\n return this.ɵOptions;\n }\n public set options(value: Partial<DateTimePickerOptions<TDate>>)\n {\n this.ɵOptions = extend(true, {}, defaultOptions, value);\n\n if(value?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = value.periodsDefinition;\n }\n }\n\n //######################### public properties - outputs #########################\n\n /**\n * @inheritdoc\n */\n @Output()\n public override valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(@Inject(POSITION) protected position: Position,\n @Inject(DATE_API) dateApi: DateApi<TDate>,\n @Inject(FORMAT_PROVIDER) formatProvider: FormatProvider,\n @Inject(DATE_TIME_PICKER_OPTIONS) @Optional() options?: DateTimePickerOptions<TDate>,)\n {\n super(dateApi, formatProvider);\n\n this.ɵOptions = extend(true, {}, defaultOptions, options);\n \n if(options?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = options.periodsDefinition;\n }\n\n this.displayedPeriodName = this.ɵOptions.defaultPeriod;\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n if(!this.displayedPeriodType)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<DateTimePickerComponent>('value') in changes)\n {\n //empty value show now\n if(isBlank(this.value))\n {\n const now = this.dateApi.now();\n\n this.showPicker(this.displayedPeriodType, now.value);\n\n return;\n }\n\n }\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.component?.destroy();\n this.component = null;\n\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows picker\n * @param type - Type of period that should be displayed\n * @param displayDate - Display date to be shown\n */\n protected showPicker(type: Type<DateTimePicker<TDate>>, displayDate: TDate): void\n {\n if(!this.pickerContainer)\n {\n return;\n }\n\n //create new component and destroy previous one\n if(!this.component || (this.component && type != this.displayedPeriodType))\n {\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = new Subscription();\n this.component?.destroy();\n this.component = this.pickerContainer.createComponent(type);\n\n this.periodChangesSubscription.add(this.component.instance.valueChange.subscribe(() =>\n {\n const component = this.component?.instance;\n\n if(!component)\n {\n return;\n }\n\n this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);\n this.valueChange.emit();\n }));\n\n this.periodChangesSubscription.add(this.component.instance.scaleUp.subscribe(date => this.showPicker(this.getUpperType(), date)));\n this.periodChangesSubscription.add(this.component.instance.scaleDown.subscribe(date => this.showPicker(this.getLowerType(), date)));\n }\n\n const component = this.component.instance;\n\n component.canScaleDown = false,\n component.canScaleUp = false;\n component.display = displayDate;\n // component.options\n //TODO: maybe add support for format!\n component.value = parseDateTime(this.value, this.dateApi, null, null);\n }\n\n /**\n * Gets type that is above current period picker\n */\n protected getUpperType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index >= periods.length)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index + 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n\n /**\n * Gets type that is below current period picker\n */\n protected getLowerType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index <= 0)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index - 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n}","<ng-container #container></ng-container>"]}
1
+ {"version":3,"file":"dateTimePicker.component.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.ts","../../../../../../src/modules/dateTimePicker/components/dateTimePicker/dateTimePicker.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,uBAAuB,EAAE,SAAS,EAAE,gBAAgB,EAAQ,YAAY,EAAE,MAAM,EAAE,KAAK,EAA4B,MAAM,EAAE,QAAQ,EAA0B,MAAM,eAAe,CAAC;AACtM,OAAO,EAAW,QAAQ,EAAC,MAAM,eAAe,CAAC;AACjD,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAC,YAAY,EAAC,MAAM,MAAM,CAAC;AAIlC,OAAO,EAAC,wBAAwB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAC,oBAAoB,EAAC,MAAM,kCAAkC,CAAC;AAGtE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAw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wB;wGAzEnC,uBAAuB,0OAkCD,gBAAgB,uFC3EnD,0CAAwC;2FDyC3B,uBAAuB;kBANnC,SAAS;+BAEI,kBAAkB,mBAEX,uBAAuB,CAAC,MAAM;;0BA0ElC,MAAM;2BAAC,QAAQ;;0BACf,MAAM;2BAAC,wBAAwB;;0BAAG,QAAQ;4CAtC7C,eAAe;sBADxB,SAAS;uBAAC,WAAW,EAAE,EAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAC;gBASvD,KAAK;sBADX,KAAK;gBAOK,OAAO;sBADjB,KAAK;gBAqBC,WAAW;sBADjB,MAAM","sourcesContent":["import {Component, ChangeDetectionStrategy, ViewChild, ViewContainerRef, Type, EventEmitter, Output, Input, OnChanges, SimpleChanges, Inject, Optional, OnDestroy, ComponentRef} from '@angular/core';\nimport {Position, POSITION} from '@anglr/common';\nimport {extend, isBlank, nameof} from '@jscrpt/common';\nimport {Subscription} from 'rxjs';\n\nimport {DateTimeInputValue} from '../../../../interfaces';\nimport {DateTimeInputOutputValue} from '../../../../misc/types';\nimport {DATE_TIME_PICKER_OPTIONS} from '../../misc/tokens';\nimport {DayPickerSAComponent} from '../dayPicker/dayPicker.component';\nimport {DateTimePickerOptions} from './dateTimePicker.interface';\nimport {DateTimePicker} from '../../interfaces';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateTimeValueFormat} from '../../../../misc/enums';\nimport {DateTimeDirective} from '../../../dateTime/directives';\n\n/**\n * Text to be displayed when configuration, options are corrupted\n */\nconst CORRUPTED_CONFIG_TEXT = 'DateTime: Corrupted configuration for DateTimePicker!';\n\n/**\n * Default options for date time picker\n */\nconst defaultOptions: DateTimePickerOptions = \n{\n defaultPeriod: 'day',\n periodsDefinition:\n {\n 'day': DayPickerSAComponent,\n },\n};\n\n/**\n * Component used for displaying date time picker\n */\n@Component(\n{\n selector: 'date-time-picker',\n templateUrl: 'dateTimePicker.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class DateTimePickerComponent<TDate = unknown> extends DateTimeDirective<TDate> implements DateTimeInputValue<TDate>, OnChanges, OnDestroy\n{\n //######################### protected properties #########################\n \n /**\n * Subscription for changes in date time period picker\n */\n protected periodChangesSubscription: Subscription|undefined|null;\n\n /**\n * Options for date time picker\n */\n protected ɵOptions: DateTimePickerOptions<TDate>;\n\n /**\n * Currently displayed period type\n */\n protected displayedPeriodType: Type<DateTimePicker<TDate>>;\n\n /**\n * Name of period which is currently displayed\n */\n protected displayedPeriodName: string;\n\n /**\n * Instance of created date time period picker\n */\n protected component: ComponentRef<DateTimePicker<TDate>>|undefined|null;\n \n //######################### protected properties - children #########################\n\n /**\n * Container used for displaying pickers for specific date time part\n */\n @ViewChild('container', {read: ViewContainerRef, static: true})\n protected pickerContainer: ViewContainerRef|undefined|null;\n\n //######################### public properties - inputs #########################\n\n /**\n * @inheritdoc\n */\n @Input()\n public value: DateTimeInputOutputValue<TDate>|undefined|null;\n\n /**\n * Options for date time picker\n */\n @Input()\n public get options(): Partial<DateTimePickerOptions<TDate>>\n {\n return this.ɵOptions;\n }\n public set options(value: Partial<DateTimePickerOptions<TDate>>)\n {\n this.ɵOptions = extend(true, {}, defaultOptions, value);\n\n if(value?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = value.periodsDefinition;\n }\n }\n\n //######################### public properties - outputs #########################\n\n /**\n * @inheritdoc\n */\n @Output()\n public valueChange: EventEmitter<void> = new EventEmitter<void>();\n\n //######################### constructor #########################\n constructor(@Inject(POSITION) protected position: Position,\n @Inject(DATE_TIME_PICKER_OPTIONS) @Optional() options?: DateTimePickerOptions<TDate>,)\n {\n super();\n\n this.ɵOptions = extend(true, {}, defaultOptions, options);\n \n if(options?.periodsDefinition)\n {\n this.ɵOptions.periodsDefinition = options.periodsDefinition;\n }\n\n this.displayedPeriodName = this.ɵOptions.defaultPeriod;\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n if(!this.displayedPeriodType)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n }\n\n //######################### public methods - implementation of OnChanges #########################\n \n /**\n * Called when input value changes\n */\n public ngOnChanges(changes: SimpleChanges): void\n {\n if(nameof<DateTimePickerComponent>('value') in changes)\n {\n //empty value show now\n if(isBlank(this.value))\n {\n const now = this.dateApi.now();\n\n this.showPicker(this.displayedPeriodType, now.value);\n\n return;\n }\n\n }\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.component?.destroy();\n this.component = null;\n\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = null;\n }\n\n //######################### protected methods #########################\n\n /**\n * Shows picker\n * @param type - Type of period that should be displayed\n * @param displayDate - Display date to be shown\n */\n protected showPicker(type: Type<DateTimePicker<TDate>>, displayDate: TDate): void\n {\n if(!this.pickerContainer)\n {\n return;\n }\n\n //create new component and destroy previous one\n if(!this.component || (this.component && type != this.displayedPeriodType))\n {\n this.periodChangesSubscription?.unsubscribe();\n this.periodChangesSubscription = new Subscription();\n this.component?.destroy();\n this.component = this.pickerContainer.createComponent(type);\n\n this.periodChangesSubscription.add(this.component.instance.valueChange.subscribe(() =>\n {\n const component = this.component?.instance;\n\n if(!component)\n {\n return;\n }\n\n this.value = formatDateTime(component.value, DateTimeValueFormat.DateInstance, null);\n this.valueChange.emit();\n }));\n\n this.periodChangesSubscription.add(this.component.instance.scaleUp.subscribe(date => this.showPicker(this.getUpperType(), date)));\n this.periodChangesSubscription.add(this.component.instance.scaleDown.subscribe(date => this.showPicker(this.getLowerType(), date)));\n }\n\n const component = this.component.instance;\n\n component.canScaleDown = false,\n component.canScaleUp = false;\n component.display = displayDate;\n // component.options\n //TODO: maybe add support for format!\n component.value = parseDateTime(this.value, this.dateApi, null, null);\n }\n\n /**\n * Gets type that is above current period picker\n */\n protected getUpperType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index >= periods.length)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index + 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n\n /**\n * Gets type that is below current period picker\n */\n protected getLowerType(): Type<DateTimePicker<TDate>>\n {\n const periods = Object.keys(this.ɵOptions.periodsDefinition);\n const index = periods.indexOf(this.displayedPeriodName);\n\n if(index < 0)\n {\n throw new Error(CORRUPTED_CONFIG_TEXT);\n }\n\n if(index <= 0)\n {\n return this.displayedPeriodType;\n }\n\n this.displayedPeriodName = periods[index - 1];\n this.displayedPeriodType = this.ɵOptions.periodsDefinition[this.displayedPeriodName];\n\n return this.displayedPeriodType;\n }\n}","<ng-container #container></ng-container>"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/datetime",
3
- "version": "5.0.0-beta.20221019112435",
3
+ "version": "5.0.0-beta.20221020044622",
4
4
  "description": "Angular library for datetime manipulation components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -0,0 +1,120 @@
1
+ import { OnDestroy } from '@angular/core';
2
+ import { Action1 } from '@jscrpt/common';
3
+ import { Observable, Subject, Subscription } from 'rxjs';
4
+ import { FormatProvider } from '../../../../interfaces';
5
+ import { DateTimeValueFormat } from '../../../../misc/enums';
6
+ import { DateApi, DateValue } from '../../../../services';
7
+ import { DateTimeBase } from '../dateTimeBase';
8
+ import * as i0 from "@angular/core";
9
+ /**
10
+ * Directive that holds shared data for date time, like formats, restrictions
11
+ */
12
+ export declare class DateTimeDirective<TDate = unknown> implements OnDestroy {
13
+ /**
14
+ * Subject used for emitting changes in max date time value
15
+ */
16
+ protected maxDateTimeChangesSubject: Subject<void>;
17
+ /**
18
+ * Subject used for emitting changes in min date time value
19
+ */
20
+ protected minDateTimeChangesSubject: Subject<void>;
21
+ /**
22
+ * Subscription for max date instance value changes
23
+ */
24
+ protected maxDateInstanceChange: Subscription | undefined | null;
25
+ /**
26
+ * Subscription for min date instance value changes
27
+ */
28
+ protected minDateInstanceChange: Subscription | undefined | null;
29
+ /**
30
+ * Max allowed value of date time
31
+ */
32
+ protected ɵMaxDateTime: TDate | undefined | null;
33
+ /**
34
+ * Min allowed value of date time
35
+ */
36
+ protected ɵMinDateTime: TDate | undefined | null;
37
+ /**
38
+ * Date time value format which is being worked with in this date time
39
+ */
40
+ protected ɵValueFormat: DateTimeValueFormat;
41
+ /**
42
+ * Format of string representation of date
43
+ */
44
+ protected ɵFormat: keyof FormatProvider;
45
+ /**
46
+ * Date api instance, used for date time manipulation
47
+ */
48
+ protected dateApi: DateApi<TDate>;
49
+ /**
50
+ * Provider for available formats
51
+ */
52
+ protected formatProvider: FormatProvider;
53
+ /**
54
+ * Occurs when there are changes in max date time value
55
+ */
56
+ get maxDateTimeChanges(): Observable<void>;
57
+ /**
58
+ * Occurs when there are changes in min date time value
59
+ */
60
+ get minDateTimeChanges(): Observable<void>;
61
+ /**
62
+ * Gets or sets date time value format which is being worked with in this date time
63
+ */
64
+ get valueFormat(): DateTimeValueFormat;
65
+ set valueFormat(value: DateTimeValueFormat);
66
+ /**
67
+ * Gets or sets format of string representation of date
68
+ */
69
+ get format(): keyof FormatProvider;
70
+ set format(value: keyof FormatProvider);
71
+ /**
72
+ * Custom format string representation of date
73
+ */
74
+ customFormat: string;
75
+ /**
76
+ * Gets or sets max allowed date for date time
77
+ */
78
+ get maxDateTime(): TDate | undefined | null;
79
+ set maxDateTime(value: TDate | undefined | null);
80
+ /**
81
+ * Gets or sets min allowed date for date time
82
+ */
83
+ get minDateTime(): TDate | undefined | null;
84
+ set minDateTime(value: TDate | undefined | null);
85
+ /**
86
+ * Called when component is destroyed
87
+ */
88
+ ngOnDestroy(): void;
89
+ /**
90
+ * Sets min date time and notifies about changes
91
+ * @param value - Value to be set
92
+ */
93
+ protected minDateSet(value: TDate | undefined | null): void;
94
+ /**
95
+ * Sets max date time and notifies about changes
96
+ * @param value - Value to be set
97
+ */
98
+ protected maxDateSet(value: TDate | undefined | null): void;
99
+ /**
100
+ * Sets min or max date time value
101
+ * @param value - Value to be set
102
+ * @param setter - Action used for setting value
103
+ */
104
+ protected setMinMaxValue(value: string | number | TDate | Date, setter: Action1<TDate | undefined | null>): void;
105
+ /**
106
+ * Custom input type for `valueFormat` input
107
+ */
108
+ static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat | DateTimeValueFormat;
109
+ /**
110
+ * Custom input type for `maxDateTime` input
111
+ */
112
+ static ngAcceptInputType_maxDateTime: DateValue | DateTimeBase;
113
+ /**
114
+ * Custom input type for `minDateTime` input
115
+ */
116
+ static ngAcceptInputType_minDateTime: DateValue | DateTimeBase;
117
+ static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeDirective<any>, never>;
118
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DateTimeDirective<any>, "[dateTime]", never, { "valueFormat": "valueFormat"; "format": "format"; "customFormat": "customFormat"; "maxDateTime": "maxDateTime"; "minDateTime": "minDateTime"; }, {}, never, never, false>;
119
+ }
120
+ //# sourceMappingURL=dateTime.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dateTime.directive.d.ts","sourceRoot":"","sources":["dateTime.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAA2B,SAAS,EAAC,MAAM,eAAe,CAAC;AAClE,OAAO,EAAC,OAAO,EAA8B,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAC,UAAU,EAAE,OAAO,EAAE,YAAY,EAAC,MAAM,MAAM,CAAC;AAEvD,OAAO,EAAC,cAAc,EAAC,MAAM,wBAAwB,CAAC;AACtD,OAAO,EAAC,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAI3D,OAAO,EAAC,OAAO,EAAE,SAAS,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,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IAExF;;OAEG;IACH,IACW,WAAW,IAAI,KAAK,GAAC,SAAS,GAAC,IAAI,CAG7C;IACD,IAAW,WAAW,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAC,IAAI,EA2CjD;IAED;;OAEG;IACH,IACW,WAAW,IAAI,KAAK,GAAC,SAAS,GAAC,IAAI,CAG7C;IACD,IAAW,WAAW,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAC,IAAI,EA2CjD;IAID;;OAEG;IACI,WAAW,IAAI,IAAI;IAW1B;;;OAGG;IAEH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAC,IAAI,GAAG,IAAI;IAMvD;;;OAGG;IAEH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,KAAK,GAAC,SAAS,GAAC,IAAI,GAAG,IAAI;IAMvD;;;;OAIG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAC,MAAM,GAAC,KAAK,GAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,KAAK,GAAC,SAAS,GAAC,IAAI,CAAC,GAAG,IAAI;IAgBtG;;OAEG;IACH,OAAc,6BAA6B,EAAE,MAAM,OAAO,mBAAmB,GAAC,mBAAmB,CAAC;IAElG;;OAEG;IACH,OAAc,6BAA6B,EAAE,SAAS,GAAC,YAAY,CAAC;IAEpE;;OAEG;IACH,OAAc,6BAA6B,EAAE,SAAS,GAAC,YAAY,CAAC;yCApS3D,iBAAiB;2CAAjB,iBAAiB;CAqS7B"}
@@ -1,27 +1,25 @@
1
- import { EventEmitter } from '@angular/core';
2
- import { DateTimeInputValue, FormatProvider } from '../../../interfaces';
3
- import { DateTimeValueFormat } from '../../../misc/enums';
1
+ import { EventEmitter, OnDestroy } from '@angular/core';
2
+ import { Subscription } from 'rxjs';
3
+ import { DateTimeInputValue } from '../../../interfaces';
4
4
  import { DateTimeInputOutputValue } from '../../../misc/types';
5
- import { DateApi } from '../../../services';
5
+ import { DateTimeDirective } from './dateTime/dateTime.directive';
6
6
  import * as i0 from "@angular/core";
7
7
  /**
8
8
  * Base class for date time directives, contains basic shared data
9
9
  */
10
- export declare class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate> {
11
- protected dateApi: DateApi<TDate>;
12
- protected formatProvider: FormatProvider;
10
+ export declare class DateTimeBase<TDate = unknown> implements DateTimeInputValue<TDate>, OnDestroy {
13
11
  /**
14
- * Date time value format which is being worked with in this date time
12
+ * Subscriptions created during initialization
15
13
  */
16
- protected ɵValueFormat: DateTimeValueFormat;
17
- /**
18
- * Format of string representation of date
19
- */
20
- protected ɵFormat: keyof FormatProvider;
14
+ protected initSubscriptions: Subscription;
21
15
  /**
22
16
  * Current value of date time, could be string, unix timestamp, Date, TDate object, or ranged DateTimeValue
23
17
  */
24
18
  protected ɵValue: DateTimeInputOutputValue<TDate> | undefined | null;
19
+ /**
20
+ * Instance of date time shared data, like formats and restrictions
21
+ */
22
+ protected dateTimeData: DateTimeDirective<TDate>;
25
23
  /**
26
24
  * @inheritdoc
27
25
  */
@@ -31,26 +29,20 @@ export declare class DateTimeBase<TDate = unknown> implements DateTimeInputValue
31
29
  * @inheritdoc
32
30
  */
33
31
  valueChange: EventEmitter<void>;
32
+ constructor();
34
33
  /**
35
- * Gets or sets date time value format which is being worked with in this date time
36
- */
37
- get valueFormat(): DateTimeValueFormat;
38
- set valueFormat(value: DateTimeValueFormat);
39
- /**
40
- * Gets or sets format of string representation of date
34
+ * Called when component is destroyed
41
35
  */
42
- get format(): keyof FormatProvider;
43
- set format(value: keyof FormatProvider);
36
+ ngOnDestroy(): void;
44
37
  /**
45
- * Custom format string representation of date
38
+ * Called whenever max date time restriction changes
46
39
  */
47
- customFormat: string;
48
- constructor(dateApi: DateApi<TDate>, formatProvider: FormatProvider);
40
+ protected onMaxDateTimeChange(): void;
49
41
  /**
50
- * Custom input type for `valueFormat` input
42
+ * Called whenever min date time restriction changes
51
43
  */
52
- static ngAcceptInputType_valueFormat: keyof typeof DateTimeValueFormat | DateTimeValueFormat;
44
+ protected onMinDateTimeChange(): void;
53
45
  static ɵfac: i0.ɵɵFactoryDeclaration<DateTimeBase<any>, never>;
54
- static ɵdir: i0.ɵɵDirectiveDeclaration<DateTimeBase<any>, never, never, { "valueFormat": "valueFormat"; "format": "format"; "customFormat": "customFormat"; }, {}, never, never, false>;
46
+ static ɵdir: i0.ɵɵDirectiveDeclaration<DateTimeBase<any>, never, never, {}, {}, never, never, false>;
55
47
  }
56
48
  //# sourceMappingURL=dateTimeBase.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeBase.d.ts","sourceRoot":"","sources":["dateTimeBase.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,YAAY,EAAQ,MAAM,eAAe,CAAC;AAG7D,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAC,wBAAwB,EAAC,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;;AAE1C;;GAEG;AACH,qBACa,YAAY,CAAC,KAAK,GAAG,OAAO,CAAE,YAAW,kBAAkB,CAAC,KAAK,CAAC;IAiF/D,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;IACjC,SAAS,CAAC,cAAc,EAAE,cAAc;IA9EpD;;OAEG;IACH,SAAS,CAAC,YAAY,EAAE,mBAAmB,CAAoC;IAE/E;;OAEG;IACH,SAAS,CAAC,OAAO,EAAE,MAAM,cAAc,CAAU;IAEjD;;OAEG;IACH,SAAS,CAAC,MAAM,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC;IAIjE;;OAEG;IACH,IAAW,KAAK,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAGjE;IACD,IAAW,KAAK,CAAC,KA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AAC,KAAK,CAAC,CAAoC;IAIpF;;OAEG;IACH,IAAW,KAAK,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAGjE;IACD,IAAW,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,EAGrE;IAED;;OAEG;IACI,WAAW,EAAE,YAAY,CAAC,IAAI,CAAC,CAA4B;;IAWlE;;OAEG;IACI,WAAW,IAAI,IAAI;IAO1B;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI;IAIrC;;OAEG;IACH,SAAS,CAAC,mBAAmB,IAAI,IAAI;yCAnE5B,YAAY;2CAAZ,YAAY;CAsExB"}
@@ -1,5 +1,5 @@
1
1
  import { ElementRef, EventEmitter, OnDestroy } from '@angular/core';
2
- import { DateTimeInput, FormatProvider } from '../../../../interfaces';
2
+ import { DateTimeInput } from '../../../../interfaces';
3
3
  import { DateTimeInputOutputValue, DateTimeObjectValue } from '../../../../misc/types';
4
4
  import { DateApi, DateValueProvider } from '../../../../services';
5
5
  import { DateTimeBase } from '../dateTimeBase';
@@ -9,6 +9,7 @@ import * as i0 from "@angular/core";
9
9
  */
10
10
  export declare class DateTimeInputDirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy {
11
11
  protected elementRef: ElementRef<HTMLInputElement>;
12
+ protected dateApi: DateApi<TDate>;
12
13
  protected valueProvider: DateValueProvider<TDate>;
13
14
  /**
14
15
  * Internal representation of current date time value
@@ -41,7 +42,7 @@ export declare class DateTimeInputDirective<TDate = unknown> extends DateTimeBas
41
42
  * @inheritdoc
42
43
  */
43
44
  blur: EventEmitter<FocusEvent>;
44
- constructor(elementRef: ElementRef<HTMLInputElement>, dateApi: DateApi<TDate>, formatProvider: FormatProvider, valueProvider: DateValueProvider<TDate>);
45
+ constructor(elementRef: ElementRef<HTMLInputElement>, dateApi: DateApi<TDate>, valueProvider: DateValueProvider<TDate>);
45
46
  /**
46
47
  * Called when component is destroyed
47
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeInput.directive.d.ts","sourceRoot":"","sources":["dateTimeInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,UAAU,EAAE,YAAY,EAAwC,SAAS,EAAC,MAAM,eAAe,CAAC;AAGnH,OAAO,EAAC,aAAa,EAAE,cAAc,EAAC,MAAM,wBAAwB,CAAC;AAErE,OAAO,EAAC,wBAAwB,EAAE,mBAAmB,EAAC,MAAM,wBAAwB,CAAC;AAErF,OAAO,EAAC,OAAO,EAAE,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;AAI7C;;GAEG;AACH,qBAaa,sBAAsB,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,YAAY,CAAC,KAAK,CAAE,YAAW,aAAa,EAAE,SAAS;IA8EpG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAGlD,SAAS,CAAC,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC;IA7E7D;;OAEG;IACH,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAAC;IAInE;;OAEG;IACH,IAAW,QAAQ,IAAI,MAAM,GAAC,SAAS,GAAC,IAAI,CAG3C;IACD,IAAW,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAC,SAAS,GAAC,IAAI,EAG/C;IAED;;OAEG;IACH,IAAoB,KAAK,IAAI,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,CAG1E;IACD,IAAoB,KAAK,CAAC,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,EAe9E;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,OAAO,CAG7B;IACD,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAGjC;IAED;;OA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