@unizap/uniui 1.0.69 → 1.0.71
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/uniui.js
CHANGED
|
@@ -348,8 +348,8 @@ const ke = {
|
|
|
348
348
|
const z = fe(null), x = fe(null), $ = (D) => {
|
|
349
349
|
const q = z.current;
|
|
350
350
|
if (!q) return;
|
|
351
|
-
const ee = document.createElement("span"), K = q.getBoundingClientRect(),
|
|
352
|
-
ee.style.width = ee.style.height = `${
|
|
351
|
+
const ee = document.createElement("span"), K = q.getBoundingClientRect(), B = Math.max(K.width, K.height);
|
|
352
|
+
ee.style.width = ee.style.height = `${B}px`, ee.style.left = `${D.clientX - K.left - B / 2}px`, ee.style.top = `${D.clientY - K.top - B / 2}px`, ee.className = "ripple", q.appendChild(ee), setTimeout(() => ee.remove(), 600), l == null || l(D);
|
|
353
353
|
}, w = ((O = ke[n]) == null ? void 0 : O[t === "filled" ? "filled" : t === "outlined" ? "outline" : "transparent"]) || "";
|
|
354
354
|
return /* @__PURE__ */ a(Ce, { children: h ? /* @__PURE__ */ C(
|
|
355
355
|
"a",
|
|
@@ -420,14 +420,13 @@ const ke = {
|
|
|
420
420
|
onChange: n,
|
|
421
421
|
className: i = "",
|
|
422
422
|
labelClass: r = "",
|
|
423
|
-
id: l
|
|
423
|
+
id: l,
|
|
424
|
+
defaultChecked: s
|
|
424
425
|
}) => {
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
s || p(d), n == null || n(d);
|
|
430
|
-
}, m = s ? o : c;
|
|
426
|
+
const c = o !== void 0, [p, g] = W(s || !1), m = (d) => {
|
|
427
|
+
const h = d.target.checked;
|
|
428
|
+
c || g(h), n == null || n(h);
|
|
429
|
+
}, u = c ? o : p;
|
|
431
430
|
return /* @__PURE__ */ C(
|
|
432
431
|
"label",
|
|
433
432
|
{
|
|
@@ -452,10 +451,8 @@ const ke = {
|
|
|
452
451
|
after:font-bold
|
|
453
452
|
${i}
|
|
454
453
|
`,
|
|
455
|
-
checked:
|
|
456
|
-
|
|
457
|
-
disabled: t,
|
|
458
|
-
onChange: g
|
|
454
|
+
checked: u,
|
|
455
|
+
onChange: m
|
|
459
456
|
}
|
|
460
457
|
),
|
|
461
458
|
e && /* @__PURE__ */ a("span", { className: `text-sm text-color-gray-700 ${r}`, children: e })
|
|
@@ -492,19 +489,19 @@ const ke = {
|
|
|
492
489
|
disabled: b = !1,
|
|
493
490
|
searchOn: y
|
|
494
491
|
}) => {
|
|
495
|
-
const [z, x] = W(!1), [$, w] = W(-1), [O, D] = W("bottom"), [q, ee] = W(""), K = fe(null),
|
|
492
|
+
const [z, x] = W(!1), [$, w] = W(-1), [O, D] = W("bottom"), [q, ee] = W(""), K = fe(null), B = fe(null), se = fe(null), Z = bn(q, 300), F = l !== void 0 ? l : z, I = (_) => {
|
|
496
493
|
l === void 0 && x(_), _ || ee(""), s == null || s(_);
|
|
497
494
|
}, J = d ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [], Q = Z ? o.filter((_) => {
|
|
498
|
-
const N = typeof _.label == "string" ? _.label : String(_.label), V = _.value ? String(_.value) : "",
|
|
495
|
+
const N = typeof _.label == "string" ? _.label : String(_.label), V = _.value ? String(_.value) : "", H = Z.toLowerCase(), ie = y || "label";
|
|
499
496
|
if (ie === "label")
|
|
500
|
-
return N.toLowerCase().includes(
|
|
497
|
+
return N.toLowerCase().includes(H);
|
|
501
498
|
if (ie === "value")
|
|
502
|
-
return V.toLowerCase().includes(
|
|
499
|
+
return V.toLowerCase().includes(H);
|
|
503
500
|
if (ie === "both")
|
|
504
|
-
return N.toLowerCase().includes(
|
|
501
|
+
return N.toLowerCase().includes(H) || V.toLowerCase().includes(H);
|
|
505
502
|
{
|
|
506
503
|
const P = _[ie];
|
|
507
|
-
return typeof P == "string" ? P.toLowerCase().includes(
|
|
504
|
+
return typeof P == "string" ? P.toLowerCase().includes(H) : !1;
|
|
508
505
|
}
|
|
509
506
|
}) : o, pe = Q.filter(
|
|
510
507
|
(_) => J.some(
|
|
@@ -516,18 +513,18 @@ const ke = {
|
|
|
516
513
|
)
|
|
517
514
|
), k = [...pe, ...R], S = pe.length > 0 && R.length > 0, A = (_) => {
|
|
518
515
|
if (d) {
|
|
519
|
-
const N = Array.isArray(e) ? e : [],
|
|
516
|
+
const N = Array.isArray(e) ? e : [], H = N.some(
|
|
520
517
|
(ie) => ie.label === _.label && ie.value === _.value
|
|
521
518
|
) ? N.filter(
|
|
522
519
|
(ie) => !(ie.label === _.label && ie.value === _.value)
|
|
523
520
|
) : [...N, _];
|
|
524
|
-
r == null || r(
|
|
521
|
+
r == null || r(H);
|
|
525
522
|
} else
|
|
526
523
|
r == null || r(_), i || (I(!1), ee(""));
|
|
527
524
|
}, L = (_, N) => {
|
|
528
525
|
if (N.stopPropagation(), d && Array.isArray(e)) {
|
|
529
526
|
const V = e.filter(
|
|
530
|
-
(
|
|
527
|
+
(H) => !(H.label === _.label && H.value === _.value)
|
|
531
528
|
);
|
|
532
529
|
r == null || r(V);
|
|
533
530
|
}
|
|
@@ -542,8 +539,8 @@ const ke = {
|
|
|
542
539
|
}, []), ce(() => {
|
|
543
540
|
if (F && K.current) {
|
|
544
541
|
if (p === "auto") {
|
|
545
|
-
const _ = K.current.getBoundingClientRect(), N = Math.min(o.length * 40, c), V = window.innerHeight - _.bottom,
|
|
546
|
-
D(V >= N || V >=
|
|
542
|
+
const _ = K.current.getBoundingClientRect(), N = Math.min(o.length * 40, c), V = window.innerHeight - _.bottom, H = _.top;
|
|
543
|
+
D(V >= N || V >= H ? "bottom" : "top");
|
|
547
544
|
} else
|
|
548
545
|
D(p);
|
|
549
546
|
g && se.current && se.current.focus();
|
|
@@ -563,7 +560,7 @@ const ke = {
|
|
|
563
560
|
"button",
|
|
564
561
|
{
|
|
565
562
|
type: "button",
|
|
566
|
-
onClick: (
|
|
563
|
+
onClick: (H) => L(N, H),
|
|
567
564
|
className: "ml-1 text-color-gray-500 hover:text-color-gray-700",
|
|
568
565
|
children: /* @__PURE__ */ a("svg", { className: "size-3", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M12 10.586l4.95-4.95 1.414 1.414-4.95 4.95 4.95 4.95-1.414 1.414-4.95-4.95-4.95 4.95-1.414-1.414 4.95-4.95-4.95-4.95L7.05 5.636l4.95 4.95z" }) })
|
|
569
566
|
}
|
|
@@ -633,7 +630,7 @@ const ke = {
|
|
|
633
630
|
/* @__PURE__ */ a(
|
|
634
631
|
"ul",
|
|
635
632
|
{
|
|
636
|
-
ref:
|
|
633
|
+
ref: B,
|
|
637
634
|
className: "overflow-y-auto",
|
|
638
635
|
style: { maxHeight: `${c}px` },
|
|
639
636
|
children: k.length > 0 ? /* @__PURE__ */ C(Ce, { children: [
|
|
@@ -806,7 +803,7 @@ function kn() {
|
|
|
806
803
|
}
|
|
807
804
|
}
|
|
808
805
|
}
|
|
809
|
-
var w = c, O = p, D = s, q = l, ee = o, K = g,
|
|
806
|
+
var w = c, O = p, D = s, q = l, ee = o, K = g, B = n, se = h, Z = d, F = t, I = r, J = i, Q = m, pe = !1;
|
|
810
807
|
function R(P) {
|
|
811
808
|
return pe || (pe = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), k(P) || $(P) === c;
|
|
812
809
|
}
|
|
@@ -840,13 +837,13 @@ function kn() {
|
|
|
840
837
|
function V(P) {
|
|
841
838
|
return $(P) === r;
|
|
842
839
|
}
|
|
843
|
-
function
|
|
840
|
+
function H(P) {
|
|
844
841
|
return $(P) === i;
|
|
845
842
|
}
|
|
846
843
|
function ie(P) {
|
|
847
844
|
return $(P) === m;
|
|
848
845
|
}
|
|
849
|
-
ue.AsyncMode = w, ue.ConcurrentMode = O, ue.ContextConsumer = D, ue.ContextProvider = q, ue.Element = ee, ue.ForwardRef = K, ue.Fragment =
|
|
846
|
+
ue.AsyncMode = w, ue.ConcurrentMode = O, ue.ContextConsumer = D, ue.ContextProvider = q, ue.Element = ee, ue.ForwardRef = K, ue.Fragment = B, ue.Lazy = se, ue.Memo = Z, ue.Portal = F, ue.Profiler = I, ue.StrictMode = J, ue.Suspense = Q, ue.isAsyncMode = R, ue.isConcurrentMode = k, ue.isContextConsumer = S, ue.isContextProvider = A, ue.isElement = L, ue.isForwardRef = j, ue.isFragment = G, ue.isLazy = M, ue.isMemo = _, ue.isPortal = N, ue.isProfiler = V, ue.isStrictMode = H, ue.isSuspense = ie, ue.isValidElementType = x, ue.typeOf = $;
|
|
850
847
|
}()), ue;
|
|
851
848
|
}
|
|
852
849
|
var ro;
|
|
@@ -1019,8 +1016,8 @@ function _n() {
|
|
|
1019
1016
|
function b(k) {
|
|
1020
1017
|
if (process.env.NODE_ENV !== "production")
|
|
1021
1018
|
var S = {}, A = 0;
|
|
1022
|
-
function L(G, M, _, N, V,
|
|
1023
|
-
if (N = N || u,
|
|
1019
|
+
function L(G, M, _, N, V, H, ie) {
|
|
1020
|
+
if (N = N || u, H = H || _, ie !== t) {
|
|
1024
1021
|
if (c) {
|
|
1025
1022
|
var P = new Error(
|
|
1026
1023
|
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"
|
|
@@ -1030,11 +1027,11 @@ function _n() {
|
|
|
1030
1027
|
var E = N + ":" + _;
|
|
1031
1028
|
!S[E] && // Avoid spamming the console because they are often not actionable except for lib authors
|
|
1032
1029
|
A < 3 && (r(
|
|
1033
|
-
"You are manually calling a React.PropTypes validation function for the `" +
|
|
1030
|
+
"You are manually calling a React.PropTypes validation function for the `" + H + "` prop on `" + N + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."
|
|
1034
1031
|
), S[E] = !0, A++);
|
|
1035
1032
|
}
|
|
1036
1033
|
}
|
|
1037
|
-
return M[_] == null ? G ? M[_] === null ? new f("The " + V + " `" +
|
|
1034
|
+
return M[_] == null ? G ? M[_] === null ? new f("The " + V + " `" + H + "` is marked as required " + ("in `" + N + "`, but its value is `null`.")) : new f("The " + V + " `" + H + "` is marked as required in " + ("`" + N + "`, but its value is `undefined`.")) : null : k(M, _, N, V, H);
|
|
1038
1035
|
}
|
|
1039
1036
|
var j = L.bind(null, !1);
|
|
1040
1037
|
return j.isRequired = L.bind(null, !0), j;
|
|
@@ -1043,9 +1040,9 @@ function _n() {
|
|
|
1043
1040
|
function S(A, L, j, G, M, _) {
|
|
1044
1041
|
var N = A[L], V = J(N);
|
|
1045
1042
|
if (V !== k) {
|
|
1046
|
-
var
|
|
1043
|
+
var H = Q(N);
|
|
1047
1044
|
return new f(
|
|
1048
|
-
"Invalid " + G + " `" + M + "` of type " + ("`" +
|
|
1045
|
+
"Invalid " + G + " `" + M + "` of type " + ("`" + H + "` supplied to `" + j + "`, expected ") + ("`" + k + "`."),
|
|
1049
1046
|
{ expectedType: k }
|
|
1050
1047
|
);
|
|
1051
1048
|
}
|
|
@@ -1066,9 +1063,9 @@ function _n() {
|
|
|
1066
1063
|
return new f("Invalid " + G + " `" + M + "` of type " + ("`" + N + "` supplied to `" + j + "`, expected an array."));
|
|
1067
1064
|
}
|
|
1068
1065
|
for (var V = 0; V < _.length; V++) {
|
|
1069
|
-
var
|
|
1070
|
-
if (
|
|
1071
|
-
return
|
|
1066
|
+
var H = k(_, V, j, G, M + "[" + V + "]", t);
|
|
1067
|
+
if (H instanceof Error)
|
|
1068
|
+
return H;
|
|
1072
1069
|
}
|
|
1073
1070
|
return null;
|
|
1074
1071
|
}
|
|
@@ -1132,9 +1129,9 @@ function _n() {
|
|
|
1132
1129
|
return new f("Invalid " + G + " `" + M + "` of type " + ("`" + N + "` supplied to `" + j + "`, expected an object."));
|
|
1133
1130
|
for (var V in _)
|
|
1134
1131
|
if (n(_, V)) {
|
|
1135
|
-
var
|
|
1136
|
-
if (
|
|
1137
|
-
return
|
|
1132
|
+
var H = k(_, V, j, G, M + "." + V, t);
|
|
1133
|
+
if (H instanceof Error)
|
|
1134
|
+
return H;
|
|
1138
1135
|
}
|
|
1139
1136
|
return null;
|
|
1140
1137
|
}
|
|
@@ -1151,8 +1148,8 @@ function _n() {
|
|
|
1151
1148
|
), l;
|
|
1152
1149
|
}
|
|
1153
1150
|
function L(j, G, M, _, N) {
|
|
1154
|
-
for (var V = [],
|
|
1155
|
-
var ie = k[
|
|
1151
|
+
for (var V = [], H = 0; H < k.length; H++) {
|
|
1152
|
+
var ie = k[H], P = ie(j, G, M, _, N, t);
|
|
1156
1153
|
if (P == null)
|
|
1157
1154
|
return null;
|
|
1158
1155
|
P.data && n(P.data, "expectedType") && V.push(P.data.expectedType);
|
|
@@ -1168,7 +1165,7 @@ function _n() {
|
|
|
1168
1165
|
}
|
|
1169
1166
|
return b(k);
|
|
1170
1167
|
}
|
|
1171
|
-
function
|
|
1168
|
+
function B(k, S, A, L, j) {
|
|
1172
1169
|
return new f(
|
|
1173
1170
|
(k || "React class") + ": " + S + " type `" + A + "." + L + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + j + "`."
|
|
1174
1171
|
);
|
|
@@ -1179,10 +1176,10 @@ function _n() {
|
|
|
1179
1176
|
if (N !== "object")
|
|
1180
1177
|
return new f("Invalid " + G + " `" + M + "` of type `" + N + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1181
1178
|
for (var V in k) {
|
|
1182
|
-
var
|
|
1183
|
-
if (typeof
|
|
1184
|
-
return
|
|
1185
|
-
var ie =
|
|
1179
|
+
var H = k[V];
|
|
1180
|
+
if (typeof H != "function")
|
|
1181
|
+
return B(j, G, M, V, Q(H));
|
|
1182
|
+
var ie = H(_, V, j, G, M + "." + V, t);
|
|
1186
1183
|
if (ie)
|
|
1187
1184
|
return ie;
|
|
1188
1185
|
}
|
|
@@ -1196,16 +1193,16 @@ function _n() {
|
|
|
1196
1193
|
if (N !== "object")
|
|
1197
1194
|
return new f("Invalid " + G + " `" + M + "` of type `" + N + "` " + ("supplied to `" + j + "`, expected `object`."));
|
|
1198
1195
|
var V = o({}, A[L], k);
|
|
1199
|
-
for (var
|
|
1200
|
-
var ie = k[
|
|
1201
|
-
if (n(k,
|
|
1202
|
-
return
|
|
1196
|
+
for (var H in V) {
|
|
1197
|
+
var ie = k[H];
|
|
1198
|
+
if (n(k, H) && typeof ie != "function")
|
|
1199
|
+
return B(j, G, M, H, Q(ie));
|
|
1203
1200
|
if (!ie)
|
|
1204
1201
|
return new f(
|
|
1205
|
-
"Invalid " + G + " `" + M + "` key `" +
|
|
1202
|
+
"Invalid " + G + " `" + M + "` key `" + H + "` supplied to `" + j + "`.\nBad object: " + JSON.stringify(A[L], null, " ") + `
|
|
1206
1203
|
Valid keys: ` + JSON.stringify(Object.keys(k), null, " ")
|
|
1207
1204
|
);
|
|
1208
|
-
var P = ie(_,
|
|
1205
|
+
var P = ie(_, H, j, G, M + "." + H, t);
|
|
1209
1206
|
if (P)
|
|
1210
1207
|
return P;
|
|
1211
1208
|
}
|
|
@@ -3246,7 +3243,7 @@ var Gt = {
|
|
|
3246
3243
|
function Jo() {
|
|
3247
3244
|
var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, o = xe(xe({}, Xo), e), t = o.accept, n = o.disabled, i = o.getFilesFromEvent, r = o.maxSize, l = o.minSize, s = o.multiple, c = o.maxFiles, p = o.onDragEnter, g = o.onDragLeave, m = o.onDragOver, u = o.onDrop, d = o.onDropAccepted, h = o.onDropRejected, f = o.onFileDialogCancel, b = o.onFileDialogOpen, y = o.useFsAccessApi, z = o.autoFocus, x = o.preventDropOnDocument, $ = o.noClick, w = o.noKeyboard, O = o.noDrag, D = o.noDragEventsBubbling, q = o.onError, ee = o.validator, K = Ze(function() {
|
|
3248
3245
|
return si(t);
|
|
3249
|
-
}, [t]),
|
|
3246
|
+
}, [t]), B = Ze(function() {
|
|
3250
3247
|
return li(t);
|
|
3251
3248
|
}, [t]), se = Ze(function() {
|
|
3252
3249
|
return typeof b == "function" ? b : _o;
|
|
@@ -3322,7 +3319,7 @@ function Jo() {
|
|
|
3322
3319
|
isDragAccept: !1,
|
|
3323
3320
|
isDragReject: !1
|
|
3324
3321
|
}), ut(T) && g && g(T));
|
|
3325
|
-
}, [F, g, D]),
|
|
3322
|
+
}, [F, g, D]), H = ge(function(T, X) {
|
|
3326
3323
|
var he = [], be = [];
|
|
3327
3324
|
T.forEach(function(_e) {
|
|
3328
3325
|
var Ve = Yo(_e, K), Ie = Nt(Ve, 2), Xe = Ie[0], He = Ie[1], Je = Zo(_e, l, r), Ye = Nt(Je, 2), Qe = Ye[0], et = Ye[1], tt = ee ? ee(_e) : null;
|
|
@@ -3350,25 +3347,25 @@ function Jo() {
|
|
|
3350
3347
|
}), u && u(he, be, X), be.length > 0 && h && h(be, X), he.length > 0 && d && d(he, X);
|
|
3351
3348
|
}, [R, s, K, l, r, c, u, d, h, ee]), ie = ge(function(T) {
|
|
3352
3349
|
T.preventDefault(), T.persist(), ye(T), j.current = [], ut(T) && Promise.resolve(i(T)).then(function(X) {
|
|
3353
|
-
xt(T) && !D ||
|
|
3350
|
+
xt(T) && !D || H(X, T);
|
|
3354
3351
|
}).catch(function(X) {
|
|
3355
3352
|
return M(X);
|
|
3356
3353
|
}), R({
|
|
3357
3354
|
type: "reset"
|
|
3358
3355
|
});
|
|
3359
|
-
}, [i,
|
|
3356
|
+
}, [i, H, M, D]), P = ge(function() {
|
|
3360
3357
|
if (A.current) {
|
|
3361
3358
|
R({
|
|
3362
3359
|
type: "openDialog"
|
|
3363
3360
|
}), se();
|
|
3364
3361
|
var T = {
|
|
3365
3362
|
multiple: s,
|
|
3366
|
-
types:
|
|
3363
|
+
types: B
|
|
3367
3364
|
};
|
|
3368
3365
|
window.showOpenFilePicker(T).then(function(X) {
|
|
3369
3366
|
return i(X);
|
|
3370
3367
|
}).then(function(X) {
|
|
3371
|
-
|
|
3368
|
+
H(X, null), R({
|
|
3372
3369
|
type: "closeDialog"
|
|
3373
3370
|
});
|
|
3374
3371
|
}).catch(function(X) {
|
|
@@ -3381,7 +3378,7 @@ function Jo() {
|
|
|
3381
3378
|
I.current && (R({
|
|
3382
3379
|
type: "openDialog"
|
|
3383
3380
|
}), se(), I.current.value = null, I.current.click());
|
|
3384
|
-
}, [R, se, Z, y,
|
|
3381
|
+
}, [R, se, Z, y, H, M, B, s]), E = ge(function(T) {
|
|
3385
3382
|
!F.current || !F.current.isEqualNode(T.target) || (T.key === " " || T.key === "Enter" || T.keyCode === 32 || T.keyCode === 13) && (T.preventDefault(), P());
|
|
3386
3383
|
}, [F, P]), ae = ge(function() {
|
|
3387
3384
|
R({
|
|
@@ -3557,7 +3554,7 @@ const Qr = ({
|
|
|
3557
3554
|
]
|
|
3558
3555
|
), q = (Z) => {
|
|
3559
3556
|
$((F) => F.filter((I, J) => J !== Z)), z(x);
|
|
3560
|
-
}, { getRootProps: ee, getInputProps: K, isDragActive:
|
|
3557
|
+
}, { getRootProps: ee, getInputProps: K, isDragActive: B, isDragReject: se } = Jo({
|
|
3561
3558
|
onDrop: D,
|
|
3562
3559
|
accept: t,
|
|
3563
3560
|
multiple: n,
|
|
@@ -3569,7 +3566,7 @@ const Qr = ({
|
|
|
3569
3566
|
{
|
|
3570
3567
|
className: `
|
|
3571
3568
|
border border-style-dashed rounded-lg p-0 overflow-hidden transition
|
|
3572
|
-
${
|
|
3569
|
+
${B ? "border-color-blue-500 bg-color-blue-50" : "border-color-gray-200 bg-color-gray-50"}
|
|
3573
3570
|
${se ? "border-color-red-500 bg-color-red-50" : ""}
|
|
3574
3571
|
${l ? "opacity-50 cursor-not-allowed" : ""}
|
|
3575
3572
|
${g}
|
|
@@ -4776,8 +4773,8 @@ const Ji = {
|
|
|
4776
4773
|
var $, w;
|
|
4777
4774
|
const O = o.options.columnResizeDirection === "rtl" ? -1 : 1, D = (z - (($ = x == null ? void 0 : x.startOffset) != null ? $ : 0)) * O, q = Math.max(D / ((w = x == null ? void 0 : x.startSize) != null ? w : 0), -0.999999);
|
|
4778
4775
|
return x.columnSizingStart.forEach((ee) => {
|
|
4779
|
-
let [K,
|
|
4780
|
-
p[K] = Math.round(Math.max(
|
|
4776
|
+
let [K, B] = ee;
|
|
4777
|
+
p[K] = Math.round(Math.max(B + B * q, 0) * 100) / 100;
|
|
4781
4778
|
}), {
|
|
4782
4779
|
...x,
|
|
4783
4780
|
deltaOffset: D,
|
|
@@ -6162,7 +6159,7 @@ const sa = xn(function({
|
|
|
6162
6159
|
const y = o !== void 0, [z, x] = W(() => t !== void 0 ? t : f ? [r, l] : r), $ = y ? o : z, w = Array.isArray($) ? $[0] : $, [O, D] = Array.isArray($) ? $ : [$, $], q = jt[c] || jt.blue, ee = No[p] ?? No.medium, K = ge(
|
|
6163
6160
|
(E) => (E - r) / (l - r) * 100,
|
|
6164
6161
|
[r, l]
|
|
6165
|
-
),
|
|
6162
|
+
), B = K(w), se = K(O), Z = K(D), F = ge((E) => Math.max(r, Math.min(l, E)), [r, l]), I = ge((E) => Math.round(E / s) * s, [s]), J = Pr(n), Q = ge(
|
|
6166
6163
|
(E, ae = !0) => {
|
|
6167
6164
|
y || x(E), ae ? J.schedule(E) : J.flush(E);
|
|
6168
6165
|
},
|
|
@@ -6217,7 +6214,7 @@ const sa = xn(function({
|
|
|
6217
6214
|
D,
|
|
6218
6215
|
Q
|
|
6219
6216
|
]
|
|
6220
|
-
),
|
|
6217
|
+
), H = ge(
|
|
6221
6218
|
(E) => {
|
|
6222
6219
|
if (g || _ == null || L == null) return;
|
|
6223
6220
|
const ae = S(E.clientX);
|
|
@@ -6303,7 +6300,7 @@ const sa = xn(function({
|
|
|
6303
6300
|
${g ? "opacity-60 cursor-not-allowed" : "cursor-pointer"}
|
|
6304
6301
|
`,
|
|
6305
6302
|
onPointerDown: (E) => V(E),
|
|
6306
|
-
onPointerMove:
|
|
6303
|
+
onPointerMove: H,
|
|
6307
6304
|
onPointerUp: ie,
|
|
6308
6305
|
onPointerCancel: ie,
|
|
6309
6306
|
children: [
|
|
@@ -6317,7 +6314,7 @@ const sa = xn(function({
|
|
|
6317
6314
|
"div",
|
|
6318
6315
|
{
|
|
6319
6316
|
className: `absolute top-0 left-0 ${ee.track} ${q.progress} rounded-full ${L ? "" : "transition-all duration-150"}`,
|
|
6320
|
-
style: { width: `${
|
|
6317
|
+
style: { width: `${B}%` }
|
|
6321
6318
|
}
|
|
6322
6319
|
),
|
|
6323
6320
|
d && h.map((E, ae) => {
|
|
@@ -6342,7 +6339,7 @@ const sa = xn(function({
|
|
|
6342
6339
|
${G === "single" ? "ring-2 ring-offset-1 ring-blue-300" : ""}
|
|
6343
6340
|
shadow-md hover:shadow-lg focus:outline-none dark:shadow-none
|
|
6344
6341
|
`,
|
|
6345
|
-
style: { left: `${
|
|
6342
|
+
style: { left: `${B}%` },
|
|
6346
6343
|
tabIndex: g ? -1 : 0,
|
|
6347
6344
|
role: "slider",
|
|
6348
6345
|
"aria-orientation": "horizontal",
|
|
@@ -6745,7 +6742,7 @@ const sa = xn(function({
|
|
|
6745
6742
|
w == null ? void 0 : w.showIndicators,
|
|
6746
6743
|
n,
|
|
6747
6744
|
O
|
|
6748
|
-
),
|
|
6745
|
+
), B = We(
|
|
6749
6746
|
x == null ? void 0 : x.showThumbs,
|
|
6750
6747
|
$ == null ? void 0 : $.showThumbs,
|
|
6751
6748
|
w == null ? void 0 : w.showThumbs,
|
|
@@ -6761,7 +6758,7 @@ const sa = xn(function({
|
|
|
6761
6758
|
s && M > 0 ? (U % (M + 1) + (M + 1)) % (M + 1) : _(U)
|
|
6762
6759
|
), V = () => {
|
|
6763
6760
|
s && M > 0 ? J(I === 0 ? M : I - 1) : N(I - 1);
|
|
6764
|
-
},
|
|
6761
|
+
}, H = () => {
|
|
6765
6762
|
s && M > 0 ? J(I >= M ? 0 : I + 1) : N(I + 1);
|
|
6766
6763
|
};
|
|
6767
6764
|
ce(() => {
|
|
@@ -6791,7 +6788,7 @@ const sa = xn(function({
|
|
|
6791
6788
|
R && (G.current = f === "horizontal" ? U : re, A(G.current - j.current));
|
|
6792
6789
|
}, E = () => {
|
|
6793
6790
|
if (!R) return;
|
|
6794
|
-
Math.abs(G.current - j.current) > 50 && (G.current < j.current ?
|
|
6791
|
+
Math.abs(G.current - j.current) > 50 && (G.current < j.current ? H() : V()), k(!1), A(0);
|
|
6795
6792
|
}, ae = () => {
|
|
6796
6793
|
const U = f === "horizontal" ? "X" : "Y";
|
|
6797
6794
|
let re = 0;
|
|
@@ -6816,7 +6813,7 @@ const sa = xn(function({
|
|
|
6816
6813
|
ref: L,
|
|
6817
6814
|
className: `w-full overflow-hidden relative ${se && M > 0 ? R ? "cursor-grabbing" : "cursor-grab" : "cursor-default"}`,
|
|
6818
6815
|
style: {
|
|
6819
|
-
height:
|
|
6816
|
+
height: B ? `calc(${t} - ${h + 20}px)` : t
|
|
6820
6817
|
},
|
|
6821
6818
|
onMouseDown: (U) => {
|
|
6822
6819
|
U.preventDefault(), ie(U.clientX, U.clientY);
|
|
@@ -6869,7 +6866,7 @@ const sa = xn(function({
|
|
|
6869
6866
|
"button",
|
|
6870
6867
|
{
|
|
6871
6868
|
"aria-label": "next",
|
|
6872
|
-
onClick:
|
|
6869
|
+
onClick: H,
|
|
6873
6870
|
className: `absolute z-20 bg-color-white/80 border border-color-gray-300 rounded-full w-8 h-8 md:w-10 md:h-10 flex items-center justify-center text-sm md:text-lg font-bold text-color-gray-800 hover:bg-color-white transition-color cursor-pointer
|
|
6874
6871
|
${f === "horizontal" ? "right-1 md:right-2 top-1/2 -translate-y-1/2" : "left-1/2 bottom-1 md:bottom-2 -translate-x-1/2"}`,
|
|
6875
6872
|
children: b || (f === "horizontal" ? "›" : "↓")
|
|
@@ -6899,7 +6896,7 @@ const sa = xn(function({
|
|
|
6899
6896
|
]
|
|
6900
6897
|
}
|
|
6901
6898
|
),
|
|
6902
|
-
|
|
6899
|
+
B && /* @__PURE__ */ a("div", { className: "uniui-thumb flex gap-1 md:gap-2 mt-2 md:mt-3 justify-center flex-wrap", children: e.map((U, re) => {
|
|
6903
6900
|
const ze = re === Math.round(I), ye = O === "mobile" ? h * 0.8 : h;
|
|
6904
6901
|
return /* @__PURE__ */ a(
|
|
6905
6902
|
"div",
|
|
@@ -7197,13 +7194,13 @@ const sa = xn(function({
|
|
|
7197
7194
|
"aria-labelledby": z,
|
|
7198
7195
|
variant: x = "radio",
|
|
7199
7196
|
cardClassName: $ = "",
|
|
7200
|
-
|
|
7197
|
+
selectedBodyClassName: w = "border-color-green-500 bg-color-green-50",
|
|
7201
7198
|
showTick: O = !0,
|
|
7202
7199
|
tickIcon: D,
|
|
7203
7200
|
tickClassName: q = "",
|
|
7204
|
-
|
|
7201
|
+
tickIconClassName: ee = "w-4 h-4",
|
|
7205
7202
|
showToggleButton: K = !1,
|
|
7206
|
-
toggleButtonIcon:
|
|
7203
|
+
toggleButtonIcon: B
|
|
7207
7204
|
}) => {
|
|
7208
7205
|
const [se, Z] = W(-1), F = t ?? n, I = (A) => {
|
|
7209
7206
|
switch (A) {
|
|
@@ -7263,7 +7260,9 @@ const sa = xn(function({
|
|
|
7263
7260
|
${_ ? "" : "hover:shadow-md"}
|
|
7264
7261
|
${$}
|
|
7265
7262
|
`,
|
|
7266
|
-
onClick: () =>
|
|
7263
|
+
onClick: (H) => {
|
|
7264
|
+
H.stopPropagation(), !_ && Q(L, M);
|
|
7265
|
+
},
|
|
7267
7266
|
children: [
|
|
7268
7267
|
N && V && /* @__PURE__ */ a("div", { className: "absolute top-2 right-2 w-6 h-6 bg-color-red-500 rounded-full flex items-center justify-center", children: /* @__PURE__ */ a(
|
|
7269
7268
|
"svg",
|
|
@@ -7308,13 +7307,13 @@ const sa = xn(function({
|
|
|
7308
7307
|
"button",
|
|
7309
7308
|
{
|
|
7310
7309
|
type: "button",
|
|
7311
|
-
onClick: (
|
|
7312
|
-
|
|
7310
|
+
onClick: (H) => {
|
|
7311
|
+
H.stopPropagation(), _ || Q(L, M);
|
|
7313
7312
|
},
|
|
7314
7313
|
disabled: _,
|
|
7315
7314
|
className: `mt-1 flex-shrink-0 rounded-full bg-color-gray-300 transition-all duration-150 ${I(u)} ${_ ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}`,
|
|
7316
7315
|
"aria-checked": N,
|
|
7317
|
-
children: N && !V && /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center", children:
|
|
7316
|
+
children: N && !V && /* @__PURE__ */ a("div", { className: "w-full h-full flex items-center justify-center", children: B || D || /* @__PURE__ */ C(
|
|
7318
7317
|
"svg",
|
|
7319
7318
|
{
|
|
7320
7319
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -7392,7 +7391,7 @@ const sa = xn(function({
|
|
|
7392
7391
|
checked: N,
|
|
7393
7392
|
onChange: () => !_ && Q(L, M),
|
|
7394
7393
|
onBlur: pe,
|
|
7395
|
-
onFocus: (
|
|
7394
|
+
onFocus: (H) => R(H, M),
|
|
7396
7395
|
className: "sr-only peer",
|
|
7397
7396
|
"aria-invalid": h,
|
|
7398
7397
|
...G && { id: G }
|
|
@@ -7982,13 +7981,13 @@ const jr = ({
|
|
|
7982
7981
|
fromTime: w,
|
|
7983
7982
|
toTime: O
|
|
7984
7983
|
}) => {
|
|
7985
|
-
const [D, q] = W(!1), [ee, K] = W(null), [
|
|
7984
|
+
const [D, q] = W(!1), [ee, K] = W(null), [B, se] = W(
|
|
7986
7985
|
b || y ? /* @__PURE__ */ new Date() : f ? new Date(typeof f == "string" ? parseInt(f) : f) : /* @__PURE__ */ new Date()
|
|
7987
7986
|
), [Z, F] = W(
|
|
7988
7987
|
d ? new Date(d) : f && !d ? new Date(typeof f == "string" ? parseInt(f) : f) : null
|
|
7989
7988
|
), [I, J] = W(b ? new Date(b) : null), [Q, pe] = W(y ? new Date(y) : null), [R, k] = W(null), [S, A] = W({ hour: 12, minute: 0, ampm: "AM" }), L = fe(null), [j, G] = W(
|
|
7990
7989
|
d ? new Date(d) : f && !d ? new Date(typeof f == "string" ? parseInt(f) : f) : null
|
|
7991
|
-
), [M, _] = W(b ? new Date(b) : null), [N, V] = W(y ? new Date(y) : null), [
|
|
7990
|
+
), [M, _] = W(b ? new Date(b) : null), [N, V] = W(y ? new Date(y) : null), [H, ie] = W(!1), [P, E] = W(!1), [ae, le] = W(!1), [ve, U] = W({ hour: 12, minute: 0, ampm: "AM" }), [re, ze] = W({ hour: 12, minute: 0, ampm: "AM" }), [ye, Te] = W(
|
|
7992
7991
|
w ? new Date(w) : null
|
|
7993
7992
|
), [Ae, qe] = W(
|
|
7994
7993
|
O ? new Date(O) : null
|
|
@@ -8130,36 +8129,36 @@ const jr = ({
|
|
|
8130
8129
|
const De = v.getMinutes();
|
|
8131
8130
|
return `${String(ne).padStart(2, "0")}:${String(De).padStart(2, "0")} ${$e}`;
|
|
8132
8131
|
}, un = () => {
|
|
8133
|
-
const v = new Date(
|
|
8132
|
+
const v = new Date(B.getFullYear(), B.getMonth(), 1), Y = new Date(B.getFullYear(), B.getMonth() + 1, 0), ne = (/* @__PURE__ */ new Date()).setHours(23, 59, 59, 999), $e = [], De = v.getDay();
|
|
8134
8133
|
for (let we = 0; we < De; we++)
|
|
8135
8134
|
$e.push(null);
|
|
8136
8135
|
for (let we = 1; we <= Y.getDate(); we++) {
|
|
8137
|
-
const kt = new Date(
|
|
8136
|
+
const kt = new Date(B.getFullYear(), B.getMonth(), we);
|
|
8138
8137
|
h && kt.getTime() > ne || $e.push(kt);
|
|
8139
8138
|
}
|
|
8140
8139
|
return $e;
|
|
8141
8140
|
}, pn = () => {
|
|
8142
8141
|
if (z) {
|
|
8143
8142
|
const v = typeof z == "string" ? new Date(z) : typeof z == "number" ? new Date(z) : z;
|
|
8144
|
-
if (
|
|
8143
|
+
if (B.getFullYear() < v.getFullYear() || B.getFullYear() === v.getFullYear() && B.getMonth() <= v.getMonth()) return !1;
|
|
8145
8144
|
}
|
|
8146
8145
|
if (m) {
|
|
8147
8146
|
const v = new Date(m);
|
|
8148
|
-
if (
|
|
8147
|
+
if (B.getFullYear() < v.getFullYear() || B.getFullYear() === v.getFullYear() && B.getMonth() <= v.getMonth()) return !1;
|
|
8149
8148
|
}
|
|
8150
8149
|
return !0;
|
|
8151
8150
|
}, gn = () => {
|
|
8152
8151
|
if (x) {
|
|
8153
8152
|
const v = typeof x == "string" ? new Date(x) : typeof x == "number" ? new Date(x) : x;
|
|
8154
|
-
if (
|
|
8153
|
+
if (B.getFullYear() > v.getFullYear() || B.getFullYear() === v.getFullYear() && B.getMonth() >= v.getMonth()) return !1;
|
|
8155
8154
|
}
|
|
8156
8155
|
if (u) {
|
|
8157
8156
|
const v = new Date(u);
|
|
8158
|
-
if (
|
|
8157
|
+
if (B.getFullYear() > v.getFullYear() || B.getFullYear() === v.getFullYear() && B.getMonth() >= v.getMonth()) return !1;
|
|
8159
8158
|
}
|
|
8160
8159
|
if (h) {
|
|
8161
8160
|
const v = /* @__PURE__ */ new Date();
|
|
8162
|
-
if (
|
|
8161
|
+
if (B.getFullYear() > v.getFullYear() || B.getFullYear() === v.getFullYear() && B.getMonth() >= v.getMonth()) return !1;
|
|
8163
8162
|
}
|
|
8164
8163
|
return !0;
|
|
8165
8164
|
}, fn = (v) => {
|
|
@@ -8264,7 +8263,7 @@ const jr = ({
|
|
|
8264
8263
|
color: "gray",
|
|
8265
8264
|
roundedFull: !0,
|
|
8266
8265
|
disabled: !pn(),
|
|
8267
|
-
onClick: () => se(new Date(
|
|
8266
|
+
onClick: () => se(new Date(B.getFullYear(), B.getMonth() - 1, 1)),
|
|
8268
8267
|
icon: /* @__PURE__ */ a("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M10.8284 12.0007L15.7782 16.9504L14.364 18.3646L8 12.0007L14.364 5.63672L15.7782 7.05093L10.8284 12.0007Z" }) })
|
|
8269
8268
|
}
|
|
8270
8269
|
),
|
|
@@ -8272,11 +8271,11 @@ const jr = ({
|
|
|
8272
8271
|
"select",
|
|
8273
8272
|
{
|
|
8274
8273
|
className: "text-sm outline-none",
|
|
8275
|
-
value:
|
|
8276
|
-
onChange: (v) => se(new Date(
|
|
8274
|
+
value: B.getMonth(),
|
|
8275
|
+
onChange: (v) => se(new Date(B.getFullYear(), parseInt(v.target.value), 1)),
|
|
8277
8276
|
children: [
|
|
8278
8277
|
To.map((v, Y) => {
|
|
8279
|
-
const ne =
|
|
8278
|
+
const ne = B.getFullYear(), $e = Y, De = /* @__PURE__ */ new Date();
|
|
8280
8279
|
if (h && ne === De.getFullYear() && $e > De.getMonth())
|
|
8281
8280
|
return null;
|
|
8282
8281
|
if (z) {
|
|
@@ -8326,7 +8325,7 @@ const jr = ({
|
|
|
8326
8325
|
color: "gray",
|
|
8327
8326
|
roundedFull: !0,
|
|
8328
8327
|
disabled: !gn(),
|
|
8329
|
-
onClick: () => se(new Date(
|
|
8328
|
+
onClick: () => se(new Date(B.getFullYear(), B.getMonth() + 1, 1)),
|
|
8330
8329
|
icon: /* @__PURE__ */ a("svg", { className: "size-5", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ a("path", { d: "M13.1717 12.0007L8.22192 7.05093L9.63614 5.63672L16.0001 12.0007L9.63614 18.3646L8.22192 16.9504L13.1717 12.0007Z" }) })
|
|
8331
8330
|
}
|
|
8332
8331
|
)
|
|
@@ -8423,7 +8422,7 @@ const jr = ({
|
|
|
8423
8422
|
}
|
|
8424
8423
|
),
|
|
8425
8424
|
o === "inline" ? /* @__PURE__ */ a(Ce, { children: D && at(oo, document.body) }) : /* @__PURE__ */ a(vt, { open: D, title: n ? "Select Time" : p, onClose: Xe, children: /* @__PURE__ */ a("div", { className: "w-72", children: oo }) }),
|
|
8426
|
-
|
|
8425
|
+
H && /* @__PURE__ */ a(vt, { open: H, onClose: () => ie(!1), title: "Select Time", children: /* @__PURE__ */ C("div", { className: "p-4", children: [
|
|
8427
8426
|
/* @__PURE__ */ C("div", { className: "flex gap-2 mb-4", children: [
|
|
8428
8427
|
/* @__PURE__ */ C("div", { className: "flex-1", children: [
|
|
8429
8428
|
/* @__PURE__ */ a("label", { className: "block text-sm font-medium text-color-gray-700 mb-1", children: "Hour" }),
|
|
@@ -8886,11 +8885,11 @@ const Io = [
|
|
|
8886
8885
|
searchClassName: d = "",
|
|
8887
8886
|
showClearAll: h = !1
|
|
8888
8887
|
}) => {
|
|
8889
|
-
const [f, b] = W(!1), [y, z] = W(""), [x, $] = W(-1), [w, O] = W("bottom"), D = fe(null), q = fe(null), ee = fe(null), K = t ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [],
|
|
8888
|
+
const [f, b] = W(!1), [y, z] = W(""), [x, $] = W(-1), [w, O] = W("bottom"), D = fe(null), q = fe(null), ee = fe(null), K = t ? Array.isArray(e) ? e : [] : e && !Array.isArray(e) ? [e] : [], B = y ? Io.filter(
|
|
8890
8889
|
(R) => R.name.toLowerCase().includes(y.toLowerCase()) || R.code.toLowerCase().includes(y.toLowerCase()) || R.dialCode.includes(y)
|
|
8891
|
-
) : Io, se =
|
|
8890
|
+
) : Io, se = B.filter(
|
|
8892
8891
|
(R) => K.some((k) => k.code === R.code)
|
|
8893
|
-
), Z =
|
|
8892
|
+
), Z = B.filter(
|
|
8894
8893
|
(R) => !K.some((k) => k.code === R.code)
|
|
8895
8894
|
), F = (R) => {
|
|
8896
8895
|
if (t) {
|
|
@@ -8911,15 +8910,15 @@ const Io = [
|
|
|
8911
8910
|
}, []), ce(() => {
|
|
8912
8911
|
if (f && D.current) {
|
|
8913
8912
|
if (p === "auto") {
|
|
8914
|
-
const R = D.current.getBoundingClientRect(), k = Math.min(
|
|
8913
|
+
const R = D.current.getBoundingClientRect(), k = Math.min(B.length * 44, c), S = window.innerHeight - R.bottom, A = R.top;
|
|
8915
8914
|
O(S >= k || S >= A ? "bottom" : "top");
|
|
8916
8915
|
} else
|
|
8917
8916
|
O(p);
|
|
8918
8917
|
n && q.current && q.current.focus();
|
|
8919
8918
|
}
|
|
8920
|
-
}, [f,
|
|
8919
|
+
}, [f, B.length, c, p, n]);
|
|
8921
8920
|
const Q = (R) => {
|
|
8922
|
-
R.key === "ArrowDown" ? (R.preventDefault(), f ? $((k) => Math.min(k + 1,
|
|
8921
|
+
R.key === "ArrowDown" ? (R.preventDefault(), f ? $((k) => Math.min(k + 1, B.length - 1)) : (b(!0), $(0))) : R.key === "ArrowUp" ? (R.preventDefault(), $((k) => Math.max(k - 1, 0))) : R.key === "Enter" ? (R.preventDefault(), x >= 0 && B[x] && F(B[x])) : R.key === "Escape" && (R.preventDefault(), b(!1), z(""), $(-1));
|
|
8923
8922
|
}, pe = () => {
|
|
8924
8923
|
if (t) {
|
|
8925
8924
|
if (K.length === 0)
|
|
@@ -9014,7 +9013,7 @@ const Io = [
|
|
|
9014
9013
|
ref: ee,
|
|
9015
9014
|
className: "overflow-y-auto",
|
|
9016
9015
|
style: { maxHeight: `${c}px` },
|
|
9017
|
-
children:
|
|
9016
|
+
children: B.length > 0 ? /* @__PURE__ */ C(Ce, { children: [
|
|
9018
9017
|
se.map((R, k) => /* @__PURE__ */ C(
|
|
9019
9018
|
"li",
|
|
9020
9019
|
{
|