@progress/kendo-vue-dateinputs 8.4.0-develop.3 → 8.4.0-develop.5
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/calendar/components/Calendar.js +1 -1
- package/calendar/components/Calendar.mjs +44 -43
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +11 -11
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +21 -21
- package/datepicker/ToggleButton.d.ts +4 -4
- package/daterangepicker/DateRangePicker.js +1 -1
- package/daterangepicker/DateRangePicker.mjs +24 -24
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +14 -14
- package/datetimepicker/DateTimeSelector.d.ts +1 -2
- package/datetimepicker/DateTimeSelector.js +1 -1
- package/datetimepicker/DateTimeSelector.mjs +56 -66
- package/dist/cdn/js/kendo-vue-dateinputs.js +1 -1
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +14 -9
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +1 -1
|
@@ -5,18 +5,18 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { defineComponent as F, createVNode as a, h as
|
|
8
|
+
import { defineComponent as F, createVNode as a, h as P, ref as N, inject as j, isVNode as A } from "vue";
|
|
9
9
|
import { provideLocalizationService as E } from "@progress/kendo-vue-intl";
|
|
10
|
-
import { date as
|
|
11
|
-
import {
|
|
10
|
+
import { date as c, messages as l, time as h, dateTimePickerCancel as m, dateTimePickerSet as d } from "../messages/main.mjs";
|
|
11
|
+
import { SegmentedControl as L, Button as p } from "@progress/kendo-vue-buttons";
|
|
12
12
|
import { Calendar as R } from "../calendar/components/Calendar.mjs";
|
|
13
13
|
import { TimePart as z } from "../timepicker/TimePart.mjs";
|
|
14
|
-
import { MAX_DATE as K, MIN_DATE as I, setTime as
|
|
14
|
+
import { MAX_DATE as K, MIN_DATE as I, setTime as f, getToday as g, MAX_TIME as T, MIN_TIME as b } from "../utils.mjs";
|
|
15
15
|
import { isEqualDate as O } from "@progress/kendo-date-math";
|
|
16
|
-
import { Keys as
|
|
17
|
-
import { MIDNIGHT_DATE as
|
|
18
|
-
import { getNow as
|
|
19
|
-
function
|
|
16
|
+
import { Keys as o, canUseDOM as W, classNames as X, getTemplate as q, cloneDate as v } from "@progress/kendo-vue-common";
|
|
17
|
+
import { MIDNIGHT_DATE as u } from "../defaults.mjs";
|
|
18
|
+
import { getNow as k } from "../timepicker/utils.mjs";
|
|
19
|
+
function D(e) {
|
|
20
20
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !A(e);
|
|
21
21
|
}
|
|
22
22
|
const ne = /* @__PURE__ */ F({
|
|
@@ -42,13 +42,13 @@ const ne = /* @__PURE__ */ F({
|
|
|
42
42
|
maxTime: {
|
|
43
43
|
type: Date,
|
|
44
44
|
default: function() {
|
|
45
|
-
return
|
|
45
|
+
return v(T);
|
|
46
46
|
}
|
|
47
47
|
},
|
|
48
48
|
minTime: {
|
|
49
49
|
type: Date,
|
|
50
50
|
default: function() {
|
|
51
|
-
return
|
|
51
|
+
return v(b);
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
weekNumber: {
|
|
@@ -71,7 +71,7 @@ const ne = /* @__PURE__ */ F({
|
|
|
71
71
|
onKeydown: Function
|
|
72
72
|
},
|
|
73
73
|
created() {
|
|
74
|
-
this._calendarWrap = null, this.currentTab = "date", this.dateValue = this.$props.value, this.timeValue = this.$props.value ||
|
|
74
|
+
this._calendarWrap = null, this.currentTab = "date", this.dateValue = this.$props.value, this.timeValue = this.$props.value || u;
|
|
75
75
|
},
|
|
76
76
|
inject: {
|
|
77
77
|
kendoLocalizationService: {
|
|
@@ -118,87 +118,80 @@ const ne = /* @__PURE__ */ F({
|
|
|
118
118
|
disabled: e,
|
|
119
119
|
cancelButton: t,
|
|
120
120
|
min: i,
|
|
121
|
-
max:
|
|
122
|
-
weekNumber:
|
|
123
|
-
focusedDate:
|
|
124
|
-
format:
|
|
125
|
-
steps:
|
|
126
|
-
} = this.$props,
|
|
121
|
+
max: $,
|
|
122
|
+
weekNumber: V,
|
|
123
|
+
focusedDate: C,
|
|
124
|
+
format: y,
|
|
125
|
+
steps: B
|
|
126
|
+
} = this.$props, _ = X({
|
|
127
127
|
"k-date-tab": this.currentTab === "date",
|
|
128
128
|
"k-time-tab": this.currentTab === "time",
|
|
129
129
|
"k-disabled": e
|
|
130
|
-
}, "k-datetime-wrap"), r = E(this),
|
|
130
|
+
}, "k-datetime-wrap"), r = E(this), M = r.toLanguageString(c, l[c]), S = r.toLanguageString(h, l[h]), n = r.toLanguageString(m, l[m]), s = r.toLanguageString(d, l[d]), w = a(R, {
|
|
131
131
|
ref: "calendar",
|
|
132
132
|
min: i,
|
|
133
|
-
max:
|
|
134
|
-
weekNumber:
|
|
135
|
-
focusedDate:
|
|
133
|
+
max: $,
|
|
134
|
+
weekNumber: V,
|
|
135
|
+
focusedDate: C,
|
|
136
136
|
disabled: e || this.currentTab !== "date",
|
|
137
137
|
value: this.dateValue,
|
|
138
138
|
onChange: this.handleCalendarValueChange,
|
|
139
139
|
onFocus: this.handleFocus,
|
|
140
140
|
onBlur: this.handleBlur
|
|
141
|
-
}, null),
|
|
142
|
-
h:
|
|
141
|
+
}, null), x = q.call(this, {
|
|
142
|
+
h: P,
|
|
143
143
|
template: this.$props.calendar,
|
|
144
|
-
defaultRendering:
|
|
144
|
+
defaultRendering: w
|
|
145
145
|
});
|
|
146
146
|
return a("div", {
|
|
147
147
|
onKeydown: this.handleKeyDown,
|
|
148
|
-
class:
|
|
148
|
+
class: _,
|
|
149
149
|
tabindex: -1
|
|
150
150
|
}, [a("div", {
|
|
151
151
|
class: "k-datetime-buttongroup"
|
|
152
152
|
}, [a(L, {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
selected: this.currentTab === "time",
|
|
165
|
-
togglable: !0,
|
|
166
|
-
onClick: this.handleTimeClick
|
|
167
|
-
}, u(h) ? h : {
|
|
168
|
-
default: () => [h]
|
|
169
|
-
})]
|
|
170
|
-
})]), a("div", {
|
|
153
|
+
layoutMode: "stretch",
|
|
154
|
+
value: this.currentTab,
|
|
155
|
+
items: [{
|
|
156
|
+
value: "date",
|
|
157
|
+
text: M
|
|
158
|
+
}, {
|
|
159
|
+
value: "time",
|
|
160
|
+
text: S
|
|
161
|
+
}],
|
|
162
|
+
onChange: this.handleTabChange
|
|
163
|
+
}, null)]), a("div", {
|
|
171
164
|
class: "k-datetime-selector"
|
|
172
165
|
}, [a("div", {
|
|
173
166
|
class: "k-datetime-calendar-wrap",
|
|
174
167
|
ref: "calendarWrap"
|
|
175
|
-
}, [
|
|
168
|
+
}, [x]), a("div", {
|
|
176
169
|
class: "k-datetime-time-wrap"
|
|
177
170
|
}, [a(z, {
|
|
178
171
|
key: 1,
|
|
179
172
|
onNowclick: this.handleNowClick,
|
|
180
173
|
disabled: e || this.currentTab !== "time",
|
|
181
174
|
ref: "timePart",
|
|
182
|
-
min: this.computedMinTime ||
|
|
183
|
-
max: this.computedMaxTime ||
|
|
175
|
+
min: this.computedMinTime || b,
|
|
176
|
+
max: this.computedMaxTime || T,
|
|
184
177
|
value: this.timeValue,
|
|
185
|
-
format:
|
|
186
|
-
steps:
|
|
178
|
+
format: y,
|
|
179
|
+
steps: B,
|
|
187
180
|
onChange: this.handleTimeListContainerChange,
|
|
188
181
|
onFocus: this.handleFocus,
|
|
189
182
|
onBlur: this.handleBlur
|
|
190
183
|
}, null)])]), a("div", {
|
|
191
184
|
class: "k-datetime-footer k-actions k-actions-stretched"
|
|
192
|
-
}, [t && a(
|
|
185
|
+
}, [t && a(p, {
|
|
193
186
|
type: "button",
|
|
194
187
|
ref: "cancelButton",
|
|
195
188
|
class: "k-time-cancel",
|
|
196
189
|
onClick: this.handleReject,
|
|
197
190
|
title: n,
|
|
198
191
|
"aria-label": n
|
|
199
|
-
},
|
|
192
|
+
}, D(n) ? n : {
|
|
200
193
|
default: () => [n]
|
|
201
|
-
}), a(
|
|
194
|
+
}), a(p, {
|
|
202
195
|
type: "button",
|
|
203
196
|
ref: "acceptButton",
|
|
204
197
|
disabled: !this.hasDateValue,
|
|
@@ -207,7 +200,7 @@ const ne = /* @__PURE__ */ F({
|
|
|
207
200
|
onClick: this.handleAccept,
|
|
208
201
|
title: s,
|
|
209
202
|
"aria-label": s
|
|
210
|
-
},
|
|
203
|
+
}, D(s) ? s : {
|
|
211
204
|
default: () => [s]
|
|
212
205
|
})])]);
|
|
213
206
|
},
|
|
@@ -229,16 +222,16 @@ const ne = /* @__PURE__ */ F({
|
|
|
229
222
|
return this._calendar && this._calendar.$el ? this._calendar : null;
|
|
230
223
|
},
|
|
231
224
|
normalizeRange(e, t) {
|
|
232
|
-
return O(e, t ||
|
|
225
|
+
return O(e, t || g()) ? e : null;
|
|
233
226
|
},
|
|
234
227
|
hasActiveButton() {
|
|
235
228
|
return this._acceptButton ? W && (document.activeElement === this._acceptButton.$el || document.activeElement === this._cancelButton.$el) : !1;
|
|
236
229
|
},
|
|
237
230
|
mergeTime(e, t) {
|
|
238
|
-
return e && t ?
|
|
231
|
+
return e && t ? f(t, e) : t;
|
|
239
232
|
},
|
|
240
233
|
mergeDate(e, t) {
|
|
241
|
-
return e ?
|
|
234
|
+
return e ? f(e || g(), t) : t;
|
|
242
235
|
},
|
|
243
236
|
move(e) {
|
|
244
237
|
if (e === "right" && this.currentTab === "time" || e === "left" && this.currentTab === "date")
|
|
@@ -247,8 +240,8 @@ const ne = /* @__PURE__ */ F({
|
|
|
247
240
|
this.shouldFocusPart = !0, this.currentTab = t;
|
|
248
241
|
},
|
|
249
242
|
handleReject(e) {
|
|
250
|
-
this.dateValue = this.$props.value, this.timeValue = this.$props.value ||
|
|
251
|
-
const t = this.mergeDate(this.$props.value, this.$props.value ||
|
|
243
|
+
this.dateValue = this.$props.value, this.timeValue = this.$props.value || u;
|
|
244
|
+
const t = this.mergeDate(this.$props.value, this.$props.value || u), i = {
|
|
252
245
|
event: e,
|
|
253
246
|
target: this,
|
|
254
247
|
value: t
|
|
@@ -266,7 +259,7 @@ const ne = /* @__PURE__ */ F({
|
|
|
266
259
|
});
|
|
267
260
|
},
|
|
268
261
|
handleNowClick(e) {
|
|
269
|
-
this.timeValue =
|
|
262
|
+
this.timeValue = k(), this.handleAccept(e, k());
|
|
270
263
|
},
|
|
271
264
|
handleCalendarValueChange(e) {
|
|
272
265
|
e.event.stopPropagation(), this.dateValue = e.value, this.currentTab = "time", this.shouldFocusPart = !0;
|
|
@@ -274,11 +267,8 @@ const ne = /* @__PURE__ */ F({
|
|
|
274
267
|
handleTimeListContainerChange(e) {
|
|
275
268
|
this.timeValue = e;
|
|
276
269
|
},
|
|
277
|
-
|
|
278
|
-
e.
|
|
279
|
-
},
|
|
280
|
-
handleTimeClick(e) {
|
|
281
|
-
e.stopPropagation(), this.move("right");
|
|
270
|
+
handleTabChange(e) {
|
|
271
|
+
e === "date" ? this.move("left") : e === "time" && this.move("right");
|
|
282
272
|
},
|
|
283
273
|
handleKeyDown(e) {
|
|
284
274
|
const {
|
|
@@ -286,15 +276,15 @@ const ne = /* @__PURE__ */ F({
|
|
|
286
276
|
altKey: i
|
|
287
277
|
} = e;
|
|
288
278
|
switch (this.$emit("keydown", e), t) {
|
|
289
|
-
case
|
|
279
|
+
case o.enter:
|
|
290
280
|
!this.hasActiveButton() && this.hasDateValue && this.handleAccept(e);
|
|
291
281
|
return;
|
|
292
|
-
case
|
|
282
|
+
case o.left:
|
|
293
283
|
if (!i)
|
|
294
284
|
return;
|
|
295
285
|
this.move("left");
|
|
296
286
|
return;
|
|
297
|
-
case
|
|
287
|
+
case o.right:
|
|
298
288
|
if (!i)
|
|
299
289
|
return;
|
|
300
290
|
this.move("right");
|