@progress/kendo-react-dateinputs 7.2.4-develop.3 → 7.3.0-develop.1
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 +12 -0
- package/calendar/components/Calendar.mjs +328 -0
- package/calendar/components/CalendarCell.js +8 -0
- package/calendar/components/CalendarCell.mjs +101 -0
- package/calendar/components/CalendarHeaderTitle.js +8 -0
- package/calendar/components/CalendarHeaderTitle.mjs +23 -0
- package/calendar/components/CalendarNavigationItem.js +8 -0
- package/calendar/components/CalendarNavigationItem.mjs +29 -0
- package/calendar/components/CalendarWeekCell.js +8 -0
- package/calendar/components/CalendarWeekCell.mjs +23 -0
- package/calendar/components/Header.js +8 -0
- package/calendar/components/Header.mjs +78 -0
- package/calendar/components/HorizontalViewList.js +8 -0
- package/calendar/components/HorizontalViewList.mjs +120 -0
- package/calendar/components/MultiViewCalendar.js +8 -0
- package/calendar/components/MultiViewCalendar.mjs +428 -0
- package/calendar/components/Navigation.js +8 -0
- package/calendar/components/Navigation.mjs +117 -0
- package/calendar/components/TodayCommand.js +8 -0
- package/calendar/components/TodayCommand.mjs +74 -0
- package/calendar/components/View.js +8 -0
- package/calendar/components/View.mjs +153 -0
- package/calendar/components/ViewList.js +8 -0
- package/calendar/components/ViewList.mjs +228 -0
- package/calendar/models/CalendarViewEnum.js +8 -0
- package/calendar/models/CalendarViewEnum.mjs +12 -0
- package/calendar/models/NavigationAction.js +8 -0
- package/calendar/models/NavigationAction.mjs +12 -0
- package/calendar/models/SelectionRange.js +8 -0
- package/calendar/models/SelectionRange.mjs +12 -0
- package/calendar/services/BusViewService.js +8 -0
- package/calendar/services/BusViewService.mjs +58 -0
- package/calendar/services/CenturyViewService.js +8 -0
- package/calendar/services/CenturyViewService.mjs +126 -0
- package/calendar/services/DOMService.js +14 -0
- package/calendar/services/DOMService.mjs +124 -0
- package/calendar/services/DecadeViewService.js +8 -0
- package/calendar/services/DecadeViewService.mjs +126 -0
- package/calendar/services/MonthViewService.js +8 -0
- package/calendar/services/MonthViewService.mjs +139 -0
- package/calendar/services/NavigationService.js +8 -0
- package/calendar/services/NavigationService.mjs +36 -0
- package/calendar/services/ScrollSyncService.js +8 -0
- package/calendar/services/ScrollSyncService.mjs +50 -0
- package/calendar/services/WeekNamesService.js +8 -0
- package/calendar/services/WeekNamesService.mjs +24 -0
- package/calendar/services/YearViewService.js +8 -0
- package/calendar/services/YearViewService.mjs +135 -0
- package/common/AdaptiveMode.js +8 -0
- package/common/AdaptiveMode.mjs +73 -0
- package/common/PickerWrap.js +8 -0
- package/common/PickerWrap.mjs +32 -0
- package/common/constants.js +8 -0
- package/common/constants.mjs +12 -0
- package/dateinput/DateInput.js +8 -0
- package/dateinput/DateInput.mjs +503 -0
- package/dateinput/models/kendo-date.js +8 -0
- package/dateinput/models/kendo-date.mjs +233 -0
- package/dateinput/models/mask.js +8 -0
- package/dateinput/models/mask.mjs +16 -0
- package/dateinput/utils.js +8 -0
- package/dateinput/utils.mjs +38 -0
- package/datepicker/DatePicker.js +8 -0
- package/datepicker/DatePicker.mjs +462 -0
- package/datepicker/ToggleButton.js +8 -0
- package/datepicker/ToggleButton.mjs +13 -0
- package/daterangepicker/DateRangePicker.js +8 -0
- package/daterangepicker/DateRangePicker.mjs +426 -0
- package/datetimepicker/DateTimePicker.js +8 -0
- package/datetimepicker/DateTimePicker.mjs +475 -0
- package/datetimepicker/DateTimeSelector.js +8 -0
- package/datetimepicker/DateTimeSelector.mjs +275 -0
- package/dist/cdn/js/kendo-react-dateinputs.js +8 -21
- package/hooks/usePickerFloatingLabel.js +8 -0
- package/hooks/usePickerFloatingLabel.mjs +31 -0
- package/index.d.mts +4528 -5
- package/index.d.ts +4528 -39
- package/index.js +8 -21
- package/index.mjs +114 -6540
- package/messages/index.js +8 -0
- package/messages/index.mjs +59 -0
- package/package-metadata.js +8 -0
- package/package-metadata.mjs +19 -0
- package/package.json +7 -7
- package/timepicker/TimeList.js +14 -0
- package/timepicker/TimeList.mjs +230 -0
- package/timepicker/TimePart.js +8 -0
- package/timepicker/TimePart.mjs +267 -0
- package/timepicker/TimePicker.js +8 -0
- package/timepicker/TimePicker.mjs +479 -0
- package/timepicker/TimeSelector.js +8 -0
- package/timepicker/TimeSelector.mjs +250 -0
- package/timepicker/models/TimePart.js +8 -0
- package/timepicker/models/TimePart.mjs +18 -0
- package/timepicker/services/DOMService.js +8 -0
- package/timepicker/services/DOMService.mjs +34 -0
- package/timepicker/services/DayPeriodService.js +8 -0
- package/timepicker/services/DayPeriodService.mjs +89 -0
- package/timepicker/services/HoursService.js +8 -0
- package/timepicker/services/HoursService.mjs +92 -0
- package/timepicker/services/MinutesService.js +8 -0
- package/timepicker/services/MinutesService.mjs +91 -0
- package/timepicker/services/SecondsService.js +8 -0
- package/timepicker/services/SecondsService.mjs +91 -0
- package/timepicker/utils.js +8 -0
- package/timepicker/utils.mjs +91 -0
- package/utils.js +8 -0
- package/utils.mjs +111 -0
- package/virtualization/Virtualization.js +8 -0
- package/virtualization/Virtualization.mjs +204 -0
- package/virtualization/services/RowHeightService.js +8 -0
- package/virtualization/services/RowHeightService.mjs +50 -0
- package/virtualization/services/ScrollerService.js +8 -0
- package/virtualization/services/ScrollerService.mjs +52 -0
- package/PopupSettings.d.ts +0 -18
- package/calendar/components/Calendar.d.ts +0 -191
- package/calendar/components/CalendarCell.d.ts +0 -39
- package/calendar/components/CalendarHeaderTitle.d.ts +0 -32
- package/calendar/components/CalendarNavigationItem.d.ts +0 -31
- package/calendar/components/CalendarWeekCell.d.ts +0 -29
- package/calendar/components/Header.d.ts +0 -58
- package/calendar/components/HorizontalViewList.d.ts +0 -71
- package/calendar/components/MultiViewCalendar.d.ts +0 -212
- package/calendar/components/Navigation.d.ts +0 -80
- package/calendar/components/TodayCommand.d.ts +0 -35
- package/calendar/components/View.d.ts +0 -89
- package/calendar/components/ViewList.d.ts +0 -115
- package/calendar/models/ActiveView.d.ts +0 -8
- package/calendar/models/CalendarSettings.d.ts +0 -106
- package/calendar/models/CalendarViewEnum.d.ts +0 -13
- package/calendar/models/CellContext.d.ts +0 -23
- package/calendar/models/MultiViewCalendarMode.d.ts +0 -13
- package/calendar/models/MultiViewCalendarSettings.d.ts +0 -115
- package/calendar/models/NavigationAction.d.ts +0 -19
- package/calendar/models/SelectionRange.d.ts +0 -21
- package/calendar/models/SelectionRangeEnd.d.ts +0 -8
- package/calendar/models/ViewService.d.ts +0 -29
- package/calendar/models/index.d.ts +0 -15
- package/calendar/services/BusViewService.d.ts +0 -25
- package/calendar/services/CenturyViewService.d.ts +0 -29
- package/calendar/services/DOMService.d.ts +0 -33
- package/calendar/services/DecadeViewService.d.ts +0 -31
- package/calendar/services/MonthViewService.d.ts +0 -37
- package/calendar/services/NavigationService.d.ts +0 -18
- package/calendar/services/ScrollSyncService.d.ts +0 -25
- package/calendar/services/WeekNamesService.d.ts +0 -13
- package/calendar/services/YearViewService.d.ts +0 -35
- package/calendar/services/index.d.ts +0 -14
- package/common/AdaptiveMode.d.ts +0 -25
- package/common/PickerWrap.d.ts +0 -22
- package/common/constants.d.ts +0 -8
- package/dateinput/DateInput.d.ts +0 -355
- package/dateinput/models/DateInputSettings.d.ts +0 -103
- package/dateinput/models/format-placeholder.d.ts +0 -43
- package/dateinput/models/incremental-steps.d.ts +0 -15
- package/dateinput/models/index.d.ts +0 -11
- package/dateinput/models/kendo-date.d.ts +0 -57
- package/dateinput/models/mask.d.ts +0 -11
- package/dateinput/models/selection.d.ts +0 -11
- package/dateinput/utils.d.ts +0 -34
- package/datepicker/DatePicker.d.ts +0 -358
- package/datepicker/ToggleButton.d.ts +0 -14
- package/datepicker/models/DatePickerSettings.d.ts +0 -141
- package/datepicker/models/index.d.ts +0 -6
- package/daterangepicker/DateRangePicker.d.ts +0 -354
- package/daterangepicker/models/DateRangePickerCalendarSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerDateInputSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerPopupSettings.d.ts +0 -10
- package/daterangepicker/models/DateRangePickerSettings.d.ts +0 -126
- package/daterangepicker/models/index.d.ts +0 -9
- package/datetimepicker/DateTimePicker.d.ts +0 -342
- package/datetimepicker/DateTimeSelector.d.ts +0 -106
- package/datetimepicker/models/DateTimePickerSettings.d.ts +0 -144
- package/datetimepicker/models/index.d.ts +0 -6
- package/hooks/usePickerFloatingLabel.d.ts +0 -24
- package/messages/index.d.ts +0 -124
- package/package-metadata.d.ts +0 -9
- package/timepicker/TimeList.d.ts +0 -91
- package/timepicker/TimePart.d.ts +0 -141
- package/timepicker/TimePicker.d.ts +0 -355
- package/timepicker/TimeSelector.d.ts +0 -144
- package/timepicker/models/IncrementalSteps.d.ts +0 -12
- package/timepicker/models/ListItem.d.ts +0 -11
- package/timepicker/models/ListService.d.ts +0 -19
- package/timepicker/models/ListServiceSettings.d.ts +0 -16
- package/timepicker/models/TimePart.d.ts +0 -14
- package/timepicker/models/TimePickerSettings.d.ts +0 -133
- package/timepicker/models/index.d.ts +0 -11
- package/timepicker/services/DOMService.d.ts +0 -14
- package/timepicker/services/DayPeriodService.d.ts +0 -51
- package/timepicker/services/HoursService.d.ts +0 -37
- package/timepicker/services/MinutesService.d.ts +0 -36
- package/timepicker/services/SecondsService.d.ts +0 -36
- package/timepicker/services/index.d.ts +0 -10
- package/timepicker/utils.d.ts +0 -60
- package/utils.d.ts +0 -100
- package/virtualization/Virtualization.d.ts +0 -120
- package/virtualization/services/RowHeightService.d.ts +0 -22
- package/virtualization/services/ScrollerService.d.ts +0 -53
- package/virtualization/services/index.d.ts +0 -7
|
@@ -0,0 +1,233 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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"});const b="d",r="wide",y=(h,e,t,u)=>{const l=h[u+h.length-t.length],f=h.substring(0,u+h.length-t.length),n=t.substring(0,u),p=[];if(f===n&&u>0)return p.push([e[u-1],n[u-1]]),p;if(f.indexOf(n)===0&&(n.length===0||e[n.length-1]!==e[n.length])){let s="";n.length===1&&p.push([e[0],n[0]]);for(let g=n.length;g<f.length;g++)e[g]!==s&&e[g]!=="_"&&(s=e[g],p.push([s,""]));return p}if(n.indexOf(f)===0||e[u-1]==="_"){let s=e[0];for(let g=Math.max(0,f.length-1);g<e.length;g++)if(e[g]!=="_"){s=e[g];break}return[[s,n[u-1]]]}return n[n.length-1]===" "||n[n.length-1]===l?[[e[u-1],"_"]]:[[e[u-1],n[u-1]]]},i=(h,e)=>(h[e.pattern[0]]=e.type,h),M=(h,e,t)=>h===null||!(e&&e>h||t&&t<h),a=["k-widget","k-dateinput"];exports.approximateStringMatching=y;exports.dateSymbolMap=i;exports.defaultFormat=b;exports.defaultFormatPlaceholder=r;exports.isInRange=M;exports.wrapperClasses=a;
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
const l = "d", y = "wide", _ = (h, e, g, u) => {
|
|
10
|
+
const b = h[u + h.length - g.length], p = h.substring(0, u + h.length - g.length), n = g.substring(0, u), t = [];
|
|
11
|
+
if (p === n && u > 0)
|
|
12
|
+
return t.push([e[u - 1], n[u - 1]]), t;
|
|
13
|
+
if (p.indexOf(n) === 0 && (n.length === 0 || e[n.length - 1] !== e[n.length])) {
|
|
14
|
+
let s = "";
|
|
15
|
+
n.length === 1 && t.push([e[0], n[0]]);
|
|
16
|
+
for (let f = n.length; f < p.length; f++)
|
|
17
|
+
e[f] !== s && e[f] !== "_" && (s = e[f], t.push([s, ""]));
|
|
18
|
+
return t;
|
|
19
|
+
}
|
|
20
|
+
if (n.indexOf(p) === 0 || e[u - 1] === "_") {
|
|
21
|
+
let s = e[0];
|
|
22
|
+
for (let f = Math.max(0, p.length - 1); f < e.length; f++)
|
|
23
|
+
if (e[f] !== "_") {
|
|
24
|
+
s = e[f];
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
return [[s, n[u - 1]]];
|
|
28
|
+
}
|
|
29
|
+
return n[n.length - 1] === " " || n[n.length - 1] === b ? [[e[u - 1], "_"]] : [[e[u - 1], n[u - 1]]];
|
|
30
|
+
}, k = (h, e) => (h[e.pattern[0]] = e.type, h), M = (h, e, g) => h === null || !(e && e > h || g && g < h), w = ["k-widget", "k-dateinput"];
|
|
31
|
+
export {
|
|
32
|
+
_ as approximateStringMatching,
|
|
33
|
+
k as dateSymbolMap,
|
|
34
|
+
l as defaultFormat,
|
|
35
|
+
y as defaultFormatPlaceholder,
|
|
36
|
+
M as isInRange,
|
|
37
|
+
w as wrapperClasses
|
|
38
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
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"});const K=require("react"),e=require("prop-types"),_=require("@progress/kendo-react-popup"),k=require("@progress/kendo-date-math"),a=require("@progress/kendo-react-common"),W=require("@progress/kendo-svg-icons"),U=require("../package-metadata.js"),j=require("../dateinput/DateInput.js"),$=require("../calendar/components/Calendar.js"),c=require("../utils.js"),C=require("../messages/index.js"),P=require("@progress/kendo-react-intl"),H=require("./ToggleButton.js"),X=require("../common/PickerWrap.js"),Z=require("../hooks/usePickerFloatingLabel.js"),G=require("@progress/kendo-react-layout"),J=require("../common/AdaptiveMode.js"),Q=require("../common/constants.js");function Y(l){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(s,t,i.get?i:{enumerable:!0,get:()=>l[t]})}}return s.default=l,Object.freeze(s)}const r=Y(K),o=class o extends r.Component{constructor(s){super(s),this._element=null,this._dateInput=r.createRef(),this._calendar=null,this.shouldFocusDateInput=!1,this.prevShow=!1,this.focus=()=>{this.dateInput&&this.dateInput.focus()},this.setCalendarRef=t=>{this._calendar=t},this.nextValue=(t,i)=>t.value!==void 0?t.value:i.value,this.nextShow=(t,i)=>t.show!==void 0?t.show:i.show,this.renderPopup=()=>{const{disabled:t,min:i,max:n,weekNumber:m,focusedDate:g}=this.props,{popupClass:u,...f}=this.props.popupSettings,v=this.show,h=this.value,w=h&&k.getDate(h),b=a.classNames("k-calendar-container k-group k-reset",u),y={popupClass:"k-datepicker-popup",show:v,anchor:this._element,className:b,id:this._popupId,anchorAlign:{horizontal:"left",vertical:"bottom"},popupAlign:{horizontal:"left",vertical:"top"},...f},p={disabled:t,value:w,min:i,max:n,weekNumber:m,focusedDate:g,className:this.mobileMode?"k-calendar-lg":"",navigation:!this.mobileMode,onChange:this.handleCalendarValueChange};return this.mobileMode?r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...p}):r.createElement(this.popupComp,{...y},r.createElement(this.calendarComp,{_ref:this.setCalendarRef,...p}))},this.renderAdaptivePopup=()=>{const{windowWidth:t=0}=this.state,i={expand:this.show,onClose:this.handleBlur,adaptiveTitle:this.props.adaptiveTitle,windowWidth:t};return r.createElement(J.AdaptiveMode,{...i},r.createElement(G.ActionSheetContent,{className:"!k-overflow-hidden"},this.renderPopup()))},this.handleInputValueChange=t=>{this.handleValueChange(t.value,t)},this.handleCalendarValueChange=t=>{const i=this.mergeTime(t.value);this.handleValueChange(i,t)},this.handleValueChange=(t,i)=>{this.setState({value:k.cloneDate(t||void 0)}),this.valueDuringOnChange=t,this.showDuringOnChange=!1,this.mobileMode||(this.shouldFocusDateInput=!0);const{onChange:n}=this.props;n&&n.call(void 0,{syntheticEvent:i.syntheticEvent,nativeEvent:i.nativeEvent,value:this.value,show:this.show,target:this}),this.valueDuringOnChange=void 0,this.showDuringOnChange=void 0,this.setShow(!1)},this.handleFocus=()=>{this.setState({focused:!0})},this.handleBlur=()=>{this.setState({focused:!1}),this.setShow(!1)},this.handleIconClick=()=>{this.props.disabled||(this.shouldFocusDateInput=!0,this.setShow(!this.show))},this.handleIconMouseDown=t=>{t.preventDefault()},this.handleKeyDown=t=>{const{altKey:i,keyCode:n}=t;if(n===a.Keys.esc){this.shouldFocusDateInput=!0,this.setShow(!1);return}i&&(n===a.Keys.up||n===a.Keys.down)&&(t.preventDefault(),t.stopPropagation(),this.shouldFocusDateInput=n===a.Keys.up,this.setShow(n===a.Keys.down))},a.validatePackage(U.packageMetadata),this.state={value:this.props.defaultValue||o.defaultProps.defaultValue,show:this.props.defaultShow||o.defaultProps.defaultShow,focused:!1}}get _popupId(){return this.props.id+"-popup-id"}get document(){if(a.canUseDOM)return this.element&&this.element.ownerDocument||document}get element(){return this._element}get mobileMode(){return!!(this.state.windowWidth&&this.state.windowWidth<=Q.MOBILE_MEDIUM_DEVISE&&this.props.adaptive)}get dateInput(){return this._dateInput.current}get calendar(){return this._calendar}get value(){const s=this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.props.value!==void 0?this.props.value:this.state.value;return s!==null?k.cloneDate(s):null}get show(){return this.showDuringOnChange!==void 0?this.showDuringOnChange:this.props.show!==void 0?this.props.show:this.state.show}get name(){return this.props.name}get min(){return this.props.min!==void 0?this.props.min:o.defaultProps.min}get max(){return this.props.max!==void 0?this.props.max:o.defaultProps.max}get dateInputComp(){return this.props.dateInput||o.defaultProps.dateInput}get toggleButtonComp(){return this.props.toggleButton||o.defaultProps.toggleButton}get calendarComp(){return this.props.calendar||o.defaultProps.calendar}get popupComp(){return this.props.popup||o.defaultProps.popup}get pickerWrapComp(){return this.props.pickerWrap||o.defaultProps.pickerWrap}get validity(){const s=c.isInDateRange(this.value,this.min,this.max),t=this.props.validationMessage!==void 0,i=(!this.required||this.value!==null)&&s,n=this.props.valid!==void 0?this.props.valid:i;return{customError:t,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:n,valueMissing:this.value===null}}get validityStyles(){return this.props.validityStyles!==void 0?this.props.validityStyles:o.defaultProps.validityStyles}get required(){return this.props.required!==void 0?this.props.required:o.defaultProps.required}componentDidMount(){var s;this.observerResize=a.canUseDOM&&window.ResizeObserver&&new window.ResizeObserver(this.calculateMedia.bind(this)),this.show&&this.forceUpdate(),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.observe(this.document.body)}componentDidUpdate(){this._calendar&&this._calendar.element&&this.show&&!this.prevShow&&this._calendar.element.focus({preventScroll:!0}),this.dateInput&&this.dateInput.element&&!this.show&&this.shouldFocusDateInput&&this.dateInput.element.focus({preventScroll:!0}),this.prevShow=this.show,this.shouldFocusDateInput=!1}componentWillUnmount(){var s;clearTimeout(this.nextTickId),(s=this.document)!=null&&s.body&&this.observerResize&&this.observerResize.disconnect()}render(){const{size:s=o.defaultProps.size,rounded:t=o.defaultProps.rounded,fillMode:i=o.defaultProps.fillMode,disabled:n,tabIndex:m,title:g,id:u,format:f,formatPlaceholder:v,min:h,max:w,className:b,width:y,name:p,validationMessage:T,required:q,validityStyles:x,ariaLabelledBy:E,ariaDescribedBy:R,ariaLabel:B}=this.props,z=this.show,N=this.value,D=!this.validityStyles||this.validity.valid,F={disabled:n,format:f,formatPlaceholder:v,id:u,ariaLabelledBy:E,ariaDescribedBy:R,ariaLabel:B,max:w,min:h,name:p,onChange:this.handleInputValueChange,required:q,tabIndex:z?-1:m,title:g,valid:this.validity.valid,validationMessage:T,validityStyles:x,value:N,label:void 0,placeholder:this.state.focused?null:this.props.placeholder,ariaExpanded:this.show,size:null,fillMode:null,rounded:null},I=P.provideLocalizationService(this).toLanguageString(C.toggleCalendar,C.messages[C.toggleCalendar]),O=r.createElement(a.AsyncFocusBlur,{onFocus:this.handleFocus,onBlur:this.mobileMode?void 0:this.handleBlur,onSyncBlur:this.props.onBlur,onSyncFocus:this.props.onFocus},({onFocus:V,onBlur:A})=>r.createElement(r.Fragment,null,r.createElement("span",{ref:L=>{this._element=L},className:a.classNames("k-input","k-datepicker",{[`k-input-${a.kendoThemeMaps.sizeMap[s]||s}`]:s,[`k-rounded-${a.kendoThemeMaps.roundedMap[t]||t}`]:t,[`k-input-${i}`]:i,"k-invalid":!D,"k-required":this.required,"k-disabled":this.props.disabled},b),onKeyDown:this.handleKeyDown,style:{width:y},onFocus:V,onBlur:A,onClick:this.mobileMode?this.handleIconClick:void 0},r.createElement(this.dateInputComp,{_ref:this._dateInput,ariaRole:"combobox",readonly:this.mobileMode,ariaExpanded:this.show,ariaControls:this._popupId,...F}),r.createElement(this.toggleButtonComp,{type:"button",icon:"calendar",svgIcon:W.calendarIcon,title:I,className:"k-input-button",rounded:null,onClick:this.mobileMode?void 0:this.handleIconClick,"aria-label":I,onMouseDown:this.handleIconMouseDown}),!this.mobileMode&&this.renderPopup()),this.mobileMode&&this.renderAdaptivePopup()));return this.props.label?r.createElement(Z.PickerFloatingLabel,{dateInput:this._dateInput,label:this.props.label,editorId:u,editorValid:D,editorDisabled:this.props.disabled,children:O,style:{width:this.props.width}}):O}setShow(s){const{onOpen:t,onClose:i}=this.props;this.show!==s&&(this.setState({show:s}),s&&t&&t.call(void 0,{target:this}),!s&&i&&i.call(void 0,{target:this}))}mergeTime(s){return this.value&&s?c.setTime(s,this.value):s}nextTick(s){clearTimeout(this.nextTickId),this.nextTickId=window.setTimeout(()=>s())}calculateMedia(s){for(let t of s)this.setState({windowWidth:t.target.clientWidth})}};o.displayName="DatePicker",o.propTypes={className:e.string,defaultShow:e.bool,defaultValue:e.instanceOf(Date),disabled:e.bool,focusedDate:e.instanceOf(Date),format:e.oneOfType([e.string,e.shape({skeleton:e.string,pattern:e.string,date:e.oneOf(["short","medium","long","full"]),time:e.oneOf(["short","medium","long","full"]),datetime:e.oneOf(["short","medium","long","full"]),era:e.oneOf(["narrow","short","long"]),year:e.oneOf(["numeric","2-digit"]),month:e.oneOf(["numeric","2-digit","narrow","short","long"]),day:e.oneOf(["numeric","2-digit"]),weekday:e.oneOf(["narrow","short","long"]),hour:e.oneOf(["numeric","2-digit"]),hour12:e.bool,minute:e.oneOf(["numeric","2-digit"]),second:e.oneOf(["numeric","2-digit"]),timeZoneName:e.oneOf(["short","long"])})]),formatPlaceholder:e.oneOfType([e.oneOf(["wide","narrow","short","formatPattern"]),e.shape({year:e.string,month:e.string,day:e.string,hour:e.string,minute:e.string,second:e.string})]),id:e.string,ariaLabelledBy:e.string,ariaDescribedBy:e.string,ariaLabel:e.string,min:e.instanceOf(Date),max:e.instanceOf(Date),name:e.string,popupSettings:e.shape({animate:e.bool,appendTo:e.any,popupClass:e.string}),show:e.bool,tabIndex:e.number,title:e.string,value:e.instanceOf(Date),weekNumber:e.bool,width:e.oneOfType([e.number,e.string]),validationMessage:e.string,required:e.bool,validate:e.bool,valid:e.bool,size:e.oneOf([null,"small","medium","large"]),rounded:e.oneOf([null,"small","medium","large","full"]),fillMode:e.oneOf([null,"solid","flat","outline"]),adaptive:e.bool,adaptiveTitle:e.string},o.defaultProps={defaultShow:!1,defaultValue:null,dateInput:j.DateInput,calendar:$.Calendar,toggleButton:H.ToggleButton,popup:_.Popup,pickerWrap:X.PickerWrap,disabled:!1,format:"d",max:c.MAX_DATE,min:c.MIN_DATE,popupSettings:{},tabIndex:0,weekNumber:!1,required:!1,validityStyles:!0,size:"medium",rounded:"medium",fillMode:"solid"};let d=o;const M=a.createPropsContext(),S=a.withIdHOC(a.withPropsContext(M,d));S.displayName="KendoReactDatePicker";P.registerForLocalization(d);exports.DatePicker=S;exports.DatePickerPropsContext=M;exports.DatePickerWithoutContext=d;
|