@progress/kendo-angular-dateinputs 5.3.1-dev.202112201533 → 6.0.0

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 (74) hide show
  1. package/LICENSE.md +1 -1
  2. package/NOTICE.txt +119 -79
  3. package/README.md +1 -1
  4. package/dist/cdn/js/kendo-angular-dateinputs.js +2 -2
  5. package/dist/cdn/main.js +1 -1
  6. package/dist/es/calendar/calendar.component.js +1 -1
  7. package/dist/es/calendar/header.component.js +1 -1
  8. package/dist/es/calendar/multiview-calendar.component.js +11 -4
  9. package/dist/es/calendar/services/dom.service.js +1 -1
  10. package/dist/es/calendar/view.component.js +1 -1
  11. package/dist/es/common/models/fillmode.js +4 -0
  12. package/dist/es/common/models/rounded.js +4 -0
  13. package/dist/es/common/models/size.js +4 -0
  14. package/dist/es/dateinput/dateinput.component.js +143 -18
  15. package/dist/es/datepicker/datepicker.component.js +130 -13
  16. package/dist/es/daterange/date-range-input.js +1 -1
  17. package/dist/es/datetimepicker/datetimepicker.component.js +147 -11
  18. package/dist/es/package-metadata.js +1 -1
  19. package/dist/es/timepicker/services/dom.service.js +12 -8
  20. package/dist/es/timepicker/timelist.component.js +3 -2
  21. package/dist/es/timepicker/timepicker.component.js +130 -13
  22. package/dist/es/timepicker/timeselector.component.js +2 -2
  23. package/dist/es/util.js +37 -0
  24. package/dist/es2015/calendar/calendar.component.js +1 -1
  25. package/dist/es2015/calendar/header.component.js +4 -4
  26. package/dist/es2015/calendar/multiview-calendar.component.d.ts +3 -1
  27. package/dist/es2015/calendar/multiview-calendar.component.js +11 -4
  28. package/dist/es2015/calendar/services/dom.service.js +1 -1
  29. package/dist/es2015/calendar/view.component.js +1 -1
  30. package/dist/es2015/common/models/fillmode.d.ts +14 -0
  31. package/dist/es2015/common/models/fillmode.js +4 -0
  32. package/dist/es2015/common/models/rounded.d.ts +15 -0
  33. package/dist/es2015/common/models/rounded.js +4 -0
  34. package/dist/es2015/common/models/size.d.ts +14 -0
  35. package/dist/es2015/common/models/size.js +4 -0
  36. package/dist/es2015/dateinput/dateinput.component.d.ts +49 -8
  37. package/dist/es2015/dateinput/dateinput.component.js +183 -68
  38. package/dist/es2015/datepicker/datepicker.component.d.ts +47 -5
  39. package/dist/es2015/datepicker/datepicker.component.js +155 -49
  40. package/dist/es2015/daterange/date-range-input.js +1 -1
  41. package/dist/es2015/datetimepicker/datetimepicker.component.d.ts +56 -6
  42. package/dist/es2015/datetimepicker/datetimepicker.component.js +186 -63
  43. package/dist/es2015/index.metadata.json +1 -1
  44. package/dist/es2015/package-metadata.js +1 -1
  45. package/dist/es2015/timepicker/services/dom.service.d.ts +1 -0
  46. package/dist/es2015/timepicker/services/dom.service.js +12 -8
  47. package/dist/es2015/timepicker/timelist.component.js +3 -2
  48. package/dist/es2015/timepicker/timepicker.component.d.ts +50 -5
  49. package/dist/es2015/timepicker/timepicker.component.js +174 -69
  50. package/dist/es2015/timepicker/timeselector.component.js +7 -5
  51. package/dist/es2015/util.d.ts +18 -0
  52. package/dist/es2015/util.js +37 -0
  53. package/dist/fesm2015/index.js +780 -282
  54. package/dist/fesm5/index.js +625 -83
  55. package/dist/npm/calendar/calendar.component.js +1 -1
  56. package/dist/npm/calendar/header.component.js +1 -1
  57. package/dist/npm/calendar/multiview-calendar.component.js +10 -3
  58. package/dist/npm/calendar/services/dom.service.js +1 -1
  59. package/dist/npm/calendar/view.component.js +1 -1
  60. package/dist/npm/common/models/fillmode.js +6 -0
  61. package/dist/npm/common/models/rounded.js +6 -0
  62. package/dist/npm/common/models/size.js +6 -0
  63. package/dist/npm/dateinput/dateinput.component.js +142 -17
  64. package/dist/npm/datepicker/datepicker.component.js +129 -12
  65. package/dist/npm/daterange/date-range-input.js +1 -1
  66. package/dist/npm/datetimepicker/datetimepicker.component.js +146 -10
  67. package/dist/npm/package-metadata.js +1 -1
  68. package/dist/npm/timepicker/services/dom.service.js +15 -10
  69. package/dist/npm/timepicker/timelist.component.js +3 -2
  70. package/dist/npm/timepicker/timepicker.component.js +129 -12
  71. package/dist/npm/timepicker/timeselector.component.js +2 -2
  72. package/dist/npm/util.js +37 -0
  73. package/dist/systemjs/kendo-angular-dateinputs.js +1 -1
  74. package/package.json +7 -7
