@anglr/datetime 6.0.0-beta.20221223060503 → 6.0.0-beta.20221223105933

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 (33) hide show
  1. package/changelog.md +3 -1
  2. package/es2015/src/directives/index.js +2 -0
  3. package/es2015/src/directives/index.js.map +1 -1
  4. package/es2015/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +10 -5
  5. package/es2015/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -1
  6. package/es2015/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +137 -0
  7. package/es2015/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -0
  8. package/es2015/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +29 -0
  9. package/es2015/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -0
  10. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +1 -0
  11. package/es2015/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  12. package/es2020/src/directives/index.js +2 -0
  13. package/es2020/src/directives/index.js.map +1 -1
  14. package/es2020/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js +10 -5
  15. package/es2020/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.js.map +1 -1
  16. package/es2020/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js +136 -0
  17. package/es2020/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.js.map +1 -0
  18. package/es2020/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js +29 -0
  19. package/es2020/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.js.map +1 -0
  20. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js +1 -0
  21. package/es2020/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/directives/index.d.ts +2 -0
  24. package/src/directives/index.d.ts.map +1 -1
  25. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts +5 -4
  26. package/src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.d.ts.map +1 -1
  27. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts +42 -0
  28. package/src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.d.ts.map +1 -0
  29. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts +11 -0
  30. package/src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.d.ts.map +1 -0
  31. package/src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.d.ts.map +1 -1
  32. package/styles/core/_mixins.scss +2 -0
  33. package/version.bak +1 -1
package/changelog.md CHANGED
@@ -30,7 +30,9 @@
30
30
  - **exports**
31
31
  - `MonthCalendarComponent`
32
32
  - `CalendarDayTemplateDirective`
33
- - new `DatePickerInputSADirective` directive, that combines date picker with simple date input
33
+ - new `SimpleDatePickerInputSADirective` directive, that combines date picker with simple date input
34
+ - new `SimpleDateTimePickerInputSADirective` directive, that combines date time picker with simple date time input
35
+ - new `SimpleDateTimeInputHandlerSADirective` directive, that adds simple handler for date time input, which allows simple navigation using keyboard
34
36
  - new `CalendarDayAspectRatio` enum, that represents available aspect ratios for displaying calendar days
35
37
  - `OneToOne` aspect ratio of width to height is 1:1 (square)
36
38
  - `ThreeToTwo` aspect ratio of width to height is 3:2
@@ -1,4 +1,6 @@
1
1
  export * from './simpleDatePickerInput/simpleDatePickerInput.directive';
2
+ export * from './simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';
3
+ export * from './simpleDateTimePickerInput/simpleDateTimePickerInput.directive';
2
4
  export * from './withTime/withTime.directive';
3
5
  export * from './withToday/withToday.directive';
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './simpleDatePickerInput/simpleDatePickerInput.directive';\nexport * from './withTime/withTime.directive';\nexport * from './withToday/withToday.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,mEAAmE,CAAC;AAClF,cAAc,iEAAiE,CAAC;AAChF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './simpleDatePickerInput/simpleDatePickerInput.directive';\nexport * from './simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';\nexport * from './simpleDateTimePickerInput/simpleDateTimePickerInput.directive';\nexport * from './withTime/withTime.directive';\nexport * from './withToday/withToday.directive';\n"]}
@@ -1,16 +1,18 @@
1
1
  import { Directive } from '@angular/core';
2
2
  import { DateTimeInputSADirective, DateTimePickerSADirective } from '../../modules';
3
+ import { SimpleDateTimeInputHandlerSADirective } from '../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';
3
4
  import * as i0 from "@angular/core";
4
5
  import * as i1 from "../../modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive";
5
6
  import * as i2 from "../../modules/dateTime/directives/dateTimeInput/dateTimeInput.directive";
7
+ import * as i3 from "../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive";
6
8
  /**
7
- * Directive that combines date picker with simple date time input
9
+ * Directive that combines date picker with simple date input
8
10
  */
9
- export class DatePickerInputSADirective {
11
+ export class SimpleDatePickerInputSADirective {
10
12
  }
11
- DatePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DatePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
12
- DatePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: DatePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDatePickerInput]", hostDirectives: [{ directive: i1.DateTimePickerSADirective, inputs: ["withPickerOptions", "withPickerOptions", "pickerOptions", "pickerOptions"] }, { directive: i2.DateTimeInputSADirective }], ngImport: i0 });
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DatePickerInputSADirective, decorators: [{
13
+ SimpleDatePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDatePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
14
+ SimpleDatePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDatePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDatePickerInput]", hostDirectives: [{ directive: i1.DateTimePickerSADirective, inputs: ["withPickerOptions", "withPickerOptions", "pickerOptions", "pickerOptions"] }, { directive: i2.DateTimeInputSADirective }, { directive: i3.SimpleDateTimeInputHandlerSADirective }], ngImport: i0 });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDatePickerInputSADirective, decorators: [{
14
16
  type: Directive,
15
17
  args: [{
16
18
  selector: 'input[dateTime][simpleDatePickerInput]',
@@ -26,6 +28,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
26
28
  {
27
29
  directive: DateTimeInputSADirective,
28
30
  },
31
+ {
32
+ directive: SimpleDateTimeInputHandlerSADirective,
33
+ },
29
34
  ],
30
35
  }]
