@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,139 @@
|
|
|
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 { addDays as g, addWeeks as I, addMonths as h, firstDayOfMonth as y, lastDayOfMonth as D, dayOfWeek as F, getDate as u, durationInMonths as d } from "@progress/kendo-date-math";
|
|
10
|
+
import { Action as o } from "../models/NavigationAction.mjs";
|
|
11
|
+
import { EMPTY_SELECTIONRANGE as O } from "../models/SelectionRange.mjs";
|
|
12
|
+
import { range as w, getToday as W, isInRange as T, isInSelectionRange as Y } from "../../utils.mjs";
|
|
13
|
+
const U = [[]], S = 7, _ = 6, $ = 6, C = 0, G = {
|
|
14
|
+
[o.Left]: (s) => g(s, -1),
|
|
15
|
+
[o.Up]: (s) => I(s, -1),
|
|
16
|
+
[o.Right]: (s) => g(s, 1),
|
|
17
|
+
[o.Down]: (s) => I(s, 1),
|
|
18
|
+
[o.PrevView]: (s) => h(s, -1),
|
|
19
|
+
[o.NextView]: (s) => h(s, 1),
|
|
20
|
+
[o.FirstInView]: (s) => y(s),
|
|
21
|
+
[o.LastInView]: (s) => D(s)
|
|
22
|
+
};
|
|
23
|
+
class Q {
|
|
24
|
+
constructor(t) {
|
|
25
|
+
this.intl = t;
|
|
26
|
+
}
|
|
27
|
+
addToDate(t, e) {
|
|
28
|
+
return h(t, e);
|
|
29
|
+
}
|
|
30
|
+
datesList(t, e) {
|
|
31
|
+
return w(0, e).map((n) => h(t, n));
|
|
32
|
+
}
|
|
33
|
+
data(t) {
|
|
34
|
+
const {
|
|
35
|
+
cellUID: e,
|
|
36
|
+
focusedDate: n,
|
|
37
|
+
isActiveView: l,
|
|
38
|
+
max: r,
|
|
39
|
+
min: a,
|
|
40
|
+
selectedDate: c,
|
|
41
|
+
selectionRange: m = O,
|
|
42
|
+
viewDate: f
|
|
43
|
+
} = t;
|
|
44
|
+
if (!f)
|
|
45
|
+
return U;
|
|
46
|
+
const M = y(f), R = D(f), N = F(M, this.intl.firstDay(), -1), b = w(0, S), q = W();
|
|
47
|
+
return w(0, _).map((V) => {
|
|
48
|
+
const v = g(N, V * S);
|
|
49
|
+
return b.map((L) => {
|
|
50
|
+
const i = this.normalize(g(v, L), a, r);
|
|
51
|
+
if (i < M || i > R)
|
|
52
|
+
return null;
|
|
53
|
+
const p = this.isEqual(i, m.start), A = this.isEqual(i, m.end), E = !p && !A && Y(i, m), k = l && (Array.isArray(c) ? this.isSelectedFromArray(i, c, a, r) : T(c, a, r) && this.isEqual(i, c));
|
|
54
|
+
return {
|
|
55
|
+
formattedValue: this.value(i),
|
|
56
|
+
id: `${e}${i.getTime()}`,
|
|
57
|
+
isFocused: this.isEqual(i, n),
|
|
58
|
+
isSelected: k,
|
|
59
|
+
isInRange: T(i, a, r),
|
|
60
|
+
isWeekend: this.isWeekend(i),
|
|
61
|
+
isRangeStart: p,
|
|
62
|
+
isRangeMid: E,
|
|
63
|
+
isRangeEnd: A,
|
|
64
|
+
isRangeSplitStart: E && this.isEqual(i, M),
|
|
65
|
+
isRangeSplitEnd: E && this.isEqual(i, R),
|
|
66
|
+
isToday: this.isEqual(i, q),
|
|
67
|
+
title: this.cellTitle(i),
|
|
68
|
+
value: i
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
isEqual(t, e) {
|
|
74
|
+
return !t || !e ? !1 : u(t).getTime() === u(e).getTime();
|
|
75
|
+
}
|
|
76
|
+
isSelectedFromArray(t, e, n, l) {
|
|
77
|
+
let r = !1;
|
|
78
|
+
return e.forEach((a) => {
|
|
79
|
+
T(t, n, l) && this.isEqual(t, a) && (r = !0);
|
|
80
|
+
}), r;
|
|
81
|
+
}
|
|
82
|
+
isInArray(t, e) {
|
|
83
|
+
return !!e.length && y(e[0]) <= t && t <= D(e[e.length - 1]);
|
|
84
|
+
}
|
|
85
|
+
isInRange(t, e, n) {
|
|
86
|
+
const l = u(t), r = !e || u(e) <= l, a = !n || l <= u(n);
|
|
87
|
+
return r && a;
|
|
88
|
+
}
|
|
89
|
+
isInSameView(t, e) {
|
|
90
|
+
return d(t, e) === 0;
|
|
91
|
+
}
|
|
92
|
+
isRangeStart(t) {
|
|
93
|
+
return !t.getMonth();
|
|
94
|
+
}
|
|
95
|
+
move(t, e) {
|
|
96
|
+
const n = G[e];
|
|
97
|
+
return n ? n(t) : t;
|
|
98
|
+
}
|
|
99
|
+
cellTitle(t) {
|
|
100
|
+
return this.intl.formatDate(t, "D");
|
|
101
|
+
}
|
|
102
|
+
navigationTitle(t) {
|
|
103
|
+
return t ? this.isRangeStart(t) ? t.getFullYear().toString() : this.abbrMonthNames()[t.getMonth()] : "";
|
|
104
|
+
}
|
|
105
|
+
title(t) {
|
|
106
|
+
return `${this.wideMonthNames()[t.getMonth()]} ${t.getFullYear()}`;
|
|
107
|
+
}
|
|
108
|
+
rowLength(t) {
|
|
109
|
+
return S + (t ? 1 : 0);
|
|
110
|
+
}
|
|
111
|
+
skip(t, e) {
|
|
112
|
+
return d(e, t);
|
|
113
|
+
}
|
|
114
|
+
total(t, e) {
|
|
115
|
+
return d(t, e) + 1;
|
|
116
|
+
}
|
|
117
|
+
value(t) {
|
|
118
|
+
return t ? t.getDate().toString() : "";
|
|
119
|
+
}
|
|
120
|
+
viewDate(t, e, n = 1) {
|
|
121
|
+
return d(t, e) < n ? h(t, -1) : t;
|
|
122
|
+
}
|
|
123
|
+
isWeekend(t) {
|
|
124
|
+
const e = t.getDay();
|
|
125
|
+
return e === $ || e === C;
|
|
126
|
+
}
|
|
127
|
+
abbrMonthNames() {
|
|
128
|
+
return this.intl.dateFormatNames({ nameType: "abbreviated", type: "months" });
|
|
129
|
+
}
|
|
130
|
+
normalize(t, e, n) {
|
|
131
|
+
return t < e && this.isEqual(t, e) ? u(e) : t > n && this.isEqual(t, n) ? u(n) : t;
|
|
132
|
+
}
|
|
133
|
+
wideMonthNames() {
|
|
134
|
+
return this.intl.dateFormatNames({ nameType: "wide", type: "months", standAlone: !0 });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
Q as MonthViewService
|
|
139
|
+
};
|
|
@@ -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 t=require("../models/NavigationAction.js"),c={33:t.Action.PrevView,34:t.Action.NextView,35:t.Action.LastInView,36:t.Action.FirstInView,37:t.Action.Left,38:t.Action.Up,39:t.Action.Right,40:t.Action.Down,"meta+38":t.Action.UpperView,"meta+40":t.Action.LowerView};class s{constructor(i){this.bus=i}action(i){const o=`${i.ctrlKey||i.metaKey?"meta+":""}${i.keyCode}`;return c[o]}move(i,o,e,n,r){return n?o===t.Action.UpperView&&this.bus.canMoveUp(e)?(this.bus.moveUp(e,r),i):o===t.Action.LowerView&&this.bus.canMoveDown(e)?(this.bus.moveDown(e,r),i):n.move(i,o):i}}exports.NavigationService=s;
|
|
@@ -0,0 +1,36 @@
|
|
|
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 { Action as t } from "../models/NavigationAction.mjs";
|
|
10
|
+
const n = {
|
|
11
|
+
33: t.PrevView,
|
|
12
|
+
34: t.NextView,
|
|
13
|
+
35: t.LastInView,
|
|
14
|
+
36: t.FirstInView,
|
|
15
|
+
37: t.Left,
|
|
16
|
+
38: t.Up,
|
|
17
|
+
39: t.Right,
|
|
18
|
+
40: t.Down,
|
|
19
|
+
"meta+38": t.UpperView,
|
|
20
|
+
"meta+40": t.LowerView
|
|
21
|
+
};
|
|
22
|
+
class p {
|
|
23
|
+
constructor(e) {
|
|
24
|
+
this.bus = e;
|
|
25
|
+
}
|
|
26
|
+
action(e) {
|
|
27
|
+
const r = `${e.ctrlKey || e.metaKey ? "meta+" : ""}${e.keyCode}`;
|
|
28
|
+
return n[r];
|
|
29
|
+
}
|
|
30
|
+
move(e, r, o, i, s) {
|
|
31
|
+
return i ? r === t.UpperView && this.bus.canMoveUp(o) ? (this.bus.moveUp(o, s), e) : r === t.LowerView && this.bus.canMoveDown(o) ? (this.bus.moveDown(o, s), e) : i.move(e, r) : e;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
p as NavigationService
|
|
36
|
+
};
|
|
@@ -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 n=l=>t=>Math.floor(t/l),o=l=>t=>t*l;class s{constructor(t){this.dom=t,this.divideByMagnitude=null,this.powerByMagnitude=null,this.navigator=null,this.view=null,this.monthScrolled=!1,this.navScrolled=!1}configure(t){const i=Math.max(this.dom.viewHeight(t)/this.dom.navigationItemHeight,1);this.divideByMagnitude=n(i),this.powerByMagnitude=o(i)}sync(t,i,e){if(!(!t||!i)){if(this.navigator=t,this.view=i,e.target===this.navigator.element){if(this.monthScrolled){this.monthScrolled=!1;return}this.navScrolled=!0,this.scrollSiblingOf(this.navigator.element)}if(e.target===this.view.element){if(this.navScrolled){this.navScrolled=!1;return}this.monthScrolled=!0,this.scrollSiblingOf(this.view.element)}}}scrollSiblingOf(t){const i=this.siblingComponent(t),e=this.calculateScroll(i,t.scrollTop);i.scrollTo(e)}siblingComponent(t){return this.navigator.element===t?this.view:this.navigator}calculateScroll(t,i){const e=t===this.navigator?this.divideByMagnitude:this.powerByMagnitude;return e?e(i):0}}exports.ScrollSyncService=s;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 n = (l) => (t) => Math.floor(t / l), o = (l) => (t) => t * l;
|
|
10
|
+
class s {
|
|
11
|
+
constructor(t) {
|
|
12
|
+
this.dom = t, this.divideByMagnitude = null, this.powerByMagnitude = null, this.navigator = null, this.view = null, this.monthScrolled = !1, this.navScrolled = !1;
|
|
13
|
+
}
|
|
14
|
+
configure(t) {
|
|
15
|
+
const i = Math.max(this.dom.viewHeight(t) / this.dom.navigationItemHeight, 1);
|
|
16
|
+
this.divideByMagnitude = n(i), this.powerByMagnitude = o(i);
|
|
17
|
+
}
|
|
18
|
+
sync(t, i, e) {
|
|
19
|
+
if (!(!t || !i)) {
|
|
20
|
+
if (this.navigator = t, this.view = i, e.target === this.navigator.element) {
|
|
21
|
+
if (this.monthScrolled) {
|
|
22
|
+
this.monthScrolled = !1;
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
this.navScrolled = !0, this.scrollSiblingOf(this.navigator.element);
|
|
26
|
+
}
|
|
27
|
+
if (e.target === this.view.element) {
|
|
28
|
+
if (this.navScrolled) {
|
|
29
|
+
this.navScrolled = !1;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
this.monthScrolled = !0, this.scrollSiblingOf(this.view.element);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
scrollSiblingOf(t) {
|
|
37
|
+
const i = this.siblingComponent(t), e = this.calculateScroll(i, t.scrollTop);
|
|
38
|
+
i.scrollTo(e);
|
|
39
|
+
}
|
|
40
|
+
siblingComponent(t) {
|
|
41
|
+
return this.navigator.element === t ? this.view : this.navigator;
|
|
42
|
+
}
|
|
43
|
+
calculateScroll(t, i) {
|
|
44
|
+
const e = t === this.navigator ? this.divideByMagnitude : this.powerByMagnitude;
|
|
45
|
+
return e ? e(i) : 0;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
s as ScrollSyncService
|
|
50
|
+
};
|
|
@@ -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 s=require("../../utils.js");class a{constructor(e){this.intl=e}getWeekNames(e=!1){const t=s.shiftWeekNames(this.intl.dateFormatNames({nameType:"short",type:"days"}),this.intl.firstDay());return e?[""].concat(t):t}}exports.WeekNamesService=a;
|
|
@@ -0,0 +1,24 @@
|
|
|
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 { shiftWeekNames as s } from "../../utils.mjs";
|
|
10
|
+
class r {
|
|
11
|
+
constructor(e) {
|
|
12
|
+
this.intl = e;
|
|
13
|
+
}
|
|
14
|
+
getWeekNames(e = !1) {
|
|
15
|
+
const t = s(
|
|
16
|
+
this.intl.dateFormatNames({ nameType: "short", type: "days" }),
|
|
17
|
+
this.intl.firstDay()
|
|
18
|
+
);
|
|
19
|
+
return e ? [""].concat(t) : t;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
r as WeekNamesService
|
|
24
|
+
};
|
|
@@ -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 n=require("@progress/kendo-date-math"),l=require("../models/NavigationAction.js"),u=require("../../utils.js"),m=require("../models/SelectionRange.js"),v=[[]],f=4,y=3,V=r=>r>4?-5:r<2?-2:-7,p=r=>r<7?5:r<10?7:2,N={[l.Action.Left]:r=>n.addMonths(r,-1),[l.Action.Up]:r=>n.addMonths(r,V(r.getMonth())),[l.Action.Right]:r=>n.addMonths(r,1),[l.Action.Down]:r=>n.addMonths(r,p(r.getMonth())),[l.Action.PrevView]:r=>n.addYears(r,-1),[l.Action.NextView]:r=>n.addYears(r,1),[l.Action.FirstInView]:r=>n.firstMonthOfYear(r),[l.Action.LastInView]:r=>n.lastMonthOfYear(r)};class L{constructor(e){this._intl=e}addToDate(e,t){return n.addYears(e,t)}datesList(e,t){return u.range(0,t).map(s=>n.addYears(e,s))}data(e){const{cellUID:t,focusedDate:s,isActiveView:c,max:i,min:o,selectedDate:g,selectionRange:h=m.EMPTY_SELECTIONRANGE,viewDate:d}=e;if(!d)return v;const A=this.abbrMonthNames(),Y=n.firstMonthOfYear(d),I=n.lastMonthOfYear(d),w=Y.getFullYear(),F=u.range(0,f),T=u.getToday();return u.range(0,y).map(R=>{const q=n.addMonths(Y,R*f);return F.map(D=>{const a=this.normalize(n.addMonths(q,D),o,i);if(w<a.getFullYear())return null;const E=this.isEqual(a,h.start),S=this.isEqual(a,h.end),M=!E&&!S&&u.isInSelectionRange(a,h),b=c&&(Array.isArray(g)?this.isSelectedFromArray(a,g,o,i):u.isInRange(g,o,i)&&this.isEqual(a,g));return{formattedValue:A[a.getMonth()],id:`${t}${a.getTime()}`,isFocused:this.isEqual(a,s),isSelected:b,isInRange:u.isInRange(a,o,i),isWeekend:!1,isRangeStart:E,isRangeMid:M,isRangeEnd:S,isRangeSplitEnd:M&&this.isEqual(a,I),isRangeSplitStart:M&&this.isEqual(a,Y),isToday:this.isEqual(a,T),title:this.cellTitle(a),value:a}})})}isSelectedFromArray(e,t,s,c){let i=!1;return t.forEach(o=>{u.isInRange(e,s,c)&&this.isEqual(e,o)&&(i=!0)}),i}isEqual(e,t){return!e||!t?!1:e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()}isInArray(e,t){if(!t.length)return!1;const s=e.getFullYear();return t[0].getFullYear()<=s&&s<=t[t.length-1].getFullYear()}isInRange(e,t,s){const c=n.createDate(e.getFullYear(),e.getMonth(),1),i=!t||n.createDate(t.getFullYear(),t.getMonth(),1)<=c,o=!s||c<=n.createDate(s.getFullYear(),s.getMonth(),1);return i&&o}isInSameView(e,t){return n.durationInYears(e,t)===0}isRangeStart(e){return e.getFullYear()%10===0}move(e,t){const s=N[t];return s?s(e):e}cellTitle(e){return`${e.getFullYear()} ${this.value(e)}`}navigationTitle(e){return this.title(e)}title(e){return e?e.getFullYear().toString():""}rowLength(e){return f}skip(e,t){return n.durationInYears(t,e)}total(e,t){return n.durationInYears(e,t)+1}value(e){return e?this.abbrMonthNames()[e.getMonth()]:""}viewDate(e,t,s=1){return n.durationInYears(e,t)<s?n.addYears(e,-1):e}abbrMonthNames(){return this._intl.dateFormatNames({nameType:"abbreviated",type:"months"})}normalize(e,t,s){return e<t&&this.isEqual(e,t)?n.cloneDate(t):e>s&&this.isEqual(e,s)?n.cloneDate(s):e}}exports.YearViewService=L;
|
|
@@ -0,0 +1,135 @@
|
|
|
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 { addMonths as u, addYears as g, firstMonthOfYear as I, lastMonthOfYear as R, createDate as M, durationInYears as h, cloneDate as p } from "@progress/kendo-date-math";
|
|
10
|
+
import { Action as o } from "../models/NavigationAction.mjs";
|
|
11
|
+
import { range as m, getToday as _, isInRange as F, isInSelectionRange as O } from "../../utils.mjs";
|
|
12
|
+
import { EMPTY_SELECTIONRANGE as $ } from "../models/SelectionRange.mjs";
|
|
13
|
+
const C = [[]], S = 4, G = 3, P = (r) => r > 4 ? -5 : r < 2 ? -2 : -7, k = (r) => r < 7 ? 5 : r < 10 ? 7 : 2, z = {
|
|
14
|
+
[o.Left]: (r) => u(r, -1),
|
|
15
|
+
[o.Up]: (r) => u(r, P(r.getMonth())),
|
|
16
|
+
[o.Right]: (r) => u(r, 1),
|
|
17
|
+
[o.Down]: (r) => u(r, k(r.getMonth())),
|
|
18
|
+
[o.PrevView]: (r) => g(r, -1),
|
|
19
|
+
[o.NextView]: (r) => g(r, 1),
|
|
20
|
+
[o.FirstInView]: (r) => I(r),
|
|
21
|
+
[o.LastInView]: (r) => R(r)
|
|
22
|
+
};
|
|
23
|
+
class K {
|
|
24
|
+
constructor(t) {
|
|
25
|
+
this._intl = t;
|
|
26
|
+
}
|
|
27
|
+
addToDate(t, e) {
|
|
28
|
+
return g(t, e);
|
|
29
|
+
}
|
|
30
|
+
datesList(t, e) {
|
|
31
|
+
return m(0, e).map((n) => g(t, n));
|
|
32
|
+
}
|
|
33
|
+
data(t) {
|
|
34
|
+
const {
|
|
35
|
+
cellUID: e,
|
|
36
|
+
focusedDate: n,
|
|
37
|
+
isActiveView: l,
|
|
38
|
+
max: i,
|
|
39
|
+
min: a,
|
|
40
|
+
selectedDate: c,
|
|
41
|
+
selectionRange: f = $,
|
|
42
|
+
viewDate: Y
|
|
43
|
+
} = t;
|
|
44
|
+
if (!Y)
|
|
45
|
+
return C;
|
|
46
|
+
const b = this.abbrMonthNames(), d = I(Y), q = R(Y), y = d.getFullYear(), A = m(0, S), V = _();
|
|
47
|
+
return m(0, G).map((v) => {
|
|
48
|
+
const D = u(d, v * S);
|
|
49
|
+
return A.map((N) => {
|
|
50
|
+
const s = this.normalize(u(D, N), a, i);
|
|
51
|
+
if (y < s.getFullYear())
|
|
52
|
+
return null;
|
|
53
|
+
const w = this.isEqual(s, f.start), T = this.isEqual(s, f.end), E = !w && !T && O(s, f), L = l && (Array.isArray(c) ? this.isSelectedFromArray(s, c, a, i) : F(c, a, i) && this.isEqual(s, c));
|
|
54
|
+
return {
|
|
55
|
+
formattedValue: b[s.getMonth()],
|
|
56
|
+
id: `${e}${s.getTime()}`,
|
|
57
|
+
isFocused: this.isEqual(s, n),
|
|
58
|
+
isSelected: L,
|
|
59
|
+
isInRange: F(s, a, i),
|
|
60
|
+
isWeekend: !1,
|
|
61
|
+
isRangeStart: w,
|
|
62
|
+
isRangeMid: E,
|
|
63
|
+
isRangeEnd: T,
|
|
64
|
+
isRangeSplitEnd: E && this.isEqual(s, q),
|
|
65
|
+
isRangeSplitStart: E && this.isEqual(s, d),
|
|
66
|
+
isToday: this.isEqual(s, V),
|
|
67
|
+
title: this.cellTitle(s),
|
|
68
|
+
value: s
|
|
69
|
+
};
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
isSelectedFromArray(t, e, n, l) {
|
|
74
|
+
let i = !1;
|
|
75
|
+
return e.forEach((a) => {
|
|
76
|
+
F(t, n, l) && this.isEqual(t, a) && (i = !0);
|
|
77
|
+
}), i;
|
|
78
|
+
}
|
|
79
|
+
isEqual(t, e) {
|
|
80
|
+
return !t || !e ? !1 : t.getFullYear() === e.getFullYear() && t.getMonth() === e.getMonth();
|
|
81
|
+
}
|
|
82
|
+
isInArray(t, e) {
|
|
83
|
+
if (!e.length)
|
|
84
|
+
return !1;
|
|
85
|
+
const n = t.getFullYear();
|
|
86
|
+
return e[0].getFullYear() <= n && n <= e[e.length - 1].getFullYear();
|
|
87
|
+
}
|
|
88
|
+
isInRange(t, e, n) {
|
|
89
|
+
const l = M(t.getFullYear(), t.getMonth(), 1), i = !e || M(e.getFullYear(), e.getMonth(), 1) <= l, a = !n || l <= M(n.getFullYear(), n.getMonth(), 1);
|
|
90
|
+
return i && a;
|
|
91
|
+
}
|
|
92
|
+
isInSameView(t, e) {
|
|
93
|
+
return h(t, e) === 0;
|
|
94
|
+
}
|
|
95
|
+
isRangeStart(t) {
|
|
96
|
+
return t.getFullYear() % 10 === 0;
|
|
97
|
+
}
|
|
98
|
+
move(t, e) {
|
|
99
|
+
const n = z[e];
|
|
100
|
+
return n ? n(t) : t;
|
|
101
|
+
}
|
|
102
|
+
cellTitle(t) {
|
|
103
|
+
return `${t.getFullYear()} ${this.value(t)}`;
|
|
104
|
+
}
|
|
105
|
+
navigationTitle(t) {
|
|
106
|
+
return this.title(t);
|
|
107
|
+
}
|
|
108
|
+
title(t) {
|
|
109
|
+
return t ? t.getFullYear().toString() : "";
|
|
110
|
+
}
|
|
111
|
+
rowLength(t) {
|
|
112
|
+
return S;
|
|
113
|
+
}
|
|
114
|
+
skip(t, e) {
|
|
115
|
+
return h(e, t);
|
|
116
|
+
}
|
|
117
|
+
total(t, e) {
|
|
118
|
+
return h(t, e) + 1;
|
|
119
|
+
}
|
|
120
|
+
value(t) {
|
|
121
|
+
return t ? this.abbrMonthNames()[t.getMonth()] : "";
|
|
122
|
+
}
|
|
123
|
+
viewDate(t, e, n = 1) {
|
|
124
|
+
return h(t, e) < n ? g(t, -1) : t;
|
|
125
|
+
}
|
|
126
|
+
abbrMonthNames() {
|
|
127
|
+
return this._intl.dateFormatNames({ nameType: "abbreviated", type: "months" });
|
|
128
|
+
}
|
|
129
|
+
normalize(t, e, n) {
|
|
130
|
+
return t < e && this.isEqual(t, e) ? p(e) : t > n && this.isEqual(t, n) ? p(n) : t;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export {
|
|
134
|
+
K as YearViewService
|
|
135
|
+
};
|
|
@@ -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 h=require("react"),l=require("@progress/kendo-react-layout"),k=require("@progress/kendo-svg-icons"),i=require("@progress/kendo-react-buttons");function v(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:()=>a[n]})}}return e.default=a,Object.freeze(e)}const t=v(h),s=500,g=a=>{const{footer:e,children:n,windowWidth:o=0,navigatable:d,navigatableElements:u,expand:m,animation:b,onClose:c,adaptiveTitle:p,mobileFilter:r}=a,f={navigatable:d||!1,navigatableElements:u||[],expand:m,animation:b!==!1,onClose:c,animationStyles:o<=s?{top:0,width:"100%",height:"100%"}:void 0,className:o<=s?"k-adaptive-actionsheet k-actionsheet-fullscreen":"k-adaptive-actionsheet k-actionsheet-bottom"};return t.createElement(l.ActionSheet,{...f},t.createElement(l.ActionSheetHeader,{className:"k-text-center"},t.createElement("div",{className:"k-actionsheet-titlebar-group k-hbox"},t.createElement("div",{className:"k-actionsheet-title"},t.createElement("div",null,p)),t.createElement("div",{className:"k-actionsheet-actions"},t.createElement(i.Button,{tabIndex:0,"aria-label":"Cancel","aria-disabled":"false",type:"button",fillMode:"flat",icon:"x",svgIcon:k.xIcon,onClick:c}))),r&&t.createElement("div",{className:"k-actionsheet-titlebar-group k-actionsheet-filter"},r)),n,e&&t.createElement(l.ActionSheetFooter,{className:"k-actions k-actions-stretched"},t.createElement(i.Button,{size:"large",tabIndex:0,"aria-label":e.cancelText,"aria-disabled":"false",type:"button",onClick:e.onCancel},e.cancelText),t.createElement(i.Button,{tabIndex:0,themeColor:"primary",size:"large","aria-label":e.applyText,"aria-disabled":"false",type:"button",onClick:e.onApply},e.applyText)))};exports.AdaptiveMode=g;
|
|
@@ -0,0 +1,73 @@
|
|
|
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 * as e from "react";
|
|
10
|
+
import { ActionSheet as f, ActionSheetHeader as k, ActionSheetFooter as E } from "@progress/kendo-react-layout";
|
|
11
|
+
import { xIcon as v } from "@progress/kendo-svg-icons";
|
|
12
|
+
import { Button as a } from "@progress/kendo-react-buttons";
|
|
13
|
+
const o = 500, y = (c) => {
|
|
14
|
+
const {
|
|
15
|
+
footer: t,
|
|
16
|
+
children: s,
|
|
17
|
+
windowWidth: l = 0,
|
|
18
|
+
navigatable: r,
|
|
19
|
+
navigatableElements: m,
|
|
20
|
+
expand: d,
|
|
21
|
+
animation: p,
|
|
22
|
+
onClose: n,
|
|
23
|
+
adaptiveTitle: b,
|
|
24
|
+
mobileFilter: i
|
|
25
|
+
} = c, h = {
|
|
26
|
+
navigatable: r || !1,
|
|
27
|
+
navigatableElements: m || [],
|
|
28
|
+
expand: d,
|
|
29
|
+
animation: p !== !1,
|
|
30
|
+
onClose: n,
|
|
31
|
+
animationStyles: l <= o ? { top: 0, width: "100%", height: "100%" } : void 0,
|
|
32
|
+
className: l <= o ? "k-adaptive-actionsheet k-actionsheet-fullscreen" : "k-adaptive-actionsheet k-actionsheet-bottom"
|
|
33
|
+
};
|
|
34
|
+
return /* @__PURE__ */ e.createElement(f, { ...h }, /* @__PURE__ */ e.createElement(k, { className: "k-text-center" }, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group k-hbox" }, /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-title" }, /* @__PURE__ */ e.createElement("div", null, b)), /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-actions" }, /* @__PURE__ */ e.createElement(
|
|
35
|
+
a,
|
|
36
|
+
{
|
|
37
|
+
tabIndex: 0,
|
|
38
|
+
"aria-label": "Cancel",
|
|
39
|
+
"aria-disabled": "false",
|
|
40
|
+
type: "button",
|
|
41
|
+
fillMode: "flat",
|
|
42
|
+
icon: "x",
|
|
43
|
+
svgIcon: v,
|
|
44
|
+
onClick: n
|
|
45
|
+
}
|
|
46
|
+
))), i && /* @__PURE__ */ e.createElement("div", { className: "k-actionsheet-titlebar-group k-actionsheet-filter" }, i)), s, t && /* @__PURE__ */ e.createElement(E, { className: "k-actions k-actions-stretched" }, /* @__PURE__ */ e.createElement(
|
|
47
|
+
a,
|
|
48
|
+
{
|
|
49
|
+
size: "large",
|
|
50
|
+
tabIndex: 0,
|
|
51
|
+
"aria-label": t.cancelText,
|
|
52
|
+
"aria-disabled": "false",
|
|
53
|
+
type: "button",
|
|
54
|
+
onClick: t.onCancel
|
|
55
|
+
},
|
|
56
|
+
t.cancelText
|
|
57
|
+
), /* @__PURE__ */ e.createElement(
|
|
58
|
+
a,
|
|
59
|
+
{
|
|
60
|
+
tabIndex: 0,
|
|
61
|
+
themeColor: "primary",
|
|
62
|
+
size: "large",
|
|
63
|
+
"aria-label": t.applyText,
|
|
64
|
+
"aria-disabled": "false",
|
|
65
|
+
type: "button",
|
|
66
|
+
onClick: t.onApply
|
|
67
|
+
},
|
|
68
|
+
t.applyText
|
|
69
|
+
)));
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
y as AdaptiveMode
|
|
73
|
+
};
|
|
@@ -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 l=require("react"),s=require("@progress/kendo-react-common");function u(e){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(a,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return a.default=e,Object.freeze(a)}const r=u(l),i=r.forwardRef((e,a)=>{const{_ref:t}=e,n=r.useRef(null);r.useImperativeHandle(a,()=>n.current),r.useImperativeHandle(t,()=>n.current);const c=r.useMemo(()=>s.classNames(e.className,"k-picker-wrap"),[e.className]);return r.createElement("span",{ref:n,id:e.id,style:e.style,className:c,tabIndex:e.tabIndex},e.children)});exports.PickerWrap=i;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 * as a from "react";
|
|
10
|
+
import { classNames as s } from "@progress/kendo-react-common";
|
|
11
|
+
const m = a.forwardRef((e, n) => {
|
|
12
|
+
const { _ref: r } = e, t = a.useRef(null);
|
|
13
|
+
a.useImperativeHandle(n, () => t.current), a.useImperativeHandle(r, () => t.current);
|
|
14
|
+
const c = a.useMemo(
|
|
15
|
+
() => s(e.className, "k-picker-wrap"),
|
|
16
|
+
[e.className]
|
|
17
|
+
);
|
|
18
|
+
return /* @__PURE__ */ a.createElement(
|
|
19
|
+
"span",
|
|
20
|
+
{
|
|
21
|
+
ref: t,
|
|
22
|
+
id: e.id,
|
|
23
|
+
style: e.style,
|
|
24
|
+
className: c,
|
|
25
|
+
tabIndex: e.tabIndex
|
|
26
|
+
},
|
|
27
|
+
e.children
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
m as PickerWrap
|
|
32
|
+
};
|
|
@@ -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 e=768;exports.MOBILE_MEDIUM_DEVISE=e;
|
|
@@ -0,0 +1,12 @@
|
|
|
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 E = 768;
|
|
10
|
+
export {
|
|
11
|
+
E as MOBILE_MEDIUM_DEVISE
|
|
12
|
+
};
|
|
@@ -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 T=require("react"),t=require("prop-types"),g=require("@progress/kendo-date-math"),P=require("@progress/kendo-react-buttons"),F=require("@progress/kendo-svg-icons"),y=require("@progress/kendo-react-intl"),q=require("./models/kendo-date.js"),l=require("@progress/kendo-react-common"),B=require("@progress/kendo-react-labels"),_=require("../package-metadata.js"),v=require("./utils.js"),b=require("../utils.js"),h=require("../messages/index.js"),A=require("../timepicker/utils.js");function L(f){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(f){for(const e in f)if(e!=="default"){const s=Object.getOwnPropertyDescriptor(f,e);Object.defineProperty(i,e,s.get?s:{enumerable:!0,get:()=>f[e]})}}return i.default=f,Object.freeze(i)}const u=L(T),N="Please enter a valid value!",o=class o extends u.Component{constructor(i){super(i),this.kendoDate=null,this.currentFormat="",this.paste=!1,this._element=null,this._wrapper=null,this._lastSelectedSymbol="",this.focus=()=>{this._element&&this._element.focus()},this.setValidity=()=>{this.element&&this.element.setCustomValidity&&this.element.setCustomValidity(this.validity.valid?"":this.props.validationMessage||o.defaultProps.validationMessage)},this.updateOnPaste=e=>{if(!this.element||!this.kendoDate)return;const s=y.provideIntlService(this).parseDate(this.element.value,this.props.format)||this.value,a=this.value;this.kendoDate.setValue(s),this.triggerChange(e,a)},this.spinnersMouseDown=e=>{e.preventDefault();const s=l.getActiveElement(document);this.element&&s!==this.element&&this.element.focus({preventScroll:!0})},this.handlePaste=()=>{this.paste=!0},this.elementChange=e=>{if(!this.element||!this.kendoDate)return;if(this.paste){this.updateOnPaste(e),this.paste=!1;return}const{text:s,format:a}=this.kendoDate.getTextAndFormat();this.currentFormat=a;const r=this.value,n=v.approximateStringMatching(s,this.currentFormat,this.element.value,this.selection.start),d=n.length===1&&n[0][1]==="_";if(!d)for(let c=0;c<n.length;c++)this.kendoDate.parsePart(n[c][0],n[c][1]);n.length&&n[0][0]!=="_"&&this.setSelection(this.selectionBySymbol(n[0][0])),d&&this.switchDateSegment(1),this.triggerChange(e,r)},this.elementClick=e=>{this.setSelection(this.selectionByIndex(this.selection.start))},this.nativeWheel=e=>{l.getActiveElement(document)===this.element&&e.preventDefault()},this.wheel=e=>{l.getActiveElement(document)===this.element&&(e.nativeEvent.deltaY<0&&this.increasePart(e),e.nativeEvent.deltaY>0&&this.decreasePart(e))},this.increasePart=e=>{this.modifyDateSegmentValue(1,e)},this.decreasePart=e=>{this.modifyDateSegmentValue(-1,e)},this.elementKeyDown=e=>{if(!e.altKey){switch(e.keyCode){case 37:this.switchDateSegment(-1);break;case 38:this.modifyDateSegmentValue(1,e);break;case 39:this.switchDateSegment(1);break;case 40:this.modifyDateSegmentValue(-1,e);break;default:return}e.preventDefault()}},this.elementOnFocus=e=>{this.wrapper&&this.wrapper.classList.add("k-focus"),this.setState({focused:!0})},this.elementOnBlur=e=>{this.wrapper&&this.wrapper.classList.remove("k-focus"),this.setState({focused:!1})},l.validatePackage(_.packageMetadata),this.state={focused:!1}}get _inputId(){return this.props.id+"-accessibility-id"}componentDidMount(){this.setValidity(),this.wrapper&&this.wrapper.addEventListener("wheel",this.nativeWheel,{passive:!1})}componentDidUpdate(i,e){this._lastSelectedSymbol&&e.focused===this.state.focused?this.setSelection(this.selectionBySymbol(this._lastSelectedSymbol)):this.props.placeholder!==void 0&&this.selection.start===this.selection.end&&this.setSelection({start:0,end:this.currentFormat.length}),this.setValidity()}componentWillUnmount(){this.wrapper&&this.wrapper.removeEventListener("wheel",this.nativeWheel)}render(){const{size:i=o.defaultProps.size,fillMode:e=o.defaultProps.fillMode,rounded:s=o.defaultProps.rounded}=this.props;this.props._ref&&(this.props._ref.current=this);const a=y.provideLocalizationService(this),r={...o.defaultProps,...this.props},{name:n,label:d,id:c}=r,p=this.text,I=p===this.props.placeholder?"":p,x=p===this.props.placeholder?p:void 0,S=c||this._inputId,w=!this.validityStyles||this.validity.valid;let C=[...v.wrapperClasses];this.props.className&&C.push(this.props.className);const O=u.createElement(l.AsyncFocusBlur,{onFocus:this.elementOnFocus,onBlur:this.elementOnBlur},({onFocus:M,onBlur:V})=>u.createElement("span",{ref:D=>{this._wrapper=D},style:d?void 0:{width:this.props.width},dir:this.props.dir,className:l.classNames("k-dateinput","k-input",{[`k-input-${l.kendoThemeMaps.sizeMap[i]||i}`]:i,[`k-input-${e}`]:e,[`k-rounded-${l.kendoThemeMaps.roundedMap[s]||s}`]:s,"k-invalid":!w,"k-required":this.required,"k-disabled":this.props.disabled},this.props.className),onFocus:M,onBlur:V},u.createElement("input",{role:this.props.ariaRole||"textbox",readOnly:this.props.readonly,tabIndex:this.props.tabIndex,disabled:this.props.disabled,title:this.props.title!==void 0?this.props.title:p,type:"text",spellCheck:!1,autoComplete:"off",autoCorrect:"off",className:"k-input-inner",id:S,"aria-label":this.props.ariaLabel,"aria-labelledby":this.props.ariaLabelledBy,"aria-describedby":this.props.ariaDescribedBy,"aria-haspopup":this.props.ariaHasPopup,"aria-disabled":this.props.disabled,"aria-expanded":this.props.ariaExpanded,"aria-controls":this.props.ariaControls,onWheel:this.wheel,onClick:this.elementClick,onInput:this.elementChange,onPaste:this.handlePaste,onKeyDown:this.elementKeyDown,onChange:l.noop,value:I,placeholder:x,name:n,ref:D=>this._element=D}),this.props.children,this.props.spinners&&u.createElement("span",{className:"k-input-spinner k-spin-button",onMouseDown:this.spinnersMouseDown},u.createElement(P.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-increase",icon:"caret-alt-up",svgIcon:F.caretAltUpIcon,"aria-label":a.toLanguageString(h.increaseValue,h.messages[h.increaseValue]),title:a.toLanguageString(h.increaseValue,h.messages[h.increaseValue]),onClick:this.increasePart}),u.createElement(P.Button,{tabIndex:-1,type:"button",rounded:null,className:"k-spinner-decrease",icon:"caret-alt-down",svgIcon:F.caretAltDownIcon,"aria-label":a.toLanguageString(h.decreaseValue,h.messages[h.decreaseValue]),title:a.toLanguageString(h.decreaseValue,h.messages[h.decreaseValue]),onClick:this.decreasePart}))));return d?u.createElement(B.FloatingLabel,{label:d,editorId:S,editorValue:p,editorValid:w,editorDisabled:this.props.disabled,children:O,style:{width:this.props.width}}):O}get value(){return this.valueDuringOnChange!==void 0?this.valueDuringOnChange:this.kendoDate&&this.kendoDate.getDateObject()}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 text(){const i={...k.defaultProps,...this.props},{formatPlaceholder:e=o.defaultProps.formatPlaceholder,format:s=o.defaultProps.format,value:a,defaultValue:r}=i;this.kendoDate===null?(this.kendoDate=new q.KendoDate(this.intl.bind(this),e,s),this.kendoDate.setValue(a||r||null)):(this.kendoDate.format=s,this.kendoDate.formatPlaceholder=e),a!==void 0&&this.value!==a&&this.kendoDate.setValue(a);const{text:n,format:d}=this.kendoDate.getTextAndFormat();return this.currentFormat=d,i.placeholder!==null&&i.placeholder!==void 0&&!this.state.focused&&!this.kendoDate.hasValue()?i.placeholder:n}get validity(){const i=v.isInRange(this.value,this.min,this.max)&&A.isInTimeRange(this.value,this.props.minTime,this.props.maxTime),e=this.props.validationMessage!==void 0,s=(!this.required||this.value!==null)&&i,a=this.props.valid!==void 0?this.props.valid:s;return{customError:e,rangeOverflow:this.value&&this.max.getTime()<this.value.getTime()||!1,rangeUnderflow:this.value&&this.value.getTime()<this.min.getTime()||!1,valid:a,valueMissing:this.value===null}}get element(){return this._element}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}get wrapper(){return this._wrapper}intl(){return y.provideIntlService(this)}get selection(){let i={start:0,end:0};return this.element!==null&&this.element.selectionStart!==void 0&&(i={start:this.element.selectionStart,end:this.element.selectionEnd}),i}setSelection(i){this._lastSelectedSymbol=this.currentFormat[i.start],window.requestAnimationFrame(()=>{const e=l.getActiveElement(document);this.element&&e===this.element&&!this.props.disableSelection&&this.element.setSelectionRange(i.start,i.end)})}triggerChange(i,e){this.valueDuringOnChange=this.value,this.forceUpdate(),this.props.onChange&&!g.isEqual(e,this.value)&&this.props.onChange.call(void 0,{syntheticEvent:i,nativeEvent:i.nativeEvent,value:this.value,target:this}),this.valueDuringOnChange=void 0}selectionBySymbol(i){let e=-1,s=0;for(let a=0;a<this.currentFormat.length;a++)this.currentFormat[a]===i&&(s=a+1,e===-1&&(e=a));return e<0&&(e=0),{start:e,end:s}}selectionByIndex(i){let e={start:i,end:i};for(let s=i,a=i-1;s<this.currentFormat.length||a>=0;s++,a--){if(s<this.currentFormat.length&&this.currentFormat[s]!=="_"){e=this.selectionBySymbol(this.currentFormat[s]);break}if(a>=0&&this.currentFormat[a]!=="_"){e=this.selectionBySymbol(this.currentFormat[a]);break}}return e}switchDateSegment(i){const{start:e,end:s}=this.selection;if(e<s&&this.currentFormat[e]!==this.currentFormat[s-1]){this.setSelection(this.selectionByIndex(i>0?e:s-1));return}const a=this.currentFormat[e];let r=e+i;for(;r>0&&r<this.currentFormat.length&&!(this.currentFormat[r]!==a&&this.currentFormat[r]!=="_");)r+=i;if(this.currentFormat[r]==="_")return;let n=r;for(;n>=0&&n<this.currentFormat.length&&this.currentFormat[n]===this.currentFormat[r];)n+=i;r>n&&(n+1!==e||r+1!==s)?this.setSelection({start:n+1,end:r+1}):r<n&&(r!==e||n!==s)&&this.setSelection({start:r,end:n})}modifyDateSegmentValue(i,e){if(!this.kendoDate)return;const s=this.value,a=this.currentFormat[this.selection.start],r=this.kendoDate.symbolMap(a),n=((this.props.steps||{})[r]||1)*i;this.kendoDate.modifyPart(a,n),this.triggerChange(e,s)}};o.displayName="DateInput",o.propTypes={value:t.instanceOf(Date),format:t.oneOfType([t.string,t.shape({skeleton:t.string,pattern:t.string,date:t.oneOf(["short","medium","long","full"]),time:t.oneOf(["short","medium","long","full"]),datetime:t.oneOf(["short","medium","long","full"]),era:t.oneOf(["narrow","short","long"]),year:t.oneOf(["numeric","2-digit"]),month:t.oneOf(["numeric","2-digit","narrow","short","long"]),day:t.oneOf(["numeric","2-digit"]),weekday:t.oneOf(["narrow","short","long"]),hour:t.oneOf(["numeric","2-digit"]),hour12:t.bool,minute:t.oneOf(["numeric","2-digit"]),second:t.oneOf(["numeric","2-digit"]),timeZoneName:t.oneOf(["short","long"])})]),formatPlaceholder:t.oneOfType([t.oneOf(["wide","narrow","short","formatPattern"]),t.shape({year:t.string,month:t.string,day:t.string,hour:t.string,minute:t.string,second:t.string})]),width:t.oneOfType([t.string,t.number]),tabIndex:t.number,title:t.string,steps:t.shape({year:t.number,month:t.number,day:t.number,hour:t.number,minute:t.number,second:t.number}),min:t.instanceOf(Date),max:t.instanceOf(Date),disabled:t.bool,spinners:t.bool,name:t.string,dir:t.string,label:t.string,id:t.string,ariaLabelledBy:t.string,ariaDescribedBy:t.string,ariaLabel:t.string,ariaRole:t.string,ariaHasPopup:t.oneOfType([t.bool,t.string]),ariaExpanded:t.oneOfType([t.bool]),onChange:t.func,validationMessage:t.string,required:t.bool,validate:t.bool,valid:t.bool,size:t.oneOf([null,"small","medium","large"]),rounded:t.oneOf([null,"small","medium","large","full"]),fillMode:t.oneOf([null,"solid","flat","outline"])},o.defaultProps={format:v.defaultFormat,size:"medium",rounded:"medium",fillMode:"solid",formatPlaceholder:v.defaultFormatPlaceholder,spinners:!1,disabled:!1,max:g.cloneDate(b.MAX_DATE),min:g.cloneDate(b.MIN_DATE),minTime:g.cloneDate(b.MIN_TIME),maxTime:g.cloneDate(b.MAX_TIME),required:!1,validityStyles:!0,validationMessage:N,placeholder:null,ariaHasPopup:"grid"};let m=o;const E=l.createPropsContext(),k=l.withIdHOC(l.withPropsContext(E,m));k.displayName="KendoReactDateInput";y.registerForIntl(m);y.registerForLocalization(m);exports.DateInput=k;exports.DateInputPropsContext=E;exports.DateInputWithoutContext=m;
|