@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.
@@ -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 x, ref as N, inject as j, isVNode as A } from "vue";
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 p, messages as l, time as f, dateTimePickerCancel as g, dateTimePickerSet as T } from "../messages/main.mjs";
11
- import { ButtonGroup as L, Button as o } from "@progress/kendo-vue-buttons";
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 b, getToday as k, MAX_TIME as v, MIN_TIME as D } from "../utils.mjs";
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 d, canUseDOM as W, classNames as G, getTemplate as X, cloneDate as $ } from "@progress/kendo-vue-common";
17
- import { MIDNIGHT_DATE as m } from "../defaults.mjs";
18
- import { getNow as C } from "../timepicker/utils.mjs";
19
- function u(e) {
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 $(v);
45
+ return v(T);
46
46
  }
47
47
  },
48
48
  minTime: {
49
49
  type: Date,
50
50
  default: function() {
51
- return $(D);
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 || m;
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: V,
122
- weekNumber: y,
123
- focusedDate: B,
124
- format: _,
125
- steps: w
126
- } = this.$props, M = G({
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), c = r.toLanguageString(p, l[p]), h = r.toLanguageString(f, l[f]), n = r.toLanguageString(g, l[g]), s = r.toLanguageString(T, l[T]), P = a(R, {
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: V,
134
- weekNumber: y,
135
- focusedDate: B,
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), S = X.call(this, {
142
- h: x,
141
+ }, null), x = q.call(this, {
142
+ h: P,
143
143
  template: this.$props.calendar,
144
- defaultRendering: P
144
+ defaultRendering: w
145
145
  });
146
146
  return a("div", {
147
147
  onKeydown: this.handleKeyDown,
148
- class: M,
148
+ class: _,
149
149
  tabindex: -1
150
150
  }, [a("div", {
151
151
  class: "k-datetime-buttongroup"
152
152
  }, [a(L, {
153
- width: "100%"
154
- }, {
155
- default: () => [a(o, {
156
- type: "button",
157
- selected: this.currentTab === "date",
158
- togglable: !0,
159
- onClick: this.handleDateClick
160
- }, u(c) ? c : {
161
- default: () => [c]
162
- }), a(o, {
163
- type: "button",
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
- }, [S]), a("div", {
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 || D,
183
- max: this.computedMaxTime || v,
175
+ min: this.computedMinTime || b,
176
+ max: this.computedMaxTime || T,
184
177
  value: this.timeValue,
185
- format: _,
186
- steps: w,
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(o, {
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
- }, u(n) ? n : {
192
+ }, D(n) ? n : {
200
193
  default: () => [n]
201
- }), a(o, {
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
- }, u(s) ? s : {
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 || k()) ? e : null;
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 ? b(t, e) : t;
231
+ return e && t ? f(t, e) : t;
239
232
  },
240
233
  mergeDate(e, t) {
241
- return e ? b(e || k(), t) : t;
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 || m;
251
- const t = this.mergeDate(this.$props.value, this.$props.value || m), i = {
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 = C(), this.handleAccept(e, C());
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
- handleDateClick(e) {
278
- e.stopPropagation(), this.move("left");
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 d.enter:
279
+ case o.enter:
290
280
  !this.hasActiveButton() && this.hasDateValue && this.handleAccept(e);
291
281
  return;
292
- case d.left:
282
+ case o.left:
293
283
  if (!i)
294
284
  return;
295
285
  this.move("left");
296
286
  return;
297
- case d.right:
287
+ case o.right:
298
288
  if (!i)
299
289
  return;
300
290
  this.move("right");