@anglr/datetime 6.0.0-beta.20221223105933 → 6.1.0-beta.20230104111018

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 (67) hide show
  1. package/changelog.md +19 -0
  2. package/es2015/src/directives/datePickerInput/datePickerInput.directive.js +37 -0
  3. package/es2015/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -0
  4. package/es2015/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +325 -0
  5. package/es2015/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -0
  6. package/es2015/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +29 -0
  7. package/es2015/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -0
  8. package/es2015/src/directives/index.js +4 -0
  9. package/es2015/src/directives/index.js.map +1 -1
  10. package/es2015/src/directives/withNow/withNow.directive.js +44 -0
  11. package/es2015/src/directives/withNow/withNow.directive.js.map +1 -0
  12. package/es2015/src/directives/withToday/withToday.directive.js +6 -6
  13. package/es2015/src/directives/withToday/withToday.directive.js.map +1 -1
  14. package/es2015/src/misc/utils.js +52 -0
  15. package/es2015/src/misc/utils.js.map +1 -1
  16. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js +32 -12
  17. package/es2015/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -1
  18. package/es2020/src/directives/datePickerInput/datePickerInput.directive.js +37 -0
  19. package/es2020/src/directives/datePickerInput/datePickerInput.directive.js.map +1 -0
  20. package/es2020/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js +322 -0
  21. package/es2020/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.js.map +1 -0
  22. package/es2020/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js +29 -0
  23. package/es2020/src/directives/dateTimePickerInput/dateTimePickerInput.directive.js.map +1 -0
  24. package/es2020/src/directives/index.js +4 -0
  25. package/es2020/src/directives/index.js.map +1 -1
  26. package/es2020/src/directives/withNow/withNow.directive.js +44 -0
  27. package/es2020/src/directives/withNow/withNow.directive.js.map +1 -0
  28. package/es2020/src/directives/withToday/withToday.directive.js +6 -6
  29. package/es2020/src/directives/withToday/withToday.directive.js.map +1 -1
  30. package/es2020/src/misc/utils.js +52 -0
  31. package/es2020/src/misc/utils.js.map +1 -1
  32. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js +32 -12
  33. package/es2020/src/modules/dateTime/directives/dateTime/dateTime.directive.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/directives/datePickerInput/datePickerInput.directive.d.ts +12 -0
  36. package/src/directives/datePickerInput/datePickerInput.directive.d.ts.map +1 -0
  37. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts +86 -0
  38. package/src/directives/dateTimeInputHandler/dateTimeInputHandler.directive.d.ts.map +1 -0
  39. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts +11 -0
  40. package/src/directives/dateTimePickerInput/dateTimePickerInput.directive.d.ts.map +1 -0
  41. package/src/directives/index.d.ts +4 -0
  42. package/src/directives/index.d.ts.map +1 -1
  43. package/src/directives/withNow/withNow.directive.d.ts +22 -0
  44. package/src/directives/withNow/withNow.directive.d.ts.map +1 -0
  45. package/src/directives/withToday/withToday.directive.d.ts +3 -2
  46. package/src/directives/withToday/withToday.directive.d.ts.map +1 -1
  47. package/src/misc/utils.d.ts +18 -1
  48. package/src/misc/utils.d.ts.map +1 -1
  49. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts +19 -6
  50. package/src/modules/dateTime/directives/dateTime/dateTime.directive.d.ts.map +1 -1
  51. package/version.bak +1 -1
  52. package/es2015/src/legacy/selector/components/inputDateTime/inputDateTime.component.js +0 -488
  53. package/es2015/src/legacy/selector/components/inputDateTime/inputDateTime.component.js.map +0 -1
  54. package/es2015/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -367
  55. package/es2015/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +0 -1
  56. package/es2020/src/legacy/selector/components/inputDateTime/inputDateTime.component.js +0 -488
  57. package/es2020/src/legacy/selector/components/inputDateTime/inputDateTime.component.js.map +0 -1
  58. package/es2020/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.js +0 -367
  59. package/es2020/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.js.map +0 -1
  60. package/src/legacy/selector/components/inputDateTime/inputDateTime.component.css +0 -9
  61. package/src/legacy/selector/components/inputDateTime/inputDateTime.component.d.ts +0 -1
  62. package/src/legacy/selector/components/inputDateTime/inputDateTime.component.d.ts.map +0 -1
  63. package/src/legacy/selector/components/inputDateTime/inputDateTime.component.html +0 -10
  64. package/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.css +0 -9
  65. package/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts +0 -1
  66. package/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.d.ts.map +0 -1
  67. package/src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.html +0 -9
