@progress/kendo-vue-dateinputs 3.6.4 → 3.6.5-dev.202210181442
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
|
@@ -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.js';
|
|
|
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 };
|
|
@@ -3,41 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CalendarVue2 = exports.Calendar = void 0;
|
|
7
|
-
|
|
6
|
+
exports.CalendarVue2 = exports.Calendar = void 0;
|
|
7
|
+
// @ts-ignore
|
|
8
8
|
var Vue = require("vue");
|
|
9
|
-
|
|
10
9
|
var allVue = Vue;
|
|
11
10
|
var gh = allVue.h;
|
|
12
11
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
13
12
|
var inject = allVue.inject;
|
|
14
|
-
|
|
15
13
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
16
|
-
|
|
17
14
|
var kendo_date_math_1 = require("@progress/kendo-date-math");
|
|
18
|
-
|
|
19
15
|
var kendo_vue_intl_1 = require("@progress/kendo-vue-intl");
|
|
20
|
-
|
|
21
16
|
var package_metadata_1 = require("../../package-metadata");
|
|
22
|
-
|
|
23
17
|
var ViewList_1 = require("./ViewList");
|
|
24
|
-
|
|
25
18
|
var defaults_1 = require("../../defaults");
|
|
26
|
-
|
|
27
19
|
var main_1 = require("../models/main");
|
|
28
|
-
|
|
29
20
|
var utils_1 = require("../../utils");
|
|
30
|
-
|
|
31
21
|
var main_2 = require("../services/main");
|
|
32
|
-
|
|
33
22
|
var Header_1 = require("./Header");
|
|
34
|
-
|
|
35
23
|
var main_3 = require("../utils/main");
|
|
36
24
|
/**
|
|
37
25
|
* @hidden
|
|
38
26
|
*/
|
|
39
|
-
|
|
40
|
-
|
|
41
27
|
var CalendarVue2 = {
|
|
42
28
|
name: 'KendoCalendar',
|
|
43
29
|
inject: {
|
|
@@ -178,7 +164,6 @@ var CalendarVue2 = {
|
|
|
178
164
|
this._lastView = this.$props.activeView || this.$data.currentActiveView;
|
|
179
165
|
this._lastViewsCount = this.$props.views;
|
|
180
166
|
this._oldValue = this.computedValue();
|
|
181
|
-
|
|
182
167
|
if (!this.calendarViewList) {
|
|
183
168
|
this.calendarViewList = this.v3 ? this.calendarViewListRef : this.$refs.calendarViewList;
|
|
184
169
|
}
|
|
@@ -203,9 +188,9 @@ var CalendarVue2 = {
|
|
|
203
188
|
computedValue: function computedValue() {
|
|
204
189
|
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;
|
|
205
190
|
},
|
|
206
|
-
focus: function focus(
|
|
191
|
+
focus: function focus() {
|
|
207
192
|
if (this.calendarViewList) {
|
|
208
|
-
this.calendarViewList.$el.firstElementChild.focus(
|
|
193
|
+
this.calendarViewList.$el.firstElementChild.focus();
|
|
209
194
|
}
|
|
210
195
|
},
|
|
211
196
|
handleBlur: function handleBlur() {
|
|
@@ -224,7 +209,6 @@ var CalendarVue2 = {
|
|
|
224
209
|
if (this.$props.disabled) {
|
|
225
210
|
return;
|
|
226
211
|
}
|
|
227
|
-
|
|
228
212
|
this.$data.didNavigationChange = true;
|
|
229
213
|
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
230
214
|
this.$data.currentFocusedDate = focusedDate;
|
|
@@ -238,11 +222,9 @@ var CalendarVue2 = {
|
|
|
238
222
|
handlePrevClick: function handlePrevClick(event) {
|
|
239
223
|
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
240
224
|
this.focus();
|
|
241
|
-
|
|
242
225
|
if (this.$props.disabled) {
|
|
243
226
|
return;
|
|
244
227
|
}
|
|
245
|
-
|
|
246
228
|
this.$data.currentFocusedDate = focusedDate;
|
|
247
229
|
},
|
|
248
230
|
handleTitleClick: function handleTitleClick() {
|
|
@@ -251,11 +233,9 @@ var CalendarVue2 = {
|
|
|
251
233
|
handleNextClick: function handleNextClick(event) {
|
|
252
234
|
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
253
235
|
this.focus();
|
|
254
|
-
|
|
255
236
|
if (this.$props.disabled) {
|
|
256
237
|
return;
|
|
257
238
|
}
|
|
258
|
-
|
|
259
239
|
this.$data.currentFocusedDate = focusedDate;
|
|
260
240
|
},
|
|
261
241
|
handleCellEnter: function handleCellEnter(value) {
|
|
@@ -265,16 +245,14 @@ var CalendarVue2 = {
|
|
|
265
245
|
},
|
|
266
246
|
generateRange: function generateRange(candidate, value) {
|
|
267
247
|
var end = value.end,
|
|
268
|
-
|
|
248
|
+
start = value.start;
|
|
269
249
|
var shouldSwap = value.start !== null && candidate.getTime() <= value.start.getTime();
|
|
270
|
-
|
|
271
250
|
if (!this.$props.allowReverse && shouldSwap) {
|
|
272
251
|
return {
|
|
273
252
|
start: candidate,
|
|
274
253
|
end: this._selectedRange.start
|
|
275
254
|
};
|
|
276
255
|
}
|
|
277
|
-
|
|
278
256
|
return this.activeRange !== 'end' ? {
|
|
279
257
|
start: candidate,
|
|
280
258
|
end: end
|
|
@@ -297,35 +275,27 @@ var CalendarVue2 = {
|
|
|
297
275
|
},
|
|
298
276
|
handleDateChange: function handleDateChange(event) {
|
|
299
277
|
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
300
|
-
|
|
301
278
|
var canNavigateDown = this._bus.canMoveDown(this.$data.currentActiveView);
|
|
302
|
-
|
|
303
279
|
if (this.$props.disabled) {
|
|
304
280
|
return;
|
|
305
281
|
}
|
|
306
|
-
|
|
307
282
|
if (canNavigateDown) {
|
|
308
283
|
if (event.isTodayClick) {
|
|
309
284
|
this._bus.moveToBottom(this.$data.currentActiveView);
|
|
310
285
|
} else {
|
|
311
286
|
this._bus.moveDown(this.$data.currentActiveView, event.event);
|
|
312
|
-
|
|
313
287
|
this.$data.currentFocusedDate = focusedDate;
|
|
314
288
|
return;
|
|
315
289
|
}
|
|
316
290
|
}
|
|
317
|
-
|
|
318
291
|
var value;
|
|
319
|
-
|
|
320
292
|
switch (this.$props.mode) {
|
|
321
293
|
case 'single':
|
|
322
294
|
value = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
323
295
|
break;
|
|
324
|
-
|
|
325
296
|
case 'multiple':
|
|
326
297
|
if (Array.isArray(this._selectedMultiple)) {
|
|
327
298
|
var result = this._selectedMultiple.slice();
|
|
328
|
-
|
|
329
299
|
var index_1 = -1;
|
|
330
300
|
result.forEach(function (date, idx) {
|
|
331
301
|
if ((0, kendo_date_math_1.isEqualDate)(date, event.value)) {
|
|
@@ -341,20 +311,16 @@ var CalendarVue2 = {
|
|
|
341
311
|
value = [(0, kendo_date_math_1.cloneDate)(event.value)];
|
|
342
312
|
}
|
|
343
313
|
}
|
|
344
|
-
|
|
345
314
|
break;
|
|
346
|
-
|
|
347
315
|
case 'range':
|
|
348
316
|
var hasSelection = this._selectedRange.start !== null && this._selectedRange.end !== null && this.activeRange === 'start';
|
|
349
317
|
value = hasSelection ? this.clampRange(event.value) : this.generateRange(event.value, this._selectedRange);
|
|
350
318
|
this.$data.currentActiveRangeEnd = this.activeRange !== 'end' ? 'end' : 'start';
|
|
351
319
|
break;
|
|
352
|
-
|
|
353
320
|
default:
|
|
354
321
|
value = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
355
322
|
break;
|
|
356
323
|
}
|
|
357
|
-
|
|
358
324
|
this.$data.currentValue = value;
|
|
359
325
|
this.triggerChange(value, event);
|
|
360
326
|
},
|
|
@@ -377,17 +343,14 @@ var CalendarVue2 = {
|
|
|
377
343
|
},
|
|
378
344
|
handleMouseDown: function handleMouseDown(event) {
|
|
379
345
|
var focusedDate = (0, kendo_date_math_1.cloneDate)(event.value);
|
|
380
|
-
|
|
381
346
|
if (this.$props.disabled || this.$data.currentActiveView !== 0) {
|
|
382
347
|
return;
|
|
383
348
|
}
|
|
384
|
-
|
|
385
349
|
this.$data.currentFocusedDate = focusedDate;
|
|
386
350
|
},
|
|
387
351
|
tableKeyDown: function tableKeyDown(event) {
|
|
388
352
|
var keyCode = event.keyCode;
|
|
389
353
|
this.$emit('keydown', event);
|
|
390
|
-
|
|
391
354
|
if (keyCode === kendo_vue_common_1.Keys.enter) {
|
|
392
355
|
var args = {
|
|
393
356
|
event: event,
|
|
@@ -402,36 +365,35 @@ var CalendarVue2 = {
|
|
|
402
365
|
this.handleDateChange(args);
|
|
403
366
|
} else {
|
|
404
367
|
var candidate = (0, utils_1.dateInRange)(this._navigation.move(this._focusedDate, this._navigation.action(event), this.$data.currentActiveView, this._service, event), this.currentMin, this.currentMax);
|
|
405
|
-
|
|
406
368
|
if ((0, kendo_date_math_1.isEqualDate)(this._focusedDate, candidate)) {
|
|
407
369
|
return;
|
|
408
370
|
}
|
|
409
|
-
|
|
410
371
|
this._calculateFocusFromValue = false;
|
|
411
372
|
this.$data.currentFocusedDate = candidate;
|
|
412
373
|
}
|
|
413
|
-
|
|
414
374
|
event.preventDefault();
|
|
415
375
|
},
|
|
416
376
|
isValueEqual: function isValueEqual(newValue, oldValue) {
|
|
417
377
|
if (newValue instanceof Date && oldValue instanceof Date) {
|
|
418
|
-
return (0, kendo_date_math_1.isEqualDate)(newValue, oldValue);
|
|
378
|
+
return (0, kendo_date_math_1.isEqualDate)(newValue, oldValue);
|
|
379
|
+
// @ts-ignore
|
|
419
380
|
} else if (newValue instanceof Object && oldValue instanceof Object) {
|
|
420
|
-
if (newValue && oldValue &&
|
|
381
|
+
if (newValue && oldValue &&
|
|
382
|
+
// @ts-ignore
|
|
421
383
|
(0, kendo_date_math_1.isEqualDate)(newValue.start, oldValue.start) && (0, kendo_date_math_1.isEqualDate)(newValue.end, oldValue.end)) {
|
|
422
384
|
return true;
|
|
423
385
|
} else {
|
|
424
386
|
return false;
|
|
425
387
|
}
|
|
426
388
|
} else if (newValue instanceof Array && oldValue instanceof Array) {
|
|
427
|
-
if (newValue && oldValue &&
|
|
389
|
+
if (newValue && oldValue &&
|
|
390
|
+
// @ts-ignore
|
|
428
391
|
newValue.length === oldValue.length) {
|
|
429
392
|
return true;
|
|
430
393
|
} else {
|
|
431
394
|
return false;
|
|
432
395
|
}
|
|
433
396
|
}
|
|
434
|
-
|
|
435
397
|
return false;
|
|
436
398
|
},
|
|
437
399
|
rangeWithFocused: function rangeWithFocused(range, focusedDate) {
|
|
@@ -444,7 +406,6 @@ var CalendarVue2 = {
|
|
|
444
406
|
// @ts-ignore
|
|
445
407
|
render: function render(createElement) {
|
|
446
408
|
var _this = this;
|
|
447
|
-
|
|
448
409
|
var h = gh || createElement;
|
|
449
410
|
var views = this.$props.views;
|
|
450
411
|
var currentValue = this.computedValue();
|
|
@@ -461,37 +422,31 @@ var CalendarVue2 = {
|
|
|
461
422
|
this._selectedRange = (0, main_3.extractRangeFromValue)(currentValue);
|
|
462
423
|
var calculatedFocus = (0, main_3.extractFocusedDate)(this._selectedDate, this._selectedMultiple, this._selectedRange);
|
|
463
424
|
var currentDateInRange = (0, utils_1.dateInRange)(didValueChange && calculatedFocus !== null ? calculatedFocus : currentFocusedDate, this.currentMin, this.currentMax);
|
|
464
|
-
|
|
465
425
|
if (currentDateInRange instanceof Date) {
|
|
466
426
|
this._focusedDate = (0, kendo_date_math_1.getDate)(currentDateInRange);
|
|
467
427
|
} else if (calculatedFocus) {
|
|
468
428
|
this._focusedDate = calculatedFocus;
|
|
469
429
|
}
|
|
470
|
-
|
|
471
430
|
var visualizedRange = this.rangeWithFocused(this._selectedRange, currentFocusedDate);
|
|
472
431
|
this._intl = (0, kendo_vue_intl_1.provideIntlService)(this);
|
|
473
|
-
|
|
474
432
|
this._bus.configure(main_1.CalendarViewEnum[this.$props.bottomView], main_1.CalendarViewEnum[this.$props.topView]);
|
|
475
|
-
|
|
476
433
|
this._service = this._bus.service(activeView, this._intl);
|
|
477
434
|
var rootClassNames = (0, kendo_vue_common_1.classNames)('k-widget k-calendar', 'k-calendar-range', {
|
|
478
435
|
'k-disabled': this.$props.disabled,
|
|
479
436
|
'k-week-number': this.$props.weekNumber
|
|
480
437
|
}, this.$props.className);
|
|
481
438
|
var didViewChange = this._lastView !== this.$data.currentActiveView;
|
|
482
|
-
|
|
483
439
|
var isDateInList = this._dates && this._service.isInArray(this._focusedDate, this._dates);
|
|
484
|
-
|
|
485
440
|
var didViewsCountChange = this._lastViewsCount !== this.$props.views;
|
|
486
|
-
|
|
487
441
|
if (!isDateInList || didViewChange || didViewsCountChange) {
|
|
488
442
|
this._dates = this._service.datesList(this._focusedDate, views);
|
|
489
443
|
}
|
|
490
|
-
|
|
491
444
|
var activeDate = (0, kendo_date_math_1.cloneDate)(this._dates && this._dates[0] ? this._dates[0] : undefined);
|
|
492
|
-
var calendarBody = [this.$props.navigation &&
|
|
445
|
+
var calendarBody = [this.$props.navigation &&
|
|
446
|
+
// @ts-ignore function children
|
|
493
447
|
h(Header_1.Header, {
|
|
494
|
-
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
448
|
+
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined
|
|
449
|
+
// key={`.kendo.calendar.header.${this.$data.currentFocusedDate.getTime()}`}
|
|
495
450
|
,
|
|
496
451
|
attrs: this.v3 ? undefined : {
|
|
497
452
|
tabIndex: !this.$props.disabled ? this.$props.tabIndex || 0 : undefined,
|
|
@@ -524,7 +479,8 @@ var CalendarVue2 = {
|
|
|
524
479
|
bus: this._bus,
|
|
525
480
|
service: this._service,
|
|
526
481
|
headerTitle: headerTitle
|
|
527
|
-
}),
|
|
482
|
+
}),
|
|
483
|
+
// @ts-ignore function children
|
|
528
484
|
h(ViewList_1.ViewList, {
|
|
529
485
|
// key={`.kendo.calendar.viewlist.${this.$data.currentFocusedDate.getTime()}`}
|
|
530
486
|
allowReverse: this.$props.allowReverse,
|
|
@@ -610,6 +566,5 @@ exports.CalendarVue2 = CalendarVue2;
|
|
|
610
566
|
/**
|
|
611
567
|
* @hidden
|
|
612
568
|
*/
|
|
613
|
-
|
|
614
569
|
var Calendar = CalendarVue2;
|
|
615
570
|
exports.Calendar = Calendar;
|
|
@@ -3,43 +3,33 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CalendarCellVue2 = exports.CalendarCell = void 0;
|
|
7
|
-
|
|
6
|
+
exports.CalendarCellVue2 = exports.CalendarCell = void 0;
|
|
7
|
+
// @ts-ignore
|
|
8
8
|
var Vue = require("vue");
|
|
9
|
-
|
|
10
9
|
var allVue = Vue;
|
|
11
10
|
var gh = allVue.h;
|
|
12
11
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
13
|
-
|
|
14
12
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
13
|
/**
|
|
16
14
|
* @hidden
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
16
|
var compareProps = function compareProps(x, y) {
|
|
21
17
|
var xProps = Object.getOwnPropertyNames(x);
|
|
22
18
|
var yProps = Object.getOwnPropertyNames(y);
|
|
23
|
-
|
|
24
19
|
if (xProps.length !== yProps.length) {
|
|
25
20
|
return false;
|
|
26
21
|
}
|
|
27
|
-
|
|
28
22
|
for (var i = 0; i < xProps.length; i++) {
|
|
29
23
|
var propName = xProps[i];
|
|
30
|
-
|
|
31
24
|
if (x[propName] !== y[propName]) {
|
|
32
25
|
return false;
|
|
33
26
|
}
|
|
34
27
|
}
|
|
35
|
-
|
|
36
28
|
return true;
|
|
37
29
|
};
|
|
38
30
|
/**
|
|
39
31
|
* @hidden
|
|
40
32
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
33
|
var CalendarCellVue2 = {
|
|
44
34
|
name: 'KendoCalendarCell',
|
|
45
35
|
// @ts-ignore
|
|
@@ -71,11 +61,11 @@ var CalendarCellVue2 = {
|
|
|
71
61
|
// due to date object being compared by instance
|
|
72
62
|
// and new Date object is created
|
|
73
63
|
// every time and fails the shallow compare of the Vue.
|
|
74
|
-
|
|
75
64
|
/**
|
|
76
65
|
* @hidden
|
|
77
66
|
*/
|
|
78
|
-
updated: function updated() {
|
|
67
|
+
updated: function updated() {
|
|
68
|
+
// const { value, ...props } = this.props;
|
|
79
69
|
// const { value: newValue, ...newProps } = nextProps;
|
|
80
70
|
// const valueEqual = !(value && newValue) || value.getTime() === newValue.getTime();
|
|
81
71
|
// return !(valueEqual && compareProps(props, newProps));
|
|
@@ -88,7 +78,6 @@ var CalendarCellVue2 = {
|
|
|
88
78
|
};
|
|
89
79
|
},
|
|
90
80
|
// tslint:disable:max-line-length
|
|
91
|
-
|
|
92
81
|
/**
|
|
93
82
|
* @return
|
|
94
83
|
* 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`.
|
|
@@ -98,20 +87,20 @@ var CalendarCellVue2 = {
|
|
|
98
87
|
var h = gh || createElement;
|
|
99
88
|
var defaultSlot = (0, kendo_vue_common_1.getDefaultSlots)(this);
|
|
100
89
|
var _a = this.$props,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
90
|
+
formattedValue = _a.formattedValue,
|
|
91
|
+
isWeekend = _a.isWeekend,
|
|
92
|
+
isFocused = _a.isFocused,
|
|
93
|
+
isInRange = _a.isInRange,
|
|
94
|
+
isSelected = _a.isSelected,
|
|
95
|
+
isRangeStart = _a.isRangeStart,
|
|
96
|
+
isRangeMid = _a.isRangeMid,
|
|
97
|
+
isRangeEnd = _a.isRangeEnd,
|
|
98
|
+
isRangeSplitStart = _a.isRangeSplitStart,
|
|
99
|
+
isRangeSplitEnd = _a.isRangeSplitEnd,
|
|
100
|
+
isToday = _a.isToday,
|
|
101
|
+
isDisabled = _a.isDisabled,
|
|
102
|
+
view = _a.view,
|
|
103
|
+
value = _a.value;
|
|
115
104
|
var isEndActive = this.$props.activeRangeEnd === 'end' && isRangeEnd;
|
|
116
105
|
var isStartActive = this.$props.activeRangeEnd === 'start' && isRangeStart;
|
|
117
106
|
return h("td", {
|
|
@@ -173,6 +162,5 @@ exports.CalendarCellVue2 = CalendarCellVue2;
|
|
|
173
162
|
/**
|
|
174
163
|
* @hidden
|
|
175
164
|
*/
|
|
176
|
-
|
|
177
165
|
var CalendarCell = CalendarCellVue2;
|
|
178
166
|
exports.CalendarCell = CalendarCell;
|
|
@@ -3,22 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CalendarHeaderTitleVue2 = exports.CalendarHeaderTitle = void 0;
|
|
7
|
-
|
|
6
|
+
exports.CalendarHeaderTitleVue2 = exports.CalendarHeaderTitle = void 0;
|
|
7
|
+
// @ts-ignore
|
|
8
8
|
var Vue = require("vue");
|
|
9
|
-
|
|
10
9
|
var allVue = Vue;
|
|
11
10
|
var gh = allVue.h;
|
|
12
11
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
13
|
-
|
|
14
12
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
|
-
|
|
16
13
|
var kendo_vue_buttons_1 = require("@progress/kendo-vue-buttons");
|
|
17
14
|
/**
|
|
18
15
|
* @hidden
|
|
19
16
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
17
|
var CalendarHeaderTitleVue2 = {
|
|
23
18
|
name: 'KendoHeaderTitle',
|
|
24
19
|
// @ts-ignore
|
|
@@ -42,7 +37,6 @@ var CalendarHeaderTitleVue2 = {
|
|
|
42
37
|
v3: v3
|
|
43
38
|
};
|
|
44
39
|
},
|
|
45
|
-
|
|
46
40
|
/**
|
|
47
41
|
* @return
|
|
48
42
|
* Returns a `<button />` element with the [`value`]({% slug api_dateinputs_calendarheadertitleprops %}#toc-value) of the title as a child.
|
|
@@ -51,7 +45,8 @@ var CalendarHeaderTitleVue2 = {
|
|
|
51
45
|
render: function render(createElement) {
|
|
52
46
|
var h = gh || createElement;
|
|
53
47
|
var defaultSlot = (0, kendo_vue_common_1.getDefaultSlots)(this);
|
|
54
|
-
return (
|
|
48
|
+
return (
|
|
49
|
+
// @ts-ignore function children
|
|
55
50
|
h(kendo_vue_buttons_1.Button, {
|
|
56
51
|
type: "button",
|
|
57
52
|
attrs: this.v3 ? undefined : {
|
|
@@ -79,6 +74,5 @@ exports.CalendarHeaderTitleVue2 = CalendarHeaderTitleVue2;
|
|
|
79
74
|
/**
|
|
80
75
|
* @hidden
|
|
81
76
|
*/
|
|
82
|
-
|
|
83
77
|
var CalendarHeaderTitle = CalendarHeaderTitleVue2;
|
|
84
78
|
exports.CalendarHeaderTitle = CalendarHeaderTitle;
|
|
@@ -3,20 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.CalendarWeekCellVue2 = exports.CalendarWeekCell = void 0;
|
|
7
|
-
|
|
6
|
+
exports.CalendarWeekCellVue2 = exports.CalendarWeekCell = void 0;
|
|
7
|
+
// @ts-ignore
|
|
8
8
|
var Vue = require("vue");
|
|
9
|
-
|
|
10
9
|
var allVue = Vue;
|
|
11
10
|
var gh = allVue.h;
|
|
12
11
|
var isV3 = allVue.version && allVue.version[0] === '3';
|
|
13
|
-
|
|
14
12
|
var kendo_vue_common_1 = require("@progress/kendo-vue-common");
|
|
15
13
|
/**
|
|
16
14
|
* @hidden
|
|
17
15
|
*/
|
|
18
|
-
|
|
19
|
-
|
|
20
16
|
var CalendarWeekCellVue2 = {
|
|
21
17
|
props: {
|
|
22
18
|
id: String,
|
|
@@ -33,7 +29,6 @@ var CalendarWeekCellVue2 = {
|
|
|
33
29
|
v3: v3
|
|
34
30
|
};
|
|
35
31
|
},
|
|
36
|
-
|
|
37
32
|
/**
|
|
38
33
|
* @return
|
|
39
34
|
* Returns a `<td />` element with the [`value`]({% slug api_dateinputs_calendarweekcellprops %}#toc-value) as a child.
|
|
@@ -64,6 +59,5 @@ exports.CalendarWeekCellVue2 = CalendarWeekCellVue2;
|
|
|
64
59
|
/**
|
|
65
60
|
* @hidden
|
|
66
61
|
*/
|
|
67
|
-
|
|
68
62
|
var CalendarWeekCell = CalendarWeekCellVue2;
|
|
69
63
|
exports.CalendarWeekCell = CalendarWeekCell;
|