@progress/kendo-react-dateinputs 9.0.0-develop.2 → 9.0.0-develop.20
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/README.md +47 -46
- package/calendar/components/Calendar.mjs +57 -60
- package/calendar/components/CalendarNavigationItem.mjs +10 -12
- package/calendar/components/CalendarWeekCell.mjs +9 -1
- package/calendar/components/HorizontalViewList.mjs +8 -11
- package/calendar/components/MultiViewCalendar.mjs +13 -8
- package/calendar/components/Navigation.mjs +11 -11
- package/calendar/components/View.mjs +8 -25
- package/common/PickerWrap.mjs +2 -15
- package/dateinput/DateInput.js +1 -1
- package/dateinput/DateInput.mjs +264 -321
- package/dateinput/dateInputIntl.js +8 -0
- package/dateinput/dateInputIntl.mjs +20 -0
- package/dateinput/utils.js +1 -1
- package/dateinput/utils.mjs +4 -27
- package/datepicker/DatePicker.js +1 -1
- package/datepicker/DatePicker.mjs +104 -82
- package/daterangepicker/DateRangePicker.mjs +14 -3
- package/datetimepicker/DateTimePicker.js +1 -1
- package/datetimepicker/DateTimePicker.mjs +102 -81
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +6 -11
- package/index.d.mts +177 -36
- package/index.d.ts +177 -36
- package/package-metadata.mjs +1 -1
- package/package.json +8 -7
- package/timepicker/TimeList.mjs +27 -12
- package/timepicker/TimePart.mjs +55 -75
- package/timepicker/TimePicker.js +1 -1
- package/timepicker/TimePicker.mjs +85 -69
- package/timepicker/services/DOMService.mjs +7 -4
- package/timepicker/services/DayPeriodService.mjs +1 -4
- package/timepicker/utils.mjs +3 -15
- package/virtualization/Virtualization.js +1 -1
- package/virtualization/Virtualization.mjs +3 -13
- package/dateinput/models/kendo-date.js +0 -8
- package/dateinput/models/kendo-date.mjs +0 -233
- package/dateinput/models/mask.js +0 -8
- package/dateinput/models/mask.mjs +0 -16
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use client";
|
|
9
|
-
import { getDate as M, isEqual as v, cloneDate as m, addMonths as f, lastDayOfMonth as y, createDate as P } from "@progress/kendo-date-math";
|
|
10
|
-
import { Mask as x } from "./mask.mjs";
|
|
11
|
-
import { dateSymbolMap as D } from "../utils.mjs";
|
|
12
|
-
class k {
|
|
13
|
-
constructor(t, e, s) {
|
|
14
|
-
this.year = !0, this.month = !0, this.date = !0, this.hours = !0, this.minutes = !0, this.seconds = !0, this.milliseconds = !0, this.leadingZero = null, this.typedMonthPart = "", this.knownParts = "adHhmMsEy", this.symbols = {
|
|
15
|
-
E: "E",
|
|
16
|
-
H: "H",
|
|
17
|
-
M: "M",
|
|
18
|
-
a: "a",
|
|
19
|
-
d: "d",
|
|
20
|
-
h: "h",
|
|
21
|
-
m: "m",
|
|
22
|
-
s: "s",
|
|
23
|
-
y: "y"
|
|
24
|
-
}, this._value = M(/* @__PURE__ */ new Date()), this.intlProvider = t, this.formatPlaceholder = e, this.format = s, this.monthNames = this.allFormatedMonths();
|
|
25
|
-
}
|
|
26
|
-
get intl() {
|
|
27
|
-
return this.intlProvider();
|
|
28
|
-
}
|
|
29
|
-
get value() {
|
|
30
|
-
return this._value;
|
|
31
|
-
}
|
|
32
|
-
setValue(t) {
|
|
33
|
-
t ? v(t, this._value) || (this._value = m(t), this.modifyExisting(!0)) : (this._value = M(/* @__PURE__ */ new Date()), this.modifyExisting(!1));
|
|
34
|
-
}
|
|
35
|
-
hasValue() {
|
|
36
|
-
const t = (e, s) => e || s.type !== "literal" && s.type !== "dayperiod" && this.getExisting(s.pattern[0]);
|
|
37
|
-
return this.intl.splitDateFormat(this.format).reduce(t, !1);
|
|
38
|
-
}
|
|
39
|
-
getDateObject() {
|
|
40
|
-
for (let t = 0; t < this.knownParts.length; t++)
|
|
41
|
-
if (!this.getExisting(this.knownParts[t]))
|
|
42
|
-
return null;
|
|
43
|
-
return m(this.value);
|
|
44
|
-
}
|
|
45
|
-
getTextAndFormat() {
|
|
46
|
-
return this.merge(
|
|
47
|
-
this.intl.formatDate(this.value, this.format),
|
|
48
|
-
this.dateFormatString(this.value, this.format)
|
|
49
|
-
);
|
|
50
|
-
}
|
|
51
|
-
modifyExisting(t) {
|
|
52
|
-
const e = this.dateFormatString(this.value, this.format).symbols;
|
|
53
|
-
for (let s = 0; s < e.length; s++)
|
|
54
|
-
this.setExisting(e[s], t);
|
|
55
|
-
}
|
|
56
|
-
getExisting(t) {
|
|
57
|
-
switch (t) {
|
|
58
|
-
case "y":
|
|
59
|
-
return this.year;
|
|
60
|
-
case "M":
|
|
61
|
-
case "L":
|
|
62
|
-
return this.month;
|
|
63
|
-
case "d":
|
|
64
|
-
return this.date;
|
|
65
|
-
case "E":
|
|
66
|
-
return this.date && this.month && this.year;
|
|
67
|
-
case "h":
|
|
68
|
-
case "H":
|
|
69
|
-
return this.hours;
|
|
70
|
-
case "m":
|
|
71
|
-
return this.minutes;
|
|
72
|
-
case "s":
|
|
73
|
-
return this.seconds;
|
|
74
|
-
default:
|
|
75
|
-
return !0;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
setExisting(t, e) {
|
|
79
|
-
switch (t) {
|
|
80
|
-
case "y":
|
|
81
|
-
this.year = e, e === !1 && this._value.setFullYear(2e3);
|
|
82
|
-
break;
|
|
83
|
-
case "M":
|
|
84
|
-
this.month = e, e === !1 && this._value.setMonth(0);
|
|
85
|
-
break;
|
|
86
|
-
case "d":
|
|
87
|
-
this.date = e;
|
|
88
|
-
break;
|
|
89
|
-
case "h":
|
|
90
|
-
case "H":
|
|
91
|
-
this.hours = e;
|
|
92
|
-
break;
|
|
93
|
-
case "m":
|
|
94
|
-
this.minutes = e;
|
|
95
|
-
break;
|
|
96
|
-
case "s":
|
|
97
|
-
this.seconds = e;
|
|
98
|
-
break;
|
|
99
|
-
default:
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
modifyPart(t, e) {
|
|
104
|
-
let s = m(this.value);
|
|
105
|
-
switch (t) {
|
|
106
|
-
case "y":
|
|
107
|
-
s.setFullYear(s.getFullYear() + e);
|
|
108
|
-
break;
|
|
109
|
-
case "M":
|
|
110
|
-
s = f(this.value, e);
|
|
111
|
-
break;
|
|
112
|
-
case "d":
|
|
113
|
-
case "E":
|
|
114
|
-
s.setDate(s.getDate() + e);
|
|
115
|
-
break;
|
|
116
|
-
case "h":
|
|
117
|
-
case "H":
|
|
118
|
-
s.setHours(s.getHours() + e);
|
|
119
|
-
break;
|
|
120
|
-
case "m":
|
|
121
|
-
s.setMinutes(s.getMinutes() + e);
|
|
122
|
-
break;
|
|
123
|
-
case "s":
|
|
124
|
-
s.setSeconds(s.getSeconds() + e);
|
|
125
|
-
break;
|
|
126
|
-
case "a":
|
|
127
|
-
s.setHours(s.getHours() + 12 * e);
|
|
128
|
-
break;
|
|
129
|
-
}
|
|
130
|
-
this.setExisting(t, !0), this._value = s;
|
|
131
|
-
}
|
|
132
|
-
parsePart(t, e) {
|
|
133
|
-
if (this.resetLeadingZero(), !e)
|
|
134
|
-
return this.setExisting(t, !1), { value: null };
|
|
135
|
-
const s = this.intl.formatDate(this.value, this.format), r = this.dateFormatString(this.value, this.format), n = r.symbols;
|
|
136
|
-
let i = !1, h = "", l = "", d = "";
|
|
137
|
-
for (let o = 0; o < s.length; o++)
|
|
138
|
-
n[o] === t ? (l += this.getExisting(t) ? s[o] : "0", i = !0) : i ? d += s[o] : h += s[o];
|
|
139
|
-
let a = null;
|
|
140
|
-
const g = this.matchMonth(e);
|
|
141
|
-
for (; l.length > 0 && l.charAt(0) === "0"; )
|
|
142
|
-
l = l.slice(1);
|
|
143
|
-
l.length >= 4 && (l = "");
|
|
144
|
-
for (let o = 0; o < 2; o++) {
|
|
145
|
-
let c = l + e, p = parseInt(c, 10);
|
|
146
|
-
if (a = this.intl.parseDate(h + c + d, this.format), !a && !isNaN(p) && !isNaN(parseInt(e, 10))) {
|
|
147
|
-
if (t === "M" && !g) {
|
|
148
|
-
const u = p - 1;
|
|
149
|
-
u > -1 && u < 12 && (a = m(this.value), a.setMonth(u), a.getMonth() !== u && (a = y(f(a, -1))));
|
|
150
|
-
}
|
|
151
|
-
t === "y" && (a = P(
|
|
152
|
-
parseInt(c, 10),
|
|
153
|
-
this.month ? this.value.getMonth() : 0,
|
|
154
|
-
this.date ? this.value.getDate() : 1,
|
|
155
|
-
this.hours ? this.value.getHours() : 0,
|
|
156
|
-
this.minutes ? this.value.getMinutes() : 0,
|
|
157
|
-
this.seconds ? this.value.getSeconds() : 0,
|
|
158
|
-
this.milliseconds ? this.value.getMilliseconds() : 0
|
|
159
|
-
), this.date && a.getDate() !== this.value.getDate() && (a = y(f(a, -1))));
|
|
160
|
-
}
|
|
161
|
-
if (a)
|
|
162
|
-
return this._value = a, this.setExisting(t, !0), { value: this.value };
|
|
163
|
-
l = "";
|
|
164
|
-
}
|
|
165
|
-
return g && (a = this.intl.parseDate(h + g + d, this.format), a) ? (this._value = a, this.setExisting(t, !0), { value: this.value }) : (e === "0" && (this.leadingZero = this.isAbbrMonth(r.partMap, t) ? null : { [t]: !0 }, this.setExisting(t, !1)), { value: null });
|
|
166
|
-
}
|
|
167
|
-
symbolMap(t) {
|
|
168
|
-
return this.intl.splitDateFormat(this.format).reduce(D, {})[t];
|
|
169
|
-
}
|
|
170
|
-
resetLeadingZero() {
|
|
171
|
-
const t = this.leadingZero !== null;
|
|
172
|
-
return this.leadingZero = null, t;
|
|
173
|
-
}
|
|
174
|
-
isAbbrMonth(t, e) {
|
|
175
|
-
const s = this.partPattern(t, e);
|
|
176
|
-
return s.type === "month" && s.names;
|
|
177
|
-
}
|
|
178
|
-
partPattern(t, e) {
|
|
179
|
-
return t.filter((s) => s.pattern.indexOf(e) !== -1)[0];
|
|
180
|
-
}
|
|
181
|
-
matchMonth(t) {
|
|
182
|
-
if (this.typedMonthPart += t.toLowerCase(), this.monthNames.length === 0)
|
|
183
|
-
return "";
|
|
184
|
-
for (; this.typedMonthPart.length > 0; ) {
|
|
185
|
-
for (let s = 0; s < this.monthNames.length; s++)
|
|
186
|
-
if (this.monthNames[s].toLowerCase().indexOf(this.typedMonthPart) === 0)
|
|
187
|
-
return this.monthNames[s];
|
|
188
|
-
const e = parseInt(this.typedMonthPart, 10);
|
|
189
|
-
if (e >= 1 && e <= 12 && e.toString() === this.typedMonthPart)
|
|
190
|
-
return this.monthNames[e - 1];
|
|
191
|
-
this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length);
|
|
192
|
-
}
|
|
193
|
-
return "";
|
|
194
|
-
}
|
|
195
|
-
allFormatedMonths() {
|
|
196
|
-
const t = this.intl.splitDateFormat(this.format);
|
|
197
|
-
for (let e = 0; e < t.length; e++)
|
|
198
|
-
if (t[e].type === "month" && t[e].names)
|
|
199
|
-
return this.intl.dateFormatNames(t[e].names);
|
|
200
|
-
return [];
|
|
201
|
-
}
|
|
202
|
-
dateFormatString(t, e) {
|
|
203
|
-
const s = this.intl.splitDateFormat(e), r = [], n = [];
|
|
204
|
-
for (let h = 0; h < s.length; h++) {
|
|
205
|
-
let l = this.intl.formatDate(t, { pattern: s[h].pattern }).length;
|
|
206
|
-
for (; l > 0; )
|
|
207
|
-
r.push(this.symbols[s[h].pattern[0]] || "_"), n.push(s[h]), l--;
|
|
208
|
-
}
|
|
209
|
-
const i = new x();
|
|
210
|
-
return i.symbols = r.join(""), i.partMap = n, i;
|
|
211
|
-
}
|
|
212
|
-
merge(t, e) {
|
|
213
|
-
let s = "", r = "", n = e.symbols;
|
|
214
|
-
for (let i = n.length - 1; i >= 0; i--)
|
|
215
|
-
if (this.knownParts.indexOf(n[i]) === -1 || this.getExisting(n[i]))
|
|
216
|
-
s = t[i] + s, r = n[i] + r;
|
|
217
|
-
else {
|
|
218
|
-
const h = n[i];
|
|
219
|
-
for (; i >= 0 && h === n[i]; )
|
|
220
|
-
i--;
|
|
221
|
-
for (i++, this.leadingZero && this.leadingZero[h] ? s = "0" + s : s = this.dateFieldName(e.partMap[i]) + s; r.length < s.length; )
|
|
222
|
-
r = n[i] + r;
|
|
223
|
-
}
|
|
224
|
-
return { text: s, format: r };
|
|
225
|
-
}
|
|
226
|
-
dateFieldName(t) {
|
|
227
|
-
const e = this.formatPlaceholder || "wide";
|
|
228
|
-
return e[t.type] ? e[t.type] : e === "formatPattern" ? t.pattern : this.intl.dateFieldName(Object.assign(t, { nameType: e }));
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
export {
|
|
232
|
-
k as KendoDate
|
|
233
|
-
};
|
package/dateinput/models/mask.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class s{constructor(){this.symbols="",this.partMap=[]}}exports.Mask=s;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
*-------------------------------------------------------------------------------------------
|
|
4
|
-
* Copyright © 2024 Progress Software Corporation. All rights reserved.
|
|
5
|
-
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
-
*-------------------------------------------------------------------------------------------
|
|
7
|
-
*/
|
|
8
|
-
"use client";
|
|
9
|
-
class t {
|
|
10
|
-
constructor() {
|
|
11
|
-
this.symbols = "", this.partMap = [];
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
t as Mask
|
|
16
|
-
};
|