rharuow-ds 1.3.2 → 1.4.1
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/README.md +68 -3
- package/dist/rharuow-ds.cjs.js +1 -1
- package/dist/rharuow-ds.es.js +714 -660
- package/dist/styles.css +1 -1
- package/dist/types/src/components/MultiSelect.d.ts +4 -0
- package/dist/types/src/components/Select.d.ts +4 -0
- package/dist/types/src/stories/Input.stories.d.ts +1 -0
- package/dist/types/src/stories/MultiSelect.stories.d.ts +17 -0
- package/dist/types/src/stories/Select.stories.d.ts +17 -0
- package/package.json +1 -1
package/dist/rharuow-ds.es.js
CHANGED
|
@@ -1,610 +1,647 @@
|
|
|
1
1
|
import * as e from "react";
|
|
2
|
-
import
|
|
3
|
-
import { useFormContext as
|
|
2
|
+
import I from "react";
|
|
3
|
+
import { useFormContext as te, useWatch as re } from "react-hook-form";
|
|
4
4
|
function se(t) {
|
|
5
|
-
var
|
|
6
|
-
if (typeof t == "string" || typeof t == "number")
|
|
5
|
+
var a, r, o = "";
|
|
6
|
+
if (typeof t == "string" || typeof t == "number") o += t;
|
|
7
7
|
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
8
|
-
var
|
|
9
|
-
for (
|
|
10
|
-
} else for (
|
|
11
|
-
return
|
|
8
|
+
var c = t.length;
|
|
9
|
+
for (a = 0; a < c; a++) t[a] && (r = se(t[a])) && (o && (o += " "), o += r);
|
|
10
|
+
} else for (r in t) t[r] && (o && (o += " "), o += r);
|
|
11
|
+
return o;
|
|
12
12
|
}
|
|
13
13
|
function ge() {
|
|
14
|
-
for (var t,
|
|
15
|
-
return
|
|
14
|
+
for (var t, a, r = 0, o = "", c = arguments.length; r < c; r++) (t = arguments[r]) && (a = se(t)) && (o && (o += " "), o += a);
|
|
15
|
+
return o;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
17
|
+
function i(...t) {
|
|
18
18
|
return ge(...t);
|
|
19
19
|
}
|
|
20
|
-
const
|
|
20
|
+
const ze = ({
|
|
21
21
|
children: t,
|
|
22
|
-
variant:
|
|
23
|
-
className:
|
|
24
|
-
...
|
|
22
|
+
variant: a = "default",
|
|
23
|
+
className: r = "",
|
|
24
|
+
...o
|
|
25
25
|
}) => {
|
|
26
|
-
const
|
|
26
|
+
const c = "px-4 py-2 rounded font-medium transition", C = {
|
|
27
27
|
default: "bg-[var(--primary,#2563eb)] text-[var(--primary-text,#fff)] hover:bg-[var(--primary-hover,#1d4ed8)]",
|
|
28
28
|
outline: "border border-[var(--primary,#2563eb)] text-[var(--primary,#2563eb)] bg-white hover:bg-[var(--primary-hover,#e0e7ff)]",
|
|
29
29
|
secondary: "bg-[var(--secondary,#fbbf24)] text-[var(--secondary-text,#222)] hover:bg-[var(--secondary-hover,#f59e42)]"
|
|
30
30
|
};
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
return /* @__PURE__ */ I.createElement("button", { className: i(c, C[a], r), ...o }, t);
|
|
32
32
|
}, he = e.forwardRef(
|
|
33
33
|
({
|
|
34
34
|
name: t,
|
|
35
|
-
className:
|
|
36
|
-
type:
|
|
37
|
-
label:
|
|
38
|
-
onFocus:
|
|
35
|
+
className: a,
|
|
36
|
+
type: r = "text",
|
|
37
|
+
label: o,
|
|
38
|
+
onFocus: c,
|
|
39
39
|
onBlur: C,
|
|
40
|
-
Icon:
|
|
41
|
-
iconClassName:
|
|
42
|
-
iconAction:
|
|
43
|
-
containerClassName:
|
|
44
|
-
...
|
|
45
|
-
},
|
|
46
|
-
var
|
|
47
|
-
const [
|
|
40
|
+
Icon: v,
|
|
41
|
+
iconClassName: V,
|
|
42
|
+
iconAction: B,
|
|
43
|
+
containerClassName: N,
|
|
44
|
+
...x
|
|
45
|
+
}, h) => {
|
|
46
|
+
var G, H, z;
|
|
47
|
+
const [f, R] = e.useState(!1), [g, S] = e.useState(!1), s = te(), m = s == null ? void 0 : s.control, b = s == null ? void 0 : s.register, _ = m && t ? re({ control: m, name: t }) : void 0, L = x.value ?? _ ?? "", y = (z = (H = (G = s == null ? void 0 : s.formState) == null ? void 0 : G.errors) == null ? void 0 : H[t]) == null ? void 0 : z.message, A = ["date", "datetime-local", "time", "month", "week"].includes(r), u = f || !!L || A, M = r === "password" ? g ? "text" : "password" : r, D = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
|
|
48
48
|
"path",
|
|
49
49
|
{
|
|
50
50
|
d: "M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z",
|
|
51
51
|
fill: "currentColor"
|
|
52
52
|
}
|
|
53
|
-
)),
|
|
53
|
+
)), w = () => /* @__PURE__ */ e.createElement("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, /* @__PURE__ */ e.createElement(
|
|
54
54
|
"path",
|
|
55
55
|
{
|
|
56
56
|
d: "M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z",
|
|
57
57
|
fill: "currentColor"
|
|
58
58
|
}
|
|
59
|
-
)),
|
|
60
|
-
|
|
59
|
+
)), X = () => {
|
|
60
|
+
S(!g);
|
|
61
61
|
};
|
|
62
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
62
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", N) }, /* @__PURE__ */ e.createElement(
|
|
63
63
|
"input",
|
|
64
64
|
{
|
|
65
|
-
id:
|
|
66
|
-
type:
|
|
67
|
-
className:
|
|
65
|
+
id: x.id || t,
|
|
66
|
+
type: M,
|
|
67
|
+
className: i(
|
|
68
68
|
"peer flex h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50",
|
|
69
|
-
|
|
69
|
+
r === "password" || v ? "pr-12" : "",
|
|
70
70
|
// espaço extra para qualquer ícone (password ou customizado)
|
|
71
|
-
|
|
71
|
+
a
|
|
72
72
|
),
|
|
73
|
-
onFocus: (
|
|
74
|
-
|
|
73
|
+
onFocus: (E) => {
|
|
74
|
+
R(!0), c && c(E);
|
|
75
75
|
},
|
|
76
|
-
...
|
|
77
|
-
const
|
|
76
|
+
...s && t ? (() => {
|
|
77
|
+
const E = b(t), j = E.onBlur;
|
|
78
78
|
return {
|
|
79
|
-
...
|
|
80
|
-
ref: (
|
|
81
|
-
typeof
|
|
79
|
+
...E,
|
|
80
|
+
ref: (O) => {
|
|
81
|
+
typeof h == "function" ? h(O) : h && (h.current = O), E.ref && E.ref(O);
|
|
82
82
|
},
|
|
83
|
-
onBlur: (
|
|
84
|
-
|
|
83
|
+
onBlur: (O) => {
|
|
84
|
+
R(!1), C && C(O), j && j(O);
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
87
|
})() : {
|
|
88
|
-
ref:
|
|
89
|
-
onBlur: (
|
|
90
|
-
|
|
88
|
+
ref: h,
|
|
89
|
+
onBlur: (E) => {
|
|
90
|
+
R(!1), C && C(E);
|
|
91
91
|
}
|
|
92
92
|
},
|
|
93
|
-
...
|
|
93
|
+
...x
|
|
94
94
|
}
|
|
95
|
-
),
|
|
95
|
+
), o && /* @__PURE__ */ e.createElement(
|
|
96
96
|
"label",
|
|
97
97
|
{
|
|
98
|
-
htmlFor:
|
|
99
|
-
className:
|
|
98
|
+
htmlFor: x.id || t,
|
|
99
|
+
className: i(
|
|
100
100
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
101
|
-
|
|
101
|
+
u ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
102
102
|
)
|
|
103
103
|
},
|
|
104
|
-
|
|
105
|
-
),
|
|
104
|
+
o
|
|
105
|
+
), r === "password" && /* @__PURE__ */ e.createElement(
|
|
106
106
|
"button",
|
|
107
107
|
{
|
|
108
108
|
type: "button",
|
|
109
109
|
className: "absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 hover:text-[var(--primary,#2563eb)] transition-colors duration-200 focus:outline-none focus:text-[var(--primary,#2563eb)]",
|
|
110
|
-
onClick:
|
|
111
|
-
"aria-label":
|
|
110
|
+
onClick: X,
|
|
111
|
+
"aria-label": g ? "Esconder senha" : "Mostrar senha",
|
|
112
112
|
tabIndex: -1
|
|
113
113
|
},
|
|
114
|
-
|
|
115
|
-
),
|
|
114
|
+
g ? /* @__PURE__ */ e.createElement(w, null) : /* @__PURE__ */ e.createElement(D, null)
|
|
115
|
+
), v && r !== "password" && /* @__PURE__ */ e.createElement(
|
|
116
116
|
"div",
|
|
117
117
|
{
|
|
118
|
-
className:
|
|
118
|
+
className: i(
|
|
119
119
|
"absolute top-1/2 right-3 -translate-y-1/2 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
|
|
120
|
-
|
|
120
|
+
V
|
|
121
121
|
),
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: B
|
|
123
123
|
},
|
|
124
|
-
/* @__PURE__ */ e.createElement(
|
|
125
|
-
),
|
|
124
|
+
/* @__PURE__ */ e.createElement(v, null)
|
|
125
|
+
), y && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, y));
|
|
126
126
|
}
|
|
127
127
|
);
|
|
128
128
|
he.displayName = "Input";
|
|
129
129
|
const we = e.forwardRef(
|
|
130
130
|
({
|
|
131
131
|
name: t,
|
|
132
|
-
label:
|
|
133
|
-
options:
|
|
134
|
-
className:
|
|
135
|
-
containerClassName:
|
|
132
|
+
label: a,
|
|
133
|
+
options: r,
|
|
134
|
+
className: o,
|
|
135
|
+
containerClassName: c,
|
|
136
136
|
isClearable: C,
|
|
137
|
-
|
|
138
|
-
|
|
137
|
+
searchable: v = !1,
|
|
138
|
+
filterPlaceholder: V = "Digite para filtrar...",
|
|
139
|
+
caseSensitive: B = !1,
|
|
140
|
+
filterFunction: N,
|
|
141
|
+
onFocus: x,
|
|
142
|
+
onBlur: h,
|
|
139
143
|
...f
|
|
140
|
-
},
|
|
141
|
-
var
|
|
142
|
-
const [
|
|
144
|
+
}, R) => {
|
|
145
|
+
var K, J, l, F;
|
|
146
|
+
const [g, S] = e.useState(!1), [s, m] = e.useState(!1), [b, _] = e.useState(""), [L, y] = e.useState({
|
|
143
147
|
top: 0,
|
|
144
148
|
left: 0,
|
|
145
149
|
width: 0
|
|
146
|
-
}),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
150
|
+
}), k = e.useRef(null), A = e.useRef(null), u = te(), M = u == null ? void 0 : u.control, D = M && t ? re({ control: M, name: t }) : void 0, w = f.value ?? D ?? "", X = (l = (J = (K = u == null ? void 0 : u.formState) == null ? void 0 : K.errors) == null ? void 0 : J[t]) == null ? void 0 : l.message, H = N || ((n, P) => {
|
|
151
|
+
const ee = B ? n.label : n.label.toLowerCase(), ae = B ? P : P.toLowerCase();
|
|
152
|
+
return ee.includes(ae);
|
|
153
|
+
}), z = b.trim() ? r.filter((n) => H(n, b.trim())) : r, E = r.find((n) => n.value === w), j = v && s ? b : (E == null ? void 0 : E.label) || "", O = g || !!w || v && !!b, T = e.useCallback(() => {
|
|
154
|
+
if (k.current && s) {
|
|
155
|
+
const n = k.current.getBoundingClientRect();
|
|
156
|
+
y({
|
|
157
|
+
top: n.bottom + window.scrollY + 4,
|
|
158
|
+
left: n.left + window.scrollX,
|
|
159
|
+
width: n.width
|
|
153
160
|
});
|
|
154
161
|
}
|
|
155
|
-
}, [
|
|
162
|
+
}, [s]);
|
|
156
163
|
e.useEffect(() => {
|
|
157
|
-
if (
|
|
158
|
-
const
|
|
159
|
-
return window.addEventListener("resize",
|
|
160
|
-
window.removeEventListener("resize",
|
|
164
|
+
if (T(), s) {
|
|
165
|
+
const n = () => T(), P = () => T();
|
|
166
|
+
return window.addEventListener("resize", n), window.addEventListener("scroll", P, !0), () => {
|
|
167
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", P, !0);
|
|
161
168
|
};
|
|
162
169
|
}
|
|
163
|
-
}, [
|
|
164
|
-
const
|
|
165
|
-
|
|
170
|
+
}, [s, T]), e.useEffect(() => {
|
|
171
|
+
const n = (P) => {
|
|
172
|
+
k.current && !k.current.contains(P.target) && (m(!1), S(!1));
|
|
166
173
|
};
|
|
167
|
-
return document.addEventListener("mousedown",
|
|
168
|
-
document.removeEventListener("mousedown",
|
|
174
|
+
return document.addEventListener("mousedown", n), () => {
|
|
175
|
+
document.removeEventListener("mousedown", n);
|
|
169
176
|
};
|
|
170
177
|
}, []);
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
},
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
|
|
178
|
+
const U = () => {
|
|
179
|
+
m((n) => !n), S(!0);
|
|
180
|
+
}, q = (n) => {
|
|
181
|
+
S(!0), x && x(n);
|
|
182
|
+
}, $ = (n) => {
|
|
183
|
+
h && h(n);
|
|
184
|
+
}, Z = (n) => {
|
|
185
|
+
_(n.target.value);
|
|
186
|
+
}, Q = (n) => {
|
|
187
|
+
if (u && t && u.setValue(t, n), f.onChange) {
|
|
188
|
+
const P = {
|
|
189
|
+
target: { value: n }
|
|
190
|
+
};
|
|
191
|
+
f.onChange(P);
|
|
192
|
+
}
|
|
193
|
+
m(!1), S(!1), _("");
|
|
177
194
|
};
|
|
178
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
195
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", c), ref: k }, /* @__PURE__ */ e.createElement(
|
|
179
196
|
"div",
|
|
180
197
|
{
|
|
181
198
|
id: f.id || t,
|
|
182
199
|
tabIndex: 0,
|
|
183
200
|
role: "button",
|
|
184
201
|
"aria-haspopup": "listbox",
|
|
185
|
-
"aria-expanded":
|
|
186
|
-
className:
|
|
202
|
+
"aria-expanded": s,
|
|
203
|
+
className: i(
|
|
187
204
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
188
|
-
|
|
205
|
+
o
|
|
189
206
|
),
|
|
190
|
-
onClick:
|
|
191
|
-
onFocus:
|
|
192
|
-
onBlur:
|
|
193
|
-
ref:
|
|
207
|
+
onClick: v ? void 0 : U,
|
|
208
|
+
onFocus: v ? void 0 : q,
|
|
209
|
+
onBlur: v ? void 0 : $,
|
|
210
|
+
ref: R
|
|
194
211
|
},
|
|
195
|
-
/* @__PURE__ */ e.createElement(
|
|
196
|
-
|
|
212
|
+
v ? /* @__PURE__ */ e.createElement(
|
|
213
|
+
"input",
|
|
214
|
+
{
|
|
215
|
+
ref: A,
|
|
216
|
+
type: "text",
|
|
217
|
+
value: j,
|
|
218
|
+
onChange: Z,
|
|
219
|
+
onFocus: v ? (n) => {
|
|
220
|
+
S(!0), m(!0), x && x(n);
|
|
221
|
+
} : void 0,
|
|
222
|
+
onBlur: v ? (n) => {
|
|
223
|
+
h && h(n);
|
|
224
|
+
} : void 0,
|
|
225
|
+
placeholder: a ? "" : V || "Selecione...",
|
|
226
|
+
className: i(
|
|
227
|
+
"w-full bg-transparent border-none outline-none text-sm",
|
|
228
|
+
!w && !b && "text-gray-400"
|
|
229
|
+
)
|
|
230
|
+
}
|
|
231
|
+
) : /* @__PURE__ */ e.createElement("span", { className: i("block truncate", !w && "text-gray-400") }, ((F = r.find((n) => n.value === w)) == null ? void 0 : F.label) || !a && "Selecione..."),
|
|
232
|
+
C && w && /* @__PURE__ */ e.createElement(
|
|
197
233
|
"button",
|
|
198
234
|
{
|
|
199
235
|
type: "button",
|
|
200
236
|
tabIndex: -1,
|
|
201
237
|
"aria-label": "Limpar seleção",
|
|
202
238
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
203
|
-
onClick: (
|
|
204
|
-
if (
|
|
205
|
-
const
|
|
239
|
+
onClick: (n) => {
|
|
240
|
+
if (n.stopPropagation(), u && t && u.setValue(t, ""), f.onChange) {
|
|
241
|
+
const P = {
|
|
206
242
|
target: { value: "" }
|
|
207
243
|
};
|
|
208
|
-
f.onChange(
|
|
244
|
+
f.onChange(P);
|
|
209
245
|
}
|
|
210
|
-
|
|
246
|
+
m(!1), S(!1);
|
|
211
247
|
}
|
|
212
248
|
},
|
|
213
249
|
"✕"
|
|
214
250
|
)
|
|
215
|
-
),
|
|
251
|
+
), a && /* @__PURE__ */ e.createElement(
|
|
216
252
|
"label",
|
|
217
253
|
{
|
|
218
254
|
htmlFor: f.id || t,
|
|
219
|
-
className:
|
|
255
|
+
className: i(
|
|
220
256
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
221
|
-
|
|
257
|
+
O ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
222
258
|
)
|
|
223
259
|
},
|
|
224
|
-
|
|
260
|
+
a
|
|
225
261
|
), /* @__PURE__ */ e.createElement(
|
|
226
262
|
"div",
|
|
227
263
|
{
|
|
228
|
-
className:
|
|
264
|
+
className: i(
|
|
229
265
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
230
266
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
231
|
-
|
|
267
|
+
s ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
232
268
|
),
|
|
233
269
|
style: {
|
|
234
|
-
maxHeight:
|
|
270
|
+
maxHeight: s ? "9.5rem" : "0",
|
|
235
271
|
// 3 options * 2.5rem + padding
|
|
236
|
-
overflowY:
|
|
272
|
+
overflowY: r.length > 3 ? "auto" : "hidden",
|
|
237
273
|
position: "fixed",
|
|
238
274
|
// Use fixed positioning to escape container overflow
|
|
239
|
-
top:
|
|
240
|
-
left:
|
|
241
|
-
width:
|
|
275
|
+
top: s ? L.top : "auto",
|
|
276
|
+
left: s ? L.left : "auto",
|
|
277
|
+
width: s ? L.width : "auto",
|
|
242
278
|
zIndex: 9999,
|
|
243
|
-
boxShadow:
|
|
279
|
+
boxShadow: s ? "var(--select-dropdown-shadow)" : "none"
|
|
244
280
|
}
|
|
245
281
|
},
|
|
246
|
-
|
|
282
|
+
z.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : z.map((n) => /* @__PURE__ */ e.createElement(
|
|
247
283
|
"div",
|
|
248
284
|
{
|
|
249
|
-
key:
|
|
250
|
-
className:
|
|
285
|
+
key: n.value,
|
|
286
|
+
className: i(
|
|
251
287
|
"px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
|
|
252
288
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
253
|
-
|
|
289
|
+
w === n.value && "bg-[var(--select-dropdown-selected)]"
|
|
254
290
|
),
|
|
255
|
-
onMouseDown: () =>
|
|
256
|
-
if (l && t && l.setValue(t, c.value), f.onChange) {
|
|
257
|
-
const r = {
|
|
258
|
-
target: { value: c.value }
|
|
259
|
-
};
|
|
260
|
-
f.onChange(r);
|
|
261
|
-
}
|
|
262
|
-
p(!0);
|
|
263
|
-
}
|
|
291
|
+
onMouseDown: () => Q(n.value)
|
|
264
292
|
},
|
|
265
|
-
|
|
293
|
+
n.label
|
|
266
294
|
))
|
|
267
|
-
),
|
|
295
|
+
), X && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, X));
|
|
268
296
|
}
|
|
269
297
|
);
|
|
270
298
|
we.displayName = "Select";
|
|
271
299
|
const ye = e.forwardRef(
|
|
272
300
|
({
|
|
273
301
|
name: t,
|
|
274
|
-
className:
|
|
275
|
-
label:
|
|
276
|
-
onFocus:
|
|
277
|
-
onBlur:
|
|
302
|
+
className: a,
|
|
303
|
+
label: r,
|
|
304
|
+
onFocus: o,
|
|
305
|
+
onBlur: c,
|
|
278
306
|
Icon: C,
|
|
279
|
-
iconClassName:
|
|
280
|
-
iconAction:
|
|
281
|
-
containerClassName:
|
|
282
|
-
rows:
|
|
283
|
-
...
|
|
284
|
-
},
|
|
285
|
-
var
|
|
286
|
-
const [
|
|
287
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
307
|
+
iconClassName: v,
|
|
308
|
+
iconAction: V,
|
|
309
|
+
containerClassName: B,
|
|
310
|
+
rows: N = 4,
|
|
311
|
+
...x
|
|
312
|
+
}, h) => {
|
|
313
|
+
var y, k, A;
|
|
314
|
+
const [f, R] = e.useState(!1), g = te(), S = g == null ? void 0 : g.control, s = g == null ? void 0 : g.register, m = S && t ? re({ control: S, name: t }) : void 0, b = x.value ?? m ?? "", _ = (A = (k = (y = g == null ? void 0 : g.formState) == null ? void 0 : y.errors) == null ? void 0 : k[t]) == null ? void 0 : A.message, L = f || !!b;
|
|
315
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", B) }, /* @__PURE__ */ e.createElement(
|
|
288
316
|
"textarea",
|
|
289
317
|
{
|
|
290
|
-
id:
|
|
291
|
-
rows:
|
|
292
|
-
className:
|
|
318
|
+
id: x.id || t,
|
|
319
|
+
rows: N,
|
|
320
|
+
className: i(
|
|
293
321
|
"peer flex min-h-[80px] w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 pt-6 pb-2 text-sm placeholder-transparent transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 resize-vertical",
|
|
294
322
|
C ? "pr-12" : "",
|
|
295
323
|
// espaço extra para ícone customizado
|
|
296
|
-
|
|
324
|
+
a
|
|
297
325
|
),
|
|
298
|
-
onFocus: (
|
|
299
|
-
|
|
326
|
+
onFocus: (u) => {
|
|
327
|
+
R(!0), o && o(u);
|
|
300
328
|
},
|
|
301
|
-
...
|
|
302
|
-
const
|
|
329
|
+
...g && t ? (() => {
|
|
330
|
+
const u = s(t), M = u.onBlur;
|
|
303
331
|
return {
|
|
304
|
-
...
|
|
305
|
-
ref: (
|
|
306
|
-
typeof
|
|
332
|
+
...u,
|
|
333
|
+
ref: (D) => {
|
|
334
|
+
typeof h == "function" ? h(D) : h && (h.current = D), u.ref && u.ref(D);
|
|
307
335
|
},
|
|
308
|
-
onBlur: (
|
|
309
|
-
|
|
336
|
+
onBlur: (D) => {
|
|
337
|
+
R(!1), c && c(D), M && M(D);
|
|
310
338
|
}
|
|
311
339
|
};
|
|
312
340
|
})() : {
|
|
313
|
-
ref:
|
|
314
|
-
onBlur: (
|
|
315
|
-
|
|
341
|
+
ref: h,
|
|
342
|
+
onBlur: (u) => {
|
|
343
|
+
R(!1), c && c(u);
|
|
316
344
|
}
|
|
317
345
|
},
|
|
318
|
-
...
|
|
346
|
+
...x
|
|
319
347
|
}
|
|
320
|
-
),
|
|
348
|
+
), r && /* @__PURE__ */ e.createElement(
|
|
321
349
|
"label",
|
|
322
350
|
{
|
|
323
|
-
htmlFor:
|
|
324
|
-
className:
|
|
351
|
+
htmlFor: x.id || t,
|
|
352
|
+
className: i(
|
|
325
353
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
326
|
-
|
|
354
|
+
L ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
327
355
|
)
|
|
328
356
|
},
|
|
329
|
-
|
|
357
|
+
r
|
|
330
358
|
), C && /* @__PURE__ */ e.createElement(
|
|
331
359
|
"div",
|
|
332
360
|
{
|
|
333
|
-
className:
|
|
361
|
+
className: i(
|
|
334
362
|
"absolute top-3 right-3 text-gray-400 cursor-pointer hover:text-[var(--primary,#2563eb)] transition-colors duration-200",
|
|
335
|
-
|
|
363
|
+
v
|
|
336
364
|
),
|
|
337
|
-
onClick:
|
|
365
|
+
onClick: V
|
|
338
366
|
},
|
|
339
367
|
/* @__PURE__ */ e.createElement(C, null)
|
|
340
|
-
),
|
|
368
|
+
), _ && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, _));
|
|
341
369
|
}
|
|
342
370
|
);
|
|
343
371
|
ye.displayName = "Textarea";
|
|
344
372
|
const Ee = e.forwardRef(
|
|
345
373
|
({
|
|
346
374
|
name: t,
|
|
347
|
-
label:
|
|
348
|
-
loadOptions:
|
|
349
|
-
className:
|
|
350
|
-
containerClassName:
|
|
375
|
+
label: a,
|
|
376
|
+
loadOptions: r,
|
|
377
|
+
className: o,
|
|
378
|
+
containerClassName: c,
|
|
351
379
|
isClearable: C,
|
|
352
|
-
defaultOptions:
|
|
353
|
-
loadingMessage:
|
|
354
|
-
noOptionsMessage:
|
|
355
|
-
searchable:
|
|
356
|
-
debounceMs:
|
|
357
|
-
onFocus:
|
|
358
|
-
onBlur:
|
|
359
|
-
...
|
|
360
|
-
},
|
|
361
|
-
var
|
|
362
|
-
const [
|
|
380
|
+
defaultOptions: v = !1,
|
|
381
|
+
loadingMessage: V = "Carregando...",
|
|
382
|
+
noOptionsMessage: B = "Nenhuma opção encontrada",
|
|
383
|
+
searchable: N = !1,
|
|
384
|
+
debounceMs: x = 300,
|
|
385
|
+
onFocus: h,
|
|
386
|
+
onBlur: f,
|
|
387
|
+
...R
|
|
388
|
+
}, g) => {
|
|
389
|
+
var ee, ae, ne;
|
|
390
|
+
const [S, s] = e.useState(!1), [m, b] = e.useState(!1), [_, L] = e.useState([]), [y, k] = e.useState(!1), [A, u] = e.useState(""), [M, D] = e.useState(""), [w, X] = e.useState({
|
|
363
391
|
top: 0,
|
|
364
392
|
left: 0,
|
|
365
393
|
width: 0
|
|
366
|
-
}),
|
|
367
|
-
if (
|
|
368
|
-
const
|
|
369
|
-
|
|
370
|
-
top:
|
|
371
|
-
left:
|
|
372
|
-
width:
|
|
394
|
+
}), G = e.useRef(null), H = e.useRef(null), z = te(), E = z == null ? void 0 : z.control, j = E && t ? re({ control: E, name: t }) : void 0, O = R.value ?? j ?? "", T = (ne = (ae = (ee = z == null ? void 0 : z.formState) == null ? void 0 : ee.errors) == null ? void 0 : ae[t]) == null ? void 0 : ne.message, U = S || !!O, q = e.useCallback(() => {
|
|
395
|
+
if (G.current && m) {
|
|
396
|
+
const p = G.current.getBoundingClientRect();
|
|
397
|
+
X({
|
|
398
|
+
top: p.bottom + window.scrollY + 4,
|
|
399
|
+
left: p.left + window.scrollX,
|
|
400
|
+
width: p.width
|
|
373
401
|
});
|
|
374
402
|
}
|
|
375
|
-
}, [
|
|
403
|
+
}, [m]);
|
|
376
404
|
e.useEffect(() => {
|
|
377
|
-
if (
|
|
378
|
-
const
|
|
379
|
-
return window.addEventListener("resize",
|
|
380
|
-
window.removeEventListener("resize",
|
|
405
|
+
if (q(), m) {
|
|
406
|
+
const p = () => q(), Y = () => q();
|
|
407
|
+
return window.addEventListener("resize", p), window.addEventListener("scroll", Y, !0), () => {
|
|
408
|
+
window.removeEventListener("resize", p), window.removeEventListener("scroll", Y, !0);
|
|
381
409
|
};
|
|
382
410
|
}
|
|
383
|
-
}, [
|
|
384
|
-
const
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
return () => clearTimeout(
|
|
388
|
-
}, [
|
|
389
|
-
(
|
|
390
|
-
}, [
|
|
391
|
-
|
|
411
|
+
}, [m, q]), e.useEffect(() => {
|
|
412
|
+
const p = setTimeout(() => {
|
|
413
|
+
D(A);
|
|
414
|
+
}, x);
|
|
415
|
+
return () => clearTimeout(p);
|
|
416
|
+
}, [A, x]), e.useEffect(() => {
|
|
417
|
+
(m || v && _.length === 0) && $(N ? M : void 0);
|
|
418
|
+
}, [M, m]), e.useEffect(() => {
|
|
419
|
+
v === !0 ? $() : Array.isArray(v) && L(v);
|
|
392
420
|
}, []);
|
|
393
|
-
const
|
|
421
|
+
const $ = async (p) => {
|
|
394
422
|
try {
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
} catch (
|
|
399
|
-
console.error("Error loading options:",
|
|
423
|
+
k(!0);
|
|
424
|
+
const Y = await r(p);
|
|
425
|
+
L(Y);
|
|
426
|
+
} catch (Y) {
|
|
427
|
+
console.error("Error loading options:", Y), L([]);
|
|
400
428
|
} finally {
|
|
401
|
-
|
|
429
|
+
k(!1);
|
|
402
430
|
}
|
|
403
431
|
};
|
|
404
432
|
e.useEffect(() => {
|
|
405
|
-
const
|
|
406
|
-
|
|
433
|
+
const p = (Y) => {
|
|
434
|
+
G.current && !G.current.contains(Y.target) && (b(!1), s(!1), u(""));
|
|
407
435
|
};
|
|
408
|
-
return document.addEventListener("mousedown",
|
|
409
|
-
document.removeEventListener("mousedown",
|
|
436
|
+
return document.addEventListener("mousedown", p), () => {
|
|
437
|
+
document.removeEventListener("mousedown", p);
|
|
410
438
|
};
|
|
411
439
|
}, []);
|
|
412
|
-
const
|
|
413
|
-
|
|
414
|
-
var
|
|
415
|
-
return (
|
|
440
|
+
const Z = () => {
|
|
441
|
+
m || (b(!0), s(!0), N && H.current && setTimeout(() => {
|
|
442
|
+
var p;
|
|
443
|
+
return (p = H.current) == null ? void 0 : p.focus();
|
|
416
444
|
}, 0));
|
|
417
|
-
},
|
|
418
|
-
|
|
419
|
-
}, K = (
|
|
420
|
-
|
|
421
|
-
},
|
|
422
|
-
|
|
423
|
-
},
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
target: { value:
|
|
445
|
+
}, Q = (p) => {
|
|
446
|
+
s(!0), h && h(p);
|
|
447
|
+
}, K = (p) => {
|
|
448
|
+
f && f(p);
|
|
449
|
+
}, J = (p) => {
|
|
450
|
+
u(p.target.value);
|
|
451
|
+
}, l = (p) => {
|
|
452
|
+
if (z && t && z.setValue(t, p), R.onChange) {
|
|
453
|
+
const Y = {
|
|
454
|
+
target: { value: p }
|
|
427
455
|
};
|
|
428
|
-
|
|
456
|
+
R.onChange(Y);
|
|
429
457
|
}
|
|
430
|
-
|
|
431
|
-
},
|
|
432
|
-
if (
|
|
433
|
-
const
|
|
458
|
+
b(!1), s(!1), u("");
|
|
459
|
+
}, F = (p) => {
|
|
460
|
+
if (p.stopPropagation(), z && t && z.setValue(t, ""), R.onChange) {
|
|
461
|
+
const Y = {
|
|
434
462
|
target: { value: "" }
|
|
435
463
|
};
|
|
436
|
-
|
|
464
|
+
R.onChange(Y);
|
|
437
465
|
}
|
|
438
|
-
|
|
439
|
-
},
|
|
440
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
466
|
+
b(!1), s(!1), u("");
|
|
467
|
+
}, n = _.find((p) => p.value === O), P = N && m ? A : (n == null ? void 0 : n.label) || "";
|
|
468
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", c), ref: G }, /* @__PURE__ */ e.createElement(
|
|
441
469
|
"div",
|
|
442
470
|
{
|
|
443
|
-
id:
|
|
444
|
-
tabIndex:
|
|
471
|
+
id: R.id || t,
|
|
472
|
+
tabIndex: N ? -1 : 0,
|
|
445
473
|
role: "button",
|
|
446
474
|
"aria-haspopup": "listbox",
|
|
447
|
-
"aria-expanded":
|
|
448
|
-
className:
|
|
475
|
+
"aria-expanded": m,
|
|
476
|
+
className: i(
|
|
449
477
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
450
|
-
|
|
478
|
+
o
|
|
451
479
|
),
|
|
452
|
-
onClick:
|
|
453
|
-
onFocus:
|
|
454
|
-
onBlur:
|
|
455
|
-
ref:
|
|
480
|
+
onClick: Z,
|
|
481
|
+
onFocus: N ? void 0 : Q,
|
|
482
|
+
onBlur: N ? void 0 : K,
|
|
483
|
+
ref: g
|
|
456
484
|
},
|
|
457
|
-
|
|
485
|
+
N ? /* @__PURE__ */ e.createElement(
|
|
458
486
|
"input",
|
|
459
487
|
{
|
|
460
|
-
ref:
|
|
488
|
+
ref: H,
|
|
461
489
|
type: "text",
|
|
462
|
-
value:
|
|
463
|
-
onChange:
|
|
464
|
-
onFocus:
|
|
490
|
+
value: P,
|
|
491
|
+
onChange: J,
|
|
492
|
+
onFocus: Q,
|
|
465
493
|
onBlur: K,
|
|
466
|
-
placeholder:
|
|
467
|
-
className:
|
|
494
|
+
placeholder: a ? "" : "Selecione...",
|
|
495
|
+
className: i(
|
|
468
496
|
"w-full bg-transparent border-none outline-none text-sm",
|
|
469
|
-
!
|
|
497
|
+
!O && !A && "text-gray-400"
|
|
470
498
|
)
|
|
471
499
|
}
|
|
472
|
-
) : /* @__PURE__ */ e.createElement("span", { className:
|
|
473
|
-
|
|
474
|
-
C &&
|
|
500
|
+
) : /* @__PURE__ */ e.createElement("span", { className: i("block truncate", !O && "text-gray-400") }, (n == null ? void 0 : n.label) || !a && "Selecione..."),
|
|
501
|
+
y && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
|
|
502
|
+
C && O && !y && /* @__PURE__ */ e.createElement(
|
|
475
503
|
"button",
|
|
476
504
|
{
|
|
477
505
|
type: "button",
|
|
478
506
|
tabIndex: -1,
|
|
479
507
|
"aria-label": "Limpar seleção",
|
|
480
508
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
481
|
-
onClick:
|
|
509
|
+
onClick: F
|
|
482
510
|
},
|
|
483
511
|
"✕"
|
|
484
512
|
)
|
|
485
|
-
),
|
|
513
|
+
), a && /* @__PURE__ */ e.createElement(
|
|
486
514
|
"label",
|
|
487
515
|
{
|
|
488
|
-
htmlFor:
|
|
489
|
-
className:
|
|
516
|
+
htmlFor: R.id || t,
|
|
517
|
+
className: i(
|
|
490
518
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
491
|
-
|
|
519
|
+
U ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
492
520
|
)
|
|
493
521
|
},
|
|
494
|
-
|
|
522
|
+
a
|
|
495
523
|
), /* @__PURE__ */ e.createElement(
|
|
496
524
|
"div",
|
|
497
525
|
{
|
|
498
|
-
className:
|
|
526
|
+
className: i(
|
|
499
527
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
500
528
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
501
|
-
|
|
529
|
+
m ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
502
530
|
),
|
|
503
531
|
style: {
|
|
504
|
-
maxHeight:
|
|
505
|
-
overflowY:
|
|
532
|
+
maxHeight: m ? "9.5rem" : "0",
|
|
533
|
+
overflowY: _.length > 3 ? "auto" : "hidden",
|
|
506
534
|
position: "fixed",
|
|
507
535
|
// Use fixed positioning to escape container overflow
|
|
508
|
-
top:
|
|
509
|
-
left:
|
|
510
|
-
width:
|
|
536
|
+
top: m ? w.top : "auto",
|
|
537
|
+
left: m ? w.left : "auto",
|
|
538
|
+
width: m ? w.width : "auto",
|
|
511
539
|
zIndex: 9999,
|
|
512
|
-
boxShadow:
|
|
540
|
+
boxShadow: m ? "var(--select-dropdown-shadow)" : "none"
|
|
513
541
|
}
|
|
514
542
|
},
|
|
515
|
-
|
|
543
|
+
y ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, V) : _.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, B) : _.map((p) => /* @__PURE__ */ e.createElement(
|
|
516
544
|
"div",
|
|
517
545
|
{
|
|
518
|
-
key:
|
|
519
|
-
className:
|
|
546
|
+
key: p.value,
|
|
547
|
+
className: i(
|
|
520
548
|
"px-3 py-2 cursor-pointer text-sm transition-colors duration-150",
|
|
521
549
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
522
|
-
|
|
550
|
+
O === p.value && "bg-[var(--select-dropdown-selected)]"
|
|
523
551
|
),
|
|
524
|
-
onMouseDown: () =>
|
|
552
|
+
onMouseDown: () => l(p.value)
|
|
525
553
|
},
|
|
526
|
-
|
|
554
|
+
p.label
|
|
527
555
|
))
|
|
528
|
-
),
|
|
556
|
+
), T && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, T));
|
|
529
557
|
}
|
|
530
558
|
);
|
|
531
559
|
Ee.displayName = "AsyncSelect";
|
|
532
560
|
const Ne = e.forwardRef(
|
|
533
561
|
({
|
|
534
562
|
name: t,
|
|
535
|
-
label:
|
|
536
|
-
options:
|
|
537
|
-
className:
|
|
538
|
-
containerClassName:
|
|
563
|
+
label: a,
|
|
564
|
+
options: r,
|
|
565
|
+
className: o,
|
|
566
|
+
containerClassName: c,
|
|
539
567
|
isClearable: C,
|
|
540
|
-
|
|
541
|
-
|
|
568
|
+
searchable: v = !1,
|
|
569
|
+
filterPlaceholder: V = "Digite para filtrar...",
|
|
570
|
+
caseSensitive: B = !1,
|
|
571
|
+
filterFunction: N,
|
|
572
|
+
onFocus: x,
|
|
573
|
+
onBlur: h,
|
|
542
574
|
...f
|
|
543
|
-
},
|
|
544
|
-
var
|
|
545
|
-
const [
|
|
575
|
+
}, R) => {
|
|
576
|
+
var Q, K, J;
|
|
577
|
+
const [g, S] = e.useState(!1), [s, m] = e.useState(!1), [b, _] = e.useState(""), [L, y] = e.useState({
|
|
546
578
|
top: 0,
|
|
547
579
|
left: 0,
|
|
548
580
|
width: 0
|
|
549
|
-
}),
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
581
|
+
}), k = e.useRef(null), A = e.useRef(null), u = te(), M = u == null ? void 0 : u.control, D = M && t ? re({ control: M, name: t }) : void 0, w = f.value ?? D ?? [], X = (J = (K = (Q = u == null ? void 0 : u.formState) == null ? void 0 : Q.errors) == null ? void 0 : K[t]) == null ? void 0 : J.message, H = N || ((l, F) => {
|
|
582
|
+
const n = B ? l.label : l.label.toLowerCase(), P = B ? F : F.toLowerCase();
|
|
583
|
+
return n.includes(P);
|
|
584
|
+
}), z = b.trim() ? r.filter((l) => H(l, b.trim())) : r, E = g || w && w.length > 0 || v && !!b, j = e.useCallback(() => {
|
|
585
|
+
if (k.current && s) {
|
|
586
|
+
const l = k.current.getBoundingClientRect();
|
|
587
|
+
y({
|
|
588
|
+
top: l.bottom + window.scrollY + 4,
|
|
589
|
+
left: l.left + window.scrollX,
|
|
590
|
+
width: l.width
|
|
556
591
|
});
|
|
557
592
|
}
|
|
558
|
-
}, [
|
|
593
|
+
}, [s]);
|
|
559
594
|
e.useEffect(() => {
|
|
560
|
-
if (
|
|
561
|
-
const
|
|
562
|
-
return window.addEventListener("resize",
|
|
563
|
-
window.removeEventListener("resize",
|
|
595
|
+
if (j(), s) {
|
|
596
|
+
const l = () => j(), F = () => j();
|
|
597
|
+
return window.addEventListener("resize", l), window.addEventListener("scroll", F, !0), () => {
|
|
598
|
+
window.removeEventListener("resize", l), window.removeEventListener("scroll", F, !0);
|
|
564
599
|
};
|
|
565
600
|
}
|
|
566
|
-
}, [
|
|
567
|
-
const
|
|
568
|
-
|
|
601
|
+
}, [s, j]), e.useEffect(() => {
|
|
602
|
+
const l = (F) => {
|
|
603
|
+
k.current && !k.current.contains(F.target) && (m(!1), S(!1));
|
|
569
604
|
};
|
|
570
|
-
return document.addEventListener("mousedown",
|
|
571
|
-
document.removeEventListener("mousedown",
|
|
605
|
+
return document.addEventListener("mousedown", l), () => {
|
|
606
|
+
document.removeEventListener("mousedown", l);
|
|
572
607
|
};
|
|
573
608
|
}, []);
|
|
574
|
-
const
|
|
575
|
-
|
|
576
|
-
},
|
|
577
|
-
|
|
578
|
-
},
|
|
579
|
-
|
|
580
|
-
},
|
|
581
|
-
var
|
|
582
|
-
let
|
|
583
|
-
|
|
584
|
-
target: { value:
|
|
585
|
-
})),
|
|
586
|
-
},
|
|
587
|
-
var
|
|
588
|
-
|
|
609
|
+
const O = () => {
|
|
610
|
+
m((l) => !l), S(!0);
|
|
611
|
+
}, T = (l) => {
|
|
612
|
+
S(!0), x && x(l);
|
|
613
|
+
}, U = (l) => {
|
|
614
|
+
h && h(l);
|
|
615
|
+
}, q = (l) => {
|
|
616
|
+
var n;
|
|
617
|
+
let F;
|
|
618
|
+
w.includes(l) ? F = w.filter((P) => P !== l) : F = [...w, l], u && t && u.setValue(t, F), f.onChange && ((n = f.onChange) == null || n.call(f, {
|
|
619
|
+
target: { value: F }
|
|
620
|
+
})), S(!0);
|
|
621
|
+
}, $ = (l) => {
|
|
622
|
+
var F;
|
|
623
|
+
l.stopPropagation(), u && t && u.setValue(t, []), f.onChange && ((F = f.onChange) == null || F.call(f, {
|
|
589
624
|
target: { value: [] }
|
|
590
|
-
})),
|
|
625
|
+
})), m(!1), S(!1);
|
|
626
|
+
}, Z = (l) => {
|
|
627
|
+
_(l.target.value);
|
|
591
628
|
};
|
|
592
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
629
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", c), ref: k }, /* @__PURE__ */ e.createElement(
|
|
593
630
|
"div",
|
|
594
631
|
{
|
|
595
632
|
id: f.id || t,
|
|
596
633
|
tabIndex: 0,
|
|
597
634
|
role: "button",
|
|
598
635
|
"aria-haspopup": "listbox",
|
|
599
|
-
"aria-expanded":
|
|
600
|
-
className:
|
|
636
|
+
"aria-expanded": s,
|
|
637
|
+
className: i(
|
|
601
638
|
"peer flex items-center h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-3 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
602
|
-
|
|
639
|
+
o
|
|
603
640
|
),
|
|
604
|
-
onClick:
|
|
605
|
-
onFocus:
|
|
606
|
-
onBlur:
|
|
607
|
-
ref:
|
|
641
|
+
onClick: v ? void 0 : O,
|
|
642
|
+
onFocus: v ? void 0 : T,
|
|
643
|
+
onBlur: v ? void 0 : U,
|
|
644
|
+
ref: R
|
|
608
645
|
},
|
|
609
646
|
/* @__PURE__ */ e.createElement(
|
|
610
647
|
"div",
|
|
@@ -612,26 +649,26 @@ const Ne = e.forwardRef(
|
|
|
612
649
|
className: "flex flex-nowrap gap-1 items-center min-h-[1.5rem] w-full overflow-x-auto",
|
|
613
650
|
style: { scrollbarWidth: "none" }
|
|
614
651
|
},
|
|
615
|
-
|
|
652
|
+
w && w.length > 0 ? r.filter((l) => w.includes(l.value)).map((l) => /* @__PURE__ */ e.createElement(
|
|
616
653
|
"span",
|
|
617
654
|
{
|
|
618
|
-
key:
|
|
655
|
+
key: l.value,
|
|
619
656
|
className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm mr-1 gap-2",
|
|
620
657
|
style: { maxWidth: "140px" }
|
|
621
658
|
},
|
|
622
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate", title:
|
|
659
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate", title: l.label }, l.label),
|
|
623
660
|
/* @__PURE__ */ e.createElement(
|
|
624
661
|
"button",
|
|
625
662
|
{
|
|
626
663
|
type: "button",
|
|
627
664
|
className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
|
|
628
|
-
"aria-label": `Remover ${
|
|
665
|
+
"aria-label": `Remover ${l.label}`,
|
|
629
666
|
tabIndex: -1,
|
|
630
|
-
onClick: (
|
|
631
|
-
|
|
632
|
-
const
|
|
633
|
-
|
|
634
|
-
target: { value:
|
|
667
|
+
onClick: (F) => {
|
|
668
|
+
F.stopPropagation();
|
|
669
|
+
const n = w.filter((P) => P !== l.value);
|
|
670
|
+
u && t && u.setValue(t, n), f.onChange && f.onChange({
|
|
671
|
+
target: { value: n }
|
|
635
672
|
});
|
|
636
673
|
}
|
|
637
674
|
},
|
|
@@ -655,204 +692,221 @@ const Ne = e.forwardRef(
|
|
|
655
692
|
)
|
|
656
693
|
)
|
|
657
694
|
)
|
|
658
|
-
)) : !
|
|
695
|
+
)) : !a && !v && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione..."),
|
|
696
|
+
v && /* @__PURE__ */ e.createElement(
|
|
697
|
+
"input",
|
|
698
|
+
{
|
|
699
|
+
ref: A,
|
|
700
|
+
type: "text",
|
|
701
|
+
value: b,
|
|
702
|
+
onChange: Z,
|
|
703
|
+
onFocus: (l) => {
|
|
704
|
+
S(!0), m(!0), x && x(l);
|
|
705
|
+
},
|
|
706
|
+
onBlur: (l) => {
|
|
707
|
+
h && h(l);
|
|
708
|
+
},
|
|
709
|
+
placeholder: a ? w && w.length > 0 ? "" : V : V || "Selecione...",
|
|
710
|
+
className: "flex-1 bg-transparent border-none outline-none text-sm min-w-[100px]"
|
|
711
|
+
}
|
|
712
|
+
)
|
|
659
713
|
),
|
|
660
|
-
C &&
|
|
714
|
+
C && w && w.length > 0 && /* @__PURE__ */ e.createElement(
|
|
661
715
|
"button",
|
|
662
716
|
{
|
|
663
717
|
type: "button",
|
|
664
718
|
tabIndex: -1,
|
|
665
719
|
"aria-label": "Limpar seleção",
|
|
666
720
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
667
|
-
onClick:
|
|
721
|
+
onClick: $
|
|
668
722
|
},
|
|
669
723
|
"✕"
|
|
670
724
|
)
|
|
671
|
-
),
|
|
725
|
+
), a && /* @__PURE__ */ e.createElement(
|
|
672
726
|
"label",
|
|
673
727
|
{
|
|
674
728
|
htmlFor: f.id || t,
|
|
675
|
-
className:
|
|
729
|
+
className: i(
|
|
676
730
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
677
|
-
|
|
731
|
+
E ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
678
732
|
)
|
|
679
733
|
},
|
|
680
|
-
|
|
734
|
+
a
|
|
681
735
|
), /* @__PURE__ */ e.createElement(
|
|
682
736
|
"div",
|
|
683
737
|
{
|
|
684
|
-
className:
|
|
738
|
+
className: i(
|
|
685
739
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
686
740
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
687
|
-
|
|
741
|
+
s ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
688
742
|
),
|
|
689
743
|
style: {
|
|
690
|
-
maxHeight:
|
|
691
|
-
overflowY:
|
|
744
|
+
maxHeight: s ? "9.5rem" : "0",
|
|
745
|
+
overflowY: r.length > 3 ? "auto" : "hidden",
|
|
692
746
|
position: "fixed",
|
|
693
747
|
// Use fixed positioning to escape container overflow
|
|
694
|
-
top:
|
|
695
|
-
left:
|
|
696
|
-
width:
|
|
748
|
+
top: s ? L.top : "auto",
|
|
749
|
+
left: s ? L.left : "auto",
|
|
750
|
+
width: s ? L.width : "auto",
|
|
697
751
|
zIndex: 9999,
|
|
698
|
-
boxShadow:
|
|
752
|
+
boxShadow: s ? "var(--select-dropdown-shadow)" : "none"
|
|
699
753
|
}
|
|
700
754
|
},
|
|
701
|
-
|
|
755
|
+
z.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, "Nenhuma opção encontrada") : z.map((l) => /* @__PURE__ */ e.createElement(
|
|
702
756
|
"div",
|
|
703
757
|
{
|
|
704
|
-
key:
|
|
705
|
-
className:
|
|
758
|
+
key: l.value,
|
|
759
|
+
className: i(
|
|
706
760
|
"px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
|
|
707
761
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
708
|
-
|
|
762
|
+
w.includes(l.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
|
|
709
763
|
),
|
|
710
|
-
onMouseDown: () =>
|
|
764
|
+
onMouseDown: () => q(l.value)
|
|
711
765
|
},
|
|
712
766
|
/* @__PURE__ */ e.createElement(
|
|
713
767
|
"input",
|
|
714
768
|
{
|
|
715
769
|
type: "checkbox",
|
|
716
|
-
checked:
|
|
770
|
+
checked: w.includes(l.value),
|
|
717
771
|
readOnly: !0,
|
|
718
772
|
className: "accent-blue-500"
|
|
719
773
|
}
|
|
720
774
|
),
|
|
721
|
-
|
|
775
|
+
l.label
|
|
722
776
|
))
|
|
723
|
-
),
|
|
777
|
+
), X && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, X));
|
|
724
778
|
}
|
|
725
779
|
);
|
|
726
780
|
Ne.displayName = "MultiSelect";
|
|
727
781
|
const Ce = e.forwardRef(
|
|
728
782
|
({
|
|
729
783
|
name: t,
|
|
730
|
-
label:
|
|
731
|
-
loadOptions:
|
|
732
|
-
className:
|
|
733
|
-
containerClassName:
|
|
784
|
+
label: a,
|
|
785
|
+
loadOptions: r,
|
|
786
|
+
className: o,
|
|
787
|
+
containerClassName: c,
|
|
734
788
|
isClearable: C,
|
|
735
|
-
defaultOptions:
|
|
736
|
-
loadingMessage:
|
|
737
|
-
noOptionsMessage:
|
|
738
|
-
searchable:
|
|
739
|
-
debounceMs:
|
|
740
|
-
maxSelectedDisplay:
|
|
741
|
-
onFocus:
|
|
742
|
-
onBlur:
|
|
743
|
-
...
|
|
744
|
-
},
|
|
745
|
-
var
|
|
746
|
-
const [
|
|
789
|
+
defaultOptions: v = !1,
|
|
790
|
+
loadingMessage: V = "Carregando...",
|
|
791
|
+
noOptionsMessage: B = "Nenhuma opção encontrada",
|
|
792
|
+
searchable: N = !1,
|
|
793
|
+
debounceMs: x = 300,
|
|
794
|
+
maxSelectedDisplay: h = 3,
|
|
795
|
+
onFocus: f,
|
|
796
|
+
onBlur: R,
|
|
797
|
+
...g
|
|
798
|
+
}, S) => {
|
|
799
|
+
var p, Y, le;
|
|
800
|
+
const [s, m] = e.useState(!1), [b, _] = e.useState(!1), [L, y] = e.useState([]), [k, A] = e.useState(!1), [u, M] = e.useState(""), [D, w] = e.useState(""), [X, G] = e.useState({
|
|
747
801
|
top: 0,
|
|
748
802
|
left: 0,
|
|
749
803
|
width: 0
|
|
750
|
-
}),
|
|
751
|
-
if (
|
|
752
|
-
const
|
|
753
|
-
|
|
754
|
-
top:
|
|
755
|
-
left:
|
|
756
|
-
width:
|
|
804
|
+
}), H = e.useRef(null), z = e.useRef(null), E = te(), j = E == null ? void 0 : E.control, O = j && t ? re({ control: j, name: t }) : void 0, T = g.value ?? O ?? [], U = (le = (Y = (p = E == null ? void 0 : E.formState) == null ? void 0 : p.errors) == null ? void 0 : Y[t]) == null ? void 0 : le.message, q = s || T && T.length > 0, $ = e.useCallback(() => {
|
|
805
|
+
if (H.current && b) {
|
|
806
|
+
const d = H.current.getBoundingClientRect();
|
|
807
|
+
G({
|
|
808
|
+
top: d.bottom + window.scrollY + 4,
|
|
809
|
+
left: d.left + window.scrollX,
|
|
810
|
+
width: d.width
|
|
757
811
|
});
|
|
758
812
|
}
|
|
759
|
-
}, [
|
|
813
|
+
}, [b]);
|
|
760
814
|
e.useEffect(() => {
|
|
761
|
-
if (
|
|
762
|
-
const
|
|
763
|
-
return window.addEventListener("resize",
|
|
764
|
-
window.removeEventListener("resize",
|
|
815
|
+
if ($(), b) {
|
|
816
|
+
const d = () => $(), W = () => $();
|
|
817
|
+
return window.addEventListener("resize", d), window.addEventListener("scroll", W, !0), () => {
|
|
818
|
+
window.removeEventListener("resize", d), window.removeEventListener("scroll", W, !0);
|
|
765
819
|
};
|
|
766
820
|
}
|
|
767
|
-
}, [
|
|
768
|
-
const
|
|
769
|
-
|
|
770
|
-
},
|
|
771
|
-
return () => clearTimeout(
|
|
772
|
-
}, [
|
|
773
|
-
(
|
|
774
|
-
}, [
|
|
775
|
-
|
|
821
|
+
}, [b, $]), e.useEffect(() => {
|
|
822
|
+
const d = setTimeout(() => {
|
|
823
|
+
w(u);
|
|
824
|
+
}, x);
|
|
825
|
+
return () => clearTimeout(d);
|
|
826
|
+
}, [u, x]), e.useEffect(() => {
|
|
827
|
+
(b || v && L.length === 0) && Z(N ? D : void 0);
|
|
828
|
+
}, [D, b]), e.useEffect(() => {
|
|
829
|
+
v === !0 ? Z() : Array.isArray(v) && y(v);
|
|
776
830
|
}, []);
|
|
777
|
-
const
|
|
831
|
+
const Z = async (d) => {
|
|
778
832
|
try {
|
|
779
|
-
|
|
780
|
-
const
|
|
781
|
-
|
|
782
|
-
} catch (
|
|
783
|
-
console.error("Error loading options:",
|
|
833
|
+
A(!0);
|
|
834
|
+
const W = await r(d);
|
|
835
|
+
y(W);
|
|
836
|
+
} catch (W) {
|
|
837
|
+
console.error("Error loading options:", W), y([]);
|
|
784
838
|
} finally {
|
|
785
|
-
|
|
839
|
+
A(!1);
|
|
786
840
|
}
|
|
787
841
|
};
|
|
788
842
|
e.useEffect(() => {
|
|
789
|
-
const
|
|
790
|
-
|
|
843
|
+
const d = (W) => {
|
|
844
|
+
H.current && !H.current.contains(W.target) && (_(!1), m(!1), M(""));
|
|
791
845
|
};
|
|
792
|
-
return document.addEventListener("mousedown",
|
|
793
|
-
document.removeEventListener("mousedown",
|
|
846
|
+
return document.addEventListener("mousedown", d), () => {
|
|
847
|
+
document.removeEventListener("mousedown", d);
|
|
794
848
|
};
|
|
795
849
|
}, []);
|
|
796
|
-
const
|
|
797
|
-
|
|
798
|
-
var
|
|
799
|
-
return (
|
|
850
|
+
const Q = () => {
|
|
851
|
+
b || (_(!0), m(!0), N && z.current && setTimeout(() => {
|
|
852
|
+
var d;
|
|
853
|
+
return (d = z.current) == null ? void 0 : d.focus();
|
|
800
854
|
}, 0));
|
|
801
|
-
}, K = (
|
|
802
|
-
|
|
803
|
-
},
|
|
804
|
-
|
|
805
|
-
},
|
|
806
|
-
|
|
807
|
-
},
|
|
808
|
-
let
|
|
809
|
-
|
|
810
|
-
target: { value:
|
|
811
|
-
}),
|
|
812
|
-
},
|
|
813
|
-
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
target: { value:
|
|
855
|
+
}, K = (d) => {
|
|
856
|
+
m(!0), f && f(d);
|
|
857
|
+
}, J = (d) => {
|
|
858
|
+
R && R(d);
|
|
859
|
+
}, l = (d) => {
|
|
860
|
+
M(d.target.value);
|
|
861
|
+
}, F = (d) => {
|
|
862
|
+
let W;
|
|
863
|
+
T.includes(d) ? W = T.filter((oe) => oe !== d) : W = [...T, d], E && t && E.setValue(t, W), g.onChange && g.onChange({
|
|
864
|
+
target: { value: W }
|
|
865
|
+
}), m(!0);
|
|
866
|
+
}, n = (d, W) => {
|
|
867
|
+
W.stopPropagation();
|
|
868
|
+
const oe = T.filter((xe) => xe !== d);
|
|
869
|
+
E && t && E.setValue(t, oe), g.onChange && g.onChange({
|
|
870
|
+
target: { value: oe }
|
|
817
871
|
});
|
|
818
|
-
},
|
|
819
|
-
|
|
872
|
+
}, P = (d) => {
|
|
873
|
+
d.stopPropagation(), E && t && E.setValue(t, []), g.onChange && g.onChange({
|
|
820
874
|
target: { value: [] }
|
|
821
|
-
}),
|
|
822
|
-
},
|
|
823
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
875
|
+
}), _(!1), m(!1), M("");
|
|
876
|
+
}, ee = L.filter((d) => T.includes(d.value)), ae = ee.slice(0, h), ne = ee.length - h;
|
|
877
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", c), ref: H }, /* @__PURE__ */ e.createElement(
|
|
824
878
|
"div",
|
|
825
879
|
{
|
|
826
|
-
id:
|
|
827
|
-
tabIndex:
|
|
880
|
+
id: g.id || t,
|
|
881
|
+
tabIndex: N ? -1 : 0,
|
|
828
882
|
role: "button",
|
|
829
883
|
"aria-haspopup": "listbox",
|
|
830
|
-
"aria-expanded":
|
|
831
|
-
className:
|
|
884
|
+
"aria-expanded": b,
|
|
885
|
+
className: i(
|
|
832
886
|
"peer flex items-center min-h-12 w-full border border-[var(--primary,#2563eb)] rounded-md bg-[var(--input-bg,#fff)] text-[var(--input-text,#222)] px-3 py-2 text-sm transition focus:outline-none focus:border-[var(--primary,#2563eb)] disabled:cursor-not-allowed disabled:opacity-50 appearance-none cursor-pointer relative",
|
|
833
|
-
|
|
887
|
+
o
|
|
834
888
|
),
|
|
835
|
-
onClick:
|
|
836
|
-
onFocus:
|
|
837
|
-
onBlur:
|
|
838
|
-
ref:
|
|
889
|
+
onClick: Q,
|
|
890
|
+
onFocus: N ? void 0 : K,
|
|
891
|
+
onBlur: N ? void 0 : J,
|
|
892
|
+
ref: S
|
|
839
893
|
},
|
|
840
|
-
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" },
|
|
894
|
+
/* @__PURE__ */ e.createElement("div", { className: "flex flex-wrap gap-1 items-center min-h-[1.5rem] w-full" }, ae.map((d) => /* @__PURE__ */ e.createElement(
|
|
841
895
|
"span",
|
|
842
896
|
{
|
|
843
|
-
key:
|
|
897
|
+
key: d.value,
|
|
844
898
|
className: "flex items-center border border-blue-200 bg-blue-50 text-blue-700 rounded-2xl px-3 py-1 text-xs shadow-sm gap-2",
|
|
845
899
|
style: { maxWidth: "140px" }
|
|
846
900
|
},
|
|
847
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate", title:
|
|
901
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate", title: d.label }, d.label),
|
|
848
902
|
/* @__PURE__ */ e.createElement(
|
|
849
903
|
"button",
|
|
850
904
|
{
|
|
851
905
|
type: "button",
|
|
852
906
|
className: "ml-1 text-[var(--primary,#2563eb)] hover:text-red-500 focus:outline-none w-4 h-4 flex items-center justify-center rounded-full transition-colors duration-150",
|
|
853
|
-
"aria-label": `Remover ${
|
|
907
|
+
"aria-label": `Remover ${d.label}`,
|
|
854
908
|
tabIndex: -1,
|
|
855
|
-
onClick: (
|
|
909
|
+
onClick: (W) => n(d.value, W)
|
|
856
910
|
},
|
|
857
911
|
/* @__PURE__ */ e.createElement(
|
|
858
912
|
"svg",
|
|
@@ -874,401 +928,401 @@ const Ce = e.forwardRef(
|
|
|
874
928
|
)
|
|
875
929
|
)
|
|
876
930
|
)
|
|
877
|
-
)),
|
|
931
|
+
)), ne > 0 && /* @__PURE__ */ e.createElement("span", { className: "flex items-center border border-gray-200 bg-gray-100 text-gray-600 rounded-2xl px-3 py-1 text-xs" }, "+", ne, " mais"), N ? /* @__PURE__ */ e.createElement(
|
|
878
932
|
"input",
|
|
879
933
|
{
|
|
880
|
-
ref:
|
|
934
|
+
ref: z,
|
|
881
935
|
type: "text",
|
|
882
|
-
value:
|
|
883
|
-
onChange:
|
|
936
|
+
value: u,
|
|
937
|
+
onChange: l,
|
|
884
938
|
onFocus: K,
|
|
885
|
-
onBlur:
|
|
886
|
-
placeholder:
|
|
939
|
+
onBlur: J,
|
|
940
|
+
placeholder: T.length === 0 && !a ? "Selecione..." : "",
|
|
887
941
|
className: "flex-1 min-w-[120px] bg-transparent border-none outline-none text-sm"
|
|
888
942
|
}
|
|
889
|
-
) :
|
|
890
|
-
|
|
891
|
-
C &&
|
|
943
|
+
) : T.length === 0 && !a && /* @__PURE__ */ e.createElement("span", { className: "text-gray-400 text-sm" }, "Selecione...")),
|
|
944
|
+
k && /* @__PURE__ */ e.createElement("div", { className: "absolute right-8 top-1/2 -translate-y-1/2" }, /* @__PURE__ */ e.createElement("div", { className: "animate-spin rounded-full h-4 w-4 border-b-2 border-[var(--primary,#2563eb)]" })),
|
|
945
|
+
C && T && T.length > 0 && !k && /* @__PURE__ */ e.createElement(
|
|
892
946
|
"button",
|
|
893
947
|
{
|
|
894
948
|
type: "button",
|
|
895
949
|
tabIndex: -1,
|
|
896
950
|
"aria-label": "Limpar seleção",
|
|
897
951
|
className: "absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-red-500 bg-transparent p-1 rounded-full focus:outline-none",
|
|
898
|
-
onClick:
|
|
952
|
+
onClick: P
|
|
899
953
|
},
|
|
900
954
|
"✕"
|
|
901
955
|
)
|
|
902
|
-
),
|
|
956
|
+
), a && /* @__PURE__ */ e.createElement(
|
|
903
957
|
"label",
|
|
904
958
|
{
|
|
905
|
-
htmlFor:
|
|
906
|
-
className:
|
|
959
|
+
htmlFor: g.id || t,
|
|
960
|
+
className: i(
|
|
907
961
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm text-gray-400 transition-all duration-200",
|
|
908
|
-
|
|
962
|
+
q ? "top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white" : "top-3 scale-100 translate-y-0.5"
|
|
909
963
|
)
|
|
910
964
|
},
|
|
911
|
-
|
|
965
|
+
a
|
|
912
966
|
), /* @__PURE__ */ e.createElement(
|
|
913
967
|
"div",
|
|
914
968
|
{
|
|
915
|
-
className:
|
|
969
|
+
className: i(
|
|
916
970
|
"absolute left-0 w-full mt-1 rounded-md transition-all duration-200 overflow-hidden",
|
|
917
971
|
"bg-[var(--select-dropdown-bg)] border-[var(--select-dropdown-border)] text-[var(--select-dropdown-text)]",
|
|
918
|
-
|
|
972
|
+
b ? "border max-h-36 opacity-100 scale-100" : "max-h-0 opacity-0 scale-95 pointer-events-none"
|
|
919
973
|
),
|
|
920
974
|
style: {
|
|
921
|
-
maxHeight:
|
|
922
|
-
overflowY:
|
|
975
|
+
maxHeight: b ? "9.5rem" : "0",
|
|
976
|
+
overflowY: L.length > 3 ? "auto" : "hidden",
|
|
923
977
|
position: "fixed",
|
|
924
978
|
// Use fixed positioning to escape container overflow
|
|
925
|
-
top:
|
|
926
|
-
left:
|
|
927
|
-
width:
|
|
979
|
+
top: b ? X.top : "auto",
|
|
980
|
+
left: b ? X.left : "auto",
|
|
981
|
+
width: b ? X.width : "auto",
|
|
928
982
|
zIndex: 9999,
|
|
929
|
-
boxShadow:
|
|
983
|
+
boxShadow: b ? "var(--select-dropdown-shadow)" : "none"
|
|
930
984
|
}
|
|
931
985
|
},
|
|
932
|
-
|
|
986
|
+
k ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, V) : L.length === 0 ? /* @__PURE__ */ e.createElement("div", { className: "px-3 py-2 text-sm text-gray-500 text-center" }, B) : L.map((d) => /* @__PURE__ */ e.createElement(
|
|
933
987
|
"div",
|
|
934
988
|
{
|
|
935
|
-
key:
|
|
936
|
-
className:
|
|
989
|
+
key: d.value,
|
|
990
|
+
className: i(
|
|
937
991
|
"px-3 py-2 cursor-pointer text-sm flex items-center gap-2 transition-colors duration-150",
|
|
938
992
|
"hover:bg-[var(--select-dropdown-hover)]",
|
|
939
|
-
|
|
993
|
+
T.includes(d.value) && "bg-[var(--select-dropdown-selected)] font-semibold"
|
|
940
994
|
),
|
|
941
|
-
onMouseDown: () =>
|
|
995
|
+
onMouseDown: () => F(d.value)
|
|
942
996
|
},
|
|
943
997
|
/* @__PURE__ */ e.createElement(
|
|
944
998
|
"input",
|
|
945
999
|
{
|
|
946
1000
|
type: "checkbox",
|
|
947
|
-
checked:
|
|
1001
|
+
checked: T.includes(d.value),
|
|
948
1002
|
readOnly: !0,
|
|
949
1003
|
className: "accent-blue-500"
|
|
950
1004
|
}
|
|
951
1005
|
),
|
|
952
|
-
|
|
1006
|
+
d.label
|
|
953
1007
|
))
|
|
954
|
-
),
|
|
1008
|
+
), U && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, U));
|
|
955
1009
|
}
|
|
956
1010
|
);
|
|
957
1011
|
Ce.displayName = "MultiAsyncSelect";
|
|
958
|
-
const
|
|
1012
|
+
const Se = {
|
|
959
1013
|
sm: "h-10 text-sm px-3",
|
|
960
1014
|
md: "h-12 text-base px-4",
|
|
961
1015
|
lg: "h-16 text-lg px-6"
|
|
962
|
-
},
|
|
1016
|
+
}, ke = e.forwardRef(
|
|
963
1017
|
({
|
|
964
1018
|
name: t,
|
|
965
|
-
label:
|
|
966
|
-
options:
|
|
967
|
-
className:
|
|
968
|
-
containerClassName:
|
|
1019
|
+
label: a,
|
|
1020
|
+
options: r,
|
|
1021
|
+
className: o,
|
|
1022
|
+
containerClassName: c,
|
|
969
1023
|
optionClassName: C,
|
|
970
|
-
direction:
|
|
971
|
-
size:
|
|
972
|
-
onFocus:
|
|
973
|
-
onBlur:
|
|
974
|
-
...
|
|
975
|
-
},
|
|
976
|
-
var
|
|
977
|
-
const
|
|
978
|
-
|
|
1024
|
+
direction: v = "row",
|
|
1025
|
+
size: V = "md",
|
|
1026
|
+
onFocus: B,
|
|
1027
|
+
onBlur: N,
|
|
1028
|
+
...x
|
|
1029
|
+
}, h) => {
|
|
1030
|
+
var b, _, L;
|
|
1031
|
+
const f = te(), R = f == null ? void 0 : f.control, g = R && t ? re({ control: R, name: t }) : void 0, S = x.value ?? g ?? "", s = (L = (_ = (b = f == null ? void 0 : f.formState) == null ? void 0 : b.errors) == null ? void 0 : _[t]) == null ? void 0 : L.message, m = (y) => {
|
|
1032
|
+
f && t && f.setValue(t, y), x.onChange && x.onChange({ target: { value: y } });
|
|
979
1033
|
};
|
|
980
|
-
return /* @__PURE__ */ e.createElement("div", { className:
|
|
1034
|
+
return /* @__PURE__ */ e.createElement("div", { className: i("relative", c), ref: h }, a && /* @__PURE__ */ e.createElement(
|
|
981
1035
|
"label",
|
|
982
1036
|
{
|
|
983
1037
|
htmlFor: t,
|
|
984
|
-
className:
|
|
1038
|
+
className: i(
|
|
985
1039
|
"absolute left-3 z-10 origin-[0] cursor-text select-none text-sm transition-all duration-200",
|
|
986
1040
|
"top-0 scale-90 -translate-y-1 text-xs text-[var(--primary,#2563eb)] p-1 rounded-full bg-white"
|
|
987
1041
|
)
|
|
988
1042
|
},
|
|
989
|
-
|
|
1043
|
+
a
|
|
990
1044
|
), /* @__PURE__ */ e.createElement(
|
|
991
1045
|
"div",
|
|
992
1046
|
{
|
|
993
|
-
className:
|
|
1047
|
+
className: i(
|
|
994
1048
|
"flex gap-2 w-full pt-6",
|
|
995
1049
|
// espaço para label flutuante
|
|
996
|
-
|
|
997
|
-
|
|
1050
|
+
v === "row" ? "flex-row" : "flex-col",
|
|
1051
|
+
o
|
|
998
1052
|
),
|
|
999
|
-
"aria-label":
|
|
1053
|
+
"aria-label": a,
|
|
1000
1054
|
tabIndex: -1,
|
|
1001
|
-
onFocus:
|
|
1002
|
-
onBlur:
|
|
1055
|
+
onFocus: B,
|
|
1056
|
+
onBlur: N
|
|
1003
1057
|
},
|
|
1004
|
-
|
|
1058
|
+
r.map((y) => /* @__PURE__ */ e.createElement(
|
|
1005
1059
|
"button",
|
|
1006
1060
|
{
|
|
1007
|
-
key:
|
|
1061
|
+
key: y.value,
|
|
1008
1062
|
type: "button",
|
|
1009
|
-
className:
|
|
1063
|
+
className: i(
|
|
1010
1064
|
"relative flex items-center justify-center border rounded-lg transition-all duration-200 shadow-sm px-4 focus:outline-none focus:ring-2 focus:ring-[var(--primary-hover,#dbeafe)]",
|
|
1011
|
-
|
|
1012
|
-
|
|
1065
|
+
Se[V],
|
|
1066
|
+
S === y.value ? "border-[var(--primary,#2563eb)] bg-[var(--primary-hover,#dbeafe)] text-[var(--primary,#2563eb)] ring-2 ring-[var(--primary-hover,#dbeafe)] shadow-md transform scale-[1.02]" : "border-gray-200 bg-white text-gray-600 hover:border-[var(--primary,#2563eb)] hover:bg-[var(--primary-hover,#dbeafe)] hover:text-[var(--primary,#2563eb)] hover:shadow-md",
|
|
1013
1067
|
C
|
|
1014
1068
|
),
|
|
1015
|
-
"aria-pressed":
|
|
1016
|
-
"data-selected":
|
|
1069
|
+
"aria-pressed": S === y.value,
|
|
1070
|
+
"data-selected": S === y.value,
|
|
1017
1071
|
tabIndex: 0,
|
|
1018
|
-
onClick: () =>
|
|
1019
|
-
onKeyDown: (
|
|
1020
|
-
(
|
|
1072
|
+
onClick: () => m(y.value),
|
|
1073
|
+
onKeyDown: (k) => {
|
|
1074
|
+
(k.key === "Enter" || k.key === " ") && (k.preventDefault(), m(y.value));
|
|
1021
1075
|
}
|
|
1022
1076
|
},
|
|
1023
|
-
|
|
1024
|
-
/* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" },
|
|
1077
|
+
y.icon && /* @__PURE__ */ e.createElement("span", { className: "mr-2 text-lg flex items-center" }, y.icon),
|
|
1078
|
+
/* @__PURE__ */ e.createElement("span", { className: "truncate font-medium" }, y.label)
|
|
1025
1079
|
))
|
|
1026
|
-
),
|
|
1080
|
+
), s && /* @__PURE__ */ e.createElement("span", { className: "text-red-500 text-xs mt-1 block" }, s));
|
|
1027
1081
|
}
|
|
1028
1082
|
);
|
|
1029
|
-
|
|
1030
|
-
const
|
|
1031
|
-
({ children: t, className:
|
|
1032
|
-
|
|
1083
|
+
ke.displayName = "RadioGroup";
|
|
1084
|
+
const ie = I.forwardRef(
|
|
1085
|
+
({ children: t, className: a, as: r = "div", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1086
|
+
r,
|
|
1033
1087
|
{
|
|
1034
|
-
ref:
|
|
1035
|
-
className:
|
|
1088
|
+
ref: c,
|
|
1089
|
+
className: i(
|
|
1036
1090
|
"px-6 py-4 border-b",
|
|
1037
1091
|
"bg-[var(--card-header-bg,rgba(249,250,251,0.5))]",
|
|
1038
1092
|
"border-[var(--card-header-border,#e5e7eb)]",
|
|
1039
1093
|
"text-[var(--card-text,#111827)]",
|
|
1040
|
-
|
|
1094
|
+
a
|
|
1041
1095
|
),
|
|
1042
|
-
...
|
|
1096
|
+
...o
|
|
1043
1097
|
},
|
|
1044
1098
|
t
|
|
1045
1099
|
)
|
|
1046
1100
|
);
|
|
1047
|
-
|
|
1048
|
-
const
|
|
1049
|
-
({ children: t, className:
|
|
1050
|
-
|
|
1101
|
+
ie.displayName = "CardHeader";
|
|
1102
|
+
const ce = I.forwardRef(
|
|
1103
|
+
({ children: t, className: a, as: r = "div", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1104
|
+
r,
|
|
1051
1105
|
{
|
|
1052
|
-
ref:
|
|
1053
|
-
className:
|
|
1106
|
+
ref: c,
|
|
1107
|
+
className: i(
|
|
1054
1108
|
"px-6 py-4",
|
|
1055
1109
|
"flex-1",
|
|
1056
1110
|
// Para ocupar o espaço disponível
|
|
1057
1111
|
"bg-[var(--card-bg,#ffffff)]",
|
|
1058
1112
|
"text-[var(--card-text,#111827)]",
|
|
1059
|
-
|
|
1113
|
+
a
|
|
1060
1114
|
),
|
|
1061
|
-
...
|
|
1115
|
+
...o
|
|
1062
1116
|
},
|
|
1063
1117
|
t
|
|
1064
1118
|
)
|
|
1065
1119
|
);
|
|
1066
|
-
|
|
1067
|
-
const de =
|
|
1068
|
-
({ children: t, className:
|
|
1069
|
-
|
|
1120
|
+
ce.displayName = "CardBody";
|
|
1121
|
+
const de = I.forwardRef(
|
|
1122
|
+
({ children: t, className: a, as: r = "div", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1123
|
+
r,
|
|
1070
1124
|
{
|
|
1071
|
-
ref:
|
|
1072
|
-
className:
|
|
1125
|
+
ref: c,
|
|
1126
|
+
className: i(
|
|
1073
1127
|
"px-6 py-4 border-t",
|
|
1074
1128
|
"bg-[var(--card-footer-bg,rgba(249,250,251,0.5))]",
|
|
1075
1129
|
"border-[var(--card-footer-border,#e5e7eb)]",
|
|
1076
1130
|
"text-[var(--card-text,#111827)]",
|
|
1077
|
-
|
|
1131
|
+
a
|
|
1078
1132
|
),
|
|
1079
|
-
...
|
|
1133
|
+
...o
|
|
1080
1134
|
},
|
|
1081
1135
|
t
|
|
1082
1136
|
)
|
|
1083
1137
|
);
|
|
1084
1138
|
de.displayName = "CardFooter";
|
|
1085
|
-
const Re =
|
|
1139
|
+
const Re = I.forwardRef(
|
|
1086
1140
|
({
|
|
1087
1141
|
children: t,
|
|
1088
|
-
className:
|
|
1089
|
-
variant:
|
|
1090
|
-
size:
|
|
1091
|
-
padding:
|
|
1142
|
+
className: a,
|
|
1143
|
+
variant: r = "default",
|
|
1144
|
+
size: o = "md",
|
|
1145
|
+
padding: c = "none",
|
|
1092
1146
|
// none pois cada seção tem seu próprio padding
|
|
1093
1147
|
rounded: C = "lg",
|
|
1094
|
-
constrainWidth:
|
|
1148
|
+
constrainWidth: v = !1,
|
|
1095
1149
|
// Por padrão, não aplicar max-width
|
|
1096
|
-
...
|
|
1097
|
-
},
|
|
1098
|
-
const
|
|
1150
|
+
...V
|
|
1151
|
+
}, B) => {
|
|
1152
|
+
const N = {
|
|
1099
1153
|
default: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-sm,0_1px_2px_0_rgb(0_0_0_/_0.05))]",
|
|
1100
1154
|
outlined: "bg-[var(--card-bg,#ffffff)] border-2 border-[var(--primary,#2563eb)]",
|
|
1101
1155
|
elevated: "bg-[var(--card-bg,#ffffff)] border border-[var(--card-border,#e5e7eb)] shadow-[var(--card-shadow-lg,0_10px_15px_-3px_rgb(0_0_0_/_0.1),_0_4px_6px_-4px_rgb(0_0_0_/_0.1))]",
|
|
1102
1156
|
flat: "bg-[var(--card-bg,#ffffff)] border-0"
|
|
1103
|
-
},
|
|
1157
|
+
}, x = {
|
|
1104
1158
|
sm: "max-w-sm",
|
|
1105
1159
|
md: "max-w-md",
|
|
1106
1160
|
lg: "max-w-lg"
|
|
1107
|
-
},
|
|
1161
|
+
}, h = {
|
|
1108
1162
|
none: "",
|
|
1109
1163
|
sm: "p-3",
|
|
1110
1164
|
md: "p-4",
|
|
1111
1165
|
lg: "p-6"
|
|
1112
|
-
},
|
|
1166
|
+
}, f = {
|
|
1113
1167
|
none: "rounded-none",
|
|
1114
1168
|
sm: "rounded-sm",
|
|
1115
1169
|
md: "rounded-md",
|
|
1116
1170
|
lg: "rounded-lg",
|
|
1117
1171
|
xl: "rounded-xl"
|
|
1118
1172
|
};
|
|
1119
|
-
return /* @__PURE__ */
|
|
1173
|
+
return /* @__PURE__ */ I.createElement(
|
|
1120
1174
|
"div",
|
|
1121
1175
|
{
|
|
1122
|
-
ref:
|
|
1123
|
-
className:
|
|
1176
|
+
ref: B,
|
|
1177
|
+
className: i(
|
|
1124
1178
|
"flex flex-col",
|
|
1125
1179
|
// Flex column para organizar header, body, footer
|
|
1126
1180
|
"overflow-hidden",
|
|
1127
1181
|
// Para manter os borders radius das seções
|
|
1128
|
-
|
|
1129
|
-
|
|
1182
|
+
N[r],
|
|
1183
|
+
v && x[o],
|
|
1130
1184
|
// Aplicar max-width apenas se constrainWidth for true
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1185
|
+
h[c],
|
|
1186
|
+
f[C],
|
|
1187
|
+
a
|
|
1134
1188
|
),
|
|
1135
|
-
...
|
|
1189
|
+
...V
|
|
1136
1190
|
},
|
|
1137
1191
|
t
|
|
1138
1192
|
);
|
|
1139
1193
|
}
|
|
1140
|
-
),
|
|
1141
|
-
Header:
|
|
1142
|
-
Body:
|
|
1194
|
+
), Te = Object.assign(Re, {
|
|
1195
|
+
Header: ie,
|
|
1196
|
+
Body: ce,
|
|
1143
1197
|
Footer: de
|
|
1144
|
-
}), ue =
|
|
1198
|
+
}), ue = I.forwardRef(
|
|
1145
1199
|
({
|
|
1146
1200
|
children: t,
|
|
1147
|
-
className:
|
|
1148
|
-
variant:
|
|
1149
|
-
size:
|
|
1150
|
-
responsive:
|
|
1201
|
+
className: a,
|
|
1202
|
+
variant: r = "default",
|
|
1203
|
+
size: o = "md",
|
|
1204
|
+
responsive: c = !1,
|
|
1151
1205
|
stickyHeader: C = !1,
|
|
1152
|
-
...
|
|
1153
|
-
},
|
|
1154
|
-
const
|
|
1206
|
+
...v
|
|
1207
|
+
}, V) => {
|
|
1208
|
+
const B = i(
|
|
1155
1209
|
// Base styles
|
|
1156
1210
|
"w-full border-collapse bg-[var(--table-bg)] text-[var(--table-text)]",
|
|
1157
1211
|
// Variant styles
|
|
1158
1212
|
{
|
|
1159
|
-
"border border-[var(--table-border)]":
|
|
1213
|
+
"border border-[var(--table-border)]": r === "bordered"
|
|
1160
1214
|
},
|
|
1161
1215
|
// Size styles
|
|
1162
1216
|
{
|
|
1163
|
-
"text-sm":
|
|
1164
|
-
"text-base":
|
|
1165
|
-
"text-lg":
|
|
1217
|
+
"text-sm": o === "sm",
|
|
1218
|
+
"text-base": o === "md",
|
|
1219
|
+
"text-lg": o === "lg"
|
|
1166
1220
|
},
|
|
1167
|
-
|
|
1168
|
-
),
|
|
1221
|
+
a
|
|
1222
|
+
), N = i(
|
|
1169
1223
|
{
|
|
1170
|
-
"overflow-x-auto":
|
|
1224
|
+
"overflow-x-auto": c,
|
|
1171
1225
|
"max-h-96 overflow-y-auto": C
|
|
1172
1226
|
}
|
|
1173
|
-
),
|
|
1227
|
+
), x = /* @__PURE__ */ I.createElement(
|
|
1174
1228
|
"table",
|
|
1175
1229
|
{
|
|
1176
|
-
ref:
|
|
1177
|
-
className:
|
|
1178
|
-
...
|
|
1230
|
+
ref: V,
|
|
1231
|
+
className: B,
|
|
1232
|
+
...v
|
|
1179
1233
|
},
|
|
1180
1234
|
t
|
|
1181
1235
|
);
|
|
1182
|
-
return
|
|
1236
|
+
return c || C ? /* @__PURE__ */ I.createElement("div", { className: N }, x) : x;
|
|
1183
1237
|
}
|
|
1184
|
-
), fe =
|
|
1185
|
-
({ children: t, className:
|
|
1186
|
-
|
|
1238
|
+
), fe = I.forwardRef(
|
|
1239
|
+
({ children: t, className: a, as: r = "thead", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1240
|
+
r,
|
|
1187
1241
|
{
|
|
1188
|
-
ref:
|
|
1189
|
-
className:
|
|
1242
|
+
ref: c,
|
|
1243
|
+
className: i(
|
|
1190
1244
|
"border-b border-[var(--table-border)] bg-[var(--table-header-bg)]",
|
|
1191
1245
|
{
|
|
1192
|
-
"sticky top-0 z-10":
|
|
1246
|
+
"sticky top-0 z-10": r === "thead"
|
|
1193
1247
|
},
|
|
1194
|
-
|
|
1248
|
+
a
|
|
1195
1249
|
),
|
|
1196
|
-
...
|
|
1250
|
+
...o
|
|
1197
1251
|
},
|
|
1198
1252
|
t
|
|
1199
1253
|
)
|
|
1200
|
-
), me =
|
|
1201
|
-
({ children: t, className:
|
|
1202
|
-
|
|
1254
|
+
), me = I.forwardRef(
|
|
1255
|
+
({ children: t, className: a, as: r = "tbody", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1256
|
+
r,
|
|
1203
1257
|
{
|
|
1204
|
-
ref:
|
|
1205
|
-
className:
|
|
1258
|
+
ref: c,
|
|
1259
|
+
className: i(
|
|
1206
1260
|
"[&_tr:nth-child(odd)]:bg-[var(--table-row-odd)]",
|
|
1207
1261
|
"[&_tr:nth-child(even)]:bg-[var(--table-row-even)]",
|
|
1208
|
-
|
|
1262
|
+
a
|
|
1209
1263
|
),
|
|
1210
|
-
...
|
|
1264
|
+
...o
|
|
1211
1265
|
},
|
|
1212
1266
|
t
|
|
1213
1267
|
)
|
|
1214
|
-
),
|
|
1215
|
-
({ children: t, className:
|
|
1216
|
-
|
|
1268
|
+
), ve = I.forwardRef(
|
|
1269
|
+
({ children: t, className: a, as: r = "tfoot", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1270
|
+
r,
|
|
1217
1271
|
{
|
|
1218
|
-
ref:
|
|
1219
|
-
className:
|
|
1272
|
+
ref: c,
|
|
1273
|
+
className: i(
|
|
1220
1274
|
"border-t border-[var(--table-border)] bg-[var(--table-header-bg)] font-medium",
|
|
1221
|
-
|
|
1275
|
+
a
|
|
1222
1276
|
),
|
|
1223
|
-
...
|
|
1277
|
+
...o
|
|
1224
1278
|
},
|
|
1225
1279
|
t
|
|
1226
1280
|
)
|
|
1227
|
-
),
|
|
1228
|
-
({ children: t, className:
|
|
1281
|
+
), be = I.forwardRef(
|
|
1282
|
+
({ children: t, className: a, variant: r = "default", ...o }, c) => /* @__PURE__ */ I.createElement(
|
|
1229
1283
|
"tr",
|
|
1230
1284
|
{
|
|
1231
|
-
ref:
|
|
1232
|
-
className:
|
|
1285
|
+
ref: c,
|
|
1286
|
+
className: i(
|
|
1233
1287
|
"border-b border-[var(--table-border)] transition-colors",
|
|
1234
1288
|
{
|
|
1235
|
-
"hover:bg-[var(--table-row-hover)]":
|
|
1236
|
-
"bg-[var(--table-row-selected)]":
|
|
1289
|
+
"hover:bg-[var(--table-row-hover)]": r === "hover",
|
|
1290
|
+
"bg-[var(--table-row-selected)]": r === "selected"
|
|
1237
1291
|
},
|
|
1238
|
-
|
|
1292
|
+
a
|
|
1239
1293
|
),
|
|
1240
|
-
...
|
|
1294
|
+
...o
|
|
1241
1295
|
},
|
|
1242
1296
|
t
|
|
1243
1297
|
)
|
|
1244
|
-
),
|
|
1298
|
+
), pe = I.forwardRef(
|
|
1245
1299
|
({
|
|
1246
1300
|
children: t,
|
|
1247
|
-
className:
|
|
1248
|
-
as:
|
|
1249
|
-
align:
|
|
1250
|
-
scope:
|
|
1301
|
+
className: a,
|
|
1302
|
+
as: r = "td",
|
|
1303
|
+
align: o = "left",
|
|
1304
|
+
scope: c,
|
|
1251
1305
|
colSpan: C,
|
|
1252
|
-
rowSpan:
|
|
1253
|
-
...
|
|
1254
|
-
},
|
|
1255
|
-
|
|
1306
|
+
rowSpan: v,
|
|
1307
|
+
...V
|
|
1308
|
+
}, B) => /* @__PURE__ */ I.createElement(
|
|
1309
|
+
r,
|
|
1256
1310
|
{
|
|
1257
|
-
ref:
|
|
1258
|
-
scope:
|
|
1311
|
+
ref: B,
|
|
1312
|
+
scope: r === "th" ? c : void 0,
|
|
1259
1313
|
colSpan: C,
|
|
1260
|
-
rowSpan:
|
|
1261
|
-
className:
|
|
1314
|
+
rowSpan: v,
|
|
1315
|
+
className: i(
|
|
1262
1316
|
"px-4 py-3 text-left",
|
|
1263
1317
|
{
|
|
1264
|
-
"font-semibold":
|
|
1265
|
-
"text-sm":
|
|
1266
|
-
"text-center":
|
|
1267
|
-
"text-right":
|
|
1318
|
+
"font-semibold": r === "th",
|
|
1319
|
+
"text-sm": r === "td",
|
|
1320
|
+
"text-center": o === "center",
|
|
1321
|
+
"text-right": o === "right"
|
|
1268
1322
|
},
|
|
1269
|
-
|
|
1323
|
+
a
|
|
1270
1324
|
),
|
|
1271
|
-
...
|
|
1325
|
+
...V
|
|
1272
1326
|
},
|
|
1273
1327
|
t
|
|
1274
1328
|
)
|
|
@@ -1276,33 +1330,33 @@ const Re = L.forwardRef(
|
|
|
1276
1330
|
ue.displayName = "Table";
|
|
1277
1331
|
fe.displayName = "TableHeader";
|
|
1278
1332
|
me.displayName = "TableBody";
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1333
|
+
ve.displayName = "TableFooter";
|
|
1334
|
+
be.displayName = "TableRow";
|
|
1335
|
+
pe.displayName = "TableCell";
|
|
1336
|
+
const _e = Object.assign(ue, {
|
|
1283
1337
|
Header: fe,
|
|
1284
1338
|
Body: me,
|
|
1285
|
-
Footer:
|
|
1286
|
-
Row:
|
|
1287
|
-
Cell:
|
|
1339
|
+
Footer: ve,
|
|
1340
|
+
Row: be,
|
|
1341
|
+
Cell: pe
|
|
1288
1342
|
});
|
|
1289
1343
|
export {
|
|
1290
1344
|
Ee as AsyncSelect,
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1345
|
+
ze as Button,
|
|
1346
|
+
Te as Card,
|
|
1347
|
+
ce as CardBody,
|
|
1294
1348
|
de as CardFooter,
|
|
1295
|
-
|
|
1349
|
+
ie as CardHeader,
|
|
1296
1350
|
he as Input,
|
|
1297
1351
|
Ce as MultiAsyncSelect,
|
|
1298
1352
|
Ne as MultiSelect,
|
|
1299
|
-
|
|
1353
|
+
ke as RadioGroup,
|
|
1300
1354
|
we as Select,
|
|
1301
|
-
|
|
1355
|
+
_e as Table,
|
|
1302
1356
|
me as TableBody,
|
|
1303
|
-
|
|
1304
|
-
|
|
1357
|
+
pe as TableCell,
|
|
1358
|
+
ve as TableFooter,
|
|
1305
1359
|
fe as TableHeader,
|
|
1306
|
-
|
|
1360
|
+
be as TableRow,
|
|
1307
1361
|
ye as Textarea
|
|
1308
1362
|
};
|