dishui 0.0.1 → 0.0.2
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/dishui.css +1 -1
- package/dist/dishui.es.js +346 -294
- package/dist/dishui.umd.js +4 -4
- package/package.json +18 -13
package/dist/dishui.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
var
|
|
1
|
+
import H, { useState as U, useRef as oe, useEffect as de } from "react";
|
|
2
|
+
var K = { exports: {} }, Z = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
5
5
|
* react-jsx-runtime.production.js
|
|
@@ -9,29 +9,29 @@ var Z = { exports: {} }, M = {};
|
|
|
9
9
|
* This source code is licensed under the MIT license found in the
|
|
10
10
|
* LICENSE file in the root directory of this source tree.
|
|
11
11
|
*/
|
|
12
|
-
var
|
|
13
|
-
function
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
var
|
|
17
|
-
function
|
|
18
|
-
var
|
|
19
|
-
if (t !== void 0 && (
|
|
12
|
+
var re;
|
|
13
|
+
function me() {
|
|
14
|
+
if (re) return Z;
|
|
15
|
+
re = 1;
|
|
16
|
+
var f = Symbol.for("react.transitional.element"), c = Symbol.for("react.fragment");
|
|
17
|
+
function p(n, u, t) {
|
|
18
|
+
var C = null;
|
|
19
|
+
if (t !== void 0 && (C = "" + t), u.key !== void 0 && (C = "" + u.key), "key" in u) {
|
|
20
20
|
t = {};
|
|
21
|
-
for (var
|
|
22
|
-
|
|
23
|
-
} else t =
|
|
24
|
-
return
|
|
25
|
-
$$typeof:
|
|
21
|
+
for (var i in u)
|
|
22
|
+
i !== "key" && (t[i] = u[i]);
|
|
23
|
+
} else t = u;
|
|
24
|
+
return u = t.ref, {
|
|
25
|
+
$$typeof: f,
|
|
26
26
|
type: n,
|
|
27
|
-
key:
|
|
28
|
-
ref:
|
|
27
|
+
key: C,
|
|
28
|
+
ref: u !== void 0 ? u : null,
|
|
29
29
|
props: t
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
|
-
return
|
|
32
|
+
return Z.Fragment = c, Z.jsx = p, Z.jsxs = p, Z;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var Q = {};
|
|
35
35
|
/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.development.js
|
|
@@ -41,47 +41,47 @@ var W = {};
|
|
|
41
41
|
* This source code is licensed under the MIT license found in the
|
|
42
42
|
* LICENSE file in the root directory of this source tree.
|
|
43
43
|
*/
|
|
44
|
-
var
|
|
45
|
-
function
|
|
46
|
-
return
|
|
47
|
-
function
|
|
44
|
+
var ne;
|
|
45
|
+
function pe() {
|
|
46
|
+
return ne || (ne = 1, process.env.NODE_ENV !== "production" && function() {
|
|
47
|
+
function f(e) {
|
|
48
48
|
if (e == null) return null;
|
|
49
49
|
if (typeof e == "function")
|
|
50
|
-
return e.$$typeof ===
|
|
50
|
+
return e.$$typeof === T ? null : e.displayName || e.name || null;
|
|
51
51
|
if (typeof e == "string") return e;
|
|
52
52
|
switch (e) {
|
|
53
|
-
case
|
|
53
|
+
case R:
|
|
54
54
|
return "Fragment";
|
|
55
|
-
case
|
|
55
|
+
case M:
|
|
56
56
|
return "Profiler";
|
|
57
|
-
case
|
|
57
|
+
case P:
|
|
58
58
|
return "StrictMode";
|
|
59
|
-
case
|
|
59
|
+
case W:
|
|
60
60
|
return "Suspense";
|
|
61
|
-
case
|
|
61
|
+
case y:
|
|
62
62
|
return "SuspenseList";
|
|
63
|
-
case
|
|
63
|
+
case F:
|
|
64
64
|
return "Activity";
|
|
65
65
|
}
|
|
66
66
|
if (typeof e == "object")
|
|
67
67
|
switch (typeof e.tag == "number" && console.error(
|
|
68
68
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
69
69
|
), e.$$typeof) {
|
|
70
|
-
case
|
|
70
|
+
case a:
|
|
71
71
|
return "Portal";
|
|
72
|
-
case
|
|
72
|
+
case I:
|
|
73
73
|
return (e.displayName || "Context") + ".Provider";
|
|
74
|
-
case
|
|
74
|
+
case $:
|
|
75
75
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
76
|
-
case
|
|
76
|
+
case O:
|
|
77
77
|
var s = e.render;
|
|
78
78
|
return e = e.displayName, e || (e = s.displayName || s.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
79
|
-
case
|
|
80
|
-
return s = e.displayName || null, s !== null ? s :
|
|
81
|
-
case
|
|
79
|
+
case D:
|
|
80
|
+
return s = e.displayName || null, s !== null ? s : f(e.type) || "Memo";
|
|
81
|
+
case S:
|
|
82
82
|
s = e._payload, e = e._init;
|
|
83
83
|
try {
|
|
84
|
-
return
|
|
84
|
+
return f(e(s));
|
|
85
85
|
} catch {
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -90,7 +90,7 @@ function be() {
|
|
|
90
90
|
function c(e) {
|
|
91
91
|
return "" + e;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function p(e) {
|
|
94
94
|
try {
|
|
95
95
|
c(e);
|
|
96
96
|
var s = !1;
|
|
@@ -99,8 +99,8 @@ function be() {
|
|
|
99
99
|
}
|
|
100
100
|
if (s) {
|
|
101
101
|
s = console;
|
|
102
|
-
var
|
|
103
|
-
return
|
|
102
|
+
var l = s.error, b = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
103
|
+
return l.call(
|
|
104
104
|
s,
|
|
105
105
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
106
106
|
b
|
|
@@ -108,58 +108,58 @@ function be() {
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
function n(e) {
|
|
111
|
-
if (e ===
|
|
112
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
111
|
+
if (e === R) return "<>";
|
|
112
|
+
if (typeof e == "object" && e !== null && e.$$typeof === S)
|
|
113
113
|
return "<...>";
|
|
114
114
|
try {
|
|
115
|
-
var s =
|
|
115
|
+
var s = f(e);
|
|
116
116
|
return s ? "<" + s + ">" : "<...>";
|
|
117
117
|
} catch {
|
|
118
118
|
return "<...>";
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
var e =
|
|
121
|
+
function u() {
|
|
122
|
+
var e = E.A;
|
|
123
123
|
return e === null ? null : e.getOwner();
|
|
124
124
|
}
|
|
125
125
|
function t() {
|
|
126
126
|
return Error("react-stack-top-frame");
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function C(e) {
|
|
129
129
|
if (k.call(e, "key")) {
|
|
130
130
|
var s = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
131
131
|
if (s && s.isReactWarning) return !1;
|
|
132
132
|
}
|
|
133
133
|
return e.key !== void 0;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
function
|
|
137
|
-
|
|
135
|
+
function i(e, s) {
|
|
136
|
+
function l() {
|
|
137
|
+
z || (z = !0, console.error(
|
|
138
138
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
139
139
|
s
|
|
140
140
|
));
|
|
141
141
|
}
|
|
142
|
-
|
|
143
|
-
get:
|
|
142
|
+
l.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
143
|
+
get: l,
|
|
144
144
|
configurable: !0
|
|
145
145
|
});
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
var e =
|
|
149
|
-
return
|
|
147
|
+
function j() {
|
|
148
|
+
var e = f(this.type);
|
|
149
|
+
return Y[e] || (Y[e] = !0, console.error(
|
|
150
150
|
"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."
|
|
151
151
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
152
152
|
}
|
|
153
|
-
function v(e, s,
|
|
154
|
-
return
|
|
155
|
-
$$typeof:
|
|
153
|
+
function v(e, s, l, b, N, h, _, A) {
|
|
154
|
+
return l = h.ref, e = {
|
|
155
|
+
$$typeof: o,
|
|
156
156
|
type: e,
|
|
157
157
|
key: s,
|
|
158
|
-
props:
|
|
159
|
-
_owner:
|
|
160
|
-
}, (
|
|
158
|
+
props: h,
|
|
159
|
+
_owner: N
|
|
160
|
+
}, (l !== void 0 ? l : null) !== null ? Object.defineProperty(e, "ref", {
|
|
161
161
|
enumerable: !1,
|
|
162
|
-
get:
|
|
162
|
+
get: j
|
|
163
163
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
164
164
|
configurable: !1,
|
|
165
165
|
enumerable: !1,
|
|
@@ -174,33 +174,33 @@ function be() {
|
|
|
174
174
|
configurable: !1,
|
|
175
175
|
enumerable: !1,
|
|
176
176
|
writable: !0,
|
|
177
|
-
value:
|
|
177
|
+
value: _
|
|
178
178
|
}), Object.defineProperty(e, "_debugTask", {
|
|
179
179
|
configurable: !1,
|
|
180
180
|
enumerable: !1,
|
|
181
181
|
writable: !0,
|
|
182
|
-
value:
|
|
182
|
+
value: A
|
|
183
183
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
184
184
|
}
|
|
185
|
-
function
|
|
186
|
-
var
|
|
187
|
-
if (
|
|
185
|
+
function g(e, s, l, b, N, h, _, A) {
|
|
186
|
+
var m = s.children;
|
|
187
|
+
if (m !== void 0)
|
|
188
188
|
if (b)
|
|
189
|
-
if (
|
|
190
|
-
for (b = 0; b <
|
|
191
|
-
|
|
192
|
-
Object.freeze && Object.freeze(
|
|
189
|
+
if (G(m)) {
|
|
190
|
+
for (b = 0; b < m.length; b++)
|
|
191
|
+
w(m[b]);
|
|
192
|
+
Object.freeze && Object.freeze(m);
|
|
193
193
|
} else
|
|
194
194
|
console.error(
|
|
195
195
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
196
196
|
);
|
|
197
|
-
else
|
|
197
|
+
else w(m);
|
|
198
198
|
if (k.call(s, "key")) {
|
|
199
|
-
|
|
200
|
-
var
|
|
201
|
-
return
|
|
199
|
+
m = f(e);
|
|
200
|
+
var B = Object.keys(s).filter(function(ee) {
|
|
201
|
+
return ee !== "key";
|
|
202
202
|
});
|
|
203
|
-
b = 0 <
|
|
203
|
+
b = 0 < B.length ? "{key: someKey, " + B.join(": ..., ") + ": ...}" : "{key: someKey}", J[m + b] || (B = 0 < B.length ? "{" + B.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
204
204
|
`A props object containing a "key" prop is being spread into JSX:
|
|
205
205
|
let props = %s;
|
|
206
206
|
<%s {...props} />
|
|
@@ -208,150 +208,150 @@ React keys must be passed directly to JSX without using spread:
|
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s key={someKey} {...props} />`,
|
|
210
210
|
b,
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
),
|
|
211
|
+
m,
|
|
212
|
+
B,
|
|
213
|
+
m
|
|
214
|
+
), J[m + b] = !0);
|
|
215
215
|
}
|
|
216
|
-
if (
|
|
217
|
-
|
|
218
|
-
for (var
|
|
219
|
-
|
|
220
|
-
} else
|
|
221
|
-
return
|
|
222
|
-
|
|
216
|
+
if (m = null, l !== void 0 && (p(l), m = "" + l), C(s) && (p(s.key), m = "" + s.key), "key" in s) {
|
|
217
|
+
l = {};
|
|
218
|
+
for (var X in s)
|
|
219
|
+
X !== "key" && (l[X] = s[X]);
|
|
220
|
+
} else l = s;
|
|
221
|
+
return m && i(
|
|
222
|
+
l,
|
|
223
223
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
224
224
|
), v(
|
|
225
225
|
e,
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
226
|
+
m,
|
|
227
|
+
h,
|
|
228
|
+
N,
|
|
229
|
+
u(),
|
|
230
|
+
l,
|
|
231
|
+
_,
|
|
232
|
+
A
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
typeof e == "object" && e !== null && e.$$typeof ===
|
|
235
|
+
function w(e) {
|
|
236
|
+
typeof e == "object" && e !== null && e.$$typeof === o && e._store && (e._store.validated = 1);
|
|
237
237
|
}
|
|
238
|
-
var
|
|
238
|
+
var d = H, o = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), R = Symbol.for("react.fragment"), P = Symbol.for("react.strict_mode"), M = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), I = Symbol.for("react.context"), O = Symbol.for("react.forward_ref"), W = Symbol.for("react.suspense"), y = Symbol.for("react.suspense_list"), D = Symbol.for("react.memo"), S = Symbol.for("react.lazy"), F = Symbol.for("react.activity"), T = Symbol.for("react.client.reference"), E = d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, k = Object.prototype.hasOwnProperty, G = Array.isArray, V = console.createTask ? console.createTask : function() {
|
|
239
239
|
return null;
|
|
240
240
|
};
|
|
241
|
-
|
|
241
|
+
d = {
|
|
242
242
|
"react-stack-bottom-frame": function(e) {
|
|
243
243
|
return e();
|
|
244
244
|
}
|
|
245
245
|
};
|
|
246
|
-
var
|
|
247
|
-
|
|
246
|
+
var z, Y = {}, L = d["react-stack-bottom-frame"].bind(
|
|
247
|
+
d,
|
|
248
248
|
t
|
|
249
|
-
)(),
|
|
250
|
-
|
|
251
|
-
var
|
|
252
|
-
return
|
|
249
|
+
)(), q = V(n(t)), J = {};
|
|
250
|
+
Q.Fragment = R, Q.jsx = function(e, s, l, b, N) {
|
|
251
|
+
var h = 1e4 > E.recentlyCreatedOwnerStacks++;
|
|
252
|
+
return g(
|
|
253
253
|
e,
|
|
254
254
|
s,
|
|
255
|
-
|
|
255
|
+
l,
|
|
256
256
|
!1,
|
|
257
257
|
b,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
258
|
+
N,
|
|
259
|
+
h ? Error("react-stack-top-frame") : L,
|
|
260
|
+
h ? V(n(e)) : q
|
|
261
261
|
);
|
|
262
|
-
},
|
|
263
|
-
var
|
|
264
|
-
return
|
|
262
|
+
}, Q.jsxs = function(e, s, l, b, N) {
|
|
263
|
+
var h = 1e4 > E.recentlyCreatedOwnerStacks++;
|
|
264
|
+
return g(
|
|
265
265
|
e,
|
|
266
266
|
s,
|
|
267
|
-
|
|
267
|
+
l,
|
|
268
268
|
!0,
|
|
269
269
|
b,
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
270
|
+
N,
|
|
271
|
+
h ? Error("react-stack-top-frame") : L,
|
|
272
|
+
h ? V(n(e)) : q
|
|
273
273
|
);
|
|
274
274
|
};
|
|
275
|
-
}()),
|
|
275
|
+
}()), Q;
|
|
276
276
|
}
|
|
277
|
-
var
|
|
278
|
-
function
|
|
279
|
-
return
|
|
277
|
+
var ae;
|
|
278
|
+
function be() {
|
|
279
|
+
return ae || (ae = 1, process.env.NODE_ENV === "production" ? K.exports = me() : K.exports = pe()), K.exports;
|
|
280
280
|
}
|
|
281
|
-
var
|
|
282
|
-
const
|
|
283
|
-
children:
|
|
281
|
+
var r = be();
|
|
282
|
+
const he = ({
|
|
283
|
+
children: f,
|
|
284
284
|
variant: c = "primary",
|
|
285
|
-
size:
|
|
285
|
+
size: p = "md",
|
|
286
286
|
outline: n = !1,
|
|
287
|
-
dash:
|
|
287
|
+
dash: u = !1,
|
|
288
288
|
soft: t = !1,
|
|
289
|
-
active:
|
|
290
|
-
disabled:
|
|
291
|
-
wide:
|
|
289
|
+
active: C = !1,
|
|
290
|
+
disabled: i = !1,
|
|
291
|
+
wide: j = !1,
|
|
292
292
|
block: v = !1,
|
|
293
|
-
square:
|
|
294
|
-
circle:
|
|
295
|
-
leftSection:
|
|
296
|
-
rightSection:
|
|
297
|
-
onClick:
|
|
298
|
-
className:
|
|
293
|
+
square: g = !1,
|
|
294
|
+
circle: w = !1,
|
|
295
|
+
leftSection: d,
|
|
296
|
+
rightSection: o,
|
|
297
|
+
onClick: a,
|
|
298
|
+
className: R = ""
|
|
299
299
|
}) => {
|
|
300
|
-
const
|
|
301
|
-
N,
|
|
302
|
-
w,
|
|
300
|
+
const P = "btn", M = c ? `btn-${c}` : "", $ = p ? `btn-${p}` : "", E = [
|
|
303
301
|
P,
|
|
302
|
+
M,
|
|
303
|
+
$,
|
|
304
304
|
n ? "btn-outline" : "",
|
|
305
|
-
|
|
305
|
+
u ? "btn-dash" : "",
|
|
306
306
|
t ? "btn-soft" : "",
|
|
307
|
-
|
|
308
|
-
|
|
307
|
+
C ? "btn-active" : "",
|
|
308
|
+
j ? "btn-wide" : "",
|
|
309
309
|
v ? "btn-block" : "",
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
310
|
+
g ? "btn-square" : "",
|
|
311
|
+
w ? "btn-circle" : "",
|
|
312
|
+
R
|
|
313
313
|
].filter(Boolean).join(" ");
|
|
314
|
-
return /* @__PURE__ */
|
|
314
|
+
return /* @__PURE__ */ r.jsxs(
|
|
315
315
|
"button",
|
|
316
316
|
{
|
|
317
|
-
className:
|
|
318
|
-
disabled:
|
|
319
|
-
onClick:
|
|
317
|
+
className: E,
|
|
318
|
+
disabled: i,
|
|
319
|
+
onClick: a,
|
|
320
320
|
children: [
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
321
|
+
d && /* @__PURE__ */ r.jsx("span", { className: "mr-2", children: d }),
|
|
322
|
+
f,
|
|
323
|
+
o && /* @__PURE__ */ r.jsx("span", { className: "ml-2", children: o })
|
|
324
324
|
]
|
|
325
325
|
}
|
|
326
326
|
);
|
|
327
|
-
},
|
|
328
|
-
children:
|
|
327
|
+
}, xe = ({
|
|
328
|
+
children: f,
|
|
329
329
|
vertical: c = !1,
|
|
330
|
-
className:
|
|
330
|
+
className: p = "",
|
|
331
331
|
rounded: n = "none",
|
|
332
|
-
radius:
|
|
332
|
+
radius: u = "full",
|
|
333
333
|
roundedStyle: t
|
|
334
334
|
}) => {
|
|
335
|
-
const
|
|
335
|
+
const C = [
|
|
336
336
|
"join",
|
|
337
337
|
c ? "join-vertical" : "join-horizontal",
|
|
338
|
-
|
|
339
|
-
].filter(Boolean).join(" "),
|
|
340
|
-
return /* @__PURE__ */
|
|
341
|
-
if (!
|
|
342
|
-
const
|
|
343
|
-
let
|
|
344
|
-
t ? c ? n === "left" &&
|
|
345
|
-
const
|
|
346
|
-
return
|
|
347
|
-
className:
|
|
338
|
+
p
|
|
339
|
+
].filter(Boolean).join(" "), i = n !== "none" ? "full" : u;
|
|
340
|
+
return /* @__PURE__ */ r.jsx("div", { className: C, children: H.Children.map(f, (j, v) => {
|
|
341
|
+
if (!H.isValidElement(j)) return j;
|
|
342
|
+
const g = j, w = g.props.className || "", d = v === 0, o = v === H.Children.count(f) - 1;
|
|
343
|
+
let a = "";
|
|
344
|
+
t ? c ? n === "left" && d && t.top ? a = t.top : n === "right" && o && t.bottom ? a = t.bottom : n === "both" && (d && t.top && (a = t.top), o && t.bottom && (a = t.bottom)) : n === "left" && d && t.left ? a = t.left : n === "right" && o && t.right ? a = t.right : n === "both" && (d && t.left && (a = t.left), o && t.right && (a = t.right)) : c ? n === "left" && d ? a = `rounded-t-${i}` : n === "right" && o ? a = `rounded-b-${i}` : n === "both" && (d && (a = `rounded-t-${i}`), o && (a = `rounded-b-${i}`)) : n === "left" && d ? a = `rounded-l-${i}` : n === "right" && o ? a = `rounded-r-${i}` : n === "both" && (d && (a = `rounded-l-${i}`), o && (a = `rounded-r-${i}`));
|
|
345
|
+
const R = `${w} join-item ${a}`.trim();
|
|
346
|
+
return H.cloneElement(g, {
|
|
347
|
+
className: R
|
|
348
348
|
});
|
|
349
349
|
}) });
|
|
350
|
-
},
|
|
351
|
-
children:
|
|
350
|
+
}, Ce = ({
|
|
351
|
+
children: f,
|
|
352
352
|
className: c = ""
|
|
353
353
|
}) => {
|
|
354
|
-
const
|
|
354
|
+
const p = [
|
|
355
355
|
"join-item",
|
|
356
356
|
"flex",
|
|
357
357
|
"items-center",
|
|
@@ -361,178 +361,230 @@ const Ce = ({
|
|
|
361
361
|
"border-base-300",
|
|
362
362
|
c
|
|
363
363
|
].filter(Boolean).join(" ");
|
|
364
|
-
return /* @__PURE__ */
|
|
365
|
-
},
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
const
|
|
369
|
-
children:
|
|
364
|
+
return /* @__PURE__ */ r.jsx("div", { className: p, children: f });
|
|
365
|
+
}, le = he;
|
|
366
|
+
le.Group = xe;
|
|
367
|
+
le.GroupSection = Ce;
|
|
368
|
+
const Ee = ({
|
|
369
|
+
children: f,
|
|
370
370
|
variant: c = "primary",
|
|
371
|
-
size:
|
|
371
|
+
size: p = "md",
|
|
372
372
|
outline: n = !1,
|
|
373
|
-
className:
|
|
373
|
+
className: u = ""
|
|
374
374
|
}) => {
|
|
375
|
-
const t = "badge",
|
|
375
|
+
const t = "badge", C = c ? `badge-${c}` : "", i = p ? `badge-${p}` : "", v = [
|
|
376
376
|
t,
|
|
377
|
-
|
|
378
|
-
|
|
377
|
+
C,
|
|
378
|
+
i,
|
|
379
379
|
n ? "badge-outline" : "",
|
|
380
|
-
|
|
380
|
+
u
|
|
381
381
|
].filter(Boolean).join(" ");
|
|
382
|
-
return /* @__PURE__ */
|
|
383
|
-
},
|
|
384
|
-
placeholder:
|
|
382
|
+
return /* @__PURE__ */ r.jsx("div", { className: v, children: f });
|
|
383
|
+
}, je = ({
|
|
384
|
+
placeholder: f,
|
|
385
385
|
value: c,
|
|
386
|
-
onChange:
|
|
386
|
+
onChange: p,
|
|
387
387
|
type: n = "text",
|
|
388
|
-
variant:
|
|
388
|
+
variant: u,
|
|
389
389
|
size: t = "md",
|
|
390
|
-
disabled:
|
|
391
|
-
required:
|
|
392
|
-
label:
|
|
390
|
+
disabled: C = !1,
|
|
391
|
+
required: i = !1,
|
|
392
|
+
label: j,
|
|
393
393
|
leftSection: v,
|
|
394
|
-
rightSection:
|
|
395
|
-
pattern:
|
|
396
|
-
className:
|
|
397
|
-
validator:
|
|
398
|
-
validatorHint:
|
|
394
|
+
rightSection: g,
|
|
395
|
+
pattern: w,
|
|
396
|
+
className: d = "",
|
|
397
|
+
validator: o = !1,
|
|
398
|
+
validatorHint: a,
|
|
399
|
+
validationRules: R = []
|
|
399
400
|
}) => {
|
|
400
|
-
const
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
401
|
+
const [P, M] = U(!1), [$, I] = U(""), [O, W] = U(null), [y, D] = U(!1), [S, F] = U([]), T = oe(null), E = n === "password" && P ? "text" : n, k = (h) => {
|
|
402
|
+
const _ = h.target.value;
|
|
403
|
+
if (n === "password" && _.length > (c || "").length) {
|
|
404
|
+
const A = _.slice((c || "").length);
|
|
405
|
+
I(A), setTimeout(() => {
|
|
406
|
+
I("");
|
|
407
|
+
}, 1e3);
|
|
408
|
+
}
|
|
409
|
+
o && T.current && G(_), p && p(h);
|
|
410
|
+
}, G = (h) => {
|
|
411
|
+
if (!T.current) return;
|
|
412
|
+
const _ = T.current.checkValidity(), A = [];
|
|
413
|
+
R.length > 0 && R.forEach((m) => {
|
|
414
|
+
m.pattern.test(h) || A.push(m.message);
|
|
415
|
+
}), F(A), W(_ && A.length === 0);
|
|
416
|
+
}, V = () => {
|
|
417
|
+
M(!P);
|
|
418
|
+
}, z = () => {
|
|
419
|
+
o && !O && D(!0);
|
|
420
|
+
}, Y = () => {
|
|
421
|
+
D(!1);
|
|
422
|
+
};
|
|
423
|
+
let L = "";
|
|
424
|
+
o && O !== null && (L = O ? "input-success" : "input-error");
|
|
425
|
+
const q = "input", J = u && !L ? `input-${u}` : "", e = t ? `input-${t}` : "", l = [
|
|
426
|
+
q,
|
|
427
|
+
J,
|
|
428
|
+
e,
|
|
429
|
+
o ? "validator" : "",
|
|
430
|
+
L,
|
|
431
|
+
d
|
|
432
|
+
].filter(Boolean).join(" "), b = n === "password" && /* @__PURE__ */ r.jsx(
|
|
433
|
+
"span",
|
|
434
|
+
{
|
|
435
|
+
className: "cursor-pointer opacity-70 hover:opacity-100",
|
|
436
|
+
onClick: V,
|
|
437
|
+
children: P ? (
|
|
438
|
+
// 眼睛关闭图标
|
|
439
|
+
/* @__PURE__ */ r.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
440
|
+
/* @__PURE__ */ r.jsx("path", { d: "M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94" }),
|
|
441
|
+
/* @__PURE__ */ r.jsx("path", { d: "M14.12 14.12a3 3 0 1 1-4.24-4.24" }),
|
|
442
|
+
/* @__PURE__ */ r.jsx("path", { d: "M1 1l22 22" }),
|
|
443
|
+
/* @__PURE__ */ r.jsx("path", { d: "M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19" })
|
|
444
|
+
] })
|
|
445
|
+
) : (
|
|
446
|
+
// 眼睛打开图标
|
|
447
|
+
/* @__PURE__ */ r.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-5 w-5", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
|
|
448
|
+
/* @__PURE__ */ r.jsx("path", { d: "M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z" }),
|
|
449
|
+
/* @__PURE__ */ r.jsx("circle", { cx: "12", cy: "12", r: "3" })
|
|
450
|
+
] })
|
|
451
|
+
)
|
|
452
|
+
}
|
|
453
|
+
), N = /* @__PURE__ */ r.jsx("div", { className: "validation-tooltip", children: S.length > 0 ? /* @__PURE__ */ r.jsx("ul", { className: "text-xs list-disc pl-4 py-1", children: S.map((h, _) => /* @__PURE__ */ r.jsx("li", { children: h }, _)) }) : a ? /* @__PURE__ */ r.jsx("p", { className: "text-xs py-1", children: a }) : null });
|
|
454
|
+
return j || v || g || n === "password" ? /* @__PURE__ */ r.jsxs("div", { className: "relative", onMouseEnter: z, onMouseLeave: Y, children: [
|
|
455
|
+
/* @__PURE__ */ r.jsxs("label", { className: l, children: [
|
|
456
|
+
v && /* @__PURE__ */ r.jsx("span", { children: v }),
|
|
457
|
+
j && /* @__PURE__ */ r.jsx("span", { children: j }),
|
|
458
|
+
/* @__PURE__ */ r.jsx(
|
|
412
459
|
"input",
|
|
413
460
|
{
|
|
414
|
-
|
|
415
|
-
|
|
461
|
+
ref: T,
|
|
462
|
+
type: E,
|
|
463
|
+
placeholder: f,
|
|
416
464
|
value: c,
|
|
417
|
-
onChange:
|
|
418
|
-
disabled:
|
|
419
|
-
required:
|
|
465
|
+
onChange: k,
|
|
466
|
+
disabled: C,
|
|
467
|
+
required: i,
|
|
420
468
|
className: "grow",
|
|
421
|
-
pattern:
|
|
469
|
+
pattern: w
|
|
422
470
|
}
|
|
423
471
|
),
|
|
424
|
-
|
|
472
|
+
n === "password" && $ && /* @__PURE__ */ r.jsx("span", { className: "password-recent absolute right-10 font-mono", children: $ }),
|
|
473
|
+
n === "password" ? /* @__PURE__ */ r.jsx("span", { children: b }) : g ? /* @__PURE__ */ r.jsx("span", { children: g }) : null
|
|
425
474
|
] }),
|
|
426
|
-
a &&
|
|
427
|
-
|
|
428
|
-
|
|
475
|
+
o && a && !y && /* @__PURE__ */ r.jsx("p", { className: "validator-hint text-xs mt-1 opacity-70", children: a }),
|
|
476
|
+
y && o && !O && /* @__PURE__ */ r.jsx("div", { className: "absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1", children: N })
|
|
477
|
+
] }) : /* @__PURE__ */ r.jsxs("div", { className: "relative", onMouseEnter: z, onMouseLeave: Y, children: [
|
|
478
|
+
/* @__PURE__ */ r.jsx(
|
|
429
479
|
"input",
|
|
430
480
|
{
|
|
431
|
-
|
|
432
|
-
|
|
481
|
+
ref: T,
|
|
482
|
+
type: E,
|
|
483
|
+
placeholder: f,
|
|
433
484
|
value: c,
|
|
434
|
-
onChange:
|
|
435
|
-
disabled:
|
|
436
|
-
required:
|
|
437
|
-
className:
|
|
438
|
-
pattern:
|
|
485
|
+
onChange: k,
|
|
486
|
+
disabled: C,
|
|
487
|
+
required: i,
|
|
488
|
+
className: l,
|
|
489
|
+
pattern: w
|
|
439
490
|
}
|
|
440
491
|
),
|
|
441
|
-
a &&
|
|
492
|
+
o && a && !y && /* @__PURE__ */ r.jsx("p", { className: "validator-hint text-xs mt-1 opacity-70", children: a }),
|
|
493
|
+
y && o && !O && /* @__PURE__ */ r.jsx("div", { className: "absolute z-10 mt-1 bg-base-200 border border-error rounded shadow-lg text-error px-3 py-1", children: N })
|
|
442
494
|
] });
|
|
443
|
-
},
|
|
444
|
-
children:
|
|
495
|
+
}, ge = ({
|
|
496
|
+
children: f,
|
|
445
497
|
variant: c = "neutral",
|
|
446
|
-
size:
|
|
498
|
+
size: p = "md",
|
|
447
499
|
outline: n = !1,
|
|
448
|
-
dash:
|
|
500
|
+
dash: u = !1,
|
|
449
501
|
soft: t = !1,
|
|
450
|
-
bold:
|
|
451
|
-
italic:
|
|
452
|
-
underline:
|
|
502
|
+
bold: C = !1,
|
|
503
|
+
italic: i = !1,
|
|
504
|
+
underline: j = !1,
|
|
453
505
|
ellipsis: v = !1,
|
|
454
|
-
maxWidth:
|
|
455
|
-
stateTimeout:
|
|
456
|
-
styleConfig:
|
|
506
|
+
maxWidth: g,
|
|
507
|
+
stateTimeout: w,
|
|
508
|
+
styleConfig: d = {},
|
|
457
509
|
// 使用用户传入的状态,默认为'default'
|
|
458
|
-
state:
|
|
459
|
-
onStateChange:
|
|
460
|
-
onClick:
|
|
461
|
-
onDoubleClick:
|
|
462
|
-
onMouseEnter:
|
|
463
|
-
onMouseLeave:
|
|
464
|
-
onDragStart:
|
|
465
|
-
onDragEnd:
|
|
466
|
-
draggable:
|
|
467
|
-
className:
|
|
468
|
-
style:
|
|
510
|
+
state: o,
|
|
511
|
+
onStateChange: a,
|
|
512
|
+
onClick: R,
|
|
513
|
+
onDoubleClick: P,
|
|
514
|
+
onMouseEnter: M,
|
|
515
|
+
onMouseLeave: $,
|
|
516
|
+
onDragStart: I,
|
|
517
|
+
onDragEnd: O,
|
|
518
|
+
draggable: W = !1,
|
|
519
|
+
className: y = "",
|
|
520
|
+
style: D = {}
|
|
469
521
|
}) => {
|
|
470
|
-
var
|
|
471
|
-
const [
|
|
472
|
-
|
|
473
|
-
},
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
},
|
|
522
|
+
var se, te;
|
|
523
|
+
const [S, F] = U("default"), T = o !== void 0 ? o : S, E = oe(null), k = (x) => {
|
|
524
|
+
o === void 0 && F(x), a && a(x), G(x);
|
|
525
|
+
}, G = (x = T) => {
|
|
526
|
+
E.current && (clearTimeout(E.current), E.current = null), w && x !== "default" && o === void 0 && (E.current = setTimeout(() => {
|
|
527
|
+
F("default"), a && a("default");
|
|
528
|
+
}, w));
|
|
477
529
|
};
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}), [
|
|
481
|
-
const
|
|
530
|
+
de(() => (G(), () => {
|
|
531
|
+
E.current && clearTimeout(E.current);
|
|
532
|
+
}), [T, w, o]);
|
|
533
|
+
const V = "label", z = c ? `text-${c}` : "", Y = {
|
|
482
534
|
xs: "text-xs",
|
|
483
535
|
sm: "text-sm",
|
|
484
536
|
md: "text-base",
|
|
485
537
|
lg: "text-lg",
|
|
486
538
|
xl: "text-xl"
|
|
487
|
-
},
|
|
488
|
-
I,
|
|
539
|
+
}, L = Y[p] || Y.md, h = [
|
|
489
540
|
V,
|
|
490
|
-
|
|
541
|
+
z,
|
|
542
|
+
L,
|
|
491
543
|
n ? "border border-current px-2 py-1 rounded" : "",
|
|
492
|
-
|
|
544
|
+
u ? "border border-dashed border-current px-2 py-1 rounded" : "",
|
|
493
545
|
t ? "bg-opacity-10 bg-current px-2 py-1 rounded" : "",
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
546
|
+
C ? "font-bold" : "",
|
|
547
|
+
i ? "italic" : "",
|
|
548
|
+
j ? "underline" : "",
|
|
497
549
|
v ? "truncate" : "",
|
|
498
|
-
|
|
499
|
-
].filter(Boolean).join(" "),
|
|
500
|
-
k("clicked"),
|
|
501
|
-
},
|
|
502
|
-
k("doubleClicked"),
|
|
503
|
-
},
|
|
504
|
-
k("hover"),
|
|
505
|
-
},
|
|
506
|
-
k("default"),
|
|
507
|
-
},
|
|
508
|
-
k("dragging"),
|
|
509
|
-
},
|
|
510
|
-
k("default"),
|
|
511
|
-
},
|
|
512
|
-
...
|
|
513
|
-
...
|
|
514
|
-
...
|
|
550
|
+
y
|
|
551
|
+
].filter(Boolean).join(" "), _ = (x) => {
|
|
552
|
+
k("clicked"), R && R(x);
|
|
553
|
+
}, A = (x) => {
|
|
554
|
+
k("doubleClicked"), P && P(x);
|
|
555
|
+
}, m = (x) => {
|
|
556
|
+
k("hover"), M && M(x);
|
|
557
|
+
}, B = (x) => {
|
|
558
|
+
k("default"), $ && $(x);
|
|
559
|
+
}, X = (x) => {
|
|
560
|
+
k("dragging"), I && I(x);
|
|
561
|
+
}, ee = (x) => {
|
|
562
|
+
k("default"), O && O(x);
|
|
563
|
+
}, ce = ((se = d[T]) == null ? void 0 : se.style) || {}, ie = ((te = d[T]) == null ? void 0 : te.className) || "", ue = {
|
|
564
|
+
...D,
|
|
565
|
+
...ce,
|
|
566
|
+
...g ? { maxWidth: g } : {},
|
|
515
567
|
...v ? { display: "inline-block", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } : {}
|
|
516
|
-
},
|
|
517
|
-
return /* @__PURE__ */
|
|
568
|
+
}, fe = `${h} ${ie}`.trim();
|
|
569
|
+
return /* @__PURE__ */ r.jsx(
|
|
518
570
|
"span",
|
|
519
571
|
{
|
|
520
|
-
className:
|
|
521
|
-
style:
|
|
522
|
-
onClick:
|
|
523
|
-
onDoubleClick:
|
|
524
|
-
onMouseEnter:
|
|
525
|
-
onMouseLeave:
|
|
526
|
-
onDragStart:
|
|
527
|
-
onDragEnd:
|
|
528
|
-
draggable:
|
|
529
|
-
children:
|
|
572
|
+
className: fe,
|
|
573
|
+
style: ue,
|
|
574
|
+
onClick: _,
|
|
575
|
+
onDoubleClick: A,
|
|
576
|
+
onMouseEnter: m,
|
|
577
|
+
onMouseLeave: B,
|
|
578
|
+
onDragStart: X,
|
|
579
|
+
onDragEnd: ee,
|
|
580
|
+
draggable: W,
|
|
581
|
+
children: f
|
|
530
582
|
}
|
|
531
583
|
);
|
|
532
584
|
};
|
|
533
585
|
export {
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
586
|
+
Ee as Badge,
|
|
587
|
+
le as Button,
|
|
588
|
+
je as Input,
|
|
589
|
+
ge as Label
|
|
538
590
|
};
|