@progress/kendo-react-dateinputs 9.0.0-develop.2 → 9.0.0-develop.4
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/models/kendo-date.js +1 -1
- package/dateinput/models/kendo-date.mjs +8 -7
- package/datepicker/DatePicker.mjs +14 -6
- package/daterangepicker/DateRangePicker.mjs +14 -3
- package/datetimepicker/DateTimePicker.mjs +22 -15
- package/dist/cdn/js/kendo-react-dateinputs.js +1 -1
- package/hooks/usePickerFloatingLabel.mjs +1 -7
- package/index.d.mts +4 -1
- package/index.d.ts +4 -1
- package/package-metadata.mjs +1 -1
- package/package.json +7 -7
- package/timepicker/TimeList.mjs +27 -12
- package/timepicker/TimePart.mjs +55 -75
- package/timepicker/TimePicker.mjs +11 -5
- 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
|
@@ -17,13 +17,7 @@ const a = (e) => {
|
|
|
17
17
|
};
|
|
18
18
|
}, l = (e) => {
|
|
19
19
|
const { dateInput: t, ...o } = e, r = a(t);
|
|
20
|
-
return /* @__PURE__ */ n.createElement(
|
|
21
|
-
s,
|
|
22
|
-
{
|
|
23
|
-
...o,
|
|
24
|
-
...r
|
|
25
|
-
}
|
|
26
|
-
);
|
|
20
|
+
return /* @__PURE__ */ n.createElement(s, { ...o, ...r });
|
|
27
21
|
};
|
|
28
22
|
export {
|
|
29
23
|
l as PickerFloatingLabel,
|
package/index.d.mts
CHANGED
|
@@ -1176,7 +1176,7 @@ export declare interface DatePickerOpenEvent {
|
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Represents the props of the [KendoReact DatePicker component]({% slug overview_datepicker %}).
|
|
1178
1178
|
*/
|
|
1179
|
-
export declare interface DatePickerProps extends DatePickerSettings, FormComponentProps, Omit<
|
|
1179
|
+
export declare interface DatePickerProps extends DatePickerSettings, FormComponentProps, Omit<React_2.HTMLAttributes<HTMLElement>, 'defaultValue' | 'onChange' | 'onBlur' | 'onFocus' | 'placeholder'> {
|
|
1180
1180
|
/**
|
|
1181
1181
|
* Sets the default value of the DatePicker ([see example]({% slug default_value_datepicker %})).
|
|
1182
1182
|
*/
|
|
@@ -1939,6 +1939,9 @@ export declare class DateRangePickerWithoutContext extends React_2.Component<Dat
|
|
|
1939
1939
|
disabled: PropTypes.Requireable<boolean>;
|
|
1940
1940
|
spinners: PropTypes.Requireable<boolean>;
|
|
1941
1941
|
name: PropTypes.Requireable<string>;
|
|
1942
|
+
/**
|
|
1943
|
+
* @hidden
|
|
1944
|
+
*/
|
|
1942
1945
|
dir: PropTypes.Requireable<string>;
|
|
1943
1946
|
label: PropTypes.Requireable<string>;
|
|
1944
1947
|
id: PropTypes.Requireable<string>;
|
package/index.d.ts
CHANGED
|
@@ -1176,7 +1176,7 @@ export declare interface DatePickerOpenEvent {
|
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Represents the props of the [KendoReact DatePicker component]({% slug overview_datepicker %}).
|
|
1178
1178
|
*/
|
|
1179
|
-
export declare interface DatePickerProps extends DatePickerSettings, FormComponentProps, Omit<
|
|
1179
|
+
export declare interface DatePickerProps extends DatePickerSettings, FormComponentProps, Omit<React_2.HTMLAttributes<HTMLElement>, 'defaultValue' | 'onChange' | 'onBlur' | 'onFocus' | 'placeholder'> {
|
|
1180
1180
|
/**
|
|
1181
1181
|
* Sets the default value of the DatePicker ([see example]({% slug default_value_datepicker %})).
|
|
1182
1182
|
*/
|
|
@@ -1939,6 +1939,9 @@ export declare class DateRangePickerWithoutContext extends React_2.Component<Dat
|
|
|
1939
1939
|
disabled: PropTypes.Requireable<boolean>;
|
|
1940
1940
|
spinners: PropTypes.Requireable<boolean>;
|
|
1941
1941
|
name: PropTypes.Requireable<string>;
|
|
1942
|
+
/**
|
|
1943
|
+
* @hidden
|
|
1944
|
+
*/
|
|
1942
1945
|
dir: PropTypes.Requireable<string>;
|
|
1943
1946
|
label: PropTypes.Requireable<string>;
|
|
1944
1947
|
id: PropTypes.Requireable<string>;
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-dateinputs",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1729499181,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-dateinputs",
|
|
3
|
-
"version": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.4",
|
|
4
4
|
"description": "React DateInput is a perfect input component for handling quick and efficient date values. KendoReact Date Inputs package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -24,12 +24,12 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-date-math": "^1.4.0",
|
|
26
26
|
"@progress/kendo-licensing": "^1.3.4",
|
|
27
|
-
"@progress/kendo-react-buttons": "9.0.0-develop.
|
|
28
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
29
|
-
"@progress/kendo-react-intl": "9.0.0-develop.
|
|
30
|
-
"@progress/kendo-react-labels": "9.0.0-develop.
|
|
31
|
-
"@progress/kendo-react-layout": "9.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-popup": "9.0.0-develop.
|
|
27
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.4",
|
|
28
|
+
"@progress/kendo-react-common": "9.0.0-develop.4",
|
|
29
|
+
"@progress/kendo-react-intl": "9.0.0-develop.4",
|
|
30
|
+
"@progress/kendo-react-labels": "9.0.0-develop.4",
|
|
31
|
+
"@progress/kendo-react-layout": "9.0.0-develop.4",
|
|
32
|
+
"@progress/kendo-react-popup": "9.0.0-develop.4",
|
|
33
33
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
34
34
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
35
35
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|
package/timepicker/TimeList.mjs
CHANGED
|
@@ -47,7 +47,11 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
47
47
|
this.dom.didCalculate && (this.itemHeight = this.dom.itemHeight, this.listHeight = this.dom.timeListHeight, this.topOffset = (this.listHeight - this.itemHeight) / 2, this.bottomOffset = this.listHeight - this.itemHeight, this.props.mobileMode && (this.topOffset += T, this.bottomOffset += T * 2), this.topThreshold = this.itemHeight * S, this.bottomThreshold = this.itemHeight * (1 - S));
|
|
48
48
|
}, this.configureServices = ({ min: t, max: s, value: e } = this.props) => {
|
|
49
49
|
if (this.service) {
|
|
50
|
-
const [o, l] = this.service.limitRange(
|
|
50
|
+
const [o, l] = this.service.limitRange(
|
|
51
|
+
t || this.min,
|
|
52
|
+
s || this.max,
|
|
53
|
+
e || this.props.value
|
|
54
|
+
);
|
|
51
55
|
this.service.configure(this.serviceSettings({ min: o, max: l }));
|
|
52
56
|
}
|
|
53
57
|
}, this.serviceSettings = (t) => {
|
|
@@ -82,10 +86,7 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
82
86
|
return;
|
|
83
87
|
const { keyCode: s } = t;
|
|
84
88
|
(s === c.down || s === c.up || s === c.end || s === c.home) && t.preventDefault();
|
|
85
|
-
const o = (B[t.keyCode] || H)(
|
|
86
|
-
this.service.data(this.props.value),
|
|
87
|
-
this.service.selectedIndex(this.props.value)
|
|
88
|
-
);
|
|
89
|
+
const o = (B[t.keyCode] || H)(this.service.data(this.props.value), this.service.selectedIndex(this.props.value));
|
|
89
90
|
o && this.handleChange(o);
|
|
90
91
|
}, this.handleChange = _((t) => {
|
|
91
92
|
if (!this.service)
|
|
@@ -148,9 +149,17 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
148
149
|
style: { transform: l, msTransform: l },
|
|
149
150
|
className: u(a.ul({ c: e }))
|
|
150
151
|
},
|
|
151
|
-
o.map((p, b) => /* @__PURE__ */ n.createElement(
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
o.map((p, b) => /* @__PURE__ */ n.createElement(
|
|
153
|
+
"li",
|
|
154
|
+
{
|
|
155
|
+
key: b,
|
|
156
|
+
className: u(a.li({ c: e })),
|
|
157
|
+
onClick: () => {
|
|
158
|
+
this.handleChange(p);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
/* @__PURE__ */ n.createElement("span", null, p.text)
|
|
162
|
+
))
|
|
154
163
|
), /* @__PURE__ */ n.createElement("div", { className: u(a.scrollablePlaceholder({ c: e })) }));
|
|
155
164
|
return /* @__PURE__ */ n.createElement(
|
|
156
165
|
"div",
|
|
@@ -189,10 +198,16 @@ const F = 2, S = 0.05, N = 100, k = 0, T = 9, B = {
|
|
|
189
198
|
total: d,
|
|
190
199
|
unstyled: s
|
|
191
200
|
}
|
|
192
|
-
) : /* @__PURE__ */ n.createElement(
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
) : /* @__PURE__ */ n.createElement(
|
|
202
|
+
"div",
|
|
203
|
+
{
|
|
204
|
+
className: u(
|
|
205
|
+
a.containerSelector({ c: e }),
|
|
206
|
+
a.container({ c: e, content: !0, scrollable: !0 })
|
|
207
|
+
)
|
|
208
|
+
},
|
|
209
|
+
v
|
|
210
|
+
)
|
|
196
211
|
);
|
|
197
212
|
}
|
|
198
213
|
};
|
package/timepicker/TimePart.mjs
CHANGED
|
@@ -17,7 +17,9 @@ import { MIN_TIME as A, MAX_TIME as K, MIDNIGHT_DATE as _ } from "../utils.mjs";
|
|
|
17
17
|
import { TIME_PART as d } from "./models/TimePart.mjs";
|
|
18
18
|
import { isInTimeRange as $, getNow as z, snapTime as N, generateSnappers as B, timeInRange as W } from "./utils.mjs";
|
|
19
19
|
import { Button as j } from "@progress/kendo-react-buttons";
|
|
20
|
-
const v = new RegExp(
|
|
20
|
+
const v = new RegExp(
|
|
21
|
+
`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`
|
|
22
|
+
), a = class a extends n.Component {
|
|
21
23
|
constructor(i) {
|
|
22
24
|
super(i), this._element = null, this._nowButton = null, this.dateFormatParts = [], this.timeLists = [], this.focus = (s, e) => {
|
|
23
25
|
Promise.resolve().then(() => {
|
|
@@ -30,10 +32,12 @@ const v = new RegExp(`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`)
|
|
|
30
32
|
return r && r && s.type === "literal" ? v.test(r.type || "") : v.test(s.type || "");
|
|
31
33
|
}, this.focusList = (s) => {
|
|
32
34
|
this.timeLists.length && this.timeLists.reduce(this.listReducer, []).map((e) => s === 1 ? e.next : e.prev).map((e) => e && e.element && e.element.focus({ preventScroll: !0 }));
|
|
33
|
-
}, this.listReducer = (s, e, o, r) => s.length || e.props.id !== this.state.activeListIndex ? s : [
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
}, this.listReducer = (s, e, o, r) => s.length || e.props.id !== this.state.activeListIndex ? s : [
|
|
36
|
+
{
|
|
37
|
+
next: r[o + 1] || e,
|
|
38
|
+
prev: r[o - 1] || e
|
|
39
|
+
}
|
|
40
|
+
], this.showNowButton = () => !this.hasSteps() && this.props.nowButton && $(z(), this.min, this.max), this.handleKeyDown = (s) => {
|
|
37
41
|
const { keyCode: e } = s;
|
|
38
42
|
switch (e) {
|
|
39
43
|
case T.left:
|
|
@@ -62,9 +66,7 @@ const v = new RegExp(`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`)
|
|
|
62
66
|
}, this.handleChange = (s) => {
|
|
63
67
|
const { onChange: e } = this.props;
|
|
64
68
|
e && e.call(void 0, s);
|
|
65
|
-
}, this.snapTime = N(
|
|
66
|
-
B(this.props.steps, this.props.min || a.defaultProps.min)
|
|
67
|
-
), this.state = {
|
|
69
|
+
}, this.snapTime = N(B(this.props.steps, this.props.min || a.defaultProps.min)), this.state = {
|
|
68
70
|
activeListIndex: -1
|
|
69
71
|
}, this.hasActiveButton = this.hasActiveButton.bind(this);
|
|
70
72
|
}
|
|
@@ -75,11 +77,7 @@ const v = new RegExp(`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`)
|
|
|
75
77
|
return this._element;
|
|
76
78
|
}
|
|
77
79
|
get value() {
|
|
78
|
-
return W(
|
|
79
|
-
this.snapTime(O(this.props.value || _)),
|
|
80
|
-
this.min,
|
|
81
|
-
this.max
|
|
82
|
-
);
|
|
80
|
+
return W(this.snapTime(O(this.props.value || _)), this.min, this.max);
|
|
83
81
|
}
|
|
84
82
|
get intl() {
|
|
85
83
|
return k(this);
|
|
@@ -110,17 +108,7 @@ const v = new RegExp(`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`)
|
|
|
110
108
|
* @hidden
|
|
111
109
|
*/
|
|
112
110
|
render() {
|
|
113
|
-
const {
|
|
114
|
-
format: i,
|
|
115
|
-
smoothScroll: s,
|
|
116
|
-
onNowClick: e,
|
|
117
|
-
className: o,
|
|
118
|
-
disabled: r,
|
|
119
|
-
mobileMode: w,
|
|
120
|
-
show: D,
|
|
121
|
-
onNowKeyDown: E,
|
|
122
|
-
unstyled: g
|
|
123
|
-
} = this.props, m = g && g.uTime;
|
|
111
|
+
const { format: i, smoothScroll: s, onNowClick: e, className: o, disabled: r, mobileMode: w, show: D, onNowKeyDown: E, unstyled: g } = this.props, m = g && g.uTime;
|
|
124
112
|
this.snapTime = N(B(this.steps, this.min)), this.dateFormatParts = this.intl.splitDateFormat(i || a.defaultProps.format).filter(this.timeFormatFilter);
|
|
125
113
|
const F = l(
|
|
126
114
|
h.part({
|
|
@@ -149,63 +137,55 @@ const v = new RegExp(`${d.hour}|${d.minute}|${d.second}|${d.dayperiod}|literal`)
|
|
|
149
137
|
tabIndex: r ? -1 : 0
|
|
150
138
|
},
|
|
151
139
|
b.toLanguageString(I, x[I])
|
|
152
|
-
)), /* @__PURE__ */ n.createElement(
|
|
140
|
+
)), /* @__PURE__ */ n.createElement("div", { className: l(h.listContainer({ c: m })), onKeyDown: this.handleKeyDown }, /* @__PURE__ */ n.createElement("span", { className: l(h.highlight({ c: m })) }), this.dateFormatParts.map((u, c) => u.type !== "literal" ? /* @__PURE__ */ n.createElement(
|
|
153
141
|
"div",
|
|
154
142
|
{
|
|
155
|
-
|
|
156
|
-
|
|
143
|
+
key: c,
|
|
144
|
+
className: l(
|
|
145
|
+
h.listWrapper({
|
|
146
|
+
c: m,
|
|
147
|
+
focused: c === this.state.activeListIndex
|
|
148
|
+
})
|
|
149
|
+
),
|
|
150
|
+
role: "presentation",
|
|
151
|
+
tabIndex: -1
|
|
157
152
|
},
|
|
158
|
-
/* @__PURE__ */ n.createElement(
|
|
159
|
-
|
|
160
|
-
"div",
|
|
153
|
+
/* @__PURE__ */ n.createElement(
|
|
154
|
+
"span",
|
|
161
155
|
{
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
c: m,
|
|
166
|
-
focused: c === this.state.activeListIndex
|
|
167
|
-
})
|
|
168
|
-
),
|
|
169
|
-
role: "presentation",
|
|
170
|
-
tabIndex: -1
|
|
171
|
-
},
|
|
172
|
-
/* @__PURE__ */ n.createElement("span", { className: l(h.title({ c: m })), onMouseDown: (p) => {
|
|
173
|
-
p.preventDefault();
|
|
174
|
-
} }, this.intl.dateFieldName(u)),
|
|
175
|
-
/* @__PURE__ */ n.createElement(
|
|
176
|
-
P,
|
|
177
|
-
{
|
|
178
|
-
min: this.min,
|
|
179
|
-
max: this.max,
|
|
180
|
-
boundRange: this.boundRange,
|
|
181
|
-
part: u,
|
|
182
|
-
step: u.type ? this.steps[u.type] : 1,
|
|
183
|
-
smoothScroll: s,
|
|
184
|
-
ref: (p) => {
|
|
185
|
-
p && this.timeLists.push(p);
|
|
186
|
-
},
|
|
187
|
-
id: c,
|
|
188
|
-
onFocus: () => {
|
|
189
|
-
this.handleListFocus(c);
|
|
190
|
-
},
|
|
191
|
-
onBlur: this.handleListBlur,
|
|
192
|
-
onChange: this.handleChange,
|
|
193
|
-
value: this.value,
|
|
194
|
-
disabled: r,
|
|
195
|
-
show: D,
|
|
196
|
-
mobileMode: w,
|
|
197
|
-
unstyled: g
|
|
156
|
+
className: l(h.title({ c: m })),
|
|
157
|
+
onMouseDown: (p) => {
|
|
158
|
+
p.preventDefault();
|
|
198
159
|
}
|
|
199
|
-
)
|
|
200
|
-
) : /* @__PURE__ */ n.createElement(
|
|
201
|
-
"div",
|
|
202
|
-
{
|
|
203
|
-
key: c,
|
|
204
|
-
className: l(h.separator({ c: m }))
|
|
205
160
|
},
|
|
206
|
-
u
|
|
207
|
-
)
|
|
208
|
-
|
|
161
|
+
this.intl.dateFieldName(u)
|
|
162
|
+
),
|
|
163
|
+
/* @__PURE__ */ n.createElement(
|
|
164
|
+
P,
|
|
165
|
+
{
|
|
166
|
+
min: this.min,
|
|
167
|
+
max: this.max,
|
|
168
|
+
boundRange: this.boundRange,
|
|
169
|
+
part: u,
|
|
170
|
+
step: u.type ? this.steps[u.type] : 1,
|
|
171
|
+
smoothScroll: s,
|
|
172
|
+
ref: (p) => {
|
|
173
|
+
p && this.timeLists.push(p);
|
|
174
|
+
},
|
|
175
|
+
id: c,
|
|
176
|
+
onFocus: () => {
|
|
177
|
+
this.handleListFocus(c);
|
|
178
|
+
},
|
|
179
|
+
onBlur: this.handleListBlur,
|
|
180
|
+
onChange: this.handleChange,
|
|
181
|
+
value: this.value,
|
|
182
|
+
disabled: r,
|
|
183
|
+
show: D,
|
|
184
|
+
mobileMode: w,
|
|
185
|
+
unstyled: g
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
) : /* @__PURE__ */ n.createElement("div", { key: c, className: l(h.separator({ c: m })) }, u.pattern))));
|
|
209
189
|
}
|
|
210
190
|
nextTick(i) {
|
|
211
191
|
clearTimeout(this.nextTickId), this.nextTickId = window.setTimeout(() => i());
|
|
@@ -53,9 +53,7 @@ const n = class n extends a.Component {
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}, this.renderPopup = () => {
|
|
56
|
-
const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, r = o && o.uTimePicker, h = c(
|
|
57
|
-
t
|
|
58
|
-
), l = {
|
|
56
|
+
const { popupClass: t, ...s } = this.popupSettings, { unstyled: o } = this.props, r = o && o.uTimePicker, h = c(t), l = {
|
|
59
57
|
popupClass: g.popup({ c: r }),
|
|
60
58
|
show: this.show,
|
|
61
59
|
animate: this.element !== null,
|
|
@@ -291,7 +289,10 @@ const n = class n extends a.Component {
|
|
|
291
289
|
fillMode: null,
|
|
292
290
|
rounded: null,
|
|
293
291
|
readonly: this.mobileMode
|
|
294
|
-
}, A = this.localizationService.toLanguageString(f, u[f]), N = this.localizationService.toLanguageString(
|
|
292
|
+
}, A = this.localizationService.toLanguageString(f, u[f]), N = this.localizationService.toLanguageString(
|
|
293
|
+
C,
|
|
294
|
+
u[C]
|
|
295
|
+
), b = /* @__PURE__ */ a.createElement(
|
|
295
296
|
H,
|
|
296
297
|
{
|
|
297
298
|
onFocus: this.handleFocus,
|
|
@@ -412,7 +413,12 @@ n.displayName = "TimePicker", n.propTypes = {
|
|
|
412
413
|
})
|
|
413
414
|
]),
|
|
414
415
|
formatPlaceholder: e.oneOfType([
|
|
415
|
-
e.oneOf([
|
|
416
|
+
e.oneOf([
|
|
417
|
+
"wide",
|
|
418
|
+
"narrow",
|
|
419
|
+
"short",
|
|
420
|
+
"formatPattern"
|
|
421
|
+
]),
|
|
416
422
|
e.shape({
|
|
417
423
|
year: e.string,
|
|
418
424
|
month: e.string,
|
|
@@ -18,10 +18,13 @@ class y {
|
|
|
18
18
|
calculateHeights(c, n) {
|
|
19
19
|
if (!C)
|
|
20
20
|
return;
|
|
21
|
-
const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const t = n && n.uTime, o = s("div"), p = s("span"), u = s("ul"), h = s("li"), m = () => h("<span>02</span>", i(e.li({ c: t }))), d = () => u([m()], i(e.ul({ c: t }))), f = () => o(
|
|
22
|
+
[d()],
|
|
23
|
+
i(
|
|
24
|
+
e.containerSelector({ c: t }),
|
|
25
|
+
e.container({ c: t, content: !0, scrollable: !0 })
|
|
26
|
+
)
|
|
27
|
+
), g = o(
|
|
25
28
|
[
|
|
26
29
|
p("minute", i(e.title({ c: t }))),
|
|
27
30
|
o([f()], i(e.list({ c: t })))
|
package/timepicker/utils.mjs
CHANGED
|
@@ -38,29 +38,17 @@ const a = (e) => (t, r) => {
|
|
|
38
38
|
}), F = (e, t, r) => {
|
|
39
39
|
if (!e || !t || !r)
|
|
40
40
|
return e;
|
|
41
|
-
const {
|
|
42
|
-
candidateValue: n,
|
|
43
|
-
minValue: s,
|
|
44
|
-
maxValue: o
|
|
45
|
-
} = i(e, t, r);
|
|
41
|
+
const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
|
|
46
42
|
return n < s ? u(e, t) : n > o ? u(e, r) : e;
|
|
47
43
|
}, N = (e, t, r) => {
|
|
48
44
|
if (!e || !t || !r)
|
|
49
45
|
return !0;
|
|
50
|
-
const {
|
|
51
|
-
candidateValue: n,
|
|
52
|
-
minValue: s,
|
|
53
|
-
maxValue: o
|
|
54
|
-
} = i(e, t, r);
|
|
46
|
+
const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
|
|
55
47
|
return s <= n && n <= o;
|
|
56
48
|
}, P = (e, t, r) => {
|
|
57
49
|
if (e === null)
|
|
58
50
|
return !0;
|
|
59
|
-
const {
|
|
60
|
-
candidateValue: n,
|
|
61
|
-
minValue: s,
|
|
62
|
-
maxValue: o
|
|
63
|
-
} = i(e, t, r);
|
|
51
|
+
const { candidateValue: n, minValue: s, maxValue: o } = i(e, t, r);
|
|
64
52
|
return s <= n && n <= o;
|
|
65
53
|
}, v = (e, t) => {
|
|
66
54
|
if (e === null || t === null)
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),s=require("prop-types"),f=require("@progress/kendo-react-common"),H=require("./services/ScrollerService.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const g=P(w),T=(r,e,t)=>Math.min(Math.abs(e-r),t),C=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},a=class a extends g.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<O||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i)
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),s=require("prop-types"),f=require("@progress/kendo-react-common"),H=require("./services/ScrollerService.js");function P(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const i=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,i.get?i:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const g=P(w),T=(r,e,t)=>Math.min(Math.abs(e-r),t),C=17,O=10,A={1:r=>e=>e+r,0:r=>e=>e-r},x={1:r=>e=>Math.min(e,r),0:r=>e=>Math.max(e,r)},I={1:r=>e=>e<r,0:r=>e=>e>r},a=class a extends g.Component{constructor(e){super(e),this.rowHeightService=null,this.scrollContainer=null,this.lastDirection=null,this.lastTotal=0,this.lastTake=0,this.animationInProgress=!1,this.restrictScroll=!1,this.scrollTo=t=>{const i=this.direction==="vertical"?"scrollTop":"scrollLeft";if(!this.scrollContainer)return;const o=this.scrollContainer[i];this.restrictScroll&&i==="scrollTop"&&(!Number.isInteger(o)||!Number.isInteger(t))&&Math.abs(o-t)<O||(this.scrollContainer[i]=t)},this.scrollToIndex=t=>{this.animationInProgress=!1,this.rowHeightService&&this.scrollTo(this.rowHeightService.offset(t))},this.animateToIndex=t=>{if(!this.rowHeightService||!window)return;window.cancelAnimationFrame(this.cancelAnimation);const i=this.rowHeightService.offset(t),o=this.getContainerScrollDirection(i),{start:n,end:l}=this.scrollRange(i,o);if(n===l)return;const S=this.scrollStep(n,l),c=A[o](S),h=x[o](l),u=I[o](c(l)),m=p=>{this.animationInProgress=!0;const d=c(p);this.scrollTo(h(d)),u(d)?this.cancelAnimation=window.requestAnimationFrame(()=>{m(d)}):this.animationInProgress=!1};this.cancelAnimation=window.requestAnimationFrame(()=>{m(n)})},this.scrollToBottom=()=>{this.rowHeightService&&this.scrollTo(this.rowHeightService.totalHeight()+this.props.bottomOffset)},this.scrollStep=(t,i)=>{const o=this.props.scrollDuration||a.defaultProps.scrollDuration;return Math.abs(i-t)/(o/C)},this.scrollRange=(t,i)=>{const o=this.containerScrollPosition;if(parseInt(`${t}`,10)===parseInt(`${o}`,10))return{start:t,end:t};const n=this.containerMaxScroll(),l=i===0?1:-1,S=T(o,t,this.props.maxScrollDifference||0),c=Math.min(t,n);return{start:Math.min(Math.max(c+l*S,0),n),end:c}},this.containerMaxScroll=()=>this.containerScrollSize-this.containerOffsetSize,this.getContainerScrollDirection=t=>t<this.containerScrollPosition?0:1,this.initServices=(t=this.props)=>{const i=this.direction==="vertical"?t.itemHeight:t.itemWidth;i!==void 0&&(this.rowHeightService=new f.RowHeightService(t.total,i,0),this.scrollerService.create(this.rowHeightService,t.skip,t.take,t.total,t.topOffset,this.scrollOffsetSize,this.direction))},this.getContainerProperty=t=>this.scrollContainer?this.scrollContainer[t]:0,this.handleScroll=t=>{if(!this.scrollContainer||!this.rowHeightService)return;const i=t.target;this.scrollerService.onScroll({scrollLeft:i.scrollLeft,scrollTop:i.scrollTop,offsetHeight:i.offsetHeight,offsetWidth:i.offsetWidth});const o=this.rowHeightService.index(this.containerScrollPosition-this.props.topOffset),{onScrollAction:n}=this.props,l={index:o,target:i,scrollAction:this.scrollAction,pageAction:this.pageAction,animationInProgress:this.animationInProgress};this.props.onScroll&&this.props.onScroll.call(void 0,t),n&&n.call(void 0,l),this.scrollAction=void 0,this.pageAction=void 0},this.handleScrollAction=t=>{this.scrollAction=t},this.handlePageAction=t=>{this.pageAction=t},this.scrollerService=new H.ScrollerService(this.handleScrollAction,this.handlePageAction),this.restrictScroll=Number.parseFloat(g.version)>17}get element(){return this.scrollContainer}get containerOffsetSize(){return this.getContainerProperty(this.direction==="vertical"?"offsetHeight":"offsetWidth")}get containerScrollSize(){return this.getContainerProperty(this.direction==="vertical"?"scrollHeight":"scrollWidth")}get containerScrollPosition(){return this.getContainerProperty(this.direction==="vertical"?"scrollTop":"scrollLeft")}get direction(){return this.props.direction!==void 0?this.props.direction:a.defaultProps.direction}get scrollOffsetSize(){return this.props.scrollOffsetSize!==void 0?this.props.scrollOffsetSize:a.defaultProps.scrollOffsetSize}activeIndex(){return this.itemIndex(Math.ceil(this.containerScrollPosition))}itemIndex(e){return this.rowHeightService?this.rowHeightService.index(e):0}itemOffset(e){return this.rowHeightService?this.rowHeightService.offset(e):0}isIndexVisible(e){if(!this.rowHeightService)return!1;const t=this.containerScrollPosition,i=t+this.containerOffsetSize,o=this.rowHeightService.offset(e),n=o+this.rowHeightService.height(e);return o>=t&&n<=i}isListScrolled(e){return this.rowHeightService?this.containerScrollPosition!==this.rowHeightService.offset(e):!1}componentDidMount(){const{onMount:e}=this.props;e&&e.call(void 0,this)}render(){const{total:e,take:t,bottomOffset:i,className:o,tabIndex:n,role:l,children:S,unstyled:c}=this.props,h=c&&c.uCalendar;(this.lastTotal!==e||this.lastDirection!==this.direction||this.lastTake!==t)&&(this.initServices(),this.lastTotal=e,this.lastDirection=this.direction,this.lastTake=t);const u=`${(this.rowHeightService?this.rowHeightService.totalHeight():0)+i}`,m=this.direction==="vertical"?{height:`${u}px`}:{width:`${u}px`},p=f.classNames(f.uCalendar.scrollableSelector({c:h}),f.uCalendar.scrollable({c:h,horizontal:this.direction==="horizontal"}),o),d=f.classNames(f.uCalendar.scrollablePlaceholder({c:h,horizontal:this.direction==="horizontal"}));return g.createElement("div",{ref:b=>{this.scrollContainer=b},onScroll:this.handleScroll,className:p,tabIndex:n,role:l},S,g.createElement("div",{style:m,className:d}))}};a.propTypes={bottomOffset:s.number.isRequired,className:s.string,direction:s.oneOf(["horizontal","vertical"]),forceScroll:s.bool,itemHeight:s.number,itemWidth:s.number,maxScrollDifference:s.number,onScroll:s.func,onScrollAction:s.func,scrollDuration:s.number,scrollOffsetSize:s.number,skip:s.number.isRequired,tabIndex:s.number,take:s.number.isRequired,topOffset:s.number.isRequired,total:s.number.isRequired,role:s.string},a.defaultProps={direction:"vertical",forceScroll:!1,scrollOffsetSize:0,maxScrollDifference:100,scrollDuration:100};let v=a;exports.Virtualization=v;
|
|
@@ -33,8 +33,7 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
33
33
|
if (!this.rowHeightService || !window)
|
|
34
34
|
return;
|
|
35
35
|
window.cancelAnimationFrame(this.cancelAnimation);
|
|
36
|
-
const e = this.rowHeightService.offset(t), r = this.getContainerScrollDirection(e);
|
|
37
|
-
let { start: n, end: l } = this.scrollRange(e, r);
|
|
36
|
+
const e = this.rowHeightService.offset(t), r = this.getContainerScrollDirection(e), { start: n, end: l } = this.scrollRange(e, r);
|
|
38
37
|
if (n === l)
|
|
39
38
|
return;
|
|
40
39
|
const f = this.scrollStep(n, l), c = x[r](f), h = I[r](l), d = M[r](c(l)), m = (g) => {
|
|
@@ -91,10 +90,7 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
91
90
|
this.scrollAction = t;
|
|
92
91
|
}, this.handlePageAction = (t) => {
|
|
93
92
|
this.pageAction = t;
|
|
94
|
-
}, this.scrollerService = new P(
|
|
95
|
-
this.handleScrollAction,
|
|
96
|
-
this.handlePageAction
|
|
97
|
-
), this.restrictScroll = Number.parseFloat(u.version) > 17;
|
|
93
|
+
}, this.scrollerService = new P(this.handleScrollAction, this.handlePageAction), this.restrictScroll = Number.parseFloat(u.version) > 17;
|
|
98
94
|
}
|
|
99
95
|
get element() {
|
|
100
96
|
return this.scrollContainer;
|
|
@@ -166,13 +162,7 @@ const T = (s, i, t) => Math.min(Math.abs(i - s), t), A = 17, C = 10, x = {
|
|
|
166
162
|
role: l
|
|
167
163
|
},
|
|
168
164
|
f,
|
|
169
|
-
/* @__PURE__ */ u.createElement(
|
|
170
|
-
"div",
|
|
171
|
-
{
|
|
172
|
-
style: m,
|
|
173
|
-
className: S
|
|
174
|
-
}
|
|
175
|
-
)
|
|
165
|
+
/* @__PURE__ */ u.createElement("div", { style: m, className: S })
|
|
176
166
|
);
|
|
177
167
|
}
|
|
178
168
|
};
|