@progress/kendo-vue-dateinputs 2.5.0-dev.202109140519 → 2.5.1-dev.202110051346
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/dist/cdn/js/kendo-vue-dateinputs.js +1 -1
- package/dist/es/calendar/components/CalendarCell.d.ts +1 -0
- package/dist/es/calendar/components/CalendarHeaderTitle.d.ts +1 -0
- package/dist/es/calendar/components/Header.d.ts +2 -0
- package/dist/es/calendar/components/View.d.ts +2 -0
- package/dist/es/calendar/components/ViewList.d.ts +2 -0
- package/dist/es/calendar/components/ViewList.js +1 -1
- package/dist/es/calendar/components/interfaces/CalendarComputed.d.ts +1 -0
- package/dist/es/calendar/components/interfaces/CalendarMethods.d.ts +1 -0
- package/dist/es/dateinput/DateInput.js +31 -25
- package/dist/es/dateinput/interfaces/DateInputComputed.d.ts +2 -1
- package/dist/es/dateinput/interfaces/DateInputData.d.ts +1 -0
- package/dist/es/dateinput/interfaces/DateInputMethods.d.ts +1 -0
- package/dist/es/datepicker/DatePicker.js +29 -4
- package/dist/es/datepicker/interfaces/DatePickerComputed.d.ts +1 -0
- package/dist/es/datepicker/interfaces/DatePickerMethods.d.ts +2 -0
- package/dist/es/datepicker/interfaces/DatePickerProps.d.ts +4 -0
- package/dist/es/datetimepicker/DateTimePicker.d.ts +5 -0
- package/dist/es/datetimepicker/DateTimePicker.js +38 -11
- package/dist/es/datetimepicker/DateTimeSelector.d.ts +2 -0
- package/dist/es/datetimepicker/models/DateTimePickerSettings.d.ts +9 -0
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.d.ts +2 -0
- package/dist/es/timepicker/TimePart.d.ts +2 -0
- package/dist/es/timepicker/TimePicker.d.ts +5 -0
- package/dist/es/timepicker/TimePicker.js +44 -15
- package/dist/es/timepicker/TimeSelector.d.ts +2 -0
- package/dist/es/timepicker/models/TimePickerSettings.d.ts +8 -0
- package/dist/es/virtualization/Virtualization.d.ts +2 -0
- package/dist/npm/calendar/components/CalendarCell.d.ts +1 -0
- package/dist/npm/calendar/components/CalendarHeaderTitle.d.ts +1 -0
- package/dist/npm/calendar/components/Header.d.ts +2 -0
- package/dist/npm/calendar/components/View.d.ts +2 -0
- package/dist/npm/calendar/components/ViewList.d.ts +2 -0
- package/dist/npm/calendar/components/ViewList.js +1 -1
- package/dist/npm/calendar/components/interfaces/CalendarComputed.d.ts +1 -0
- package/dist/npm/calendar/components/interfaces/CalendarMethods.d.ts +1 -0
- package/dist/npm/dateinput/DateInput.js +31 -24
- package/dist/npm/dateinput/interfaces/DateInputComputed.d.ts +2 -1
- package/dist/npm/dateinput/interfaces/DateInputData.d.ts +1 -0
- package/dist/npm/dateinput/interfaces/DateInputMethods.d.ts +1 -0
- package/dist/npm/datepicker/DatePicker.js +30 -4
- package/dist/npm/datepicker/interfaces/DatePickerComputed.d.ts +1 -0
- package/dist/npm/datepicker/interfaces/DatePickerMethods.d.ts +2 -0
- package/dist/npm/datepicker/interfaces/DatePickerProps.d.ts +4 -0
- package/dist/npm/datetimepicker/DateTimePicker.d.ts +5 -0
- package/dist/npm/datetimepicker/DateTimePicker.js +39 -11
- package/dist/npm/datetimepicker/DateTimeSelector.d.ts +2 -0
- package/dist/npm/datetimepicker/models/DateTimePickerSettings.d.ts +9 -0
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.d.ts +2 -0
- package/dist/npm/timepicker/TimePart.d.ts +2 -0
- package/dist/npm/timepicker/TimePicker.d.ts +5 -0
- package/dist/npm/timepicker/TimePicker.js +45 -15
- package/dist/npm/timepicker/TimeSelector.d.ts +2 -0
- package/dist/npm/timepicker/models/TimePickerSettings.d.ts +8 -0
- package/dist/npm/virtualization/Virtualization.d.ts +2 -0
- package/package.json +7 -6
|
@@ -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';
|
|
@@ -110,6 +111,8 @@ var TimePicker = {
|
|
|
110
111
|
}
|
|
111
112
|
},
|
|
112
113
|
name: String,
|
|
114
|
+
label: String,
|
|
115
|
+
placeholder: String,
|
|
113
116
|
popupSettings: {
|
|
114
117
|
type: Object,
|
|
115
118
|
default: function _default() {
|
|
@@ -183,7 +186,8 @@ var TimePicker = {
|
|
|
183
186
|
currentValue: null,
|
|
184
187
|
currentShow: false,
|
|
185
188
|
valueDuringOnChange: undefined,
|
|
186
|
-
showDuringOnChange: undefined
|
|
189
|
+
showDuringOnChange: undefined,
|
|
190
|
+
isFocused: false
|
|
187
191
|
};
|
|
188
192
|
},
|
|
189
193
|
computed: {
|
|
@@ -212,7 +216,7 @@ var TimePicker = {
|
|
|
212
216
|
this.$forceUpdate();
|
|
213
217
|
}
|
|
214
218
|
|
|
215
|
-
this._dateInput = this.$refs.dateInput;
|
|
219
|
+
this._dateInput = this.v3 ? this.dateInputRef : this.$refs.dateInput;
|
|
216
220
|
this._timeSelector = this.$refs.timeSelector;
|
|
217
221
|
this._wrapper = this.$refs[this._anchor];
|
|
218
222
|
|
|
@@ -223,7 +227,7 @@ var TimePicker = {
|
|
|
223
227
|
}
|
|
224
228
|
},
|
|
225
229
|
updated: function updated() {
|
|
226
|
-
this._dateInput = this.$refs.dateInput;
|
|
230
|
+
this._dateInput = this.v3 ? this.dateInputRef : this.$refs.dateInput;
|
|
227
231
|
this._timeSelector = this.$refs.timeSelector;
|
|
228
232
|
this._wrapper = this.$refs[this._anchor];
|
|
229
233
|
|
|
@@ -262,6 +266,7 @@ var TimePicker = {
|
|
|
262
266
|
tabIndex = _a.tabIndex,
|
|
263
267
|
title = _a.title,
|
|
264
268
|
id = _a.id,
|
|
269
|
+
placeholder = _a.placeholder,
|
|
265
270
|
format = _a.format,
|
|
266
271
|
formatPlaceholder = _a.formatPlaceholder,
|
|
267
272
|
smoothScroll = _a.smoothScroll,
|
|
@@ -284,7 +289,8 @@ var TimePicker = {
|
|
|
284
289
|
var wrapperClassNames = classNames('k-picker-wrap', {
|
|
285
290
|
'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:
|
|
297
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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);
|
|
@@ -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,6 +57,14 @@ 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
|
*/
|
|
@@ -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
|
/**
|
|
@@ -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-
|
|
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,
|
|
@@ -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
|
-
|
|
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-
|
|
185
|
-
'k-state-
|
|
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.
|
|
222
|
+
this.$data.isFocused = true;
|
|
220
223
|
this.$emit('focus', e);
|
|
221
224
|
},
|
|
222
225
|
handleBlur: function handleBlur(e) {
|
|
223
|
-
this.$data.
|
|
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.
|
|
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":
|
|
582
|
+
"class": wrapperClassesInstance.join(' ')
|
|
580
583
|
}, [h("span", {
|
|
581
|
-
"class":
|
|
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 ?
|
|
675
|
-
|
|
676
|
-
|
|
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
|
-
|
|
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
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
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;
|
|
@@ -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");
|
|
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 = {
|
|
@@ -90,6 +92,7 @@ var DatePicker = {
|
|
|
90
92
|
return undefined;
|
|
91
93
|
}
|
|
92
94
|
},
|
|
95
|
+
label: String,
|
|
93
96
|
placeholder: String,
|
|
94
97
|
popup: {
|
|
95
98
|
type: [String, Object, Function],
|
|
@@ -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;
|
|
@@ -487,7 +493,6 @@ var DatePicker = {
|
|
|
487
493
|
placeholder: this.$props.placeholder,
|
|
488
494
|
attrs: this.v3 ? undefined : {
|
|
489
495
|
placeholder: this.$props.placeholder,
|
|
490
|
-
label: this.$props.label,
|
|
491
496
|
disabled: disabled,
|
|
492
497
|
format: format,
|
|
493
498
|
formatPlaceholder: formatPlaceholder,
|
|
@@ -503,7 +508,6 @@ var DatePicker = {
|
|
|
503
508
|
validityStyles: validityStyles,
|
|
504
509
|
value: value
|
|
505
510
|
},
|
|
506
|
-
label: this.$props.label,
|
|
507
511
|
disabled: disabled,
|
|
508
512
|
format: format,
|
|
509
513
|
formatPlaceholder: formatPlaceholder,
|
|
@@ -621,7 +625,7 @@ var DatePicker = {
|
|
|
621
625
|
defaultRendering: popupDefaultRendering,
|
|
622
626
|
defaultSlots: calendarRendering
|
|
623
627
|
});
|
|
624
|
-
|
|
628
|
+
var datepicker = h("span", {
|
|
625
629
|
ref: this.v3 ? function (el) {
|
|
626
630
|
_this.kendoAnchorRef = el;
|
|
627
631
|
} : this._anchor,
|
|
@@ -641,6 +645,28 @@ var DatePicker = {
|
|
|
641
645
|
onFocusin: this.handleFocus,
|
|
642
646
|
onFocusout: this.handleBlur
|
|
643
647
|
}, [pickerWrapRendering, popupRendering]);
|
|
648
|
+
return this.$props.label ? // @ts-ignore function children
|
|
649
|
+
h(kendo_vue_labels_1.FloatingLabel, {
|
|
650
|
+
label: this.$props.label,
|
|
651
|
+
attrs: this.v3 ? undefined : {
|
|
652
|
+
label: this.$props.label,
|
|
653
|
+
editorId: id,
|
|
654
|
+
editorValid: isValid,
|
|
655
|
+
editorValue: this.getDateInputText(),
|
|
656
|
+
editorPlaceholder: this.$props.placeholder,
|
|
657
|
+
editorDisabled: this.$props.disabled
|
|
658
|
+
},
|
|
659
|
+
editorId: id,
|
|
660
|
+
editorValid: isValid,
|
|
661
|
+
editorValue: this.getDateInputText(),
|
|
662
|
+
editorPlaceholder: this.$props.placeholder,
|
|
663
|
+
editorDisabled: this.$props.disabled,
|
|
664
|
+
style: {
|
|
665
|
+
width: width
|
|
666
|
+
}
|
|
667
|
+
}, this.v3 ? function () {
|
|
668
|
+
return [datepicker];
|
|
669
|
+
} : [datepicker]) : datepicker;
|
|
644
670
|
}
|
|
645
671
|
};
|
|
646
672
|
exports.DatePicker = DatePicker;
|
|
@@ -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,10 @@ 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
|
+
* Renders a floating label for the DatePicker.
|
|
22
|
+
*/
|
|
23
|
+
label?: string;
|
|
20
24
|
/**
|
|
21
25
|
* Specifies the value of the placeholder.
|
|
22
26
|
*/
|
|
@@ -51,6 +51,7 @@ export interface DateTimePickerData {
|
|
|
51
51
|
valueDuringOnChange?: Date | null;
|
|
52
52
|
showDuringOnChange?: boolean;
|
|
53
53
|
shouldFocusDateInput: boolean;
|
|
54
|
+
isFocused: boolean;
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* @hidden
|
|
@@ -59,6 +60,7 @@ export interface DateTimePickerState {
|
|
|
59
60
|
_popupId: string;
|
|
60
61
|
_wrapper: any;
|
|
61
62
|
_dateInput: any;
|
|
63
|
+
dateInputRef: any;
|
|
62
64
|
_dateTimeSelector: any;
|
|
63
65
|
_anchor: any;
|
|
64
66
|
_oldShow: boolean;
|
|
@@ -70,6 +72,7 @@ export interface DateTimePickerState {
|
|
|
70
72
|
* @hidden
|
|
71
73
|
*/
|
|
72
74
|
export interface DateTimePickerComputed {
|
|
75
|
+
[key: string]: any;
|
|
73
76
|
computedValue: Date | null;
|
|
74
77
|
computedShow: boolean;
|
|
75
78
|
}
|
|
@@ -77,6 +80,7 @@ export interface DateTimePickerComputed {
|
|
|
77
80
|
* @hidden
|
|
78
81
|
*/
|
|
79
82
|
export interface DateTimePickerMethods {
|
|
83
|
+
[key: string]: any;
|
|
80
84
|
validity: () => FormComponentValidity;
|
|
81
85
|
focus: () => void;
|
|
82
86
|
setShow: (show: boolean) => void;
|
|
@@ -91,6 +95,7 @@ export interface DateTimePickerMethods {
|
|
|
91
95
|
timeSelectorBlur: (event: any) => void;
|
|
92
96
|
timeSelectorFocus: () => void;
|
|
93
97
|
createBlurTimeout: () => void;
|
|
98
|
+
getDateInputText: () => string;
|
|
94
99
|
}
|
|
95
100
|
/**
|
|
96
101
|
* @hidden
|