@progress/kendo-vue-dateinputs 2.5.0 → 2.5.1

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 (58) hide show
  1. package/dist/cdn/js/kendo-vue-dateinputs.js +1 -1
  2. package/dist/es/calendar/components/CalendarCell.d.ts +1 -0
  3. package/dist/es/calendar/components/CalendarHeaderTitle.d.ts +1 -0
  4. package/dist/es/calendar/components/Header.d.ts +2 -0
  5. package/dist/es/calendar/components/View.d.ts +2 -0
  6. package/dist/es/calendar/components/ViewList.d.ts +2 -0
  7. package/dist/es/calendar/components/ViewList.js +1 -1
  8. package/dist/es/calendar/components/interfaces/CalendarComputed.d.ts +1 -0
  9. package/dist/es/calendar/components/interfaces/CalendarMethods.d.ts +1 -0
  10. package/dist/es/dateinput/DateInput.js +31 -25
  11. package/dist/es/dateinput/interfaces/DateInputComputed.d.ts +2 -1
  12. package/dist/es/dateinput/interfaces/DateInputData.d.ts +1 -0
  13. package/dist/es/dateinput/interfaces/DateInputMethods.d.ts +1 -0
  14. package/dist/es/datepicker/DatePicker.js +31 -5
  15. package/dist/es/datepicker/interfaces/DatePickerComputed.d.ts +1 -0
  16. package/dist/es/datepicker/interfaces/DatePickerMethods.d.ts +2 -0
  17. package/dist/es/datepicker/interfaces/DatePickerProps.d.ts +8 -0
  18. package/dist/es/datetimepicker/DateTimePicker.d.ts +5 -0
  19. package/dist/es/datetimepicker/DateTimePicker.js +49 -13
  20. package/dist/es/datetimepicker/DateTimeSelector.d.ts +2 -0
  21. package/dist/es/datetimepicker/models/DateTimePickerSettings.d.ts +13 -0
  22. package/dist/es/package-metadata.js +1 -1
  23. package/dist/es/timepicker/TimeList.d.ts +2 -0
  24. package/dist/es/timepicker/TimePart.d.ts +2 -0
  25. package/dist/es/timepicker/TimePicker.d.ts +5 -0
  26. package/dist/es/timepicker/TimePicker.js +47 -17
  27. package/dist/es/timepicker/TimeSelector.d.ts +2 -0
  28. package/dist/es/timepicker/models/TimePickerSettings.d.ts +14 -2
  29. package/dist/es/virtualization/Virtualization.d.ts +2 -0
  30. package/dist/npm/calendar/components/CalendarCell.d.ts +1 -0
  31. package/dist/npm/calendar/components/CalendarHeaderTitle.d.ts +1 -0
  32. package/dist/npm/calendar/components/Header.d.ts +2 -0
  33. package/dist/npm/calendar/components/View.d.ts +2 -0
  34. package/dist/npm/calendar/components/ViewList.d.ts +2 -0
  35. package/dist/npm/calendar/components/ViewList.js +1 -1
  36. package/dist/npm/calendar/components/interfaces/CalendarComputed.d.ts +1 -0
  37. package/dist/npm/calendar/components/interfaces/CalendarMethods.d.ts +1 -0
  38. package/dist/npm/dateinput/DateInput.js +31 -24
  39. package/dist/npm/dateinput/interfaces/DateInputComputed.d.ts +2 -1
  40. package/dist/npm/dateinput/interfaces/DateInputData.d.ts +1 -0
  41. package/dist/npm/dateinput/interfaces/DateInputMethods.d.ts +1 -0
  42. package/dist/npm/datepicker/DatePicker.js +32 -5
  43. package/dist/npm/datepicker/interfaces/DatePickerComputed.d.ts +1 -0
  44. package/dist/npm/datepicker/interfaces/DatePickerMethods.d.ts +2 -0
  45. package/dist/npm/datepicker/interfaces/DatePickerProps.d.ts +8 -0
  46. package/dist/npm/datetimepicker/DateTimePicker.d.ts +5 -0
  47. package/dist/npm/datetimepicker/DateTimePicker.js +50 -13
  48. package/dist/npm/datetimepicker/DateTimeSelector.d.ts +2 -0
  49. package/dist/npm/datetimepicker/models/DateTimePickerSettings.d.ts +13 -0
  50. package/dist/npm/package-metadata.js +1 -1
  51. package/dist/npm/timepicker/TimeList.d.ts +2 -0
  52. package/dist/npm/timepicker/TimePart.d.ts +2 -0
  53. package/dist/npm/timepicker/TimePicker.d.ts +5 -0
  54. package/dist/npm/timepicker/TimePicker.js +48 -17
  55. package/dist/npm/timepicker/TimeSelector.d.ts +2 -0
  56. package/dist/npm/timepicker/models/TimePickerSettings.d.ts +14 -2
  57. package/dist/npm/virtualization/Virtualization.d.ts +2 -0
  58. package/package.json +7 -6