@@ -93,8 +93,9 @@ var TimeListComponent = /** @class */ (function () {
93
93
  this.dom.ensureHeights();
94
94
  this.itemHeight = this.dom.itemHeight;
95
95
  this.listHeight = this.dom.timeListHeight;
96
- this.topOffset = (this.listHeight - this.itemHeight) / 2;
97
- this.bottomOffset = this.listHeight - this.itemHeight;
96
+ var titleHeight = this.dom.timeListTitleHeight;
97
+ this.topOffset = (this.listHeight - this.itemHeight - titleHeight) / 2;
98
+ this.bottomOffset = this.listHeight - this.itemHeight - titleHeight;
98
99
  this.topThreshold = this.itemHeight * SNAP_THRESHOLD;
99
100
  this.bottomThreshold = this.itemHeight * (1 - SNAP_THRESHOLD);
100
101
  var translate = "translateY(" + this.topOffset + "px)";
@@ -17,7 +17,7 @@ import { PickerService } from '../common/picker.service';
17
17
  import { requiresZoneOnBlur, currentFocusTarget } from '../common/utils';
18
18
  import { TIME_PART } from './models/time-part.default';
19
19
  import { PreventableEvent } from '../preventable-event';
20
- import { noop, setTime, isWindowAvailable } from '../util';
20
+ import { noop, setTime, isWindowAvailable, getFillModeClass, getSizeClass, getRoundedClass } from '../util';
21
21
  import { timeRangeValidator } from '../validators/time-range.validator';
22
22
  import { TOUCH_ENABLED } from '../touch-enabled';
23
23
  import { fromEvent } from 'rxjs';
@@ -29,12 +29,12 @@ var formatRegExp = new RegExp(TIME_PART.hour + "|" + TIME_PART.minute + "|" + TI
29
29
  * Represents the [Kendo UI TimePicker component for Angular]({% slug overview_timepicker %}#toc-basic-usage).
30
30
  */
31
31
  var TimePickerComponent = /** @class */ (function () {
32
- function TimePickerComponent(zone, localization, cdr, popupService, element, renderer, injector, pickerService, intl, touchEnabled) {
32
+ function TimePickerComponent(zone, localization, cdr, popupService, wrapper, renderer, injector, pickerService, intl, touchEnabled) {
33
33
  this.zone = zone;
34
34
  this.localization = localization;
35
35
  this.cdr = cdr;
36
36
  this.popupService = popupService;
37
- this.element = element;
37
+ this.wrapper = wrapper;
38
38
  this.renderer = renderer;
39
39
  this.injector = injector;
40
40
  this.pickerService = pickerService;
@@ -196,6 +196,9 @@ var TimePickerComponent = /** @class */ (function () {
196
196
  this._value = null;
197
197
  this._active = false;
198
198
  this.domEvents = [];
199
+ this._size = 'medium';
200
+ this._rounded = 'medium';
201
+ this._fillMode = 'solid';
199
202
  validatePackage(packageMetadata);
200
203
  this.pickerSubscriptions = this.pickerService.onFocus.subscribe(this.handleFocus.bind(this));
201
204
  this.pickerSubscriptions.add(this.pickerService.onBlur.subscribe(this.handleBlur.bind(this)));
@@ -306,6 +309,85 @@ var TimePickerComponent = /** @class */ (function () {
306
309
  enumerable: true,
307
310
  configurable: true
308
311
  });
312
+ Object.defineProperty(TimePickerComponent.prototype, "size", {
313
+ get: function () {
314
+ return this._size;
315
+ },
316
+ /**
317
+ * Sets the size of the component.
318
+ *
319
+ * The possible values are:
320
+ * * `'small'`
321
+ * * `'medium'` (Default)
322
+ * * `'large'`
323
+ * * `null`
324
+ *
325
+ */
326
+ set: function (size) {
327
+ this.renderer.removeClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
328
+ this.renderer.removeClass(this.toggleButton.nativeElement, getSizeClass('input', this.size));
329
+ if (size) {
330
+ this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', size));
331
+ this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('input', size));
332
+ }
333
+ this._size = size;
334
+ },
335
+ enumerable: true,
336
+ configurable: true
337
+ });
338
+ Object.defineProperty(TimePickerComponent.prototype, "rounded", {
339
+ get: function () {
340
+ return this._rounded;
341
+ },
342
+ /**
343
+ * Sets the border radius of the component.
344
+ *
345
+ * The possible values are:
346
+ * * `'small'`
347
+ * * `'medium'` (Default)
348
+ * * `'large'`
349
+ * * `'full'`
350
+ * * `null`
351
+ *
352
+ */
353
+ set: function (rounded) {
354
+ this.renderer.removeClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
355
+ if (rounded) {
356
+ this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(rounded));
357
+ }
358
+ this._rounded = rounded;
359
+ },
360
+ enumerable: true,
361
+ configurable: true
362
+ });
363
+ Object.defineProperty(TimePickerComponent.prototype, "fillMode", {
364
+ get: function () {
365
+ return this._fillMode;
366
+ },
367
+ /**
368
+ * Sets the fillMode of the component.
369
+ *
370
+ * The possible values are:
371
+ * * `'solid'` (Default)
372
+ * * `'flat'`
373
+ * * `'outline'`
374
+ * * `null`
375
+ *
376
+ */
377
+ set: function (fillMode) {
378
+ this.renderer.removeClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
379
+ this.renderer.removeClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
380
+ this.renderer.removeClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
381
+ if (fillMode) {
382
+ this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', fillMode));
383
+ this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', fillMode));
384
+ this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + fillMode + "-base");
385
+ }
386
+ this._fillMode = fillMode;
387
+ },
388
+ enumerable: true,
389
+ configurable: true
390
+ });
309
391
  Object.defineProperty(TimePickerComponent.prototype, "disabledClass", {
310
392
  /**
311
393
  * @hidden
@@ -337,10 +419,10 @@ var TimePickerComponent = /** @class */ (function () {
337
419
  }
338
420
  var element = this.wrapper.nativeElement;
339
421
  if (value) {
340
- this.renderer.addClass(element, 'k-state-focused');
422
+ this.renderer.addClass(element, 'k-focus');
341
423
  }
342
424
  else {
343
- this.renderer.removeClass(element, 'k-state-focused');
425
+ this.renderer.removeClass(element, 'k-focus');
344
426
  }
345
427
  },
346
428
  enumerable: true,
@@ -397,13 +479,19 @@ var TimePickerComponent = /** @class */ (function () {
397
479
  this.localizationChangeSubscription = this.localization
398
480
  .changes.subscribe(function () { return _this.cdr.markForCheck(); });
399
481
  this.control = this.injector.get(NgControl, null);
400
- if (this.element) {
401
- this.renderer.removeAttribute(this.element.nativeElement, 'tabindex');
482
+ if (this.wrapper) {
483
+ this.renderer.removeAttribute(this.wrapper.nativeElement, 'tabindex');
402
484
  this.zone.runOutsideAngular(function () {
403
485
  _this.bindEvents();
404
486
  });
405
487
  }
406
488
  };
489
+ /**
490
+ * @hidden
491
+ */
492
+ TimePickerComponent.prototype.ngAfterViewInit = function () {
493
+ this.setComponentClasses();
494
+ };
407
495
  /**
408
496
  * @hidden
409
497
  */
@@ -716,7 +804,7 @@ var TimePickerComponent = /** @class */ (function () {
716
804
  }
717
805
  };
718
806
  TimePickerComponent.prototype.bindEvents = function () {
719
- var element = this.element.nativeElement;
807
+ var element = this.wrapper.nativeElement;
720
808
  this.domEvents.push(this.renderer.listen(element, 'keydown', this.handleKeydown.bind(this)));
721
809
  if (isWindowAvailable()) {
722
810
  this.windowBlurSubscription = fromEvent(window, 'blur').subscribe(this.handleWindowBlur.bind(this));
@@ -768,6 +856,20 @@ var TimePickerComponent = /** @class */ (function () {
768
856
  this.cdr.markForCheck();
769
857
  this.zone.run(function () { return _this.onValidatorChange(); });
770
858
  };
859
+ TimePickerComponent.prototype.setComponentClasses = function () {
860
+ if (this.size) {
861
+ this.renderer.addClass(this.wrapper.nativeElement, getSizeClass('input', this.size));
862
+ this.renderer.addClass(this.toggleButton.nativeElement, getSizeClass('button', this.size));
863
+ }
864
+ if (this.rounded) {
865
+ this.renderer.addClass(this.wrapper.nativeElement, getRoundedClass(this.rounded));
866
+ }
867
+ if (this.fillMode) {
868
+ this.renderer.addClass(this.wrapper.nativeElement, getFillModeClass('input', this.fillMode));
869
+ this.renderer.addClass(this.toggleButton.nativeElement, getFillModeClass('button', this.fillMode));
870
+ this.renderer.addClass(this.toggleButton.nativeElement, "k-button-" + this.fillMode + "-base");
871
+ }
872
+ };
771
873
  var TimePickerComponent_1;
772
874
  tslib_1.__decorate([
773
875
  ViewChild('container', { read: ViewContainerRef, static: false }),
@@ -778,9 +880,9 @@ var TimePickerComponent = /** @class */ (function () {
778
880
  tslib_1.__metadata("design:type", TemplateRef)
779
881
  ], TimePickerComponent.prototype, "popupTemplate", void 0);
780
882
  tslib_1.__decorate([
781
- ViewChild('wrapper', { static: false }),
883
+ ViewChild('toggleButton', { static: true }),
782
884
  tslib_1.__metadata("design:type", ElementRef)
783
- ], TimePickerComponent.prototype, "wrapper", void 0);
885
+ ], TimePickerComponent.prototype, "toggleButton", void 0);
784
886
  tslib_1.__decorate([
785
887
  Input(),
786
888
  tslib_1.__metadata("design:type", String)
@@ -863,6 +965,21 @@ var TimePickerComponent = /** @class */ (function () {
863
965
  tslib_1.__metadata("design:type", Date),
864
966
  tslib_1.__metadata("design:paramtypes", [Date])
865
967
  ], TimePickerComponent.prototype, "value", null);
968
+ tslib_1.__decorate([
969
+ Input(),
970
+ tslib_1.__metadata("design:type", String),
971
+ tslib_1.__metadata("design:paramtypes", [String])
972
+ ], TimePickerComponent.prototype, "size", null);
973
+ tslib_1.__decorate([
974
+ Input(),
975
+ tslib_1.__metadata("design:type", String),
976
+ tslib_1.__metadata("design:paramtypes", [String])
977
+ ], TimePickerComponent.prototype, "rounded", null);
978
+ tslib_1.__decorate([
979
+ Input(),
980
+ tslib_1.__metadata("design:type", String),
981
+ tslib_1.__metadata("design:paramtypes", [String])
982
+ ], TimePickerComponent.prototype, "fillMode", null);
866
983
  tslib_1.__decorate([
867
984
  Output(),
868
985
  tslib_1.__metadata("design:type", EventEmitter)
@@ -884,12 +1001,12 @@ var TimePickerComponent = /** @class */ (function () {
884
1001
  tslib_1.__metadata("design:type", EventEmitter)
885
1002
  ], TimePickerComponent.prototype, "close", void 0);
886
1003
  tslib_1.__decorate([
887
- HostBinding('class.k-widget'),
888
1004
  HostBinding('class.k-timepicker'),
1005
+ HostBinding('class.k-input'),
889
1006
  tslib_1.__metadata("design:type", Boolean)
890
1007
  ], TimePickerComponent.prototype, "wrapperClasses", void 0);
891
1008
  tslib_1.__decorate([
892
- HostBinding('class.k-state-disabled'),
1009
+ HostBinding('class.k-disabled'),
893
1010
  tslib_1.__metadata("design:type", Boolean),
894
1011
  tslib_1.__metadata("design:paramtypes", [])
895
1012
  ], TimePickerComponent.prototype, "disabledClass", null);
@@ -909,7 +1026,7 @@ var TimePickerComponent = /** @class */ (function () {
909
1026
  PickerService
910
1027
  ],
911
1028
  selector: 'kendo-timepicker',
912
- template: "\n <ng-container kendoTimePickerLocalizedMessages\n i18n-accept=\"kendo.timepicker.accept|The Accept button text in the timepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timepicker.acceptLabel|The label for the Accept button in the timepicker component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timepicker.cancel|The Cancel button text in the timepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timepicker.cancelLabel|The label for the Cancel button in the timepicker component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timepicker.now|The Now button text in the timepicker component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-toggle=\"kendo.timepicker.toggle|The label for the toggle button in the timepicker component\"\n toggle=\"Toggle time list\"\n >\n </ng-container>\n <span #wrapper\n class=\"k-picker-wrap\"\n [class.k-state-disabled]=\"disabled\"\n >\n <kendo-dateinput\n #input\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"show\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [role]=\"inputRole\"\n [ariaReadOnly]=\"readonly\"\n [format]=\"format\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [min]=\"normalizeTime(min)\"\n [max]=\"normalizeTime(max)\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [steps]=\"steps\"\n [tabindex]=\"!show ? tabindex : -1\"\n [title]=\"title\"\n [value]=\"value\"\n (valueChange)=\"handleInputChange($event)\"\n ></kendo-dateinput>\n <span class=\"k-select\"\n role=\"button\"\n [attr.title]=\"localization.get('toggle')\"\n [attr.aria-label]=\"localization.get('toggle')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleIconClick,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-icon k-i-clock\"></span>\n </span>\n <ng-template #popupTemplate>\n <kendo-timeselector\n #timeSelector\n [cancelButton]=\"cancelButton\"\n [nowButton]=\"nowButton\"\n [format]=\"format\"\n [min]=\"min\"\n [max]=\"max\"\n [steps]=\"steps\"\n [value]=\"value\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeydown,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n (valueChange)=\"handleChange($event)\"\n (valueReject)=\"handleReject()\"\n >\n <kendo-timeselector-messages\n [acceptLabel]=\"localization.get('acceptLabel')\"\n [accept]=\"localization.get('accept')\"\n [cancelLabel]=\"localization.get('cancelLabel')\"\n [cancel]=\"localization.get('cancel')\"\n [nowLabel]=\"localization.get('nowLabel')\"\n [now]=\"localization.get('now')\"\n >\n </kendo-timeselector-messages>\n </kendo-timeselector>\n </ng-template>\n </span>\n <ng-container #container></ng-container>\n "
1029
+ template: "\n <ng-container kendoTimePickerLocalizedMessages\n i18n-accept=\"kendo.timepicker.accept|The Accept button text in the timepicker component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timepicker.acceptLabel|The label for the Accept button in the timepicker component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timepicker.cancel|The Cancel button text in the timepicker component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timepicker.cancelLabel|The label for the Cancel button in the timepicker component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timepicker.now|The Now button text in the timepicker component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timepicker.nowLabel|The label for the Now button in the timepicker component\"\n nowLabel=\"Select now\"\n\n i18n-toggle=\"kendo.timepicker.toggle|The label for the toggle button in the timepicker component\"\n toggle=\"Toggle time list\"\n >\n </ng-container>\n <kendo-dateinput\n #input\n [focusableId]=\"focusableId\"\n [hasPopup]=\"true\"\n [isPopupOpen]=\"show\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly || readOnlyInput\"\n [role]=\"inputRole\"\n [ariaReadOnly]=\"readonly\"\n [format]=\"format\"\n [formatPlaceholder]=\"formatPlaceholder\"\n [placeholder]=\"placeholder\"\n [min]=\"normalizeTime(min)\"\n [max]=\"normalizeTime(max)\"\n [incompleteDateValidation]=\"incompleteDateValidation\"\n [fillMode]=\"fillMode\"\n [rounded]=\"rounded\"\n [size]=\"size\"\n [steps]=\"steps\"\n [tabindex]=\"!show ? tabindex : -1\"\n [title]=\"title\"\n [value]=\"value\"\n (valueChange)=\"handleInputChange($event)\"\n ></kendo-dateinput>\n <button\n #toggleButton\n type=\"button\"\n class=\"k-input-button k-button k-icon-button\"\n [attr.title]=\"localization.get('toggle')\"\n [attr.aria-label]=\"localization.get('toggle')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleIconClick,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n >\n <span class=\"k-button-icon k-icon k-i-clock\"></span>\n </button>\n <ng-template #popupTemplate>\n <kendo-timeselector\n #timeSelector\n [cancelButton]=\"cancelButton\"\n [nowButton]=\"nowButton\"\n [format]=\"format\"\n [min]=\"min\"\n [max]=\"max\"\n [steps]=\"steps\"\n [value]=\"value\"\n [kendoEventsOutsideAngular]=\"{\n keydown: handleKeydown,\n mousedown: handleMousedown\n }\"\n [scope]=\"this\"\n (valueChange)=\"handleChange($event)\"\n (valueReject)=\"handleReject()\"\n >\n <kendo-timeselector-messages\n [acceptLabel]=\"localization.get('acceptLabel')\"\n [accept]=\"localization.get('accept')\"\n [cancelLabel]=\"localization.get('cancelLabel')\"\n [cancel]=\"localization.get('cancel')\"\n [nowLabel]=\"localization.get('nowLabel')\"\n [now]=\"localization.get('now')\"\n >\n </kendo-timeselector-messages>\n </kendo-timeselector>\n </ng-template>\n <ng-container #container></ng-container>\n "
913
1030
  }),
914
1031
  tslib_1.__param(9, Optional()), tslib_1.__param(9, Inject(TOUCH_ENABLED)),
915
1032
  tslib_1.__metadata("design:paramtypes", [NgZone,
@@ -414,7 +414,7 @@ var TimeSelectorComponent = /** @class */ (function () {
414
414
  tslib_1.__metadata("design:type", Boolean)
415
415
  ], TimeSelectorComponent.prototype, "componentClass", void 0);
416
416
  tslib_1.__decorate([
417
- HostBinding('class.k-state-disabled'),
417
+ HostBinding('class.k-disabled'),
418
418
  tslib_1.__metadata("design:type", Boolean),
419
419
  tslib_1.__metadata("design:paramtypes", [])
420
420
  ], TimeSelectorComponent.prototype, "disabledClass", null);
@@ -475,7 +475,7 @@ var TimeSelectorComponent = /** @class */ (function () {
475
475
  }
476
476
  ],
477
477
  selector: 'kendo-timeselector',
478
- template: "\n <ng-container kendoTimeSelectorLocalizedMessages\n i18n-accept=\"kendo.timeselector.accept|The Accept button text in the timeselector component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timeselector.acceptLabel|The label for the Accept button in the timeselector component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timeselector.cancel|The Cancel button text in the timeselector component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timeselector.cancelLabel|The label for the Cancel button in the timeselector component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timeselector.now|The Now button text in the timeselector component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timeselector.nowLabel|The label for the Now button in the timeselector component\"\n nowLabel=\"Select now\"\n >\n </ng-container>\n <div class=\"k-time-header\">\n <span class=\"k-title k-timeselector-title\">\n {{ intl.formatDate(current, format) }}\n </span>\n <button\n #now\n *ngIf=\"showNowButton\"\n class=\"k-button k-flat k-time-now\" type=\"button\"\n [attr.title]=\"localization.get('nowLabel')\"\n [attr.aria-label]=\"localization.get('nowLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleNow,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('now')}}</button>\n </div>\n <div class=\"k-time-list-container\">\n <span class=\"k-time-highlight\"></span>\n <ng-template ngFor [ngForOf]=\"dateFormatParts\" let-part let-idx=\"index\">\n <div\n #listWrapper\n class=\"k-time-list-wrapper\"\n role=\"presentation\" tabindex=\"-1\"\n *ngIf=\"part.type !== 'literal'\"\n >\n <span class=\"k-title k-timeselector-title\">{{intl.dateFieldName(part)}}</span>\n <kendo-timelist\n [min]=\"min\"\n [max]=\"max\"\n [part]=\"part\"\n [step]=\"partStep(part)\"\n [disabled]=\"disabled\"\n [(value)]=\"current\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleListFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.data-timelist-index]=\"idx\"\n ></kendo-timelist>\n </div>\n <div class=\"k-time-separator\" *ngIf=\"part.type === 'literal'\">\n {{part.pattern}}\n </div>\n </ng-template>\n </div>\n <div class=\"k-time-footer k-action-buttons\" *ngIf=\"setButton || cancelButton\">\n <button\n #cancel\n *ngIf=\"cancelButton\"\n class=\"k-button k-time-cancel\" type=\"button\"\n [attr.title]=\"localization.get('cancelLabel')\"\n [attr.aria-label]=\"localization.get('cancelLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleReject,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('cancel')}}</button>\n <button\n #accept\n *ngIf=\"setButton\"\n type=\"button\"\n class=\"k-time-accept k-button k-primary\"\n [attr.title]=\"localization.get('acceptLabel')\"\n [attr.aria-label]=\"localization.get('acceptLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleAccept,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('accept')}}</button>\n </div>\n "
478
+ template: "\n <ng-container kendoTimeSelectorLocalizedMessages\n i18n-accept=\"kendo.timeselector.accept|The Accept button text in the timeselector component\"\n accept=\"Set\"\n\n i18n-acceptLabel=\"kendo.timeselector.acceptLabel|The label for the Accept button in the timeselector component\"\n acceptLabel=\"Set time\"\n\n i18n-cancel=\"kendo.timeselector.cancel|The Cancel button text in the timeselector component\"\n cancel=\"Cancel\"\n\n i18n-cancelLabel=\"kendo.timeselector.cancelLabel|The label for the Cancel button in the timeselector component\"\n cancelLabel=\"Cancel changes\"\n\n i18n-now=\"kendo.timeselector.now|The Now button text in the timeselector component\"\n now=\"Now\"\n\n i18n-nowLabel=\"kendo.timeselector.nowLabel|The label for the Now button in the timeselector component\"\n nowLabel=\"Select now\"\n >\n </ng-container>\n <div class=\"k-time-header\">\n <span class=\"k-title k-timeselector-title\">\n {{ intl.formatDate(current, format) }}\n </span>\n <button\n #now\n *ngIf=\"showNowButton\"\n type=\"button\"\n class=\"k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-time-now\"\n [attr.title]=\"localization.get('nowLabel')\"\n [attr.aria-label]=\"localization.get('nowLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleNow,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('now')}}</button>\n </div>\n <div class=\"k-time-list-container\">\n <span class=\"k-time-highlight\"></span>\n <ng-template ngFor [ngForOf]=\"dateFormatParts\" let-part let-idx=\"index\">\n <div\n #listWrapper\n class=\"k-time-list-wrapper\"\n role=\"presentation\" tabindex=\"-1\"\n *ngIf=\"part.type !== 'literal'\"\n >\n <span class=\"k-title k-timeselector-title\">{{intl.dateFieldName(part)}}</span>\n <kendo-timelist\n [min]=\"min\"\n [max]=\"max\"\n [part]=\"part\"\n [step]=\"partStep(part)\"\n [disabled]=\"disabled\"\n [(value)]=\"current\"\n [kendoEventsOutsideAngular]=\"{\n focus: handleListFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [attr.data-timelist-index]=\"idx\"\n ></kendo-timelist>\n </div>\n <div class=\"k-time-separator\" *ngIf=\"part.type === 'literal'\">\n {{part.pattern}}\n </div>\n </ng-template>\n </div>\n <div class=\"k-time-footer k-action-buttons k-actions k-hstack k-justify-content-stretch\" *ngIf=\"setButton || cancelButton\">\n <button\n #cancel\n *ngIf=\"cancelButton\"\n class=\"k-button k-time-cancel k-button-md k-rounded-md k-button-solid k-button-solid-base\"\n type=\"button\"\n [attr.title]=\"localization.get('cancelLabel')\"\n [attr.aria-label]=\"localization.get('cancelLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleReject,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('cancel')}}</button>\n <button\n #accept\n *ngIf=\"setButton\"\n type=\"button\"\n class=\"k-button k-time-accept k-button-md k-rounded-md k-button-solid k-button-solid-primary\"\n [attr.title]=\"localization.get('acceptLabel')\"\n [attr.aria-label]=\"localization.get('acceptLabel')\"\n [kendoEventsOutsideAngular]=\"{\n click: handleAccept,\n focus: handleFocus,\n blur: handleBlur\n }\"\n [scope]=\"this\"\n [disabled]=\"disabled\"\n >{{localization.get('accept')}}</button>\n </div>\n "
479
479
  }),
480
480
  tslib_1.__param(7, Optional()),
481
481
  tslib_1.__metadata("design:paramtypes", [LocalizationService,
package/dist/es/util.js CHANGED
@@ -355,4 +355,41 @@ export var isTabExitingCalendar = function (calendarType, focusedElement, shiftK
355
355
  (!shiftKey && focusedElement.classList.contains('k-next-view')) // exited on next button focused and regular tab
356
356
  );
357
357
  };
358
+ /**
359
+ * @hidden
360
+ * Returns the size class based on the component and size input.
361
+ */
362
+ export var getSizeClass = function (component, size) {
363
+ var SIZE_CLASSES = {
364
+ 'small': "k-" + component + "-sm",
365
+ 'medium': "k-" + component + "-md",
366
+ 'large': "k-" + component + "-lg"
367
+ };
368
+ return SIZE_CLASSES[size];
369
+ };
370
+ /**
371
+ * @hidden
372
+ * Returns the rounded class based on the rounded input.
373
+ */
374
+ export var getRoundedClass = function (rounded) {
375
+ var ROUNDED_CLASSES = {
376
+ 'small': 'k-rounded-sm',
377
+ 'medium': 'k-rounded-md',
378
+ 'large': 'k-rounded-lg',
379
+ 'full': 'k-rounded-full'
380
+ };
381
+ return ROUNDED_CLASSES[rounded];
382
+ };
383
+ /**
384
+ * @hidden
385
+ * Return the fillMode class based on the component and fillMode input.
386
+ */
387
+ export var getFillModeClass = function (component, fillMode) {
388
+ var FILLMODE_CLASSES = {
389
+ 'solid': "k-" + component + "-solid",
390
+ 'flat': "k-" + component + "-flat",
391
+ 'outline': "k-" + component + "-outline"
392
+ };
393
+ return FILLMODE_CLASSES[fillMode];
394
+ };
358
395
  export { ɵ0, ɵ1, ɵ2 };
@@ -999,7 +999,7 @@ tslib_1.__decorate([
999
999
  ], CalendarComponent.prototype, "calendarTabIndex", null);
1000
1000
  tslib_1.__decorate([
1001
1001
  HostBinding('attr.aria-disabled'),
1002
- HostBinding('class.k-state-disabled'),
1002
+ HostBinding('class.k-disabled'),
1003
1003
  tslib_1.__metadata("design:type", Boolean),
1004
1004
  tslib_1.__metadata("design:paramtypes", [])
1005
1005
  ], CalendarComponent.prototype, "ariaDisabled", null);
@@ -159,7 +159,7 @@ HeaderComponent = tslib_1.__decorate([
159
159
  Component({
160
160
  selector: 'kendo-calendar-header',
161
161
  template: `
162
- <span class="k-button k-flat k-title k-calendar-title" [class.k-state-disabled]="!navigate"
162
+ <span class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-calendar-title" [class.k-disabled]="!navigate"
163
163
  [kendoEventsOutsideAngular]="{
164
164
  click: handleNavigation
165
165
  }"
@@ -175,7 +175,7 @@ HeaderComponent = tslib_1.__decorate([
175
175
  <span class="k-calendar-nav k-hstack">
176
176
  <button
177
177
  *ngIf="showNavigationButtons"
178
- class="k-button k-flat k-icon-button k-prev-view"
178
+ class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-prev-view"
179
179
  type="button"
180
180
  [attr.aria-disabled]="isPrevDisabled"
181
181
  [disabled]="isPrevDisabled"
@@ -186,7 +186,7 @@ HeaderComponent = tslib_1.__decorate([
186
186
  </button>
187
187
  <span
188
188
  class="k-today k-nav-today"
189
- [class.k-state-disabled]="!todayAvailable"
189
+ [class.k-disabled]="!todayAvailable"
190
190
  [kendoEventsOutsideAngular]="{
191
191
  click: handleTodayClick
192
192
  }"
@@ -196,7 +196,7 @@ HeaderComponent = tslib_1.__decorate([
196
196
  </span>
197
197
  <button
198
198
  *ngIf="showNavigationButtons"
199
- class="k-button k-flat k-icon-button k-next-view"
199
+ class="k-button k-button-md k-rounded-md k-button-flat k-button-flat-base k-icon-button k-next-view"
200
200
  type="button"
201
201
  [attr.aria-disabled]="isNextDisabled"
202
202
  [disabled]="isNextDisabled"
@@ -24,6 +24,7 @@ import { CalendarViewEnum } from './models/view.enum';
24
24
  import { SelectionRangeEnd } from './models/selection-range-end.type';
25
25
  import { SelectionRange } from './models/selection-range.interface';
26
26
  import { CalendarSelection } from './models/selection';
27
+ import { PickerService } from '../common/picker.service';
27
28
  /**
28
29
  * @hidden
29
30
  */
@@ -55,6 +56,7 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
55
56
  private zone;
56
57
  private disabledDatesService;
57
58
  private selectionService;
59
+ private pickerService?;
58
60
  /**
59
61
  * @hidden
60
62
  */
@@ -333,7 +335,7 @@ export declare class MultiViewCalendarComponent implements AfterViewInit, Contro
333
335
  * @hidden
334
336
  */
335
337
  keydown(event: KeyDown): void;
336
- constructor(bus: BusViewService, element: ElementRef, navigator: NavigationService, renderer: Renderer2, cdr: ChangeDetectorRef, zone: NgZone, disabledDatesService: DisabledDatesService, selectionService: SelectionService);
338
+ constructor(bus: BusViewService, element: ElementRef, navigator: NavigationService, renderer: Renderer2, cdr: ChangeDetectorRef, zone: NgZone, disabledDatesService: DisabledDatesService, selectionService: SelectionService, pickerService?: PickerService);
337
339
  ngOnInit(): void;
338
340
  ngOnChanges(changes: any): void;
339
341
  ngOnDestroy(): void;
@@ -3,7 +3,7 @@
3
3
  * Licensed under commercial license. See LICENSE.md in the project root for more information
4
4
  *-------------------------------------------------------------------------------------------*/
5
5
  import * as tslib_1 from "tslib";
6
- import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone } from '@angular/core';
6
+ import { Component, ChangeDetectorRef, ChangeDetectionStrategy, ContentChild, EventEmitter, ElementRef, Renderer2, isDevMode, forwardRef, HostBinding, HostListener, Input, Output, ViewChild, NgZone, Optional } from '@angular/core';
7
7
  import { NG_VALUE_ACCESSOR, NG_VALIDATORS } from '@angular/forms';
8
8
  import { L10N_PREFIX, LocalizationService } from '@progress/kendo-angular-l10n';
9
9
  import { cloneDate, isEqual } from '@progress/kendo-date-math';
@@ -30,6 +30,7 @@ import { MIN_DATE, MAX_DATE } from '../defaults';
30
30
  import { areDatesEqual, dateInRange, getToday, hasExistingValue, last, noop } from '../util';
31
31
  import { Subscription } from 'rxjs';
32
32
  import { isPresent } from '../common/utils';
33
+ import { PickerService } from '../common/picker.service';
33
34
  const BOTTOM_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-bottomview';
34
35
  const TOP_VIEW_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-topview';
35
36
  const MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min';
@@ -66,7 +67,7 @@ export const RANGE_CALENDAR_RANGE_VALIDATORS = {
66
67
  * ```
67
68
  */
68
69
  let MultiViewCalendarComponent = class MultiViewCalendarComponent {
69
- constructor(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService) {
70
+ constructor(bus, element, navigator, renderer, cdr, zone, disabledDatesService, selectionService, pickerService) {
70
71
  this.bus = bus;
71
72
  this.element = element;
72
73
  this.navigator = navigator;
@@ -75,6 +76,7 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
75
76
  this.zone = zone;
76
77
  this.disabledDatesService = disabledDatesService;
77
78
  this.selectionService = selectionService;
79
+ this.pickerService = pickerService;
78
80
  /**
79
81
  * @hidden
80
82
  */
@@ -413,6 +415,9 @@ let MultiViewCalendarComponent = class MultiViewCalendarComponent {
413
415
  return;
414
416
  }
415
417
  if (event.keyCode === Keys.Enter) {
418
+ if (isPresent(this.pickerService)) {
419
+ event.preventDefault(); // Don't submit form from Datepicker popup
420
+ }
416
421
  this.performSelection(this.focusedDate, event);
417
422
  }
418
423
  const candidate = dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event), this.activeViewEnum), this.min, this.max);
@@ -899,7 +904,7 @@ tslib_1.__decorate([
899
904
  ], MultiViewCalendarComponent.prototype, "calendarTabIndex", null);
900
905
  tslib_1.__decorate([
901
906
  HostBinding('attr.aria-disabled'),
902
- HostBinding('class.k-state-disabled'),
907
+ HostBinding('class.k-disabled'),
903
908
  tslib_1.__metadata("design:type", Boolean),
904
909
  tslib_1.__metadata("design:paramtypes", [])
905
910
  ], MultiViewCalendarComponent.prototype, "ariaDisabled", null);
@@ -1025,6 +1030,7 @@ MultiViewCalendarComponent = tslib_1.__decorate([
1025
1030
  </kendo-calendar-horizontal>
1026
1031
  `
1027
1032
  }),
1033
+ tslib_1.__param(8, Optional()),
1028
1034
  tslib_1.__metadata("design:paramtypes", [BusViewService,
1029
1035
  ElementRef,
1030
1036
  NavigationService,
@@ -1032,6 +1038,7 @@ MultiViewCalendarComponent = tslib_1.__decorate([
1032
1038
  ChangeDetectorRef,
1033
1039
  NgZone,
1034
1040
  DisabledDatesService,
1035
- SelectionService])
1041
+ SelectionService,
1042
+ PickerService])
1036
1043
  ], MultiViewCalendarComponent);
1037
1044
  export { MultiViewCalendarComponent };
@@ -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-title k-calendar-title">March 2017</span>
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-state-disabled': context.isDisabled,
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
+ *-------------------------------------------------------------------------------------------*/