shekel-fe-shared-lib 1.0.7 → 1.0.9
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.cjs +29 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +1168 -550
- package/dist/index.mjs.map +1 -1
- package/dist/types/components/Badge.d.ts +7 -2
- package/dist/types/components/Button.d.ts +9 -2
- package/dist/types/components/Card.d.ts +5 -2
- package/dist/types/components/Checkbox.d.ts +6 -2
- package/dist/types/components/Dropdown.d.ts +7 -1
- package/dist/types/components/Modal.d.ts +8 -0
- package/dist/types/components/Progress.d.ts +6 -1
- package/dist/types/components/SearchInput.d.ts +10 -2
- package/dist/types/components/Select.d.ts +10 -2
- package/dist/types/components/SelectedItemsList.d.ts +10 -1
- package/dist/types/components/StatCard.d.ts +12 -1
- package/dist/types/components/Steps.d.ts +8 -2
- package/dist/types/components/Table.d.ts +10 -2
- package/dist/types/components/TableTop.d.ts +9 -1
- package/package.json +1 -1
- package/dist/shekel-fe-shared-lib.css +0 -1
package/dist/index.mjs
CHANGED
|
@@ -1,28 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useState as R, useRef as U, useEffect as V } from "react";
|
|
3
|
+
const ee = ({
|
|
4
4
|
variant: s = "primary",
|
|
5
5
|
size: a = "md",
|
|
6
|
-
fullWidth:
|
|
6
|
+
fullWidth: n = !1,
|
|
7
7
|
icon: t,
|
|
8
8
|
iconPosition: c = "left",
|
|
9
|
-
loading:
|
|
10
|
-
hoverColor:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
loading: u = !1,
|
|
10
|
+
hoverColor: $,
|
|
11
|
+
bgColor: i,
|
|
12
|
+
textColor: o,
|
|
13
|
+
borderColor: m,
|
|
14
|
+
hoverBgColor: g,
|
|
15
|
+
hoverTextColor: x,
|
|
16
|
+
rounded: b = "lg",
|
|
17
|
+
style: h,
|
|
18
|
+
className: r = "",
|
|
19
|
+
children: w,
|
|
20
|
+
disabled: d,
|
|
21
|
+
...y
|
|
15
22
|
}) => {
|
|
16
|
-
const
|
|
23
|
+
const l = "inline-flex items-center justify-center font-normal transition-all duration-300 ease-out focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed active:scale-95", f = {
|
|
17
24
|
primary: "bg-[#EC615B] hover:bg-[#D4554F] text-white focus:ring-[#EC615B] shadow-sm hover:shadow-md",
|
|
18
25
|
outlined: "border border-gray-300 bg-white hover:bg-gray-50 text-[#181918] focus:ring-gray-300",
|
|
19
26
|
ghost: "bg-gray-100 hover:bg-gray-200 text-[#181918] focus:ring-gray-300",
|
|
20
27
|
text: "text-[#181918] hover:bg-gray-100 focus:ring-gray-300"
|
|
21
|
-
},
|
|
28
|
+
}, N = {
|
|
22
29
|
sm: "px-3 py-1.5 text-sm gap-1.5",
|
|
23
30
|
md: "px-4 py-2 text-base gap-2",
|
|
24
|
-
lg: "px-6 py-3 text-lg gap-2.5"
|
|
25
|
-
|
|
31
|
+
lg: "px-6 py-3 text-lg gap-2.5",
|
|
32
|
+
responsive: "px-2 py-1 text-xs sm:px-3 sm:py-1.5 sm:text-sm md:px-4 md:py-2 md:text-base lg:px-6 lg:py-3 lg:text-lg gap-1 sm:gap-1.5 md:gap-2 lg:gap-2.5"
|
|
33
|
+
}, p = {
|
|
34
|
+
none: "rounded-none",
|
|
35
|
+
sm: "rounded-sm",
|
|
36
|
+
md: "rounded-md",
|
|
37
|
+
lg: "rounded-lg",
|
|
38
|
+
full: "rounded-full"
|
|
39
|
+
}, B = n ? "w-full" : "";
|
|
40
|
+
let k = f[s];
|
|
41
|
+
(i || o || m) && (k = "");
|
|
42
|
+
const T = `${l} ${k} ${N[a]} ${p[b]} ${B} ${r}`, P = () => u ? /* @__PURE__ */ C(
|
|
26
43
|
"svg",
|
|
27
44
|
{
|
|
28
45
|
className: "animate-spin h-4 w-4",
|
|
@@ -51,65 +68,169 @@ const D = ({
|
|
|
51
68
|
)
|
|
52
69
|
]
|
|
53
70
|
}
|
|
54
|
-
) : t
|
|
55
|
-
|
|
71
|
+
) : t, L = {
|
|
72
|
+
...h
|
|
73
|
+
};
|
|
74
|
+
return i && (L.backgroundColor = i), o && (L.color = o), m && (L.borderColor = m), /* @__PURE__ */ C(
|
|
56
75
|
"button",
|
|
57
76
|
{
|
|
58
|
-
className:
|
|
59
|
-
disabled:
|
|
60
|
-
style:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
onMouseEnter: (N) => {
|
|
64
|
-
i && !m && !d && (N.currentTarget.style.backgroundColor = i);
|
|
77
|
+
className: T,
|
|
78
|
+
disabled: d || u,
|
|
79
|
+
style: L,
|
|
80
|
+
onMouseEnter: (M) => {
|
|
81
|
+
!d && !u && (g ? M.currentTarget.style.backgroundColor = g : $ && (M.currentTarget.style.backgroundColor = $), x && (M.currentTarget.style.color = x));
|
|
65
82
|
},
|
|
66
|
-
onMouseLeave: (
|
|
67
|
-
|
|
83
|
+
onMouseLeave: (M) => {
|
|
84
|
+
!d && !u && ((i || g || $) && (M.currentTarget.style.backgroundColor = i || ""), (o || x) && (M.currentTarget.style.color = o || ""));
|
|
68
85
|
},
|
|
69
|
-
...
|
|
86
|
+
...y,
|
|
70
87
|
children: [
|
|
71
|
-
c === "left" &&
|
|
72
|
-
|
|
73
|
-
c === "right" &&
|
|
88
|
+
c === "left" && P(),
|
|
89
|
+
w,
|
|
90
|
+
c === "right" && P()
|
|
74
91
|
]
|
|
75
92
|
}
|
|
76
93
|
);
|
|
77
|
-
},
|
|
94
|
+
}, te = ({
|
|
78
95
|
label: s,
|
|
79
96
|
value: a,
|
|
80
|
-
selected:
|
|
97
|
+
selected: n = !1,
|
|
81
98
|
onClick: t,
|
|
82
|
-
className: c = ""
|
|
99
|
+
className: c = "",
|
|
100
|
+
size: u = "responsive",
|
|
101
|
+
rounded: $ = "md",
|
|
102
|
+
bgColor: i,
|
|
103
|
+
borderColor: o,
|
|
104
|
+
labelColor: m,
|
|
105
|
+
valueColor: g,
|
|
106
|
+
selectedBgColor: x,
|
|
107
|
+
selectedBorderColor: b,
|
|
108
|
+
selectedLabelColor: h,
|
|
109
|
+
selectedValueColor: r,
|
|
110
|
+
style: w
|
|
83
111
|
}) => {
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
112
|
+
const d = () => {
|
|
113
|
+
switch (u) {
|
|
114
|
+
case "sm":
|
|
115
|
+
return "p-2 sm:p-3";
|
|
116
|
+
case "md":
|
|
117
|
+
return "p-3 sm:p-4";
|
|
118
|
+
case "lg":
|
|
119
|
+
return "p-4 sm:p-6";
|
|
120
|
+
case "responsive":
|
|
121
|
+
return "p-3 sm:p-4 md:p-5 lg:p-6";
|
|
122
|
+
default:
|
|
123
|
+
return "p-4";
|
|
124
|
+
}
|
|
125
|
+
}, y = () => {
|
|
126
|
+
switch ($) {
|
|
127
|
+
case "none":
|
|
128
|
+
return "rounded-none";
|
|
129
|
+
case "sm":
|
|
130
|
+
return "rounded-sm";
|
|
131
|
+
case "md":
|
|
132
|
+
return "rounded-md";
|
|
133
|
+
case "lg":
|
|
134
|
+
return "rounded-lg";
|
|
135
|
+
case "xl":
|
|
136
|
+
return "rounded-xl";
|
|
137
|
+
case "full":
|
|
138
|
+
return "rounded-full";
|
|
139
|
+
default:
|
|
140
|
+
return "rounded-md";
|
|
141
|
+
}
|
|
142
|
+
}, l = () => {
|
|
143
|
+
switch (u) {
|
|
144
|
+
case "sm":
|
|
145
|
+
return "text-xs sm:text-xs";
|
|
146
|
+
case "md":
|
|
147
|
+
return "text-sm sm:text-base";
|
|
148
|
+
case "lg":
|
|
149
|
+
return "text-base sm:text-lg";
|
|
150
|
+
case "responsive":
|
|
151
|
+
return "text-xs sm:text-sm md:text-base lg:text-lg";
|
|
152
|
+
default:
|
|
153
|
+
return "text-xs sm:text-sm md:text-base";
|
|
154
|
+
}
|
|
155
|
+
}, f = () => {
|
|
156
|
+
switch (u) {
|
|
157
|
+
case "sm":
|
|
158
|
+
return "text-lg sm:text-xl";
|
|
159
|
+
case "md":
|
|
160
|
+
return "text-2xl sm:text-3xl";
|
|
161
|
+
case "lg":
|
|
162
|
+
return "text-4xl sm:text-5xl";
|
|
163
|
+
case "responsive":
|
|
164
|
+
return "text-2xl sm:text-3xl md:text-4xl lg:text-5xl";
|
|
165
|
+
default:
|
|
166
|
+
return "text-3xl";
|
|
167
|
+
}
|
|
168
|
+
}, P = `${`stat-card relative flex flex-col ${d()} ${y()} border transition-all duration-500 ease-in-out cursor-pointer overflow-hidden`} ${n ? "border-[#181918] bg-[#F4F4F4] shadow-sm scale-[1.02]" : `${o ? "" : "border-gray-200"} ${i ? "" : "bg-white"} ${!i && !o ? "hover:border-gray-300 hover:shadow-sm" : ""}`} ${c}`, L = {
|
|
169
|
+
...w
|
|
170
|
+
};
|
|
171
|
+
return n && x ? L.backgroundColor = x : !n && i && (L.backgroundColor = i), n && b ? L.borderColor = b : !n && o && (L.borderColor = o), /* @__PURE__ */ C("div", { className: P, onClick: t, style: L, children: [
|
|
172
|
+
n && /* @__PURE__ */ e("div", { className: "absolute inset-0 bg-gradient-to-r from-transparent via-[#EC615B]/5 to-transparent animate-slide-in pointer-events-none" }),
|
|
173
|
+
/* @__PURE__ */ C("div", { className: "relative z-10 transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]", children: [
|
|
174
|
+
/* @__PURE__ */ e(
|
|
175
|
+
"span",
|
|
176
|
+
{
|
|
177
|
+
className: `${l()} font-normal mb-2 block transition-colors duration-500 ${n ? "text-gray-700" : "text-gray-600"}`,
|
|
178
|
+
style: n && h ? { color: h } : !n && m ? { color: m } : void 0,
|
|
179
|
+
children: s
|
|
180
|
+
}
|
|
181
|
+
),
|
|
182
|
+
/* @__PURE__ */ e(
|
|
183
|
+
"span",
|
|
184
|
+
{
|
|
185
|
+
className: `${f()} font-semibold stat-value block transition-all duration-500 ${n ? "text-[#181918] scale-105" : "text-[#181918]"}`,
|
|
186
|
+
style: n && r ? { color: r } : !n && g ? { color: g } : void 0,
|
|
187
|
+
children: a
|
|
188
|
+
}
|
|
189
|
+
)
|
|
90
190
|
] })
|
|
91
191
|
] });
|
|
92
|
-
},
|
|
192
|
+
}, se = ({
|
|
93
193
|
icon: s,
|
|
94
194
|
iconPosition: a = "left",
|
|
95
|
-
size:
|
|
195
|
+
size: n = "md",
|
|
96
196
|
fullWidth: t = !1,
|
|
97
197
|
className: c = "",
|
|
98
|
-
onIconClick:
|
|
99
|
-
|
|
198
|
+
onIconClick: u,
|
|
199
|
+
bgColor: $,
|
|
200
|
+
borderColor: i,
|
|
201
|
+
focusBorderColor: o,
|
|
202
|
+
iconColor: m,
|
|
203
|
+
textColor: g,
|
|
204
|
+
placeholderColor: x,
|
|
205
|
+
rounded: b = "md",
|
|
206
|
+
style: h,
|
|
207
|
+
...r
|
|
100
208
|
}) => {
|
|
101
|
-
const
|
|
209
|
+
const w = "relative inline-flex items-center", d = "border focus:outline-none focus:ring-1 transition-all duration-200 ease-in-out", y = {
|
|
102
210
|
sm: "px-3 py-1.5 text-sm",
|
|
103
211
|
md: "px-4 py-2 text-base",
|
|
104
|
-
lg: "px-5 py-3 text-lg"
|
|
105
|
-
|
|
212
|
+
lg: "px-5 py-3 text-lg",
|
|
213
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"
|
|
214
|
+
}, l = {
|
|
106
215
|
sm: "w-4 h-4",
|
|
107
216
|
md: "w-5 h-5",
|
|
108
|
-
lg: "w-6 h-6"
|
|
109
|
-
|
|
217
|
+
lg: "w-6 h-6",
|
|
218
|
+
responsive: "w-4 sm:w-5 md:w-6 h-4 sm:h-5 md:h-6"
|
|
219
|
+
}, f = {
|
|
220
|
+
none: "rounded-none",
|
|
221
|
+
sm: "rounded-sm",
|
|
222
|
+
md: "rounded-lg",
|
|
223
|
+
lg: "rounded-xl",
|
|
224
|
+
full: "rounded-full"
|
|
225
|
+
}, N = a === "left" ? n === "sm" ? "pl-9" : n === "md" ? "pl-10" : n === "lg" ? "pl-12" : "pl-9 sm:pl-10 md:pl-12" : n === "sm" ? "pr-9" : n === "md" ? "pr-10" : n === "lg" ? "pr-12" : "pr-9 sm:pr-10 md:pr-12", p = t ? "w-full" : "", B = {
|
|
226
|
+
backgroundColor: $,
|
|
227
|
+
borderColor: i || "#D1D5DB",
|
|
228
|
+
color: g,
|
|
229
|
+
...h
|
|
230
|
+
}, k = x ? "" : "placeholder:text-gray-400", T = i ? "" : "border-gray-300", P = g ? "" : "text-gray-900", L = o ? "" : "focus:ring-[#EC615B] focus:border-[#EC615B]", M = `${d} ${y[n]} ${s ? N : ""} ${p} ${f[b]} ${T} ${P} ${L} ${k} ${c}`, F = a === "left" ? "left-3" : "right-3", j = m || "text-gray-400", S = m ? "" : "hover:text-gray-600", E = /* @__PURE__ */ e(
|
|
110
231
|
"svg",
|
|
111
232
|
{
|
|
112
|
-
className:
|
|
233
|
+
className: `${l[n]} ${j}`,
|
|
113
234
|
xmlns: "http://www.w3.org/2000/svg",
|
|
114
235
|
fill: "none",
|
|
115
236
|
viewBox: "0 0 24 24",
|
|
@@ -125,337 +246,544 @@ const D = ({
|
|
|
125
246
|
)
|
|
126
247
|
}
|
|
127
248
|
);
|
|
128
|
-
return /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ C("div", { className: `${w} ${p}`, children: [
|
|
129
250
|
s && /* @__PURE__ */ e(
|
|
130
251
|
"div",
|
|
131
252
|
{
|
|
132
|
-
className: `absolute ${
|
|
133
|
-
onClick:
|
|
134
|
-
children: s === !0 ?
|
|
253
|
+
className: `absolute ${F} ${j} ${u ? "cursor-pointer" : ""} ${S}`,
|
|
254
|
+
onClick: u,
|
|
255
|
+
children: s === !0 ? E : s
|
|
135
256
|
}
|
|
136
257
|
),
|
|
137
|
-
/* @__PURE__ */ e(
|
|
258
|
+
/* @__PURE__ */ e(
|
|
259
|
+
"input",
|
|
260
|
+
{
|
|
261
|
+
type: "text",
|
|
262
|
+
className: M,
|
|
263
|
+
style: {
|
|
264
|
+
...B,
|
|
265
|
+
...o && {
|
|
266
|
+
"--focus-border-color": o
|
|
267
|
+
},
|
|
268
|
+
...x && {
|
|
269
|
+
"--placeholder-color": x
|
|
270
|
+
}
|
|
271
|
+
},
|
|
272
|
+
...r
|
|
273
|
+
}
|
|
274
|
+
)
|
|
138
275
|
] });
|
|
139
|
-
},
|
|
276
|
+
}, re = ({
|
|
140
277
|
padding: s = "md",
|
|
141
278
|
shadow: a = "sm",
|
|
142
|
-
hover:
|
|
279
|
+
hover: n = !1,
|
|
143
280
|
bordered: t = !0,
|
|
144
281
|
rounded: c = "lg",
|
|
145
|
-
className:
|
|
146
|
-
|
|
282
|
+
className: u = "",
|
|
283
|
+
bgColor: $,
|
|
284
|
+
borderColor: i,
|
|
285
|
+
style: o,
|
|
286
|
+
children: m,
|
|
147
287
|
...g
|
|
148
288
|
}) => {
|
|
149
|
-
const
|
|
289
|
+
const x = "card transition-all duration-300 ease-out", b = {
|
|
150
290
|
none: "p-0",
|
|
151
291
|
sm: "p-3",
|
|
152
292
|
md: "p-4",
|
|
153
|
-
lg: "p-6"
|
|
154
|
-
|
|
293
|
+
lg: "p-6",
|
|
294
|
+
responsive: "p-2 sm:p-3 md:p-4 lg:p-6"
|
|
295
|
+
}, h = {
|
|
155
296
|
none: "",
|
|
156
297
|
sm: "shadow-sm",
|
|
157
298
|
md: "shadow-md",
|
|
158
299
|
lg: "shadow-lg"
|
|
159
|
-
},
|
|
300
|
+
}, r = {
|
|
160
301
|
none: "rounded-none",
|
|
161
302
|
sm: "rounded-sm",
|
|
162
303
|
md: "rounded-md",
|
|
163
304
|
lg: "rounded-lg",
|
|
164
305
|
xl: "rounded-xl"
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
306
|
+
}, w = t ? `border ${i || "border-gray-200"}` : "", d = n ? "cursor-pointer" : "", l = `${x} ${$ ? "" : "bg-white"} ${b[s]} ${h[a]} ${r[c]} ${w} ${d} ${u}`, f = {
|
|
307
|
+
...$ && { backgroundColor: $ },
|
|
308
|
+
...o
|
|
309
|
+
};
|
|
310
|
+
return /* @__PURE__ */ e("div", { className: l, style: f, ...g, children: /* @__PURE__ */ e("div", { className: n ? "transition-transform duration-300 ease-out hover:scale-[0.98] active:scale-[0.96]" : "", children: m }) });
|
|
311
|
+
}, ne = ({
|
|
168
312
|
items: s,
|
|
169
313
|
trigger: a = "click",
|
|
170
|
-
placement:
|
|
314
|
+
placement: n = "bottomLeft",
|
|
171
315
|
children: t,
|
|
172
316
|
className: c = "",
|
|
173
|
-
overlayClassName:
|
|
174
|
-
disabled:
|
|
317
|
+
overlayClassName: u = "",
|
|
318
|
+
disabled: $ = !1,
|
|
319
|
+
size: i = "md",
|
|
320
|
+
menuBgColor: o,
|
|
321
|
+
menuItemHoverColor: m,
|
|
322
|
+
dangerColor: g,
|
|
323
|
+
borderColor: x,
|
|
324
|
+
style: b
|
|
175
325
|
}) => {
|
|
176
|
-
const [
|
|
177
|
-
|
|
178
|
-
const
|
|
179
|
-
|
|
326
|
+
const [h, r] = R(!1), w = U(null);
|
|
327
|
+
V(() => {
|
|
328
|
+
const z = (I) => {
|
|
329
|
+
w.current && !w.current.contains(I.target) && r(!1);
|
|
180
330
|
};
|
|
181
|
-
return
|
|
182
|
-
document.removeEventListener("mousedown",
|
|
331
|
+
return h && document.addEventListener("mousedown", z), () => {
|
|
332
|
+
document.removeEventListener("mousedown", z);
|
|
183
333
|
};
|
|
184
|
-
}, [
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
|
|
334
|
+
}, [h]);
|
|
335
|
+
const d = () => {
|
|
336
|
+
!$ && a === "click" && r(!h);
|
|
337
|
+
}, y = () => {
|
|
338
|
+
!$ && a === "hover" && r(!0);
|
|
189
339
|
}, l = () => {
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
!
|
|
193
|
-
},
|
|
340
|
+
!$ && a === "hover" && r(!1);
|
|
341
|
+
}, f = (z) => {
|
|
342
|
+
!z.disabled && z.onClick && z.onClick(), r(!1);
|
|
343
|
+
}, N = {
|
|
194
344
|
bottomLeft: "top-full left-0 mt-1",
|
|
195
345
|
bottomRight: "top-full right-0 mt-1",
|
|
196
346
|
topLeft: "bottom-full left-0 mb-1",
|
|
197
347
|
topRight: "bottom-full right-0 mb-1"
|
|
198
|
-
},
|
|
199
|
-
|
|
348
|
+
}, p = n.startsWith("bottom") ? "dropdown-slide-down" : "dropdown-slide-up", B = {
|
|
349
|
+
sm: "min-w-[120px] text-xs",
|
|
350
|
+
md: "min-w-[160px] text-sm",
|
|
351
|
+
lg: "min-w-[220px] text-base",
|
|
352
|
+
responsive: "min-w-[120px] sm:min-w-[160px] md:min-w-[200px] lg:min-w-[240px] text-xs sm:text-sm md:text-base"
|
|
353
|
+
}, k = {
|
|
354
|
+
sm: "px-3 py-1.5 text-xs gap-1.5",
|
|
355
|
+
md: "px-4 py-2 text-sm gap-2",
|
|
356
|
+
lg: "px-5 py-3 text-base gap-2.5",
|
|
357
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-xs sm:text-sm md:text-base gap-1.5 sm:gap-2 md:gap-2.5"
|
|
358
|
+
}, T = "hover:bg-gray-50", P = "border-gray-200", L = "text-red-600", M = m ? { backgroundColor: m } : {}, F = m ? "" : T, j = g ? { color: g } : {}, S = g ? { backgroundColor: g + "15" } : {}, E = x || P;
|
|
359
|
+
return /* @__PURE__ */ C(
|
|
200
360
|
"div",
|
|
201
361
|
{
|
|
202
|
-
ref:
|
|
362
|
+
ref: w,
|
|
203
363
|
className: `relative inline-block ${c}`,
|
|
204
|
-
onMouseEnter:
|
|
364
|
+
onMouseEnter: y,
|
|
205
365
|
onMouseLeave: l,
|
|
366
|
+
style: b,
|
|
206
367
|
children: [
|
|
207
368
|
/* @__PURE__ */ e(
|
|
208
369
|
"div",
|
|
209
370
|
{
|
|
210
|
-
onClick:
|
|
211
|
-
className: `inline-flex ${
|
|
371
|
+
onClick: d,
|
|
372
|
+
className: `inline-flex ${$ ? "cursor-not-allowed opacity-50" : "cursor-pointer"}`,
|
|
212
373
|
children: t
|
|
213
374
|
}
|
|
214
375
|
),
|
|
215
|
-
|
|
376
|
+
h && !$ && /* @__PURE__ */ e(
|
|
216
377
|
"div",
|
|
217
378
|
{
|
|
218
|
-
className: `absolute ${
|
|
219
|
-
children: /* @__PURE__ */ e(
|
|
379
|
+
className: `absolute ${N[n]} ${p} z-50 ${B[i]} ${u}`,
|
|
380
|
+
children: /* @__PURE__ */ e(
|
|
220
381
|
"div",
|
|
221
382
|
{
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
383
|
+
className: `dropdown-menu rounded-lg shadow-lg border py-1 overflow-hidden ${E}`,
|
|
384
|
+
style: { backgroundColor: o || "#ffffff" },
|
|
385
|
+
children: s.map((z) => {
|
|
386
|
+
let I = {};
|
|
387
|
+
return z.disabled || (z.danger ? I = {
|
|
388
|
+
...j,
|
|
389
|
+
...S
|
|
390
|
+
} : m && (I = M)), /* @__PURE__ */ C(
|
|
391
|
+
"div",
|
|
392
|
+
{
|
|
393
|
+
onClick: () => f(z),
|
|
394
|
+
className: `
|
|
395
|
+
dropdown-menu-item
|
|
396
|
+
flex items-center cursor-pointer transition-all duration-200 ease-out
|
|
397
|
+
${k[i]}
|
|
398
|
+
${z.disabled ? "opacity-50 cursor-not-allowed" : F}
|
|
399
|
+
${z.danger ? g ? "" : L : "text-gray-700"}
|
|
400
|
+
`,
|
|
401
|
+
style: I,
|
|
402
|
+
children: [
|
|
403
|
+
z.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: z.icon }),
|
|
404
|
+
/* @__PURE__ */ e("span", { children: z.label })
|
|
405
|
+
]
|
|
406
|
+
},
|
|
407
|
+
z.key
|
|
408
|
+
);
|
|
409
|
+
})
|
|
410
|
+
}
|
|
411
|
+
)
|
|
236
412
|
}
|
|
237
413
|
)
|
|
238
414
|
]
|
|
239
415
|
}
|
|
240
416
|
);
|
|
241
|
-
},
|
|
417
|
+
}, G = ({
|
|
242
418
|
options: s,
|
|
243
419
|
value: a,
|
|
244
|
-
defaultValue:
|
|
420
|
+
defaultValue: n,
|
|
245
421
|
placeholder: t = "Select an option",
|
|
246
422
|
onChange: c,
|
|
247
|
-
disabled:
|
|
248
|
-
size:
|
|
249
|
-
fullWidth:
|
|
250
|
-
className:
|
|
423
|
+
disabled: u = !1,
|
|
424
|
+
size: $ = "md",
|
|
425
|
+
fullWidth: i = !1,
|
|
426
|
+
className: o = "",
|
|
251
427
|
allowClear: m = !1,
|
|
252
|
-
showSearch:
|
|
253
|
-
searchPlaceholder:
|
|
428
|
+
showSearch: g = !1,
|
|
429
|
+
searchPlaceholder: x = "Search...",
|
|
430
|
+
bgColor: b,
|
|
431
|
+
borderColor: h,
|
|
432
|
+
focusBorderColor: r = "#EC615B",
|
|
433
|
+
selectedBgColor: w,
|
|
434
|
+
selectedTextColor: d,
|
|
435
|
+
hoverBgColor: y,
|
|
436
|
+
rounded: l = "lg",
|
|
437
|
+
style: f
|
|
254
438
|
}) => {
|
|
255
|
-
const [
|
|
256
|
-
|
|
257
|
-
), [
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
|
|
439
|
+
const [N, p] = R(!1), [B, k] = R(
|
|
440
|
+
n
|
|
441
|
+
), [T, P] = R(""), L = U(null), M = U(null), F = a !== void 0 ? a : B;
|
|
442
|
+
V(() => {
|
|
443
|
+
const v = (O) => {
|
|
444
|
+
L.current && !L.current.contains(O.target) && (p(!1), P(""));
|
|
261
445
|
};
|
|
262
|
-
return
|
|
263
|
-
document.removeEventListener("mousedown",
|
|
446
|
+
return N && (document.addEventListener("mousedown", v), g && M.current && M.current.focus()), () => {
|
|
447
|
+
document.removeEventListener("mousedown", v);
|
|
264
448
|
};
|
|
265
|
-
}, [
|
|
266
|
-
const
|
|
267
|
-
a === void 0 &&
|
|
268
|
-
},
|
|
269
|
-
|
|
270
|
-
},
|
|
271
|
-
(
|
|
272
|
-
) : s,
|
|
449
|
+
}, [N, g]);
|
|
450
|
+
const j = (v) => {
|
|
451
|
+
a === void 0 && k(v), c == null || c(v), p(!1), P("");
|
|
452
|
+
}, S = (v) => {
|
|
453
|
+
v.stopPropagation(), a === void 0 && k(void 0), c == null || c("");
|
|
454
|
+
}, E = s.find((v) => v.value === F), z = g ? s.filter(
|
|
455
|
+
(v) => v.label.toLowerCase().includes(T.toLowerCase())
|
|
456
|
+
) : s, I = {
|
|
273
457
|
sm: "px-3 py-1.5 text-sm",
|
|
274
458
|
md: "px-4 py-2 text-base",
|
|
275
|
-
lg: "px-5 py-3 text-lg"
|
|
276
|
-
|
|
459
|
+
lg: "px-5 py-3 text-lg",
|
|
460
|
+
responsive: "px-3 sm:px-4 md:px-5 py-1.5 sm:py-2 md:py-3 text-sm sm:text-base md:text-lg"
|
|
461
|
+
}, A = {
|
|
462
|
+
none: "rounded-none",
|
|
463
|
+
sm: "rounded-sm",
|
|
464
|
+
md: "rounded-md",
|
|
465
|
+
lg: "rounded-lg",
|
|
466
|
+
full: "rounded-full"
|
|
467
|
+
}, W = i ? "w-full" : "min-w-[200px]", D = () => {
|
|
468
|
+
const v = {};
|
|
469
|
+
return b && (v.backgroundColor = b), h && (v.borderColor = h), v;
|
|
470
|
+
}, H = () => {
|
|
471
|
+
const v = {};
|
|
472
|
+
return w && (v.backgroundColor = w), d && (v.color = d), v;
|
|
473
|
+
}, Q = /* @__PURE__ */ e(
|
|
277
474
|
"svg",
|
|
278
475
|
{
|
|
279
|
-
className: `w-4 h-4 transition-transform duration-200 ease-out ${
|
|
476
|
+
className: `w-4 h-4 transition-transform duration-200 ease-out ${N ? "rotate-180" : ""}`,
|
|
280
477
|
fill: "none",
|
|
281
478
|
stroke: "currentColor",
|
|
282
479
|
viewBox: "0 0 24 24",
|
|
283
480
|
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M19 9l-7 7-7-7" })
|
|
284
481
|
}
|
|
285
|
-
),
|
|
286
|
-
return /* @__PURE__ */
|
|
287
|
-
/* @__PURE__ */
|
|
482
|
+
), q = /* @__PURE__ */ e("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) });
|
|
483
|
+
return /* @__PURE__ */ C("div", { ref: L, className: `relative inline-block ${W} ${o}`, style: f, children: [
|
|
484
|
+
/* @__PURE__ */ C(
|
|
288
485
|
"div",
|
|
289
486
|
{
|
|
290
|
-
onClick: () => !
|
|
487
|
+
onClick: () => !u && p(!N),
|
|
291
488
|
className: `
|
|
292
489
|
select-trigger
|
|
293
490
|
flex items-center justify-between gap-2
|
|
294
|
-
border
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
${
|
|
298
|
-
${
|
|
299
|
-
${l ? "border-[#EC615B] ring-2 ring-[#EC615B] ring-opacity-20" : ""}
|
|
491
|
+
border transition-all duration-200 ease-out
|
|
492
|
+
${I[$]}
|
|
493
|
+
${A[l]}
|
|
494
|
+
${u ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
495
|
+
${N ? "ring-2 ring-opacity-20" : ""}
|
|
300
496
|
`,
|
|
497
|
+
style: {
|
|
498
|
+
...D(),
|
|
499
|
+
backgroundColor: b || D().backgroundColor || "#FFFFFF",
|
|
500
|
+
borderColor: h || D().borderColor || "#D1D5DB",
|
|
501
|
+
...N && {
|
|
502
|
+
borderColor: r,
|
|
503
|
+
boxShadow: `0 0 0 2px ${r}20`
|
|
504
|
+
},
|
|
505
|
+
...!u && !N && y && {
|
|
506
|
+
cursor: "pointer"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
onMouseEnter: (v) => {
|
|
510
|
+
!u && y && (v.currentTarget.style.backgroundColor = y);
|
|
511
|
+
},
|
|
512
|
+
onMouseLeave: (v) => {
|
|
513
|
+
b ? v.currentTarget.style.backgroundColor = b : v.currentTarget.style.backgroundColor = "#FFFFFF";
|
|
514
|
+
},
|
|
301
515
|
children: [
|
|
302
|
-
/* @__PURE__ */ e("span", { className:
|
|
303
|
-
/* @__PURE__ */
|
|
304
|
-
m &&
|
|
516
|
+
/* @__PURE__ */ e("span", { className: E ? "text-gray-900" : "text-gray-400", children: E ? E.label : t }),
|
|
517
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
518
|
+
m && F && !u && /* @__PURE__ */ e(
|
|
305
519
|
"span",
|
|
306
520
|
{
|
|
307
|
-
onClick:
|
|
521
|
+
onClick: S,
|
|
308
522
|
className: "text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",
|
|
309
|
-
children:
|
|
523
|
+
children: q
|
|
310
524
|
}
|
|
311
525
|
),
|
|
312
|
-
/* @__PURE__ */ e("span", { className: "text-gray-400", children:
|
|
526
|
+
/* @__PURE__ */ e("span", { className: "text-gray-400", children: Q })
|
|
313
527
|
] })
|
|
314
528
|
]
|
|
315
529
|
}
|
|
316
530
|
),
|
|
317
|
-
|
|
318
|
-
|
|
531
|
+
N && !u && /* @__PURE__ */ e("div", { className: "absolute top-full left-0 right-0 mt-1 z-50 dropdown-slide-down", children: /* @__PURE__ */ C("div", { className: `select-dropdown bg-white shadow-lg border border-gray-200 py-1 max-h-[300px] overflow-auto ${A[l]}`, children: [
|
|
532
|
+
g && /* @__PURE__ */ e("div", { className: "px-2 py-2 border-b border-gray-200", children: /* @__PURE__ */ e(
|
|
319
533
|
"input",
|
|
320
534
|
{
|
|
321
|
-
ref:
|
|
535
|
+
ref: M,
|
|
322
536
|
type: "text",
|
|
323
|
-
value:
|
|
324
|
-
onChange: (
|
|
325
|
-
placeholder:
|
|
326
|
-
className: "w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2
|
|
327
|
-
|
|
537
|
+
value: T,
|
|
538
|
+
onChange: (v) => P(v.target.value),
|
|
539
|
+
placeholder: x,
|
|
540
|
+
className: "w-full px-3 py-1.5 text-sm border border-gray-300 rounded focus:outline-none focus:ring-2 transition-all duration-200 ease-out",
|
|
541
|
+
style: {
|
|
542
|
+
borderColor: h,
|
|
543
|
+
boxShadow: `0 0 0 2px ${r}20`
|
|
544
|
+
},
|
|
545
|
+
onClick: (v) => v.stopPropagation()
|
|
328
546
|
}
|
|
329
547
|
) }),
|
|
330
|
-
|
|
548
|
+
z.length === 0 ? /* @__PURE__ */ e("div", { className: "px-4 py-3 text-sm text-gray-500 text-center", children: "No results found" }) : z.map((v) => /* @__PURE__ */ e(
|
|
331
549
|
"div",
|
|
332
550
|
{
|
|
333
|
-
onClick: () => !
|
|
551
|
+
onClick: () => !v.disabled && j(v.value),
|
|
334
552
|
className: `
|
|
335
553
|
select-option
|
|
336
|
-
px-4 py-2 text-sm
|
|
337
|
-
${
|
|
338
|
-
${y.value === C ? "bg-[#FCEAE9] text-[#EC615B] font-medium" : "text-[#181918]"}
|
|
554
|
+
px-4 py-2 text-sm transition-all duration-200 ease-out
|
|
555
|
+
${v.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer"}
|
|
339
556
|
`,
|
|
340
|
-
|
|
557
|
+
style: {
|
|
558
|
+
...v.value === F ? H() : {},
|
|
559
|
+
backgroundColor: v.value === F ? w || "#FCEAE9" : void 0,
|
|
560
|
+
color: v.value === F ? d || "#EC615B" : "#181918",
|
|
561
|
+
fontWeight: v.value === F ? "medium" : void 0
|
|
562
|
+
},
|
|
563
|
+
onMouseEnter: (O) => {
|
|
564
|
+
!v.disabled && v.value !== F && (O.currentTarget.style.backgroundColor = y || "#F3F4F6");
|
|
565
|
+
},
|
|
566
|
+
onMouseLeave: (O) => {
|
|
567
|
+
v.value !== F && (O.currentTarget.style.backgroundColor = "transparent");
|
|
568
|
+
},
|
|
569
|
+
children: v.label
|
|
341
570
|
},
|
|
342
|
-
|
|
571
|
+
v.value
|
|
343
572
|
))
|
|
344
573
|
] }) })
|
|
345
574
|
] });
|
|
346
|
-
},
|
|
575
|
+
}, le = ({
|
|
347
576
|
columns: s,
|
|
348
577
|
dataSource: a,
|
|
349
|
-
rowKey:
|
|
578
|
+
rowKey: n = "id",
|
|
350
579
|
pagination: t,
|
|
351
580
|
loading: c = !1,
|
|
352
|
-
onRow:
|
|
353
|
-
className:
|
|
354
|
-
bordered:
|
|
355
|
-
striped:
|
|
581
|
+
onRow: u,
|
|
582
|
+
className: $ = "",
|
|
583
|
+
bordered: i = !1,
|
|
584
|
+
striped: o = !1,
|
|
585
|
+
size: m = "md",
|
|
586
|
+
headerBgColor: g,
|
|
587
|
+
headerTextColor: x,
|
|
588
|
+
rowHoverColor: b,
|
|
589
|
+
borderColor: h,
|
|
590
|
+
stripedRowColor: r,
|
|
591
|
+
rounded: w = "md",
|
|
592
|
+
style: d
|
|
356
593
|
}) => {
|
|
357
|
-
const [
|
|
594
|
+
const [y, l] = R(
|
|
358
595
|
t && typeof t == "object" && t.current || 1
|
|
359
|
-
), [
|
|
596
|
+
), [f, N] = R(
|
|
360
597
|
t && typeof t == "object" && t.pageSize || 10
|
|
361
|
-
),
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
598
|
+
), p = {
|
|
599
|
+
sm: {
|
|
600
|
+
headerPadding: "px-3 py-2",
|
|
601
|
+
headerFontSize: "text-xs",
|
|
602
|
+
rowPadding: "px-3 py-2",
|
|
603
|
+
rowFontSize: "text-xs",
|
|
604
|
+
containerRounded: "rounded-md"
|
|
605
|
+
},
|
|
606
|
+
md: {
|
|
607
|
+
headerPadding: "px-4 py-3",
|
|
608
|
+
headerFontSize: "text-xs",
|
|
609
|
+
rowPadding: "px-4 py-3",
|
|
610
|
+
rowFontSize: "text-sm",
|
|
611
|
+
containerRounded: "rounded-lg"
|
|
612
|
+
},
|
|
613
|
+
lg: {
|
|
614
|
+
headerPadding: "px-6 py-4",
|
|
615
|
+
headerFontSize: "text-sm",
|
|
616
|
+
rowPadding: "px-6 py-4",
|
|
617
|
+
rowFontSize: "text-base",
|
|
618
|
+
containerRounded: "rounded-xl"
|
|
619
|
+
},
|
|
620
|
+
responsive: {
|
|
621
|
+
headerPadding: "px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",
|
|
622
|
+
headerFontSize: "text-xs sm:text-xs md:text-sm",
|
|
623
|
+
rowPadding: "px-2 sm:px-3 md:px-4 py-2 sm:py-2.5 md:py-3",
|
|
624
|
+
rowFontSize: "text-xs sm:text-xs md:text-sm",
|
|
625
|
+
containerRounded: "rounded-md sm:rounded-lg md:rounded-lg"
|
|
626
|
+
}
|
|
627
|
+
}, B = {
|
|
628
|
+
none: "",
|
|
629
|
+
sm: "rounded-sm",
|
|
630
|
+
md: "rounded-md",
|
|
631
|
+
lg: "rounded-lg",
|
|
632
|
+
xl: "rounded-xl",
|
|
633
|
+
"2xl": "rounded-2xl"
|
|
634
|
+
}, k = p[m], T = B[w], P = (S, E) => typeof n == "function" ? n(S) : S[n] || String(E), L = (S, E) => E ? E.split(".").reduce((z, I) => z == null ? void 0 : z[I], S) : S, M = t === !1 ? a : a.slice((y - 1) * f, y * f), F = (S) => {
|
|
635
|
+
l(S), t && typeof t == "object" && t.onChange && t.onChange(S, f);
|
|
636
|
+
}, j = (S) => {
|
|
637
|
+
N(S), l(1), t && typeof t == "object" && t.onChange && t.onChange(1, S);
|
|
365
638
|
};
|
|
366
|
-
return /* @__PURE__ */
|
|
367
|
-
/* @__PURE__ */ e(
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
{
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
383
|
-
fill: "none",
|
|
384
|
-
viewBox: "0 0 24 24",
|
|
385
|
-
children: [
|
|
386
|
-
/* @__PURE__ */ e(
|
|
387
|
-
"circle",
|
|
639
|
+
return /* @__PURE__ */ C("div", { className: "w-full", style: d, children: [
|
|
640
|
+
/* @__PURE__ */ e(
|
|
641
|
+
"div",
|
|
642
|
+
{
|
|
643
|
+
className: `overflow-x-auto ${T || "rounded-2xl"} border`,
|
|
644
|
+
style: { borderColor: h || "#EEEEEE" },
|
|
645
|
+
children: /* @__PURE__ */ C("table", { className: `w-full ${i ? "border-collapse" : ""} ${$}`, children: [
|
|
646
|
+
/* @__PURE__ */ e(
|
|
647
|
+
"thead",
|
|
648
|
+
{
|
|
649
|
+
style: {
|
|
650
|
+
backgroundColor: g || "#F5F6F7",
|
|
651
|
+
color: x || "#333333"
|
|
652
|
+
},
|
|
653
|
+
children: /* @__PURE__ */ e("tr", { children: s.map((S, E) => /* @__PURE__ */ e(
|
|
654
|
+
"th",
|
|
388
655
|
{
|
|
389
|
-
className: "
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
656
|
+
className: `${k.headerPadding} text-left ${k.headerFontSize} font-medium uppercase tracking-wider ${i && E !== s.length - 1 ? "border-r" : ""} ${S.align === "center" ? "text-center" : S.align === "right" ? "text-right" : ""}`,
|
|
657
|
+
style: {
|
|
658
|
+
width: S.width,
|
|
659
|
+
borderColor: h || "#EEEEEE",
|
|
660
|
+
color: x || "#333333"
|
|
661
|
+
},
|
|
662
|
+
children: S.title
|
|
663
|
+
},
|
|
664
|
+
S.key
|
|
665
|
+
)) })
|
|
666
|
+
}
|
|
667
|
+
),
|
|
668
|
+
/* @__PURE__ */ e(
|
|
669
|
+
"tbody",
|
|
670
|
+
{
|
|
671
|
+
className: "bg-white divide-y",
|
|
672
|
+
style: { borderColor: h || "#e5e5e5" },
|
|
673
|
+
children: c ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
674
|
+
"td",
|
|
399
675
|
{
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
676
|
+
colSpan: s.length,
|
|
677
|
+
className: `${k.rowPadding} py-8 text-center`,
|
|
678
|
+
style: { color: "#333333" },
|
|
679
|
+
children: /* @__PURE__ */ C("div", { className: "flex justify-center items-center", children: [
|
|
680
|
+
/* @__PURE__ */ C(
|
|
681
|
+
"svg",
|
|
682
|
+
{
|
|
683
|
+
className: "animate-spin h-5 w-5 mr-2",
|
|
684
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
685
|
+
fill: "none",
|
|
686
|
+
viewBox: "0 0 24 24",
|
|
687
|
+
children: [
|
|
688
|
+
/* @__PURE__ */ e(
|
|
689
|
+
"circle",
|
|
690
|
+
{
|
|
691
|
+
className: "opacity-25",
|
|
692
|
+
cx: "12",
|
|
693
|
+
cy: "12",
|
|
694
|
+
r: "10",
|
|
695
|
+
stroke: "currentColor",
|
|
696
|
+
strokeWidth: "4"
|
|
697
|
+
}
|
|
698
|
+
),
|
|
699
|
+
/* @__PURE__ */ e(
|
|
700
|
+
"path",
|
|
701
|
+
{
|
|
702
|
+
className: "opacity-75",
|
|
703
|
+
fill: "currentColor",
|
|
704
|
+
d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"
|
|
705
|
+
}
|
|
706
|
+
)
|
|
707
|
+
]
|
|
708
|
+
}
|
|
709
|
+
),
|
|
710
|
+
"Loading..."
|
|
711
|
+
] })
|
|
403
712
|
}
|
|
404
|
-
)
|
|
405
|
-
]
|
|
406
|
-
}
|
|
407
|
-
),
|
|
408
|
-
"Loading..."
|
|
409
|
-
] }) }) }) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: s.length, className: "px-4 py-8 text-center text-[#333333]", children: "No data" }) }) : b.map((x, w) => {
|
|
410
|
-
const C = d ? d(x, w) : {};
|
|
411
|
-
return /* @__PURE__ */ e(
|
|
412
|
-
"tr",
|
|
413
|
-
{
|
|
414
|
-
className: `${h && w % 2 === 1 ? "bg-[#F5F6F7]" : ""} hover:bg-gray-50 transition-colors duration-200 ease-out`,
|
|
415
|
-
...C,
|
|
416
|
-
children: s.map(($, E) => {
|
|
417
|
-
const L = r(x, $.dataIndex), B = $.render ? $.render(L, x, w) : L;
|
|
418
|
-
return /* @__PURE__ */ e(
|
|
713
|
+
) }) : M.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
419
714
|
"td",
|
|
420
715
|
{
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
716
|
+
colSpan: s.length,
|
|
717
|
+
className: `${k.rowPadding} py-8 text-center`,
|
|
718
|
+
style: { color: "#333333" },
|
|
719
|
+
children: "No data"
|
|
720
|
+
}
|
|
721
|
+
) }) : M.map((S, E) => {
|
|
722
|
+
const z = u ? u(S, E) : {}, I = o && E % 2 === 1 ? r || "#F5F6F7" : "transparent", A = b || "#f3f4f6";
|
|
723
|
+
return /* @__PURE__ */ e(
|
|
724
|
+
"tr",
|
|
725
|
+
{
|
|
726
|
+
className: "transition-colors duration-200 ease-out",
|
|
727
|
+
style: {
|
|
728
|
+
backgroundColor: I
|
|
729
|
+
},
|
|
730
|
+
onMouseEnter: (W) => {
|
|
731
|
+
(b || !o || E % 2 === 0) && (W.currentTarget.style.backgroundColor = A);
|
|
732
|
+
},
|
|
733
|
+
onMouseLeave: (W) => {
|
|
734
|
+
W.currentTarget.style.backgroundColor = I;
|
|
735
|
+
},
|
|
736
|
+
...z,
|
|
737
|
+
children: s.map((W, D) => {
|
|
738
|
+
const H = L(S, W.dataIndex), Q = W.render ? W.render(H, S, E) : H;
|
|
739
|
+
return /* @__PURE__ */ e(
|
|
740
|
+
"td",
|
|
741
|
+
{
|
|
742
|
+
className: `${k.rowPadding} ${k.rowFontSize} text-gray-900 ${i && D !== s.length - 1 ? "border-r" : ""} ${W.align === "center" ? "text-center" : W.align === "right" ? "text-right" : ""}`,
|
|
743
|
+
style: {
|
|
744
|
+
borderColor: h || "#EEEEEE"
|
|
745
|
+
},
|
|
746
|
+
children: Q
|
|
747
|
+
},
|
|
748
|
+
W.key
|
|
749
|
+
);
|
|
750
|
+
})
|
|
751
|
+
},
|
|
752
|
+
P(S, E)
|
|
753
|
+
);
|
|
754
|
+
})
|
|
755
|
+
}
|
|
756
|
+
)
|
|
757
|
+
] })
|
|
758
|
+
}
|
|
759
|
+
),
|
|
432
760
|
t !== !1 && /* @__PURE__ */ e(
|
|
433
|
-
|
|
761
|
+
J,
|
|
434
762
|
{
|
|
435
|
-
current:
|
|
436
|
-
pageSize:
|
|
763
|
+
current: y,
|
|
764
|
+
pageSize: f,
|
|
437
765
|
total: a.length,
|
|
438
|
-
onChange:
|
|
439
|
-
onPageSizeChange:
|
|
766
|
+
onChange: F,
|
|
767
|
+
onPageSizeChange: j,
|
|
440
768
|
showSizeChanger: t && typeof t == "object" ? t.showSizeChanger : !0,
|
|
441
769
|
pageSizeOptions: t && typeof t == "object" ? t.pageSizeOptions : [10, 20, 50, 100],
|
|
442
770
|
showTotal: t && typeof t == "object" ? t.showTotal : !0,
|
|
443
|
-
size: t && typeof t == "object" ? t.size : "md"
|
|
771
|
+
size: t && typeof t == "object" && t.size ? t.size : m === "responsive" ? "md" : m
|
|
444
772
|
}
|
|
445
773
|
)
|
|
446
774
|
] });
|
|
447
|
-
},
|
|
775
|
+
}, J = ({
|
|
448
776
|
current: s,
|
|
449
777
|
pageSize: a,
|
|
450
|
-
total:
|
|
778
|
+
total: n,
|
|
451
779
|
onChange: t,
|
|
452
780
|
onPageSizeChange: c,
|
|
453
|
-
showSizeChanger:
|
|
454
|
-
pageSizeOptions:
|
|
455
|
-
showTotal:
|
|
456
|
-
size:
|
|
781
|
+
showSizeChanger: u = !0,
|
|
782
|
+
pageSizeOptions: $ = [10, 20, 50, 100],
|
|
783
|
+
showTotal: i = !0,
|
|
784
|
+
size: o = "md"
|
|
457
785
|
}) => {
|
|
458
|
-
const m = Math.ceil(
|
|
786
|
+
const m = Math.ceil(n / a), g = (s - 1) * a + 1, x = Math.min(s * a, n), b = {
|
|
459
787
|
sm: {
|
|
460
788
|
button: "px-2.5 py-1 text-xs",
|
|
461
789
|
icon: "h-3.5 w-3.5",
|
|
@@ -471,40 +799,40 @@ const D = ({
|
|
|
471
799
|
icon: "h-6 w-6",
|
|
472
800
|
nav: "px-3 py-3"
|
|
473
801
|
}
|
|
474
|
-
},
|
|
802
|
+
}, h = () => {
|
|
475
803
|
const r = [];
|
|
476
804
|
if (m <= 7)
|
|
477
|
-
for (let
|
|
478
|
-
r.push(
|
|
805
|
+
for (let d = 1; d <= m; d++)
|
|
806
|
+
r.push(d);
|
|
479
807
|
else if (s <= 3) {
|
|
480
|
-
for (let
|
|
808
|
+
for (let d = 1; d <= 5; d++) r.push(d);
|
|
481
809
|
r.push("..."), r.push(m);
|
|
482
810
|
} else if (s >= m - 2) {
|
|
483
811
|
r.push(1), r.push("...");
|
|
484
|
-
for (let
|
|
812
|
+
for (let d = m - 4; d <= m; d++) r.push(d);
|
|
485
813
|
} else {
|
|
486
814
|
r.push(1), r.push("...");
|
|
487
|
-
for (let
|
|
815
|
+
for (let d = s - 1; d <= s + 1; d++) r.push(d);
|
|
488
816
|
r.push("..."), r.push(m);
|
|
489
817
|
}
|
|
490
818
|
return r;
|
|
491
819
|
};
|
|
492
|
-
return /* @__PURE__ */
|
|
493
|
-
|
|
494
|
-
|
|
820
|
+
return /* @__PURE__ */ C("div", { className: "flex items-center justify-between px-4 py-3 border-t border-[#EEEEEE] sm:px-6 mt-4", children: [
|
|
821
|
+
i && /* @__PURE__ */ C("div", { className: "text-sm text-[#181918]", children: [
|
|
822
|
+
g,
|
|
495
823
|
"-",
|
|
496
|
-
|
|
824
|
+
x,
|
|
497
825
|
" of ",
|
|
498
|
-
|
|
826
|
+
n,
|
|
499
827
|
" items"
|
|
500
828
|
] }),
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
503
|
-
|
|
829
|
+
/* @__PURE__ */ C("div", { className: "flex items-center gap-2", children: [
|
|
830
|
+
u && /* @__PURE__ */ e(
|
|
831
|
+
G,
|
|
504
832
|
{
|
|
505
833
|
value: a.toString(),
|
|
506
834
|
onChange: (r) => c(Number(r)),
|
|
507
|
-
options:
|
|
835
|
+
options: $.map((r) => ({
|
|
508
836
|
value: r.toString(),
|
|
509
837
|
label: `${r} / page`
|
|
510
838
|
})),
|
|
@@ -512,14 +840,14 @@ const D = ({
|
|
|
512
840
|
className: "w-32"
|
|
513
841
|
}
|
|
514
842
|
),
|
|
515
|
-
/* @__PURE__ */
|
|
843
|
+
/* @__PURE__ */ C("nav", { className: "inline-flex gap-1 items-center", "aria-label": "Pagination", children: [
|
|
516
844
|
/* @__PURE__ */ e(
|
|
517
845
|
"button",
|
|
518
846
|
{
|
|
519
847
|
onClick: () => t(s - 1),
|
|
520
848
|
disabled: s === 1,
|
|
521
|
-
className: `relative inline-flex items-center justify-center rounded-md ${
|
|
522
|
-
children: /* @__PURE__ */ e("svg", { className:
|
|
849
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[o].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,
|
|
850
|
+
children: /* @__PURE__ */ e("svg", { className: b[o].icon, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
523
851
|
"path",
|
|
524
852
|
{
|
|
525
853
|
strokeLinecap: "round",
|
|
@@ -530,18 +858,18 @@ const D = ({
|
|
|
530
858
|
) })
|
|
531
859
|
}
|
|
532
860
|
),
|
|
533
|
-
|
|
861
|
+
h().map((r, w) => r === "..." ? /* @__PURE__ */ e(
|
|
534
862
|
"span",
|
|
535
863
|
{
|
|
536
|
-
className: `relative inline-flex items-center justify-center ${
|
|
864
|
+
className: `relative inline-flex items-center justify-center ${b[o].button} font-normal text-[#181918]`,
|
|
537
865
|
children: "..."
|
|
538
866
|
},
|
|
539
|
-
`ellipsis-${
|
|
867
|
+
`ellipsis-${w}`
|
|
540
868
|
) : /* @__PURE__ */ e(
|
|
541
869
|
"button",
|
|
542
870
|
{
|
|
543
871
|
onClick: () => t(r),
|
|
544
|
-
className: `relative inline-flex items-center justify-center rounded-md ${
|
|
872
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[o].button} font-medium transition-all duration-300 ease-out focus:z-20 hover:scale-105 active:scale-95 ${s === r ? "bg-[#EC615B] text-white shadow-sm" : "text-[#181918] hover:bg-gray-100"}`,
|
|
545
873
|
children: r
|
|
546
874
|
},
|
|
547
875
|
r
|
|
@@ -551,8 +879,8 @@ const D = ({
|
|
|
551
879
|
{
|
|
552
880
|
onClick: () => t(s + 1),
|
|
553
881
|
disabled: s === m,
|
|
554
|
-
className: `relative inline-flex items-center justify-center rounded-md ${
|
|
555
|
-
children: /* @__PURE__ */ e("svg", { className:
|
|
882
|
+
className: `relative inline-flex items-center justify-center rounded-md ${b[o].nav} text-[#181918] hover:bg-gray-100 focus:z-20 disabled:opacity-30 disabled:cursor-not-allowed disabled:hover:bg-transparent transition-all duration-300 ease-out hover:scale-110 active:scale-95`,
|
|
883
|
+
children: /* @__PURE__ */ e("svg", { className: b[o].icon, viewBox: "0 0 20 20", fill: "none", stroke: "currentColor", children: /* @__PURE__ */ e(
|
|
556
884
|
"path",
|
|
557
885
|
{
|
|
558
886
|
strokeLinecap: "round",
|
|
@@ -566,141 +894,275 @@ const D = ({
|
|
|
566
894
|
] })
|
|
567
895
|
] })
|
|
568
896
|
] });
|
|
569
|
-
},
|
|
897
|
+
}, oe = ({
|
|
570
898
|
title: s,
|
|
571
899
|
description: a,
|
|
572
|
-
searchPlaceholder:
|
|
900
|
+
searchPlaceholder: n = "Search...",
|
|
573
901
|
onSearch: t,
|
|
574
902
|
actions: c,
|
|
575
|
-
filters:
|
|
576
|
-
className:
|
|
903
|
+
filters: u,
|
|
904
|
+
className: $ = "",
|
|
905
|
+
size: i = "responsive",
|
|
906
|
+
titleColor: o,
|
|
907
|
+
descriptionColor: m,
|
|
908
|
+
searchBgColor: g = "white",
|
|
909
|
+
searchBorderColor: x = "#d1d5db",
|
|
910
|
+
searchFocusBorderColor: b = "#3b82f6",
|
|
911
|
+
rounded: h = "md",
|
|
912
|
+
style: r
|
|
577
913
|
}) => {
|
|
578
|
-
const
|
|
579
|
-
t == null || t(
|
|
914
|
+
const w = (p) => {
|
|
915
|
+
t == null || t(p.target.value);
|
|
916
|
+
}, y = {
|
|
917
|
+
sm: {
|
|
918
|
+
titleSize: "text-lg",
|
|
919
|
+
titleWeight: "font-semibold",
|
|
920
|
+
descriptionSize: "text-xs",
|
|
921
|
+
searchInputSize: "text-xs",
|
|
922
|
+
searchInputPy: "py-1.5",
|
|
923
|
+
searchPaddingLeft: "pl-8",
|
|
924
|
+
iconSize: "h-4 w-4",
|
|
925
|
+
spacing: "space-y-2",
|
|
926
|
+
gap: "gap-2",
|
|
927
|
+
maxWidth: "max-w-sm",
|
|
928
|
+
descriptionMargin: "mt-0.5"
|
|
929
|
+
},
|
|
930
|
+
md: {
|
|
931
|
+
titleSize: "text-xl",
|
|
932
|
+
titleWeight: "font-semibold",
|
|
933
|
+
descriptionSize: "text-sm",
|
|
934
|
+
searchInputSize: "text-sm",
|
|
935
|
+
searchInputPy: "py-2",
|
|
936
|
+
searchPaddingLeft: "pl-10",
|
|
937
|
+
iconSize: "h-5 w-5",
|
|
938
|
+
spacing: "space-y-3",
|
|
939
|
+
gap: "gap-3",
|
|
940
|
+
maxWidth: "max-w-md",
|
|
941
|
+
descriptionMargin: "mt-1"
|
|
942
|
+
},
|
|
943
|
+
lg: {
|
|
944
|
+
titleSize: "text-2xl",
|
|
945
|
+
titleWeight: "font-bold",
|
|
946
|
+
descriptionSize: "text-base",
|
|
947
|
+
searchInputSize: "text-base",
|
|
948
|
+
searchInputPy: "py-2.5",
|
|
949
|
+
searchPaddingLeft: "pl-12",
|
|
950
|
+
iconSize: "h-6 w-6",
|
|
951
|
+
spacing: "space-y-4",
|
|
952
|
+
gap: "gap-4",
|
|
953
|
+
maxWidth: "max-w-lg",
|
|
954
|
+
descriptionMargin: "mt-2"
|
|
955
|
+
},
|
|
956
|
+
responsive: {
|
|
957
|
+
titleSize: "text-lg sm:text-xl md:text-2xl",
|
|
958
|
+
titleWeight: "font-semibold md:font-bold",
|
|
959
|
+
descriptionSize: "text-xs sm:text-sm md:text-base",
|
|
960
|
+
searchInputSize: "text-xs sm:text-sm md:text-base",
|
|
961
|
+
searchInputPy: "py-1.5 sm:py-2 md:py-2.5",
|
|
962
|
+
searchPaddingLeft: "pl-8 sm:pl-10 md:pl-12",
|
|
963
|
+
iconSize: "h-4 w-4 sm:h-5 sm:w-5 md:h-6 md:w-6",
|
|
964
|
+
spacing: "space-y-2 sm:space-y-3 md:space-y-4",
|
|
965
|
+
gap: "gap-2 sm:gap-3 md:gap-4",
|
|
966
|
+
maxWidth: "max-w-sm md:max-w-md lg:max-w-lg",
|
|
967
|
+
descriptionMargin: "mt-0.5 sm:mt-1 md:mt-2"
|
|
968
|
+
}
|
|
969
|
+
}[i], f = {
|
|
970
|
+
none: "rounded-none",
|
|
971
|
+
sm: "rounded-sm",
|
|
972
|
+
md: "rounded-md",
|
|
973
|
+
lg: "rounded-lg",
|
|
974
|
+
full: "rounded-full"
|
|
975
|
+
}[h], N = {
|
|
976
|
+
backgroundColor: g,
|
|
977
|
+
borderColor: x
|
|
580
978
|
};
|
|
581
|
-
return /* @__PURE__ */
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
979
|
+
return /* @__PURE__ */ C(
|
|
980
|
+
"div",
|
|
981
|
+
{
|
|
982
|
+
className: `${y.spacing} mb-4 ${$}`,
|
|
983
|
+
style: r,
|
|
984
|
+
children: [
|
|
985
|
+
(s || a) && /* @__PURE__ */ C("div", { children: [
|
|
986
|
+
s && /* @__PURE__ */ e(
|
|
987
|
+
"h2",
|
|
988
|
+
{
|
|
989
|
+
className: `${y.titleSize} ${y.titleWeight}`,
|
|
990
|
+
style: { color: o || "#111827" },
|
|
991
|
+
children: s
|
|
992
|
+
}
|
|
993
|
+
),
|
|
994
|
+
a && /* @__PURE__ */ e(
|
|
995
|
+
"p",
|
|
996
|
+
{
|
|
997
|
+
className: `${y.descriptionSize} ${y.descriptionMargin}`,
|
|
998
|
+
style: { color: m || "#6b7280" },
|
|
999
|
+
children: a
|
|
1000
|
+
}
|
|
1001
|
+
)
|
|
1002
|
+
] }),
|
|
1003
|
+
/* @__PURE__ */ C("div", { className: `flex flex-col sm:flex-row items-stretch sm:items-center justify-between ${y.gap}`, children: [
|
|
1004
|
+
t && /* @__PURE__ */ e("div", { className: `flex-1 ${y.maxWidth}`, children: /* @__PURE__ */ C("div", { className: "relative", children: [
|
|
1005
|
+
/* @__PURE__ */ e("div", { className: "absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none", children: /* @__PURE__ */ e(
|
|
1006
|
+
"svg",
|
|
597
1007
|
{
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
1008
|
+
className: `${y.iconSize} text-gray-400`,
|
|
1009
|
+
fill: "none",
|
|
1010
|
+
stroke: "currentColor",
|
|
1011
|
+
viewBox: "0 0 24 24",
|
|
1012
|
+
children: /* @__PURE__ */ e(
|
|
1013
|
+
"path",
|
|
1014
|
+
{
|
|
1015
|
+
strokeLinecap: "round",
|
|
1016
|
+
strokeLinejoin: "round",
|
|
1017
|
+
strokeWidth: 2,
|
|
1018
|
+
d: "M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
1019
|
+
}
|
|
1020
|
+
)
|
|
1021
|
+
}
|
|
1022
|
+
) }),
|
|
1023
|
+
/* @__PURE__ */ e(
|
|
1024
|
+
"input",
|
|
1025
|
+
{
|
|
1026
|
+
type: "text",
|
|
1027
|
+
placeholder: n,
|
|
1028
|
+
onChange: w,
|
|
1029
|
+
className: `block w-full ${y.searchPaddingLeft} pr-3 ${y.searchInputPy} border ${f} focus:outline-none focus:ring-2 focus:ring-opacity-50 ${y.searchInputSize} transition-colors duration-200`,
|
|
1030
|
+
style: N,
|
|
1031
|
+
onFocus: (p) => {
|
|
1032
|
+
p.currentTarget.style.borderColor = b, p.currentTarget.style.boxShadow = "0 0 0 2px rgba(59, 130, 246, 0.1)";
|
|
1033
|
+
},
|
|
1034
|
+
onBlur: (p) => {
|
|
1035
|
+
p.currentTarget.style.borderColor = x, p.currentTarget.style.boxShadow = "none";
|
|
1036
|
+
}
|
|
602
1037
|
}
|
|
603
1038
|
)
|
|
604
|
-
}
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
] });
|
|
620
|
-
}, J = ({
|
|
1039
|
+
] }) }),
|
|
1040
|
+
c && /* @__PURE__ */ e("div", { className: "flex items-center gap-2 w-full sm:w-auto", children: c })
|
|
1041
|
+
] }),
|
|
1042
|
+
u && /* @__PURE__ */ e("div", { className: `flex flex-wrap items-center ${y.gap}`, children: u })
|
|
1043
|
+
]
|
|
1044
|
+
}
|
|
1045
|
+
);
|
|
1046
|
+
}, X = {
|
|
1047
|
+
sm: "384px",
|
|
1048
|
+
md: "448px",
|
|
1049
|
+
lg: "512px",
|
|
1050
|
+
xl: "600px",
|
|
1051
|
+
full: "100%",
|
|
1052
|
+
responsive: "90vw"
|
|
1053
|
+
}, ae = ({
|
|
621
1054
|
open: s,
|
|
622
1055
|
onClose: a,
|
|
623
|
-
title:
|
|
1056
|
+
title: n,
|
|
624
1057
|
children: t,
|
|
625
1058
|
footer: c,
|
|
626
|
-
width:
|
|
1059
|
+
width: u,
|
|
1060
|
+
size: $ = "md",
|
|
627
1061
|
closable: i = !0,
|
|
628
|
-
maskClosable:
|
|
629
|
-
centered:
|
|
630
|
-
className:
|
|
1062
|
+
maskClosable: o = !0,
|
|
1063
|
+
centered: m = !0,
|
|
1064
|
+
className: g = "",
|
|
1065
|
+
bgColor: x = "#ffffff",
|
|
1066
|
+
headerBgColor: b = "#ffffff",
|
|
1067
|
+
overlayColor: h = "rgba(0, 0, 0, 0.5)",
|
|
1068
|
+
bodyClassName: r = "",
|
|
1069
|
+
headerClassName: w = "",
|
|
1070
|
+
maxHeight: d = "70vh"
|
|
631
1071
|
}) => {
|
|
632
|
-
const [
|
|
633
|
-
|
|
1072
|
+
const [y, l] = R(!1), [f, N] = R(!1), p = u || X[$], k = {
|
|
1073
|
+
width: typeof p == "number" ? `${p}px` : p,
|
|
1074
|
+
maxWidth: "90vw",
|
|
1075
|
+
backgroundColor: x
|
|
1076
|
+
}, T = {
|
|
1077
|
+
backgroundColor: b
|
|
1078
|
+
}, P = {
|
|
1079
|
+
backgroundColor: h
|
|
1080
|
+
};
|
|
1081
|
+
if (V(() => {
|
|
634
1082
|
if (s)
|
|
635
|
-
|
|
1083
|
+
l(!0), setTimeout(() => N(!0), 10), document.body.style.overflow = "hidden";
|
|
636
1084
|
else {
|
|
637
|
-
|
|
638
|
-
const
|
|
639
|
-
|
|
1085
|
+
N(!1);
|
|
1086
|
+
const F = setTimeout(() => {
|
|
1087
|
+
l(!1);
|
|
640
1088
|
}, 200);
|
|
641
|
-
return document.body.style.overflow = "unset", () => clearTimeout(
|
|
1089
|
+
return document.body.style.overflow = "unset", () => clearTimeout(F);
|
|
642
1090
|
}
|
|
643
|
-
}, [s]),
|
|
644
|
-
const
|
|
645
|
-
|
|
1091
|
+
}, [s]), V(() => {
|
|
1092
|
+
const F = (j) => {
|
|
1093
|
+
j.key === "Escape" && i && s && a();
|
|
646
1094
|
};
|
|
647
|
-
return s && document.addEventListener("keydown",
|
|
648
|
-
document.removeEventListener("keydown",
|
|
1095
|
+
return s && document.addEventListener("keydown", F), () => {
|
|
1096
|
+
document.removeEventListener("keydown", F);
|
|
649
1097
|
};
|
|
650
|
-
}, [s, a, i]), !
|
|
651
|
-
const
|
|
652
|
-
|
|
653
|
-
},
|
|
654
|
-
|
|
1098
|
+
}, [s, a, i]), !y) return null;
|
|
1099
|
+
const L = () => {
|
|
1100
|
+
o && a();
|
|
1101
|
+
}, M = (F) => {
|
|
1102
|
+
F.stopPropagation();
|
|
655
1103
|
};
|
|
656
|
-
return /* @__PURE__ */
|
|
1104
|
+
return /* @__PURE__ */ C(
|
|
657
1105
|
"div",
|
|
658
1106
|
{
|
|
659
1107
|
className: "fixed inset-0 z-50 overflow-y-auto",
|
|
660
|
-
onClick:
|
|
1108
|
+
onClick: L,
|
|
661
1109
|
children: [
|
|
662
1110
|
/* @__PURE__ */ e(
|
|
663
1111
|
"div",
|
|
664
1112
|
{
|
|
665
|
-
className: `fixed inset-0
|
|
1113
|
+
className: `fixed inset-0 transition-opacity duration-200 ease-out ${f ? "opacity-100" : "opacity-0"}`,
|
|
1114
|
+
style: P
|
|
666
1115
|
}
|
|
667
1116
|
),
|
|
668
|
-
/* @__PURE__ */ e("div", { className: `flex min-h-full items-center justify-center p-4 ${
|
|
1117
|
+
/* @__PURE__ */ e("div", { className: `flex min-h-full items-center justify-center p-4 ${m ? "items-center" : "items-start pt-20"}`, children: /* @__PURE__ */ C(
|
|
669
1118
|
"div",
|
|
670
1119
|
{
|
|
671
|
-
className: `relative
|
|
672
|
-
style: {
|
|
673
|
-
onClick:
|
|
1120
|
+
className: `relative rounded-lg shadow-xl transition-all duration-200 ease-out overflow-y-auto ${f ? "opacity-100 scale-100 translate-y-0" : "opacity-0 scale-95 -translate-y-4"} ${g}`,
|
|
1121
|
+
style: { ...k, maxHeight: typeof d == "number" ? `${d}px` : d },
|
|
1122
|
+
onClick: M,
|
|
674
1123
|
children: [
|
|
675
|
-
(
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
className: "text-
|
|
682
|
-
|
|
683
|
-
"
|
|
1124
|
+
(n || i) && /* @__PURE__ */ C(
|
|
1125
|
+
"div",
|
|
1126
|
+
{
|
|
1127
|
+
className: `flex items-center justify-between px-6 py-4 border-b border-gray-200 ${w}`,
|
|
1128
|
+
style: T,
|
|
1129
|
+
children: [
|
|
1130
|
+
n && /* @__PURE__ */ e("h3", { className: "text-lg font-semibold text-gray-900", children: n }),
|
|
1131
|
+
i && /* @__PURE__ */ e(
|
|
1132
|
+
"button",
|
|
684
1133
|
{
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
stroke: "currentColor",
|
|
688
|
-
viewBox: "0 0 24 24",
|
|
1134
|
+
onClick: a,
|
|
1135
|
+
className: "text-gray-400 hover:text-gray-600 transition-colors duration-200 ease-out",
|
|
689
1136
|
children: /* @__PURE__ */ e(
|
|
690
|
-
"
|
|
1137
|
+
"svg",
|
|
691
1138
|
{
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
1139
|
+
className: "w-5 h-5",
|
|
1140
|
+
fill: "none",
|
|
1141
|
+
stroke: "currentColor",
|
|
1142
|
+
viewBox: "0 0 24 24",
|
|
1143
|
+
children: /* @__PURE__ */ e(
|
|
1144
|
+
"path",
|
|
1145
|
+
{
|
|
1146
|
+
strokeLinecap: "round",
|
|
1147
|
+
strokeLinejoin: "round",
|
|
1148
|
+
strokeWidth: 2,
|
|
1149
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1150
|
+
}
|
|
1151
|
+
)
|
|
696
1152
|
}
|
|
697
1153
|
)
|
|
698
1154
|
}
|
|
699
1155
|
)
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
/* @__PURE__ */ e(
|
|
1156
|
+
]
|
|
1157
|
+
}
|
|
1158
|
+
),
|
|
1159
|
+
/* @__PURE__ */ e(
|
|
1160
|
+
"div",
|
|
1161
|
+
{
|
|
1162
|
+
className: `px-6 py-4 ${r}`,
|
|
1163
|
+
children: t
|
|
1164
|
+
}
|
|
1165
|
+
),
|
|
704
1166
|
c && /* @__PURE__ */ e("div", { className: "px-6 py-4 border-t border-gray-200 flex justify-end gap-2", children: c })
|
|
705
1167
|
]
|
|
706
1168
|
}
|
|
@@ -708,16 +1170,21 @@ const D = ({
|
|
|
708
1170
|
]
|
|
709
1171
|
}
|
|
710
1172
|
);
|
|
711
|
-
},
|
|
1173
|
+
}, ie = ({
|
|
712
1174
|
children: s,
|
|
713
1175
|
variant: a = "default",
|
|
714
|
-
size:
|
|
1176
|
+
size: n = "md",
|
|
715
1177
|
dot: t = !1,
|
|
716
1178
|
icon: c,
|
|
717
|
-
iconPosition:
|
|
718
|
-
className:
|
|
1179
|
+
iconPosition: u = "left",
|
|
1180
|
+
className: $ = "",
|
|
1181
|
+
bgColor: i,
|
|
1182
|
+
textColor: o,
|
|
1183
|
+
borderColor: m,
|
|
1184
|
+
rounded: g = "full",
|
|
1185
|
+
style: x
|
|
719
1186
|
}) => {
|
|
720
|
-
const
|
|
1187
|
+
const b = {
|
|
721
1188
|
default: "bg-gray-100 text-[#181918]",
|
|
722
1189
|
primary: "bg-[#FCEAE9] text-[#EC615B]",
|
|
723
1190
|
success: "bg-green-100 text-green-800",
|
|
@@ -727,56 +1194,80 @@ const D = ({
|
|
|
727
1194
|
}, h = {
|
|
728
1195
|
sm: "px-2 py-0.5 text-xs",
|
|
729
1196
|
md: "px-2.5 py-1 text-sm",
|
|
730
|
-
lg: "px-3 py-1.5 text-base"
|
|
731
|
-
|
|
1197
|
+
lg: "px-3 py-1.5 text-base",
|
|
1198
|
+
responsive: "px-1.5 py-0.5 text-[10px] sm:px-2 sm:py-0.5 sm:text-xs md:px-2.5 md:py-1 md:text-sm lg:px-3 lg:py-1.5 lg:text-base"
|
|
1199
|
+
}, r = {
|
|
732
1200
|
sm: "w-1.5 h-1.5",
|
|
733
1201
|
md: "w-2 h-2",
|
|
734
|
-
lg: "w-2.5 h-2.5"
|
|
735
|
-
|
|
1202
|
+
lg: "w-2.5 h-2.5",
|
|
1203
|
+
responsive: "w-1 h-1 sm:w-1.5 sm:h-1.5 md:w-2 md:h-2 lg:w-2.5 lg:h-2.5"
|
|
1204
|
+
}, w = {
|
|
736
1205
|
default: "bg-gray-600",
|
|
737
1206
|
primary: "bg-[#EC615B]",
|
|
738
1207
|
success: "bg-green-600",
|
|
739
1208
|
warning: "bg-yellow-600",
|
|
740
1209
|
danger: "bg-red-600",
|
|
741
1210
|
info: "bg-cyan-600"
|
|
742
|
-
},
|
|
1211
|
+
}, d = {
|
|
743
1212
|
sm: "w-3 h-3",
|
|
744
1213
|
md: "w-3.5 h-3.5",
|
|
745
|
-
lg: "w-4 h-4"
|
|
1214
|
+
lg: "w-4 h-4",
|
|
1215
|
+
responsive: "w-2.5 h-2.5 sm:w-3 sm:h-3 md:w-3.5 md:h-3.5 lg:w-4 lg:h-4"
|
|
1216
|
+
}, y = {
|
|
1217
|
+
none: "rounded-none",
|
|
1218
|
+
sm: "rounded-sm",
|
|
1219
|
+
md: "rounded-md",
|
|
1220
|
+
lg: "rounded-lg",
|
|
1221
|
+
full: "rounded-full"
|
|
1222
|
+
}, l = {
|
|
1223
|
+
...i && { backgroundColor: i },
|
|
1224
|
+
...o && { color: o },
|
|
1225
|
+
...m && { borderColor: m, borderWidth: "1px", borderStyle: "solid" },
|
|
1226
|
+
...x
|
|
746
1227
|
};
|
|
747
|
-
return /* @__PURE__ */
|
|
1228
|
+
return /* @__PURE__ */ C(
|
|
748
1229
|
"span",
|
|
749
1230
|
{
|
|
750
|
-
className: `inline-flex items-center gap-1.5 font-medium
|
|
1231
|
+
className: `inline-flex items-center gap-1.5 font-medium transition-all duration-200 ${i ? "" : b[a]} ${h[n]} ${y[g]} ${$}`,
|
|
1232
|
+
style: l,
|
|
751
1233
|
children: [
|
|
752
|
-
t && /* @__PURE__ */ e("span", { className: `rounded-full ${
|
|
753
|
-
c &&
|
|
1234
|
+
t && /* @__PURE__ */ e("span", { className: `rounded-full ${r[n]} ${w[a]}` }),
|
|
1235
|
+
c && u === "left" && /* @__PURE__ */ e("span", { className: `inline-flex items-center ${d[n]}`, children: c }),
|
|
754
1236
|
s,
|
|
755
|
-
c &&
|
|
1237
|
+
c && u === "right" && /* @__PURE__ */ e("span", { className: `inline-flex items-center ${d[n]}`, children: c })
|
|
756
1238
|
]
|
|
757
1239
|
}
|
|
758
1240
|
);
|
|
759
|
-
},
|
|
1241
|
+
}, de = ({
|
|
760
1242
|
items: s,
|
|
761
1243
|
current: a = 0,
|
|
762
|
-
direction:
|
|
1244
|
+
direction: n = "vertical",
|
|
763
1245
|
size: t = "md",
|
|
764
1246
|
variant: c = "default",
|
|
765
|
-
className:
|
|
1247
|
+
className: u = "",
|
|
1248
|
+
style: $,
|
|
1249
|
+
finishColor: i,
|
|
1250
|
+
processColor: o,
|
|
1251
|
+
waitColor: m,
|
|
1252
|
+
errorColor: g,
|
|
1253
|
+
lineColor: x
|
|
766
1254
|
}) => {
|
|
767
|
-
const
|
|
1255
|
+
const b = (l, f) => f.status ? f.status : l < a ? "finish" : l === a ? "process" : "wait", h = {
|
|
768
1256
|
sm: "w-6 h-6",
|
|
769
1257
|
md: "w-8 h-8",
|
|
770
|
-
lg: "w-10 h-10"
|
|
771
|
-
|
|
1258
|
+
lg: "w-10 h-10",
|
|
1259
|
+
responsive: "w-6 h-6 sm:w-7 sm:h-7 md:w-8 md:h-8 lg:w-10 lg:h-10"
|
|
1260
|
+
}, r = {
|
|
772
1261
|
sm: "text-sm",
|
|
773
1262
|
md: "text-base",
|
|
774
|
-
lg: "text-lg"
|
|
775
|
-
|
|
1263
|
+
lg: "text-lg",
|
|
1264
|
+
responsive: "text-xs sm:text-sm md:text-base lg:text-lg"
|
|
1265
|
+
}, w = {
|
|
776
1266
|
sm: "text-xs",
|
|
777
1267
|
md: "text-sm",
|
|
778
|
-
lg: "text-base"
|
|
779
|
-
|
|
1268
|
+
lg: "text-base",
|
|
1269
|
+
responsive: "text-xs sm:text-xs md:text-sm lg:text-base"
|
|
1270
|
+
}, d = (l, f) => f || (l === "finish" ? /* @__PURE__ */ e("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
780
1271
|
"path",
|
|
781
1272
|
{
|
|
782
1273
|
fillRule: "evenodd",
|
|
@@ -790,142 +1281,161 @@ const D = ({
|
|
|
790
1281
|
d: "M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z",
|
|
791
1282
|
clipRule: "evenodd"
|
|
792
1283
|
}
|
|
793
|
-
) }) : null),
|
|
794
|
-
const
|
|
1284
|
+
) }) : null), y = (l) => {
|
|
1285
|
+
const f = c === "outline";
|
|
795
1286
|
switch (l) {
|
|
796
1287
|
case "finish":
|
|
797
1288
|
return {
|
|
798
|
-
icon:
|
|
1289
|
+
icon: f ? `bg-white text-white border ${i ? `border-[${i}]` : "border-green-500"}` : `${i ? `bg-[${i}]` : "bg-green-500"} text-white ${i ? `border-[${i}]` : "border-green-500"}`,
|
|
799
1290
|
title: "text-[#181918]",
|
|
800
1291
|
description: "text-gray-600",
|
|
801
|
-
line: "bg-green-500"
|
|
1292
|
+
line: x ? `bg-[${x}]` : "bg-green-500",
|
|
1293
|
+
iconColor: i
|
|
802
1294
|
};
|
|
803
1295
|
case "process":
|
|
804
1296
|
return {
|
|
805
|
-
icon:
|
|
1297
|
+
icon: f ? `bg-white text-white border ${o ? `border-[${o}]` : "border-[#EC615B]"}` : `${o ? `bg-[${o}]` : "bg-[#EC615B]"} text-white ${o ? `border-[${o}]` : "border-[#EC615B]"}`,
|
|
806
1298
|
title: "text-[#181918] font-semibold",
|
|
807
1299
|
description: "text-gray-700",
|
|
808
|
-
line: "bg-gray-300"
|
|
1300
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1301
|
+
iconColor: o
|
|
809
1302
|
};
|
|
810
1303
|
case "error":
|
|
811
1304
|
return {
|
|
812
|
-
icon:
|
|
1305
|
+
icon: f ? `bg-white text-white border ${g ? `border-[${g}]` : "border-red-500"}` : `${g ? `bg-[${g}]` : "bg-red-500"} text-white ${g ? `border-[${g}]` : "border-red-500"}`,
|
|
813
1306
|
title: "text-red-600",
|
|
814
1307
|
description: "text-red-500",
|
|
815
|
-
line: "bg-gray-300"
|
|
1308
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1309
|
+
iconColor: g
|
|
816
1310
|
};
|
|
817
1311
|
default:
|
|
818
1312
|
return {
|
|
819
1313
|
icon: "bg-white text-gray-400 border-gray-300",
|
|
820
1314
|
title: "text-gray-500",
|
|
821
1315
|
description: "text-gray-400",
|
|
822
|
-
line: "bg-gray-300"
|
|
1316
|
+
line: x ? `bg-[${x}]` : "bg-gray-300",
|
|
1317
|
+
iconColor: m
|
|
823
1318
|
};
|
|
824
1319
|
}
|
|
825
1320
|
};
|
|
826
|
-
return
|
|
827
|
-
const
|
|
828
|
-
return /* @__PURE__ */
|
|
829
|
-
/* @__PURE__ */
|
|
1321
|
+
return n === "horizontal" ? /* @__PURE__ */ e("div", { className: `flex items-start ${u}`, style: $, children: s.map((l, f) => {
|
|
1322
|
+
const N = b(f, l), p = y(N), B = f === s.length - 1, k = {};
|
|
1323
|
+
return p.iconColor && (k.color = p.iconColor), /* @__PURE__ */ C("div", { className: "flex flex-1 items-start", children: [
|
|
1324
|
+
/* @__PURE__ */ C("div", { className: "flex flex-col items-center", children: [
|
|
830
1325
|
/* @__PURE__ */ e(
|
|
831
1326
|
"div",
|
|
832
1327
|
{
|
|
833
|
-
className: `flex items-center justify-center ${
|
|
834
|
-
|
|
1328
|
+
className: `flex items-center justify-center ${h[t]} rounded-full border transition-all duration-300 ${p.icon}`,
|
|
1329
|
+
style: k,
|
|
1330
|
+
children: d(N, l.icon)
|
|
835
1331
|
}
|
|
836
1332
|
),
|
|
837
|
-
/* @__PURE__ */
|
|
1333
|
+
/* @__PURE__ */ C("div", { className: "mt-2 text-center", children: [
|
|
838
1334
|
/* @__PURE__ */ e(
|
|
839
1335
|
"div",
|
|
840
1336
|
{
|
|
841
|
-
className: `${
|
|
1337
|
+
className: `${r[t]} ${p.title} transition-colors duration-300`,
|
|
842
1338
|
children: l.title
|
|
843
1339
|
}
|
|
844
1340
|
),
|
|
845
1341
|
l.description && /* @__PURE__ */ e(
|
|
846
1342
|
"div",
|
|
847
1343
|
{
|
|
848
|
-
className: `${
|
|
1344
|
+
className: `${w[t]} ${p.description} mt-1 transition-colors duration-300`,
|
|
849
1345
|
children: l.description
|
|
850
1346
|
}
|
|
851
1347
|
)
|
|
852
1348
|
] })
|
|
853
1349
|
] }),
|
|
854
|
-
!
|
|
1350
|
+
!B && /* @__PURE__ */ e(
|
|
855
1351
|
"div",
|
|
856
1352
|
{
|
|
857
|
-
className: `flex-1 h-0.5 mt-4 mx-2 ${
|
|
1353
|
+
className: `flex-1 h-0.5 mt-4 mx-2 ${p.line} transition-colors duration-300`
|
|
858
1354
|
}
|
|
859
1355
|
)
|
|
860
|
-
] },
|
|
861
|
-
}) }) : /* @__PURE__ */ e("div", { className: `flex flex-col ${
|
|
862
|
-
const
|
|
863
|
-
return /* @__PURE__ */
|
|
864
|
-
/* @__PURE__ */
|
|
1356
|
+
] }, f);
|
|
1357
|
+
}) }) : /* @__PURE__ */ e("div", { className: `flex flex-col ${u}`, style: $, children: s.map((l, f) => {
|
|
1358
|
+
const N = b(f, l), p = y(N), B = f === s.length - 1, k = {};
|
|
1359
|
+
return p.iconColor && (k.color = p.iconColor), /* @__PURE__ */ C("div", { className: "flex", children: [
|
|
1360
|
+
/* @__PURE__ */ C("div", { className: "flex flex-col items-center mr-4", children: [
|
|
865
1361
|
/* @__PURE__ */ e(
|
|
866
1362
|
"div",
|
|
867
1363
|
{
|
|
868
|
-
className: `flex items-center justify-center ${
|
|
869
|
-
|
|
1364
|
+
className: `flex items-center justify-center ${h[t]} rounded-full border transition-all duration-300 ${p.icon}`,
|
|
1365
|
+
style: k,
|
|
1366
|
+
children: d(N, l.icon)
|
|
870
1367
|
}
|
|
871
1368
|
),
|
|
872
|
-
!
|
|
1369
|
+
!B && /* @__PURE__ */ e(
|
|
873
1370
|
"div",
|
|
874
1371
|
{
|
|
875
|
-
className: `w-0.5 flex-1 my-1 ${
|
|
1372
|
+
className: `w-0.5 flex-1 my-1 ${p.line} transition-colors duration-300`,
|
|
876
1373
|
style: { minHeight: "20px" }
|
|
877
1374
|
}
|
|
878
1375
|
)
|
|
879
1376
|
] }),
|
|
880
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ C("div", { className: "flex-1 pb-6", children: [
|
|
881
1378
|
/* @__PURE__ */ e(
|
|
882
1379
|
"div",
|
|
883
1380
|
{
|
|
884
|
-
className: `${
|
|
1381
|
+
className: `${r[t]} ${p.title} transition-colors duration-300`,
|
|
885
1382
|
children: l.title
|
|
886
1383
|
}
|
|
887
1384
|
),
|
|
888
1385
|
l.description && /* @__PURE__ */ e(
|
|
889
1386
|
"div",
|
|
890
1387
|
{
|
|
891
|
-
className: `${
|
|
1388
|
+
className: `${w[t]} ${p.description} mt-1 transition-colors duration-300`,
|
|
892
1389
|
children: l.description
|
|
893
1390
|
}
|
|
894
1391
|
)
|
|
895
1392
|
] })
|
|
896
|
-
] },
|
|
1393
|
+
] }, f);
|
|
897
1394
|
}) });
|
|
898
|
-
},
|
|
1395
|
+
}, ce = ({
|
|
899
1396
|
percent: s = 0,
|
|
900
1397
|
status: a = "normal",
|
|
901
|
-
showInfo:
|
|
1398
|
+
showInfo: n = !0,
|
|
902
1399
|
strokeColor: t,
|
|
903
1400
|
strokeWidth: c,
|
|
904
|
-
size:
|
|
905
|
-
className:
|
|
906
|
-
format:
|
|
1401
|
+
size: u = "md",
|
|
1402
|
+
className: $ = "",
|
|
1403
|
+
format: i,
|
|
1404
|
+
bgColor: o,
|
|
1405
|
+
successColor: m,
|
|
1406
|
+
exceptionColor: g,
|
|
1407
|
+
trackColor: x,
|
|
1408
|
+
rounded: b = "full"
|
|
907
1409
|
}) => {
|
|
908
|
-
const h = Math.min(100, Math.max(0, s)),
|
|
1410
|
+
const h = Math.min(100, Math.max(0, s)), r = {
|
|
909
1411
|
sm: "h-1.5",
|
|
910
1412
|
md: "h-2",
|
|
911
|
-
lg: "h-3"
|
|
912
|
-
|
|
1413
|
+
lg: "h-3",
|
|
1414
|
+
responsive: "h-1.5 sm:h-2 md:h-3 lg:h-4"
|
|
1415
|
+
}, w = {
|
|
913
1416
|
sm: "text-xs",
|
|
914
1417
|
md: "text-sm",
|
|
915
|
-
lg: "text-base"
|
|
916
|
-
|
|
1418
|
+
lg: "text-base",
|
|
1419
|
+
responsive: "text-xs sm:text-sm md:text-base lg:text-lg"
|
|
1420
|
+
}, d = {
|
|
1421
|
+
none: "rounded-none",
|
|
1422
|
+
sm: "rounded-sm",
|
|
1423
|
+
md: "rounded-md",
|
|
1424
|
+
lg: "rounded-lg",
|
|
1425
|
+
full: "rounded-full"
|
|
1426
|
+
}, y = () => {
|
|
917
1427
|
if (t) return t;
|
|
918
1428
|
switch (a) {
|
|
919
1429
|
case "success":
|
|
920
|
-
return "bg-green-500";
|
|
1430
|
+
return m || "bg-green-500";
|
|
921
1431
|
case "exception":
|
|
922
|
-
return "bg-red-500";
|
|
1432
|
+
return g || "bg-red-500";
|
|
923
1433
|
case "active":
|
|
924
|
-
return "bg-[#EC615B]";
|
|
1434
|
+
return o || "bg-[#EC615B]";
|
|
925
1435
|
default:
|
|
926
|
-
return h === 100 ? "bg-green-500" : "bg-[#EC615B]";
|
|
1436
|
+
return h === 100 ? m || "bg-green-500" : o || "bg-[#EC615B]";
|
|
927
1437
|
}
|
|
928
|
-
}, l = () => a === "success" || h === 100 ? /* @__PURE__ */ e("svg", { className: "w-4 h-4 text-green-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
1438
|
+
}, l = () => x || "bg-gray-200", f = () => a === "success" || h === 100 ? /* @__PURE__ */ e("svg", { className: "w-4 h-4 text-green-500", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e(
|
|
929
1439
|
"path",
|
|
930
1440
|
{
|
|
931
1441
|
fillRule: "evenodd",
|
|
@@ -939,99 +1449,117 @@ const D = ({
|
|
|
939
1449
|
d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z",
|
|
940
1450
|
clipRule: "evenodd"
|
|
941
1451
|
}
|
|
942
|
-
) }) : null,
|
|
943
|
-
return /* @__PURE__ */
|
|
1452
|
+
) }) : null, N = () => i ? i(h) : `${Math.round(h)}%`, p = c ? `${c}px` : void 0;
|
|
1453
|
+
return /* @__PURE__ */ C("div", { className: `flex items-center gap-2 ${$}`, children: [
|
|
944
1454
|
/* @__PURE__ */ e("div", { className: "flex-1", children: /* @__PURE__ */ e(
|
|
945
1455
|
"div",
|
|
946
1456
|
{
|
|
947
|
-
className: `w-full
|
|
948
|
-
style: { height:
|
|
1457
|
+
className: `w-full overflow-hidden ${r[u]} ${d[b]} ${l()}`,
|
|
1458
|
+
style: { height: p },
|
|
949
1459
|
children: /* @__PURE__ */ e(
|
|
950
1460
|
"div",
|
|
951
1461
|
{
|
|
952
|
-
className: `${
|
|
1462
|
+
className: `${y()} ${r[u]} ${d[b]} transition-all duration-300 ease-out ${a === "active" ? "progress-active" : ""}`,
|
|
953
1463
|
style: {
|
|
954
1464
|
width: `${h}%`,
|
|
955
|
-
height:
|
|
1465
|
+
height: p
|
|
956
1466
|
}
|
|
957
1467
|
}
|
|
958
1468
|
)
|
|
959
1469
|
}
|
|
960
1470
|
) }),
|
|
961
|
-
|
|
1471
|
+
n && /* @__PURE__ */ e("div", { className: `flex items-center gap-1 ${w[u]} text-gray-600 font-normal`, children: f() || N() })
|
|
962
1472
|
] });
|
|
963
|
-
},
|
|
1473
|
+
}, ue = ({
|
|
964
1474
|
checked: s,
|
|
965
1475
|
defaultChecked: a = !1,
|
|
966
|
-
onChange:
|
|
1476
|
+
onChange: n,
|
|
967
1477
|
disabled: t = !1,
|
|
968
1478
|
indeterminate: c = !1,
|
|
969
|
-
size:
|
|
970
|
-
variant:
|
|
971
|
-
className:
|
|
972
|
-
id:
|
|
1479
|
+
size: u = "md",
|
|
1480
|
+
variant: $ = "filled",
|
|
1481
|
+
className: i = "",
|
|
1482
|
+
id: o,
|
|
973
1483
|
name: m,
|
|
974
|
-
value:
|
|
1484
|
+
value: g,
|
|
1485
|
+
checkedColor: x = "#EC615B",
|
|
1486
|
+
uncheckedColor: b = "#ffffff",
|
|
1487
|
+
checkedBorderColor: h = "#EC615B",
|
|
1488
|
+
style: r
|
|
975
1489
|
}) => {
|
|
976
|
-
const [
|
|
1490
|
+
const [w, d] = R(a), y = s !== void 0, l = y ? s : w, f = (L) => {
|
|
977
1491
|
if (t) return;
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
},
|
|
1492
|
+
const M = L.target.checked;
|
|
1493
|
+
y || d(M), n == null || n(M);
|
|
1494
|
+
}, N = {
|
|
981
1495
|
sm: "w-4 h-4",
|
|
982
1496
|
md: "w-5 h-5",
|
|
983
|
-
lg: "w-6 h-6"
|
|
984
|
-
|
|
1497
|
+
lg: "w-6 h-6",
|
|
1498
|
+
responsive: "w-4 h-4 sm:w-5 sm:h-5 lg:w-6 lg:h-6"
|
|
1499
|
+
}, p = {
|
|
985
1500
|
sm: "w-3 h-3",
|
|
986
1501
|
md: "w-3.5 h-3.5",
|
|
987
|
-
lg: "w-4 h-4"
|
|
988
|
-
|
|
989
|
-
|
|
1502
|
+
lg: "w-4 h-4",
|
|
1503
|
+
responsive: "w-2.5 h-2.5 sm:w-3.5 sm:h-3.5 lg:w-4 lg:h-4"
|
|
1504
|
+
}, B = $ === "filled", k = () => t ? "cursor-not-allowed opacity-50 border-gray-300 bg-gray-100" : !l && !c ? "border-gray-300 bg-white hover:border-gray-400" : "", T = () => {
|
|
1505
|
+
if (!t && !(!l && !c))
|
|
1506
|
+
return B ? {
|
|
1507
|
+
borderColor: h,
|
|
1508
|
+
backgroundColor: x
|
|
1509
|
+
} : {
|
|
1510
|
+
borderColor: h,
|
|
1511
|
+
backgroundColor: b
|
|
1512
|
+
};
|
|
1513
|
+
}, P = () => B && (l || c) ? "text-white" : "";
|
|
1514
|
+
return /* @__PURE__ */ C("div", { className: "inline-flex items-center", style: r, children: [
|
|
990
1515
|
/* @__PURE__ */ e(
|
|
991
1516
|
"input",
|
|
992
1517
|
{
|
|
993
1518
|
type: "checkbox",
|
|
994
|
-
id:
|
|
1519
|
+
id: o,
|
|
995
1520
|
name: m,
|
|
996
|
-
value:
|
|
997
|
-
checked:
|
|
998
|
-
onChange:
|
|
1521
|
+
value: g,
|
|
1522
|
+
checked: l,
|
|
1523
|
+
onChange: f,
|
|
999
1524
|
disabled: t,
|
|
1000
1525
|
className: "sr-only"
|
|
1001
1526
|
}
|
|
1002
1527
|
),
|
|
1003
|
-
/* @__PURE__ */
|
|
1528
|
+
/* @__PURE__ */ C(
|
|
1004
1529
|
"label",
|
|
1005
1530
|
{
|
|
1006
|
-
htmlFor:
|
|
1531
|
+
htmlFor: o,
|
|
1007
1532
|
className: `
|
|
1008
1533
|
relative flex items-center justify-center
|
|
1009
|
-
${
|
|
1010
|
-
${
|
|
1534
|
+
${N[u]}
|
|
1535
|
+
${$ === "outline" ? "border" : "border-2"}
|
|
1011
1536
|
rounded
|
|
1012
1537
|
transition-all duration-200 ease-out
|
|
1013
1538
|
cursor-pointer
|
|
1014
|
-
${
|
|
1015
|
-
${
|
|
1539
|
+
${k()}
|
|
1540
|
+
${i}
|
|
1016
1541
|
`,
|
|
1542
|
+
style: T(),
|
|
1017
1543
|
children: [
|
|
1018
|
-
|
|
1544
|
+
l && !c && /* @__PURE__ */ e(
|
|
1019
1545
|
"svg",
|
|
1020
1546
|
{
|
|
1021
|
-
className: `${
|
|
1547
|
+
className: `${p[u]} ${P()}`,
|
|
1022
1548
|
fill: "none",
|
|
1023
1549
|
stroke: "currentColor",
|
|
1024
1550
|
viewBox: "0 0 24 24",
|
|
1025
1551
|
strokeWidth: 3,
|
|
1552
|
+
style: !B && (l || c) ? { color: x } : void 0,
|
|
1026
1553
|
children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M5 13l4 4L19 7" })
|
|
1027
1554
|
}
|
|
1028
1555
|
),
|
|
1029
1556
|
c && /* @__PURE__ */ e(
|
|
1030
1557
|
"svg",
|
|
1031
1558
|
{
|
|
1032
|
-
className: `${
|
|
1559
|
+
className: `${p[u]} ${P()}`,
|
|
1033
1560
|
fill: "currentColor",
|
|
1034
1561
|
viewBox: "0 0 24 24",
|
|
1562
|
+
style: !B && (l || c) ? { color: x } : void 0,
|
|
1035
1563
|
children: /* @__PURE__ */ e("rect", { x: "4", y: "11", width: "16", height: "2", rx: "1" })
|
|
1036
1564
|
}
|
|
1037
1565
|
)
|
|
@@ -1039,92 +1567,182 @@ const D = ({
|
|
|
1039
1567
|
}
|
|
1040
1568
|
)
|
|
1041
1569
|
] });
|
|
1042
|
-
},
|
|
1570
|
+
}, Y = (s = "md") => ({
|
|
1571
|
+
sm: {
|
|
1572
|
+
container: "space-y-1",
|
|
1573
|
+
item: "px-2 py-1.5",
|
|
1574
|
+
label: "text-xs",
|
|
1575
|
+
sublabel: "text-[10px]",
|
|
1576
|
+
button: "w-5 h-5",
|
|
1577
|
+
icon: "w-3 h-3"
|
|
1578
|
+
},
|
|
1579
|
+
md: {
|
|
1580
|
+
container: "space-y-2",
|
|
1581
|
+
item: "px-4 py-3",
|
|
1582
|
+
label: "text-sm",
|
|
1583
|
+
sublabel: "text-xs",
|
|
1584
|
+
button: "w-6 h-6",
|
|
1585
|
+
icon: "w-4 h-4"
|
|
1586
|
+
},
|
|
1587
|
+
lg: {
|
|
1588
|
+
container: "space-y-3",
|
|
1589
|
+
item: "px-5 py-4",
|
|
1590
|
+
label: "text-base",
|
|
1591
|
+
sublabel: "text-sm",
|
|
1592
|
+
button: "w-7 h-7",
|
|
1593
|
+
icon: "w-5 h-5"
|
|
1594
|
+
},
|
|
1595
|
+
responsive: {
|
|
1596
|
+
container: "space-y-1 sm:space-y-2 md:space-y-3",
|
|
1597
|
+
item: "px-2 py-1.5 sm:px-3 sm:py-2 md:px-4 md:py-3 lg:px-5 lg:py-4",
|
|
1598
|
+
label: "text-xs sm:text-sm md:text-base",
|
|
1599
|
+
sublabel: "text-[10px] sm:text-xs md:text-sm",
|
|
1600
|
+
button: "w-5 h-5 sm:w-5 sm:h-5 md:w-6 md:h-6 lg:w-7 lg:h-7",
|
|
1601
|
+
icon: "w-3 h-3 sm:w-3 sm:h-3 md:w-4 md:h-4 lg:w-5 lg:h-5"
|
|
1602
|
+
}
|
|
1603
|
+
})[s], Z = (s = "md") => ({
|
|
1604
|
+
none: "rounded-none",
|
|
1605
|
+
sm: "rounded-sm",
|
|
1606
|
+
md: "rounded-lg",
|
|
1607
|
+
lg: "rounded-xl",
|
|
1608
|
+
full: "rounded-full"
|
|
1609
|
+
})[s], me = ({
|
|
1043
1610
|
items: s,
|
|
1044
1611
|
onRemove: a,
|
|
1045
|
-
emptyMessage:
|
|
1612
|
+
emptyMessage: n = "No items selected",
|
|
1046
1613
|
className: t = "",
|
|
1047
1614
|
itemClassName: c = "",
|
|
1048
|
-
maxHeight:
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1615
|
+
maxHeight: u = "300px",
|
|
1616
|
+
size: $ = "md",
|
|
1617
|
+
bgColor: i,
|
|
1618
|
+
hoverBgColor: o,
|
|
1619
|
+
textColor: m,
|
|
1620
|
+
sublabelColor: g,
|
|
1621
|
+
removeButtonColor: x,
|
|
1622
|
+
removeButtonHoverColor: b,
|
|
1623
|
+
rounded: h = "md",
|
|
1624
|
+
style: r
|
|
1625
|
+
}) => {
|
|
1626
|
+
const w = Y($), d = Z(h), y = "#F4F4F4", l = "#EBEBEB", f = "#181918", N = "#999999", p = "#9CA3AF", B = "#EC615B", k = i || y, T = o || l, P = m || f, L = g || N, M = x || p, F = b || B;
|
|
1627
|
+
return s.length === 0 ? /* @__PURE__ */ e(
|
|
1628
|
+
"div",
|
|
1629
|
+
{
|
|
1630
|
+
className: `text-center py-8 text-gray-500 text-sm ${t}`,
|
|
1631
|
+
style: {
|
|
1632
|
+
color: L,
|
|
1633
|
+
...r
|
|
1634
|
+
},
|
|
1635
|
+
children: n
|
|
1636
|
+
}
|
|
1637
|
+
) : /* @__PURE__ */ e(
|
|
1638
|
+
"div",
|
|
1639
|
+
{
|
|
1640
|
+
className: `overflow-y-auto ${w.container} ${t}`,
|
|
1641
|
+
style: { maxHeight: u, ...r },
|
|
1642
|
+
children: s.map((j, S) => /* @__PURE__ */ C(
|
|
1643
|
+
"div",
|
|
1644
|
+
{
|
|
1645
|
+
className: `
|
|
1058
1646
|
group flex items-center justify-between
|
|
1059
|
-
|
|
1647
|
+
${d}
|
|
1060
1648
|
transition-all duration-300 ease-out
|
|
1061
|
-
hover:
|
|
1649
|
+
hover:shadow-sm
|
|
1062
1650
|
animate-slide-in-item
|
|
1063
1651
|
${c}
|
|
1064
1652
|
`,
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1653
|
+
style: {
|
|
1654
|
+
backgroundColor: k,
|
|
1655
|
+
animationDelay: `${S * 50}ms`
|
|
1656
|
+
},
|
|
1657
|
+
onMouseEnter: (E) => {
|
|
1658
|
+
E.currentTarget.style.backgroundColor = T;
|
|
1659
|
+
},
|
|
1660
|
+
onMouseLeave: (E) => {
|
|
1661
|
+
E.currentTarget.style.backgroundColor = k;
|
|
1662
|
+
},
|
|
1663
|
+
children: [
|
|
1664
|
+
/* @__PURE__ */ C("div", { className: `flex-1 min-w-0 ${w.item}`, children: [
|
|
1665
|
+
j.sublabel && /* @__PURE__ */ e(
|
|
1666
|
+
"div",
|
|
1667
|
+
{
|
|
1668
|
+
className: `font-normal mb-0.5 ${w.sublabel}`,
|
|
1669
|
+
style: { color: L },
|
|
1670
|
+
children: j.sublabel
|
|
1671
|
+
}
|
|
1672
|
+
),
|
|
1673
|
+
/* @__PURE__ */ e(
|
|
1674
|
+
"div",
|
|
1675
|
+
{
|
|
1676
|
+
className: `font-medium truncate ${w.label}`,
|
|
1677
|
+
style: { color: P },
|
|
1678
|
+
children: j.label
|
|
1679
|
+
}
|
|
1680
|
+
)
|
|
1681
|
+
] }),
|
|
1682
|
+
/* @__PURE__ */ e(
|
|
1683
|
+
"button",
|
|
1684
|
+
{
|
|
1685
|
+
onClick: () => a(j.id),
|
|
1686
|
+
className: `
|
|
1687
|
+
ml-3 flex-shrink-0 rounded-full
|
|
1080
1688
|
flex items-center justify-center
|
|
1081
|
-
text-gray-400
|
|
1082
1689
|
transition-all duration-200 ease-out
|
|
1083
|
-
hover:
|
|
1690
|
+
hover:scale-110
|
|
1084
1691
|
active:scale-95
|
|
1085
|
-
focus:outline-none focus:ring-2 focus:ring-
|
|
1692
|
+
focus:outline-none focus:ring-2 focus:ring-opacity-50
|
|
1693
|
+
${w.button}
|
|
1086
1694
|
`,
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
{
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1695
|
+
style: {
|
|
1696
|
+
color: M
|
|
1697
|
+
},
|
|
1698
|
+
onMouseEnter: (E) => {
|
|
1699
|
+
E.currentTarget.style.backgroundColor = "white", E.currentTarget.style.color = F;
|
|
1700
|
+
},
|
|
1701
|
+
onMouseLeave: (E) => {
|
|
1702
|
+
E.currentTarget.style.backgroundColor = "transparent", E.currentTarget.style.color = M;
|
|
1703
|
+
},
|
|
1704
|
+
"aria-label": `Remove ${j.label}`,
|
|
1705
|
+
children: /* @__PURE__ */ e(
|
|
1706
|
+
"svg",
|
|
1707
|
+
{
|
|
1708
|
+
className: w.icon,
|
|
1709
|
+
fill: "none",
|
|
1710
|
+
stroke: "currentColor",
|
|
1711
|
+
viewBox: "0 0 24 24",
|
|
1712
|
+
children: /* @__PURE__ */ e(
|
|
1713
|
+
"path",
|
|
1714
|
+
{
|
|
1715
|
+
strokeLinecap: "round",
|
|
1716
|
+
strokeLinejoin: "round",
|
|
1717
|
+
strokeWidth: 2,
|
|
1718
|
+
d: "M6 18L18 6M6 6l12 12"
|
|
1719
|
+
}
|
|
1720
|
+
)
|
|
1721
|
+
}
|
|
1722
|
+
)
|
|
1723
|
+
}
|
|
1724
|
+
)
|
|
1725
|
+
]
|
|
1726
|
+
},
|
|
1727
|
+
j.id
|
|
1728
|
+
))
|
|
1729
|
+
}
|
|
1730
|
+
);
|
|
1731
|
+
};
|
|
1114
1732
|
export {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1733
|
+
ie as Badge,
|
|
1734
|
+
ee as Button,
|
|
1735
|
+
re as Card,
|
|
1736
|
+
ue as Checkbox,
|
|
1737
|
+
ne as Dropdown,
|
|
1738
|
+
ae as Modal,
|
|
1739
|
+
ce as Progress,
|
|
1740
|
+
se as SearchInput,
|
|
1741
|
+
G as Select,
|
|
1742
|
+
me as SelectedItemsList,
|
|
1743
|
+
te as StatCard,
|
|
1744
|
+
de as Steps,
|
|
1745
|
+
le as Table,
|
|
1746
|
+
oe as TableTop
|
|
1129
1747
|
};
|
|
1130
1748
|
//# sourceMappingURL=index.mjs.map
|