@progress/kendo-angular-dateinputs 5.3.1-dev.202112011809 → 6.0.0-dev.202201181611
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.
- package/LICENSE.md +1 -1
- package/NOTICE.txt +119 -79
- package/README.md +1 -1
- package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
- package/dist/cdn/main.js +1 -1
- package/dist/es/calendar/calendar.component.js +14 -2
- package/dist/es/calendar/header.component.js +1 -1
- package/dist/es/calendar/multiview-calendar.component.js +28 -12
- package/dist/es/calendar/multiview-calendar.module.js +9 -1
- package/dist/es/calendar/services/dom.service.js +1 -1
- package/dist/es/calendar/view.component.js +1 -1
- package/dist/es/common/models/fillmode.js +4 -0
- package/dist/es/common/models/rounded.js +4 -0
- package/dist/es/common/models/size.js +4 -0
- package/dist/es/dateinput/dateinput.component.js +143 -18
- package/dist/es/datepicker/datepicker.component.js +130 -13
- package/dist/es/daterange/date-range-input.js +1 -1
- package/dist/es/datetimepicker/datetimepicker.component.js +147 -11
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/services/dom.service.js +12 -8
- package/dist/es/timepicker/timelist.component.js +3 -2
- package/dist/es/timepicker/timepicker.component.js +130 -13
- package/dist/es/timepicker/timeselector.component.js +2 -2
- package/dist/es/util.js +37 -0
- package/dist/es2015/calendar/calendar.component.d.ts +7 -0
- package/dist/es2015/calendar/calendar.component.js +14 -2
- package/dist/es2015/calendar/header.component.js +4 -4
- package/dist/es2015/calendar/multiview-calendar.component.d.ts +8 -2
- package/dist/es2015/calendar/multiview-calendar.component.js +31 -11
- package/dist/es2015/calendar/multiview-calendar.module.js +9 -1
- package/dist/es2015/calendar/services/dom.service.js +1 -1
- package/dist/es2015/calendar/view.component.js +1 -1
- package/dist/es2015/common/models/fillmode.d.ts +14 -0
- package/dist/es2015/common/models/fillmode.js +4 -0
- package/dist/es2015/common/models/rounded.d.ts +15 -0
- package/dist/es2015/common/models/rounded.js +4 -0
- package/dist/es2015/common/models/size.d.ts +14 -0
- package/dist/es2015/common/models/size.js +4 -0
- package/dist/es2015/dateinput/dateinput.component.d.ts +49 -8
- package/dist/es2015/dateinput/dateinput.component.js +183 -68
- package/dist/es2015/datepicker/datepicker.component.d.ts +47 -5
- package/dist/es2015/datepicker/datepicker.component.js +155 -49
- package/dist/es2015/daterange/date-range-input.js +1 -1
- package/dist/es2015/datetimepicker/datetimepicker.component.d.ts +56 -6
- package/dist/es2015/datetimepicker/datetimepicker.component.js +186 -63
- package/dist/es2015/index.metadata.json +1 -1
- package/dist/es2015/package-metadata.js +1 -1
- package/dist/es2015/timepicker/services/dom.service.d.ts +1 -0
- package/dist/es2015/timepicker/services/dom.service.js +12 -8
- package/dist/es2015/timepicker/timelist.component.js +3 -2
- package/dist/es2015/timepicker/timepicker.component.d.ts +50 -5
- package/dist/es2015/timepicker/timepicker.component.js +174 -69
- package/dist/es2015/timepicker/timeselector.component.js +7 -5
- package/dist/es2015/util.d.ts +18 -0
- package/dist/es2015/util.js +37 -0
- package/dist/fesm2015/index.js +821 -290
- package/dist/fesm5/index.js +663 -92
- package/dist/npm/calendar/calendar.component.js +14 -2
- package/dist/npm/calendar/header.component.js +1 -1
- package/dist/npm/calendar/multiview-calendar.component.js +27 -11
- package/dist/npm/calendar/multiview-calendar.module.js +9 -1
- package/dist/npm/calendar/services/dom.service.js +1 -1
- package/dist/npm/calendar/view.component.js +1 -1
- package/dist/npm/common/models/fillmode.js +6 -0
- package/dist/npm/common/models/rounded.js +6 -0
- package/dist/npm/common/models/size.js +6 -0
- package/dist/npm/dateinput/dateinput.component.js +142 -17
- package/dist/npm/datepicker/datepicker.component.js +129 -12
- package/dist/npm/daterange/date-range-input.js +1 -1
- package/dist/npm/datetimepicker/datetimepicker.component.js +146 -10
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/services/dom.service.js +15 -10
- package/dist/npm/timepicker/timelist.component.js +3 -2
- package/dist/npm/timepicker/timepicker.component.js +129 -12
- package/dist/npm/timepicker/timeselector.component.js +2 -2
- package/dist/npm/util.js +37 -0
- package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
- package/package.json +2 -2
|
@@ -18,7 +18,7 @@ const tbody = containerFactory('tbody');
|
|
|
18
18
|
const thead = containerFactory('thead');
|
|
19
19
|
const table = containerFactory('table');
|
|
20
20
|
const monthHeader = () => (div(`
|
|
21
|
-
<span class="k-button k-flat k-
|
|
21
|
+
<span class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title">March 2017</span>
|
|
22
22
|
<span class="k-spacer"></span>
|
|
23
23
|
<span class="k-calendar-nav k-hstack">
|
|
24
24
|
<span class="k-today k-nav-today">TODAY</span>
|
|
@@ -117,7 +117,7 @@ let ViewComponent = class ViewComponent {
|
|
|
117
117
|
'k-state-selected': !context.isOtherMonth && (context.isSelected || isRangeStart || isRangeEnd),
|
|
118
118
|
'k-today': !context.isOtherMonth && context.isToday,
|
|
119
119
|
'k-weekend': context.isWeekend,
|
|
120
|
-
'k-
|
|
120
|
+
'k-disabled': context.isDisabled,
|
|
121
121
|
'k-other-month': context.isOtherMonth
|
|
122
122
|
});
|
|
123
123
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the possible fillMode options of the DateInput.
|
|
7
|
+
*
|
|
8
|
+
* The possible values are:
|
|
9
|
+
* - `'solid'` (Default)
|
|
10
|
+
* - `'flat'`
|
|
11
|
+
* - `'outline'`
|
|
12
|
+
* - `null`
|
|
13
|
+
*/
|
|
14
|
+
export declare type DateInputFillMode = 'solid' | 'flat' | 'outline';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the possible rounded options of the DateInput.
|
|
7
|
+
*
|
|
8
|
+
* The possible values are:
|
|
9
|
+
* - `'small'`
|
|
10
|
+
* - `'medium'` (Default)
|
|
11
|
+
* - `'large'`
|
|
12
|
+
* - `'full'`
|
|
13
|
+
* - `null`
|
|
14
|
+
*/
|
|
15
|
+
export declare type DateInputRounded = 'small' | 'medium' | 'large' | 'full';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
5
|
+
/**
|
|
6
|
+
* Represents the possible size options of the DateInput.
|
|
7
|
+
*
|
|
8
|
+
* The possible values are:
|
|
9
|
+
* - `'small'`
|
|
10
|
+
* - `'medium'` (Default)
|
|
11
|
+
* - `'large'`
|
|
12
|
+
* - `null`
|
|
13
|
+
*/
|
|
14
|
+
export declare type DateInputSize = 'small' | 'medium' | 'large';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/**-----------------------------------------------------------------------------------------
|
|
2
|
+
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
|
+
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
+
*-------------------------------------------------------------------------------------------*/
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, EventEmitter, ElementRef, OnInit, OnDestroy, OnChanges, Renderer2, NgZone, Injector, SimpleChanges } from '@angular/core';
|
|
5
|
+
import { ChangeDetectorRef, EventEmitter, ElementRef, OnInit, OnDestroy, OnChanges, Renderer2, NgZone, Injector, SimpleChanges, AfterViewInit } from '@angular/core';
|
|
6
6
|
import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { IntlService } from '@progress/kendo-angular-intl';
|
|
@@ -11,14 +11,17 @@ import { DateInputFormatPlaceholder } from './models/format-placeholder.model';
|
|
|
11
11
|
import { DateInputIncrementalSteps } from './models/incremental-steps.model';
|
|
12
12
|
import { PickerService } from '../common/picker.service';
|
|
13
13
|
import { FormatSettings } from './models/format-settings.model';
|
|
14
|
+
import { DateInputSize } from '../common/models/size';
|
|
15
|
+
import { DateInputRounded } from '../common/models/rounded';
|
|
16
|
+
import { DateInputFillMode } from '../common/models/fillmode';
|
|
14
17
|
/**
|
|
15
18
|
* Represents the [Kendo UI DateInput component for Angular]({% slug overview_dateinput %}#toc-basic-usage).
|
|
16
19
|
*/
|
|
17
|
-
export declare class DateInputComponent implements OnInit, ControlValueAccessor, OnChanges, OnDestroy, Validator {
|
|
20
|
+
export declare class DateInputComponent implements OnInit, AfterViewInit, ControlValueAccessor, OnChanges, OnDestroy, Validator {
|
|
18
21
|
private cdr;
|
|
19
22
|
private intl;
|
|
20
23
|
private renderer;
|
|
21
|
-
|
|
24
|
+
wrapper: ElementRef;
|
|
22
25
|
private ngZone;
|
|
23
26
|
private injector;
|
|
24
27
|
localization: LocalizationService;
|
|
@@ -204,6 +207,40 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
204
207
|
* @hidden
|
|
205
208
|
*/
|
|
206
209
|
hasPopup: boolean;
|
|
210
|
+
/**
|
|
211
|
+
* Sets the size of the component.
|
|
212
|
+
*
|
|
213
|
+
* The possible values are:
|
|
214
|
+
* * `'small'`
|
|
215
|
+
* * `'medium'` (Default)
|
|
216
|
+
* * `'large'`
|
|
217
|
+
* * `null`
|
|
218
|
+
*
|
|
219
|
+
*/
|
|
220
|
+
size: DateInputSize;
|
|
221
|
+
/**
|
|
222
|
+
* Sets the border radius of the component.
|
|
223
|
+
*
|
|
224
|
+
* The possible values are:
|
|
225
|
+
* * `'small'`
|
|
226
|
+
* * `'medium'` (Default)
|
|
227
|
+
* * `'large'`
|
|
228
|
+
* * `'full'`
|
|
229
|
+
* * `null`
|
|
230
|
+
*
|
|
231
|
+
*/
|
|
232
|
+
rounded: DateInputRounded;
|
|
233
|
+
/**
|
|
234
|
+
* Sets the fillMode of the component.
|
|
235
|
+
*
|
|
236
|
+
* The possible values are:
|
|
237
|
+
* * `'solid'` (Default)
|
|
238
|
+
* * `'flat'`
|
|
239
|
+
* * `'outline'`
|
|
240
|
+
* * `null`
|
|
241
|
+
*
|
|
242
|
+
*/
|
|
243
|
+
fillMode: DateInputFillMode;
|
|
207
244
|
/**
|
|
208
245
|
* Fires each time the user selects a new value.
|
|
209
246
|
* For more information, refer to the section on
|
|
@@ -269,10 +306,6 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
269
306
|
* @hidden
|
|
270
307
|
*/
|
|
271
308
|
dateInput: ElementRef;
|
|
272
|
-
/**
|
|
273
|
-
* @hidden
|
|
274
|
-
*/
|
|
275
|
-
wrap: ElementRef;
|
|
276
309
|
readonly wrapperClass: boolean;
|
|
277
310
|
readonly disabledClass: boolean;
|
|
278
311
|
readonly inputElement: any;
|
|
@@ -291,6 +324,8 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
291
324
|
isDateIncomplete: boolean;
|
|
292
325
|
protected currentValue: string;
|
|
293
326
|
protected currentFormat: string;
|
|
327
|
+
private spinup;
|
|
328
|
+
private spindown;
|
|
294
329
|
private backspace;
|
|
295
330
|
private resetSegmentValue;
|
|
296
331
|
private symbolsMap;
|
|
@@ -309,7 +344,10 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
309
344
|
private onControlChange;
|
|
310
345
|
private onControlTouched;
|
|
311
346
|
private onValidatorChange;
|
|
312
|
-
|
|
347
|
+
private _size;
|
|
348
|
+
private _rounded;
|
|
349
|
+
private _fillMode;
|
|
350
|
+
constructor(cdr: ChangeDetectorRef, intl: IntlService, renderer: Renderer2, wrapper: ElementRef, ngZone: NgZone, injector: Injector, localization: LocalizationService, pickerService?: PickerService);
|
|
313
351
|
/**
|
|
314
352
|
* @hidden
|
|
315
353
|
* Used by the TextBoxContainer to determine if the component is empty
|
|
@@ -338,6 +376,7 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
338
376
|
* @hidden
|
|
339
377
|
*/
|
|
340
378
|
ngOnInit(): void;
|
|
379
|
+
ngAfterViewInit(): void;
|
|
341
380
|
/**
|
|
342
381
|
* @hidden
|
|
343
382
|
*/
|
|
@@ -437,4 +476,6 @@ export declare class DateInputComponent implements OnInit, ControlValueAccessor,
|
|
|
437
476
|
private emitFocus;
|
|
438
477
|
private emitBlur;
|
|
439
478
|
private updateIncompleteValidationStatus;
|
|
479
|
+
private setSpinnerFill;
|
|
480
|
+
private setComponentClasses;
|
|
440
481
|
}
|
|
@@ -17,7 +17,7 @@ import { packageMetadata } from '../package-metadata';
|
|
|
17
17
|
import { addMonths, cloneDate, createDate, getDate, isEqual, lastDayOfMonth } from '@progress/kendo-date-math';
|
|
18
18
|
import { isDocumentAvailable, hasObservers, KendoInput, Keys, guid } from '@progress/kendo-angular-common';
|
|
19
19
|
import { Arrow } from './arrow.enum';
|
|
20
|
-
import { approximateStringMatching, noop, isInRange, dateInRange, isValidRange, setTime, cropTwoDigitYear, setYears, msPaddingFromFormat, millisecondDigitsInFormat, millisecondStepFor } from '../util';
|
|
20
|
+
import { approximateStringMatching, noop, isInRange, dateInRange, isValidRange, setTime, cropTwoDigitYear, setYears, msPaddingFromFormat, millisecondDigitsInFormat, millisecondStepFor, getSizeClass, getRoundedClass, getFillModeClass } from '../util';
|
|
21
21
|
import { PickerService } from '../common/picker.service';
|
|
22
22
|
import { closest } from '../common/dom-queries';
|
|
23
23
|
import { requiresZoneOnBlur, isPresent } from '../common/utils';
|
|
@@ -450,11 +450,11 @@ class KendoDate {
|
|
|
450
450
|
* Represents the [Kendo UI DateInput component for Angular]({% slug overview_dateinput %}#toc-basic-usage).
|
|
451
451
|
*/
|
|
452
452
|
let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
453
|
-
constructor(cdr, intl, renderer,
|
|
453
|
+
constructor(cdr, intl, renderer, wrapper, ngZone, injector, localization, pickerService) {
|
|
454
454
|
this.cdr = cdr;
|
|
455
455
|
this.intl = intl;
|
|
456
456
|
this.renderer = renderer;
|
|
457
|
-
this.
|
|
457
|
+
this.wrapper = wrapper;
|
|
458
458
|
this.ngZone = ngZone;
|
|
459
459
|
this.injector = injector;
|
|
460
460
|
this.localization = localization;
|
|
@@ -656,6 +656,9 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
656
656
|
this.onControlChange = noop;
|
|
657
657
|
this.onControlTouched = noop;
|
|
658
658
|
this.onValidatorChange = noop;
|
|
659
|
+
this._size = 'medium';
|
|
660
|
+
this._rounded = 'medium';
|
|
661
|
+
this._fillMode = 'solid';
|
|
659
662
|
this.symbolsMap = this.dateSymbolMap();
|
|
660
663
|
this.updateFormatSections();
|
|
661
664
|
if (this.pickerService) {
|
|
@@ -687,6 +690,71 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
687
690
|
get value() {
|
|
688
691
|
return this._value;
|
|
689
692
|
}
|
|
693
|
+
/**
|
|
694
|
+
* Sets the size of the component.
|
|
695
|
+
*
|
|
696
|
+
* The possible values are:
|
|
697
|
+
* * `'small'`
|
|
698
|
+
* * `'medium'` (Default)
|
|
699
|
+
* * `'large'`
|
|
700
|
+
* * `null`
|
|
701
|
+
*
|
|
702
|
+
*/
|
|
703
|
+
set size(size) {
|
|
704
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
705
|
+
if (size) {
|
|
706
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', size));
|
|
707
|
+
}
|
|
708
|
+
this._size = size;
|
|
709
|
+
}
|
|
710
|
+
get size() {
|
|
711
|
+
return this._size;
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Sets the border radius of the component.
|
|
715
|
+
*
|
|
716
|
+
* The possible values are:
|
|
717
|
+
* * `'small'`
|
|
718
|
+
* * `'medium'` (Default)
|
|
719
|
+
* * `'large'`
|
|
720
|
+
* * `'full'`
|
|
721
|
+
* * `null`
|
|
722
|
+
*
|
|
723
|
+
*/
|
|
724
|
+
set rounded(rounded) {
|
|
725
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
726
|
+
if (rounded) {
|
|
727
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
|
|
728
|
+
}
|
|
729
|
+
this._rounded = rounded;
|
|
730
|
+
}
|
|
731
|
+
get rounded() {
|
|
732
|
+
return this._rounded;
|
|
733
|
+
}
|
|
734
|
+
/**
|
|
735
|
+
* Sets the fillMode of the component.
|
|
736
|
+
*
|
|
737
|
+
* The possible values are:
|
|
738
|
+
* * `'solid'` (Default)
|
|
739
|
+
* * `'flat'`
|
|
740
|
+
* * `'outline'`
|
|
741
|
+
* * `null`
|
|
742
|
+
*
|
|
743
|
+
*/
|
|
744
|
+
set fillMode(fillMode) {
|
|
745
|
+
this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
746
|
+
if (fillMode) {
|
|
747
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', fillMode));
|
|
748
|
+
if (this.spinners && this.spinup && this.spindown) {
|
|
749
|
+
this.setSpinnerFill(this.spinup.nativeElement, fillMode, this.fillMode);
|
|
750
|
+
this.setSpinnerFill(this.spindown.nativeElement, fillMode, this.fillMode);
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
this._fillMode = fillMode;
|
|
754
|
+
}
|
|
755
|
+
get fillMode() {
|
|
756
|
+
return this._fillMode;
|
|
757
|
+
}
|
|
690
758
|
get wrapperClass() {
|
|
691
759
|
return true;
|
|
692
760
|
}
|
|
@@ -704,16 +772,16 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
704
772
|
}
|
|
705
773
|
set isActive(value) {
|
|
706
774
|
this._active = value;
|
|
707
|
-
if (!this.
|
|
775
|
+
if (!this.wrapper) {
|
|
708
776
|
return;
|
|
709
777
|
}
|
|
710
778
|
if (!isPresent(this.pickerService)) {
|
|
711
|
-
const element = this.
|
|
779
|
+
const element = this.wrapper.nativeElement;
|
|
712
780
|
if (value) {
|
|
713
|
-
this.renderer.addClass(element, 'k-
|
|
781
|
+
this.renderer.addClass(element, 'k-focus');
|
|
714
782
|
}
|
|
715
783
|
else {
|
|
716
|
-
this.renderer.removeClass(element, 'k-
|
|
784
|
+
this.renderer.removeClass(element, 'k-focus');
|
|
717
785
|
}
|
|
718
786
|
}
|
|
719
787
|
}
|
|
@@ -750,7 +818,7 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
750
818
|
* @hidden
|
|
751
819
|
*/
|
|
752
820
|
containsElement(element) {
|
|
753
|
-
return Boolean(closest(element, node => node === this.
|
|
821
|
+
return Boolean(closest(element, node => node === this.wrapper.nativeElement));
|
|
754
822
|
}
|
|
755
823
|
/**
|
|
756
824
|
* @hidden
|
|
@@ -802,13 +870,16 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
802
870
|
this.updateElementValue();
|
|
803
871
|
this.intlSubscription = this.intl.changes.subscribe(this.intlChange.bind(this));
|
|
804
872
|
this.ngControl = this.injector.get(NgControl, null);
|
|
805
|
-
if (this.
|
|
806
|
-
this.renderer.removeAttribute(this.
|
|
873
|
+
if (this.wrapper) {
|
|
874
|
+
this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
|
|
807
875
|
this.ngZone.runOutsideAngular(() => {
|
|
808
876
|
this.bindEvents();
|
|
809
877
|
});
|
|
810
878
|
}
|
|
811
879
|
}
|
|
880
|
+
ngAfterViewInit() {
|
|
881
|
+
this.setComponentClasses();
|
|
882
|
+
}
|
|
812
883
|
/**
|
|
813
884
|
* @hidden
|
|
814
885
|
*/
|
|
@@ -1157,7 +1228,7 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
1157
1228
|
}
|
|
1158
1229
|
}
|
|
1159
1230
|
bindEvents() {
|
|
1160
|
-
const element = this.
|
|
1231
|
+
const element = this.wrapper.nativeElement;
|
|
1161
1232
|
const mousewheelHandler = this.handleMouseWheel.bind(this);
|
|
1162
1233
|
this.domEvents.push(this.renderer.listen(element, 'DOMMouseScroll', mousewheelHandler), this.renderer.listen(element, 'mousewheel', mousewheelHandler), this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)), this.renderer.listen(element, 'paste', this.handlePaste.bind(this)), this.renderer.listen(element, 'input', this.handleInput.bind(this)));
|
|
1163
1234
|
}
|
|
@@ -1288,6 +1359,29 @@ let DateInputComponent = DateInputComponent_1 = class DateInputComponent {
|
|
|
1288
1359
|
this.pickerService.dateCompletenessChange.emit();
|
|
1289
1360
|
}
|
|
1290
1361
|
}
|
|
1362
|
+
setSpinnerFill(spinner, fill, oldFill) {
|
|
1363
|
+
if (oldFill) {
|
|
1364
|
+
this.renderer.removeClass(spinner, `k-button-${oldFill}`);
|
|
1365
|
+
this.renderer.removeClass(spinner, `k-button-${oldFill}-base`);
|
|
1366
|
+
}
|
|
1367
|
+
this.renderer.addClass(spinner, `k-button-${fill}`);
|
|
1368
|
+
this.renderer.addClass(spinner, `k-button-${fill}-base`);
|
|
1369
|
+
}
|
|
1370
|
+
setComponentClasses() {
|
|
1371
|
+
if (this.size) {
|
|
1372
|
+
this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
|
|
1373
|
+
}
|
|
1374
|
+
if (this.rounded) {
|
|
1375
|
+
this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
|
|
1376
|
+
}
|
|
1377
|
+
if (this.fillMode) {
|
|
1378
|
+
this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
|
|
1379
|
+
}
|
|
1380
|
+
if (this.spinners) {
|
|
1381
|
+
this.setSpinnerFill(this.spinup.nativeElement, this.fillMode);
|
|
1382
|
+
this.setSpinnerFill(this.spindown.nativeElement, this.fillMode);
|
|
1383
|
+
}
|
|
1384
|
+
}
|
|
1291
1385
|
};
|
|
1292
1386
|
tslib_1.__decorate([
|
|
1293
1387
|
Input(),
|
|
@@ -1379,6 +1473,21 @@ tslib_1.__decorate([
|
|
|
1379
1473
|
Input(),
|
|
1380
1474
|
tslib_1.__metadata("design:type", Boolean)
|
|
1381
1475
|
], DateInputComponent.prototype, "hasPopup", void 0);
|
|
1476
|
+
tslib_1.__decorate([
|
|
1477
|
+
Input(),
|
|
1478
|
+
tslib_1.__metadata("design:type", String),
|
|
1479
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1480
|
+
], DateInputComponent.prototype, "size", null);
|
|
1481
|
+
tslib_1.__decorate([
|
|
1482
|
+
Input(),
|
|
1483
|
+
tslib_1.__metadata("design:type", String),
|
|
1484
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1485
|
+
], DateInputComponent.prototype, "rounded", null);
|
|
1486
|
+
tslib_1.__decorate([
|
|
1487
|
+
Input(),
|
|
1488
|
+
tslib_1.__metadata("design:type", String),
|
|
1489
|
+
tslib_1.__metadata("design:paramtypes", [String])
|
|
1490
|
+
], DateInputComponent.prototype, "fillMode", null);
|
|
1382
1491
|
tslib_1.__decorate([
|
|
1383
1492
|
Output(),
|
|
1384
1493
|
tslib_1.__metadata("design:type", EventEmitter)
|
|
@@ -1400,20 +1509,24 @@ tslib_1.__decorate([
|
|
|
1400
1509
|
tslib_1.__metadata("design:type", ElementRef)
|
|
1401
1510
|
], DateInputComponent.prototype, "dateInput", void 0);
|
|
1402
1511
|
tslib_1.__decorate([
|
|
1403
|
-
|
|
1404
|
-
tslib_1.__metadata("design:type", ElementRef)
|
|
1405
|
-
], DateInputComponent.prototype, "wrap", void 0);
|
|
1406
|
-
tslib_1.__decorate([
|
|
1407
|
-
HostBinding('class.k-widget'),
|
|
1512
|
+
HostBinding('class.k-input'),
|
|
1408
1513
|
HostBinding('class.k-dateinput'),
|
|
1409
1514
|
tslib_1.__metadata("design:type", Boolean),
|
|
1410
1515
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1411
1516
|
], DateInputComponent.prototype, "wrapperClass", null);
|
|
1412
1517
|
tslib_1.__decorate([
|
|
1413
|
-
HostBinding('class.k-
|
|
1518
|
+
HostBinding('class.k-disabled'),
|
|
1414
1519
|
tslib_1.__metadata("design:type", Boolean),
|
|
1415
1520
|
tslib_1.__metadata("design:paramtypes", [])
|
|
1416
1521
|
], DateInputComponent.prototype, "disabledClass", null);
|
|
1522
|
+
tslib_1.__decorate([
|
|
1523
|
+
ViewChild('spinup', { static: false }),
|
|
1524
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
1525
|
+
], DateInputComponent.prototype, "spinup", void 0);
|
|
1526
|
+
tslib_1.__decorate([
|
|
1527
|
+
ViewChild('spindown', { static: false }),
|
|
1528
|
+
tslib_1.__metadata("design:type", ElementRef)
|
|
1529
|
+
], DateInputComponent.prototype, "spindown", void 0);
|
|
1417
1530
|
DateInputComponent = DateInputComponent_1 = tslib_1.__decorate([
|
|
1418
1531
|
Component({
|
|
1419
1532
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -1435,57 +1548,59 @@ DateInputComponent = DateInputComponent_1 = tslib_1.__decorate([
|
|
|
1435
1548
|
decrement="Decrease value"
|
|
1436
1549
|
>
|
|
1437
1550
|
</ng-container>
|
|
1438
|
-
<
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
<
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1551
|
+
<input
|
|
1552
|
+
#dateInput
|
|
1553
|
+
autocomplete="off"
|
|
1554
|
+
autocorrect="off"
|
|
1555
|
+
autocapitalize="off"
|
|
1556
|
+
spellcheck="false"
|
|
1557
|
+
class="k-input-inner"
|
|
1558
|
+
[attr.role]="role"
|
|
1559
|
+
[attr.aria-readonly]="ariaReadOnly"
|
|
1560
|
+
[id]="focusableId"
|
|
1561
|
+
[title]="title"
|
|
1562
|
+
[tabindex]="tabindex"
|
|
1563
|
+
[disabled]="disabled"
|
|
1564
|
+
[readonly]="readonly"
|
|
1565
|
+
[placeholder]="placeholder"
|
|
1566
|
+
[attr.aria-expanded]="isPopupOpen"
|
|
1567
|
+
[attr.aria-haspopup]="hasPopup"
|
|
1568
|
+
[kendoEventsOutsideAngular]="{
|
|
1569
|
+
click: handleClick,
|
|
1570
|
+
focus: handleFocus,
|
|
1571
|
+
mousedown: handleMousedown,
|
|
1572
|
+
touchstart: handleMousedown,
|
|
1573
|
+
dragstart: handleDragAndDrop,
|
|
1574
|
+
drop: handleDragAndDrop,
|
|
1575
|
+
blur: handleBlur
|
|
1576
|
+
}"
|
|
1577
|
+
[scope]="this"
|
|
1578
|
+
/>
|
|
1579
|
+
<span *ngIf="spinners" class="k-input-spinner k-spin-button" (mousedown)="$event.preventDefault()">
|
|
1580
|
+
<button
|
|
1581
|
+
#spinup
|
|
1582
|
+
tabindex="-1"
|
|
1583
|
+
class="k-spinner-increase k-button k-icon-button"
|
|
1584
|
+
[class.k-active]="arrowDirection === arrow.Up"
|
|
1585
|
+
(mousedown)="arrowDirection = arrow.Up"
|
|
1586
|
+
(mouseleave)="arrowDirection = arrow.None"
|
|
1587
|
+
(click)="handleButtonClick(1)"
|
|
1588
|
+
[title]="localization.get('increment')"
|
|
1589
|
+
[attr.aria-label]="localization.get('increment')">
|
|
1590
|
+
<span class="k-button-icon k-icon k-i-arrow-n"></span>
|
|
1591
|
+
</button>
|
|
1592
|
+
<button
|
|
1593
|
+
#spindown
|
|
1594
|
+
tabindex="-1"
|
|
1595
|
+
class="k-spinner-decrease k-button k-icon-button"
|
|
1596
|
+
(click)="handleButtonClick(-1)"
|
|
1597
|
+
[class.k-active]="arrowDirection === arrow.Down"
|
|
1598
|
+
(mousedown)="arrowDirection = arrow.Down"
|
|
1599
|
+
(mouseleave)="arrowDirection = arrow.None"
|
|
1600
|
+
[title]="localization.get('decrement')"
|
|
1601
|
+
[attr.aria-label]="localization.get('decrement')">
|
|
1602
|
+
<span class="k-button-icon k-icon k-i-arrow-s"></span>
|
|
1603
|
+
</button>
|
|
1489
1604
|
</span>
|
|
1490
1605
|
`
|
|
1491
1606
|
}),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright © 2021 Progress Software Corporation. All rights reserved.
|
|
3
3
|
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
4
|
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { ChangeDetectorRef, ElementRef, TemplateRef, EventEmitter, Renderer2, ViewContainerRef, NgZone, OnInit, OnChanges, OnDestroy, Injector } from '@angular/core';
|
|
5
|
+
import { ChangeDetectorRef, ElementRef, TemplateRef, EventEmitter, Renderer2, ViewContainerRef, NgZone, OnInit, OnChanges, OnDestroy, Injector, AfterViewInit } from '@angular/core';
|
|
6
6
|
import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms';
|
|
7
7
|
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
8
8
|
import { PopupService, PopupRef } from '@progress/kendo-angular-popup';
|
|
@@ -24,15 +24,18 @@ import { PickerService } from '../common/picker.service';
|
|
|
24
24
|
import { DisabledDatesService } from '../calendar/services/disabled-dates.service';
|
|
25
25
|
import { DateInputFormatPlaceholder } from '../dateinput/models/format-placeholder.model';
|
|
26
26
|
import { DateInputComponent } from '../dateinput/dateinput.component';
|
|
27
|
+
import { DateInputSize } from '../common/models/size';
|
|
28
|
+
import { DateInputRounded } from '../common/models/rounded';
|
|
29
|
+
import { DateInputFillMode } from '../common/models/fillmode';
|
|
27
30
|
/**
|
|
28
31
|
* Represents the [Kendo UI DatePicker component for Angular]({% slug overview_datepicker %}#toc-basic-usage).
|
|
29
32
|
*/
|
|
30
|
-
export declare class DatePickerComponent implements ControlValueAccessor, OnInit, OnChanges, OnDestroy, Validator {
|
|
33
|
+
export declare class DatePickerComponent implements ControlValueAccessor, OnInit, AfterViewInit, OnChanges, OnDestroy, Validator {
|
|
31
34
|
zone: NgZone;
|
|
32
35
|
localization: LocalizationService;
|
|
33
36
|
private cdr;
|
|
34
37
|
private popupService;
|
|
35
|
-
|
|
38
|
+
wrapper: ElementRef;
|
|
36
39
|
private renderer;
|
|
37
40
|
private injector;
|
|
38
41
|
private pickerService;
|
|
@@ -40,7 +43,7 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
40
43
|
private touchEnabled;
|
|
41
44
|
container: ViewContainerRef;
|
|
42
45
|
popupTemplate: TemplateRef<any>;
|
|
43
|
-
|
|
46
|
+
toggleButton: ElementRef;
|
|
44
47
|
/**
|
|
45
48
|
* @hidden
|
|
46
49
|
*/
|
|
@@ -314,6 +317,40 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
314
317
|
* ([see example]({% slug calendar_type_datepicker %}#toc-week-number-column)).
|
|
315
318
|
*/
|
|
316
319
|
weekNumber: boolean;
|
|
320
|
+
/**
|
|
321
|
+
* Sets the size of the component.
|
|
322
|
+
*
|
|
323
|
+
* The possible values are:
|
|
324
|
+
* * `'small'`
|
|
325
|
+
* * `'medium'` (Default)
|
|
326
|
+
* * `'large'`
|
|
327
|
+
* * `null`
|
|
328
|
+
*
|
|
329
|
+
*/
|
|
330
|
+
size: DateInputSize;
|
|
331
|
+
/**
|
|
332
|
+
* Sets the border radius of the component.
|
|
333
|
+
*
|
|
334
|
+
* The possible values are:
|
|
335
|
+
* * `'small'`
|
|
336
|
+
* * `'medium'` (Default)
|
|
337
|
+
* * `'large'`
|
|
338
|
+
* * `'full'`
|
|
339
|
+
* * `null`
|
|
340
|
+
*
|
|
341
|
+
*/
|
|
342
|
+
rounded: DateInputRounded;
|
|
343
|
+
/**
|
|
344
|
+
* Sets the fillMode of the component.
|
|
345
|
+
*
|
|
346
|
+
* The possible values are:
|
|
347
|
+
* * `'solid'` (Default)
|
|
348
|
+
* * `'flat'`
|
|
349
|
+
* * `'outline'`
|
|
350
|
+
* * `null`
|
|
351
|
+
*
|
|
352
|
+
*/
|
|
353
|
+
fillMode: DateInputFillMode;
|
|
317
354
|
/**
|
|
318
355
|
* Fires each time the user selects a new value
|
|
319
356
|
* ([more information and example]({% slug overview_datepicker %}#toc-events)).
|
|
@@ -410,7 +447,10 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
410
447
|
private windowBlurSubscription;
|
|
411
448
|
private control;
|
|
412
449
|
private domEvents;
|
|
413
|
-
|
|
450
|
+
private _size;
|
|
451
|
+
private _rounded;
|
|
452
|
+
private _fillMode;
|
|
453
|
+
constructor(zone: NgZone, localization: LocalizationService, cdr: ChangeDetectorRef, popupService: PopupService, wrapper: ElementRef, renderer: Renderer2, injector: Injector, pickerService: PickerService, disabledDatesService: DisabledDatesService, touchEnabled: boolean);
|
|
414
454
|
/**
|
|
415
455
|
* @hidden
|
|
416
456
|
* Used by the TextBoxContainer to determine if the component is empty.
|
|
@@ -420,6 +460,7 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
420
460
|
* @hidden
|
|
421
461
|
*/
|
|
422
462
|
ngOnInit(): void;
|
|
463
|
+
ngAfterViewInit(): void;
|
|
423
464
|
/**
|
|
424
465
|
* @hidden
|
|
425
466
|
*/
|
|
@@ -532,4 +573,5 @@ export declare class DatePickerComponent implements ControlValueAccessor, OnInit
|
|
|
532
573
|
private blurComponent;
|
|
533
574
|
private handleSameSelection;
|
|
534
575
|
private handleDateCompletenessChange;
|
|
576
|
+
private setComponentClasses;
|
|
535
577
|
}
|