lizaui 5.0.4 → 5.0.6
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/dist/button/index.es.js +1 -1
- package/dist/calendar/index.es.js +1 -1
- package/dist/checkbox/index.es.js +1 -1
- package/dist/chunks/{button-DaCTNWTs.js → button-wlPPnoey.js} +2 -2
- package/dist/chunks/{button-DaCTNWTs.js.map → button-wlPPnoey.js.map} +1 -1
- package/dist/chunks/{checkbox-CJAWo52b.js → checkbox-DoMayXNj.js} +2 -2
- package/dist/chunks/{checkbox-CJAWo52b.js.map → checkbox-DoMayXNj.js.map} +1 -1
- package/dist/chunks/{index-Db2rLomN.js → index-Do-g2tEs.js} +3 -3
- package/dist/chunks/{index-Db2rLomN.js.map → index-Do-g2tEs.js.map} +1 -1
- package/dist/chunks/select-C25qmFpo.js +1321 -0
- package/dist/chunks/select-C25qmFpo.js.map +1 -0
- package/dist/chunks/select-DW1tRhcQ.js +2 -0
- package/dist/chunks/select-DW1tRhcQ.js.map +1 -0
- package/dist/chunks/textarea-ClUh9LtQ.js +3793 -0
- package/dist/chunks/textarea-ClUh9LtQ.js.map +1 -0
- package/dist/chunks/textarea-ZUAx_MBk.js +65 -0
- package/dist/chunks/textarea-ZUAx_MBk.js.map +1 -0
- package/dist/components/time-input/time-picker-input.d.ts +9 -1
- package/dist/components/time-input/time-picker-input.d.ts.map +1 -1
- package/dist/components/time-input/time-picker.styled.d.ts +3 -1
- package/dist/components/time-input/time-picker.styled.d.ts.map +1 -1
- package/dist/divider/index.es.js +1 -1
- package/dist/modal/index.es.js +1 -1
- package/dist/pagination/index.cjs.js +1 -1
- package/dist/pagination/index.cjs.js.map +1 -1
- package/dist/pagination/index.es.js +7 -6
- package/dist/pagination/index.es.js.map +1 -1
- package/dist/select-input/index.es.js +1 -1
- package/dist/table/index.es.js +1 -1
- package/dist/time-input/index.cjs.js +23 -18
- package/dist/time-input/index.cjs.js.map +1 -1
- package/dist/time-input/index.es.js +401 -357
- package/dist/time-input/index.es.js.map +1 -1
- package/dist/ui/index.cjs.js +4 -4
- package/dist/ui/index.cjs.js.map +1 -1
- package/dist/ui/index.es.js +344 -342
- package/dist/ui/index.es.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/textarea-ELiVeST1.js +0 -5102
- package/dist/chunks/textarea-ELiVeST1.js.map +0 -1
- package/dist/chunks/textarea-xD71CEWT.js +0 -65
- package/dist/chunks/textarea-xD71CEWT.js.map +0 -1
|
@@ -1,140 +1,144 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { createPortal as
|
|
1
|
+
import { j as o } from "../chunks/jsx-runtime-Cl_4eDuT.js";
|
|
2
|
+
import { memo as qe, useLayoutEffect as rn, useEffect as pe, useState as re, useRef as G, useCallback as xe, useMemo as on, createElement as De, useId as an } from "react";
|
|
3
|
+
import { createPortal as sn } from "react-dom";
|
|
4
4
|
import { c as be } from "../chunks/clsx-OuTLNxxd.js";
|
|
5
|
-
import { g as Oe, a as
|
|
5
|
+
import { g as Oe, a as I, b as oe, c as de, d as Pe, u as ye, e as cn, f as Be, h as Ue, m as un, F as ln, i as dn } from "../chunks/styled-components.browser.esm-CAEXERbT.js";
|
|
6
|
+
import { c as mn } from "../chunks/utils-BFAOD39w.js";
|
|
7
|
+
import "../chunks/textarea-ClUh9LtQ.js";
|
|
8
|
+
import { L as pn } from "../chunks/label-error-Vg0P1jJJ.js";
|
|
9
|
+
import "../chunks/button-wlPPnoey.js";
|
|
6
10
|
function Se(e) {
|
|
7
|
-
var n = e.angle,
|
|
8
|
-
return
|
|
9
|
-
transform: "rotate(".concat(
|
|
10
|
-
}, children:
|
|
11
|
+
var n = e.angle, t = n === void 0 ? 0 : n, a = e.name, i = e.length, s = i === void 0 ? 100 : i, c = e.oppositeLength, u = c === void 0 ? 10 : c, l = e.width, p = l === void 0 ? 1 : l;
|
|
12
|
+
return o.jsx("div", { className: "react-clock__hand react-clock__".concat(a, "-hand"), style: {
|
|
13
|
+
transform: "rotate(".concat(t, "deg)")
|
|
14
|
+
}, children: o.jsx("div", { className: "react-clock__hand__body react-clock__".concat(a, "-hand__body"), style: {
|
|
11
15
|
width: "".concat(p, "px"),
|
|
12
|
-
top: "".concat(50 -
|
|
16
|
+
top: "".concat(50 - s / 2, "%"),
|
|
13
17
|
bottom: "".concat(50 - u / 2, "%")
|
|
14
18
|
} }) });
|
|
15
19
|
}
|
|
16
|
-
var ze =
|
|
17
|
-
var
|
|
18
|
-
return
|
|
20
|
+
var ze = qe(function(n) {
|
|
21
|
+
var t = n.angle, a = t === void 0 ? 0 : t, i = n.length, s = i === void 0 ? 10 : i, c = n.name, u = n.width, l = u === void 0 ? 1 : u;
|
|
22
|
+
return o.jsx("div", { className: "react-clock__mark react-clock__".concat(c, "-mark"), style: {
|
|
19
23
|
transform: "rotate(".concat(a, "deg)")
|
|
20
|
-
}, children:
|
|
24
|
+
}, children: o.jsx("div", { className: "react-clock__mark__body react-clock__".concat(c, "-mark__body"), style: {
|
|
21
25
|
width: "".concat(l, "px"),
|
|
22
26
|
top: 0,
|
|
23
|
-
bottom: "".concat(100 -
|
|
27
|
+
bottom: "".concat(100 - s / 2, "%")
|
|
24
28
|
} }) });
|
|
25
|
-
}),
|
|
26
|
-
var
|
|
27
|
-
return
|
|
29
|
+
}), fn = qe(function(n) {
|
|
30
|
+
var t = n.angle, a = t === void 0 ? 0 : t, i = n.length, s = i === void 0 ? 10 : i, c = n.name, u = n.number;
|
|
31
|
+
return o.jsx("div", { className: "react-clock__mark react-clock__".concat(c, "-mark"), style: {
|
|
28
32
|
transform: "rotate(".concat(a, "deg)")
|
|
29
|
-
}, children:
|
|
33
|
+
}, children: o.jsx("div", { className: "react-clock__mark__number", style: {
|
|
30
34
|
transform: "rotate(-".concat(a, "deg)"),
|
|
31
|
-
top: "".concat(
|
|
35
|
+
top: "".concat(s / 2, "%")
|
|
32
36
|
}, children: u }) });
|
|
33
37
|
});
|
|
34
|
-
function
|
|
38
|
+
function hn(e, n) {
|
|
35
39
|
return n.toLocaleString(e || Oe() || void 0);
|
|
36
40
|
}
|
|
37
|
-
function
|
|
41
|
+
function gn(e) {
|
|
38
42
|
return e !== null && e !== !1 && !Number.isNaN(Number(e));
|
|
39
43
|
}
|
|
40
|
-
function
|
|
44
|
+
function bn() {
|
|
41
45
|
for (var e = [], n = 0; n < arguments.length; n++)
|
|
42
46
|
e[n] = arguments[n];
|
|
43
|
-
return Math.max.apply(Math, e.filter(
|
|
47
|
+
return Math.max.apply(Math, e.filter(gn));
|
|
44
48
|
}
|
|
45
|
-
function
|
|
46
|
-
var n = e.className,
|
|
49
|
+
function kn(e) {
|
|
50
|
+
var n = e.className, t = e.formatHour, a = t === void 0 ? hn : t, i = e.hourHandLength, s = i === void 0 ? 50 : i, c = e.hourHandOppositeLength, u = e.hourHandWidth, l = u === void 0 ? 4 : u, p = e.hourMarksLength, k = p === void 0 ? 10 : p, h = e.hourMarksWidth, _ = h === void 0 ? 3 : h, y = e.locale, w = e.minuteHandLength, P = w === void 0 ? 70 : w, g = e.minuteHandOppositeLength, N = e.minuteHandWidth, M = N === void 0 ? 2 : N, E = e.minuteMarksLength, A = E === void 0 ? 6 : E, J = e.minuteMarksWidth, Q = J === void 0 ? 1 : J, R = e.renderHourMarks, O = R === void 0 ? !0 : R, S = e.renderMinuteHand, q = S === void 0 ? !0 : S, z = e.renderMinuteMarks, T = z === void 0 ? !0 : z, X = e.renderNumbers, ie = e.renderSecondHand, Y = ie === void 0 ? !0 : ie, V = e.secondHandLength, ae = V === void 0 ? 90 : V, se = e.secondHandOppositeLength, Z = e.secondHandWidth, ee = Z === void 0 ? 1 : Z, B = e.size, L = B === void 0 ? 150 : B, W = e.useMillisecondPrecision, b = e.value;
|
|
47
51
|
function ce() {
|
|
48
|
-
if (!
|
|
52
|
+
if (!T)
|
|
49
53
|
return null;
|
|
50
|
-
for (var
|
|
51
|
-
var
|
|
52
|
-
|
|
54
|
+
for (var x = [], v = 1; v <= 60; v += 1) {
|
|
55
|
+
var te = O && !(v % 5);
|
|
56
|
+
te || x.push(o.jsx(ze, { angle: v * 6, length: A, name: "minute", width: Q }, "minute_".concat(v)));
|
|
53
57
|
}
|
|
54
|
-
return
|
|
58
|
+
return x;
|
|
55
59
|
}
|
|
56
60
|
function ue() {
|
|
57
|
-
if (!
|
|
61
|
+
if (!O)
|
|
58
62
|
return null;
|
|
59
|
-
for (var
|
|
60
|
-
|
|
61
|
-
return
|
|
63
|
+
for (var x = [], v = 1; v <= 12; v += 1)
|
|
64
|
+
x.push(o.jsx(ze, { angle: v * 30, length: k, name: "hour", width: _ }, "hour_".concat(v)));
|
|
65
|
+
return x;
|
|
62
66
|
}
|
|
63
|
-
function
|
|
64
|
-
if (!
|
|
67
|
+
function $() {
|
|
68
|
+
if (!X)
|
|
65
69
|
return null;
|
|
66
|
-
for (var
|
|
67
|
-
|
|
68
|
-
return
|
|
70
|
+
for (var x = [], v = 1; v <= 12; v += 1)
|
|
71
|
+
x.push(o.jsx(fn, { angle: v * 30, length: bn(O && k, T && A, 0), name: "number", number: a(y, v) }, "number_".concat(v)));
|
|
72
|
+
return x;
|
|
69
73
|
}
|
|
70
74
|
function fe() {
|
|
71
|
-
return
|
|
75
|
+
return o.jsxs("div", { className: "react-clock__face", children: [ce(), ue(), $()] });
|
|
72
76
|
}
|
|
73
77
|
function le() {
|
|
74
|
-
var
|
|
75
|
-
return
|
|
78
|
+
var x = b ? I(b) * 30 + oe(b) / 2 + de(b) / 120 + (W ? Pe(b) / 12e4 : 0) : 0;
|
|
79
|
+
return o.jsx(Se, { angle: x, length: s, name: "hour", oppositeLength: c, width: l });
|
|
76
80
|
}
|
|
77
81
|
function he() {
|
|
78
82
|
if (!q)
|
|
79
83
|
return null;
|
|
80
|
-
var
|
|
81
|
-
return
|
|
84
|
+
var x = b ? I(b) * 360 + oe(b) * 6 + de(b) / 10 + (W ? Pe(b) / 1e4 : 0) : 0;
|
|
85
|
+
return o.jsx(Se, { angle: x, length: P, name: "minute", oppositeLength: g, width: M });
|
|
82
86
|
}
|
|
83
|
-
function
|
|
84
|
-
if (!
|
|
87
|
+
function ne() {
|
|
88
|
+
if (!Y)
|
|
85
89
|
return null;
|
|
86
|
-
var
|
|
87
|
-
return
|
|
90
|
+
var x = b ? oe(b) * 360 + de(b) * 6 + (W ? Pe(b) * 6e-3 : 0) : 0;
|
|
91
|
+
return o.jsx(Se, { angle: x, length: ae, name: "second", oppositeLength: se, width: ee });
|
|
88
92
|
}
|
|
89
|
-
return
|
|
93
|
+
return o.jsxs("time", { className: be("react-clock", n), dateTime: b instanceof Date ? (
|
|
90
94
|
// Returns a string in the format "HH:MM" or "HH:MM:SS"
|
|
91
|
-
|
|
95
|
+
b.toLocaleTimeString("en", {
|
|
92
96
|
hourCycle: "h23",
|
|
93
97
|
hour: "2-digit",
|
|
94
98
|
minute: q ? "2-digit" : void 0,
|
|
95
|
-
second:
|
|
99
|
+
second: Y ? "2-digit" : void 0
|
|
96
100
|
})
|
|
97
|
-
) :
|
|
98
|
-
width:
|
|
99
|
-
height:
|
|
100
|
-
}, children: [fe(), le(), he(),
|
|
101
|
+
) : b || void 0, style: {
|
|
102
|
+
width: L,
|
|
103
|
+
height: L
|
|
104
|
+
}, children: [fe(), le(), he(), ne()] });
|
|
101
105
|
}
|
|
102
|
-
function
|
|
103
|
-
return
|
|
106
|
+
function vn({ children: e }) {
|
|
107
|
+
return o.jsx("span", { className: "react-time-picker__inputGroup__divider", children: e });
|
|
104
108
|
}
|
|
105
109
|
function Ve(e, n) {
|
|
106
|
-
let
|
|
107
|
-
return n === "am" &&
|
|
110
|
+
let t = Number(e);
|
|
111
|
+
return n === "am" && t === 12 ? t = 0 : n === "pm" && t < 12 && (t += 12), t;
|
|
108
112
|
}
|
|
109
113
|
function me(e) {
|
|
110
114
|
return [Number(e) % 12 || 12, Number(e) < 12 ? "am" : "pm"];
|
|
111
115
|
}
|
|
112
|
-
const
|
|
116
|
+
const $e = /* @__PURE__ */ new Map();
|
|
113
117
|
function Je(e) {
|
|
114
|
-
return function(
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
return
|
|
118
|
+
return function(t, a) {
|
|
119
|
+
const i = t || Oe();
|
|
120
|
+
$e.has(i) || $e.set(i, /* @__PURE__ */ new Map());
|
|
121
|
+
const s = $e.get(i);
|
|
122
|
+
return s.has(e) || s.set(e, new Intl.DateTimeFormat(i || void 0, e).format), s.get(e)(a);
|
|
119
123
|
};
|
|
120
124
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
123
|
-
return (n,
|
|
125
|
+
const Me = /* @__PURE__ */ new Map();
|
|
126
|
+
function _n(e) {
|
|
127
|
+
return (n, t) => {
|
|
124
128
|
const a = n || Oe();
|
|
125
|
-
|
|
126
|
-
const
|
|
127
|
-
return
|
|
129
|
+
Me.has(a) || Me.set(a, /* @__PURE__ */ new Map());
|
|
130
|
+
const i = Me.get(a);
|
|
131
|
+
return i.has(e) || i.set(e, new Intl.NumberFormat(a || void 0, e).format), i.get(e)(t);
|
|
128
132
|
};
|
|
129
133
|
}
|
|
130
|
-
const
|
|
134
|
+
const xn = ["9", "٩"], Ze = new RegExp(`[${xn.join("")}]`), Ke = Je({ hour: "numeric" });
|
|
131
135
|
function Qe(e) {
|
|
132
|
-
const n = Ke(e, new Date(2017, 0, 1, 9)),
|
|
133
|
-
if (
|
|
134
|
-
if (a !==
|
|
135
|
-
return [a,
|
|
136
|
-
if (
|
|
137
|
-
return [
|
|
136
|
+
const n = Ke(e, new Date(2017, 0, 1, 9)), t = Ke(e, new Date(2017, 0, 1, 21)), [a, i] = n.split(Ze), [s, c] = t.split(Ze);
|
|
137
|
+
if (c !== void 0) {
|
|
138
|
+
if (a !== s)
|
|
139
|
+
return [a, s].map((u) => u.trim());
|
|
140
|
+
if (i !== c)
|
|
141
|
+
return [i, c].map((u) => u.trim());
|
|
138
142
|
}
|
|
139
143
|
return ["AM", "PM"];
|
|
140
144
|
}
|
|
@@ -147,32 +151,32 @@ function Le(...e) {
|
|
|
147
151
|
function je(...e) {
|
|
148
152
|
return Math.max(...e.filter(Te));
|
|
149
153
|
}
|
|
150
|
-
function
|
|
151
|
-
const
|
|
152
|
-
return
|
|
154
|
+
function wn({ ariaLabel: e, autoFocus: n, className: t, disabled: a, inputRef: i, locale: s, maxTime: c, minTime: u, onChange: l, onKeyDown: p, required: k, value: h }) {
|
|
155
|
+
const _ = u ? me(I(u))[1] === "pm" : !1, y = c ? me(I(c))[1] === "am" : !1, w = "amPm", [P, g] = Qe(s);
|
|
156
|
+
return o.jsxs("select", {
|
|
153
157
|
"aria-label": e,
|
|
154
158
|
// biome-ignore lint/a11y/noAutofocus: This is up to developers' decision
|
|
155
159
|
autoFocus: n,
|
|
156
|
-
className: be(`${
|
|
160
|
+
className: be(`${t}__input`, `${t}__${w}`),
|
|
157
161
|
"data-input": "true",
|
|
158
162
|
"data-select": "true",
|
|
159
163
|
disabled: a,
|
|
160
|
-
name:
|
|
164
|
+
name: w,
|
|
161
165
|
onChange: l,
|
|
162
166
|
onKeyDown: p,
|
|
163
167
|
// Assertion is needed for React 18 compatibility
|
|
164
|
-
ref:
|
|
165
|
-
required:
|
|
166
|
-
value:
|
|
167
|
-
children: [!
|
|
168
|
+
ref: i,
|
|
169
|
+
required: k,
|
|
170
|
+
value: h !== null ? h : "",
|
|
171
|
+
children: [!h && o.jsx("option", { value: "", children: "--" }), o.jsx("option", { disabled: _, value: "am", children: P }), o.jsx("option", { disabled: y, value: "pm", children: g })]
|
|
168
172
|
});
|
|
169
173
|
}
|
|
170
|
-
const We = typeof window < "u",
|
|
171
|
-
function
|
|
174
|
+
const We = typeof window < "u", yn = We ? rn : pe, Ln = We && /(MSIE|Trident\/|Edge\/)/.test(navigator.userAgent), jn = We && /Firefox/.test(navigator.userAgent);
|
|
175
|
+
function Nn(e) {
|
|
172
176
|
const { target: n } = e;
|
|
173
|
-
|
|
177
|
+
Ln ? requestAnimationFrame(() => n.select()) : n.select();
|
|
174
178
|
}
|
|
175
|
-
function
|
|
179
|
+
function Cn(e) {
|
|
176
180
|
if (document.readyState === "complete")
|
|
177
181
|
return;
|
|
178
182
|
function n() {
|
|
@@ -180,10 +184,10 @@ function Ln(e) {
|
|
|
180
184
|
}
|
|
181
185
|
window.addEventListener("load", n);
|
|
182
186
|
}
|
|
183
|
-
function
|
|
187
|
+
function Hn(e) {
|
|
184
188
|
if (!document.fonts)
|
|
185
189
|
return;
|
|
186
|
-
const n =
|
|
190
|
+
const n = cn(e);
|
|
187
191
|
if (!n || document.fonts.check(n))
|
|
188
192
|
return;
|
|
189
193
|
function a() {
|
|
@@ -191,7 +195,7 @@ function jn(e) {
|
|
|
191
195
|
}
|
|
192
196
|
document.fonts.addEventListener("loadingdone", a);
|
|
193
197
|
}
|
|
194
|
-
function
|
|
198
|
+
function In(e) {
|
|
195
199
|
if (e && "selectionStart" in e && e.selectionStart !== null && "selectionEnd" in e && e.selectionEnd !== null)
|
|
196
200
|
return e.value.slice(e.selectionStart, e.selectionEnd);
|
|
197
201
|
if ("getSelection" in window) {
|
|
@@ -200,78 +204,78 @@ function Nn(e) {
|
|
|
200
204
|
}
|
|
201
205
|
return null;
|
|
202
206
|
}
|
|
203
|
-
function
|
|
207
|
+
function En(e) {
|
|
204
208
|
if (e !== null)
|
|
205
|
-
return function(
|
|
206
|
-
if (
|
|
209
|
+
return function(t) {
|
|
210
|
+
if (jn)
|
|
207
211
|
return;
|
|
208
|
-
const { key: a, target:
|
|
209
|
-
(!
|
|
212
|
+
const { key: a, target: i } = t, { value: s } = i, c = a.length === 1 && /\d/.test(a), u = In(i);
|
|
213
|
+
(!c || !(u || s.length < e)) && t.preventDefault();
|
|
210
214
|
};
|
|
211
215
|
}
|
|
212
|
-
function Ne({ ariaLabel: e, autoFocus: n, className:
|
|
213
|
-
|
|
214
|
-
!
|
|
215
|
-
}, [
|
|
216
|
-
const
|
|
217
|
-
return
|
|
216
|
+
function Ne({ ariaLabel: e, autoFocus: n, className: t, disabled: a, inputRef: i, max: s, min: c, name: u, nameForClass: l, onChange: p, onKeyDown: k, onKeyUp: h, placeholder: _ = "--", required: y, showLeadingZeros: w, step: P, value: g }) {
|
|
217
|
+
yn(() => {
|
|
218
|
+
!i || !i.current || (ye(i.current), Cn(i.current), Hn(i.current));
|
|
219
|
+
}, [i, g]);
|
|
220
|
+
const N = w && g && Number(g) < 10 && (g === "0" || !g.toString().startsWith("0")), M = s ? s.toString().length : null;
|
|
221
|
+
return o.jsxs(o.Fragment, { children: [N ? o.jsx("span", { className: `${t}__leadingZero`, children: "0" }) : null, o.jsx("input", {
|
|
218
222
|
"aria-label": e,
|
|
219
223
|
autoComplete: "off",
|
|
220
224
|
// biome-ignore lint/a11y/noAutofocus: This is up to developers' decision
|
|
221
225
|
autoFocus: n,
|
|
222
|
-
className: be(`${
|
|
226
|
+
className: be(`${t}__input`, `${t}__${l || u}`, N && `${t}__input--hasLeadingZero`),
|
|
223
227
|
"data-input": "true",
|
|
224
228
|
disabled: a,
|
|
225
229
|
inputMode: "numeric",
|
|
226
|
-
max:
|
|
227
|
-
min:
|
|
230
|
+
max: s,
|
|
231
|
+
min: c,
|
|
228
232
|
name: u,
|
|
229
233
|
onChange: p,
|
|
230
|
-
onFocus:
|
|
231
|
-
onKeyDown:
|
|
232
|
-
onKeyPress:
|
|
233
|
-
onKeyUp: (
|
|
234
|
-
ye(
|
|
234
|
+
onFocus: Nn,
|
|
235
|
+
onKeyDown: k,
|
|
236
|
+
onKeyPress: En(M),
|
|
237
|
+
onKeyUp: (E) => {
|
|
238
|
+
ye(E.target), h && h(E);
|
|
235
239
|
},
|
|
236
|
-
placeholder:
|
|
240
|
+
placeholder: _,
|
|
237
241
|
// Assertion is needed for React 18 compatibility
|
|
238
|
-
ref:
|
|
239
|
-
required:
|
|
240
|
-
step:
|
|
242
|
+
ref: i,
|
|
243
|
+
required: y,
|
|
244
|
+
step: P,
|
|
241
245
|
type: "number",
|
|
242
|
-
value:
|
|
246
|
+
value: g !== null ? g : ""
|
|
243
247
|
})] });
|
|
244
248
|
}
|
|
245
|
-
function
|
|
246
|
-
const
|
|
247
|
-
const [l, p] = me(
|
|
249
|
+
function Fn({ amPm: e, maxTime: n, minTime: t, value: a, ...i }) {
|
|
250
|
+
const s = Le(12, n && (() => {
|
|
251
|
+
const [l, p] = me(I(n));
|
|
248
252
|
return p !== e ? null : l;
|
|
249
|
-
})()),
|
|
250
|
-
const [l, p] = me(
|
|
253
|
+
})()), c = je(1, t && (() => {
|
|
254
|
+
const [l, p] = me(I(t));
|
|
251
255
|
return (
|
|
252
256
|
// pm is always after am, so we should ignore validation
|
|
253
257
|
p !== e || // If minHour is 12 am/pm, user should be able to enter 12, 1, ..., 11.
|
|
254
258
|
l === 12 ? null : l
|
|
255
259
|
);
|
|
256
260
|
})()), u = a ? me(a)[0].toString() : "";
|
|
257
|
-
return
|
|
261
|
+
return o.jsx(Ne, { max: s, min: c, name: "hour12", nameForClass: "hour", value: u, ...i });
|
|
258
262
|
}
|
|
259
|
-
function
|
|
260
|
-
const a = Le(23, e &&
|
|
261
|
-
return
|
|
263
|
+
function Pn({ maxTime: e, minTime: n, ...t }) {
|
|
264
|
+
const a = Le(23, e && I(e)), i = je(0, n && I(n));
|
|
265
|
+
return o.jsx(Ne, { max: a, min: i, name: "hour24", nameForClass: "hour", ...t });
|
|
262
266
|
}
|
|
263
|
-
function
|
|
264
|
-
function
|
|
265
|
-
return e ===
|
|
267
|
+
function Sn({ hour: e, maxTime: n, minTime: t, showLeadingZeros: a = !0, ...i }) {
|
|
268
|
+
function s(l) {
|
|
269
|
+
return e === I(l).toString();
|
|
266
270
|
}
|
|
267
|
-
const
|
|
268
|
-
return
|
|
271
|
+
const c = Le(59, n && s(n) && oe(n)), u = je(0, t && s(t) && oe(t));
|
|
272
|
+
return o.jsx(Ne, { max: c, min: u, name: "minute", showLeadingZeros: a, ...i });
|
|
269
273
|
}
|
|
270
|
-
function
|
|
274
|
+
function $n({ ariaLabel: e, disabled: n, maxTime: t, minTime: a, name: i, onChange: s, required: c, value: u, valueType: l }) {
|
|
271
275
|
const p = (() => {
|
|
272
276
|
switch (l) {
|
|
273
277
|
case "hour":
|
|
274
|
-
return (
|
|
278
|
+
return (_) => `${I(_)}:00`;
|
|
275
279
|
case "minute":
|
|
276
280
|
return Ue;
|
|
277
281
|
case "second":
|
|
@@ -279,7 +283,7 @@ function Fn({ ariaLabel: e, disabled: n, maxTime: r, minTime: a, name: o, onChan
|
|
|
279
283
|
default:
|
|
280
284
|
throw new Error("Invalid valueType");
|
|
281
285
|
}
|
|
282
|
-
})(),
|
|
286
|
+
})(), k = (() => {
|
|
283
287
|
switch (l) {
|
|
284
288
|
case "hour":
|
|
285
289
|
return 3600;
|
|
@@ -291,78 +295,78 @@ function Fn({ ariaLabel: e, disabled: n, maxTime: r, minTime: a, name: o, onChan
|
|
|
291
295
|
throw new Error("Invalid valueType");
|
|
292
296
|
}
|
|
293
297
|
})();
|
|
294
|
-
function
|
|
295
|
-
|
|
298
|
+
function h(_) {
|
|
299
|
+
_.stopPropagation();
|
|
296
300
|
}
|
|
297
|
-
return
|
|
301
|
+
return o.jsx("input", { "aria-label": e, disabled: n, hidden: !0, max: t ? p(t) : void 0, min: a ? p(a) : void 0, name: i, onChange: s, onFocus: h, required: c, step: k, style: {
|
|
298
302
|
visibility: "hidden",
|
|
299
303
|
position: "absolute",
|
|
300
304
|
zIndex: "-999"
|
|
301
305
|
}, type: "time", value: u ? p(u) : "" });
|
|
302
306
|
}
|
|
303
|
-
function
|
|
304
|
-
function
|
|
305
|
-
return e ===
|
|
307
|
+
function Mn({ hour: e, maxTime: n, minTime: t, minute: a, showLeadingZeros: i = !0, ...s }) {
|
|
308
|
+
function c(p) {
|
|
309
|
+
return e === I(p).toString() && a === oe(p).toString();
|
|
306
310
|
}
|
|
307
|
-
const u = Le(59, n &&
|
|
308
|
-
return
|
|
311
|
+
const u = Le(59, n && c(n) && de(n)), l = je(0, t && c(t) && de(t));
|
|
312
|
+
return o.jsx(Ne, { max: u, min: l, name: "second", showLeadingZeros: i, ...s });
|
|
309
313
|
}
|
|
310
|
-
const Ge = {},
|
|
311
|
-
function
|
|
314
|
+
const Ge = {}, An = ["hour", "minute", "second"];
|
|
315
|
+
function On(e) {
|
|
312
316
|
return e.dataset.input === "true";
|
|
313
317
|
}
|
|
314
|
-
function
|
|
315
|
-
let
|
|
318
|
+
function Re(e, n) {
|
|
319
|
+
let t = e;
|
|
316
320
|
do
|
|
317
|
-
|
|
318
|
-
while (
|
|
319
|
-
return
|
|
321
|
+
t = t[n];
|
|
322
|
+
while (t && !On(t));
|
|
323
|
+
return t;
|
|
320
324
|
}
|
|
321
325
|
function Ae(e) {
|
|
322
326
|
e && e.focus();
|
|
323
327
|
}
|
|
324
|
-
function
|
|
325
|
-
const a = [],
|
|
326
|
-
return e.split(
|
|
328
|
+
function Wn(e, n, t) {
|
|
329
|
+
const a = [], i = new RegExp(Object.keys(n).map((c) => `${c}+`).join("|"), "g"), s = e.match(i);
|
|
330
|
+
return e.split(i).reduce((c, u, l) => {
|
|
327
331
|
const p = u && // biome-ignore lint/suspicious/noArrayIndexKey: index is stable here
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
const
|
|
331
|
-
if (
|
|
332
|
-
const
|
|
333
|
-
if (!
|
|
334
|
-
return
|
|
335
|
-
!
|
|
332
|
+
o.jsx(vn, { children: u }, `separator_${l}`);
|
|
333
|
+
c.push(p);
|
|
334
|
+
const k = s?.[l];
|
|
335
|
+
if (k) {
|
|
336
|
+
const h = n[k] || n[Object.keys(n).find((_) => k.match(_))];
|
|
337
|
+
if (!h)
|
|
338
|
+
return c;
|
|
339
|
+
!t && a.includes(h) ? c.push(k) : (c.push(h(k, l)), a.push(h));
|
|
336
340
|
}
|
|
337
|
-
return
|
|
341
|
+
return c;
|
|
338
342
|
}, []);
|
|
339
343
|
}
|
|
340
|
-
const we =
|
|
341
|
-
function
|
|
342
|
-
const [
|
|
344
|
+
const we = _n({ useGrouping: !1 });
|
|
345
|
+
function Dn({ amPmAriaLabel: e, autoFocus: n, className: t, disabled: a, format: i, hourAriaLabel: s, hourPlaceholder: c, isClockOpen: u = null, locale: l, maxDetail: p = "minute", maxTime: k, minTime: h, minuteAriaLabel: _, minutePlaceholder: y, name: w = "time", nativeInputAriaLabel: P, onChange: g, onInvalidChange: N, required: M, secondAriaLabel: E, secondPlaceholder: A, value: J }) {
|
|
346
|
+
const [Q, R] = re(null), [O, S] = re(null), [q, z] = re(null), [T, X] = re(null), [ie, Y] = re(null), V = G(null), ae = G(null), se = G(null), Z = G(null), ee = G(null), [B, L] = re(u), W = G(void 0);
|
|
343
347
|
pe(() => {
|
|
344
|
-
|
|
348
|
+
L(u);
|
|
345
349
|
}, [u]), pe(() => {
|
|
346
|
-
const
|
|
347
|
-
|
|
350
|
+
const r = J;
|
|
351
|
+
r ? (R(me(I(r))[1]), S(I(r).toString()), z(oe(r).toString()), X(de(r).toString()), Y(r)) : (R(null), S(null), z(null), X(null), Y(null));
|
|
348
352
|
}, [
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
353
|
+
J,
|
|
354
|
+
h,
|
|
355
|
+
k,
|
|
352
356
|
p,
|
|
353
357
|
// Toggling clock visibility resets values
|
|
354
|
-
|
|
358
|
+
B
|
|
355
359
|
]);
|
|
356
|
-
const
|
|
357
|
-
const
|
|
360
|
+
const b = p, ce = (() => {
|
|
361
|
+
const r = An.indexOf(p), d = Ge[r] || (() => {
|
|
358
362
|
const m = { hour: "numeric" };
|
|
359
|
-
return
|
|
363
|
+
return r >= 1 && (m.minute = "numeric"), r >= 2 && (m.second = "numeric"), Ge[r] = m, m;
|
|
360
364
|
})();
|
|
361
365
|
return Je(d);
|
|
362
366
|
})();
|
|
363
|
-
function ue(
|
|
367
|
+
function ue(r) {
|
|
364
368
|
return (() => {
|
|
365
|
-
switch (
|
|
369
|
+
switch (b) {
|
|
366
370
|
case "hour":
|
|
367
371
|
case "minute":
|
|
368
372
|
return Ue;
|
|
@@ -371,249 +375,247 @@ function An({ amPmAriaLabel: e, autoFocus: n, className: r, disabled: a, format:
|
|
|
371
375
|
default:
|
|
372
376
|
throw new Error("Invalid valueType");
|
|
373
377
|
}
|
|
374
|
-
})()(
|
|
378
|
+
})()(r);
|
|
375
379
|
}
|
|
376
|
-
const
|
|
377
|
-
const
|
|
378
|
-
return ce(l,
|
|
380
|
+
const $ = i || (() => {
|
|
381
|
+
const Ie = new Date(2017, 0, 1, 21, 13, 14);
|
|
382
|
+
return ce(l, Ie).replace(we(l, 9), "h").replace(we(l, 21), "H").replace(we(l, 13), "mm").replace(we(l, 14), "ss").replace(new RegExp(Qe(l).join("|")), "a");
|
|
379
383
|
})(), fe = (() => {
|
|
380
|
-
const
|
|
381
|
-
return
|
|
384
|
+
const r = $.match(/[^0-9a-z]/i);
|
|
385
|
+
return r ? r[0] : null;
|
|
382
386
|
})();
|
|
383
|
-
function le(
|
|
384
|
-
if (
|
|
385
|
-
const d =
|
|
387
|
+
function le(r) {
|
|
388
|
+
if (r.target === r.currentTarget) {
|
|
389
|
+
const d = r.target.children[1];
|
|
386
390
|
Ae(d);
|
|
387
391
|
}
|
|
388
392
|
}
|
|
389
|
-
function he(
|
|
390
|
-
switch (
|
|
393
|
+
function he(r) {
|
|
394
|
+
switch (W.current = r.key, r.key) {
|
|
391
395
|
case "ArrowLeft":
|
|
392
396
|
case "ArrowRight":
|
|
393
397
|
case fe: {
|
|
394
|
-
|
|
395
|
-
const { target: d } =
|
|
396
|
-
Ae(
|
|
398
|
+
r.preventDefault();
|
|
399
|
+
const { target: d } = r, m = r.key === "ArrowLeft" ? "previousElementSibling" : "nextElementSibling", F = Re(d, m);
|
|
400
|
+
Ae(F);
|
|
397
401
|
break;
|
|
398
402
|
}
|
|
399
403
|
}
|
|
400
404
|
}
|
|
401
|
-
function
|
|
402
|
-
const { key: d, target: m } =
|
|
403
|
-
if (!(
|
|
405
|
+
function ne(r) {
|
|
406
|
+
const { key: d, target: m } = r;
|
|
407
|
+
if (!(W.current === d) || !!Number.isNaN(Number(d)))
|
|
404
408
|
return;
|
|
405
409
|
const ge = m.getAttribute("max");
|
|
406
410
|
if (!ge)
|
|
407
411
|
return;
|
|
408
412
|
const { value: _e } = m;
|
|
409
413
|
if (Number(_e) * 10 > Number(ge) || _e.length >= ge.length) {
|
|
410
|
-
const
|
|
411
|
-
Ae(
|
|
414
|
+
const Ee = Re(m, "nextElementSibling");
|
|
415
|
+
Ae(Ee);
|
|
412
416
|
}
|
|
413
417
|
}
|
|
414
|
-
function
|
|
415
|
-
if (!
|
|
418
|
+
function x() {
|
|
419
|
+
if (!g)
|
|
416
420
|
return;
|
|
417
|
-
function
|
|
418
|
-
return !!
|
|
421
|
+
function r(j) {
|
|
422
|
+
return !!j;
|
|
419
423
|
}
|
|
420
424
|
const d = [
|
|
421
|
-
|
|
425
|
+
V.current,
|
|
422
426
|
ae.current,
|
|
423
427
|
se.current,
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
].filter(
|
|
427
|
-
for (const
|
|
428
|
-
|
|
429
|
-
if (m.every((
|
|
430
|
-
|
|
428
|
+
Z.current,
|
|
429
|
+
ee.current
|
|
430
|
+
].filter(r), m = d.slice(1), F = {};
|
|
431
|
+
for (const j of d)
|
|
432
|
+
F[j.name] = j.type === "number" ? j.valueAsNumber : j.value;
|
|
433
|
+
if (m.every((j) => !j.value)) {
|
|
434
|
+
g(null, !1);
|
|
431
435
|
return;
|
|
432
436
|
}
|
|
433
|
-
const ge = d.every((
|
|
437
|
+
const ge = d.every((j) => j.value), _e = d.every((j) => j.validity.valid);
|
|
434
438
|
if (ge && _e) {
|
|
435
|
-
const
|
|
436
|
-
|
|
439
|
+
const j = Number(F.hour24 || F.hour12 && F.amPm && Ve(F.hour12, F.amPm) || 0), Ee = Number(F.minute || 0), Ye = Number(F.second || 0), Fe = (tn) => `0${tn}`.slice(-2), en = `${Fe(j)}:${Fe(Ee)}:${Fe(Ye)}`, nn = ue(en);
|
|
440
|
+
g(nn, !1);
|
|
437
441
|
return;
|
|
438
442
|
}
|
|
439
|
-
|
|
443
|
+
N && N();
|
|
440
444
|
}
|
|
441
|
-
function
|
|
442
|
-
const { name: d, value: m } =
|
|
445
|
+
function v(r) {
|
|
446
|
+
const { name: d, value: m } = r.target;
|
|
443
447
|
switch (d) {
|
|
444
448
|
case "amPm":
|
|
445
|
-
|
|
449
|
+
R(m);
|
|
446
450
|
break;
|
|
447
451
|
case "hour12":
|
|
448
|
-
|
|
452
|
+
S(m ? Ve(m, Q || "am").toString() : "");
|
|
449
453
|
break;
|
|
450
454
|
case "hour24":
|
|
451
|
-
|
|
455
|
+
S(m);
|
|
452
456
|
break;
|
|
453
457
|
case "minute":
|
|
454
|
-
|
|
458
|
+
z(m);
|
|
455
459
|
break;
|
|
456
460
|
case "second":
|
|
457
|
-
|
|
461
|
+
X(m);
|
|
458
462
|
break;
|
|
459
463
|
}
|
|
460
|
-
|
|
464
|
+
x();
|
|
461
465
|
}
|
|
462
|
-
function
|
|
463
|
-
const { value: d } =
|
|
464
|
-
if (!
|
|
466
|
+
function te(r) {
|
|
467
|
+
const { value: d } = r.target;
|
|
468
|
+
if (!g)
|
|
465
469
|
return;
|
|
466
|
-
|
|
470
|
+
g(d || null, !1);
|
|
467
471
|
}
|
|
468
|
-
const
|
|
469
|
-
className:
|
|
472
|
+
const K = {
|
|
473
|
+
className: t,
|
|
470
474
|
disabled: a,
|
|
471
|
-
maxTime:
|
|
472
|
-
minTime:
|
|
473
|
-
onChange:
|
|
475
|
+
maxTime: k,
|
|
476
|
+
minTime: h,
|
|
477
|
+
onChange: v,
|
|
474
478
|
onKeyDown: he,
|
|
475
|
-
onKeyUp:
|
|
479
|
+
onKeyUp: ne,
|
|
476
480
|
// This is only for showing validity when editing
|
|
477
|
-
required: !!(
|
|
481
|
+
required: !!(M || B)
|
|
478
482
|
};
|
|
479
|
-
function
|
|
480
|
-
if (
|
|
481
|
-
throw new Error(`Unsupported token: ${
|
|
482
|
-
const m =
|
|
483
|
-
return
|
|
484
|
-
}
|
|
485
|
-
function
|
|
486
|
-
if (
|
|
487
|
-
throw new Error(`Unsupported token: ${
|
|
488
|
-
const m =
|
|
489
|
-
return
|
|
490
|
-
}
|
|
491
|
-
function ke(
|
|
492
|
-
return /h/.test(
|
|
493
|
-
}
|
|
494
|
-
function f(
|
|
495
|
-
if (
|
|
496
|
-
throw new Error(`Unsupported token: ${
|
|
497
|
-
const m =
|
|
498
|
-
return
|
|
499
|
-
}
|
|
500
|
-
function
|
|
501
|
-
if (
|
|
502
|
-
throw new Error(`Unsupported token: ${
|
|
503
|
-
const m =
|
|
504
|
-
return
|
|
505
|
-
}
|
|
506
|
-
function
|
|
507
|
-
return
|
|
508
|
-
}
|
|
509
|
-
function
|
|
510
|
-
return
|
|
483
|
+
function Ce(r, d) {
|
|
484
|
+
if (r && r.length > 2)
|
|
485
|
+
throw new Error(`Unsupported token: ${r}`);
|
|
486
|
+
const m = r ? r.length === 2 : !1;
|
|
487
|
+
return o.jsx(Fn, { ...K, amPm: Q, ariaLabel: s, autoFocus: d === 0 && n, inputRef: ae, placeholder: c, showLeadingZeros: m, value: O }, "hour12");
|
|
488
|
+
}
|
|
489
|
+
function He(r, d) {
|
|
490
|
+
if (r && r.length > 2)
|
|
491
|
+
throw new Error(`Unsupported token: ${r}`);
|
|
492
|
+
const m = r ? r.length === 2 : !1;
|
|
493
|
+
return o.jsx(Pn, { ...K, ariaLabel: s, autoFocus: d === 0 && n, inputRef: se, placeholder: c, showLeadingZeros: m, value: O }, "hour24");
|
|
494
|
+
}
|
|
495
|
+
function ke(r, d) {
|
|
496
|
+
return /h/.test(r) ? Ce(r, d) : He(r, d);
|
|
497
|
+
}
|
|
498
|
+
function f(r, d) {
|
|
499
|
+
if (r && r.length > 2)
|
|
500
|
+
throw new Error(`Unsupported token: ${r}`);
|
|
501
|
+
const m = r ? r.length === 2 : !1;
|
|
502
|
+
return o.jsx(Sn, { ...K, ariaLabel: _, autoFocus: d === 0 && n, hour: O, inputRef: Z, placeholder: y, showLeadingZeros: m, value: q }, "minute");
|
|
503
|
+
}
|
|
504
|
+
function C(r, d) {
|
|
505
|
+
if (r && r.length > 2)
|
|
506
|
+
throw new Error(`Unsupported token: ${r}`);
|
|
507
|
+
const m = r ? r.length === 2 : !0;
|
|
508
|
+
return o.jsx(Mn, { ...K, ariaLabel: E, autoFocus: d === 0 && n, hour: O, inputRef: ee, minute: q, placeholder: A, showLeadingZeros: m, value: T }, "second");
|
|
509
|
+
}
|
|
510
|
+
function D(r, d) {
|
|
511
|
+
return o.jsx(wn, { ...K, ariaLabel: e, autoFocus: d === 0 && n, inputRef: V, locale: l, onChange: v, value: Q }, "ampm");
|
|
512
|
+
}
|
|
513
|
+
function U() {
|
|
514
|
+
return Wn($, {
|
|
511
515
|
h: ke,
|
|
512
516
|
H: ke,
|
|
513
517
|
m: f,
|
|
514
|
-
s:
|
|
515
|
-
a:
|
|
516
|
-
}, typeof
|
|
518
|
+
s: C,
|
|
519
|
+
a: D
|
|
520
|
+
}, typeof i < "u");
|
|
517
521
|
}
|
|
518
522
|
function ve() {
|
|
519
|
-
return
|
|
523
|
+
return o.jsx($n, { ariaLabel: P, disabled: a, maxTime: k, minTime: h, name: w, onChange: te, required: M, value: ie, valueType: b }, "time");
|
|
520
524
|
}
|
|
521
525
|
return (
|
|
522
526
|
// biome-ignore lint/a11y/useKeyWithClickEvents: This interaction is designed for mouse users only
|
|
523
527
|
// biome-ignore lint/a11y/noStaticElementInteractions: This interaction is designed for mouse users only
|
|
524
|
-
|
|
528
|
+
o.jsxs("div", { className: t, onClick: le, children: [ve(), U()] })
|
|
525
529
|
);
|
|
526
530
|
}
|
|
527
|
-
const
|
|
531
|
+
const H = "react-time-picker", zn = ["mousedown", "focusin", "touchstart"], Xe = {
|
|
528
532
|
xmlns: "http://www.w3.org/2000/svg",
|
|
529
533
|
width: 19,
|
|
530
534
|
height: 19,
|
|
531
535
|
viewBox: "0 0 19 19",
|
|
532
536
|
stroke: "black",
|
|
533
537
|
strokeWidth: 2
|
|
534
|
-
},
|
|
535
|
-
function
|
|
536
|
-
const { amPmAriaLabel: n, autoFocus:
|
|
538
|
+
}, Vn = o.jsxs("svg", { ...Xe, "aria-hidden": "true", className: `${H}__clock-button__icon ${H}__button__icon`, fill: "none", children: [o.jsx("circle", { cx: "9.5", cy: "9.5", r: "7.5" }), o.jsx("path", { d: "M9.5 4.5 v5 h4" })] }), Zn = o.jsxs("svg", { ...Xe, "aria-hidden": "true", className: `${H}__clear-button__icon ${H}__button__icon`, children: [o.jsx("line", { x1: "4", x2: "15", y1: "4", y2: "15" }), o.jsx("line", { x1: "15", x2: "4", y1: "4", y2: "15" })] });
|
|
539
|
+
function Kn(e) {
|
|
540
|
+
const { amPmAriaLabel: n, autoFocus: t, className: a, clearAriaLabel: i, clearIcon: s = Zn, clockAriaLabel: c, clockIcon: u = Vn, closeClock: l = !0, "data-testid": p, hourAriaLabel: k, hourPlaceholder: h, disableClock: _, disabled: y, format: w, id: P, isOpen: g = null, locale: N, maxTime: M, maxDetail: E = "minute", minTime: A, minuteAriaLabel: J, minutePlaceholder: Q, name: R = "time", nativeInputAriaLabel: O, onClockClose: S, onClockOpen: q, onChange: z, onFocus: T, onInvalidChange: X, openClockOnFocus: ie = !0, required: Y, value: V, secondAriaLabel: ae, secondPlaceholder: se, shouldCloseClock: Z, shouldOpenClock: ee, ...B } = e, [L, W] = re(g), b = G(null), ce = G(null);
|
|
537
541
|
pe(() => {
|
|
538
|
-
|
|
539
|
-
}, [
|
|
542
|
+
W(g);
|
|
543
|
+
}, [g]);
|
|
540
544
|
function ue({ reason: f }) {
|
|
541
|
-
|
|
545
|
+
ee && !ee({ reason: f }) || (W(!0), q && q());
|
|
542
546
|
}
|
|
543
|
-
const
|
|
544
|
-
|
|
545
|
-
}, [
|
|
547
|
+
const $ = xe(({ reason: f }) => {
|
|
548
|
+
Z && !Z({ reason: f }) || (W(!1), S && S());
|
|
549
|
+
}, [S, Z]);
|
|
546
550
|
function fe() {
|
|
547
|
-
|
|
551
|
+
L ? $({ reason: "buttonClick" }) : ue({ reason: "buttonClick" });
|
|
548
552
|
}
|
|
549
|
-
function le(f,
|
|
550
|
-
|
|
553
|
+
function le(f, C = l) {
|
|
554
|
+
C && $({ reason: "select" }), z && z(f);
|
|
551
555
|
}
|
|
552
556
|
function he(f) {
|
|
553
|
-
|
|
554
|
-
!(
|
|
557
|
+
T && T(f), // Internet Explorer still fires onFocus on disabled elements
|
|
558
|
+
!(y || L || !ie || f.target.dataset.select === "true") && ue({ reason: "focus" });
|
|
555
559
|
}
|
|
556
|
-
const
|
|
557
|
-
f.key === "Escape" &&
|
|
558
|
-
}, [
|
|
559
|
-
function
|
|
560
|
+
const ne = xe((f) => {
|
|
561
|
+
f.key === "Escape" && $({ reason: "escape" });
|
|
562
|
+
}, [$]);
|
|
563
|
+
function x() {
|
|
560
564
|
le(null);
|
|
561
565
|
}
|
|
562
|
-
function
|
|
566
|
+
function v(f) {
|
|
563
567
|
f.stopPropagation();
|
|
564
568
|
}
|
|
565
|
-
const
|
|
566
|
-
const { current:
|
|
567
|
-
|
|
568
|
-
}, [
|
|
569
|
-
for (const
|
|
570
|
-
f ? document.addEventListener(
|
|
571
|
-
f ? document.addEventListener("keydown",
|
|
572
|
-
}, [
|
|
573
|
-
pe(() => (
|
|
574
|
-
|
|
575
|
-
}), [
|
|
576
|
-
function
|
|
577
|
-
const [f] = Array.isArray(
|
|
569
|
+
const te = xe((f) => {
|
|
570
|
+
const { current: C } = b, { current: D } = ce, U = "composedPath" in f ? f.composedPath()[0] : f.target;
|
|
571
|
+
U && C && !C.contains(U) && (!D || !D.contains(U)) && $({ reason: "outsideAction" });
|
|
572
|
+
}, [$]), K = xe((f = L) => {
|
|
573
|
+
for (const C of zn)
|
|
574
|
+
f ? document.addEventListener(C, te) : document.removeEventListener(C, te);
|
|
575
|
+
f ? document.addEventListener("keydown", ne) : document.removeEventListener("keydown", ne);
|
|
576
|
+
}, [L, te, ne]);
|
|
577
|
+
pe(() => (K(), () => {
|
|
578
|
+
K(!1);
|
|
579
|
+
}), [K]);
|
|
580
|
+
function Ce() {
|
|
581
|
+
const [f] = Array.isArray(V) ? V : [V], C = {
|
|
578
582
|
amPmAriaLabel: n,
|
|
579
|
-
hourAriaLabel:
|
|
580
|
-
minuteAriaLabel:
|
|
581
|
-
nativeInputAriaLabel:
|
|
583
|
+
hourAriaLabel: k,
|
|
584
|
+
minuteAriaLabel: J,
|
|
585
|
+
nativeInputAriaLabel: O,
|
|
582
586
|
secondAriaLabel: ae
|
|
583
|
-
},
|
|
584
|
-
hourPlaceholder:
|
|
585
|
-
minutePlaceholder:
|
|
587
|
+
}, D = {
|
|
588
|
+
hourPlaceholder: h,
|
|
589
|
+
minutePlaceholder: Q,
|
|
586
590
|
secondPlaceholder: se
|
|
587
591
|
};
|
|
588
|
-
return
|
|
592
|
+
return o.jsxs("div", { className: `${H}__wrapper`, children: [o.jsx(Dn, { ...C, ...D, autoFocus: t, className: `${H}__inputGroup`, disabled: y, format: w, isClockOpen: L, locale: N, maxDetail: E, maxTime: M, minTime: A, name: R, onChange: le, onInvalidChange: X, required: Y, value: f }), s !== null && o.jsx("button", { "aria-label": i, className: `${H}__clear-button ${H}__button`, disabled: y, onClick: x, onFocus: v, type: "button", children: typeof s == "function" ? De(s) : s }), u !== null && !_ && o.jsx("button", { "aria-expanded": L || !1, "aria-label": c, className: `${H}__clock-button ${H}__button`, disabled: y, onClick: fe, onFocus: v, type: "button", children: typeof u == "function" ? De(u) : u })] });
|
|
589
593
|
}
|
|
590
|
-
function
|
|
591
|
-
if (
|
|
594
|
+
function He() {
|
|
595
|
+
if (L === null || _)
|
|
592
596
|
return null;
|
|
593
|
-
const { clockProps: f, portalContainer:
|
|
594
|
-
return
|
|
595
|
-
m && !
|
|
597
|
+
const { clockProps: f, portalContainer: C, value: D } = e, U = `${H}__clock`, ve = be(U, `${U}--${L ? "open" : "closed"}`), [r] = Array.isArray(D) ? D : [D], d = o.jsx(kn, { locale: N, value: r, ...f });
|
|
598
|
+
return C ? sn(o.jsx("div", { ref: ce, className: ve, children: d }), C) : o.jsx(ln, { children: o.jsx("div", { ref: (m) => {
|
|
599
|
+
m && !L && m.removeAttribute("style");
|
|
596
600
|
}, className: ve, children: d }) });
|
|
597
601
|
}
|
|
598
602
|
const ke = on(
|
|
599
|
-
() =>
|
|
603
|
+
() => un(B),
|
|
600
604
|
// biome-ignore lint/correctness/useExhaustiveDependencies: FIXME
|
|
601
|
-
[
|
|
605
|
+
[B]
|
|
602
606
|
);
|
|
603
607
|
return (
|
|
604
608
|
// biome-ignore lint/a11y/noStaticElementInteractions: False positive caused by non interactive wrapper listening for bubbling events
|
|
605
|
-
|
|
609
|
+
o.jsxs("div", { className: be(H, `${H}--${L ? "open" : "closed"}`, `${H}--${y ? "disabled" : "enabled"}`, a), "data-testid": p, id: P, ...ke, onFocus: he, ref: b, children: [Ce(), He()] })
|
|
606
610
|
);
|
|
607
611
|
}
|
|
608
|
-
const
|
|
612
|
+
const Gn = dn.div`
|
|
609
613
|
width: auto;
|
|
610
614
|
|
|
611
615
|
.react-time-picker {
|
|
612
616
|
display: inline-flex;
|
|
613
617
|
position: relative;
|
|
614
|
-
width: 86px;
|
|
615
|
-
min-width: 86px;
|
|
616
|
-
max-width: 86px;
|
|
618
|
+
min-width: 86px;
|
|
617
619
|
}
|
|
618
620
|
|
|
619
621
|
.react-time-picker,
|
|
@@ -632,18 +634,25 @@ const Vn = ln.div`
|
|
|
632
634
|
display: flex;
|
|
633
635
|
flex-grow: 1;
|
|
634
636
|
flex-shrink: 0;
|
|
635
|
-
border: 1px solid var(--input);
|
|
637
|
+
border: 1px solid ${({ isInvalid: e }) => e ? "var(--color-danger-default)" : "var(--input)"};
|
|
636
638
|
background-color: white;
|
|
637
639
|
border-radius: var(--radius-medium);
|
|
638
640
|
width: 100%;
|
|
639
641
|
height: var(--input-default);
|
|
640
642
|
padding: 0 6px;
|
|
643
|
+
transition: border-color 120ms ease;
|
|
644
|
+
|
|
645
|
+
&:focus-within {
|
|
646
|
+
border-color: ${({ isInvalid: e }) => e ? "var(--color-danger-default)" : "var(--color-primary-default)"};
|
|
647
|
+
box-shadow: 0 0 0 3px
|
|
648
|
+
${({ isInvalid: e }) => e ? "color-mix(in srgb, var(--color-danger-default) 20%, transparent)" : "color-mix(in srgb, var(--color-primary-default) 20%, transparent)"};
|
|
649
|
+
}
|
|
641
650
|
}
|
|
642
651
|
.react-time-picker__inputGroup {
|
|
643
652
|
padding: 0;
|
|
644
653
|
min-width: unset;
|
|
645
|
-
|
|
646
|
-
|
|
654
|
+
display: flex;
|
|
655
|
+
align-items: center;
|
|
647
656
|
}
|
|
648
657
|
.react-time-picker__inputGroup__divider {
|
|
649
658
|
padding: 1px 0;
|
|
@@ -652,7 +661,7 @@ const Vn = ln.div`
|
|
|
652
661
|
.react-time-picker__inputGroup__leadingZero {
|
|
653
662
|
font-weight: 400;
|
|
654
663
|
font-size: 14px;
|
|
655
|
-
|
|
664
|
+
color: inherit;
|
|
656
665
|
}
|
|
657
666
|
.react-time-picker__inputGroup__input {
|
|
658
667
|
min-width: 0.54em;
|
|
@@ -666,9 +675,9 @@ const Vn = ln.div`
|
|
|
666
675
|
-moz-appearance: textfield;
|
|
667
676
|
font-weight: 400;
|
|
668
677
|
font-size: 14px;
|
|
669
|
-
|
|
678
|
+
color: inherit;
|
|
670
679
|
outline: none;
|
|
671
|
-
|
|
680
|
+
border-radius: var(--radius-small);
|
|
672
681
|
}
|
|
673
682
|
.react-time-picker__inputGroup__input::-webkit-outer-spin-button,
|
|
674
683
|
.react-time-picker__inputGroup__input::-webkit-inner-spin-button {
|
|
@@ -691,18 +700,18 @@ const Vn = ln.div`
|
|
|
691
700
|
border: 0;
|
|
692
701
|
background: transparent;
|
|
693
702
|
padding: 2px 2px;
|
|
694
|
-
|
|
695
|
-
|
|
703
|
+
margin-left: auto;
|
|
704
|
+
width: 20px;
|
|
696
705
|
}
|
|
697
706
|
.react-time-picker__button:enabled {
|
|
698
707
|
cursor: pointer;
|
|
699
|
-
|
|
708
|
+
opacity: 0.7;
|
|
700
709
|
}
|
|
701
710
|
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
711
|
+
.react-time-picker__button:enabled:hover,
|
|
712
|
+
.react-time-picker__button:enabled:focus {
|
|
713
|
+
opacity: 1;
|
|
714
|
+
}
|
|
706
715
|
.react-time-picker__button:enabled:hover .react-time-picker__button__icon,
|
|
707
716
|
.react-time-picker__button:enabled:focus .react-time-picker__button__icon {
|
|
708
717
|
opacity: 1;
|
|
@@ -728,40 +737,75 @@ const Vn = ln.div`
|
|
|
728
737
|
.react-time-picker__clock--closed {
|
|
729
738
|
display: none;
|
|
730
739
|
}
|
|
731
|
-
`,
|
|
740
|
+
`, et = ({
|
|
732
741
|
onChange: e,
|
|
733
742
|
time: n,
|
|
734
|
-
name:
|
|
743
|
+
name: t,
|
|
735
744
|
handleAddTime: a,
|
|
736
|
-
|
|
737
|
-
|
|
745
|
+
id: i,
|
|
746
|
+
label: s,
|
|
747
|
+
required: c = !1,
|
|
748
|
+
isClearable: u = !0,
|
|
749
|
+
error: l,
|
|
750
|
+
touched: p,
|
|
751
|
+
onBlurField: k,
|
|
752
|
+
isErrorText: h = !0,
|
|
753
|
+
disabled: _ = !1,
|
|
754
|
+
...y
|
|
738
755
|
}) => {
|
|
739
|
-
const
|
|
756
|
+
const w = G(null), P = an(), g = i || P, N = !_ && !!l && p, M = mn("form-control-label block font-normal text-sm text-foreground mb-1", {
|
|
757
|
+
"text-danger": N
|
|
758
|
+
});
|
|
740
759
|
return pe(() => {
|
|
741
|
-
const
|
|
742
|
-
|
|
760
|
+
const E = (A) => {
|
|
761
|
+
A.key === "Enter" && (A.preventDefault(), a && a(A));
|
|
743
762
|
};
|
|
744
|
-
return
|
|
745
|
-
|
|
763
|
+
return w.current && w.current.addEventListener("keydown", E), () => {
|
|
764
|
+
w.current && w.current.removeEventListener("keydown", E);
|
|
746
765
|
};
|
|
747
|
-
}, [a,
|
|
748
|
-
|
|
766
|
+
}, [a, t]), /* @__PURE__ */ o.jsxs(
|
|
767
|
+
Gn,
|
|
749
768
|
{
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
769
|
+
ref: w,
|
|
770
|
+
isInvalid: N,
|
|
771
|
+
className: "time-picker-input relative flex flex-col",
|
|
772
|
+
onBlurCapture: () => k?.(t),
|
|
773
|
+
children: [
|
|
774
|
+
s && /* @__PURE__ */ o.jsxs("label", { htmlFor: g, className: M, children: [
|
|
775
|
+
s,
|
|
776
|
+
" ",
|
|
777
|
+
c && /* @__PURE__ */ o.jsx("span", { className: "text-danger", children: "*" })
|
|
778
|
+
] }),
|
|
779
|
+
/* @__PURE__ */ o.jsx(
|
|
780
|
+
Kn,
|
|
781
|
+
{
|
|
782
|
+
id: g,
|
|
783
|
+
name: t,
|
|
784
|
+
value: n,
|
|
785
|
+
onChange: e,
|
|
786
|
+
amPmAriaLabel: "n/a",
|
|
787
|
+
disableClock: !0,
|
|
788
|
+
format: "HH:mm a",
|
|
789
|
+
hourPlaceholder: "hh",
|
|
790
|
+
minutePlaceholder: "mm",
|
|
791
|
+
disabled: _,
|
|
792
|
+
required: c,
|
|
793
|
+
clearIcon: u ? /* @__PURE__ */ o.jsx("svg", { "aria-hidden": "true", focusable: "false", height: "1em", role: "presentation", viewBox: "0 0 24 24", width: "1em", children: /* @__PURE__ */ o.jsx(
|
|
794
|
+
"path",
|
|
795
|
+
{
|
|
796
|
+
d: "M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",
|
|
797
|
+
fill: "currentColor"
|
|
798
|
+
}
|
|
799
|
+
) }) : null,
|
|
800
|
+
...y
|
|
801
|
+
}
|
|
802
|
+
),
|
|
803
|
+
!_ && l && p && h && /* @__PURE__ */ o.jsx(pn, { text: l })
|
|
804
|
+
]
|
|
761
805
|
}
|
|
762
|
-
)
|
|
806
|
+
);
|
|
763
807
|
};
|
|
764
808
|
export {
|
|
765
|
-
|
|
809
|
+
et as TimePickerInput
|
|
766
810
|
};
|
|
767
811
|
//# sourceMappingURL=index.es.js.map
|