31
36
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"simpleDatePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,eAAe,CAAC;;;;AAElF;;GAEG;AAoBH,MAAM,OAAO,0BAA0B;;uHAA1B,0BAA0B;2GAA1B,0BAA0B;2FAA1B,0BAA0B;kBAnBtC,SAAS;mBACV;oBACI,QAAQ,EAAE,wCAAwC;oBAClD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,yBAAyB;4BACpC,MAAM,EACN;gCACI,mBAAmB;gCACnB,eAAe;6BAClB;yBACJ;wBACD;4BACI,SAAS,EAAE,wBAAwB;yBACtC;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {DateTimeInputSADirective, DateTimePickerSADirective} from '../../modules';\n\n/**\n * Directive that combines date picker with simple date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDatePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: DateTimePickerSADirective,\n inputs:\n [\n 'withPickerOptions',\n 'pickerOptions',\n ]\n },\n {\n directive: DateTimeInputSADirective,\n },\n ],\n})\nexport class DatePickerInputSADirective\n{\n}"]}
1
+ {"version":3,"file":"simpleDatePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,EAAC,qCAAqC,EAAC,MAAM,oEAAoE,CAAC;;;;;AAEzH;;GAEG;AAuBH,MAAM,OAAO,gCAAgC;;6HAAhC,gCAAgC;iHAAhC,gCAAgC;2FAAhC,gCAAgC;kBAtB5C,SAAS;mBACV;oBACI,QAAQ,EAAE,wCAAwC;oBAClD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,yBAAyB;4BACpC,MAAM,EACN;gCACI,mBAAmB;gCACnB,eAAe;6BAClB;yBACJ;wBACD;4BACI,SAAS,EAAE,wBAAwB;yBACtC;wBACD;4BACI,SAAS,EAAE,qCAAqC;yBACnD;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {DateTimeInputSADirective, DateTimePickerSADirective} from '../../modules';\nimport {SimpleDateTimeInputHandlerSADirective} from '../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';\n\n/**\n * Directive that combines date picker with simple date input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDatePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: DateTimePickerSADirective,\n inputs:\n [\n 'withPickerOptions',\n 'pickerOptions',\n ]\n },\n {\n directive: DateTimeInputSADirective,\n },\n {\n directive: SimpleDateTimeInputHandlerSADirective,\n },\n ],\n})\nexport class SimpleDatePickerInputSADirective\n{\n}"]}
@@ -0,0 +1,137 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Directive, Inject, Optional } from '@angular/core';
3
+ import { BindThis } from '@jscrpt/common';
4
+ import { DATE_TIME_INPUT, DATE_API } from '../../misc/tokens';
5
+ import { parseDateTime } from '../../misc/utils';
6
+ import { DateTimePickerSADirective, DateTimeSADirective } from '../../modules';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "../../modules";
9
+ /**
10
+ * Directive that adds simple handler for date time input, which allows simple navigation using keyboard
11
+ */
12
+ export class SimpleDateTimeInputHandlerSADirective {
13
+ //######################### constructor #########################
14
+ constructor(input, dateApi, dateTimeData, picker) {
15
+ this.input = input;
16
+ this.dateApi = dateApi;
17
+ this.dateTimeData = dateTimeData;
18
+ this.picker = picker;
19
+ }
20
+ //######################### public methods - implementation of OnInit #########################
21
+ /**
22
+ * Initialize component
23
+ */
24
+ ngOnInit() {
25
+ this.input.element.addEventListener('keydown', this.handleKeyboard);
26
+ }
27
+ //######################### public methods - implementation of OnDestroy #########################
28
+ /**
29
+ * Called when component is destroyed
30
+ */
31
+ ngOnDestroy() {
32
+ this.input.element.removeEventListener('keydown', this.handleKeyboard);
33
+ }
34
+ //######################### protected methods #########################
35
+ /**
36
+ * Handles keyboard events
37
+ * @param event - Keyboard event that occured
38
+ */
39
+ handleKeyboard(event) {
40
+ var _a, _b;
41
+ const parsedValue = parseDateTime(this.input.value, this.dateApi, null, this.dateTimeData.customFormat);
42
+ //no value do nothing
43
+ if (!parsedValue) {
44
+ return;
45
+ }
46
+ //range value
47
+ if (Array.isArray(parsedValue)) {
48
+ //TODO: finish range support
49
+ }
50
+ else {
51
+ //do nothing for invalid date time
52
+ if (!parsedValue.isValid()) {
53
+ return;
54
+ }
55
+ switch (event.key) {
56
+ case 'ArrowRight':
57
+ case 'ArrowLeft':
58
+ {
59
+ event.preventDefault();
60
+ event.stopPropagation();
61
+ this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowLeft' ? parsedValue.subtractDays(1) : parsedValue.addDays(1));
62
+ break;
63
+ }
64
+ case 'ArrowUp':
65
+ case 'ArrowDown':
66
+ {
67
+ event.preventDefault();
68
+ event.stopPropagation();
69
+ this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowUp' ? parsedValue.subtractWeeks(1) : parsedValue.addWeeks(1));
70
+ break;
71
+ }
72
+ case 'Escape':
73
+ {
74
+ (_a = this.picker) === null || _a === void 0 ? void 0 : _a.hidePicker();
75
+ break;
76
+ }
77
+ case ' ':
78
+ {
79
+ if (event.ctrlKey) {
80
+ (_b = this.picker) === null || _b === void 0 ? void 0 : _b.showPicker();
81
+ }
82
+ break;
83
+ }
84
+ }
85
+ }
86
+ }
87
+ /**
88
+ * Tests whether are min or max constraint broken, returns true if constraint is broken
89
+ * @param value - Value to be tested
90
+ */
91
+ minMaxConstraintTest(value) {
92
+ return (!!this.dateTimeData.minDateTime && value.isBefore(this.dateTimeData.minDateTime)) ||
93
+ (!!this.dateTimeData.maxDateTime && value.isAfter(this.dateTimeData.maxDateTime));
94
+ }
95
+ /**
96
+ * Runs code with check whether min max constrains was broken
97
+ * @param value - Value to be used checked for constrains
98
+ * @param code - Code that should be executed which can change current value
99
+ */
100
+ withMinMaxConstraint(value, code) {
101
+ value.updateOriginal();
102
+ code();
103
+ //min value constraint failure
104
+ if (this.minMaxConstraintTest(value)) {
105
+ value.resetOriginal();
106
+ }
107
+ //value has changed, change input value
108
+ if (!value.isSame(value.originalValue)) {
109
+ this.input.value = value.value;
110
+ this.input.valueChange.next();
111
+ }
112
+ }
113
+ }
114
+ SimpleDateTimeInputHandlerSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimeInputHandlerSADirective, deps: [{ token: DATE_TIME_INPUT }, { token: DATE_API }, { token: i1.DateTimeSADirective }, { token: i1.DateTimePickerSADirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
115
+ SimpleDateTimeInputHandlerSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDateTimeInputHandlerSADirective, isStandalone: true, selector: "[dateTime][withSimpleHandler]", ngImport: i0 });
116
+ __decorate([
117
+ BindThis,
118
+ __metadata("design:type", Function),
119
+ __metadata("design:paramtypes", [KeyboardEvent]),
120
+ __metadata("design:returntype", void 0)
121
+ ], SimpleDateTimeInputHandlerSADirective.prototype, "handleKeyboard", null);
122
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimeInputHandlerSADirective, decorators: [{
123
+ type: Directive,
124
+ args: [{
125
+ selector: '[dateTime][withSimpleHandler]',
126
+ standalone: true,
127
+ }]
128
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
129
+ type: Inject,
130
+ args: [DATE_TIME_INPUT]
131
+ }] }, { type: undefined, decorators: [{
132
+ type: Inject,
133
+ args: [DATE_API]
134
+ }] }, { type: i1.DateTimeSADirective }, { type: i1.DateTimePickerSADirective, decorators: [{
135
+ type: Optional
136
+ }] }]; }, propDecorators: { handleKeyboard: [] } });
137
+ //# sourceMappingURL=simpleDateTimeInputHandler.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimeInputHandler.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,yBAAyB,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;;;AAG7E;;GAEG;AAMH,MAAM,OAAO,qCAAqC;IAE9C,iEAAiE;IACjE,YAA+C,KAA2B,EAClC,OAAuB,EACzC,YAAwC,EAC5B,MAAyC;QAH5B,UAAK,GAAL,KAAK,CAAsB;QAClC,YAAO,GAAP,OAAO,CAAgB;QACzC,iBAAY,GAAZ,YAAY,CAA4B;QAC5B,WAAM,GAAN,MAAM,CAAmC;IAE3E,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IACxE,CAAC;IAED,kGAAkG;IAElG;;OAEG;IACI,WAAW;QAEd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;IAC3E,CAAC;IAED,uEAAuE;IAEvE;;;OAGG;IAEI,cAAc,CAAC,KAAoB;;QAEtC,MAAM,WAAW,GAAG,aAAa,CAAC,I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Init, Optional} from '@angular/core';\nimport {BindThis} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../interfaces';\nimport {DATE_TIME_INPUT, DATE_API} from '../../misc/tokens';\nimport {parseDateTime} from '../../misc/utils';\nimport {DateTimePickerSADirective, DateTimeSADirective} from '../../modules';\nimport {DateApi, DateApiObject} from '../../services';\n\n/**\n * Directive that adds simple handler for date time input, which allows simple navigation using keyboard\n */\n@Directive(\n{\n selector: '[dateTime][withSimpleHandler]',\n standalone: true,\n})\nexport class SimpleDateTimeInputHandlerSADirective<TDate = unknown> implements OnInit, OnDestroy\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected dateTimeData: DateTimeSADirective<TDate>,\n @Optional() protected picker?: DateTimePickerSADirective<TDate>,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.input.element.addEventListener('keydown', this.handleKeyboard);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.input.element.removeEventListener('keydown', this.handleKeyboard);\n }\n\n //######################### protected methods #########################\n\n /**\n * Handles keyboard events\n * @param event - Keyboard event that occured\n */\n @BindThis\n public handleKeyboard(event: KeyboardEvent): void\n {\n const parsedValue = parseDateTime(this.input.value, this.dateApi, null, this.dateTimeData.customFormat);\n \n //no value do nothing\n if(!parsedValue)\n {\n return;\n }\n\n //range value\n if(Array.isArray(parsedValue))\n {\n //TODO: finish range support\n }\n else\n {\n //do nothing for invalid date time\n if(!parsedValue.isValid())\n {\n return;\n }\n\n switch(event.key)\n {\n case 'ArrowRight':\n case 'ArrowLeft':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowLeft' ? parsedValue.subtractDays(1) : parsedValue.addDays(1));\n\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowUp' ? parsedValue.subtractWeeks(1) : parsedValue.addWeeks(1));\n\n break;\n }\n case 'Escape':\n {\n this.picker?.hidePicker();\n\n break;\n }\n case ' ':\n {\n if(event.ctrlKey)\n {\n this.picker?.showPicker();\n }\n\n break;\n }\n }\n }\n }\n\n /**\n * Tests whether are min or max constraint broken, returns true if constraint is broken\n * @param value - Value to be tested\n */\n protected minMaxConstraintTest(value: DateApiObject<TDate>): boolean\n {\n return (!!this.dateTimeData.minDateTime && value.isBefore(this.dateTimeData.minDateTime)) ||\n (!!this.dateTimeData.maxDateTime && value.isAfter(this.dateTimeData.maxDateTime));\n }\n\n /**\n * Runs code with check whether min max constrains was broken\n * @param value - Value to be used checked for constrains\n * @param code - Code that should be executed which can change current value\n */\n protected withMinMaxConstraint(value: DateApiObject<TDate>, code: () => void): void\n {\n value.updateOriginal();\n\n code();\n\n //min value constraint failure\n if(this.minMaxConstraintTest(value))\n {\n value.resetOriginal();\n }\n\n //value has changed, change input value\n if(!value.isSame(value.originalValue))\n {\n this.input.value = value.value;\n this.input.valueChange.next();\n }\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { Directive } from '@angular/core';
2
+ import { SimpleDatePickerInputSADirective } from '../simpleDatePickerInput/simpleDatePickerInput.directive';
3
+ import { WithTimeSADirective } from '../withTime/withTime.directive';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "../simpleDatePickerInput/simpleDatePickerInput.directive";
6
+ import * as i2 from "../withTime/withTime.directive";
7
+ /**
8
+ * Directive that combines date time picker with simple date time input
9
+ */
10
+ export class SimpleDateTimePickerInputSADirective {
11
+ }
12
+ SimpleDateTimePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
+ SimpleDateTimePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDateTimePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDateTimePickerInput]", hostDirectives: [{ directive: i1.SimpleDatePickerInputSADirective }, { directive: i2.WithTimeSADirective }], ngImport: i0 });
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimePickerInputSADirective, decorators: [{
15
+ type: Directive,
16
+ args: [{
17
+ selector: 'input[dateTime][simpleDateTimePickerInput]',
18
+ standalone: true,
19
+ hostDirectives: [
20
+ {
21
+ directive: SimpleDatePickerInputSADirective,
22
+ },
23
+ {
24
+ directive: WithTimeSADirective,
25
+ },
26
+ ],
27
+ }]
28
+ }] });
29
+ //# sourceMappingURL=simpleDateTimePickerInput.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,gCAAgC,EAAC,MAAM,0DAA0D,CAAC;AAC1G,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;;;;AAEnE;;GAEG;AAeH,MAAM,OAAO,oCAAoC;;iIAApC,oCAAoC;qHAApC,oCAAoC;2FAApC,oCAAoC;kBAdhD,SAAS;mBACV;oBACI,QAAQ,EAAE,4CAA4C;oBACtD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,gCAAgC;yBAC9C;wBACD;4BACI,SAAS,EAAE,mBAAmB;yBACjC;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {SimpleDatePickerInputSADirective} from '../simpleDatePickerInput/simpleDatePickerInput.directive';\nimport {WithTimeSADirective} from '../withTime/withTime.directive';\n\n/**\n * Directive that combines date time picker with simple date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDateTimePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: SimpleDatePickerInputSADirective,\n },\n {\n directive: WithTimeSADirective,\n },\n ],\n})\nexport class SimpleDateTimePickerInputSADirective\n{\n}"]}
@@ -94,6 +94,7 @@ export class DateTimeInputSADirective extends DateTimeBase {
94
94
  if (isBlank(this.internalValue)) {
95
95
  return;
96
96
  }
97
+ //update for specified format, round
97
98
  //ranged value
98
99
  if (Array.isArray(this.internalValue)) {
99
100
  const [from, to] = this.internalValue;
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,wBAA0C,SAAQ,YAAmB;IA6E9E,kEAAkE;IAClE,YAAsB,UAAwC,EACtB,OAAuB,EACzC,aAAuC;QAEzD,KAAK,EAAE,CAAC;QAJU,eAAU,GAAV,UAAU,CAA8B;QACtB,YAAO,GAAP,OAAO,CAAgB;QACzC,kBAAa,GAAb,aAAa,CAA0B;QAb7D;;WAEG;QACI,UAAK,GAA6B,IAAI,YAAY,EAAc,CAAC;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E,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAEhH,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IAEO,WAAW,CAAC,KAAiB;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;qHAlMQ,wBAAwB,4CA+Eb,QAAQ;yGA/EnB,wBAAwB,6EAVjC;QAEI;YACI,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;SAC1D;KACJ;AAiKD;IAAC,QAAQ;;;;2DAiBR;AAMD;IAAC,QAAQ;;qCACoB,UAAU;;2DAGtC;AAMD;IAAC,QAAQ;;qCACmB,UAAU;;0DAGrC;2FAlMQ,wBAAwB;kBAdpC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBAC1D;qBACJ;oBACD,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;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(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,wBAA0C,SAAQ,YAAmB;IA6E9E,kEAAkE;IAClE,YAAsB,UAAwC,EACtB,OAAuB,EACzC,aAAuC;QAEzD,KAAK,EAAE,CAAC;QAJU,eAAU,GAAV,UAAU,CAA8B;QACtB,YAAO,GAAP,OAAO,CAAgB;QACzC,kBAAa,GAAb,aAAa,CAA0B;QAb7D;;WAEG;QACI,UAAK,GAA6B,IAAI,YAAY,EAAc,CAAC;QAExE;;WAEG;QACI,SAAI,GAA6B,IAAI,YAAY,EAAc,CAAC;QASnE,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1E,IAAI,CAA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AI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;qHApMQ,wBAAwB,4CA+Eb,QAAQ;yGA/EnB,wBAAwB,6EAVjC;QAEI;YACI,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;SAC1D;KACJ;AAmKD;IAAC,QAAQ;;;;2DAiBR;AAMD;IAAC,QAAQ;;qCACoB,UAAU;;2DAGtC;AAMD;IAAC,QAAQ;;qCACmB,UAAU;;0DAGrC;2FApMQ,wBAAwB;kBAdpC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBAC1D;qBACJ;oBACD,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;4EAiFlB,WAAW,MAuBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //update for specified format, round\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
@@ -1,4 +1,6 @@
1
1
  export * from './simpleDatePickerInput/simpleDatePickerInput.directive';
2
+ export * from './simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';
3
+ export * from './simpleDateTimePickerInput/simpleDateTimePickerInput.directive';
2
4
  export * from './withTime/withTime.directive';
3
5
  export * from './withToday/withToday.directive';
4
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './simpleDatePickerInput/simpleDatePickerInput.directive';\nexport * from './withTime/withTime.directive';\nexport * from './withToday/withToday.directive';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/directives/index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,mEAAmE,CAAC;AAClF,cAAc,iEAAiE,CAAC;AAChF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC","sourcesContent":["export * from './simpleDatePickerInput/simpleDatePickerInput.directive';\nexport * from './simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';\nexport * from './simpleDateTimePickerInput/simpleDateTimePickerInput.directive';\nexport * from './withTime/withTime.directive';\nexport * from './withToday/withToday.directive';\n"]}
@@ -1,16 +1,18 @@
1
1
  import { Directive } from '@angular/core';
2
2
  import { DateTimeInputSADirective, DateTimePickerSADirective } from '../../modules';
3
+ import { SimpleDateTimeInputHandlerSADirective } from '../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';
3
4
  import * as i0 from "@angular/core";
4
5
  import * as i1 from "../../modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive";
5
6
  import * as i2 from "../../modules/dateTime/directives/dateTimeInput/dateTimeInput.directive";
7
+ import * as i3 from "../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive";
6
8
  /**
7
- * Directive that combines date picker with simple date time input
9
+ * Directive that combines date picker with simple date input
8
10
  */
9
- export class DatePickerInputSADirective {
11
+ export class SimpleDatePickerInputSADirective {
10
12
  }
11
- DatePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DatePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
12
- DatePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: DatePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDatePickerInput]", hostDirectives: [{ directive: i1.DateTimePickerSADirective, inputs: ["withPickerOptions", "withPickerOptions", "pickerOptions", "pickerOptions"] }, { directive: i2.DateTimeInputSADirective }], ngImport: i0 });
13
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: DatePickerInputSADirective, decorators: [{
13
+ SimpleDatePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDatePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
14
+ SimpleDatePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDatePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDatePickerInput]", hostDirectives: [{ directive: i1.DateTimePickerSADirective, inputs: ["withPickerOptions", "withPickerOptions", "pickerOptions", "pickerOptions"] }, { directive: i2.DateTimeInputSADirective }, { directive: i3.SimpleDateTimeInputHandlerSADirective }], ngImport: i0 });
15
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDatePickerInputSADirective, decorators: [{
14
16
  type: Directive,
15
17
  args: [{
16
18
  selector: 'input[dateTime][simpleDatePickerInput]',
@@ -26,6 +28,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImpor
26
28
  {
27
29
  directive: DateTimeInputSADirective,
28
30
  },
31
+ {
32
+ directive: SimpleDateTimeInputHandlerSADirective,
33
+ },
29
34
  ],
30
35
  }]
31
36
  }] });
@@ -1 +1 @@
1
- {"version":3,"file":"simpleDatePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,eAAe,CAAC;;;;AAElF;;GAEG;AAoBH,MAAM,OAAO,0BAA0B;;uHAA1B,0BAA0B;2GAA1B,0BAA0B;2FAA1B,0BAA0B;kBAnBtC,SAAS;mBACV;oBACI,QAAQ,EAAE,wCAAwC;oBAClD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,yBAAyB;4BACpC,MAAM,EACN;gCACI,mBAAmB;gCACnB,eAAe;6BAClB;yBACJ;wBACD;4BACI,SAAS,EAAE,wBAAwB;yBACtC;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {DateTimeInputSADirective, DateTimePickerSADirective} from '../../modules';\n\n/**\n * Directive that combines date picker with simple date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDatePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: DateTimePickerSADirective,\n inputs:\n [\n 'withPickerOptions',\n 'pickerOptions',\n ]\n },\n {\n directive: DateTimeInputSADirective,\n },\n ],\n})\nexport class DatePickerInputSADirective\n{\n}"]}
1
+ {"version":3,"file":"simpleDatePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDatePickerInput/simpleDatePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,wBAAwB,EAAE,yBAAyB,EAAC,MAAM,eAAe,CAAC;AAClF,OAAO,EAAC,qCAAqC,EAAC,MAAM,oEAAoE,CAAC;;;;;AAEzH;;GAEG;AAuBH,MAAM,OAAO,gCAAgC;;6HAAhC,gCAAgC;iHAAhC,gCAAgC;2FAAhC,gCAAgC;kBAtB5C,SAAS;mBACV;oBACI,QAAQ,EAAE,wCAAwC;oBAClD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,yBAAyB;4BACpC,MAAM,EACN;gCACI,mBAAmB;gCACnB,eAAe;6BAClB;yBACJ;wBACD;4BACI,SAAS,EAAE,wBAAwB;yBACtC;wBACD;4BACI,SAAS,EAAE,qCAAqC;yBACnD;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {DateTimeInputSADirective, DateTimePickerSADirective} from '../../modules';\nimport {SimpleDateTimeInputHandlerSADirective} from '../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';\n\n/**\n * Directive that combines date picker with simple date input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDatePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: DateTimePickerSADirective,\n inputs:\n [\n 'withPickerOptions',\n 'pickerOptions',\n ]\n },\n {\n directive: DateTimeInputSADirective,\n },\n {\n directive: SimpleDateTimeInputHandlerSADirective,\n },\n ],\n})\nexport class SimpleDatePickerInputSADirective\n{\n}"]}
@@ -0,0 +1,136 @@
1
+ import { __decorate, __metadata } from "tslib";
2
+ import { Directive, Inject, Optional } from '@angular/core';
3
+ import { BindThis } from '@jscrpt/common';
4
+ import { DATE_TIME_INPUT, DATE_API } from '../../misc/tokens';
5
+ import { parseDateTime } from '../../misc/utils';
6
+ import { DateTimePickerSADirective, DateTimeSADirective } from '../../modules';
7
+ import * as i0 from "@angular/core";
8
+ import * as i1 from "../../modules";
9
+ /**
10
+ * Directive that adds simple handler for date time input, which allows simple navigation using keyboard
11
+ */
12
+ export class SimpleDateTimeInputHandlerSADirective {
13
+ //######################### constructor #########################
14
+ constructor(input, dateApi, dateTimeData, picker) {
15
+ this.input = input;
16
+ this.dateApi = dateApi;
17
+ this.dateTimeData = dateTimeData;
18
+ this.picker = picker;
19
+ }
20
+ //######################### public methods - implementation of OnInit #########################
21
+ /**
22
+ * Initialize component
23
+ */
24
+ ngOnInit() {
25
+ this.input.element.addEventListener('keydown', this.handleKeyboard);
26
+ }
27
+ //######################### public methods - implementation of OnDestroy #########################
28
+ /**
29
+ * Called when component is destroyed
30
+ */
31
+ ngOnDestroy() {
32
+ this.input.element.removeEventListener('keydown', this.handleKeyboard);
33
+ }
34
+ //######################### protected methods #########################
35
+ /**
36
+ * Handles keyboard events
37
+ * @param event - Keyboard event that occured
38
+ */
39
+ handleKeyboard(event) {
40
+ const parsedValue = parseDateTime(this.input.value, this.dateApi, null, this.dateTimeData.customFormat);
41
+ //no value do nothing
42
+ if (!parsedValue) {
43
+ return;
44
+ }
45
+ //range value
46
+ if (Array.isArray(parsedValue)) {
47
+ //TODO: finish range support
48
+ }
49
+ else {
50
+ //do nothing for invalid date time
51
+ if (!parsedValue.isValid()) {
52
+ return;
53
+ }
54
+ switch (event.key) {
55
+ case 'ArrowRight':
56
+ case 'ArrowLeft':
57
+ {
58
+ event.preventDefault();
59
+ event.stopPropagation();
60
+ this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowLeft' ? parsedValue.subtractDays(1) : parsedValue.addDays(1));
61
+ break;
62
+ }
63
+ case 'ArrowUp':
64
+ case 'ArrowDown':
65
+ {
66
+ event.preventDefault();
67
+ event.stopPropagation();
68
+ this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowUp' ? parsedValue.subtractWeeks(1) : parsedValue.addWeeks(1));
69
+ break;
70
+ }
71
+ case 'Escape':
72
+ {
73
+ this.picker?.hidePicker();
74
+ break;
75
+ }
76
+ case ' ':
77
+ {
78
+ if (event.ctrlKey) {
79
+ this.picker?.showPicker();
80
+ }
81
+ break;
82
+ }
83
+ }
84
+ }
85
+ }
86
+ /**
87
+ * Tests whether are min or max constraint broken, returns true if constraint is broken
88
+ * @param value - Value to be tested
89
+ */
90
+ minMaxConstraintTest(value) {
91
+ return (!!this.dateTimeData.minDateTime && value.isBefore(this.dateTimeData.minDateTime)) ||
92
+ (!!this.dateTimeData.maxDateTime && value.isAfter(this.dateTimeData.maxDateTime));
93
+ }
94
+ /**
95
+ * Runs code with check whether min max constrains was broken
96
+ * @param value - Value to be used checked for constrains
97
+ * @param code - Code that should be executed which can change current value
98
+ */
99
+ withMinMaxConstraint(value, code) {
100
+ value.updateOriginal();
101
+ code();
102
+ //min value constraint failure
103
+ if (this.minMaxConstraintTest(value)) {
104
+ value.resetOriginal();
105
+ }
106
+ //value has changed, change input value
107
+ if (!value.isSame(value.originalValue)) {
108
+ this.input.value = value.value;
109
+ this.input.valueChange.next();
110
+ }
111
+ }
112
+ }
113
+ SimpleDateTimeInputHandlerSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimeInputHandlerSADirective, deps: [{ token: DATE_TIME_INPUT }, { token: DATE_API }, { token: i1.DateTimeSADirective }, { token: i1.DateTimePickerSADirective, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
114
+ SimpleDateTimeInputHandlerSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDateTimeInputHandlerSADirective, isStandalone: true, selector: "[dateTime][withSimpleHandler]", ngImport: i0 });
115
+ __decorate([
116
+ BindThis,
117
+ __metadata("design:type", Function),
118
+ __metadata("design:paramtypes", [KeyboardEvent]),
119
+ __metadata("design:returntype", void 0)
120
+ ], SimpleDateTimeInputHandlerSADirective.prototype, "handleKeyboard", null);
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimeInputHandlerSADirective, decorators: [{
122
+ type: Directive,
123
+ args: [{
124
+ selector: '[dateTime][withSimpleHandler]',
125
+ standalone: true,
126
+ }]
127
+ }], ctorParameters: function () { return [{ type: undefined, decorators: [{
128
+ type: Inject,
129
+ args: [DATE_TIME_INPUT]
130
+ }] }, { type: undefined, decorators: [{
131
+ type: Inject,
132
+ args: [DATE_API]
133
+ }] }, { type: i1.DateTimeSADirective }, { type: i1.DateTimePickerSADirective, decorators: [{
134
+ type: Optional
135
+ }] }]; }, propDecorators: { handleKeyboard: [] } });
136
+ //# sourceMappingURL=simpleDateTimeInputHandler.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimeInputHandler.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,MAAM,EAAqB,QAAQ,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAC;AAGxC,OAAO,EAAC,eAAe,EAAE,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAC,yBAAyB,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;;;AAG7E;;GAEG;AAMH,MAAM,OAAO,qCAAqC;IAE9C,iEAAiE;IACjE,YAA+C,KAA2B,EAClC,OAAuB,EACzC,YAAwC,EAC5B,MAAyC;QAH5B,UAAK,GAAL,KAAK,CAAsB;QAClC,YAAO,GAAP,OAAO,CAAgB;QACzC,iBAAY,GAAZ,YAAY,CAA4B;QAC5B,WAAM,GAAN,MAAM,CAAmC;IAE3E,CAAC;IAED,+FAA+F;IAE/F;;OAEG;IACI,QAAQ;QAEX,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAA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AAqC;AAoC9C;IAAC,QAAQ;;qCACoB,aAAa;;2EA8DzC;2FAnGQ,qCAAqC;kBALjD,SAAS;mBACV;oBACI,QAAQ,EAAE,+BAA+B;oBACzC,UAAU,EAAE,IAAI;iBACnB;;0BAIgB,MAAM;2BAAC,eAAe;;0BACtB,MAAM;2BAAC,QAAQ;;0BAEf,QAAQ;4CA+Bd,cAAc","sourcesContent":["import {Directive, Inject, OnDestroy, OnInit, Optional} from '@angular/core';\nimport {BindThis} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../interfaces';\nimport {DATE_TIME_INPUT, DATE_API} from '../../misc/tokens';\nimport {parseDateTime} from '../../misc/utils';\nimport {DateTimePickerSADirective, DateTimeSADirective} from '../../modules';\nimport {DateApi, DateApiObject} from '../../services';\n\n/**\n * Directive that adds simple handler for date time input, which allows simple navigation using keyboard\n */\n@Directive(\n{\n selector: '[dateTime][withSimpleHandler]',\n standalone: true,\n})\nexport class SimpleDateTimeInputHandlerSADirective<TDate = unknown> implements OnInit, OnDestroy\n{\n //######################### constructor #########################\n constructor(@Inject(DATE_TIME_INPUT) protected input: DateTimeInput<TDate>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected dateTimeData: DateTimeSADirective<TDate>,\n @Optional() protected picker?: DateTimePickerSADirective<TDate>,)\n {\n }\n\n //######################### public methods - implementation of OnInit #########################\n \n /**\n * Initialize component\n */\n public ngOnInit(): void\n {\n this.input.element.addEventListener('keydown', this.handleKeyboard);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n this.input.element.removeEventListener('keydown', this.handleKeyboard);\n }\n\n //######################### protected methods #########################\n\n /**\n * Handles keyboard events\n * @param event - Keyboard event that occured\n */\n @BindThis\n public handleKeyboard(event: KeyboardEvent): void\n {\n const parsedValue = parseDateTime(this.input.value, this.dateApi, null, this.dateTimeData.customFormat);\n \n //no value do nothing\n if(!parsedValue)\n {\n return;\n }\n\n //range value\n if(Array.isArray(parsedValue))\n {\n //TODO: finish range support\n }\n else\n {\n //do nothing for invalid date time\n if(!parsedValue.isValid())\n {\n return;\n }\n\n switch(event.key)\n {\n case 'ArrowRight':\n case 'ArrowLeft':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowLeft' ? parsedValue.subtractDays(1) : parsedValue.addDays(1));\n\n break;\n }\n case 'ArrowUp':\n case 'ArrowDown':\n {\n event.preventDefault();\n event.stopPropagation();\n\n this.withMinMaxConstraint(parsedValue, () => event.key == 'ArrowUp' ? parsedValue.subtractWeeks(1) : parsedValue.addWeeks(1));\n\n break;\n }\n case 'Escape':\n {\n this.picker?.hidePicker();\n\n break;\n }\n case ' ':\n {\n if(event.ctrlKey)\n {\n this.picker?.showPicker();\n }\n\n break;\n }\n }\n }\n }\n\n /**\n * Tests whether are min or max constraint broken, returns true if constraint is broken\n * @param value - Value to be tested\n */\n protected minMaxConstraintTest(value: DateApiObject<TDate>): boolean\n {\n return (!!this.dateTimeData.minDateTime && value.isBefore(this.dateTimeData.minDateTime)) ||\n (!!this.dateTimeData.maxDateTime && value.isAfter(this.dateTimeData.maxDateTime));\n }\n\n /**\n * Runs code with check whether min max constrains was broken\n * @param value - Value to be used checked for constrains\n * @param code - Code that should be executed which can change current value\n */\n protected withMinMaxConstraint(value: DateApiObject<TDate>, code: () => void): void\n {\n value.updateOriginal();\n\n code();\n\n //min value constraint failure\n if(this.minMaxConstraintTest(value))\n {\n value.resetOriginal();\n }\n\n //value has changed, change input value\n if(!value.isSame(value.originalValue))\n {\n this.input.value = value.value;\n this.input.valueChange.next();\n }\n }\n}\n"]}
@@ -0,0 +1,29 @@
1
+ import { Directive } from '@angular/core';
2
+ import { SimpleDatePickerInputSADirective } from '../simpleDatePickerInput/simpleDatePickerInput.directive';
3
+ import { WithTimeSADirective } from '../withTime/withTime.directive';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "../simpleDatePickerInput/simpleDatePickerInput.directive";
6
+ import * as i2 from "../withTime/withTime.directive";
7
+ /**
8
+ * Directive that combines date time picker with simple date time input
9
+ */
10
+ export class SimpleDateTimePickerInputSADirective {
11
+ }
12
+ SimpleDateTimePickerInputSADirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimePickerInputSADirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
13
+ SimpleDateTimePickerInputSADirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.4", type: SimpleDateTimePickerInputSADirective, isStandalone: true, selector: "input[dateTime][simpleDateTimePickerInput]", hostDirectives: [{ directive: i1.SimpleDatePickerInputSADirective }, { directive: i2.WithTimeSADirective }], ngImport: i0 });
14
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.4", ngImport: i0, type: SimpleDateTimePickerInputSADirective, decorators: [{
15
+ type: Directive,
16
+ args: [{
17
+ selector: 'input[dateTime][simpleDateTimePickerInput]',
18
+ standalone: true,
19
+ hostDirectives: [
20
+ {
21
+ directive: SimpleDatePickerInputSADirective,
22
+ },
23
+ {
24
+ directive: WithTimeSADirective,
25
+ },
26
+ ],
27
+ }]
28
+ }] });
29
+ //# sourceMappingURL=simpleDateTimePickerInput.directive.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimePickerInput.directive.js","sourceRoot":"","sources":["../../../../src/directives/simpleDateTimePickerInput/simpleDateTimePickerInput.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AAExC,OAAO,EAAC,gCAAgC,EAAC,MAAM,0DAA0D,CAAC;AAC1G,OAAO,EAAC,mBAAmB,EAAC,MAAM,gCAAgC,CAAC;;;;AAEnE;;GAEG;AAeH,MAAM,OAAO,oCAAoC;;iIAApC,oCAAoC;qHAApC,oCAAoC;2FAApC,oCAAoC;kBAdhD,SAAS;mBACV;oBACI,QAAQ,EAAE,4CAA4C;oBACtD,UAAU,EAAE,IAAI;oBAChB,cAAc,EACd;wBACI;4BACI,SAAS,EAAE,gCAAgC;yBAC9C;wBACD;4BACI,SAAS,EAAE,mBAAmB;yBACjC;qBACJ;iBACJ","sourcesContent":["import {Directive} from '@angular/core';\n\nimport {SimpleDatePickerInputSADirective} from '../simpleDatePickerInput/simpleDatePickerInput.directive';\nimport {WithTimeSADirective} from '../withTime/withTime.directive';\n\n/**\n * Directive that combines date time picker with simple date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][simpleDateTimePickerInput]',\n standalone: true,\n hostDirectives:\n [\n {\n directive: SimpleDatePickerInputSADirective,\n },\n {\n directive: WithTimeSADirective,\n },\n ],\n})\nexport class SimpleDateTimePickerInputSADirective\n{\n}"]}
@@ -93,6 +93,7 @@ export class DateTimeInputSADirective extends DateTimeBase {
93
93
  if (isBlank(this.internalValue)) {
94
94
  return;
95
95
  }
96
+ //update for specified format, round
96
97
  //ranged value
97
98
  if (Array.isArray(this.internalValue)) {
98
99
  const [from, to] = this.internalValue;
@@ -1 +1 @@
1
- {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAeH,MAA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OnDestroy} from '@angular/core';\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
1
+ {"version":3,"file":"dateTimeInput.directive.js","sourceRoot":"","sources":["../../../../../../src/modules/dateTime/directives/dateTimeInput/dateTimeInput.directive.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,SAAS,EAAE,UAAU,EAAE,YAAY,EAAoB,UAAU,EAAE,MAAM,EAAY,MAAM,eAAe,CAAC;AACnH,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAGjD,OAAO,EAAC,QAAQ,EAAE,eAAe,EAAC,MAAM,yBAAyB,CAAC;AAElE,OAAO,EAAC,cAAc,EAAE,aAAa,EAAC,MAAM,wBAAwB,CAAC;AACrE,OAAO,EAAU,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAC,YAAY,EAAC,MAAM,iBAAiB,CAAC;;;AAE7C,8BAA8B;AAE9B;;GAEG;AAeH,MAAM,OAAO,wBAA0C,SAAQ,YAAmB;IA6E9E,kEAAkE;IAClE,YAAsB,UAAwC,EACtB,OAAuB,EACzC,aAAuC;QAEzD,KAAK,EAAE,CAAC;QAJU,eAAU,GAAV,UAAU,CAA8B;QACtB,YAAO,GAAP,OAAO,CAAgB;QACzC,kBAAa,GAAb,a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CAAC,aAAa,EAAE,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;QAEhH,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC5B,CAAC;IAED;;;OAGG;IAEO,WAAW,CAAC,KAAiB;QAEnC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED;;;OAGG;IAEO,UAAU,CAAC,KAAiB;QAElC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC1B,CAAC;;qHApMQ,wBAAwB,4CA+Eb,QAAQ;yGA/EnB,wBAAwB,6EAVjC;QAEI;YACI,OAAO,EAAE,eAAe;YACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAwB,CAAC;SAC1D;KACJ;AAmKD;IAAC,QAAQ;;;;2DAiBR;AAMD;IAAC,QAAQ;;qCACoB,UAAU;;2DAGtC;AAMD;IAAC,QAAQ;;qCACmB,UAAU;;0DAGrC;2FApMQ,wBAAwB;kBAdpC,SAAS;mBACV;oBACI,QAAQ,EAAE,gCAAgC;oBAC1C,SAAS,EACT;wBAEI;4BACI,OAAO,EAAE,eAAe;4BACxB,WAAW,EAAE,UAAU,CAAC,GAAG,EAAE,yBAAyB,CAAC;yBAC1D;qBACJ;oBACD,UAAU,EAAE,IAAI;oBAChB,QAAQ,EAAE,UAAU;iBACvB;;0BAgFgB,MAAM;2BAAC,QAAQ;4EAiFlB,WAAW,MAuBX,WAAW,MAUX,UAAU","sourcesContent":["import {Directive, ElementRef, EventEmitter, ExistingProvider, forwardRef, Inject, OnDestroy} from '@angular/core';\nimport {BindThis, isBlank} from '@jscrpt/common';\n\nimport {DateTimeInput} from '../../../../interfaces';\nimport {DATE_API, DATE_TIME_INPUT} from '../../../../misc/tokens';\nimport {DateTimeInputOutputValue, DateTimeObjectValue} from '../../../../misc/types';\nimport {formatDateTime, parseDateTime} from '../../../../misc/utils';\nimport {DateApi, DateValueProvider} from '../../../../services';\nimport {DateTimeBase} from '../dateTimeBase';\n\n//TODO: range is unimplemented\n\n/**\n * Directive that is used for setting up date time input\n */\n@Directive(\n{\n selector: 'input[dateTime][dateTimeInput]',\n providers:\n [\n <ExistingProvider>\n {\n provide: DATE_TIME_INPUT,\n useExisting: forwardRef(() => DateTimeInputSADirective),\n },\n ],\n standalone: true,\n exportAs: 'dateTime',\n})\nexport class DateTimeInputSADirective<TDate = unknown> extends DateTimeBase<TDate> implements DateTimeInput, OnDestroy\n{\n //######################### protected properties #########################\n\n /**\n * Internal representation of current date time value\n */\n protected internalValue: DateTimeObjectValue<TDate>|undefined|null;\n\n //######################### public properties - implementation of DateTimeInput #########################\n\n /**\n * @inheritdoc\n */\n public get rawValue(): string|undefined|null\n {\n return this.elementRef.nativeElement.value;\n }\n public set rawValue(value: string|undefined|null)\n {\n this.elementRef.nativeElement.value = value ?? '';\n }\n\n /**\n * @inheritdoc\n */\n public override get value(): DateTimeInputOutputValue<TDate>|undefined|null\n {\n return this.ɵValue;\n }\n public override set value(value: DateTimeInputOutputValue<TDate>|undefined|null)\n {\n //accepts all available formats\n this.setInternalValue(value);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n \n //not range value\n if(!Array.isArray(this.internalValue))\n {\n this.rawValue = this.internalValue?.format(this.dateTimeData.customFormat);\n }\n else\n {\n //TODO: add support for ranges\n }\n }\n\n /**\n * @inheritdoc\n */\n public get disabled(): boolean\n {\n return this.elementRef.nativeElement.disabled;\n }\n public set disabled(value: boolean)\n {\n this.elementRef.nativeElement.disabled = value;\n }\n\n /**\n * Html element that represents input itself\n */\n public get element(): HTMLElement\n {\n return this.elementRef.nativeElement;\n }\n\n /**\n * @inheritdoc\n */\n public focus: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n /**\n * @inheritdoc\n */\n public blur: EventEmitter<FocusEvent> = new EventEmitter<FocusEvent>();\n\n //######################### constructors #########################\n constructor(protected elementRef: ElementRef<HTMLInputElement>,\n @Inject(DATE_API) protected dateApi: DateApi<TDate>,\n protected valueProvider: DateValueProvider<TDate>,)\n {\n super();\n\n this.elementRef.nativeElement.addEventListener('input', this.handleInput);\n this.elementRef.nativeElement.addEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.addEventListener('blur', this.handleBlur);\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public override ngOnDestroy(): void\n {\n super.ngOnDestroy();\n\n this.elementRef.nativeElement.removeEventListener('input', this.handleInput);\n this.elementRef.nativeElement.removeEventListener('focus', this.handleFocus);\n this.elementRef.nativeElement.removeEventListener('blur', this.handleBlur);\n }\n\n //######################### protected methods #########################\n\n /**\n * Sets internal value and fix lowest time difference\n * @param value - Value to be set\n */\n protected setInternalValue(value: DateTimeInputOutputValue<TDate>|undefined|null): void\n {\n this.internalValue = parseDateTime(value, this.dateApi, null, this.dateTimeData.customFormat);\n\n if(isBlank(this.internalValue))\n {\n return;\n }\n\n //update for specified format, round\n\n //ranged value\n if(Array.isArray(this.internalValue))\n {\n const [from, to] = this.internalValue;\n\n if(from)\n {\n const val = this.valueProvider.getValue(from.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue[0] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n\n if(to)\n {\n const val = this.valueProvider.getValue(to.value, this.dateTimeData.customFormat).to;\n\n if(val)\n {\n this.internalValue[1] = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n else\n {\n const val = this.valueProvider.getValue(this.internalValue.value, this.dateTimeData.customFormat).from;\n\n if(val)\n {\n this.internalValue = this.dateApi.getValue(val, this.dateTimeData.customFormat);\n }\n }\n }\n\n /**\n * Handles input event on input\n */\n @BindThis\n protected handleInput(): void\n {\n if(!this.rawValue)\n {\n this.internalValue = null;\n this.ɵValue = null;\n\n this.valueChange.next();\n\n return;\n }\n\n this.setInternalValue(this.rawValue);\n this.ɵValue = formatDateTime(this.internalValue, this.dateTimeData.valueFormat, this.dateTimeData.customFormat);\n\n this.valueChange.next();\n }\n\n /**\n * Handles focus event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleFocus(event: FocusEvent): void\n {\n this.focus.emit(event);\n }\n\n /**\n * Handles blur event on input\n * @param event - Event that occured\n */\n @BindThis\n protected handleBlur(event: FocusEvent): void\n {\n this.blur.emit(event);\n }\n}"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anglr/datetime",
3
- "version": "6.0.0-beta.20221223060503",
3
+ "version": "6.0.0-beta.20221223105933",
4
4
  "description": "Angular library for datetime manipulation components",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,4 +1,6 @@
1
1
  export * from './simpleDatePickerInput/simpleDatePickerInput.directive';
2
+ export * from './simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive';
3
+ export * from './simpleDateTimePickerInput/simpleDateTimePickerInput.directive';
2
4
  export * from './withTime/withTime.directive';
3
5
  export * from './withToday/withToday.directive';
4
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,cAAc,yDAAyD,CAAC;AACxE,cAAc,mEAAmE,CAAC;AAClF,cAAc,iEAAiE,CAAC;AAChF,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC"}
@@ -1,11 +1,12 @@
1
1
  import * as i0 from "@angular/core";
2
2
  import * as i1 from "../../modules/dateTimePicker/directives/dateTimePicker/dateTimePicker.directive";
3
3
  import * as i2 from "../../modules/dateTime/directives/dateTimeInput/dateTimeInput.directive";
4
+ import * as i3 from "../simpleDateTimeInputHandler/simpleDateTimeInputHandler.directive";
4
5
  /**
5
- * Directive that combines date picker with simple date time input
6
+ * Directive that combines date picker with simple date input
6
7
  */
7
- export declare class DatePickerInputSADirective {
8
- static ɵfac: i0.ɵɵFactoryDeclaration<DatePickerInputSADirective, never>;
9
- static ɵdir: i0.ɵɵDirectiveDeclaration<DatePickerInputSADirective, "input[dateTime][simpleDatePickerInput]", never, {}, {}, never, never, true, [{ directive: typeof i1.DateTimePickerSADirective; inputs: { "withPickerOptions": "withPickerOptions"; "pickerOptions": "pickerOptions"; }; outputs: {}; }, { directive: typeof i2.DateTimeInputSADirective; inputs: {}; outputs: {}; }]>;
8
+ export declare class SimpleDatePickerInputSADirective {
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<SimpleDatePickerInputSADirective, never>;
10
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SimpleDatePickerInputSADirective, "input[dateTime][simpleDatePickerInput]", never, {}, {}, never, never, true, [{ directive: typeof i1.DateTimePickerSADirective; inputs: { "withPickerOptions": "withPickerOptions"; "pickerOptions": "pickerOptions"; }; outputs: {}; }, { directive: typeof i2.DateTimeInputSADirective; inputs: {}; outputs: {}; }, { directive: typeof i3.SimpleDateTimeInputHandlerSADirective; inputs: {}; outputs: {}; }]>;
10
11
  }
11
12
  //# sourceMappingURL=simpleDatePickerInput.directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simpleDatePickerInput.directive.d.ts","sourceRoot":"","sources":["simpleDatePickerInput.directive.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,qBAmBa,0BAA0B;yCAA1B,0BAA0B;2CAA1B,0BAA0B;CAEtC"}
1
+ {"version":3,"file":"simpleDatePickerInput.directive.d.ts","sourceRoot":"","sources":["simpleDatePickerInput.directive.ts"],"names":[],"mappings":";;;;AAKA;;GAEG;AACH,qBAsBa,gCAAgC;yCAAhC,gCAAgC;2CAAhC,gCAAgC;CAE5C"}
@@ -0,0 +1,42 @@
1
+ import { OnDestroy, OnInit } from '@angular/core';
2
+ import { DateTimeInput } from '../../interfaces';
3
+ import { DateTimePickerSADirective, DateTimeSADirective } from '../../modules';
4
+ import { DateApi, DateApiObject } from '../../services';
5
+ import * as i0 from "@angular/core";
6
+ /**
7
+ * Directive that adds simple handler for date time input, which allows simple navigation using keyboard
8
+ */
9
+ export declare class SimpleDateTimeInputHandlerSADirective<TDate = unknown> implements OnInit, OnDestroy {
10
+ protected input: DateTimeInput<TDate>;
11
+ protected dateApi: DateApi<TDate>;
12
+ protected dateTimeData: DateTimeSADirective<TDate>;
13
+ protected picker?: DateTimePickerSADirective<TDate> | undefined;
14
+ constructor(input: DateTimeInput<TDate>, dateApi: DateApi<TDate>, dateTimeData: DateTimeSADirective<TDate>, picker?: DateTimePickerSADirective<TDate> | undefined);
15
+ /**
16
+ * Initialize component
17
+ */
18
+ ngOnInit(): void;
19
+ /**
20
+ * Called when component is destroyed
21
+ */
22
+ ngOnDestroy(): void;
23
+ /**
24
+ * Handles keyboard events
25
+ * @param event - Keyboard event that occured
26
+ */
27
+ handleKeyboard(event: KeyboardEvent): void;
28
+ /**
29
+ * Tests whether are min or max constraint broken, returns true if constraint is broken
30
+ * @param value - Value to be tested
31
+ */
32
+ protected minMaxConstraintTest(value: DateApiObject<TDate>): boolean;
33
+ /**
34
+ * Runs code with check whether min max constrains was broken
35
+ * @param value - Value to be used checked for constrains
36
+ * @param code - Code that should be executed which can change current value
37
+ */
38
+ protected withMinMaxConstraint(value: DateApiObject<TDate>, code: () => void): void;
39
+ static ɵfac: i0.ɵɵFactoryDeclaration<SimpleDateTimeInputHandlerSADirective<any>, [null, null, null, { optional: true; }]>;
40
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SimpleDateTimeInputHandlerSADirective<any>, "[dateTime][withSimpleHandler]", never, {}, {}, never, never, true, never>;
41
+ }
42
+ //# sourceMappingURL=simpleDateTimeInputHandler.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimeInputHandler.directive.d.ts","sourceRoot":"","sources":["simpleDateTimeInputHandler.directive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,EAAW,MAAM,eAAe,CAAC;AAG7E,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAC,yBAAyB,EAAE,mBAAmB,EAAC,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAC,OAAO,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;;AAEtD;;GAEG;AACH,qBAKa,qCAAqC,CAAC,KAAK,GAAG,OAAO,CAAE,YAAW,MAAM,EAAE,SAAS;IAGvD,SAAS,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC;IAC5C,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;IACnD,SAAS,CAAC,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC;IACtC,SAAS,CAAC,MAAM,CAAC;gBAHM,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAClC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACzC,YAAY,EAAE,mBAAmB,CAAC,KAAK,CAAC,EAC5B,MAAM,CAAC,8CAAkC;IAM3E;;OAEG;IACI,QAAQ,IAAI,IAAI;IAOvB;;OAEG;IACI,WAAW,IAAI,IAAI;IAO1B;;;OAGG;IAEI,cAAc,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAgEjD;;;OAGG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,GAAG,OAAO;IAMpE;;;;OAIG;IACH,SAAS,CAAC,oBAAoB,CAAC,KAAK,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI;yCApH1E,qCAAqC;2CAArC,qCAAqC;CAuIjD"}
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "../simpleDatePickerInput/simpleDatePickerInput.directive";
3
+ import * as i2 from "../withTime/withTime.directive";
4
+ /**
5
+ * Directive that combines date time picker with simple date time input
6
+ */
7
+ export declare class SimpleDateTimePickerInputSADirective {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<SimpleDateTimePickerInputSADirective, never>;
9
+ static ɵdir: i0.ɵɵDirectiveDeclaration<SimpleDateTimePickerInputSADirective, "input[dateTime][simpleDateTimePickerInput]", never, {}, {}, never, never, true, [{ directive: typeof i1.SimpleDatePickerInputSADirective; inputs: {}; outputs: {}; }, { directive: typeof i2.WithTimeSADirective; inputs: {}; outputs: {}; }]>;
10
+ }
11
+ //# sourceMappingURL=simpleDateTimePickerInput.directive.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simpleDateTimePickerInput.directive.d.ts","sourceRoot":"","sources":["simpleDateTimePickerInput.directive.ts"],"names":[],"mappings":";;;AAKA;;GAEG;AACH,qBAca,oCAAoC;yCAApC,oCAAoC;2CAApC,oCAAoC;CAEhD"}
@@ -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,EAAC,MAAM,wBAAwB,CAAC;AAErD,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,qBAca,wBAAwB,CAAC,KAAK,GAAG,OAAO,CAAE,SAAQ,YAAY,CAAC,KAAK,CAAE,YAAW,aAAa,EAAE,SAAS;IA8EtG,SAAS,CAAC,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC;IA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I,EAe9E;IAED;;OAEG;IACH,IAAW,QAAQ,IAAI,OAAO,CAG7B;IACD,IAAW,QAAQ,CAAC,KAAK,EAAE,OAAO,EAGjC;IAED;;OAEG;IACH,IAAW,OAAO,IAAI,WAAW,CAGhC;IAED;;OAEG;IACI,KAAK,EAAE,YAAY,CAAC,UAAU,CAAC,CAAkC;IAExE;;OAEG;IACI,IAAI,EAAE,YAAY,CAAC,UAAU,CAAC,CAAkC;gBAGjD,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC,EACtB,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,EACzC,aAAa,EAAE,iBAAiB,CAAC,KAAK,CAAC;IAW7D;;OAEG;IACa,WAAW,IAAI,IAAI;IAWnC;;;OAGG;IACH,SAAS,CAAC,gBAAgB,CAAC,KAAK,EAAE,wBAAwB,CAAC,KAAK,CAAC,GAAC,SAAS,GAAC,IAAI,GAAG,IAAI;IA+CvF;;OAEG;IAEH,SAAS,CAAC,WAAW,IAAI,IAAI;IAkB7B;;;OAGG;IAEH,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;IAK9C;;;OAGG;IAEH,SAAS,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI;yCAjMpC,wBAAwB;2CAAxB,wBAAwB;CAqMpC"}
@@ -3,6 +3,7 @@
3
3
 
4
4
  @use 'misc';
5
5
  @use '../components/date-time-picker' as dateTimePicker;
6
+ @use '../components/month-calendar' as monthCalendar;
6
7
 
7
8
  @mixin buildThemeColors($theme)
8
9
  {
@@ -30,6 +31,7 @@
30
31
  @include misc.generate-margin-padding('margin', (none: 0, extra-small: 4px, small: 10px, medium: 15px, big: 20px));
31
32
  // @include misc.thin-scrollbar('--dynamic-thin-scrollbar');
32
33
  @include dateTimePicker.css;
34
+ @include monthCalendar.css;
33
35
  }
34
36
 
35
37
  @mixin buildTheme($theme)
package/version.bak CHANGED
@@ -1 +1 @@
1
- 6.0.0-beta.20221223060503
1
+ 6.0.0-beta.20221223105933