-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathsmart-webcomponents-angular-datetimepicker.js
975 lines (968 loc) · 40.7 KB
/
smart-webcomponents-angular-datetimepicker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
if (!window['Smart']) {
window['Smart'] = { RenderMode: 'manual' };
}
else {
window['Smart'].RenderMode = 'manual';
}
import './../source/modules/smart.datetimepicker';
import { __decorate, __awaiter } from 'tslib';
import { EventEmitter, Output, Input, forwardRef, ElementRef, Directive, NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
class BaseElement {
constructor(ref) {
this.onCreate = new EventEmitter();
this.onReady = new EventEmitter();
this.onAttach = new EventEmitter();
this.onDetach = new EventEmitter();
const that = this;
this.nativeElement = ref.nativeElement;
that.nativeElement.onAttached = () => {
that.onAttach.emit(that.nativeElement);
};
that.nativeElement.onDetached = () => {
that.onDetach.emit(that.nativeElement);
};
}
addEventListener(type, listener, options = false) {
this.nativeElement.addEventListener(type, listener, options);
}
removeEventListener(type, listener, options = false) {
this.nativeElement.removeEventListener(type, listener, options);
}
dispatchEvent(event) {
return this.nativeElement.dispatchEvent(event);
}
blur() {
this.nativeElement.blur();
}
click() {
this.nativeElement.click();
}
focus(options) {
this.nativeElement.focus(options);
}
/** @description Sets or gets the language. Used in conjunction with the property messages. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Determines the theme. Theme defines the look of the element */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
}
__decorate([
Output()
], BaseElement.prototype, "onCreate", void 0);
__decorate([
Output()
], BaseElement.prototype, "onReady", void 0);
__decorate([
Output()
], BaseElement.prototype, "onAttach", void 0);
__decorate([
Output()
], BaseElement.prototype, "onDetach", void 0);
__decorate([
Input()
], BaseElement.prototype, "locale", null);
__decorate([
Input()
], BaseElement.prototype, "localizeFormatFunction", null);
__decorate([
Input()
], BaseElement.prototype, "messages", null);
__decorate([
Input()
], BaseElement.prototype, "rightToLeft", null);
__decorate([
Input()
], BaseElement.prototype, "theme", null);
const Smart = window.Smart;
const CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR = {
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => DateTimePickerComponent),
multi: true
};
let DateTimePickerComponent = class DateTimePickerComponent extends BaseElement {
constructor(ref) {
super(ref);
this.eventHandlers = [];
/**
* @description
* The registered callback function called when a change event occurs on the form elements.
*/
this._onChange = () => { };
/**
* @description
* The registered callback function called when a blur event occurs on the form elements.
*/
this._onTouched = () => { };
/** @description This event is triggered when the value is changed.
* @param event. The custom event. Custom event was created with: event.detail( oldValue, value)
* oldValue - The old value before it was changed presented as a DateTime object.
* value - The new value presented as a DateTime object.
*/
this.onChange = new EventEmitter();
/** @description This event is triggered when the calendar pop-up is closed.
* @param event. The custom event. */
this.onClose = new EventEmitter();
/** @description This event is triggered when the calendar pop-up is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function.
* @param event. The custom event. */
this.onClosing = new EventEmitter();
/** @description This event is triggered when the calendar pop-up is opened.
* @param event. The custom event. */
this.onOpen = new EventEmitter();
/** @description This event is triggered when the calendar pop-up is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function.
* @param event. The custom event. */
this.onOpening = new EventEmitter();
this._initialChange = true;
this.nativeElement = ref.nativeElement;
}
/** @description Creates the component on demand.
* @param properties An optional object of properties, which will be added to the template binded ones.
*/
createComponent(properties = {}) {
this.nativeElement = document.createElement('smart-date-time-picker');
for (let propertyName in properties) {
this.nativeElement[propertyName] = properties[propertyName];
}
return this.nativeElement;
}
/** @description Sets or gets the animation mode. Animation is disabled when the property is set to 'none' */
get animation() {
return this.nativeElement ? this.nativeElement.animation : undefined;
}
set animation(value) {
this.nativeElement ? this.nativeElement.animation = value : undefined;
}
/** @description Applies new animation settings to the calendar pop-up when it is enabled. Properties:startSpeed - Determines the initial speed of the animation.easeThreshold - Determines the point at which the animation starts to slow down - the "ease effect".step - Determines the step ( scrolling interval ) at which the animation will run. stepEaseSize - Coefficient that is used to calculated the new step once the threshold has been passed. resetThreshold - Determines the threshold for animation reset. When it's reached the animation will start over. */
get animationSettings() {
return this.nativeElement ? this.nativeElement.animationSettings : undefined;
}
set animationSettings(value) {
this.nativeElement ? this.nativeElement.animationSettings = value : undefined;
}
/** @description Determines whether the calendar button pop-up will be closed automatically when date or time is selected through it. */
get autoClose() {
return this.nativeElement ? this.nativeElement.autoClose : undefined;
}
set autoClose(value) {
this.nativeElement ? this.nativeElement.autoClose = value : undefined;
}
/** @description Determines the delay before the calendar pop-up is automatically closed. Applicable only when autoClose is set to true. */
get autoCloseDelay() {
return this.nativeElement ? this.nativeElement.autoCloseDelay : undefined;
}
set autoCloseDelay(value) {
this.nativeElement ? this.nativeElement.autoCloseDelay = value : undefined;
}
/** @description Determines whether the calendar button is visible or not. The calendar button is used to open the Calendar popup to select a date. */
get calendarButton() {
return this.nativeElement ? this.nativeElement.calendarButton : undefined;
}
set calendarButton(value) {
this.nativeElement ? this.nativeElement.calendarButton = value : undefined;
}
/** @description Determines the position of the calendar button. */
get calendarButtonPosition() {
return this.nativeElement ? this.nativeElement.calendarButtonPosition : undefined;
}
set calendarButtonPosition(value) {
this.nativeElement ? this.nativeElement.calendarButtonPosition = value : undefined;
}
/** @description Determines the header mode of the calendar pop-up. */
get calendarMode() {
return this.nativeElement ? this.nativeElement.calendarMode : undefined;
}
set calendarMode(value) {
this.nativeElement ? this.nativeElement.calendarMode = value : undefined;
}
/** @description Sets or gets the format of calendar pop-up's day names. */
get dayNameFormat() {
return this.nativeElement ? this.nativeElement.dayNameFormat : undefined;
}
set dayNameFormat(value) {
this.nativeElement ? this.nativeElement.dayNameFormat = value : undefined;
}
/** @description Enables or disables the element. */
get disabled() {
return this.nativeElement ? this.nativeElement.disabled : undefined;
}
set disabled(value) {
this.nativeElement ? this.nativeElement.disabled = value : undefined;
}
/** @description Disables auto navigation of the calendar pop-up when the user clicks on a date that's not from month in view. */
get disableAutoNavigation() {
return this.nativeElement ? this.nativeElement.disableAutoNavigation : undefined;
}
set disableAutoNavigation(value) {
this.nativeElement ? this.nativeElement.disableAutoNavigation = value : undefined;
}
/** @description Determines the time zone to display the value in. */
get displayKind() {
return this.nativeElement ? this.nativeElement.displayKind : undefined;
}
set displayKind(value) {
this.nativeElement ? this.nativeElement.displayKind = value : undefined;
}
/** @description Determines the type of the month/year view in the calendar pop-up when calendarMode is set to Default. */
get displayModeView() {
return this.nativeElement ? this.nativeElement.displayModeView : undefined;
}
set displayModeView(value) {
this.nativeElement ? this.nativeElement.displayModeView = value : undefined;
}
/** @description Sets custom container to append the pop-up to. By default, it is in the DateTimePicker. The value of the property can be an HTML element or the id of an HTML element. */
get dropDownAppendTo() {
return this.nativeElement ? this.nativeElement.dropDownAppendTo : undefined;
}
set dropDownAppendTo(value) {
this.nativeElement ? this.nativeElement.dropDownAppendTo = value : undefined;
}
/** @description Sets or gets the pop-up display mode (what components appear in it, and its behaviour). */
get dropDownDisplayMode() {
return this.nativeElement ? this.nativeElement.dropDownDisplayMode : undefined;
}
set dropDownDisplayMode(value) {
this.nativeElement ? this.nativeElement.dropDownDisplayMode = value : undefined;
}
/** @description If this property is enabled, when the element's dropdown is opened, a transparent overlay is positioned between the dropdown and the rest of the document. */
get dropDownOverlay() {
return this.nativeElement ? this.nativeElement.dropDownOverlay : undefined;
}
set dropDownOverlay(value) {
this.nativeElement ? this.nativeElement.dropDownOverlay = value : undefined;
}
/** @description Determines the pop-up position when opened. */
get dropDownPosition() {
return this.nativeElement ? this.nativeElement.dropDownPosition : undefined;
}
set dropDownPosition(value) {
this.nativeElement ? this.nativeElement.dropDownPosition = value : undefined;
}
/** @description Determines how the the value can be edited inside the input. */
get editMode() {
return this.nativeElement ? this.nativeElement.editMode : undefined;
}
set editMode(value) {
this.nativeElement ? this.nativeElement.editMode = value : undefined;
}
/** @description Determines whether the value can be incremented/decremented with the mouse wheel when the mouse is over the input. */
get enableMouseWheelAction() {
return this.nativeElement ? this.nativeElement.enableMouseWheelAction : undefined;
}
set enableMouseWheelAction(value) {
this.nativeElement ? this.nativeElement.enableMouseWheelAction = value : undefined;
}
/** @description Determines the first day of the week of the calendar pop-up. From 0(Sunday) to 6(Saturday) */
get firstDayOfWeek() {
return this.nativeElement ? this.nativeElement.firstDayOfWeek : undefined;
}
set firstDayOfWeek(value) {
this.nativeElement ? this.nativeElement.firstDayOfWeek = value : undefined;
}
/** @description Sets or gets the footer template of the calendar pop-up. The value of this property can be the id of an HTMLTemplateElement or the HTMLTemplateElement itself. If set to null, a default template is applied. */
get footerTemplate() {
return this.nativeElement ? this.nativeElement.footerTemplate : undefined;
}
set footerTemplate(value) {
this.nativeElement ? this.nativeElement.footerTemplate = value : undefined;
}
/** @description Determines whether to display a footer. */
get footer() {
return this.nativeElement ? this.nativeElement.footer : undefined;
}
set footer(value) {
this.nativeElement ? this.nativeElement.footer = value : undefined;
}
/** @description Determines the pattern that is used to display the value in. Built-in Date formats:// short date pattern'd' - 'M/d/yyyy',// long date pattern'D' - 'dddd, MMMM dd, yyyy',// short time pattern't' - 'h:mm tt',// long time pattern'T' - 'h:mm:ss tt',// long date, short time pattern'f' - 'dddd, MMMM dd, yyyy h:mm tt',// long date, long time pattern'F' - 'dddd, MMMM dd, yyyy h:mm:ss tt',// month/day pattern'M' - 'MMMM dd',// month/year pattern'Y' - 'yyyy MMMM',// S is a sortable format that does not vary by culture'S' - 'yyyy'-'MM'-'dd'T'HH':'mm':'ss'Date format strings:'d'-the day of the month;'dd'-the day of the month'ddd'-the abbreviated name of the day of the week'dddd'- the full name of the day of the week'h'-the hour, using a 12-hour clock from 1 to 12'hh'-the hour, using a 12-hour clock from 01 to 12'H'-the hour, using a 24-hour clock from 0 to 23'HH'- the hour, using a 24-hour clock from 00 to 23'm'-the minute, from 0 through 59'mm'-the minutes,from 00 though59'M'- the month, from 1 through 12'MM'- the month, from 01 through 12'MMM'-the abbreviated name of the month'MMMM'-the full name of the month's'-the second, from 0 through 59'ss'-the second, from 00 through 59't'- the first character of the AM/PM designator'tt'-the AM/PM designator'y'- the year, from 0 to 99'yy'- the year, from 00 to 99'yyy'-the year, with a minimum of three digits'yyyy'-the year as a four-digit number;'yyyyy'-the year as a four-digit number. */
get formatString() {
return this.nativeElement ? this.nativeElement.formatString : undefined;
}
set formatString(value) {
this.nativeElement ? this.nativeElement.formatString = value : undefined;
}
/** @description Sets custom header template for the calendar pop-up. Accepts the id of an HTMLTemplateElement or a reference ot it. */
get headerTemplate() {
return this.nativeElement ? this.nativeElement.headerTemplate : undefined;
}
set headerTemplate(value) {
this.nativeElement ? this.nativeElement.headerTemplate = value : undefined;
}
/** @description Hides the names of the weekdays in the calendar pop-up. */
get hideDayNames() {
return this.nativeElement ? this.nativeElement.hideDayNames : undefined;
}
set hideDayNames(value) {
this.nativeElement ? this.nativeElement.hideDayNames = value : undefined;
}
/** @description Determines if dates from other months are visible or not in the calendar pop-up. */
get hideOtherMonthDays() {
return this.nativeElement ? this.nativeElement.hideOtherMonthDays : undefined;
}
set hideOtherMonthDays(value) {
this.nativeElement ? this.nativeElement.hideOtherMonthDays = value : undefined;
}
/** @description Hides the arrow of the tooltip in the calendar pop-up. */
get hideTooltipArrow() {
return this.nativeElement ? this.nativeElement.hideTooltipArrow : undefined;
}
set hideTooltipArrow(value) {
this.nativeElement ? this.nativeElement.hideTooltipArrow = value : undefined;
}
/** @description Sets additional helper text below the element that appears only when the element is focused. */
get hint() {
return this.nativeElement ? this.nativeElement.hint : undefined;
}
set hint(value) {
this.nativeElement ? this.nativeElement.hint = value : undefined;
}
/** @description Sets dates, displayed as important in the calendar pop-up. */
get importantDates() {
return this.nativeElement ? this.nativeElement.importantDates : undefined;
}
set importantDates(value) {
this.nativeElement ? this.nativeElement.importantDates = value : undefined;
}
/** @description Sets a template for the important dates of the calendar pop-up. Accepts the id of or a reference to an HTMLTemplateElement. */
get importantDatesTemplate() {
return this.nativeElement ? this.nativeElement.importantDatesTemplate : undefined;
}
set importantDatesTemplate(value) {
this.nativeElement ? this.nativeElement.importantDatesTemplate = value : undefined;
}
/** @description Sets or gets the increment/decrement interval when a date/time segment inside the input has not been highlighted. The default interval is 1 second. If a numeric value is passed, it represents milliseconds. */
get interval() {
return this.nativeElement ? this.nativeElement.interval : undefined;
}
set interval(value) {
this.nativeElement ? this.nativeElement.interval = value : undefined;
}
/** @description Sets a label above the element. */
get label() {
return this.nativeElement ? this.nativeElement.label : undefined;
}
set label(value) {
this.nativeElement ? this.nativeElement.label = value : undefined;
}
/** @description Sets or gets the locale that determines what language is used to localize the labels inside the DateTimePicker. */
get locale() {
return this.nativeElement ? this.nativeElement.locale : undefined;
}
set locale(value) {
this.nativeElement ? this.nativeElement.locale = value : undefined;
}
/** @description Callback used to customize the format of the messages that are returned from the Localization Module. */
get localizeFormatFunction() {
return this.nativeElement ? this.nativeElement.localizeFormatFunction : undefined;
}
set localizeFormatFunction(value) {
this.nativeElement ? this.nativeElement.localizeFormatFunction = value : undefined;
}
/** @description Sets or gets the maximum allowed value. */
get max() {
return this.nativeElement ? this.nativeElement.max : undefined;
}
set max(value) {
this.nativeElement ? this.nativeElement.max = value : undefined;
}
/** @description Sets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale. */
get messages() {
return this.nativeElement ? this.nativeElement.messages : undefined;
}
set messages(value) {
this.nativeElement ? this.nativeElement.messages = value : undefined;
}
/** @description Sets or gets the minimum allowed value. */
get min() {
return this.nativeElement ? this.nativeElement.min : undefined;
}
set min(value) {
this.nativeElement ? this.nativeElement.min = value : undefined;
}
/** @description Sets or gets the element's name, which is used as a reference when the data is submitted in a form. */
get name() {
return this.nativeElement ? this.nativeElement.name : undefined;
}
set name(value) {
this.nativeElement ? this.nativeElement.name = value : undefined;
}
/** @description Enables or disables the setting of the value property to be null or empty string. If the property is enabled and the value in the input is deleted, the value will be set to null and the placeholder will be displayed. Otherwise, the current date and time will be set. */
get nullable() {
return this.nativeElement ? this.nativeElement.nullable : undefined;
}
set nullable(value) {
this.nativeElement ? this.nativeElement.nullable = value : undefined;
}
/** @description Sets or gets whether the calendar pop-up is opened. */
get opened() {
return this.nativeElement ? this.nativeElement.opened : undefined;
}
set opened(value) {
this.nativeElement ? this.nativeElement.opened = value : undefined;
}
/** @description Sets or gets the placeholder text to be shown in the input when value is null. */
get placeholder() {
return this.nativeElement ? this.nativeElement.placeholder : undefined;
}
set placeholder(value) {
this.nativeElement ? this.nativeElement.placeholder = value : undefined;
}
/** @description Disables user interaction with the element. */
get readonly() {
return this.nativeElement ? this.nativeElement.readonly : undefined;
}
set readonly(value) {
this.nativeElement ? this.nativeElement.readonly = value : undefined;
}
/** @description Sets or gets an array of dates (DateTime or Date objects) that cannot be selected. */
get restrictedDates() {
return this.nativeElement ? this.nativeElement.restrictedDates : undefined;
}
set restrictedDates(value) {
this.nativeElement ? this.nativeElement.restrictedDates = value : undefined;
}
/** @description Sets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts. */
get rightToLeft() {
return this.nativeElement ? this.nativeElement.rightToLeft : undefined;
}
set rightToLeft(value) {
this.nativeElement ? this.nativeElement.rightToLeft = value : undefined;
}
/** @description Sets or gets whether the spin buttons are displayed. Spin buttons are used to increment/decrement the date/time. */
get spinButtons() {
return this.nativeElement ? this.nativeElement.spinButtons : undefined;
}
set spinButtons(value) {
this.nativeElement ? this.nativeElement.spinButtons = value : undefined;
}
/** @description Sets the delay between repeats of the spin buttons in miliseconds. */
get spinButtonsDelay() {
return this.nativeElement ? this.nativeElement.spinButtonsDelay : undefined;
}
set spinButtonsDelay(value) {
this.nativeElement ? this.nativeElement.spinButtonsDelay = value : undefined;
}
/** @description Sets a delay before the first repeat iteration of spin buttons in miliseconds. */
get spinButtonsInitialDelay() {
return this.nativeElement ? this.nativeElement.spinButtonsInitialDelay : undefined;
}
set spinButtonsInitialDelay(value) {
this.nativeElement ? this.nativeElement.spinButtonsInitialDelay = value : undefined;
}
/** @description Sets or gets the position of the spin buttons. */
get spinButtonsPosition() {
return this.nativeElement ? this.nativeElement.spinButtonsPosition : undefined;
}
set spinButtonsPosition(value) {
this.nativeElement ? this.nativeElement.spinButtonsPosition = value : undefined;
}
/** @description Sets or gets the element's visual theme. */
get theme() {
return this.nativeElement ? this.nativeElement.theme : undefined;
}
set theme(value) {
this.nativeElement ? this.nativeElement.theme = value : undefined;
}
/** @description Enables/Disabled the tooltip for the important dates in the calendar pop-up. */
get tooltip() {
return this.nativeElement ? this.nativeElement.tooltip : undefined;
}
set tooltip(value) {
this.nativeElement ? this.nativeElement.tooltip = value : undefined;
}
/** @description Sets the delay of the calendar pop-up's tooltip before it appears. */
get tooltipDelay() {
return this.nativeElement ? this.nativeElement.tooltipDelay : undefined;
}
set tooltipDelay(value) {
this.nativeElement ? this.nativeElement.tooltipDelay = value : undefined;
}
/** @description Sets the position of the tooltip in the calendar pop-up. */
get tooltipPosition() {
return this.nativeElement ? this.nativeElement.tooltipPosition : undefined;
}
set tooltipPosition(value) {
this.nativeElement ? this.nativeElement.tooltipPosition = value : undefined;
}
/** @description Sets a template for the content of the calendar pop-up's tooltip. Accepts the id of or a reference to an HTMLTemplateElement. */
get tooltipTemplate() {
return this.nativeElement ? this.nativeElement.tooltipTemplate : undefined;
}
set tooltipTemplate(value) {
this.nativeElement ? this.nativeElement.tooltipTemplate = value : undefined;
}
/** @description Sets or gets if the element can be focused. */
get unfocusable() {
return this.nativeElement ? this.nativeElement.unfocusable : undefined;
}
set unfocusable(value) {
this.nativeElement ? this.nativeElement.unfocusable = value : undefined;
}
/** @description Determines the validation mechanism for the value by min/max. */
get validation() {
return this.nativeElement ? this.nativeElement.validation : undefined;
}
set validation(value) {
this.nativeElement ? this.nativeElement.validation = value : undefined;
}
/** @description Sets or gets the value. The value represents the current date/time that is set to the element as a DateTime object. */
get value() {
return this.nativeElement ? this.nativeElement.value : undefined;
}
set value(value) {
this.nativeElement ? this.nativeElement.value = value : undefined;
}
/** @description Enables/Disabled week numbering in the calendar pop-up. */
get weekNumbers() {
return this.nativeElement ? this.nativeElement.weekNumbers : undefined;
}
set weekNumbers(value) {
this.nativeElement ? this.nativeElement.weekNumbers = value : undefined;
}
/** @description Determines the number of visible weeks in the calendar pop-up. */
get weeks() {
return this.nativeElement ? this.nativeElement.weeks : undefined;
}
set weeks(value) {
this.nativeElement ? this.nativeElement.weeks = value : undefined;
}
/** @description Determines the first year of a 100 year span within which 2-digit years fall. The default value, 1926, would interpret the 2-digit year values 26-99 as 1926 to 1999 and values 00-25 as being 2000 to 2025. */
get yearCutoff() {
return this.nativeElement ? this.nativeElement.yearCutoff : undefined;
}
set yearCutoff(value) {
this.nativeElement ? this.nativeElement.yearCutoff = value : undefined;
}
/** @description Closes the calendar pop-up.
*/
close() {
if (this.nativeElement.isRendered) {
this.nativeElement.close();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.close();
});
}
}
/** @description Focuses the input.
*/
focus() {
if (this.nativeElement.isRendered) {
this.nativeElement.focus();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.focus();
});
}
}
/** @description Opens the calendar pop-up.
*/
open() {
if (this.nativeElement.isRendered) {
this.nativeElement.open();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.open();
});
}
}
/** @description Selects the text inside the input.
*/
select() {
if (this.nativeElement.isRendered) {
this.nativeElement.select();
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.select();
});
}
}
/** @description Gets a Date object.
* @returns {Date}
*/
getDate() {
return __awaiter(this, void 0, void 0, function* () {
const getResultOnRender = () => {
return new Promise(resolve => {
this.nativeElement.whenRendered(() => {
const result = this.nativeElement.getDate();
resolve(result);
});
});
};
const result = yield getResultOnRender();
return result;
});
}
/** @description Sets the date of the DateTimePicker.
* @param {Date} date. The date object to be set.
*/
setDate(date) {
if (this.nativeElement.isRendered) {
this.nativeElement.setDate(date);
}
else {
this.nativeElement.whenRendered(() => {
this.nativeElement.setDate(date);
});
}
}
get isRendered() {
return this.nativeElement ? this.nativeElement.isRendered : false;
}
ngOnInit() {
}
ngAfterViewInit() {
const that = this;
that.onCreate.emit(that.nativeElement);
Smart.Render();
this.nativeElement.classList.add('smart-angular');
this.nativeElement.whenRendered(() => { that.onReady.emit(that.nativeElement); });
this.listen();
}
ngOnDestroy() {
this.unlisten();
}
get ngValue() {
if (!this.nativeElement) {
return null;
}
const value = this.nativeElement.value;
return value ? value.toDate() : null;
}
set ngValue(value) {
if (this.nativeElement) {
this.writeValue(value);
}
}
writeValue(value) {
const that = this;
const normalizedValue = value == null ? '' : value;
that.nativeElement.whenRendered(() => {
that.nativeElement.isInitialized = that._initialChange ? false : true;
that.value = value;
that.nativeElement.isInitialized = true;
if (that._initialChange === false) {
that._onChange(value);
}
});
}
registerOnChange(fn) {
this._onChange = fn;
}
registerOnTouched(fn) {
this._onTouched = fn;
}
ngOnChanges(changes) {
if (this.nativeElement && this.nativeElement.isRendered) {
for (const propName in changes) {
if (changes.hasOwnProperty(propName)) {
this.nativeElement[propName] = changes[propName].currentValue;
}
}
}
}
/** @description Add event listeners. */
listen() {
const that = this;
that.eventHandlers['changeHandler'] = (event) => { that.onChange.emit(event); };
that.nativeElement.addEventListener('change', that.eventHandlers['changeHandler']);
that.eventHandlers['closeHandler'] = (event) => { that.onClose.emit(event); };
that.nativeElement.addEventListener('close', that.eventHandlers['closeHandler']);
that.eventHandlers['closingHandler'] = (event) => { that.onClosing.emit(event); };
that.nativeElement.addEventListener('closing', that.eventHandlers['closingHandler']);
that.eventHandlers['openHandler'] = (event) => { that.onOpen.emit(event); };
that.nativeElement.addEventListener('open', that.eventHandlers['openHandler']);
that.eventHandlers['openingHandler'] = (event) => { that.onOpening.emit(event); };
that.nativeElement.addEventListener('opening', that.eventHandlers['openingHandler']);
that.eventHandlers['changeModelHandler'] = (event) => {
that._initialChange = false;
that._onChange(that.nativeElement.value ? that.nativeElement.value.toDate() : null);
};
that.eventHandlers['blurModelHandler'] = (event) => {
that._onTouched();
};
that.nativeElement.whenRendered(() => {
if (that.nativeElement.querySelector('input')) {
that.eventHandlers['keyupModelHandler'] = (event) => {
setTimeout(() => { that.eventHandlers['changeModelHandler'](event); }, 50);
};
that.nativeElement.querySelector('input').addEventListener('keyup', that.eventHandlers['keyupModelHandler']);
}
});
that.nativeElement.addEventListener('change', that.eventHandlers['changeModelHandler']);
that.nativeElement.addEventListener('blur', that.eventHandlers['blurModelHandler']);
}
/** @description Remove event listeners. */
unlisten() {
const that = this;
if (that.eventHandlers['changeHandler']) {
that.nativeElement.removeEventListener('change', that.eventHandlers['changeHandler']);
}
if (that.eventHandlers['closeHandler']) {
that.nativeElement.removeEventListener('close', that.eventHandlers['closeHandler']);
}
if (that.eventHandlers['closingHandler']) {
that.nativeElement.removeEventListener('closing', that.eventHandlers['closingHandler']);
}
if (that.eventHandlers['openHandler']) {
that.nativeElement.removeEventListener('open', that.eventHandlers['openHandler']);
}
if (that.eventHandlers['openingHandler']) {
that.nativeElement.removeEventListener('opening', that.eventHandlers['openingHandler']);
}
if (that.eventHandlers['changeModelHandler']) {
that.nativeElement.removeEventListener('change', that.eventHandlers['changeModelHandler']);
if (that.nativeElement.querySelector('input')) {
that.nativeElement.querySelector('input').removeEventListener('keyup', that.eventHandlers['keyupModelHandler']);
}
}
if (that.eventHandlers['blurModelHandler']) {
that.nativeElement.removeEventListener('blur', that.eventHandlers['blurModelHandler']);
}
}
};
DateTimePickerComponent.ctorParameters = () => [
{ type: ElementRef }
];
__decorate([
Input()
], DateTimePickerComponent.prototype, "animation", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "animationSettings", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "autoClose", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "autoCloseDelay", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "calendarButton", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "calendarButtonPosition", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "calendarMode", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "dayNameFormat", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "disabled", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "disableAutoNavigation", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "displayKind", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "displayModeView", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "dropDownAppendTo", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "dropDownDisplayMode", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "dropDownOverlay", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "dropDownPosition", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "editMode", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "enableMouseWheelAction", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "firstDayOfWeek", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "footerTemplate", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "footer", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "formatString", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "headerTemplate", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "hideDayNames", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "hideOtherMonthDays", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "hideTooltipArrow", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "hint", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "importantDates", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "importantDatesTemplate", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "interval", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "label", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "locale", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "localizeFormatFunction", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "max", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "messages", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "min", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "name", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "nullable", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "opened", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "placeholder", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "readonly", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "restrictedDates", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "rightToLeft", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "spinButtons", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "spinButtonsDelay", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "spinButtonsInitialDelay", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "spinButtonsPosition", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "theme", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "tooltip", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "tooltipDelay", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "tooltipPosition", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "tooltipTemplate", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "unfocusable", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "validation", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "value", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "weekNumbers", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "weeks", null);
__decorate([
Input()
], DateTimePickerComponent.prototype, "yearCutoff", null);
__decorate([
Output()
], DateTimePickerComponent.prototype, "onChange", void 0);
__decorate([
Output()
], DateTimePickerComponent.prototype, "onClose", void 0);
__decorate([
Output()
], DateTimePickerComponent.prototype, "onClosing", void 0);
__decorate([
Output()
], DateTimePickerComponent.prototype, "onOpen", void 0);
__decorate([
Output()
], DateTimePickerComponent.prototype, "onOpening", void 0);
DateTimePickerComponent = __decorate([
Directive({
exportAs: 'smart-date-time-picker', selector: 'smart-date-time-picker, [smart-date-time-picker]',
providers: [CUSTOM_INPUT_CONTROL_VALUE_ACCESSOR]
})
], DateTimePickerComponent);
let DateTimePickerModule = class DateTimePickerModule {
};
DateTimePickerModule = __decorate([
NgModule({
declarations: [DateTimePickerComponent],
schemas: [CUSTOM_ELEMENTS_SCHEMA],
exports: [DateTimePickerComponent]
})
], DateTimePickerModule);
/**
* Generated bundle index. Do not edit.
*/
export { DateTimePickerComponent, DateTimePickerModule, Smart, BaseElement as ɵa };
//# sourceMappingURL=smart-webcomponents-angular-datetimepicker.js.map