@@ -1,367 +0,0 @@
1
- "use strict";
2
- // import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef, ElementRef, ViewChild} from '@angular/core';
3
- // import {isPresent} from '@jscrpt/common';
4
- // import {Observable, Subject} from 'rxjs';
5
- // import {DateTimeValue} from '../../../../interfaces/dateTime/datetime.interface';
6
- // import {DATE_API} from '../../../../misc/tokens';
7
- // import {DateApi, DateApiObject, DateValueProvider} from '../../../../services';
8
- // import {DateTimeSelector} from '../../misc/datetimeSelector.interface';
9
- // /**
10
- // * Component used as datetime selector with simple input
11
- // */
12
- // @Component(
13
- // {
14
- // selector: 'simple-input-date-time-selector',
15
- // templateUrl: 'simpleInputDateTime.component.html',
16
- // styleUrls: ['simpleInputDateTime.component.css'],
17
- // changeDetection: ChangeDetectionStrategy.OnPush
18
- // })
19
- // export class SimpleInputDateTimeSelectorComponent<TDate = any> implements DateTimeSelector<TDate>
20
- // {
21
- // //######################### protected fields #########################
22
- // /**
23
- // * Occurs when value changes
24
- // */
25
- // protected _valueChange: Subject<void> = new Subject<void>();
26
- // /**
27
- // * Occurs when selector is touched by user
28
- // */
29
- // protected _touched: Subject<void> = new Subject<void>();
30
- // /**
31
- // * Occurs when selector requires picker to be displayed or hidden
32
- // */
33
- // protected _pickerRequest: Subject<boolean> = new Subject<boolean>();
34
- // /**
35
- // * Currently used format for displaying data
36
- // */
37
- // protected _format: string = '';
38
- // /**
39
- // * Current value representation as date api wrapper
40
- // */
41
- // protected _dateApiValue: null|DateApiObject<TDate> = null;
42
- // /**
43
- // * Indication whether is current value valid value
44
- // */
45
- // protected _isValid: boolean = true;
46
- // /**
47
- // * Minimal possible value that can be picked
48
- // */
49
- // protected _minValue: TDate|null = null;
50
- // /**
51
- // * Maximal possible value that can be picked
52
- // */
53
- // protected _maxValue: TDate|null = null;
54
- // //######################### public properties - implementation of DateTimeSelector #########################
55
- // /**
56
- // * Gets or sets currently used format for displaying data
57
- // */
58
- // public get format(): string
59
- // {
60
- // return this._format;
61
- // }
62
- // public set format(value: string)
63
- // {
64
- // if(isPresent(value))
65
- // {
66
- // value = this._dateApi.getFormat(value);
67
- // }
68
- // this._format = value;
69
- // }
70
- // /**
71
- // * Gets or sets placeholder that is displayed when there is no value selected
72
- // */
73
- // public placeholder: string|null = null;
74
- // /**
75
- // * Gets current value of datetime
76
- // */
77
- // public get value(): DateTimeValue<TDate>|null
78
- // {
79
- // if(!this._dateApiValue || !this._isValid)
80
- // {
81
- // return null;
82
- // }
83
- // return this._valueProvider.getValue(this._dateApiValue.value, this._format);
84
- // }
85
- // /**
86
- // * Gets formatted value
87
- // */
88
- // public get formattedValue(): string|null
89
- // {
90
- // if(!this._isValid)
91
- // {
92
- // return null;
93
- // }
94
- // return this.currentValue;
95
- // }
96
- // /**
97
- // * Gets indication whether is current value valid
98
- // */
99
- // public get valid(): boolean
100
- // {
101
- // return this._isValid;
102
- // }
103
- // /**
104
- // * Occurs when value changes
105
- // */
106
- // public get valueChange(): Observable<void>
107
- // {
108
- // return this._valueChange.asObservable();
109
- // }
110
- // /**
111
- // * Occurs when selector is touched by user
112
- // */
113
- // public get touched(): Observable<void>
114
- // {
115
- // return this._touched.asObservable();
116
- // }
117
- // /**
118
- // * Occurs when selector requires picker to be displayed
119
- // */
120
- // public get pickerRequest(): Observable<boolean>
121
- // {
122
- // return this._pickerRequest.asObservable();
123
- // }
124
- // //######################### public properties - template bindings #########################
125
- // /**
126
- // * Indication whether is input disabled
127
- // * @internal
128
- // */
129
- // public disabled: boolean = false;
130
- // //######################### public properties - children #########################
131
- // /**
132
- // * Instance of html input element
133
- // * @internal
134
- // */
135
- // @ViewChild('input', {static: true})
136
- // public inputElement?: ElementRef<HTMLInputElement>;
137
- // //######################### protected properties #########################
138
- // /**
139
- // * Gets or sets string representation current of value
140
- // */
141
- // protected get currentValue(): string|null
142
- // {
143
- // return this.input.value || null;
144
- // }
145
- // protected set currentValue(value: string|null)
146
- // {
147
- // if(this.input)
148
- // {
149
- // this.input.value = value ?? '';
150
- // }
151
- // }
152
- // /**
153
- // * Gets input element used for handling date time value
154
- // */
155
- // protected get input(): HTMLInputElement
156
- // {
157
- // return this.inputElement!.nativeElement;
158
- // }
159
- // //######################### constructor #########################
160
- // constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,
161
- // protected _valueProvider: DateValueProvider<TDate>,
162
- // protected _changeDetector: ChangeDetectorRef)
163
- // {
164
- // }
165
- // //######################### public methods - implementation of DateTimeSelector #########################
166
- // /**
167
- // * Sets minimal possible value for picker, that can be picked
168
- // * @param value - Minimal possible value that can be picked
169
- // */
170
- // public setMinValue(value: TDate|null): void
171
- // {
172
- // this._minValue = value;
173
- // }
174
- // /**
175
- // * Sets maximal possible value for picker, that can be picked
176
- // * @param value - Maximal possible value that can be picked
177
- // */
178
- // public setMaxValue(value: TDate|null): void
179
- // {
180
- // this._maxValue = value;
181
- // }
182
- // /**
183
- // * Sets value of datetime selector
184
- // * @param value - Value to be set to this selector
185
- // */
186
- // public setValue(value: DateTimeValue<TDate>|null): void
187
- // {
188
- // if(value?.from)
189
- // {
190
- // this._dateApiValue = this._dateApi.getValue(value?.from, this._format);
191
- // this._isValid = this._dateApiValue.isValid();
192
- // this._show();
193
- // }
194
- // else
195
- // {
196
- // this._clearValue();
197
- // }
198
- // }
199
- // /**
200
- // * Sets as 'control' disabled
201
- // * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true
202
- // */
203
- // public setDisabled(disabled: boolean = true): void
204
- // {
205
- // this.disabled = disabled;
206
- // }
207
- // /**
208
- // * Explicitly runs invalidation of content (change detection)
209
- // */
210
- // public invalidateVisuals(): void
211
- // {
212
- // this._changeDetector.detectChanges();
213
- // }
214
- // //######################### public methods - template bindings #########################
215
- // /**
216
- // * Handles gaining of focus
217
- // * @internal
218
- // */
219
- // public handleFocus(): void
220
- // {
221
- // this._pickerRequest.next(true);
222
- // //no value
223
- // if(!this._dateApiValue)
224
- // {
225
- // this._dateApiValue = this._dateApi.now();
226
- // this._isValid = this._dateApiValue.isValid();
227
- // if(this._minMaxConstraintTest())
228
- // {
229
- // this._clearValue();
230
- // }
231
- // else
232
- // {
233
- // this._valueChange.next();
234
- // }
235
- // }
236
- // if(!this._isValid)
237
- // {
238
- // return;
239
- // }
240
- // this._show();
241
- // }
242
- // /**
243
- // * Handles blur on input
244
- // * @internal
245
- // */
246
- // public handleBlur(): void
247
- // {
248
- // this._pickerRequest.next(false);
249
- // }
250
- // /**
251
- // * Handles user input
252
- // * @internal
253
- // */
254
- // public handleInput(): void
255
- // {
256
- // //empty value
257
- // if(!this.currentValue)
258
- // {
259
- // this._clearValue();
260
- // this._valueChange.next();
261
- // return;
262
- // }
263
- // this._dateApiValue = this._dateApi.getValue(this.currentValue, this._format);
264
- // this._isValid = this._dateApiValue.isValid();
265
- // this._valueChange.next();
266
- // }
267
- // /**
268
- // * Handles click event inside of input
269
- // * @internal
270
- // */
271
- // public handleClick(): void
272
- // {
273
- // this._pickerRequest.next(true);
274
- // }
275
- // /**
276
- // * Handles keyboard events
277
- // * @param event - Keyboard event that occured
278
- // * @param input - Html input element that holds current value and selection
279
- // * @internal
280
- // */
281
- // public handleKeyboard(event: KeyboardEvent): void
282
- // {
283
- // if(!this._dateApiValue?.isValid())
284
- // {
285
- // return;
286
- // }
287
- // switch(event.key)
288
- // {
289
- // case 'ArrowRight':
290
- // case 'ArrowLeft':
291
- // {
292
- // event.preventDefault();
293
- // event.stopPropagation();
294
- // this._withMinMaxConstraint(() => event.key == 'ArrowLeft' ? this._dateApiValue!.subtractDays(1) : this._dateApiValue!.addDays(1));
295
- // this._show();
296
- // break;
297
- // }
298
- // case 'ArrowUp':
299
- // case 'ArrowDown':
300
- // {
301
- // event.preventDefault();
302
- // event.stopPropagation();
303
- // this._withMinMaxConstraint(() => event.key == 'ArrowUp' ? this._dateApiValue!.subtractWeeks(1) : this._dateApiValue!.addWeeks(1));
304
- // this._show();
305
- // break;
306
- // }
307
- // case 'Escape':
308
- // {
309
- // this._pickerRequest.next(false);
310
- // break;
311
- // }
312
- // case ' ':
313
- // {
314
- // if(event.ctrlKey)
315
- // {
316
- // this._pickerRequest.next(true);
317
- // }
318
- // break;
319
- // }
320
- // }
321
- // }
322
- // //######################### protected methods #########################
323
- // /**
324
- // * Clears current value
325
- // */
326
- // protected _clearValue(): void
327
- // {
328
- // this._dateApiValue = null;
329
- // this._isValid = true;
330
- // this.currentValue = null;
331
- // }
332
- // /**
333
- // * Tests whether are min or max constraint broken, returns true if constraint is broken
334
- // */
335
- // protected _minMaxConstraintTest(): boolean
336
- // {
337
- // return (!!this._minValue && this._dateApiValue!.isBefore(this._minValue)) ||
338
- // (!!this._maxValue && this._dateApiValue!.isAfter(this._maxValue));
339
- // }
340
- // /**
341
- // * Runs code with check whether min max constrains was broken
342
- // * @param code - Code that should be executed which can change current value
343
- // */
344
- // protected _withMinMaxConstraint(code: () => void): void
345
- // {
346
- // this._dateApiValue!.updateOriginal();
347
- // code();
348
- // //min value constraint failure
349
- // if(this._minMaxConstraintTest())
350
- // {
351
- // this._dateApiValue?.resetOriginal();
352
- // return;
353
- // }
354
- // this._valueChange.next();
355
- // }
356
- // /**
357
- // * Shows current value in input
358
- // */
359
- // protected _show(): void
360
- // {
361
- // if(this._isValid)
362
- // {
363
- // this.currentValue = this._dateApiValue?.format(this._format) ?? null;
364
- // }
365
- // }
366
- // }
367
- //# sourceMappingURL=simpleInputDateTime.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"simpleInputDateTime.component.js","sourceRoot":"","sources":["../../../../../../src/legacy/selector/components/simpleInputDateTime/simpleInputDateTime.component.ts"],"names":[],"mappings":";AAAA,sHAAsH;AACtH,4CAA4C;AAC5C,4CAA4C;AAE5C,oFAAoF;AACpF,oDAAoD;AACpD,kFAAkF;AAClF,0EAA0E;AAE1E,MAAM;AACN,2DAA2D;AAC3D,MAAM;AACN,cAAc;AACd,IAAI;AACJ,mDAAmD;AACnD,yDAAyD;AACzD,wDAAwD;AACxD,sDAAsD;AACtD,KAAK;AACL,oGAAoG;AACpG,IAAI;AACJ,6EAA6E;AAE7E,UAAU;AACV,mCAAmC;AACnC,UAAU;AACV,mEAAmE;AAEnE,UAAU;AACV,iDAAiD;AACjD,UAAU;AACV,+DAA+D;AAE/D,UAAU;AACV,wEAAwE;AACxE,UAAU;AACV,2EAA2E;AAE3E,UAAU;AACV,mDAAmD;AACnD,UAAU;AACV,sCAAsC;AAEtC,UAAU;AACV,0DAA0D;AAC1D,UAAU;AACV,iEAAiE;AAEjE,UAAU;AACV,yDAAyD;AACzD,UAAU;AACV,0CAA0C;AAE1C,UAAU;AACV,mDAAmD;AACnD,UAAU;AACV,8CAA8C;AAE9C,UAAU;AACV,mDAAmD;AACnD,UAAU;AACV,8CAA8C;AAE9C,mHAAmH;AAEnH,UAAU;AACV,gEAAgE;AAChE,UAAU;AACV,kCAAkC;AAClC,QAAQ;AACR,+BAA+B;AAC/B,QAAQ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AAiD;AACjD,QAAQ;AACR,uFAAuF;AACvF,oFAAoF;AACpF,QAAQ;AAER,UAAU;AACV,oEAAoE;AACpE,mFAAmF;AACnF,UAAU;AACV,8DAA8D;AAC9D,QAAQ;AACR,gDAAgD;AAEhD,kBAAkB;AAElB,yCAAyC;AACzC,2CAA2C;AAC3C,YAAY;AACZ,mDAAmD;AAEnD,sBAAsB;AACtB,YAAY;AAEZ,oCAAoC;AACpC,QAAQ;AAER,UAAU;AACV,sCAAsC;AACtC,UAAU;AACV,8BAA8B;AAC9B,QAAQ;AACR,4BAA4B;AAC5B,YAAY;AACZ,oFAAoF;AACpF,YAAY;AACZ,QAAQ;AACR,IAAI","sourcesContent":["// import {Component, ChangeDetectionStrategy, Inject, ChangeDetectorRef, ElementRef, ViewChild} from '@angular/core';\n// import {isPresent} from '@jscrpt/common';\n// import {Observable, Subject} from 'rxjs';\n\n// import {DateTimeValue} from '../../../../interfaces/dateTime/datetime.interface';\n// import {DATE_API} from '../../../../misc/tokens';\n// import {DateApi, DateApiObject, DateValueProvider} from '../../../../services';\n// import {DateTimeSelector} from '../../misc/datetimeSelector.interface';\n\n// /**\n// * Component used as datetime selector with simple input\n// */\n// @Component(\n// {\n// selector: 'simple-input-date-time-selector',\n// templateUrl: 'simpleInputDateTime.component.html',\n// styleUrls: ['simpleInputDateTime.component.css'],\n// changeDetection: ChangeDetectionStrategy.OnPush\n// })\n// export class SimpleInputDateTimeSelectorComponent<TDate = any> implements DateTimeSelector<TDate>\n// {\n// //######################### protected fields #########################\n\n// /**\n// * Occurs when value changes\n// */\n// protected _valueChange: Subject<void> = new Subject<void>();\n\n// /**\n// * Occurs when selector is touched by user\n// */\n// protected _touched: Subject<void> = new Subject<void>();\n\n// /**\n// * Occurs when selector requires picker to be displayed or hidden\n// */\n// protected _pickerRequest: Subject<boolean> = new Subject<boolean>();\n\n// /**\n// * Currently used format for displaying data\n// */\n// protected _format: string = '';\n\n// /**\n// * Current value representation as date api wrapper\n// */\n// protected _dateApiValue: null|DateApiObject<TDate> = null;\n\n// /**\n// * Indication whether is current value valid value\n// */\n// protected _isValid: boolean = true;\n\n// /**\n// * Minimal possible value that can be picked\n// */\n// protected _minValue: TDate|null = null;\n\n// /**\n// * Maximal possible value that can be picked\n// */\n// protected _maxValue: TDate|null = null;\n\n// //######################### public properties - implementation of DateTimeSelector #########################\n\n// /**\n// * Gets or sets currently used format for displaying data\n// */\n// public get format(): string\n// {\n// return this._format;\n// }\n// public set format(value: string)\n// {\n// if(isPresent(value))\n// {\n// value = this._dateApi.getFormat(value);\n// }\n\n// this._format = value;\n// }\n\n// /**\n// * Gets or sets placeholder that is displayed when there is no value selected\n// */\n// public placeholder: string|null = null;\n\n// /**\n// * Gets current value of datetime\n// */\n// public get value(): DateTimeValue<TDate>|null\n// {\n// if(!this._dateApiValue || !this._isValid)\n// {\n// return null;\n// }\n\n// return this._valueProvider.getValue(this._dateApiValue.value, this._format);\n// }\n\n// /**\n// * Gets formatted value\n// */\n// public get formattedValue(): string|null\n// {\n// if(!this._isValid)\n// {\n// return null;\n// }\n\n// return this.currentValue;\n// }\n\n// /**\n// * Gets indication whether is current value valid\n// */\n// public get valid(): boolean\n// {\n// return this._isValid;\n// }\n\n// /**\n// * Occurs when value changes\n// */\n// public get valueChange(): Observable<void>\n// {\n// return this._valueChange.asObservable();\n// }\n\n// /**\n// * Occurs when selector is touched by user\n// */\n// public get touched(): Observable<void>\n// {\n// return this._touched.asObservable();\n// }\n\n// /**\n// * Occurs when selector requires picker to be displayed\n// */\n// public get pickerRequest(): Observable<boolean>\n// {\n// return this._pickerRequest.asObservable();\n// }\n\n// //######################### public properties - template bindings #########################\n\n// /**\n// * Indication whether is input disabled\n// * @internal\n// */\n// public disabled: boolean = false;\n\n// //######################### public properties - children #########################\n\n// /**\n// * Instance of html input element\n// * @internal\n// */\n// @ViewChild('input', {static: true})\n// public inputElement?: ElementRef<HTMLInputElement>;\n\n// //######################### protected properties #########################\n\n// /**\n// * Gets or sets string representation current of value\n// */\n// protected get currentValue(): string|null\n// {\n// return this.input.value || null;\n// }\n// protected set currentValue(value: string|null)\n// {\n// if(this.input)\n// {\n// this.input.value = value ?? '';\n// }\n// }\n\n// /**\n// * Gets input element used for handling date time value\n// */\n// protected get input(): HTMLInputElement\n// {\n// return this.inputElement!.nativeElement;\n// }\n\n// //######################### constructor #########################\n// constructor(@Inject(DATE_API) protected _dateApi: DateApi<TDate>,\n// protected _valueProvider: DateValueProvider<TDate>,\n// protected _changeDetector: ChangeDetectorRef)\n// {\n// }\n\n// //######################### public methods - implementation of DateTimeSelector #########################\n\n// /**\n// * Sets minimal possible value for picker, that can be picked\n// * @param value - Minimal possible value that can be picked\n// */\n// public setMinValue(value: TDate|null): void\n// {\n// this._minValue = value;\n// }\n\n// /**\n// * Sets maximal possible value for picker, that can be picked\n// * @param value - Maximal possible value that can be picked\n// */\n// public setMaxValue(value: TDate|null): void\n// {\n// this._maxValue = value;\n// }\n\n// /**\n// * Sets value of datetime selector\n// * @param value - Value to be set to this selector\n// */\n// public setValue(value: DateTimeValue<TDate>|null): void\n// {\n// if(value?.from)\n// {\n// this._dateApiValue = this._dateApi.getValue(value?.from, this._format);\n// this._isValid = this._dateApiValue.isValid();\n\n// this._show();\n// }\n// else\n// {\n// this._clearValue();\n// }\n// }\n\n// /**\n// * Sets as 'control' disabled\n// * @param disabled - Indication whether sets value as disabled, if omitted it is same as disabled set to true\n// */\n// public setDisabled(disabled: boolean = true): void\n// {\n// this.disabled = disabled;\n// }\n\n// /**\n// * Explicitly runs invalidation of content (change detection)\n// */\n// public invalidateVisuals(): void\n// {\n// this._changeDetector.detectChanges();\n// }\n\n// //######################### public methods - template bindings #########################\n\n// /**\n// * Handles gaining of focus\n// * @internal\n// */\n// public handleFocus(): void\n// {\n// this._pickerRequest.next(true);\n\n// //no value\n// if(!this._dateApiValue)\n// {\n// this._dateApiValue = this._dateApi.now();\n// this._isValid = this._dateApiValue.isValid();\n\n// if(this._minMaxConstraintTest())\n// {\n// this._clearValue();\n// }\n// else\n// {\n// this._valueChange.next();\n// }\n// }\n\n// if(!this._isValid)\n// {\n// return;\n// }\n\n// this._show();\n// }\n\n// /**\n// * Handles blur on input\n// * @internal\n// */\n// public handleBlur(): void\n// {\n// this._pickerRequest.next(false);\n// }\n\n// /**\n// * Handles user input\n// * @internal\n// */\n// public handleInput(): void\n// {\n// //empty value\n// if(!this.currentValue)\n// {\n// this._clearValue();\n// this._valueChange.next();\n\n// return;\n// }\n\n// this._dateApiValue = this._dateApi.getValue(this.currentValue, this._format);\n// this._isValid = this._dateApiValue.isValid();\n// this._valueChange.next();\n// }\n\n// /**\n// * Handles click event inside of input\n// * @internal\n// */\n// public handleClick(): void\n// {\n// this._pickerRequest.next(true);\n// }\n\n// /**\n// * Handles keyboard events\n// * @param event - Keyboard event that occured\n// * @param input - Html input element that holds current value and selection\n// * @internal\n// */\n// public handleKeyboard(event: KeyboardEvent): void\n// {\n// if(!this._dateApiValue?.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(() => event.key == 'ArrowLeft' ? this._dateApiValue!.subtractDays(1) : this._dateApiValue!.addDays(1));\n// this._show();\n\n// break;\n// }\n// case 'ArrowUp':\n// case 'ArrowDown':\n// {\n// event.preventDefault();\n// event.stopPropagation();\n\n// this._withMinMaxConstraint(() => event.key == 'ArrowUp' ? this._dateApiValue!.subtractWeeks(1) : this._dateApiValue!.addWeeks(1));\n// this._show();\n\n// break;\n// }\n// case 'Escape':\n// {\n// this._pickerRequest.next(false);\n\n// break;\n// }\n// case ' ':\n// {\n// if(event.ctrlKey)\n// {\n// this._pickerRequest.next(true);\n// }\n\n// break;\n// }\n// }\n// }\n\n// //######################### protected methods #########################\n\n// /**\n// * Clears current value\n// */\n// protected _clearValue(): void\n// {\n// this._dateApiValue = null;\n// this._isValid = true;\n// this.currentValue = null;\n// }\n\n// /**\n// * Tests whether are min or max constraint broken, returns true if constraint is broken\n// */\n// protected _minMaxConstraintTest(): boolean\n// {\n// return (!!this._minValue && this._dateApiValue!.isBefore(this._minValue)) ||\n// (!!this._maxValue && this._dateApiValue!.isAfter(this._maxValue));\n// }\n\n// /**\n// * Runs code with check whether min max constrains was broken\n// * @param code - Code that should be executed which can change current value\n// */\n// protected _withMinMaxConstraint(code: () => void): void\n// {\n// this._dateApiValue!.updateOriginal();\n\n// code();\n\n// //min value constraint failure\n// if(this._minMaxConstraintTest())\n// {\n// this._dateApiValue?.resetOriginal();\n\n// return;\n// }\n\n// this._valueChange.next();\n// }\n\n// /**\n// * Shows current value in input\n// */\n// protected _show(): void\n// {\n// if(this._isValid)\n// {\n// this.currentValue = this._dateApiValue?.format(this._format) ?? null;\n// }\n// }\n// }"]}