@progress/kendo-vue-dateinputs 3.6.4 → 3.7.0-dev.202210250731
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/Calendar.js +17 -48
- package/dist/es/calendar/components/CalendarCell.js +16 -25
- package/dist/es/calendar/components/CalendarHeaderTitle.js +2 -4
- package/dist/es/calendar/components/CalendarWeekCell.js +0 -3
- package/dist/es/calendar/components/Header.js +6 -17
- package/dist/es/calendar/components/View.js +8 -19
- package/dist/es/calendar/components/ViewList.js +11 -14
- package/dist/es/common/PickerWrap.js +0 -2
- package/dist/es/dateinput/DateInput.js +33 -78
- package/dist/es/datepicker/DatePicker.js +32 -42
- package/dist/es/datepicker/ToggleButton.js +0 -2
- package/dist/es/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/es/daterangepicker/DateRangePicker.js +10 -43
- package/dist/es/datetimepicker/DateTimePicker.js +39 -53
- package/dist/es/datetimepicker/DateTimeSelector.js +25 -36
- package/dist/es/package-metadata.js +1 -1
- package/dist/es/timepicker/TimeList.js +16 -46
- package/dist/es/timepicker/TimePart.js +7 -23
- package/dist/es/timepicker/TimePicker.js +37 -53
- package/dist/es/timepicker/TimeSelector.js +16 -23
- package/dist/es/virtualization/Virtualization.js +4 -36
- package/dist/esm/calendar/components/Calendar.js +17 -48
- package/dist/esm/calendar/components/CalendarCell.js +16 -25
- package/dist/esm/calendar/components/CalendarHeaderTitle.js +2 -4
- package/dist/esm/calendar/components/CalendarWeekCell.js +0 -3
- package/dist/esm/calendar/components/Header.js +6 -17
- package/dist/esm/calendar/components/View.js +8 -19
- package/dist/esm/calendar/components/ViewList.js +11 -14
- package/dist/esm/common/PickerWrap.js +0 -2
- package/dist/esm/dateinput/DateInput.js +33 -78
- package/dist/esm/datepicker/DatePicker.js +32 -42
- package/dist/esm/datepicker/ToggleButton.js +0 -2
- package/dist/esm/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/esm/daterangepicker/DateRangePicker.js +10 -43
- package/dist/esm/datetimepicker/DateTimePicker.js +39 -53
- package/dist/esm/datetimepicker/DateTimeSelector.js +25 -36
- package/dist/esm/package-metadata.js +1 -1
- package/dist/esm/timepicker/TimeList.js +16 -46
- package/dist/esm/timepicker/TimePart.js +7 -23
- package/dist/esm/timepicker/TimePicker.js +37 -53
- package/dist/esm/timepicker/TimeSelector.js +16 -23
- package/dist/esm/virtualization/Virtualization.js +4 -36
- package/dist/npm/calendar/components/Calendar.js +17 -62
- package/dist/npm/calendar/components/CalendarCell.js +18 -30
- package/dist/npm/calendar/components/CalendarHeaderTitle.js +4 -10
- package/dist/npm/calendar/components/CalendarWeekCell.js +2 -8
- package/dist/npm/calendar/components/Header.js +8 -30
- package/dist/npm/calendar/components/View.js +10 -31
- package/dist/npm/calendar/components/ViewList.js +13 -25
- package/dist/npm/common/PickerWrap.js +2 -7
- package/dist/npm/dateinput/DateInput.js +35 -94
- package/dist/npm/datepicker/DatePicker.js +34 -58
- package/dist/npm/datepicker/ToggleButton.js +0 -4
- package/dist/npm/datepicker/models/DatePickerSettings.js +2 -1
- package/dist/npm/daterangepicker/DateRangePicker.js +10 -56
- package/dist/npm/datetimepicker/DateTimePicker.js +41 -71
- package/dist/npm/datetimepicker/DateTimeSelector.js +27 -50
- package/dist/npm/package-metadata.js +1 -1
- package/dist/npm/timepicker/TimeList.js +16 -55
- package/dist/npm/timepicker/TimePart.js +9 -36
- package/dist/npm/timepicker/TimePicker.js +37 -67
- package/dist/npm/timepicker/TimeSelector.js +18 -35
- package/dist/npm/virtualization/Virtualization.js +4 -40
- package/package.json +7 -7
|
@@ -15,9 +15,7 @@ import { TimePart } from './TimePart';
|
|
|
15
15
|
/**
|
|
16
16
|
* @hidden
|
|
17
17
|
*/
|
|
18
|
-
|
|
19
18
|
export var Direction;
|
|
20
|
-
|
|
21
19
|
(function (Direction) {
|
|
22
20
|
Direction[Direction["Left"] = 0] = "Left";
|
|
23
21
|
Direction[Direction["Right"] = 1] = "Right";
|
|
@@ -25,8 +23,6 @@ export var Direction;
|
|
|
25
23
|
/**
|
|
26
24
|
* @hidden
|
|
27
25
|
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
26
|
var TimeSelectorVue2 = {
|
|
31
27
|
name: 'KendoTimeSelector',
|
|
32
28
|
// @ts-ignore
|
|
@@ -139,16 +135,16 @@ var TimeSelectorVue2 = {
|
|
|
139
135
|
render: function render(createElement) {
|
|
140
136
|
var h = gh || createElement;
|
|
141
137
|
var _a = this.$props,
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
138
|
+
format = _a.format,
|
|
139
|
+
cancelButton = _a.cancelButton,
|
|
140
|
+
disabled = _a.disabled,
|
|
141
|
+
tabIndex = _a.tabIndex,
|
|
142
|
+
smoothScroll = _a.smoothScroll,
|
|
143
|
+
min = _a.min,
|
|
144
|
+
max = _a.max,
|
|
145
|
+
boundRange = _a.boundRange,
|
|
146
|
+
nowButton = _a.nowButton,
|
|
147
|
+
steps = _a.steps;
|
|
152
148
|
var localizationService = provideLocalizationService(this);
|
|
153
149
|
var cancelMessage = localizationService.toLanguageString(timePickerCancel, messages[timePickerCancel]);
|
|
154
150
|
var setMessage = localizationService.toLanguageString(timePickerSet, messages[timePickerSet]);
|
|
@@ -164,7 +160,8 @@ var TimeSelectorVue2 = {
|
|
|
164
160
|
on: this.v3 ? undefined : {
|
|
165
161
|
"keydown": this.handleKeyDown
|
|
166
162
|
}
|
|
167
|
-
}, [
|
|
163
|
+
}, [
|
|
164
|
+
// @ts-ignore function children
|
|
168
165
|
h(TimePart, {
|
|
169
166
|
ref: 'timePart',
|
|
170
167
|
value: this.current,
|
|
@@ -199,7 +196,8 @@ var TimeSelectorVue2 = {
|
|
|
199
196
|
steps: steps
|
|
200
197
|
}), h("div", {
|
|
201
198
|
"class": "k-time-footer k-actions k-actions-stretched"
|
|
202
|
-
}, [cancelButton &&
|
|
199
|
+
}, [cancelButton &&
|
|
200
|
+
// @ts-ignore function children
|
|
203
201
|
h(Button, {
|
|
204
202
|
type: "button",
|
|
205
203
|
attrs: this.v3 ? undefined : {
|
|
@@ -217,7 +215,8 @@ var TimeSelectorVue2 = {
|
|
|
217
215
|
"aria-label": cancelMessage
|
|
218
216
|
}, this.v3 ? function () {
|
|
219
217
|
return [cancelMessage];
|
|
220
|
-
} : [cancelMessage]),
|
|
218
|
+
} : [cancelMessage]),
|
|
219
|
+
// @ts-ignore function children
|
|
221
220
|
h(Button, {
|
|
222
221
|
type: "button",
|
|
223
222
|
attrs: this.v3 ? undefined : {
|
|
@@ -250,7 +249,6 @@ var TimeSelectorVue2 = {
|
|
|
250
249
|
if (!this.timePart) {
|
|
251
250
|
return;
|
|
252
251
|
}
|
|
253
|
-
|
|
254
252
|
this.timePart.focus({
|
|
255
253
|
preventScroll: true
|
|
256
254
|
});
|
|
@@ -259,21 +257,17 @@ var TimeSelectorVue2 = {
|
|
|
259
257
|
if (!this._acceptButton) {
|
|
260
258
|
return false;
|
|
261
259
|
}
|
|
262
|
-
|
|
263
260
|
return canUseDOM && (document.activeElement === this._acceptButton.$el || document.activeElement === this._cancelButton.$el);
|
|
264
261
|
},
|
|
265
262
|
handleKeyDown: function handleKeyDown(event) {
|
|
266
263
|
var keyCode = event.keyCode;
|
|
267
264
|
this.$emit('keydown', event);
|
|
268
|
-
|
|
269
265
|
switch (keyCode) {
|
|
270
266
|
case Keys.enter:
|
|
271
267
|
if (!this.hasActiveButton()) {
|
|
272
268
|
this.handleAccept(event);
|
|
273
269
|
}
|
|
274
|
-
|
|
275
270
|
return;
|
|
276
|
-
|
|
277
271
|
default:
|
|
278
272
|
return;
|
|
279
273
|
}
|
|
@@ -313,6 +307,5 @@ var TimeSelectorVue2 = {
|
|
|
313
307
|
/**
|
|
314
308
|
* @hidden
|
|
315
309
|
*/
|
|
316
|
-
|
|
317
310
|
var TimeSelector = TimeSelectorVue2;
|
|
318
311
|
export { TimeSelector, TimeSelectorVue2 };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
var _a, _b, _c;
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var _a, _b, _c;
|
|
2
|
+
// @ts-ignore
|
|
4
3
|
import * as Vue from 'vue';
|
|
5
4
|
var allVue = Vue;
|
|
6
5
|
var gh = allVue.h;
|
|
@@ -10,18 +9,14 @@ import { RowHeightService, ScrollerService } from './services/main';
|
|
|
10
9
|
/**
|
|
11
10
|
* @hidden
|
|
12
11
|
*/
|
|
13
|
-
|
|
14
12
|
export var ScrollDirection;
|
|
15
|
-
|
|
16
13
|
(function (ScrollDirection) {
|
|
17
14
|
ScrollDirection[ScrollDirection["Backward"] = 0] = "Backward";
|
|
18
15
|
ScrollDirection[ScrollDirection["Forward"] = 1] = "Forward";
|
|
19
16
|
})(ScrollDirection || (ScrollDirection = {}));
|
|
20
|
-
|
|
21
17
|
var differenceToScroll = function differenceToScroll(scrollTop, staticOffset, maxScrollDifference) {
|
|
22
18
|
return Math.min(Math.abs(staticOffset - scrollTop), maxScrollDifference);
|
|
23
19
|
};
|
|
24
|
-
|
|
25
20
|
var FRAME_DURATION = 17;
|
|
26
21
|
var scrollModifiers = (_a = {}, _a[ScrollDirection.Forward] = function (step) {
|
|
27
22
|
return function (value) {
|
|
@@ -53,7 +48,6 @@ var scrollValidators = (_c = {}, _c[ScrollDirection.Forward] = function (end) {
|
|
|
53
48
|
/**
|
|
54
49
|
* @hidden
|
|
55
50
|
*/
|
|
56
|
-
|
|
57
51
|
var VirtualizationVue2 = {
|
|
58
52
|
name: 'Virtualization',
|
|
59
53
|
// @ts-ignore
|
|
@@ -139,21 +133,18 @@ var VirtualizationVue2 = {
|
|
|
139
133
|
if (!this.rowHeightService) {
|
|
140
134
|
return 0;
|
|
141
135
|
}
|
|
142
|
-
|
|
143
136
|
return this.rowHeightService.index(offset);
|
|
144
137
|
},
|
|
145
138
|
itemOffset: function itemOffset(index) {
|
|
146
139
|
if (!this.rowHeightService) {
|
|
147
140
|
return 0;
|
|
148
141
|
}
|
|
149
|
-
|
|
150
142
|
return this.rowHeightService.offset(index);
|
|
151
143
|
},
|
|
152
144
|
isIndexVisible: function isIndexVisible(index) {
|
|
153
145
|
if (!this.rowHeightService) {
|
|
154
146
|
return false;
|
|
155
147
|
}
|
|
156
|
-
|
|
157
148
|
var containerTop = this.containerScrollPosition();
|
|
158
149
|
var containerBottom = containerTop + this.containerOffsetSize();
|
|
159
150
|
var top = this.rowHeightService.offset(index);
|
|
@@ -164,61 +155,48 @@ var VirtualizationVue2 = {
|
|
|
164
155
|
if (!this.rowHeightService) {
|
|
165
156
|
return false;
|
|
166
157
|
}
|
|
167
|
-
|
|
168
158
|
return this.containerScrollPosition() !== this.rowHeightService.offset(index);
|
|
169
159
|
},
|
|
170
160
|
scrollTo: function scrollTo(value) {
|
|
171
161
|
var scrollProperty = this.$props.direction === 'vertical' ? 'scrollTop' : 'scrollLeft';
|
|
172
|
-
|
|
173
162
|
if (!this.scrollContainer) {
|
|
174
163
|
return;
|
|
175
164
|
}
|
|
176
|
-
|
|
177
165
|
this.scrollContainer[scrollProperty] = value;
|
|
178
166
|
},
|
|
179
167
|
scrollToIndex: function scrollToIndex(index) {
|
|
180
168
|
if (!this.rowHeightService) {
|
|
181
169
|
return;
|
|
182
170
|
}
|
|
183
|
-
|
|
184
171
|
this.animationInProgress = false;
|
|
185
172
|
this.scrollTo(this.rowHeightService.offset(index));
|
|
186
173
|
},
|
|
187
174
|
animateToIndex: function animateToIndex(index) {
|
|
188
175
|
var _this = this;
|
|
189
|
-
|
|
190
176
|
if (!this.rowHeightService || !window) {
|
|
191
177
|
return;
|
|
192
178
|
}
|
|
193
|
-
|
|
194
179
|
window.cancelAnimationFrame(this.cancelAnimation);
|
|
195
180
|
var indexOffset = this.rowHeightService.offset(index);
|
|
196
181
|
var direction = this.getContainerScrollDirection(indexOffset);
|
|
197
|
-
|
|
198
182
|
var _a = this.scrollRange(indexOffset, direction),
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
183
|
+
start = _a.start,
|
|
184
|
+
end = _a.end;
|
|
202
185
|
if (start === end) {
|
|
203
186
|
return;
|
|
204
187
|
}
|
|
205
|
-
|
|
206
188
|
var step = this.scrollStep(start, end);
|
|
207
189
|
var modifyScroll = scrollModifiers[direction](step);
|
|
208
190
|
var normalizeScroll = scrollNormalizers[direction](end);
|
|
209
191
|
var isScrollValid = scrollValidators[direction](modifyScroll(end));
|
|
210
|
-
|
|
211
192
|
var animate = function animate(progress) {
|
|
212
193
|
_this.animationInProgress = true;
|
|
213
194
|
var next = modifyScroll(progress);
|
|
214
|
-
|
|
215
195
|
_this.scrollTo(normalizeScroll(next));
|
|
216
|
-
|
|
217
196
|
isScrollValid(next) ? _this.cancelAnimation = window.requestAnimationFrame(function () {
|
|
218
197
|
animate(next);
|
|
219
198
|
}) : _this.animationInProgress = false;
|
|
220
199
|
};
|
|
221
|
-
|
|
222
200
|
this.cancelAnimation = window.requestAnimationFrame(function () {
|
|
223
201
|
animate(start);
|
|
224
202
|
});
|
|
@@ -227,7 +205,6 @@ var VirtualizationVue2 = {
|
|
|
227
205
|
if (!this.rowHeightService) {
|
|
228
206
|
return;
|
|
229
207
|
}
|
|
230
|
-
|
|
231
208
|
this.scrollTo(this.rowHeightService.totalHeight() + this.$props.bottomOffset);
|
|
232
209
|
},
|
|
233
210
|
scrollStep: function scrollStep(start, end) {
|
|
@@ -236,14 +213,12 @@ var VirtualizationVue2 = {
|
|
|
236
213
|
},
|
|
237
214
|
scrollRange: function scrollRange(indexOffset, direction) {
|
|
238
215
|
var containerScroll = this.containerScrollPosition();
|
|
239
|
-
|
|
240
216
|
if (parseInt("".concat(indexOffset), 10) === parseInt("".concat(containerScroll), 10)) {
|
|
241
217
|
return {
|
|
242
218
|
start: indexOffset,
|
|
243
219
|
end: indexOffset
|
|
244
220
|
};
|
|
245
221
|
}
|
|
246
|
-
|
|
247
222
|
var maxScroll = this.containerMaxScroll();
|
|
248
223
|
var sign = direction === ScrollDirection.Backward ? 1 : -1;
|
|
249
224
|
var difference = differenceToScroll(containerScroll, indexOffset, this.$props.maxScrollDifference);
|
|
@@ -263,11 +238,9 @@ var VirtualizationVue2 = {
|
|
|
263
238
|
initServices: function initServices(newProps) {
|
|
264
239
|
var props = newProps || this.$props;
|
|
265
240
|
var dimension = props.direction === 'vertical' ? props.itemHeight : props.itemWidth;
|
|
266
|
-
|
|
267
241
|
if (dimension === undefined) {
|
|
268
242
|
return;
|
|
269
243
|
}
|
|
270
|
-
|
|
271
244
|
this.rowHeightService = new RowHeightService(props.total, dimension, 0);
|
|
272
245
|
this.scrollerService.create(this.rowHeightService, props.skip, props.take, props.total, props.topOffset, this.$props.scrollOffsetSize, this.$props.direction);
|
|
273
246
|
},
|
|
@@ -275,14 +248,12 @@ var VirtualizationVue2 = {
|
|
|
275
248
|
if (!this.scrollContainer) {
|
|
276
249
|
return 0;
|
|
277
250
|
}
|
|
278
|
-
|
|
279
251
|
return this.scrollContainer[propertyName];
|
|
280
252
|
},
|
|
281
253
|
handleScroll: function handleScroll(event) {
|
|
282
254
|
if (!this.scrollContainer || !this.rowHeightService) {
|
|
283
255
|
return;
|
|
284
256
|
}
|
|
285
|
-
|
|
286
257
|
var target = event.target;
|
|
287
258
|
this.scrollerService.onScroll({
|
|
288
259
|
scrollLeft: target.scrollLeft,
|
|
@@ -320,14 +291,12 @@ var VirtualizationVue2 = {
|
|
|
320
291
|
render: function render(createElement) {
|
|
321
292
|
var h = gh || createElement;
|
|
322
293
|
var defaultSlot = getDefaultSlots(this);
|
|
323
|
-
|
|
324
294
|
if (this.lastTotal !== this.$props.total || this.lastDirection !== this.$props.direction || this.lastTake !== this.$props.take) {
|
|
325
295
|
this.initServices();
|
|
326
296
|
this.lastTotal = this.$props.total;
|
|
327
297
|
this.lastDirection = this.$props.direction;
|
|
328
298
|
this.lastTake = this.$props.take;
|
|
329
299
|
}
|
|
330
|
-
|
|
331
300
|
var vertexLength = "".concat((this.rowHeightService ? this.rowHeightService.totalHeight() : 0) + this.$props.bottomOffset);
|
|
332
301
|
var placeholderStyle = this.$props.direction === 'vertical' ? {
|
|
333
302
|
height: "".concat(vertexLength, "px")
|
|
@@ -362,6 +331,5 @@ var VirtualizationVue2 = {
|
|
|
362
331
|
/**
|
|
363
332
|
* @hidden
|
|
364
333
|
*/
|
|
365
|
-
|
|
366
334
|
var Virtualization = VirtualizationVue2;
|
|
367
335
|
export { Virtualization, VirtualizationVue2 };
|
|
@@ -18,7 +18,6 @@ import { calculateValue, extractDateFromValue, extractMultipleFromValue, extract
|
|
|
18
18
|
/**
|
|
19
19
|
* @hidden
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
21
|
var CalendarVue2 = {
|
|
23
22
|
name: 'KendoCalendar',
|
|
24
23
|
inject: {
|
|
@@ -159,7 +158,6 @@ var CalendarVue2 = {
|
|
|
159
158
|
this._lastView = this.$props.activeView || this.$data.currentActiveView;
|
|
160
159
|
this._lastViewsCount = this.$props.views;
|
|
161
160
|
this._oldValue = this.computedValue();
|
|
162
|
-
|
|
163
161
|
if (!this.calendarViewList) {
|
|
164
162
|
this.calendarViewList = this.v3 ? this.calendarViewListRef : this.$refs.calendarViewList;
|
|
165
163
|
}
|
|
@@ -184,9 +182,9 @@ var CalendarVue2 = {
|
|
|
184
182
|
computedValue: function computedValue() {
|
|
185
183
|
return this.$data.valueDuringOnChange !== undefined ? this.$data.valueDuringOnChange : this.$props.value !== undefined ? this.$props.value : this.$props.modelValue !== undefined ? this.$props.modelValue : this.$data.currentValue;
|
|
186
184
|
},
|
|
187
|
-
focus: function focus(
|
|
185
|
+
focus: function focus() {
|
|
188
186
|
if (this.calendarViewList) {
|
|
189
|
-
this.calendarViewList.$el.firstElementChild.focus(
|
|
187
|
+
this.calendarViewList.$el.firstElementChild.focus();
|
|
190
188
|
}
|
|
191
189
|
},
|
|
192
190
|
handleBlur: function handleBlur() {
|
|
@@ -205,7 +203,6 @@ var CalendarVue2 = {
|
|
|
205
203
|
if (this.$props.disabled) {
|
|
206
204
|
return;
|
|
207
205
|
}
|
|
208
|
-
|
|
209
206
|
this.$data.didNavigationChange = true;
|
|
210
207
|
var focusedDate = cloneDate(event.value);
|
|
211
208
|
this.$data.currentFocusedDate = focusedDate;
|
|
@@ -219,11 +216,9 @@ var CalendarVue2 = {
|
|
|
219
216
|
handlePrevClick: function handlePrevClick(event) {
|
|
220
217
|
var focusedDate = cloneDate(event.value);
|
|
221
218
|
this.focus();
|
|
222
|
-
|
|
223
219
|
if (this.$props.disabled) {
|
|
224
220
|
return;
|
|
225
221
|
}
|
|
226
|
-
|
|
227
222
|
this.$data.currentFocusedDate = focusedDate;
|
|
228
223
|
},
|
|
229
224
|
handleTitleClick: function handleTitleClick() {
|
|
@@ -232,11 +227,9 @@ var CalendarVue2 = {
|
|
|
232
227
|
handleNextClick: function handleNextClick(event) {
|
|
233
228
|
var focusedDate = cloneDate(event.value);
|
|
234
229
|
this.focus();
|
|
235
|
-
|
|
236
230
|
if (this.$props.disabled) {
|
|
237
231
|
return;
|
|
238
232
|
}
|
|
239
|
-
|
|
240
233
|
this.$data.currentFocusedDate = focusedDate;
|
|
241
234
|
},
|
|
242
235
|
handleCellEnter: function handleCellEnter(value) {
|
|
@@ -246,16 +239,14 @@ var CalendarVue2 = {
|
|
|
246
239
|
},
|
|
247
240
|
generateRange: function generateRange(candidate, value) {
|
|
248
241
|
var end = value.end,
|
|
249
|
-
|
|
242
|
+
start = value.start;
|
|
250
243
|
var shouldSwap = value.start !== null && candidate.getTime() <= value.start.getTime();
|
|
251
|
-
|
|
252
244
|
if (!this.$props.allowReverse && shouldSwap) {
|
|
253
245
|
return {
|
|
254
246
|
start: candidate,
|
|
255
247
|
end: this._selectedRange.start
|
|
256
248
|
};
|
|
257
249
|
}
|
|
258
|
-
|
|
259
250
|
return this.activeRange !== 'end' ? {
|
|
260
251
|
start: candidate,
|
|
261
252
|
end: end
|
|
@@ -278,35 +269,27 @@ var CalendarVue2 = {
|
|
|
278
269
|
},
|
|
279
270
|
handleDateChange: function handleDateChange(event) {
|
|
280
271
|
var focusedDate = cloneDate(event.value);
|
|
281
|
-
|
|
282
272
|
var canNavigateDown = this._bus.canMoveDown(this.$data.currentActiveView);
|
|
283
|
-
|
|
284
273
|
if (this.$props.disabled) {
|
|
285
274
|
return;
|
|
286
275
|
}
|
|
287
|
-
|
|
288
276
|
if (canNavigateDown) {
|
|
289
277
|
if (event.isTodayClick) {
|
|
290
278
|
this._bus.moveToBottom(this.$data.currentActiveView);
|
|
291
279
|
} else {
|
|
292
280
|
this._bus.moveDown(this.$data.currentActiveView, event.event);
|
|
293
|
-
|
|
294
281
|
this.$data.currentFocusedDate = focusedDate;
|
|
295
282
|
return;
|
|
296
283
|
}
|
|
297
284
|
}
|
|
298
|
-
|
|
299
285
|
var value;
|
|
300
|
-
|
|
301
286
|
switch (this.$props.mode) {
|
|
302
287
|
case 'single':
|
|
303
288
|
value = cloneDate(event.value);
|
|
304
289
|
break;
|
|
305
|
-
|
|
306
290
|
case 'multiple':
|
|
307
291
|
if (Array.isArray(this._selectedMultiple)) {
|
|
308
292
|
var result = this._selectedMultiple.slice();
|
|
309
|
-
|
|
310
293
|
var index_1 = -1;
|
|
311
294
|
result.forEach(function (date, idx) {
|
|
312
295
|
if (isEqualDate(date, event.value)) {
|
|
@@ -322,20 +305,16 @@ var CalendarVue2 = {
|
|
|
322
305
|
value = [cloneDate(event.value)];
|
|
323
306
|
}
|
|
324
307
|
}
|
|
325
|
-
|
|
326
308
|
break;
|
|
327
|
-
|
|
328
309
|
case 'range':
|
|
329
310
|
var hasSelection = this._selectedRange.start !== null && this._selectedRange.end !== null && this.activeRange === 'start';
|
|
330
311
|
value = hasSelection ? this.clampRange(event.value) : this.generateRange(event.value, this._selectedRange);
|
|
331
312
|
this.$data.currentActiveRangeEnd = this.activeRange !== 'end' ? 'end' : 'start';
|
|
332
313
|
break;
|
|
333
|
-
|
|
334
314
|
default:
|
|
335
315
|
value = cloneDate(event.value);
|
|
336
316
|
break;
|
|
337
317
|
}
|
|
338
|
-
|
|
339
318
|
this.$data.currentValue = value;
|
|
340
319
|
this.triggerChange(value, event);
|
|
341
320
|
},
|
|
@@ -358,17 +337,14 @@ var CalendarVue2 = {
|
|
|
358
337
|
},
|
|
359
338
|
handleMouseDown: function handleMouseDown(event) {
|
|
360
339
|
var focusedDate = cloneDate(event.value);
|
|
361
|
-
|
|
362
340
|
if (this.$props.disabled || this.$data.currentActiveView !== 0) {
|
|
363
341
|
return;
|
|
364
342
|
}
|
|
365
|
-
|
|
366
343
|
this.$data.currentFocusedDate = focusedDate;
|
|
367
344
|
},
|
|
368
345
|
tableKeyDown: function tableKeyDown(event) {
|
|
369
346
|
var keyCode = event.keyCode;
|
|
370
347
|
this.$emit('keydown', event);
|
|
371
|
-
|
|
372
348
|
if (keyCode === Keys.enter) {
|
|
373
349
|
var args = {
|
|
374
350
|
event: event,
|
|
@@ -383,36 +359,35 @@ var CalendarVue2 = {
|
|
|
383
359
|
this.handleDateChange(args);
|
|
384
360
|
} else {
|
|
385
361
|
var candidate = dateInRange(this._navigation.move(this._focusedDate, this._navigation.action(event), this.$data.currentActiveView, this._service, event), this.currentMin, this.currentMax);
|
|
386
|
-
|
|
387
362
|
if (isEqualDate(this._focusedDate, candidate)) {
|
|
388
363
|
return;
|
|
389
364
|
}
|
|
390
|
-
|
|
391
365
|
this._calculateFocusFromValue = false;
|
|
392
366
|
this.$data.currentFocusedDate = candidate;
|
|
393
367
|
}
|
|
394
|
-
|
|
395
368
|
event.preventDefault();
|
|
396
369
|
},
|
|
397
370
|
isValueEqual: function isValueEqual(newValue, oldValue) {
|
|
398
371
|
if (newValue instanceof Date && oldValue instanceof Date) {
|
|
399
|
-
return isEqualDate(newValue, oldValue);
|
|
372
|
+
return isEqualDate(newValue, oldValue);
|
|
373
|
+
// @ts-ignore
|
|
400
374
|
} else if (newValue instanceof Object && oldValue instanceof Object) {
|
|
401
|
-
if (newValue && oldValue &&
|
|
375
|
+
if (newValue && oldValue &&
|
|
376
|
+
// @ts-ignore
|
|
402
377
|
isEqualDate(newValue.start, oldValue.start) && isEqualDate(newValue.end, oldValue.end)) {
|
|
403
378
|
return true;
|
|
404
379
|
} else {
|
|
405
380
|
return false;
|
|
406
381
|
}
|
|
407
382
|
} else if (newValue instanceof Array && oldValue instanceof Array) {
|
|
408
|
-
if (newValue && oldValue &&
|
|
383
|
+
if (newValue && oldValue &&
|
|
384
|
+
// @ts-ignore
|
|
409
385
|
newValue.length === oldValue.length) {
|
|
410
386
|
return true;
|
|
411
387
|
} else {
|
|
412
388
|
return false;
|
|
413
389
|
}
|
|
414
390
|
}
|
|
415
|
-
|
|
416
391
|
return false;
|
|
417
392
|
},
|
|
418
393
|
rangeWithFocused: function rangeWithFocused(range, focusedDate) {
|
|
@@ -425,7 +400,6 @@ var CalendarVue2 = {
|
|
|
425
400
|
// @ts-ignore
|
|
426
401
|
render: function render(createElement) {
|
|
427
402
|
var _this = this;
|
|
428
|
-
|
|
429
403
|
var h = gh || createElement;
|
|
430
404
|
var views = this.$props.views;
|
|
431
405
|
var currentValue = this.computedValue();
|
|
@@ -442,37 +416,31 @@ var CalendarVue2 = {
|
|
|
442
416
|
this._selectedRange = extractRangeFromValue(currentValue);
|
|
443
417
|
var calculatedFocus = extractFocusedDate(this._selectedDate, this._selectedMultiple, this._selectedRange);
|
|
444
418
|
var currentDateInRange = dateInRange(didValueChange && calculatedFocus !== null ? calculatedFocus : currentFocusedDate, this.currentMin, this.currentMax);
|
|
445
|
-
|
|
446
419
|
if (currentDateInRange instanceof Date) {
|
|
447
420
|
this._focusedDate = getDate(currentDateInRange);
|
|
448
421
|
} else if (calculatedFocus) {
|
|
449
422
|
this._focusedDate = calculatedFocus;
|
|
450
423
|
}
|
|
451
|
-
|
|
452
424
|
var visualizedRange = this.rangeWithFocused(this._selectedRange, currentFocusedDate);
|
|
453
425
|
this._intl = provideIntlService(this);
|
|
454
|
-
|
|
455
426
|
this._bus.configure(CalendarViewEnum[this.$props.bottomView], CalendarViewEnum[this.$props.topView]);
|
|
456
|
-
|
|
457
427
|
this._service = this._bus.service(activeView, this._intl);
|
|
458
428
|
var rootClassNames = classNames('k-widget k-calendar', 'k-calendar-range', {
|
|
459
429
|
'k-disabled': this.$props.disabled,
|
|
460
430
|
'k-week-number': this.$props.weekNumber
|
|
461
431
|
}, this.$props.className);
|
|
462
432
|
var didViewChange = this._lastView !== this.$data.currentActiveView;
|
|
463
|
-
|
|
464
433
|
var isDateInList = this._dates && this._service.isInArray(this._focusedDate, this._dates);
|
|
465
|
-
|
|
466
434
|
var didViewsCountChange = this._lastViewsCount !== this.$props.views;
|
|
467
|
-
|
|
468
435
|
if (!isDateInList || didViewChange || didViewsCountChange) {
|
|
469
436
|
this._dates = this._service.datesList(this._focusedDate, views);
|
|
470
437
|
}
|
|
471
|
-
|
|
472
438
|
var activeDate = cloneDate(this._dates && this._dates[0] ? this._dates[0] : undefined);
|
|
473
|
-
var calendarBody = [this.$props.navigation &&
|
|
439
|
+
var calendarBody = [this.$props.navigation &&
|
|
440
|
+
// @ts-ignore function children
|
|
474
441
|
h(Header, {
|
|
475
|
-
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
442
|
+
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
443
|
+
// key={`.kendo.calendar.header.${this.$data.currentFocusedDate.getTime()}`}
|
|
476
444
|
,
|
|
477
445
|
attrs: this.v3 ? undefined : {
|
|
478
446
|
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined,
|
|
@@ -505,8 +473,10 @@ var CalendarVue2 = {
|
|
|
505
473
|
bus: this._bus,
|
|
506
474
|
service: this._service,
|
|
507
475
|
headerTitle: headerTitle
|
|
508
|
-
}),
|
|
509
|
-
|
|
476
|
+
}),
|
|
477
|
+
// @ts-ignore function children
|
|
478
|
+
h(ViewList
|
|
479
|
+
// key={`.kendo.calendar.viewlist.${this.$data.currentFocusedDate.getTime()}`}
|
|
510
480
|
, {
|
|
511
481
|
allowReverse: this.$props.allowReverse,
|
|
512
482
|
attrs: this.v3 ? undefined : {
|
|
@@ -590,6 +560,5 @@ var CalendarVue2 = {
|
|
|
590
560
|
/**
|
|
591
561
|
* @hidden
|
|
592
562
|
*/
|
|
593
|
-
|
|
594
563
|
var Calendar = CalendarVue2;
|
|
595
564
|
export { Calendar, CalendarVue2 };
|
|
@@ -7,30 +7,23 @@ import { getDefaultSlots } from '@progress/kendo-vue-common';
|
|
|
7
7
|
/**
|
|
8
8
|
* @hidden
|
|
9
9
|
*/
|
|
10
|
-
|
|
11
10
|
var compareProps = function compareProps(x, y) {
|
|
12
11
|
var xProps = Object.getOwnPropertyNames(x);
|
|
13
12
|
var yProps = Object.getOwnPropertyNames(y);
|
|
14
|
-
|
|
15
13
|
if (xProps.length !== yProps.length) {
|
|
16
14
|
return false;
|
|
17
15
|
}
|
|
18
|
-
|
|
19
16
|
for (var i = 0; i < xProps.length; i++) {
|
|
20
17
|
var propName = xProps[i];
|
|
21
|
-
|
|
22
18
|
if (x[propName] !== y[propName]) {
|
|
23
19
|
return false;
|
|
24
20
|
}
|
|
25
21
|
}
|
|
26
|
-
|
|
27
22
|
return true;
|
|
28
23
|
};
|
|
29
24
|
/**
|
|
30
25
|
* @hidden
|
|
31
26
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
27
|
var CalendarCellVue2 = {
|
|
35
28
|
name: 'KendoCalendarCell',
|
|
36
29
|
// @ts-ignore
|
|
@@ -62,11 +55,11 @@ var CalendarCellVue2 = {
|
|
|
62
55
|
// due to date object being compared by instance
|
|
63
56
|
// and new Date object is created
|
|
64
57
|
// every time and fails the shallow compare of the Vue.
|
|
65
|
-
|
|
66
58
|
/**
|
|
67
59
|
* @hidden
|
|
68
60
|
*/
|
|
69
|
-
updated: function updated() {
|
|
61
|
+
updated: function updated() {
|
|
62
|
+
// const { value, ...props } = this.props;
|
|
70
63
|
// const { value: newValue, ...newProps } = nextProps;
|
|
71
64
|
// const valueEqual = !(value && newValue) || value.getTime() === newValue.getTime();
|
|
72
65
|
// return !(valueEqual && compareProps(props, newProps));
|
|
@@ -79,7 +72,6 @@ var CalendarCellVue2 = {
|
|
|
79
72
|
};
|
|
80
73
|
},
|
|
81
74
|
// tslint:disable:max-line-length
|
|
82
|
-
|
|
83
75
|
/**
|
|
84
76
|
* @return
|
|
85
77
|
* Returns a `<td />` element with a `<span class="k-link" />` inside to apply the styles. The text inside is the [`formattedValue`]({% slug api_dateinputs_calendarcellprops %}#toc-formattedvalue) of the `cell`.
|
|
@@ -89,20 +81,20 @@ var CalendarCellVue2 = {
|
|
|
89
81
|
var h = gh || createElement;
|
|
90
82
|
var defaultSlot = getDefaultSlots(this);
|
|
91
83
|
var _a = this.$props,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
84
|
+
formattedValue = _a.formattedValue,
|
|
85
|
+
isWeekend = _a.isWeekend,
|
|
86
|
+
isFocused = _a.isFocused,
|
|
87
|
+
isInRange = _a.isInRange,
|
|
88
|
+
isSelected = _a.isSelected,
|
|
89
|
+
isRangeStart = _a.isRangeStart,
|
|
90
|
+
isRangeMid = _a.isRangeMid,
|
|
91
|
+
isRangeEnd = _a.isRangeEnd,
|
|
92
|
+
isRangeSplitStart = _a.isRangeSplitStart,
|
|
93
|
+
isRangeSplitEnd = _a.isRangeSplitEnd,
|
|
94
|
+
isToday = _a.isToday,
|
|
95
|
+
isDisabled = _a.isDisabled,
|
|
96
|
+
view = _a.view,
|
|
97
|
+
value = _a.value;
|
|
106
98
|
var isEndActive = this.$props.activeRangeEnd === 'end' && isRangeEnd;
|
|
107
99
|
var isStartActive = this.$props.activeRangeEnd === 'start' && isRangeStart;
|
|
108
100
|
return h("td", {
|
|
@@ -163,6 +155,5 @@ var CalendarCellVue2 = {
|
|
|
163
155
|
/**
|
|
164
156
|
* @hidden
|
|
165
157
|
*/
|
|
166
|
-
|
|
167
158
|
var CalendarCell = CalendarCellVue2;
|
|
168
159
|
export { CalendarCell, CalendarCellVue2 };
|
|
@@ -8,7 +8,6 @@ import { Button as KButton } from '@progress/kendo-vue-buttons';
|
|
|
8
8
|
/**
|
|
9
9
|
* @hidden
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
11
|
var CalendarHeaderTitleVue2 = {
|
|
13
12
|
name: 'KendoHeaderTitle',
|
|
14
13
|
// @ts-ignore
|
|
@@ -32,7 +31,6 @@ var CalendarHeaderTitleVue2 = {
|
|
|
32
31
|
v3: v3
|
|
33
32
|
};
|
|
34
33
|
},
|
|
35
|
-
|
|
36
34
|
/**
|
|
37
35
|
* @return
|
|
38
36
|
* Returns a `<button />` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.
|
|
@@ -41,7 +39,8 @@ var CalendarHeaderTitleVue2 = {
|
|
|
41
39
|
render: function render(createElement) {
|
|
42
40
|
var h = gh || createElement;
|
|
43
41
|
var defaultSlot = getDefaultSlots(this);
|
|
44
|
-
return (
|
|
42
|
+
return (
|
|
43
|
+
// @ts-ignore function children
|
|
45
44
|
h(KButton, {
|
|
46
45
|
type: "button",
|
|
47
46
|
attrs: this.v3 ? undefined : {
|
|
@@ -68,6 +67,5 @@ var CalendarHeaderTitleVue2 = {
|
|
|
68
67
|
/**
|
|
69
68
|
* @hidden
|
|
70
69
|
*/
|
|
71
|
-
|
|
72
70
|
var CalendarHeaderTitle = CalendarHeaderTitleVue2;
|
|
73
71
|
export { CalendarHeaderTitle, CalendarHeaderTitleVue2 };
|