@@ -47,6 +47,7 @@ export interface TimePickerState {
47
47
  _popupId: string;
48
48
  _element: HTMLSpanElement | null;
49
49
  _dateInput: any;
50
+ dateInputRef: any;
50
51
  _timeSelector: any;
51
52
  _wrapper: any;
52
53
  _anchor: any;
@@ -62,6 +63,7 @@ export interface TimePickerState {
62
63
  * @hidden
63
64
  */
64
65
  export interface TimePickerMethods {
66
+ [key: string]: any;
65
67
  validity: () => FormComponentValidity;
66
68
  focus: () => void;
67
69
  setDateInputRef: (dateInput: any) => void;
@@ -82,6 +84,7 @@ export interface TimePickerMethods {
82
84
  timeFocus: (event: any) => void;
83
85
  timeBlur: (event: any) => void;
84
86
  createBlurTimeout: () => void;
87
+ getDateInputText: () => string;
85
88
  }
86
89
  /**
87
90
  * @hidden
@@ -89,11 +92,13 @@ export interface TimePickerMethods {
89
92
  export interface TimePickerData {
90
93
  currentValue: Date | null;
91
94
  currentShow: boolean;
95
+ isFocused: boolean;
92
96
  }
93
97
  /**
94
98
  * @hidden
95
99
  */
96
100
  export interface TimePickerComputed {
101
+ [key: string]: any;
97
102
  timeSelector: any;
98
103
  computedValue: Date | null;
99
104
  computedShow: boolean;
@@ -20,6 +20,7 @@ var allVue = Vue;
20
20
  var gh = allVue.h;
21
21
  var ref = allVue.ref;
22
22
  var inject = allVue.inject;
23
+ import { FloatingLabel } from '@progress/kendo-vue-labels';
23
24
  import { Popup } from '@progress/kendo-vue-popup';
24
25
  import { cloneDate } from '@progress/kendo-date-math';
25
26
  import { classNames, guid, Keys, templateRendering, getListeners, getTemplate, canUseDOM } from '@progress/kendo-vue-common';
@@ -36,6 +37,7 @@ var TimePicker = {
36
37
  emits: {
37
38
  'changemodel': null,
38
39
  'update:modelValue': null,
40
+ 'iconclick': null,
39
41
  'change': null,
40
42
  'focus': null,
41
43
  'blur': null
@@ -110,6 +112,8 @@ var TimePicker = {
110
112
  }
111
113
  },
112
114
  name: String,
115
+ label: String,
116
+ placeholder: String,
113
117
  popupSettings: {
114
118
  type: Object,
115
119
  default: function _default() {
@@ -183,7 +187,8 @@ var TimePicker = {
183
187
  currentValue: null,
184
188
  currentShow: false,
185
189
  valueDuringOnChange: undefined,
186
- showDuringOnChange: undefined
190
+ showDuringOnChange: undefined,
191
+ isFocused: false
187
192
  };
188
193
  },
189
194
  computed: {
@@ -212,7 +217,7 @@ var TimePicker = {
212
217
  this.$forceUpdate();
213
218
  }
214
219
 
215
- this._dateInput = this.$refs.dateInput;
220
+ this._dateInput = this.v3 ? this.dateInputRef : this.$refs.dateInput;
216
221
  this._timeSelector = this.$refs.timeSelector;
217
222
  this._wrapper = this.$refs[this._anchor];
218
223
 
@@ -223,7 +228,7 @@ var TimePicker = {
223
228
  }
224
229
  },
225
230
  updated: function updated() {
226
- this._dateInput = this.$refs.dateInput;
231
+ this._dateInput = this.v3 ? this.dateInputRef : this.$refs.dateInput;
227
232
  this._timeSelector = this.$refs.timeSelector;
228
233
  this._wrapper = this.$refs[this._anchor];
229
234
 
@@ -262,6 +267,7 @@ var TimePicker = {
262
267
  tabIndex = _a.tabIndex,
263
268
  title = _a.title,
264
269
  id = _a.id,
270
+ placeholder = _a.placeholder,
265
271
  format = _a.format,
266
272
  formatPlaceholder = _a.formatPlaceholder,
267
273
  smoothScroll = _a.smoothScroll,
@@ -282,9 +288,9 @@ var TimePicker = {
282
288
  var isValid = !this.$props.validityStyles || this.validity().valid;
283
289
  var rootClassName = classNames('k-widget k-timepicker');
284
290
  var wrapperClassNames = classNames('k-picker-wrap', {
285
- 'k-state-default': !disabled && isValid,
286
291
  'k-state-invalid': !isValid,
287
- 'k-state-disabled': disabled
292
+ 'k-state-disabled': disabled,
293
+ 'k-state-focused': this.isFocused
288
294
  });
289
295
  var popupClassNames = classNames('k-group k-reset', popupClass);
290
296
  var localizationService = provideLocalizationService(this);
@@ -293,9 +299,12 @@ var TimePicker = {
293
299
  var dateInput = this.$props.dateInput ? templateRendering.call(this, this.$props.dateInput, getListeners.call(this)) : undefined;
294
300
  var dateInputDefaultRendering = // @ts-ignore function children
295
301
  h(DateInput, {
296
- ref: 'dateInput',
297
- disabled: disabled,
302
+ ref: this.v3 ? function (el) {
303
+ _this.dateInputRef = el;
304
+ } : 'dateInput',
305
+ placeholder: placeholder,
298
306
  attrs: this.v3 ? undefined : {
307
+ placeholder: placeholder,
299
308
  disabled: disabled,
300
309
  format: format,
301
310
  formatPlaceholder: formatPlaceholder,
@@ -314,6 +323,7 @@ var TimePicker = {
314
323
  validityStyles: validityStyles,
315
324
  value: this.computedValue && this.normalizeTime(this.computedValue)
316
325
  },
326
+ disabled: disabled,
317
327
  format: format,
318
328
  formatPlaceholder: formatPlaceholder,
319
329
  id: id,
@@ -417,7 +427,7 @@ var TimePicker = {
417
427
  defaultRendering: popupDefaultRendering,
418
428
  defaultSlots: timeSelector
419
429
  });
420
- return h("div", {
430
+ var timePicker = h("div", {
421
431
  "class": rootClassName,
422
432
  onKeydown: this.handleKeyDown,
423
433
  on: this.v3 ? undefined : {
@@ -456,6 +466,28 @@ var TimePicker = {
456
466
  }, [h("span", {
457
467
  "class": "k-icon k-i-clock"
458
468
  })])]), popupRendering]);
469
+ return this.$props.label ? // @ts-ignore function children
470
+ h(FloatingLabel, {
471
+ label: this.$props.label,
472
+ attrs: this.v3 ? undefined : {
473
+ label: this.$props.label,
474
+ editorId: id,
475
+ editorValid: isValid,
476
+ editorValue: this.getDateInputText(),
477
+ editorPlaceholder: this.$props.placeholder,
478
+ editorDisabled: this.$props.disabled
479
+ },
480
+ editorId: id,
481
+ editorValid: isValid,
482
+ editorValue: this.getDateInputText(),
483
+ editorPlaceholder: this.$props.placeholder,
484
+ editorDisabled: this.$props.disabled,
485
+ style: {
486
+ width: width
487
+ }
488
+ }, this.v3 ? function () {
489
+ return [timePicker];
490
+ } : [timePicker]) : timePicker;
459
491
  },
460
492
  methods: {
461
493
  validity: function validity() {
@@ -474,6 +506,9 @@ var TimePicker = {
474
506
  valueMissing: this.computedValue === null
475
507
  };
476
508
  },
509
+ getDateInputText: function getDateInputText() {
510
+ return this._dateInput ? this._dateInput._element.value : '';
511
+ },
477
512
  focus: function focus() {
478
513
  if (this._dateInput) {
479
514
  this._dateInput.focus();
@@ -522,11 +557,7 @@ var TimePicker = {
522
557
  },
523
558
  handleFocus: function handleFocus(event) {
524
559
  this._oldShow = this.computedShow;
525
-
526
- if (this._wrapper) {
527
- this._wrapper.classList.add('k-state-focused');
528
- }
529
-
560
+ this.isFocused = true;
530
561
  this.$emit('focus', event);
531
562
  },
532
563
  handleBlur: function handleBlur(event) {
@@ -545,9 +576,7 @@ var TimePicker = {
545
576
  var _this = this;
546
577
 
547
578
  this._blurTimeout = setTimeout(function () {
548
- if (_this._wrapper) {
549
- _this._wrapper.classList.remove('k-state-focused');
550
- }
579
+ _this.isFocused = false;
551
580
 
552
581
  if (_this._dateInput && canUseDOM && document.activeElement !== _this._dateInput.element() && document.activeElement && document.activeElement.className.indexOf('k-time-list') === -1) {
553
582
  _this.setShow(false);
@@ -557,13 +586,14 @@ var TimePicker = {
557
586
  handleValueReject: function handleValueReject(_) {
558
587
  this.setShow(false);
559
588
  },
560
- handleIconClick: function handleIconClick(_) {
589
+ handleIconClick: function handleIconClick(event) {
561
590
  if (this.$props.disabled) {
562
591
  return;
563
592
  }
564
593
 
565
594
  this.shouldFocusDateInput = true;
566
595
  this.setShow(!this.computedShow);
596
+ this.$emit('iconclick', event);
567
597
  },
568
598
  handleIconMouseDown: function handleIconMouseDown(event) {
569
599
  event.preventDefault();
@@ -61,6 +61,7 @@ export interface TimeSelectorData {
61
61
  * @hidden
62
62
  */
63
63
  export interface TimeSelectorMethods {
64
+ [key: string]: any;
64
65
  focusActiveList: () => void;
65
66
  hasActiveButton: () => any;
66
67
  handleKeyDown: (event: any) => void;
@@ -75,6 +76,7 @@ export interface TimeSelectorMethods {
75
76
  * @hidden
76
77
  */
77
78
  export interface TimeSelectorComputed {
79
+ [key: string]: any;
78
80
  computedValue: Date | null;
79
81
  intl: IntlService;
80
82
  current: Date | null;
@@ -57,14 +57,26 @@ export interface TimePickerSettings {
57
57
  * Specifies the `name` property of the `input` DOM element.
58
58
  */
59
59
  name?: string;
60
+ /**
61
+ * Renders a floating label for the TimePicker.
62
+ */
63
+ label?: string;
64
+ /**
65
+ * Specifies the value of the placeholder.
66
+ */
67
+ placeholder?: string;
60
68
  /**
61
69
  * Fires each time any of the TimePicker elements gets blurred.
62
70
  */
63
- onBlur?: (event: any) => void;
71
+ blur?: (event: any) => void;
64
72
  /**
65
73
  * Fires each time the user focuses any of the TimePicker elements.
66
74
  */
67
- onFocus?: (event: any) => void;
75
+ focus?: (event: any) => void;
76
+ /**
77
+ * Fires when the icon element is clicked.
78
+ */
79
+ iconclick?: (event: any) => void;
68
80
  /**
69
81
  * Configures the popup options of the TimePicker.
70
82
  *
@@ -50,6 +50,7 @@ export interface VirtualizationData {
50
50
  * @hidden
51
51
  */
52
52
  export interface VirtualizationMethods {
53
+ [key: string]: any;
53
54
  activeIndex: () => number;
54
55
  itemIndex: (offset: number) => number;
55
56
  itemOffset: (index: number) => number;
@@ -76,6 +77,7 @@ export interface VirtualizationMethods {
76
77
  * @hidden
77
78
  */
78
79
  export interface VirtualizationComputed {
80
+ [key: string]: any;
79
81
  element: HTMLDivElement | null;
80
82
  }
81
83
  /**
@@ -15,6 +15,7 @@ export interface CalendarCellProps extends CellContext {
15
15
  * @hidden
16
16
  */
17
17
  export interface CalendarCellMethods {
18
+ [key: string]: any;
18
19
  handleClick?: (e: any) => void;
19
20
  handleMouseDown?: (e: any) => void;
20
21
  handleMouseEnter?: () => void;
@@ -15,6 +15,7 @@ export interface CalendarHeaderTitleProps {
15
15
  * @hidden
16
16
  */
17
17
  export interface CalendarHeaderTitleMethods {
18
+ [key: string]: any;
18
19
  handleClick: (e: any) => void;
19
20
  }
20
21
  /**
@@ -33,6 +33,7 @@ export interface HeaderProps {
33
33
  * @hidden
34
34
  */
35
35
  export interface HeaderMethods {
36
+ [key: string]: any;
36
37
  getTitle: () => string;
37
38
  handleTitleClick: (event: any) => void;
38
39
  handleTodayClick: (event: any) => void;
@@ -47,6 +48,7 @@ export interface HeaderMethods {
47
48
  * @hidden
48
49
  */
49
50
  export interface HeaderComputed {
51
+ [key: string]: any;
50
52
  navigate?: () => void;
51
53
  todayIsInRange?: () => boolean;
52
54
  }
@@ -61,6 +61,7 @@ export interface ViewProps {
61
61
  * @hidden
62
62
  */
63
63
  export interface ViewComputed {
64
+ [key: string]: any;
64
65
  isMonthView?: boolean;
65
66
  weekNumber?: boolean;
66
67
  isHorizontal?: boolean;
@@ -69,6 +70,7 @@ export interface ViewComputed {
69
70
  * @hidden
70
71
  */
71
72
  export interface ViewMethods {
73
+ [key: string]: any;
72
74
  buildWeekNumber: (row: any, idx: number) => void;
73
75
  buildRow: (row: any) => void;
74
76
  firstDate: (row: any) => any;
@@ -69,6 +69,7 @@ export interface ViewListState {
69
69
  * @hidden
70
70
  */
71
71
  export interface ViewListComputed {
72
+ [key: string]: any;
72
73
  weekNames?: string[];
73
74
  weekNumber?: boolean;
74
75
  animate?: boolean;
@@ -77,6 +78,7 @@ export interface ViewListComputed {
77
78
  * @hidden
78
79
  */
79
80
  export interface ViewListMethods {
81
+ [key: string]: any;
80
82
  blurActiveDate: () => void;
81
83
  focusActiveDate: (event: any) => void;
82
84
  handleCellEnter: (event: any) => void;
@@ -241,7 +241,7 @@ var ViewList = {
241
241
  render: function render(createElement) {
242
242
  var h = gh || createElement;
243
243
  var selectionRange = this.$props.allowReverse ? this.rotateSelectionRange(this.$props.selectionRange) : this.$props.selectionRange;
244
- var rootClassNames = kendo_vue_common_1.classNames('k-calendar-view', 'k-hstck k-align-items-start k-justify-content-center', {
244
+ var rootClassNames = kendo_vue_common_1.classNames('k-calendar-view', 'k-hstack k-align-items-start k-justify-content-center', {
245
245
  'k-calendar-monthview': this.$props.activeView === models_1.CalendarViewEnum.month,
246
246
  'k-calendar-yearview': this.$props.activeView === models_1.CalendarViewEnum.year,
247
247
  'k-calendar-decadeview': this.$props.activeView === models_1.CalendarViewEnum.decade,
@@ -3,6 +3,7 @@ import { SelectionRangeEnd } from '../../models';
3
3
  * @hidden
4
4
  */
5
5
  export interface CalendarComputed {
6
+ [key: string]: any;
6
7
  activeRange?: SelectionRangeEnd;
7
8
  currentMin: Date;
8
9
  currentMax: Date;
@@ -4,6 +4,7 @@ import { ViewListEventArguments } from '../ViewList';
4
4
  * @hidden
5
5
  */
6
6
  export interface CalendarMethods {
7
+ [key: string]: any;
7
8
  computedValue: () => Date | Date[] | SelectionRange | null;
8
9
  focus: (event?: any) => void;
9
10
  handleTodayClick: (e: any) => void;
@@ -46,6 +46,8 @@ var utils_3 = require("../timepicker/utils");
46
46
 
47
47
  var defaults_1 = require("../defaults");
48
48
 
49
+ var kendo_vue_labels_1 = require("@progress/kendo-vue-labels");
50
+
49
51
  var VALIDATION_MESSAGE = 'Please enter a valid value!';
50
52
  var DateInput = {
51
53
  name: 'DateInput',
@@ -148,9 +150,9 @@ var DateInput = {
148
150
  currentFormat: undefined,
149
151
  valueDuringOnChange: undefined,
150
152
  hasMounted: false,
151
- focused: false,
152
153
  isEmpty: undefined,
153
- lastSelectedSymbol: undefined
154
+ lastSelectedSymbol: undefined,
155
+ isFocused: false
154
156
  };
155
157
  },
156
158
  created: function created() {
@@ -177,14 +179,15 @@ var DateInput = {
177
179
  return this.kendoDate && this.kendoDate.getDateObject();
178
180
  }
179
181
  },
180
- spanClassNames: {
182
+ wrapperClassNames: {
181
183
  get: function get() {
182
184
  var isValid = !this.$data.hasMounted || !this.$props.validityStyles || this.validity().valid;
185
+ var disabled = this.$props.disabled;
183
186
  return {
184
- 'k-floating-label-container': true,
185
- 'k-state-focused': this.$data.focused,
186
- 'k-state-empty': this.$data.isEmpty && this.$props.placeholder === '',
187
+ 'k-dateinput-wrap': true,
188
+ 'k-state-disabled': disabled,
187
189
  'k-state-invalid': !isValid && isValid !== undefined,
190
+ 'k-state-focused': this.isFocused,
188
191
  'k-rtl': this.$props.dir === 'rtl'
189
192
  };
190
193
  }
@@ -216,11 +219,11 @@ var DateInput = {
216
219
  }
217
220
  },
218
221
  handleFocus: function handleFocus(e) {
219
- this.$data.focused = true;
222
+ this.$data.isFocused = true;
220
223
  this.$emit('focus', e);
221
224
  },
222
225
  handleBlur: function handleBlur(e) {
223
- this.$data.focused = false;
226
+ this.$data.isFocused = false;
224
227
  this.$emit('blur', e);
225
228
  },
226
229
  intl: function intl() {
@@ -560,7 +563,7 @@ var DateInput = {
560
563
 
561
564
  this.$data.currentFormat = currentFormat;
562
565
  this.$data.isEmpty = currentText === this._emptyText;
563
- var showPlaceHolder = this.$props.placeholder !== undefined && this.$data.isEmpty && !this.$data.focused;
566
+ var showPlaceHolder = this.$props.placeholder !== undefined && this.$data.isEmpty && !this.$data.isFocused;
564
567
  var textToDisplay = !showPlaceHolder ? currentText : null;
565
568
  var inputId = id || this._inputId;
566
569
  var isValid = !this.$props.validityStyles || this.validity().valid;
@@ -576,9 +579,9 @@ var DateInput = {
576
579
  attrs: this.v3 ? undefined : {
577
580
  dir: this.$props.dir
578
581
  },
579
- "class": isValid ? wrapperClassesInstance.join(' ') : Array.prototype.concat([], wrapperClassesInstance, utils_1.invalidClasses).join(' ')
582
+ "class": wrapperClassesInstance.join(' ')
580
583
  }, [h("span", {
581
- "class": 'k-dateinput-wrap' + (this.$props.disabled ? ' k-state-disabled' : '')
584
+ "class": this.wrapperClassNames
582
585
  }, [h("input", {
583
586
  role: "spinbutton",
584
587
  attrs: this.v3 ? undefined : {
@@ -671,21 +674,25 @@ var DateInput = {
671
674
  }, [h("span", {
672
675
  "class": "k-icon k-i-arrow-s"
673
676
  })])])])]);
674
- return label ? h("span", {
675
- "class": this.spanClassNames,
676
- dir: this.$props.dir,
677
- attrs: this.v3 ? undefined : {
678
- dir: this.$props.dir
679
- }
680
- }, [dateinput, this.$props.label ? inputId ? h("label", {
681
- "for": inputId,
677
+ return label ? // @ts-ignore function children
678
+ h(kendo_vue_labels_1.FloatingLabel, {
679
+ label: label,
682
680
  attrs: this.v3 ? undefined : {
683
- "for": inputId
681
+ label: label,
682
+ editorId: inputId,
683
+ editorValue: textToDisplay,
684
+ editorPlaceholder: this.$props.placeholder,
685
+ editorValid: isValid,
686
+ editorDisabled: this.$props.disabled
684
687
  },
685
- "class": "k-label"
686
- }, [this.$props.label]) : h("span", {
687
- "class": "k-label"
688
- }, [this.$props.label]) : null]) : dateinput;
688
+ editorId: inputId,
689
+ editorValue: textToDisplay,
690
+ editorPlaceholder: this.$props.placeholder,
691
+ editorValid: isValid,
692
+ editorDisabled: this.$props.disabled
693
+ }, this.v3 ? function () {
694
+ return [dateinput];
695
+ } : [dateinput]) : dateinput;
689
696
  }
690
697
  };
691
698
  exports.DateInput = DateInput;
@@ -2,6 +2,7 @@
2
2
  * @hidden
3
3
  */
4
4
  export interface DateInputComputed {
5
+ [key: string]: any;
5
6
  computedValue: any;
6
- spanClassNames: any;
7
+ wrapperClassNames: object;
7
8
  }
@@ -7,4 +7,5 @@ export interface DateInputData {
7
7
  currentFormat: string;
8
8
  valueDuringOnChange: Date | null | undefined;
9
9
  lastSelectedSymbol: string;
10
+ isFocused: boolean;
10
11
  }
@@ -5,6 +5,7 @@ import { Selection } from '../models';
5
5
  * @hidden
6
6
  */
7
7
  export interface DateInputMethods {
8
+ [key: string]: any;
8
9
  handleFocus?: (_: any) => void;
9
10
  handleBlur?: (_: any) => void;
10
11
  element: () => HTMLInputElement | null;
@@ -34,7 +34,9 @@ var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
34
34
 
35
35
  var ToggleButton_1 = require("./ToggleButton");
36
36
 
37
- var PickerWrap_1 = require("../common/PickerWrap"); // tslint:enable:max-line-length
37
+ var PickerWrap_1 = require("../common/PickerWrap");
38
+
39
+ var kendo_vue_labels_1 = require("@progress/kendo-vue-labels"); // tslint:enable:max-line-length
38
40
 
39
41
 
40
42
  var DatePicker = {
@@ -52,6 +54,7 @@ var DatePicker = {
52
54
  'change': null,
53
55
  'changemodel': null,
54
56
  'update:modelValue': null,
57
+ 'iconclick': null,
55
58
  'focus': null,
56
59
  'blur': null
57
60
  },
@@ -90,6 +93,7 @@ var DatePicker = {
90
93
  return undefined;
91
94
  }
92
95
  },
96
+ label: String,
93
97
  placeholder: String,
94
98
  popup: {
95
99
  type: [String, Object, Function],
@@ -251,7 +255,6 @@ var DatePicker = {
251
255
  get: function get() {
252
256
  var disabled = this.$props.disabled;
253
257
  return {
254
- 'k-state-default': !disabled,
255
258
  'k-state-disabled': disabled,
256
259
  'k-state-focused': this.$data.isFocused
257
260
  };
@@ -336,6 +339,9 @@ var DatePicker = {
336
339
  var value = this.mergeTime(event.value);
337
340
  this.handleValueChange(value, event);
338
341
  },
342
+ getDateInputText: function getDateInputText() {
343
+ return this._dateInput ? this._dateInput._element.value : '';
344
+ },
339
345
  handleValueChange: function handleValueChange(value, event) {
340
346
  this.$data.currentValue = kendo_date_math_1.cloneDate(value || undefined);
341
347
  this.$data.currentShow = false;
@@ -369,6 +375,7 @@ var DatePicker = {
369
375
 
370
376
  this.$data.shouldFocusDateInput = true;
371
377
  this.setShow(!this.computedShow);
378
+ this.$emit('iconclick', event);
372
379
  },
373
380
  handleIconMouseDown: function handleIconMouseDown(event) {
374
381
  event.stopPropagation();
@@ -487,7 +494,6 @@ var DatePicker = {
487
494
  placeholder: this.$props.placeholder,
488
495
  attrs: this.v3 ? undefined : {
489
496
  placeholder: this.$props.placeholder,
490
- label: this.$props.label,
491
497
  disabled: disabled,
492
498
  format: format,
493
499
  formatPlaceholder: formatPlaceholder,
@@ -503,7 +509,6 @@ var DatePicker = {
503
509
  validityStyles: validityStyles,
504
510
  value: value
505
511
  },
506
- label: this.$props.label,
507
512
  disabled: disabled,
508
513
  format: format,
509
514
  formatPlaceholder: formatPlaceholder,
@@ -621,7 +626,7 @@ var DatePicker = {
621
626
  defaultRendering: popupDefaultRendering,
622
627
  defaultSlots: calendarRendering
623
628
  });
624
- return h("span", {
629
+ var datepicker = h("span", {
625
630
  ref: this.v3 ? function (el) {
626
631
  _this.kendoAnchorRef = el;
627
632
  } : this._anchor,
@@ -641,6 +646,28 @@ var DatePicker = {
641
646
  onFocusin: this.handleFocus,
642
647
  onFocusout: this.handleBlur
643
648
  }, [pickerWrapRendering, popupRendering]);
649
+ return this.$props.label ? // @ts-ignore function children
650
+ h(kendo_vue_labels_1.FloatingLabel, {
651
+ label: this.$props.label,
652
+ attrs: this.v3 ? undefined : {
653
+ label: this.$props.label,
654
+ editorId: id,
655
+ editorValid: isValid,
656
+ editorValue: this.getDateInputText(),
657
+ editorPlaceholder: this.$props.placeholder,
658
+ editorDisabled: this.$props.disabled
659
+ },
660
+ editorId: id,
661
+ editorValid: isValid,
662
+ editorValue: this.getDateInputText(),
663
+ editorPlaceholder: this.$props.placeholder,
664
+ editorDisabled: this.$props.disabled,
665
+ style: {
666
+ width: width
667
+ }
668
+ }, this.v3 ? function () {
669
+ return [datepicker];
670
+ } : [datepicker]) : datepicker;
644
671
  }
645
672
  };
646
673
  exports.DatePicker = DatePicker;
@@ -2,6 +2,7 @@
2
2
  * @hidden
3
3
  */
4
4
  export interface DatePickerComputed {
5
+ [key: string]: any;
5
6
  computedValue: Date | null;
6
7
  computedShow: boolean;
7
8
  wrapperClassNames: object;
@@ -5,6 +5,7 @@ import { DatePickerState } from './DatePickerState';
5
5
  * @hidden
6
6
  */
7
7
  export interface DatePickerMethods {
8
+ [key: string]: any;
8
9
  emitBlur?: (_: any) => void;
9
10
  validity: () => FormComponentValidity;
10
11
  nextValue: (nextProps: DatePickerProps, nextState: DatePickerState) => any;
@@ -18,6 +19,7 @@ export interface DatePickerMethods {
18
19
  handleBlur: (event: any) => void;
19
20
  calendarFocus: (event: any) => void;
20
21
  calendarBlur: (event: any) => void;
22
+ getDateInputText: () => string;
21
23
  createBlurTimeout: () => void;
22
24
  handleIconClick: () => void;
23
25
  handleIconMouseDown: (event: any) => void;
@@ -17,6 +17,14 @@ export interface DatePickerProps extends DatePickerSettings, FormComponentProps
17
17
  * Fires each time the user selects a new value ([see example]({% slug controlled_datepicker_native %}#toc-controlling-the-date-value)).
18
18
  */
19
19
  change?: (event: DatePickerChangeEvent) => void;
20
+ /**
21
+ * Fires when the icon element is clicked.
22
+ */
23
+ iconclick?: (event: any) => void;
24
+ /**
25
+ * Renders a floating label for the DatePicker.
26
+ */
27
+ label?: string;
20
28
  /**
21
29
  * Specifies the value of the placeholder.
22
30
  */