general-basic-form 2.1.3 → 2.1.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/dist/index.js +113 -118
- package/dist/index.umd.cjs +5 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function Rs() {
|
|
|
51
51
|
function e(E) {
|
|
52
52
|
if (E == null) return null;
|
|
53
53
|
if (typeof E == "function")
|
|
54
|
-
return E.$$typeof ===
|
|
54
|
+
return E.$$typeof === B ? null : E.displayName || E.name || null;
|
|
55
55
|
if (typeof E == "string") return E;
|
|
56
56
|
switch (E) {
|
|
57
57
|
case h:
|
|
@@ -103,11 +103,11 @@ function Rs() {
|
|
|
103
103
|
}
|
|
104
104
|
if (M) {
|
|
105
105
|
M = console;
|
|
106
|
-
var j = M.error,
|
|
106
|
+
var j = M.error, z = typeof Symbol == "function" && Symbol.toStringTag && E[Symbol.toStringTag] || E.constructor.name || "Object";
|
|
107
107
|
return j.call(
|
|
108
108
|
M,
|
|
109
109
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
110
|
+
z
|
|
111
111
|
), t(E);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
@@ -150,18 +150,18 @@ function Rs() {
|
|
|
150
150
|
}
|
|
151
151
|
function c() {
|
|
152
152
|
var E = e(this.type);
|
|
153
|
-
return
|
|
153
|
+
return F[E] || (F[E] = !0, console.error(
|
|
154
154
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
155
155
|
)), E = this.props.ref, E !== void 0 ? E : null;
|
|
156
156
|
}
|
|
157
|
-
function l(E, M, j,
|
|
157
|
+
function l(E, M, j, z, ne, ae) {
|
|
158
158
|
var T = j.ref;
|
|
159
159
|
return E = {
|
|
160
160
|
$$typeof: v,
|
|
161
161
|
type: E,
|
|
162
162
|
key: M,
|
|
163
163
|
props: j,
|
|
164
|
-
_owner:
|
|
164
|
+
_owner: z
|
|
165
165
|
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(E, "ref", {
|
|
166
166
|
enumerable: !1,
|
|
167
167
|
get: c
|
|
@@ -187,13 +187,13 @@ function Rs() {
|
|
|
187
187
|
value: ae
|
|
188
188
|
}), Object.freeze && (Object.freeze(E.props), Object.freeze(E)), E;
|
|
189
189
|
}
|
|
190
|
-
function f(E, M, j,
|
|
190
|
+
function f(E, M, j, z, ne, ae) {
|
|
191
191
|
var T = M.children;
|
|
192
192
|
if (T !== void 0)
|
|
193
|
-
if (
|
|
193
|
+
if (z)
|
|
194
194
|
if (L(T)) {
|
|
195
|
-
for (
|
|
196
|
-
d(T[
|
|
195
|
+
for (z = 0; z < T.length; z++)
|
|
196
|
+
d(T[z]);
|
|
197
197
|
Object.freeze && Object.freeze(T);
|
|
198
198
|
} else
|
|
199
199
|
console.error(
|
|
@@ -205,18 +205,18 @@ function Rs() {
|
|
|
205
205
|
var U = Object.keys(M).filter(function(K) {
|
|
206
206
|
return K !== "key";
|
|
207
207
|
});
|
|
208
|
-
|
|
208
|
+
z = 0 < U.length ? "{key: someKey, " + U.join(": ..., ") + ": ...}" : "{key: someKey}", Z[T + z] || (U = 0 < U.length ? "{" + U.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
209
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s {...props} />
|
|
212
212
|
React keys must be passed directly to JSX without using spread:
|
|
213
213
|
let props = %s;
|
|
214
214
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
|
|
215
|
+
z,
|
|
216
216
|
T,
|
|
217
217
|
U,
|
|
218
218
|
T
|
|
219
|
-
), Z[T +
|
|
219
|
+
), Z[T + z] = !0);
|
|
220
220
|
}
|
|
221
221
|
if (T = null, j !== void 0 && (r(j), T = "" + j), a(M) && (r(M.key), T = "" + M.key), "key" in M) {
|
|
222
222
|
j = {};
|
|
@@ -241,7 +241,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
241
241
|
function u(E) {
|
|
242
242
|
return typeof E == "object" && E !== null && E.$$typeof === v;
|
|
243
243
|
}
|
|
244
|
-
var m = pe, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), R = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), I = Symbol.for("react.activity"),
|
|
244
|
+
var m = pe, v = Symbol.for("react.transitional.element"), p = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), y = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), S = Symbol.for("react.consumer"), R = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), O = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), C = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), I = Symbol.for("react.activity"), B = Symbol.for("react.client.reference"), $ = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, L = Array.isArray, H = console.createTask ? console.createTask : function() {
|
|
245
245
|
return null;
|
|
246
246
|
};
|
|
247
247
|
m = {
|
|
@@ -249,29 +249,29 @@ React keys must be passed directly to JSX without using spread:
|
|
|
249
249
|
return E();
|
|
250
250
|
}
|
|
251
251
|
};
|
|
252
|
-
var D,
|
|
252
|
+
var D, F = {}, P = m.react_stack_bottom_frame.bind(
|
|
253
253
|
m,
|
|
254
254
|
s
|
|
255
255
|
)(), G = H(n(s)), Z = {};
|
|
256
256
|
tt.Fragment = h, tt.jsx = function(E, M, j) {
|
|
257
|
-
var
|
|
257
|
+
var z = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
258
258
|
return f(
|
|
259
259
|
E,
|
|
260
260
|
M,
|
|
261
261
|
j,
|
|
262
262
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
z ? Error("react-stack-top-frame") : P,
|
|
264
|
+
z ? H(n(E)) : G
|
|
265
265
|
);
|
|
266
266
|
}, tt.jsxs = function(E, M, j) {
|
|
267
|
-
var
|
|
267
|
+
var z = 1e4 > $.recentlyCreatedOwnerStacks++;
|
|
268
268
|
return f(
|
|
269
269
|
E,
|
|
270
270
|
M,
|
|
271
271
|
j,
|
|
272
272
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
273
|
+
z ? Error("react-stack-top-frame") : P,
|
|
274
|
+
z ? H(n(E)) : G
|
|
275
275
|
);
|
|
276
276
|
};
|
|
277
277
|
})()), tt;
|
|
@@ -565,38 +565,33 @@ const Ks = [
|
|
|
565
565
|
key: "",
|
|
566
566
|
value: ""
|
|
567
567
|
};
|
|
568
|
-
I.key = `${s}[${O}][${_}]`, I.value = typeof x == "object" ? x?.[i?.[_]?.prop] : x, C.push(I);
|
|
568
|
+
I.key = `${s}[${O}][${_}]`, I.value = (typeof x == "object" ? x?.[i?.[_]?.prop] : x) || "", C.push(I);
|
|
569
569
|
}
|
|
570
570
|
return C;
|
|
571
571
|
}, [p, h] = Ot([[...v(0)]]), y = () => {
|
|
572
572
|
h([...p, [...v(p.length)]]);
|
|
573
573
|
}, b = (O) => {
|
|
574
574
|
const x = [...p];
|
|
575
|
-
x.splice(O, 1), h(x),
|
|
576
|
-
data: {
|
|
577
|
-
...u,
|
|
578
|
-
[r.prop]: x
|
|
579
|
-
}
|
|
580
|
-
});
|
|
575
|
+
x.splice(O, 1), h(x), R(x);
|
|
581
576
|
}, S = (O, x) => {
|
|
582
577
|
let C;
|
|
583
578
|
typeof x?.target?.value == "string" ? C = x?.target?.value : C = x;
|
|
584
579
|
const {
|
|
585
580
|
rowIndex: _,
|
|
586
581
|
columnIndex: I
|
|
587
|
-
} = O,
|
|
588
|
-
|
|
589
|
-
}, R = () => {
|
|
590
|
-
let
|
|
591
|
-
a === 1 ?
|
|
592
|
-
const
|
|
593
|
-
return
|
|
594
|
-
|
|
595
|
-
}),
|
|
582
|
+
} = O, B = [...p];
|
|
583
|
+
B[_][I].value = C, h(B), R(B);
|
|
584
|
+
}, R = (O) => {
|
|
585
|
+
let x = [];
|
|
586
|
+
a === 1 ? x = O.flat().map((C) => C.value) : x = O.map((C) => {
|
|
587
|
+
const _ = {};
|
|
588
|
+
return C.forEach((I, B) => {
|
|
589
|
+
_[i[B]?.prop] = I.value;
|
|
590
|
+
}), _;
|
|
596
591
|
}), d({
|
|
597
592
|
data: {
|
|
598
593
|
...u,
|
|
599
|
-
[r.prop]:
|
|
594
|
+
[r.prop]: x
|
|
600
595
|
}
|
|
601
596
|
});
|
|
602
597
|
};
|
|
@@ -623,13 +618,13 @@ const Ks = [
|
|
|
623
618
|
let I = {
|
|
624
619
|
...r
|
|
625
620
|
};
|
|
626
|
-
const
|
|
627
|
-
return
|
|
628
|
-
...
|
|
621
|
+
const B = r?.setting?.columns?.[_];
|
|
622
|
+
return B && (I = {
|
|
623
|
+
...B
|
|
629
624
|
}), I.type === "form-list" && (I.type = "input"), I.setting = {
|
|
630
625
|
...I.setting,
|
|
631
626
|
name: C.key,
|
|
632
|
-
value:
|
|
627
|
+
value: C.value,
|
|
633
628
|
onChange: S.bind(void 0, {
|
|
634
629
|
rowIndex: x,
|
|
635
630
|
columnIndex: _
|
|
@@ -928,9 +923,9 @@ const ee = (e) => {
|
|
|
928
923
|
"bottom-left",
|
|
929
924
|
// Deprecated since Tailwind CSS v4.1.0, see https://github.com/tailwindlabs/tailwindcss/pull/17378
|
|
930
925
|
"left-bottom"
|
|
931
|
-
], k = () => [...R(), N, A], O = () => ["auto", "hidden", "clip", "visible", "scroll"], x = () => ["auto", "contain", "none"], C = () => [N, A, c], _ = () => [$e, "full", "auto", ...C()], I = () => [ke, "none", "subgrid", N, A],
|
|
926
|
+
], k = () => [...R(), N, A], O = () => ["auto", "hidden", "clip", "visible", "scroll"], x = () => ["auto", "contain", "none"], C = () => [N, A, c], _ = () => [$e, "full", "auto", ...C()], I = () => [ke, "none", "subgrid", N, A], B = () => ["auto", {
|
|
932
927
|
span: ["full", ke, N, A]
|
|
933
|
-
}, ke, N, A], $ = () => [ke, "auto", N, A], W = () => ["auto", "min", "max", "fr", N, A], L = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], H = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], D = () => ["auto", ...C()],
|
|
928
|
+
}, ke, N, A], $ = () => [ke, "auto", N, A], W = () => ["auto", "min", "max", "fr", N, A], L = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], H = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], D = () => ["auto", ...C()], F = () => [$e, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...C()], P = () => [e, N, A], G = () => [...R(), en, Jr, {
|
|
934
929
|
position: [N, A]
|
|
935
930
|
}], Z = () => ["no-repeat", {
|
|
936
931
|
repeat: ["", "x", "y", "space", "round"]
|
|
@@ -944,7 +939,7 @@ const ee = (e) => {
|
|
|
944
939
|
l,
|
|
945
940
|
N,
|
|
946
941
|
A
|
|
947
|
-
],
|
|
942
|
+
], z = () => ["", V, rt, Me], ne = () => ["solid", "dashed", "dotted", "double"], ae = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], T = () => [V, er, en, Jr], U = () => [
|
|
948
943
|
// Deprecated since Tailwind CSS v4.0.0
|
|
949
944
|
"",
|
|
950
945
|
"none",
|
|
@@ -1263,7 +1258,7 @@ const ee = (e) => {
|
|
|
1263
1258
|
* @see https://tailwindcss.com/docs/grid-column
|
|
1264
1259
|
*/
|
|
1265
1260
|
"col-start-end": [{
|
|
1266
|
-
col:
|
|
1261
|
+
col: B()
|
|
1267
1262
|
}],
|
|
1268
1263
|
/**
|
|
1269
1264
|
* Grid Column Start
|
|
@@ -1291,7 +1286,7 @@ const ee = (e) => {
|
|
|
1291
1286
|
* @see https://tailwindcss.com/docs/grid-row
|
|
1292
1287
|
*/
|
|
1293
1288
|
"row-start-end": [{
|
|
1294
|
-
row:
|
|
1289
|
+
row: B()
|
|
1295
1290
|
}],
|
|
1296
1291
|
/**
|
|
1297
1292
|
* Grid Row Start
|
|
@@ -1575,14 +1570,14 @@ const ee = (e) => {
|
|
|
1575
1570
|
* @see https://tailwindcss.com/docs/width#setting-both-width-and-height
|
|
1576
1571
|
*/
|
|
1577
1572
|
size: [{
|
|
1578
|
-
size:
|
|
1573
|
+
size: F()
|
|
1579
1574
|
}],
|
|
1580
1575
|
/**
|
|
1581
1576
|
* Width
|
|
1582
1577
|
* @see https://tailwindcss.com/docs/width
|
|
1583
1578
|
*/
|
|
1584
1579
|
w: [{
|
|
1585
|
-
w: [i, "screen", ...
|
|
1580
|
+
w: [i, "screen", ...F()]
|
|
1586
1581
|
}],
|
|
1587
1582
|
/**
|
|
1588
1583
|
* Min-Width
|
|
@@ -1594,7 +1589,7 @@ const ee = (e) => {
|
|
|
1594
1589
|
"screen",
|
|
1595
1590
|
/** Deprecated. @see https://github.com/tailwindlabs/tailwindcss.com/issues/2027#issuecomment-2620152757 */
|
|
1596
1591
|
"none",
|
|
1597
|
-
...
|
|
1592
|
+
...F()
|
|
1598
1593
|
]
|
|
1599
1594
|
}],
|
|
1600
1595
|
/**
|
|
@@ -1612,7 +1607,7 @@ const ee = (e) => {
|
|
|
1612
1607
|
{
|
|
1613
1608
|
screen: [a]
|
|
1614
1609
|
},
|
|
1615
|
-
...
|
|
1610
|
+
...F()
|
|
1616
1611
|
]
|
|
1617
1612
|
}],
|
|
1618
1613
|
/**
|
|
@@ -1620,21 +1615,21 @@ const ee = (e) => {
|
|
|
1620
1615
|
* @see https://tailwindcss.com/docs/height
|
|
1621
1616
|
*/
|
|
1622
1617
|
h: [{
|
|
1623
|
-
h: ["screen", "lh", ...
|
|
1618
|
+
h: ["screen", "lh", ...F()]
|
|
1624
1619
|
}],
|
|
1625
1620
|
/**
|
|
1626
1621
|
* Min-Height
|
|
1627
1622
|
* @see https://tailwindcss.com/docs/min-height
|
|
1628
1623
|
*/
|
|
1629
1624
|
"min-h": [{
|
|
1630
|
-
"min-h": ["screen", "lh", "none", ...
|
|
1625
|
+
"min-h": ["screen", "lh", "none", ...F()]
|
|
1631
1626
|
}],
|
|
1632
1627
|
/**
|
|
1633
1628
|
* Max-Height
|
|
1634
1629
|
* @see https://tailwindcss.com/docs/max-height
|
|
1635
1630
|
*/
|
|
1636
1631
|
"max-h": [{
|
|
1637
|
-
"max-h": ["screen", "lh", ...
|
|
1632
|
+
"max-h": ["screen", "lh", ...F()]
|
|
1638
1633
|
}],
|
|
1639
1634
|
// ------------------
|
|
1640
1635
|
// --- Typography ---
|
|
@@ -2094,70 +2089,70 @@ const ee = (e) => {
|
|
|
2094
2089
|
* @see https://tailwindcss.com/docs/border-width
|
|
2095
2090
|
*/
|
|
2096
2091
|
"border-w": [{
|
|
2097
|
-
border:
|
|
2092
|
+
border: z()
|
|
2098
2093
|
}],
|
|
2099
2094
|
/**
|
|
2100
2095
|
* Border Width X
|
|
2101
2096
|
* @see https://tailwindcss.com/docs/border-width
|
|
2102
2097
|
*/
|
|
2103
2098
|
"border-w-x": [{
|
|
2104
|
-
"border-x":
|
|
2099
|
+
"border-x": z()
|
|
2105
2100
|
}],
|
|
2106
2101
|
/**
|
|
2107
2102
|
* Border Width Y
|
|
2108
2103
|
* @see https://tailwindcss.com/docs/border-width
|
|
2109
2104
|
*/
|
|
2110
2105
|
"border-w-y": [{
|
|
2111
|
-
"border-y":
|
|
2106
|
+
"border-y": z()
|
|
2112
2107
|
}],
|
|
2113
2108
|
/**
|
|
2114
2109
|
* Border Width Start
|
|
2115
2110
|
* @see https://tailwindcss.com/docs/border-width
|
|
2116
2111
|
*/
|
|
2117
2112
|
"border-w-s": [{
|
|
2118
|
-
"border-s":
|
|
2113
|
+
"border-s": z()
|
|
2119
2114
|
}],
|
|
2120
2115
|
/**
|
|
2121
2116
|
* Border Width End
|
|
2122
2117
|
* @see https://tailwindcss.com/docs/border-width
|
|
2123
2118
|
*/
|
|
2124
2119
|
"border-w-e": [{
|
|
2125
|
-
"border-e":
|
|
2120
|
+
"border-e": z()
|
|
2126
2121
|
}],
|
|
2127
2122
|
/**
|
|
2128
2123
|
* Border Width Top
|
|
2129
2124
|
* @see https://tailwindcss.com/docs/border-width
|
|
2130
2125
|
*/
|
|
2131
2126
|
"border-w-t": [{
|
|
2132
|
-
"border-t":
|
|
2127
|
+
"border-t": z()
|
|
2133
2128
|
}],
|
|
2134
2129
|
/**
|
|
2135
2130
|
* Border Width Right
|
|
2136
2131
|
* @see https://tailwindcss.com/docs/border-width
|
|
2137
2132
|
*/
|
|
2138
2133
|
"border-w-r": [{
|
|
2139
|
-
"border-r":
|
|
2134
|
+
"border-r": z()
|
|
2140
2135
|
}],
|
|
2141
2136
|
/**
|
|
2142
2137
|
* Border Width Bottom
|
|
2143
2138
|
* @see https://tailwindcss.com/docs/border-width
|
|
2144
2139
|
*/
|
|
2145
2140
|
"border-w-b": [{
|
|
2146
|
-
"border-b":
|
|
2141
|
+
"border-b": z()
|
|
2147
2142
|
}],
|
|
2148
2143
|
/**
|
|
2149
2144
|
* Border Width Left
|
|
2150
2145
|
* @see https://tailwindcss.com/docs/border-width
|
|
2151
2146
|
*/
|
|
2152
2147
|
"border-w-l": [{
|
|
2153
|
-
"border-l":
|
|
2148
|
+
"border-l": z()
|
|
2154
2149
|
}],
|
|
2155
2150
|
/**
|
|
2156
2151
|
* Divide Width X
|
|
2157
2152
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
2158
2153
|
*/
|
|
2159
2154
|
"divide-x": [{
|
|
2160
|
-
"divide-x":
|
|
2155
|
+
"divide-x": z()
|
|
2161
2156
|
}],
|
|
2162
2157
|
/**
|
|
2163
2158
|
* Divide Width X Reverse
|
|
@@ -2169,7 +2164,7 @@ const ee = (e) => {
|
|
|
2169
2164
|
* @see https://tailwindcss.com/docs/border-width#between-children
|
|
2170
2165
|
*/
|
|
2171
2166
|
"divide-y": [{
|
|
2172
|
-
"divide-y":
|
|
2167
|
+
"divide-y": z()
|
|
2173
2168
|
}],
|
|
2174
2169
|
/**
|
|
2175
2170
|
* Divide Width Y Reverse
|
|
@@ -2331,7 +2326,7 @@ const ee = (e) => {
|
|
|
2331
2326
|
* @see https://tailwindcss.com/docs/box-shadow#adding-a-ring
|
|
2332
2327
|
*/
|
|
2333
2328
|
"ring-w": [{
|
|
2334
|
-
ring:
|
|
2329
|
+
ring: z()
|
|
2335
2330
|
}],
|
|
2336
2331
|
/**
|
|
2337
2332
|
* Ring Width Inset
|
|
@@ -2370,7 +2365,7 @@ const ee = (e) => {
|
|
|
2370
2365
|
* @see https://tailwindcss.com/docs/box-shadow#adding-an-inset-ring
|
|
2371
2366
|
*/
|
|
2372
2367
|
"inset-ring-w": [{
|
|
2373
|
-
"inset-ring":
|
|
2368
|
+
"inset-ring": z()
|
|
2374
2369
|
}],
|
|
2375
2370
|
/**
|
|
2376
2371
|
* Inset Ring Color
|
|
@@ -4549,7 +4544,7 @@ const fi = (e, t) => {
|
|
|
4549
4544
|
}, [m]);
|
|
4550
4545
|
const b = async (x, C) => {
|
|
4551
4546
|
let _ = {};
|
|
4552
|
-
for (const [I,
|
|
4547
|
+
for (const [I, B] of Object.entries(h)) {
|
|
4553
4548
|
const $ = n.find((W) => W.prop === I);
|
|
4554
4549
|
if ($ && $.rules) {
|
|
4555
4550
|
const W = nt.getItemRules({
|
|
@@ -4558,19 +4553,19 @@ const fi = (e, t) => {
|
|
|
4558
4553
|
});
|
|
4559
4554
|
for (const L of W)
|
|
4560
4555
|
try {
|
|
4561
|
-
if (L.required && !
|
|
4556
|
+
if (L.required && !B)
|
|
4562
4557
|
throw new Error(L.message || `${$.label}不能为空`);
|
|
4563
|
-
if (L.pattern && !L.pattern.test(
|
|
4558
|
+
if (L.pattern && !L.pattern.test(B))
|
|
4564
4559
|
throw new Error(L.message || `${$.label}格式不正确`);
|
|
4565
4560
|
L.validator && await new Promise((H, D) => {
|
|
4566
|
-
const
|
|
4561
|
+
const F = (P) => {
|
|
4567
4562
|
if (P) {
|
|
4568
4563
|
D(P);
|
|
4569
4564
|
return;
|
|
4570
4565
|
}
|
|
4571
4566
|
H();
|
|
4572
4567
|
};
|
|
4573
|
-
L.validator(L,
|
|
4568
|
+
L.validator(L, B, F);
|
|
4574
4569
|
});
|
|
4575
4570
|
} catch (H) {
|
|
4576
4571
|
_[I] || (_[I] = []), _[I].push({
|
|
@@ -5360,14 +5355,14 @@ const Xi = (e) => ({
|
|
|
5360
5355
|
}, m = jr(o), v = Lr(m), p = await a.getDimensions(l), h = m === "y", y = h ? "top" : "left", b = h ? "bottom" : "right", S = h ? "clientHeight" : "clientWidth", R = s.reference[v] + s.reference[m] - u[m] - s.floating[v], k = u[m] - s.reference[m], O = await (a.getOffsetParent == null ? void 0 : a.getOffsetParent(l));
|
|
5361
5356
|
let x = O ? O[S] : 0;
|
|
5362
5357
|
(!x || !await (a.isElement == null ? void 0 : a.isElement(O))) && (x = i.floating[S] || s.floating[v]);
|
|
5363
|
-
const C = R / 2 - k / 2, _ = x / 2 - p[v] / 2 - 1, I = _e(d[y], _),
|
|
5358
|
+
const C = R / 2 - k / 2, _ = x / 2 - p[v] / 2 - 1, I = _e(d[y], _), B = _e(d[b], _), $ = I, W = x - p[v] - B, L = x / 2 - p[v] / 2 + C, H = br($, L, W), D = !c.arrow && Qe(o) != null && L !== H && s.reference[v] / 2 - (L < $ ? I : B) - p[v] / 2 < 0, F = D ? L < $ ? L - $ : L - W : 0;
|
|
5364
5359
|
return {
|
|
5365
|
-
[m]: u[m] +
|
|
5360
|
+
[m]: u[m] + F,
|
|
5366
5361
|
data: {
|
|
5367
5362
|
[m]: H,
|
|
5368
|
-
centerOffset: L - H -
|
|
5363
|
+
centerOffset: L - H - F,
|
|
5369
5364
|
...D && {
|
|
5370
|
-
alignmentOffset:
|
|
5365
|
+
alignmentOffset: F
|
|
5371
5366
|
}
|
|
5372
5367
|
},
|
|
5373
5368
|
reset: D
|
|
@@ -5409,8 +5404,8 @@ const Xi = (e) => ({
|
|
|
5409
5404
|
placement: o,
|
|
5410
5405
|
overflows: _
|
|
5411
5406
|
}], !_.every((L) => L <= 0)) {
|
|
5412
|
-
var
|
|
5413
|
-
const L = (((
|
|
5407
|
+
var B, $;
|
|
5408
|
+
const L = (((B = s.flip) == null ? void 0 : B.index) || 0) + 1, H = x[L];
|
|
5414
5409
|
if (H && (!(d === "alignment" ? b !== be(H) : !1) || // We leave the current main axis only if every placement on that axis
|
|
5415
5410
|
// overflows the main axis.
|
|
5416
5411
|
I.every((P) => be(P.placement) === b ? P.overflows[0] > 0 : !0)))
|
|
@@ -5423,12 +5418,12 @@ const Xi = (e) => ({
|
|
|
5423
5418
|
placement: H
|
|
5424
5419
|
}
|
|
5425
5420
|
};
|
|
5426
|
-
let D = ($ = I.filter((
|
|
5421
|
+
let D = ($ = I.filter((F) => F.overflows[0] <= 0).sort((F, P) => F.overflows[1] - P.overflows[1])[0]) == null ? void 0 : $.placement;
|
|
5427
5422
|
if (!D)
|
|
5428
5423
|
switch (m) {
|
|
5429
5424
|
case "bestFit": {
|
|
5430
5425
|
var W;
|
|
5431
|
-
const
|
|
5426
|
+
const F = (W = I.filter((P) => {
|
|
5432
5427
|
if (O) {
|
|
5433
5428
|
const G = be(P.placement);
|
|
5434
5429
|
return G === b || // Create a bias to the `y` side axis due to horizontal
|
|
@@ -5437,7 +5432,7 @@ const Xi = (e) => ({
|
|
|
5437
5432
|
}
|
|
5438
5433
|
return !0;
|
|
5439
5434
|
}).map((P) => [P.placement, P.overflows.filter((G) => G > 0).reduce((G, Z) => G + Z, 0)]).sort((P, G) => P[1] - G[1])[0]) == null ? void 0 : W[0];
|
|
5440
|
-
|
|
5435
|
+
F && (D = F);
|
|
5441
5436
|
break;
|
|
5442
5437
|
}
|
|
5443
5438
|
case "initialPlacement":
|
|
@@ -5679,8 +5674,8 @@ const el = function(e) {
|
|
|
5679
5674
|
const b = p - f.top - f.bottom, S = v - f.left - f.right, R = _e(p - f[h], b), k = _e(v - f[y], S), O = !t.middlewareData.shift;
|
|
5680
5675
|
let x = R, C = k;
|
|
5681
5676
|
if ((r = t.middlewareData.shift) != null && r.enabled.x && (C = S), (n = t.middlewareData.shift) != null && n.enabled.y && (x = b), O && !u) {
|
|
5682
|
-
const I = ue(f.left, 0),
|
|
5683
|
-
m ? C = v - 2 * (I !== 0 ||
|
|
5677
|
+
const I = ue(f.left, 0), B = ue(f.right, 0), $ = ue(f.top, 0), W = ue(f.bottom, 0);
|
|
5678
|
+
m ? C = v - 2 * (I !== 0 || B !== 0 ? I + B : ue(f.left, f.right)) : x = p - 2 * ($ !== 0 || W !== 0 ? $ + W : ue(f.top, f.bottom));
|
|
5684
5679
|
}
|
|
5685
5680
|
await c({
|
|
5686
5681
|
...t,
|
|
@@ -6268,7 +6263,7 @@ function Fl(e) {
|
|
|
6268
6263
|
P !== O.current && (O.current = P, p(P));
|
|
6269
6264
|
}, []), S = g.useCallback((P) => {
|
|
6270
6265
|
P !== x.current && (x.current = P, y(P));
|
|
6271
|
-
}, []), R = s || v, k = a || h, O = g.useRef(null), x = g.useRef(null), C = g.useRef(f), _ = c != null, I = ir(c),
|
|
6266
|
+
}, []), R = s || v, k = a || h, O = g.useRef(null), x = g.useRef(null), C = g.useRef(f), _ = c != null, I = ir(c), B = ir(o), $ = ir(l), W = g.useCallback(() => {
|
|
6272
6267
|
if (!O.current || !x.current)
|
|
6273
6268
|
return;
|
|
6274
6269
|
const P = {
|
|
@@ -6276,7 +6271,7 @@ function Fl(e) {
|
|
|
6276
6271
|
strategy: r,
|
|
6277
6272
|
middleware: u
|
|
6278
6273
|
};
|
|
6279
|
-
|
|
6274
|
+
B.current && (P.platform = B.current), Ll(O.current, x.current, P).then((G) => {
|
|
6280
6275
|
const Z = {
|
|
6281
6276
|
...G,
|
|
6282
6277
|
// The floating element's position may be recomputed while it's closed
|
|
@@ -6289,7 +6284,7 @@ function Fl(e) {
|
|
|
6289
6284
|
d(Z);
|
|
6290
6285
|
}));
|
|
6291
6286
|
});
|
|
6292
|
-
}, [u, t, r,
|
|
6287
|
+
}, [u, t, r, B, $]);
|
|
6293
6288
|
Pt(() => {
|
|
6294
6289
|
l === !1 && C.current.isPositioned && (C.current.isPositioned = !1, d((P) => ({
|
|
6295
6290
|
...P,
|
|
@@ -6314,7 +6309,7 @@ function Fl(e) {
|
|
|
6314
6309
|
}), [b, S]), D = g.useMemo(() => ({
|
|
6315
6310
|
reference: R,
|
|
6316
6311
|
floating: k
|
|
6317
|
-
}), [R, k]),
|
|
6312
|
+
}), [R, k]), F = g.useMemo(() => {
|
|
6318
6313
|
const P = {
|
|
6319
6314
|
position: r,
|
|
6320
6315
|
left: 0,
|
|
@@ -6340,8 +6335,8 @@ function Fl(e) {
|
|
|
6340
6335
|
update: W,
|
|
6341
6336
|
refs: H,
|
|
6342
6337
|
elements: D,
|
|
6343
|
-
floatingStyles:
|
|
6344
|
-
}), [f, W, H, D,
|
|
6338
|
+
floatingStyles: F
|
|
6339
|
+
}), [f, W, H, D, F]);
|
|
6345
6340
|
}
|
|
6346
6341
|
const zl = (e) => {
|
|
6347
6342
|
function t(r) {
|
|
@@ -6457,12 +6452,12 @@ var Vr = "PopperContent", [Zl, Jl] = Ro(Vr), Ao = g.forwardRef(
|
|
|
6457
6452
|
updatePositionStrategy: m = "optimized",
|
|
6458
6453
|
onPlaced: v,
|
|
6459
6454
|
...p
|
|
6460
|
-
} = e, h = ko(Vr, r), [y, b] = g.useState(null), S = re(t, (T) => b(T)), [R, k] = g.useState(null), O = Xl(R), x = O?.width ?? 0, C = O?.height ?? 0, _ = n + (s !== "center" ? "-" + s : ""), I = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f },
|
|
6455
|
+
} = e, h = ko(Vr, r), [y, b] = g.useState(null), S = re(t, (T) => b(T)), [R, k] = g.useState(null), O = Xl(R), x = O?.width ?? 0, C = O?.height ?? 0, _ = n + (s !== "center" ? "-" + s : ""), I = typeof f == "number" ? f : { top: 0, right: 0, bottom: 0, left: 0, ...f }, B = Array.isArray(l) ? l : [l], $ = B.length > 0, W = {
|
|
6461
6456
|
padding: I,
|
|
6462
|
-
boundary:
|
|
6457
|
+
boundary: B.filter(tc),
|
|
6463
6458
|
// with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
|
|
6464
6459
|
altBoundary: $
|
|
6465
|
-
}, { refs: L, floatingStyles: H, placement: D, isPositioned:
|
|
6460
|
+
}, { refs: L, floatingStyles: H, placement: D, isPositioned: F, middlewareData: P } = Fl({
|
|
6466
6461
|
// default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
|
|
6467
6462
|
strategy: "fixed",
|
|
6468
6463
|
placement: _,
|
|
@@ -6494,9 +6489,9 @@ var Vr = "PopperContent", [Zl, Jl] = Ro(Vr), Ao = g.forwardRef(
|
|
|
6494
6489
|
]
|
|
6495
6490
|
}), [G, Z] = Do(D), E = je(v);
|
|
6496
6491
|
ce(() => {
|
|
6497
|
-
|
|
6498
|
-
}, [
|
|
6499
|
-
const M = P.arrow?.x, j = P.arrow?.y,
|
|
6492
|
+
F && E?.();
|
|
6493
|
+
}, [F, E]);
|
|
6494
|
+
const M = P.arrow?.x, j = P.arrow?.y, z = P.arrow?.centerOffset !== 0, [ne, ae] = g.useState();
|
|
6500
6495
|
return ce(() => {
|
|
6501
6496
|
y && ae(window.getComputedStyle(y).zIndex);
|
|
6502
6497
|
}, [y]), /* @__PURE__ */ w.jsx(
|
|
@@ -6506,7 +6501,7 @@ var Vr = "PopperContent", [Zl, Jl] = Ro(Vr), Ao = g.forwardRef(
|
|
|
6506
6501
|
"data-radix-popper-content-wrapper": "",
|
|
6507
6502
|
style: {
|
|
6508
6503
|
...H,
|
|
6509
|
-
transform:
|
|
6504
|
+
transform: F ? H.transform : "translate(0, -200%)",
|
|
6510
6505
|
// keep off the page when measuring
|
|
6511
6506
|
minWidth: "max-content",
|
|
6512
6507
|
zIndex: ne,
|
|
@@ -6531,7 +6526,7 @@ var Vr = "PopperContent", [Zl, Jl] = Ro(Vr), Ao = g.forwardRef(
|
|
|
6531
6526
|
onArrowChange: k,
|
|
6532
6527
|
arrowX: M,
|
|
6533
6528
|
arrowY: j,
|
|
6534
|
-
shouldHideArrow:
|
|
6529
|
+
shouldHideArrow: z,
|
|
6535
6530
|
children: /* @__PURE__ */ w.jsx(
|
|
6536
6531
|
Q.div,
|
|
6537
6532
|
{
|
|
@@ -6543,7 +6538,7 @@ var Vr = "PopperContent", [Zl, Jl] = Ro(Vr), Ao = g.forwardRef(
|
|
|
6543
6538
|
...p.style,
|
|
6544
6539
|
// if the PopperContent hasn't been placed yet (not all measurements done)
|
|
6545
6540
|
// we prevent animations so that users's animation don't kick in too early referring wrong sides
|
|
6546
|
-
animation:
|
|
6541
|
+
animation: F ? void 0 : "none"
|
|
6547
6542
|
}
|
|
6548
6543
|
}
|
|
6549
6544
|
)
|
|
@@ -7251,7 +7246,7 @@ var eu = [" ", "Enter", "ArrowUp", "ArrowDown"], tu = [" ", "Enter"], Fe = "Sele
|
|
|
7251
7246
|
defaultProp: i,
|
|
7252
7247
|
onChange: c,
|
|
7253
7248
|
caller: Fe
|
|
7254
|
-
}),
|
|
7249
|
+
}), B = g.useRef(null), $ = h ? v || !!h.closest("form") : !0, [W, L] = g.useState(/* @__PURE__ */ new Set()), H = Array.from(W).map((D) => D.props.value).join(";");
|
|
7255
7250
|
return /* @__PURE__ */ w.jsx(nc, { ...p, children: /* @__PURE__ */ w.jsxs(
|
|
7256
7251
|
nu,
|
|
7257
7252
|
{
|
|
@@ -7269,7 +7264,7 @@ var eu = [" ", "Enter", "ArrowUp", "ArrowDown"], tu = [" ", "Enter"], Fe = "Sele
|
|
|
7269
7264
|
open: x,
|
|
7270
7265
|
onOpenChange: C,
|
|
7271
7266
|
dir: O,
|
|
7272
|
-
triggerPointerDownPosRef:
|
|
7267
|
+
triggerPointerDownPosRef: B,
|
|
7273
7268
|
disabled: u,
|
|
7274
7269
|
children: [
|
|
7275
7270
|
/* @__PURE__ */ w.jsx(Kt.Provider, { scope: t, children: /* @__PURE__ */ w.jsx(
|
|
@@ -7277,11 +7272,11 @@ var eu = [" ", "Enter", "ArrowUp", "ArrowDown"], tu = [" ", "Enter"], Fe = "Sele
|
|
|
7277
7272
|
{
|
|
7278
7273
|
scope: e.__scopeSelect,
|
|
7279
7274
|
onNativeOptionAdd: g.useCallback((D) => {
|
|
7280
|
-
L((
|
|
7275
|
+
L((F) => new Set(F).add(D));
|
|
7281
7276
|
}, []),
|
|
7282
7277
|
onNativeOptionRemove: g.useCallback((D) => {
|
|
7283
|
-
L((
|
|
7284
|
-
const P = new Set(
|
|
7278
|
+
L((F) => {
|
|
7279
|
+
const P = new Set(F);
|
|
7285
7280
|
return P.delete(D), P;
|
|
7286
7281
|
});
|
|
7287
7282
|
}, []),
|
|
@@ -7420,7 +7415,7 @@ var me = 10, [es, Ie] = Je(ze), lu = "SelectContentImpl", cu = /* @__PURE__ */ i
|
|
|
7420
7415
|
avoidCollisions: h,
|
|
7421
7416
|
//
|
|
7422
7417
|
...y
|
|
7423
|
-
} = e, b = Ne(ze, r), [S, R] = g.useState(null), [k, O] = g.useState(null), x = re(t, (T) => R(T)), [C, _] = g.useState(null), [I,
|
|
7418
|
+
} = e, b = Ne(ze, r), [S, R] = g.useState(null), [k, O] = g.useState(null), x = re(t, (T) => R(T)), [C, _] = g.useState(null), [I, B] = g.useState(
|
|
7424
7419
|
null
|
|
7425
7420
|
), $ = Gt(r), [W, L] = g.useState(!1), H = g.useRef(!1);
|
|
7426
7421
|
g.useEffect(() => {
|
|
@@ -7433,13 +7428,13 @@ var me = 10, [es, Ie] = Je(ze), lu = "SelectContentImpl", cu = /* @__PURE__ */ i
|
|
|
7433
7428
|
if (Y === q || (Y?.scrollIntoView({ block: "nearest" }), Y === U && k && (k.scrollTop = 0), Y === K && k && (k.scrollTop = k.scrollHeight), Y?.focus(), document.activeElement !== q)) return;
|
|
7434
7429
|
},
|
|
7435
7430
|
[$, k]
|
|
7436
|
-
),
|
|
7431
|
+
), F = g.useCallback(
|
|
7437
7432
|
() => D([C, S]),
|
|
7438
7433
|
[D, C, S]
|
|
7439
7434
|
);
|
|
7440
7435
|
g.useEffect(() => {
|
|
7441
|
-
W &&
|
|
7442
|
-
}, [W,
|
|
7436
|
+
W && F();
|
|
7437
|
+
}, [W, F]);
|
|
7443
7438
|
const { onOpenChange: P, triggerPointerDownPosRef: G } = b;
|
|
7444
7439
|
g.useEffect(() => {
|
|
7445
7440
|
if (S) {
|
|
@@ -7471,10 +7466,10 @@ var me = 10, [es, Ie] = Je(ze), lu = "SelectContentImpl", cu = /* @__PURE__ */ i
|
|
|
7471
7466
|
(b.value !== void 0 && b.value === U || K) && (_(T), K && (H.current = !0));
|
|
7472
7467
|
},
|
|
7473
7468
|
[b.value]
|
|
7474
|
-
), j = g.useCallback(() => S?.focus(), [S]),
|
|
7469
|
+
), j = g.useCallback(() => S?.focus(), [S]), z = g.useCallback(
|
|
7475
7470
|
(T, U, X) => {
|
|
7476
7471
|
const K = !H.current && !X;
|
|
7477
|
-
(b.value !== void 0 && b.value === U || K) &&
|
|
7472
|
+
(b.value !== void 0 && b.value === U || K) && B(T);
|
|
7478
7473
|
},
|
|
7479
7474
|
[b.value]
|
|
7480
7475
|
), ne = n === "popper" ? Er : rs, ae = ne === Er ? {
|
|
@@ -7499,8 +7494,8 @@ var me = 10, [es, Ie] = Je(ze), lu = "SelectContentImpl", cu = /* @__PURE__ */ i
|
|
|
7499
7494
|
itemRefCallback: M,
|
|
7500
7495
|
selectedItem: C,
|
|
7501
7496
|
onItemLeave: j,
|
|
7502
|
-
itemTextRefCallback:
|
|
7503
|
-
focusSelectedItem:
|
|
7497
|
+
itemTextRefCallback: z,
|
|
7498
|
+
focusSelectedItem: F,
|
|
7504
7499
|
selectedItemText: I,
|
|
7505
7500
|
position: n,
|
|
7506
7501
|
isPositioned: W,
|
|
@@ -7589,25 +7584,25 @@ var uu = "SelectItemAlignedPosition", rs = g.forwardRef((e, t) => {
|
|
|
7589
7584
|
]);
|
|
7590
7585
|
i.style.minWidth = De + "px", i.style.right = Qt + "px";
|
|
7591
7586
|
}
|
|
7592
|
-
const
|
|
7593
|
-
if (U <=
|
|
7594
|
-
const q =
|
|
7587
|
+
const B = u(), $ = window.innerHeight - me * 2, W = p.scrollHeight, L = window.getComputedStyle(l), H = parseInt(L.borderTopWidth, 10), D = parseInt(L.paddingTop, 10), F = parseInt(L.borderBottomWidth, 10), P = parseInt(L.paddingBottom, 10), G = H + D + W + P + F, Z = Math.min(h.offsetHeight * 5, G), E = window.getComputedStyle(p), M = parseInt(E.paddingTop, 10), j = parseInt(E.paddingBottom, 10), z = x.top + x.height / 2 - me, ne = $ - z, ae = h.offsetHeight / 2, T = h.offsetTop + ae, U = H + D + T, X = G - U;
|
|
7588
|
+
if (U <= z) {
|
|
7589
|
+
const q = B.length > 0 && h === B[B.length - 1].ref.current;
|
|
7595
7590
|
i.style.bottom = "0px";
|
|
7596
7591
|
const Y = l.clientHeight - p.offsetTop - p.offsetHeight, fe = Math.max(
|
|
7597
7592
|
ne,
|
|
7598
7593
|
ae + // viewport might have padding bottom, include it to avoid a scrollable viewport
|
|
7599
|
-
(q ? j : 0) + Y +
|
|
7594
|
+
(q ? j : 0) + Y + F
|
|
7600
7595
|
), De = U + fe;
|
|
7601
7596
|
i.style.height = De + "px";
|
|
7602
7597
|
} else {
|
|
7603
|
-
const q =
|
|
7598
|
+
const q = B.length > 0 && h === B[0].ref.current;
|
|
7604
7599
|
i.style.top = "0px";
|
|
7605
7600
|
const fe = Math.max(
|
|
7606
|
-
|
|
7601
|
+
z,
|
|
7607
7602
|
H + p.offsetTop + // viewport might have padding top, include it to avoid a scrollable viewport
|
|
7608
7603
|
(q ? M : 0) + ae
|
|
7609
7604
|
) + X;
|
|
7610
|
-
i.style.height = fe + "px", p.scrollTop = U -
|
|
7605
|
+
i.style.height = fe + "px", p.scrollTop = U - z + p.offsetTop;
|
|
7611
7606
|
}
|
|
7612
7607
|
i.style.margin = `${me}px 0`, i.style.minHeight = Z + "px", i.style.maxHeight = $ + "px", n?.(), requestAnimationFrame(() => m.current = !0);
|
|
7613
7608
|
}
|