@schumann-dev/ui 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +547 -539
- package/dist/molecules/FormField/FormField.d.ts +4 -2
- package/dist/molecules/SegmentedControl/SegmentedControl.d.ts +3 -1
- package/dist/organisms/ConfirmModal/ConfirmModal.d.ts +3 -1
- package/dist/organisms/Modal/Modal.d.ts +3 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as e, jsxs as h, Fragment as ee } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as de, useContext as ye, createContext as ke, useState as S, useCallback as xe, useId as we, useRef as K, useEffect as H, useMemo as se, useLayoutEffect as Ce } from "react";
|
|
3
3
|
import { c as w, a as P, b as Se } from "./chunks/Icon-xe35IPZg.js";
|
|
4
4
|
import { I as Lt, g as It, i as Tt, d as Rt, r as At } from "./chunks/Icon-xe35IPZg.js";
|
|
5
5
|
import * as W from "@radix-ui/react-tooltip";
|
|
@@ -17,81 +17,81 @@ function Me({ size: t = 16, label: a, className: n }) {
|
|
|
17
17
|
}
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
const me =
|
|
20
|
+
const me = de(function({
|
|
21
21
|
variant: a = "primary",
|
|
22
22
|
size: n = "md",
|
|
23
23
|
loading: s = !1,
|
|
24
|
-
fullWidth:
|
|
25
|
-
leftIcon:
|
|
26
|
-
rightIcon:
|
|
24
|
+
fullWidth: r = !1,
|
|
25
|
+
leftIcon: o,
|
|
26
|
+
rightIcon: i,
|
|
27
27
|
disabled: c,
|
|
28
|
-
type:
|
|
29
|
-
className:
|
|
30
|
-
children:
|
|
31
|
-
...
|
|
32
|
-
},
|
|
33
|
-
const
|
|
28
|
+
type: l = "button",
|
|
29
|
+
className: _,
|
|
30
|
+
children: u,
|
|
31
|
+
...g
|
|
32
|
+
}, p) {
|
|
33
|
+
const y = c || s;
|
|
34
34
|
return /* @__PURE__ */ h(
|
|
35
35
|
"button",
|
|
36
36
|
{
|
|
37
|
-
ref:
|
|
38
|
-
type:
|
|
39
|
-
className: w("sui-btn",
|
|
37
|
+
ref: p,
|
|
38
|
+
type: l,
|
|
39
|
+
className: w("sui-btn", r && "sui-btn--full", _),
|
|
40
40
|
"data-variant": a,
|
|
41
41
|
"data-size": n,
|
|
42
42
|
"data-loading": s || void 0,
|
|
43
|
-
disabled:
|
|
43
|
+
disabled: y,
|
|
44
44
|
"aria-busy": s || void 0,
|
|
45
|
-
...
|
|
45
|
+
...g,
|
|
46
46
|
children: [
|
|
47
47
|
s && /* @__PURE__ */ e(Me, { size: n === "lg" ? 18 : 15, className: "sui-btn__spinner" }),
|
|
48
|
-
!s &&
|
|
49
|
-
|
|
50
|
-
!s &&
|
|
48
|
+
!s && o && /* @__PURE__ */ e("span", { className: "sui-btn__icon", children: o }),
|
|
49
|
+
u != null && /* @__PURE__ */ e("span", { className: "sui-btn__label", children: u }),
|
|
50
|
+
!s && i && /* @__PURE__ */ e("span", { className: "sui-btn__icon", children: i })
|
|
51
51
|
]
|
|
52
52
|
}
|
|
53
53
|
);
|
|
54
|
-
}), De =
|
|
54
|
+
}), De = de(function({ variant: a = "ghost", size: n = "md", shape: s = "square", className: r, type: o = "button", ...i }, c) {
|
|
55
55
|
return /* @__PURE__ */ e(
|
|
56
56
|
"button",
|
|
57
57
|
{
|
|
58
58
|
ref: c,
|
|
59
|
-
type:
|
|
60
|
-
className: w("sui-iconbtn",
|
|
59
|
+
type: o,
|
|
60
|
+
className: w("sui-iconbtn", r),
|
|
61
61
|
"data-variant": a,
|
|
62
62
|
"data-size": n,
|
|
63
63
|
"data-shape": s,
|
|
64
|
-
...
|
|
64
|
+
...i
|
|
65
65
|
}
|
|
66
66
|
);
|
|
67
|
-
}),
|
|
67
|
+
}), _e = ke(null);
|
|
68
68
|
function ie() {
|
|
69
|
-
return ye(
|
|
69
|
+
return ye(_e);
|
|
70
70
|
}
|
|
71
|
-
const
|
|
72
|
-
const
|
|
71
|
+
const fe = de(function({ inputSize: a = "md", invalid: n, leftAddon: s, rightAddon: r, disabled: o, className: i, id: c, ...l }, _) {
|
|
72
|
+
const u = ie(), g = c ?? (u == null ? void 0 : u.id), p = n ?? (u == null ? void 0 : u.invalid) ?? !1;
|
|
73
73
|
return /* @__PURE__ */ h(
|
|
74
74
|
"div",
|
|
75
75
|
{
|
|
76
|
-
className: w("sui-input",
|
|
76
|
+
className: w("sui-input", i),
|
|
77
77
|
"data-size": a,
|
|
78
|
-
"data-invalid":
|
|
79
|
-
"data-disabled":
|
|
78
|
+
"data-invalid": p || void 0,
|
|
79
|
+
"data-disabled": o || void 0,
|
|
80
80
|
children: [
|
|
81
81
|
s && /* @__PURE__ */ e("span", { className: "sui-input__addon sui-input__addon--left", children: s }),
|
|
82
82
|
/* @__PURE__ */ e(
|
|
83
83
|
"input",
|
|
84
84
|
{
|
|
85
|
-
ref:
|
|
86
|
-
id:
|
|
85
|
+
ref: _,
|
|
86
|
+
id: g,
|
|
87
87
|
className: "sui-input__control",
|
|
88
|
-
disabled:
|
|
89
|
-
"aria-invalid":
|
|
90
|
-
"aria-describedby":
|
|
91
|
-
...
|
|
88
|
+
disabled: o,
|
|
89
|
+
"aria-invalid": p || void 0,
|
|
90
|
+
"aria-describedby": u == null ? void 0 : u.describedBy,
|
|
91
|
+
...l
|
|
92
92
|
}
|
|
93
93
|
),
|
|
94
|
-
|
|
94
|
+
r && /* @__PURE__ */ e("span", { className: "sui-input__addon sui-input__addon--right", children: r })
|
|
95
95
|
]
|
|
96
96
|
}
|
|
97
97
|
);
|
|
@@ -101,27 +101,27 @@ function pe({
|
|
|
101
101
|
size: a = "sm",
|
|
102
102
|
weight: n = "regular",
|
|
103
103
|
tone: s = "primary",
|
|
104
|
-
align:
|
|
105
|
-
truncate:
|
|
106
|
-
mono:
|
|
104
|
+
align: r,
|
|
105
|
+
truncate: o,
|
|
106
|
+
mono: i,
|
|
107
107
|
className: c,
|
|
108
|
-
...
|
|
108
|
+
...l
|
|
109
109
|
}) {
|
|
110
110
|
return /* @__PURE__ */ e(
|
|
111
111
|
t,
|
|
112
112
|
{
|
|
113
|
-
className: w("sui-text",
|
|
113
|
+
className: w("sui-text", o && "sui-text--truncate", i && "sui-text--mono", c),
|
|
114
114
|
"data-size": a,
|
|
115
115
|
"data-weight": n,
|
|
116
116
|
"data-tone": s,
|
|
117
|
-
"data-align":
|
|
118
|
-
...
|
|
117
|
+
"data-align": r,
|
|
118
|
+
...l
|
|
119
119
|
}
|
|
120
120
|
);
|
|
121
121
|
}
|
|
122
122
|
function ze({ level: t = 2, as: a, className: n, ...s }) {
|
|
123
|
-
const
|
|
124
|
-
return /* @__PURE__ */ e(
|
|
123
|
+
const r = a ?? `h${t}`;
|
|
124
|
+
return /* @__PURE__ */ e(r, { className: w("sui-heading", n), "data-level": t, ...s });
|
|
125
125
|
}
|
|
126
126
|
function Ee({ required: t, className: a, children: n, ...s }) {
|
|
127
127
|
return /* @__PURE__ */ h("label", { className: w("sui-label", a), ...s, children: [
|
|
@@ -134,21 +134,21 @@ function it({
|
|
|
134
134
|
size: a = "md",
|
|
135
135
|
dot: n = !1,
|
|
136
136
|
leftIcon: s,
|
|
137
|
-
className:
|
|
138
|
-
children:
|
|
139
|
-
...
|
|
137
|
+
className: r,
|
|
138
|
+
children: o,
|
|
139
|
+
...i
|
|
140
140
|
}) {
|
|
141
141
|
return /* @__PURE__ */ h(
|
|
142
142
|
"span",
|
|
143
143
|
{
|
|
144
|
-
className: w("sui-badge",
|
|
144
|
+
className: w("sui-badge", r),
|
|
145
145
|
"data-status": t,
|
|
146
146
|
"data-size": a,
|
|
147
|
-
...
|
|
147
|
+
...i,
|
|
148
148
|
children: [
|
|
149
149
|
n && /* @__PURE__ */ e("span", { className: "sui-badge__dot", "aria-hidden": "true" }),
|
|
150
150
|
s && /* @__PURE__ */ e("span", { className: "sui-badge__icon", children: s }),
|
|
151
|
-
|
|
151
|
+
o
|
|
152
152
|
]
|
|
153
153
|
}
|
|
154
154
|
);
|
|
@@ -156,39 +156,39 @@ function it({
|
|
|
156
156
|
function $e(t) {
|
|
157
157
|
return t.trim().split(/\s+/).slice(0, 2).map((a) => a[0] ?? "").join("").toUpperCase();
|
|
158
158
|
}
|
|
159
|
-
function rt({ src: t, name: a, size: n = 30, className: s, style:
|
|
159
|
+
function rt({ src: t, name: a, size: n = 30, className: s, style: r }) {
|
|
160
160
|
return /* @__PURE__ */ e(
|
|
161
161
|
"span",
|
|
162
162
|
{
|
|
163
163
|
className: w("sui-avatar", s),
|
|
164
|
-
style: { width: n, height: n, fontSize: n * 0.38, ...
|
|
164
|
+
style: { width: n, height: n, fontSize: n * 0.38, ...r },
|
|
165
165
|
children: t ? /* @__PURE__ */ e("img", { src: t, alt: "" }) : $e(a) || "?"
|
|
166
166
|
}
|
|
167
167
|
);
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function ue({
|
|
170
170
|
value: t,
|
|
171
171
|
defaultValue: a,
|
|
172
172
|
onChange: n
|
|
173
173
|
}) {
|
|
174
|
-
const [s,
|
|
175
|
-
(
|
|
176
|
-
|
|
174
|
+
const [s, r] = S(a), o = t !== void 0, i = o ? t : s, c = xe(
|
|
175
|
+
(l) => {
|
|
176
|
+
o || r(l), n == null || n(l);
|
|
177
177
|
},
|
|
178
|
-
[
|
|
178
|
+
[o, n]
|
|
179
179
|
);
|
|
180
|
-
return [
|
|
180
|
+
return [i, c];
|
|
181
181
|
}
|
|
182
182
|
function Le({
|
|
183
183
|
checked: t,
|
|
184
184
|
defaultChecked: a = !1,
|
|
185
185
|
onCheckedChange: n,
|
|
186
186
|
disabled: s,
|
|
187
|
-
id:
|
|
188
|
-
className:
|
|
189
|
-
...
|
|
187
|
+
id: r,
|
|
188
|
+
className: o,
|
|
189
|
+
...i
|
|
190
190
|
}) {
|
|
191
|
-
const c = ie(), [
|
|
191
|
+
const c = ie(), [l, _] = ue({
|
|
192
192
|
value: t,
|
|
193
193
|
defaultValue: a,
|
|
194
194
|
onChange: n
|
|
@@ -198,25 +198,25 @@ function Le({
|
|
|
198
198
|
{
|
|
199
199
|
type: "button",
|
|
200
200
|
role: "switch",
|
|
201
|
-
"aria-checked":
|
|
202
|
-
id:
|
|
201
|
+
"aria-checked": l,
|
|
202
|
+
id: r ?? (c == null ? void 0 : c.id),
|
|
203
203
|
"aria-describedby": c == null ? void 0 : c.describedBy,
|
|
204
204
|
disabled: s,
|
|
205
|
-
onClick: () =>
|
|
206
|
-
className: w("sui-switch",
|
|
207
|
-
"data-checked":
|
|
208
|
-
...
|
|
205
|
+
onClick: () => _(!l),
|
|
206
|
+
className: w("sui-switch", o),
|
|
207
|
+
"data-checked": l || void 0,
|
|
208
|
+
...i,
|
|
209
209
|
children: /* @__PURE__ */ e("span", { className: "sui-switch__thumb" })
|
|
210
210
|
}
|
|
211
211
|
);
|
|
212
212
|
}
|
|
213
|
-
function lt({ width: t = "100%", height: a = 16, radius: n = 9, className: s, style:
|
|
213
|
+
function lt({ width: t = "100%", height: a = 16, radius: n = 9, className: s, style: r }) {
|
|
214
214
|
return /* @__PURE__ */ e(
|
|
215
215
|
"span",
|
|
216
216
|
{
|
|
217
217
|
className: w("sui-skeleton", s),
|
|
218
218
|
"aria-hidden": "true",
|
|
219
|
-
style: { width: t, height: a, borderRadius: n, ...
|
|
219
|
+
style: { width: t, height: a, borderRadius: n, ...r }
|
|
220
220
|
}
|
|
221
221
|
);
|
|
222
222
|
}
|
|
@@ -225,23 +225,23 @@ function ot({
|
|
|
225
225
|
max: a = 1,
|
|
226
226
|
color: n = "var(--interactive-primary)",
|
|
227
227
|
dangerColor: s = "var(--text-error)",
|
|
228
|
-
dangerThreshold:
|
|
229
|
-
height:
|
|
230
|
-
label:
|
|
228
|
+
dangerThreshold: r = 0.85,
|
|
229
|
+
height: o = 6,
|
|
230
|
+
label: i,
|
|
231
231
|
className: c
|
|
232
232
|
}) {
|
|
233
|
-
const
|
|
233
|
+
const l = a > 0 ? Math.min(Math.max(t / a, 0), 1) : 0, _ = l >= r ? s : n;
|
|
234
234
|
return /* @__PURE__ */ e(
|
|
235
235
|
"div",
|
|
236
236
|
{
|
|
237
237
|
className: w("sui-progressbar", c),
|
|
238
|
-
style: { height:
|
|
238
|
+
style: { height: o },
|
|
239
239
|
role: "progressbar",
|
|
240
|
-
"aria-valuenow": Math.round(
|
|
240
|
+
"aria-valuenow": Math.round(l * 100),
|
|
241
241
|
"aria-valuemin": 0,
|
|
242
242
|
"aria-valuemax": 100,
|
|
243
|
-
"aria-label":
|
|
244
|
-
children: /* @__PURE__ */ e("div", { className: "sui-progressbar__fill", style: { width: `${
|
|
243
|
+
"aria-label": i,
|
|
244
|
+
children: /* @__PURE__ */ e("div", { className: "sui-progressbar__fill", style: { width: `${l * 100}%`, background: _ } })
|
|
245
245
|
}
|
|
246
246
|
);
|
|
247
247
|
}
|
|
@@ -250,87 +250,88 @@ function ct({
|
|
|
250
250
|
hint: a,
|
|
251
251
|
error: n,
|
|
252
252
|
required: s,
|
|
253
|
-
id:
|
|
254
|
-
className:
|
|
255
|
-
|
|
253
|
+
id: r,
|
|
254
|
+
className: o,
|
|
255
|
+
style: i,
|
|
256
|
+
children: c
|
|
256
257
|
}) {
|
|
257
|
-
const
|
|
258
|
-
return /* @__PURE__ */ h("div", { className: w("sui-formfield",
|
|
259
|
-
t && /* @__PURE__ */ e(Ee, { htmlFor:
|
|
260
|
-
/* @__PURE__ */ e(
|
|
261
|
-
|
|
258
|
+
const l = we(), _ = r ?? l, u = n != null && n !== !1, g = `${_}-hint`, p = `${_}-error`, y = u ? p : a ? g : void 0;
|
|
259
|
+
return /* @__PURE__ */ h("div", { className: w("sui-formfield", o), style: i, children: [
|
|
260
|
+
t && /* @__PURE__ */ e(Ee, { htmlFor: _, required: s, children: t }),
|
|
261
|
+
/* @__PURE__ */ e(_e.Provider, { value: { id: _, invalid: u, describedBy: y }, children: c }),
|
|
262
|
+
u ? /* @__PURE__ */ e(pe, { as: "p", id: p, size: "xs", tone: "error", role: "alert", children: n }) : a ? /* @__PURE__ */ e(pe, { as: "p", id: g, size: "xs", tone: "secondary", children: a }) : null
|
|
262
263
|
] });
|
|
263
264
|
}
|
|
264
265
|
function q(t) {
|
|
265
266
|
return t.normalize("NFD").replace(/[\u0300-\u036f]/g, "").toLowerCase();
|
|
266
267
|
}
|
|
267
|
-
function
|
|
268
|
+
function dt({
|
|
268
269
|
value: t,
|
|
269
270
|
onChange: a,
|
|
270
271
|
options: n,
|
|
271
272
|
placeholder: s = "Selecionar...",
|
|
272
|
-
emptyText:
|
|
273
|
-
disabled:
|
|
274
|
-
className:
|
|
273
|
+
emptyText: r = "Nenhum resultado",
|
|
274
|
+
disabled: o = !1,
|
|
275
|
+
className: i
|
|
275
276
|
}) {
|
|
276
|
-
const c = ie(), [
|
|
277
|
-
|
|
278
|
-
},
|
|
279
|
-
|
|
277
|
+
const c = ie(), [l, _] = S(!1), [u, g] = S(""), [p, y] = S(0), z = K(null), E = n.find((m) => m.value === t) ?? null, L = u.trim() ? n.filter((m) => q(m.label).includes(q(u))) : n, $ = () => {
|
|
278
|
+
o || _(!0);
|
|
279
|
+
}, M = () => {
|
|
280
|
+
_(!1), g("");
|
|
280
281
|
}, T = (m) => {
|
|
281
|
-
|
|
282
|
+
o || a(m), M();
|
|
282
283
|
}, R = () => {
|
|
283
|
-
if (
|
|
284
|
-
const m =
|
|
284
|
+
if (o) return;
|
|
285
|
+
const m = L[p];
|
|
285
286
|
m && T(m.value);
|
|
286
287
|
};
|
|
287
288
|
H(() => {
|
|
288
|
-
|
|
289
|
-
}, [
|
|
290
|
-
const
|
|
289
|
+
y(0);
|
|
290
|
+
}, [u, l]);
|
|
291
|
+
const v = (m) => {
|
|
291
292
|
if (m.target === m.currentTarget) {
|
|
292
|
-
if (
|
|
293
|
+
if (o) {
|
|
293
294
|
m.preventDefault();
|
|
294
295
|
return;
|
|
295
296
|
}
|
|
296
|
-
m.key === "Enter" ? (m.preventDefault(),
|
|
297
|
+
m.key === "Enter" ? (m.preventDefault(), l ? R() : $()) : m.key === " " || m.key === "ArrowDown" ? (m.preventDefault(), l ? y((k) => Math.min(k + 1, L.length - 1)) : $()) : m.key === "ArrowUp" && (m.preventDefault(), l ? y((k) => Math.max(k - 1, 0)) : $());
|
|
297
298
|
}
|
|
298
299
|
};
|
|
299
|
-
return /* @__PURE__ */ h("div", { className: w("sui-combobox",
|
|
300
|
+
return /* @__PURE__ */ h("div", { className: w("sui-combobox", i), children: [
|
|
300
301
|
/* @__PURE__ */ h(
|
|
301
302
|
"div",
|
|
302
303
|
{
|
|
303
|
-
onClick:
|
|
304
|
+
onClick: $,
|
|
304
305
|
onFocus: (m) => {
|
|
305
|
-
m.target === m.currentTarget && !
|
|
306
|
+
m.target === m.currentTarget && !l && $();
|
|
306
307
|
},
|
|
307
|
-
onKeyDown:
|
|
308
|
-
tabIndex:
|
|
308
|
+
onKeyDown: v,
|
|
309
|
+
tabIndex: o ? -1 : 0,
|
|
309
310
|
role: "combobox",
|
|
310
|
-
"aria-expanded":
|
|
311
|
+
"aria-expanded": l,
|
|
311
312
|
"aria-haspopup": "listbox",
|
|
312
|
-
"aria-disabled":
|
|
313
|
+
"aria-disabled": o ? "true" : void 0,
|
|
313
314
|
"aria-describedby": c == null ? void 0 : c.describedBy,
|
|
314
315
|
id: c == null ? void 0 : c.id,
|
|
315
316
|
className: "sui-combobox__trigger",
|
|
316
|
-
"data-disabled":
|
|
317
|
+
"data-disabled": o || void 0,
|
|
317
318
|
"data-invalid": (c == null ? void 0 : c.invalid) || void 0,
|
|
318
319
|
children: [
|
|
319
|
-
E && !
|
|
320
|
-
|
|
320
|
+
E && !l && E.leading && /* @__PURE__ */ e("span", { className: "sui-combobox__leading", children: E.leading }),
|
|
321
|
+
l ? /* @__PURE__ */ e(
|
|
321
322
|
"input",
|
|
322
323
|
{
|
|
323
|
-
ref:
|
|
324
|
+
ref: z,
|
|
324
325
|
autoFocus: !0,
|
|
325
326
|
onFocus: (m) => m.currentTarget.select(),
|
|
326
|
-
value:
|
|
327
|
-
onChange: (m) =>
|
|
327
|
+
value: u,
|
|
328
|
+
onChange: (m) => g(m.target.value),
|
|
328
329
|
onKeyDown: (m) => {
|
|
329
|
-
if (
|
|
330
|
+
if (o) {
|
|
330
331
|
m.preventDefault();
|
|
331
332
|
return;
|
|
332
333
|
}
|
|
333
|
-
m.key === "Enter" ? (m.preventDefault(), R()) : m.key === "ArrowDown" ? (m.preventDefault(),
|
|
334
|
+
m.key === "Enter" ? (m.preventDefault(), R()) : m.key === "ArrowDown" ? (m.preventDefault(), y((k) => Math.min(k + 1, L.length - 1))) : m.key === "ArrowUp" ? (m.preventDefault(), y((k) => Math.max(k - 1, 0))) : m.key === "Escape" && M();
|
|
334
335
|
},
|
|
335
336
|
placeholder: E ? E.label : s,
|
|
336
337
|
className: "sui-combobox__search"
|
|
@@ -340,20 +341,20 @@ function ut({
|
|
|
340
341
|
]
|
|
341
342
|
}
|
|
342
343
|
),
|
|
343
|
-
|
|
344
|
-
/* @__PURE__ */ e("div", { className: "sui-combobox__backdrop", onClick:
|
|
344
|
+
l && !o && /* @__PURE__ */ h(ee, { children: [
|
|
345
|
+
/* @__PURE__ */ e("div", { className: "sui-combobox__backdrop", onClick: M }),
|
|
345
346
|
/* @__PURE__ */ h("div", { className: "sui-combobox__list", role: "listbox", children: [
|
|
346
|
-
|
|
347
|
-
|
|
347
|
+
L.length === 0 && /* @__PURE__ */ e("div", { className: "sui-combobox__empty", children: r }),
|
|
348
|
+
L.map((m, k) => /* @__PURE__ */ h(
|
|
348
349
|
"button",
|
|
349
350
|
{
|
|
350
351
|
type: "button",
|
|
351
352
|
role: "option",
|
|
352
353
|
"aria-selected": m.value === t,
|
|
353
|
-
onMouseEnter: () => k
|
|
354
|
+
onMouseEnter: () => y(k),
|
|
354
355
|
onClick: () => T(m.value),
|
|
355
356
|
className: "sui-combobox__option",
|
|
356
|
-
"data-highlight":
|
|
357
|
+
"data-highlight": k === p || void 0,
|
|
357
358
|
"data-selected": m.value === t || void 0,
|
|
358
359
|
children: [
|
|
359
360
|
m.leading && /* @__PURE__ */ e("span", { className: "sui-combobox__leading", children: m.leading }),
|
|
@@ -367,8 +368,8 @@ function ut({
|
|
|
367
368
|
] });
|
|
368
369
|
}
|
|
369
370
|
function U(t, a) {
|
|
370
|
-
const n = t.replace("#", ""), s = parseInt(n.slice(0, 2), 16),
|
|
371
|
-
return `rgba(${s},${
|
|
371
|
+
const n = t.replace("#", ""), s = parseInt(n.slice(0, 2), 16), r = parseInt(n.slice(2, 4), 16), o = parseInt(n.slice(4, 6), 16);
|
|
372
|
+
return `rgba(${s},${r},${o},${a})`;
|
|
372
373
|
}
|
|
373
374
|
function re(t) {
|
|
374
375
|
const a = t.replace("#", "").padEnd(6, "0");
|
|
@@ -379,19 +380,19 @@ function re(t) {
|
|
|
379
380
|
];
|
|
380
381
|
}
|
|
381
382
|
function ne(t, a, n) {
|
|
382
|
-
const s = (
|
|
383
|
+
const s = (r) => Math.round(Math.max(0, Math.min(255, r))).toString(16).padStart(2, "0");
|
|
383
384
|
return `#${s(t)}${s(a)}${s(n)}`;
|
|
384
385
|
}
|
|
385
386
|
function le(t, a, n) {
|
|
386
387
|
t /= 255, a /= 255, n /= 255;
|
|
387
|
-
const s = Math.max(t, a, n),
|
|
388
|
-
let
|
|
389
|
-
return
|
|
388
|
+
const s = Math.max(t, a, n), r = Math.min(t, a, n), o = s - r;
|
|
389
|
+
let i = 0;
|
|
390
|
+
return o && (s === t ? i = (a - n) / o % 6 : s === a ? i = (n - t) / o + 2 : i = (t - a) / o + 4, i *= 60, i < 0 && (i += 360)), { h: i, s: s ? o / s : 0, v: s };
|
|
390
391
|
}
|
|
391
392
|
function oe(t, a, n) {
|
|
392
|
-
const s = n * a,
|
|
393
|
-
let
|
|
394
|
-
return t < 60 ? [
|
|
393
|
+
const s = n * a, r = s * (1 - Math.abs(t / 60 % 2 - 1)), o = n - s;
|
|
394
|
+
let i = 0, c = 0, l = 0;
|
|
395
|
+
return t < 60 ? [i, c, l] = [s, r, 0] : t < 120 ? [i, c, l] = [r, s, 0] : t < 180 ? [i, c, l] = [0, s, r] : t < 240 ? [i, c, l] = [0, r, s] : t < 300 ? [i, c, l] = [r, 0, s] : [i, c, l] = [s, 0, r], [Math.round((i + o) * 255), Math.round((c + o) * 255), Math.round((l + o) * 255)];
|
|
395
396
|
}
|
|
396
397
|
function Ie(t) {
|
|
397
398
|
let a = (t == null ? void 0 : t.parentElement) ?? null;
|
|
@@ -410,54 +411,54 @@ function ve(t) {
|
|
|
410
411
|
return { top: n.top, left: n.left };
|
|
411
412
|
}
|
|
412
413
|
const Q = "#5961f7";
|
|
413
|
-
function
|
|
414
|
+
function ut({
|
|
414
415
|
options: t,
|
|
415
416
|
selected: a,
|
|
416
417
|
onChange: n,
|
|
417
418
|
placeholder: s = "Selecionar...",
|
|
418
|
-
emptyText:
|
|
419
|
-
noResultsText:
|
|
420
|
-
className:
|
|
419
|
+
emptyText: r = "Nenhuma opção disponível",
|
|
420
|
+
noResultsText: o = "Nenhum resultado",
|
|
421
|
+
className: i
|
|
421
422
|
}) {
|
|
422
|
-
const c = ie(), [
|
|
423
|
+
const c = ie(), [l, _] = S(!1), [u, g] = S(""), [p, y] = S(0), [z, E] = S(null), L = K(null), $ = K(null), M = a.map((d) => t.find((b) => b.value === d)).filter((d) => !!d), T = (d) => n(a.includes(d) ? a.filter((b) => b !== d) : [...a, d]), R = u.trim() ? t.filter((d) => q(d.label).includes(q(u))) : t;
|
|
423
424
|
H(() => {
|
|
424
|
-
if (!
|
|
425
|
-
const
|
|
425
|
+
if (!l) return;
|
|
426
|
+
const d = () => {
|
|
426
427
|
var D;
|
|
427
|
-
const
|
|
428
|
-
if (!
|
|
429
|
-
const C = ve(
|
|
430
|
-
E({ top:
|
|
428
|
+
const b = (D = L.current) == null ? void 0 : D.getBoundingClientRect();
|
|
429
|
+
if (!b) return;
|
|
430
|
+
const C = ve(L.current);
|
|
431
|
+
E({ top: b.bottom - C.top + 6, left: b.left - C.left, width: b.width });
|
|
431
432
|
};
|
|
432
|
-
return
|
|
433
|
-
window.removeEventListener("scroll",
|
|
433
|
+
return d(), window.addEventListener("scroll", d, !0), window.addEventListener("resize", d), () => {
|
|
434
|
+
window.removeEventListener("scroll", d, !0), window.removeEventListener("resize", d);
|
|
434
435
|
};
|
|
435
|
-
}, [
|
|
436
|
-
|
|
437
|
-
}, [
|
|
438
|
-
const
|
|
439
|
-
const
|
|
440
|
-
|
|
436
|
+
}, [l]), H(() => {
|
|
437
|
+
y(0);
|
|
438
|
+
}, [u, l]);
|
|
439
|
+
const v = () => {
|
|
440
|
+
const d = R[p];
|
|
441
|
+
d && T(d.value), g("");
|
|
441
442
|
}, m = () => requestAnimationFrame(() => {
|
|
442
|
-
var
|
|
443
|
-
return (
|
|
444
|
-
}),
|
|
445
|
-
|
|
443
|
+
var d;
|
|
444
|
+
return (d = $.current) == null ? void 0 : d.focus();
|
|
445
|
+
}), k = () => {
|
|
446
|
+
_(!0), m();
|
|
446
447
|
};
|
|
447
|
-
return /* @__PURE__ */ h("div", { ref:
|
|
448
|
+
return /* @__PURE__ */ h("div", { ref: L, className: w("sui-multiselect", i), children: [
|
|
448
449
|
/* @__PURE__ */ h(
|
|
449
450
|
"div",
|
|
450
451
|
{
|
|
451
|
-
onClick:
|
|
452
|
-
onFocus: (
|
|
453
|
-
|
|
452
|
+
onClick: k,
|
|
453
|
+
onFocus: (d) => {
|
|
454
|
+
d.target === d.currentTarget && k();
|
|
454
455
|
},
|
|
455
|
-
onKeyDown: (
|
|
456
|
-
|
|
456
|
+
onKeyDown: (d) => {
|
|
457
|
+
d.target === d.currentTarget && (d.key === "Enter" ? (d.preventDefault(), l ? v() : k()) : d.key === " " || d.key === "ArrowDown" ? (d.preventDefault(), l ? y((b) => Math.min(b + 1, R.length - 1)) : k()) : d.key === "ArrowUp" && (d.preventDefault(), l ? y((b) => Math.max(b - 1, 0)) : k()));
|
|
457
458
|
},
|
|
458
459
|
tabIndex: 0,
|
|
459
460
|
role: "combobox",
|
|
460
|
-
"aria-expanded":
|
|
461
|
+
"aria-expanded": l,
|
|
461
462
|
"aria-haspopup": "listbox",
|
|
462
463
|
id: c == null ? void 0 : c.id,
|
|
463
464
|
"aria-describedby": c == null ? void 0 : c.describedBy,
|
|
@@ -465,30 +466,30 @@ function dt({
|
|
|
465
466
|
className: "sui-multiselect__trigger",
|
|
466
467
|
children: [
|
|
467
468
|
/* @__PURE__ */ h("div", { className: "sui-multiselect__chips", children: [
|
|
468
|
-
|
|
469
|
+
M.map((d) => /* @__PURE__ */ h(
|
|
469
470
|
"span",
|
|
470
471
|
{
|
|
471
472
|
className: "sui-multiselect__chip",
|
|
472
473
|
style: {
|
|
473
|
-
background: U(
|
|
474
|
-
color:
|
|
474
|
+
background: U(d.color ?? Q, 0.14),
|
|
475
|
+
color: d.color ?? Q
|
|
475
476
|
},
|
|
476
477
|
children: [
|
|
477
|
-
|
|
478
|
+
d.icon ?? /* @__PURE__ */ e(
|
|
478
479
|
"span",
|
|
479
480
|
{
|
|
480
481
|
className: "sui-multiselect__dot",
|
|
481
|
-
style: { background:
|
|
482
|
+
style: { background: d.color ?? Q }
|
|
482
483
|
}
|
|
483
484
|
),
|
|
484
|
-
|
|
485
|
+
d.label,
|
|
485
486
|
/* @__PURE__ */ e(
|
|
486
487
|
"button",
|
|
487
488
|
{
|
|
488
489
|
type: "button",
|
|
489
|
-
"aria-label": `Remover ${
|
|
490
|
-
onClick: (
|
|
491
|
-
|
|
490
|
+
"aria-label": `Remover ${d.label}`,
|
|
491
|
+
onClick: (b) => {
|
|
492
|
+
b.stopPropagation(), T(d.value);
|
|
492
493
|
},
|
|
493
494
|
className: "sui-multiselect__chip-x",
|
|
494
495
|
children: "×"
|
|
@@ -496,22 +497,22 @@ function dt({
|
|
|
496
497
|
)
|
|
497
498
|
]
|
|
498
499
|
},
|
|
499
|
-
|
|
500
|
+
d.value
|
|
500
501
|
)),
|
|
501
502
|
/* @__PURE__ */ e(
|
|
502
503
|
"input",
|
|
503
504
|
{
|
|
504
|
-
ref:
|
|
505
|
-
value:
|
|
506
|
-
onChange: (
|
|
507
|
-
|
|
505
|
+
ref: $,
|
|
506
|
+
value: u,
|
|
507
|
+
onChange: (d) => {
|
|
508
|
+
g(d.target.value), _(!0);
|
|
508
509
|
},
|
|
509
|
-
onFocus: () =>
|
|
510
|
-
onKeyDown: (
|
|
511
|
-
var
|
|
512
|
-
|
|
510
|
+
onFocus: () => _(!0),
|
|
511
|
+
onKeyDown: (d) => {
|
|
512
|
+
var b;
|
|
513
|
+
d.key === "Enter" ? (d.preventDefault(), v()) : d.key === "ArrowDown" ? (d.preventDefault(), _(!0), y((C) => Math.min(C + 1, R.length - 1))) : d.key === "ArrowUp" ? (d.preventDefault(), y((C) => Math.max(C - 1, 0))) : d.key === "Escape" && (_(!1), (b = $.current) == null || b.blur());
|
|
513
514
|
},
|
|
514
|
-
placeholder:
|
|
515
|
+
placeholder: M.length === 0 ? s : "",
|
|
515
516
|
className: "sui-multiselect__search"
|
|
516
517
|
}
|
|
517
518
|
)
|
|
@@ -520,32 +521,32 @@ function dt({
|
|
|
520
521
|
]
|
|
521
522
|
}
|
|
522
523
|
),
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */ e("div", { className: "sui-multiselect__backdrop", onClick: () =>
|
|
524
|
+
l && z && /* @__PURE__ */ h(ee, { children: [
|
|
525
|
+
/* @__PURE__ */ e("div", { className: "sui-multiselect__backdrop", onClick: () => _(!1) }),
|
|
525
526
|
/* @__PURE__ */ h(
|
|
526
527
|
"div",
|
|
527
528
|
{
|
|
528
529
|
className: "sui-multiselect__list",
|
|
529
530
|
role: "listbox",
|
|
530
531
|
"aria-multiselectable": "true",
|
|
531
|
-
style: { top:
|
|
532
|
+
style: { top: z.top, left: z.left, width: z.width },
|
|
532
533
|
children: [
|
|
533
|
-
R.length === 0 && /* @__PURE__ */ e("div", { className: "sui-multiselect__empty", children: t.length === 0 ?
|
|
534
|
-
R.map((
|
|
535
|
-
const C = a.includes(
|
|
534
|
+
R.length === 0 && /* @__PURE__ */ e("div", { className: "sui-multiselect__empty", children: t.length === 0 ? r : o }),
|
|
535
|
+
R.map((d, b) => {
|
|
536
|
+
const C = a.includes(d.value);
|
|
536
537
|
return /* @__PURE__ */ h(
|
|
537
538
|
"button",
|
|
538
539
|
{
|
|
539
540
|
type: "button",
|
|
540
541
|
role: "option",
|
|
541
542
|
"aria-selected": C,
|
|
542
|
-
onMouseEnter: () =>
|
|
543
|
+
onMouseEnter: () => y(b),
|
|
543
544
|
onClick: () => {
|
|
544
545
|
var D;
|
|
545
|
-
T(
|
|
546
|
+
T(d.value), g(""), (D = $.current) == null || D.focus();
|
|
546
547
|
},
|
|
547
548
|
className: "sui-multiselect__option",
|
|
548
|
-
"data-highlight":
|
|
549
|
+
"data-highlight": b === p || void 0,
|
|
549
550
|
"data-checked": C || void 0,
|
|
550
551
|
children: [
|
|
551
552
|
/* @__PURE__ */ e(
|
|
@@ -553,33 +554,33 @@ function dt({
|
|
|
553
554
|
{
|
|
554
555
|
className: "sui-multiselect__check",
|
|
555
556
|
style: C ? {
|
|
556
|
-
background:
|
|
557
|
-
borderColor:
|
|
557
|
+
background: d.color ?? Q,
|
|
558
|
+
borderColor: d.color ?? Q
|
|
558
559
|
} : void 0,
|
|
559
560
|
children: C && /* @__PURE__ */ e(P, { name: "check", size: 12, color: "#fff", strokeWidth: 3 })
|
|
560
561
|
}
|
|
561
562
|
),
|
|
562
|
-
|
|
563
|
+
d.icon ?? /* @__PURE__ */ e(
|
|
563
564
|
"span",
|
|
564
565
|
{
|
|
565
566
|
className: "sui-multiselect__dot sui-multiselect__dot--lg",
|
|
566
|
-
style: { background:
|
|
567
|
+
style: { background: d.color ?? Q }
|
|
567
568
|
}
|
|
568
569
|
),
|
|
569
570
|
/* @__PURE__ */ h("span", { className: "sui-multiselect__option-text", children: [
|
|
570
|
-
/* @__PURE__ */ e("span", { className: "sui-multiselect__option-label", children:
|
|
571
|
-
|
|
571
|
+
/* @__PURE__ */ e("span", { className: "sui-multiselect__option-label", children: d.label }),
|
|
572
|
+
d.sublabel && /* @__PURE__ */ e(
|
|
572
573
|
"span",
|
|
573
574
|
{
|
|
574
575
|
className: "sui-multiselect__option-sub",
|
|
575
|
-
style:
|
|
576
|
-
children:
|
|
576
|
+
style: d.sublabelColor ? { color: d.sublabelColor } : void 0,
|
|
577
|
+
children: d.sublabel
|
|
577
578
|
}
|
|
578
579
|
)
|
|
579
580
|
] })
|
|
580
581
|
]
|
|
581
582
|
},
|
|
582
|
-
|
|
583
|
+
d.value
|
|
583
584
|
);
|
|
584
585
|
})
|
|
585
586
|
]
|
|
@@ -594,25 +595,27 @@ function ht({
|
|
|
594
595
|
value: a,
|
|
595
596
|
onChange: n,
|
|
596
597
|
variant: s = "pill",
|
|
597
|
-
|
|
598
|
+
disabled: r = !1,
|
|
599
|
+
className: o
|
|
598
600
|
}) {
|
|
599
|
-
return /* @__PURE__ */ e("div", { className: w("sui-segmented",
|
|
600
|
-
const
|
|
601
|
+
return /* @__PURE__ */ e("div", { className: w("sui-segmented", o), "data-variant": s, "data-disabled": r || void 0, role: "group", children: t.map((i) => {
|
|
602
|
+
const c = a === i.value, l = i.color ?? Te;
|
|
601
603
|
return /* @__PURE__ */ h(
|
|
602
604
|
"button",
|
|
603
605
|
{
|
|
604
606
|
type: "button",
|
|
605
|
-
"aria-pressed":
|
|
607
|
+
"aria-pressed": c,
|
|
608
|
+
disabled: r,
|
|
606
609
|
onClick: () => n(i.value),
|
|
607
610
|
className: "sui-segmented__option",
|
|
608
|
-
"data-on":
|
|
609
|
-
style:
|
|
611
|
+
"data-on": c || void 0,
|
|
612
|
+
style: c ? s === "pill" ? { background: U(l, 0.13), color: l } : s === "card" ? { background: U(l, 0.16), borderColor: U(l, 0.5) } : void 0 : void 0,
|
|
610
613
|
children: [
|
|
611
614
|
s === "pill" && /* @__PURE__ */ e(
|
|
612
615
|
"span",
|
|
613
616
|
{
|
|
614
617
|
className: "sui-segmented__dot",
|
|
615
|
-
style: { background:
|
|
618
|
+
style: { background: l, opacity: c ? 1 : 0.4 }
|
|
616
619
|
}
|
|
617
620
|
),
|
|
618
621
|
/* @__PURE__ */ e("span", { className: "sui-segmented__label", children: i.label }),
|
|
@@ -620,7 +623,7 @@ function ht({
|
|
|
620
623
|
"span",
|
|
621
624
|
{
|
|
622
625
|
className: "sui-segmented__sublabel",
|
|
623
|
-
style:
|
|
626
|
+
style: c ? { color: l } : void 0,
|
|
624
627
|
children: i.sublabel
|
|
625
628
|
}
|
|
626
629
|
)
|
|
@@ -635,26 +638,26 @@ function mt({
|
|
|
635
638
|
description: a,
|
|
636
639
|
checked: n,
|
|
637
640
|
onCheckedChange: s,
|
|
638
|
-
disabled:
|
|
639
|
-
className:
|
|
641
|
+
disabled: r,
|
|
642
|
+
className: o
|
|
640
643
|
}) {
|
|
641
644
|
return /* @__PURE__ */ h(
|
|
642
645
|
"div",
|
|
643
646
|
{
|
|
644
|
-
className: w("sui-switchcard",
|
|
645
|
-
"data-disabled":
|
|
646
|
-
onClick: () => !
|
|
647
|
+
className: w("sui-switchcard", o),
|
|
648
|
+
"data-disabled": r || void 0,
|
|
649
|
+
onClick: () => !r && s(!n),
|
|
647
650
|
children: [
|
|
648
651
|
/* @__PURE__ */ h("div", { className: "sui-switchcard__text", children: [
|
|
649
652
|
/* @__PURE__ */ e("div", { className: "sui-switchcard__title", children: t }),
|
|
650
653
|
a && /* @__PURE__ */ e("div", { className: "sui-switchcard__desc", children: a })
|
|
651
654
|
] }),
|
|
652
|
-
/* @__PURE__ */ e("span", { onClick: (
|
|
655
|
+
/* @__PURE__ */ e("span", { onClick: (i) => i.stopPropagation(), style: { display: "inline-flex" }, children: /* @__PURE__ */ e(
|
|
653
656
|
Le,
|
|
654
657
|
{
|
|
655
658
|
checked: n,
|
|
656
|
-
onCheckedChange: (
|
|
657
|
-
disabled:
|
|
659
|
+
onCheckedChange: (i) => s(i),
|
|
660
|
+
disabled: r,
|
|
658
661
|
"aria-label": typeof t == "string" ? t : void 0
|
|
659
662
|
}
|
|
660
663
|
) })
|
|
@@ -676,29 +679,29 @@ function pt({
|
|
|
676
679
|
onChange: a,
|
|
677
680
|
currency: n = "R$",
|
|
678
681
|
placeholder: s = "0,00",
|
|
679
|
-
disabled:
|
|
680
|
-
invalid:
|
|
682
|
+
disabled: r,
|
|
683
|
+
invalid: o
|
|
681
684
|
}) {
|
|
682
|
-
const
|
|
685
|
+
const i = K(null), c = Re(t);
|
|
683
686
|
return H(() => {
|
|
684
|
-
const
|
|
685
|
-
|
|
687
|
+
const l = i.current;
|
|
688
|
+
l && document.activeElement === l && l.setSelectionRange(l.value.length, l.value.length);
|
|
686
689
|
}), /* @__PURE__ */ e(
|
|
687
|
-
|
|
690
|
+
fe,
|
|
688
691
|
{
|
|
689
|
-
ref:
|
|
692
|
+
ref: i,
|
|
690
693
|
type: "text",
|
|
691
694
|
inputMode: "decimal",
|
|
692
695
|
className: "sui-moneyinput",
|
|
693
696
|
leftAddon: /* @__PURE__ */ e("span", { className: "sui-moneyinput__currency", children: n }),
|
|
694
697
|
value: c ? Ae(c) : "",
|
|
695
|
-
onChange: (
|
|
696
|
-
const
|
|
697
|
-
a(
|
|
698
|
+
onChange: (l) => {
|
|
699
|
+
const _ = l.target.value.replace(/\D/g, "");
|
|
700
|
+
a(_ ? (Number(_) / 100).toFixed(2) : "");
|
|
698
701
|
},
|
|
699
702
|
placeholder: s,
|
|
700
|
-
disabled:
|
|
701
|
-
invalid:
|
|
703
|
+
disabled: r,
|
|
704
|
+
invalid: o
|
|
702
705
|
}
|
|
703
706
|
);
|
|
704
707
|
}
|
|
@@ -706,47 +709,47 @@ function Pe(t) {
|
|
|
706
709
|
return t.replace(/\D+/g, "").slice(0, 12);
|
|
707
710
|
}
|
|
708
711
|
function Be(t) {
|
|
709
|
-
const a = t.slice(0, 2), n = t.slice(2, 4), s = t.slice(4, 8),
|
|
710
|
-
let
|
|
711
|
-
return a && (
|
|
712
|
+
const a = t.slice(0, 2), n = t.slice(2, 4), s = t.slice(4, 8), r = t.slice(8, 10), o = t.slice(10, 12);
|
|
713
|
+
let i = "";
|
|
714
|
+
return a && (i += a, a.length === 2 && n && (i += "/")), n && (i += n, n.length === 2 && s && (i += "/")), s && (i += s, s.length === 4 && (r || o) && (i += " ")), r && (i += r, r.length === 2 && o && (i += ":")), o && (i += o), i;
|
|
712
715
|
}
|
|
713
716
|
function ce(t) {
|
|
714
717
|
const a = /^(\d{2})\/(\d{2})\/(\d{4})\s+(\d{2}):(\d{2})$/.exec(t.trim());
|
|
715
718
|
if (!a) return null;
|
|
716
|
-
const [, n, s,
|
|
717
|
-
if (
|
|
718
|
-
const
|
|
719
|
-
return Number.isNaN(
|
|
719
|
+
const [, n, s, r, o, i] = a, c = Number(n), l = Number(s), _ = Number(r), u = Number(o), g = Number(i);
|
|
720
|
+
if (l < 1 || l > 12 || c < 1 || c > 31 || u < 0 || u > 23 || g < 0 || g > 59) return null;
|
|
721
|
+
const p = new Date(_, l - 1, c, u, g);
|
|
722
|
+
return Number.isNaN(p.getTime()) || p.getFullYear() !== _ || p.getMonth() !== l - 1 || p.getDate() !== c ? null : `${r}-${s}-${n}T${o}:${i}`;
|
|
720
723
|
}
|
|
721
724
|
function Fe(t) {
|
|
722
725
|
const a = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})/.exec(t ?? "");
|
|
723
726
|
return a ? `${a[3]}/${a[2]}/${a[1]} ${a[4]}:${a[5]}` : "";
|
|
724
727
|
}
|
|
725
|
-
function
|
|
728
|
+
function _t({
|
|
726
729
|
value: t,
|
|
727
730
|
onChange: a,
|
|
728
731
|
placeholder: n = "dd/mm/aaaa hh:mm",
|
|
729
732
|
disabled: s
|
|
730
733
|
}) {
|
|
731
|
-
const [
|
|
734
|
+
const [r, o] = S(""), i = Fe(t);
|
|
732
735
|
H(() => {
|
|
733
|
-
i
|
|
734
|
-
}, [
|
|
735
|
-
const c =
|
|
736
|
+
o(i);
|
|
737
|
+
}, [i]);
|
|
738
|
+
const c = r === "" || !!ce(r);
|
|
736
739
|
return /* @__PURE__ */ e(
|
|
737
|
-
|
|
740
|
+
fe,
|
|
738
741
|
{
|
|
739
742
|
type: "text",
|
|
740
743
|
inputMode: "numeric",
|
|
741
|
-
value:
|
|
742
|
-
onChange: (
|
|
743
|
-
const
|
|
744
|
-
|
|
745
|
-
const
|
|
746
|
-
|
|
744
|
+
value: r,
|
|
745
|
+
onChange: (l) => {
|
|
746
|
+
const _ = Be(Pe(l.target.value));
|
|
747
|
+
o(_);
|
|
748
|
+
const u = ce(_);
|
|
749
|
+
u && a(u);
|
|
747
750
|
},
|
|
748
751
|
onBlur: () => {
|
|
749
|
-
!ce(
|
|
752
|
+
!ce(r) && t && o(i);
|
|
750
753
|
},
|
|
751
754
|
placeholder: n,
|
|
752
755
|
disabled: s,
|
|
@@ -768,30 +771,30 @@ const Oe = [
|
|
|
768
771
|
"Novembro",
|
|
769
772
|
"Dezembro"
|
|
770
773
|
];
|
|
771
|
-
function
|
|
774
|
+
function ft({
|
|
772
775
|
value: t,
|
|
773
776
|
onChange: a,
|
|
774
777
|
monthLabels: n = Oe,
|
|
775
778
|
formatLabel: s,
|
|
776
|
-
prevLabel:
|
|
777
|
-
nextLabel:
|
|
778
|
-
className:
|
|
779
|
+
prevLabel: r = "Mês anterior",
|
|
780
|
+
nextLabel: o = "Próximo mês",
|
|
781
|
+
className: i
|
|
779
782
|
}) {
|
|
780
|
-
const [c,
|
|
781
|
-
let m = t.month +
|
|
782
|
-
m < 1 ? (m = 12,
|
|
783
|
-
},
|
|
784
|
-
|
|
783
|
+
const [c, l] = S(!1), [_, u] = S(t.year), g = (v) => s ? s(v) : `${n[v.month - 1]} ${v.year}`, p = g(t), y = n.indexOf(n.reduce((v, m) => m.length > v.length ? m : v)) + 1, z = g({ year: t.year, month: y }), E = (v) => v.slice(0, 3), L = (v) => {
|
|
784
|
+
let m = t.month + v, k = t.year;
|
|
785
|
+
m < 1 ? (m = 12, k -= 1) : m > 12 && (m = 1, k += 1), a({ year: k, month: m }), u(k);
|
|
786
|
+
}, $ = () => {
|
|
787
|
+
u(t.year), l((v) => !v);
|
|
785
788
|
};
|
|
786
789
|
H(() => {
|
|
787
790
|
if (!c) return;
|
|
788
|
-
const
|
|
789
|
-
m.key === "Escape" &&
|
|
791
|
+
const v = (m) => {
|
|
792
|
+
m.key === "Escape" && l(!1);
|
|
790
793
|
};
|
|
791
|
-
return document.addEventListener("keydown",
|
|
794
|
+
return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
|
|
792
795
|
}, [c]);
|
|
793
|
-
const
|
|
794
|
-
return /* @__PURE__ */ h("div", { className: w("sui-monthpicker",
|
|
796
|
+
const M = /* @__PURE__ */ new Date(), T = M.getFullYear(), R = M.getMonth() + 1;
|
|
797
|
+
return /* @__PURE__ */ h("div", { className: w("sui-monthpicker", i), children: [
|
|
795
798
|
/* @__PURE__ */ h("div", { className: "sui-monthpicker__bar", children: [
|
|
796
799
|
/* @__PURE__ */ h(
|
|
797
800
|
"button",
|
|
@@ -800,23 +803,23 @@ function _t({
|
|
|
800
803
|
className: "sui-monthpicker__label",
|
|
801
804
|
"aria-expanded": c,
|
|
802
805
|
"aria-haspopup": "dialog",
|
|
803
|
-
onClick:
|
|
806
|
+
onClick: $,
|
|
804
807
|
children: [
|
|
805
808
|
/* @__PURE__ */ e(P, { name: "calendar", size: 16, color: "var(--text-brand)" }),
|
|
806
809
|
/* @__PURE__ */ h("span", { className: "sui-monthpicker__label-text", children: [
|
|
807
|
-
/* @__PURE__ */ e("span", { className: "sui-monthpicker__label-ghost", "aria-hidden": "true", children:
|
|
808
|
-
/* @__PURE__ */ e("span", { className: "sui-monthpicker__label-value", children:
|
|
810
|
+
/* @__PURE__ */ e("span", { className: "sui-monthpicker__label-ghost", "aria-hidden": "true", children: z }),
|
|
811
|
+
/* @__PURE__ */ e("span", { className: "sui-monthpicker__label-value", children: p })
|
|
809
812
|
] })
|
|
810
813
|
]
|
|
811
814
|
}
|
|
812
815
|
),
|
|
813
816
|
/* @__PURE__ */ e("span", { className: "sui-monthpicker__divider", "aria-hidden": "true" }),
|
|
814
|
-
/* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label":
|
|
815
|
-
/* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label":
|
|
817
|
+
/* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label": r, onClick: () => L(-1), children: /* @__PURE__ */ e(P, { name: "chevLeft", size: 16 }) }),
|
|
818
|
+
/* @__PURE__ */ e("button", { type: "button", className: "sui-monthpicker__step", "aria-label": o, onClick: () => L(1), children: /* @__PURE__ */ e(P, { name: "chevRight", size: 16 }) })
|
|
816
819
|
] }),
|
|
817
820
|
c && /* @__PURE__ */ h(ee, { children: [
|
|
818
|
-
/* @__PURE__ */ e("div", { className: "sui-monthpicker__backdrop", onClick: () =>
|
|
819
|
-
/* @__PURE__ */ h("div", { className: "sui-monthpicker__panel", role: "dialog", "aria-label":
|
|
821
|
+
/* @__PURE__ */ e("div", { className: "sui-monthpicker__backdrop", onClick: () => l(!1) }),
|
|
822
|
+
/* @__PURE__ */ h("div", { className: "sui-monthpicker__panel", role: "dialog", "aria-label": p, children: [
|
|
820
823
|
/* @__PURE__ */ h("div", { className: "sui-monthpicker__yearbar", children: [
|
|
821
824
|
/* @__PURE__ */ e(
|
|
822
825
|
"button",
|
|
@@ -824,38 +827,38 @@ function _t({
|
|
|
824
827
|
type: "button",
|
|
825
828
|
className: "sui-monthpicker__step sui-monthpicker__step--year",
|
|
826
829
|
"aria-label": "Ano anterior",
|
|
827
|
-
onClick: () =>
|
|
830
|
+
onClick: () => u((v) => v - 1),
|
|
828
831
|
children: /* @__PURE__ */ e(P, { name: "chevLeft", size: 16 })
|
|
829
832
|
}
|
|
830
833
|
),
|
|
831
|
-
/* @__PURE__ */ e("span", { className: "sui-monthpicker__year", children:
|
|
834
|
+
/* @__PURE__ */ e("span", { className: "sui-monthpicker__year", children: _ }),
|
|
832
835
|
/* @__PURE__ */ e(
|
|
833
836
|
"button",
|
|
834
837
|
{
|
|
835
838
|
type: "button",
|
|
836
839
|
className: "sui-monthpicker__step sui-monthpicker__step--year",
|
|
837
840
|
"aria-label": "Próximo ano",
|
|
838
|
-
onClick: () =>
|
|
841
|
+
onClick: () => u((v) => v + 1),
|
|
839
842
|
children: /* @__PURE__ */ e(P, { name: "chevRight", size: 16 })
|
|
840
843
|
}
|
|
841
844
|
)
|
|
842
845
|
] }),
|
|
843
|
-
/* @__PURE__ */ e("div", { className: "sui-monthpicker__grid", children: n.map((
|
|
844
|
-
const
|
|
846
|
+
/* @__PURE__ */ e("div", { className: "sui-monthpicker__grid", children: n.map((v, m) => {
|
|
847
|
+
const k = m + 1, d = t.year === _ && t.month === k;
|
|
845
848
|
return /* @__PURE__ */ e(
|
|
846
849
|
"button",
|
|
847
850
|
{
|
|
848
851
|
type: "button",
|
|
849
|
-
"aria-pressed":
|
|
852
|
+
"aria-pressed": d,
|
|
850
853
|
className: "sui-monthpicker__month",
|
|
851
|
-
"data-selected":
|
|
852
|
-
"data-current": T ===
|
|
854
|
+
"data-selected": d || void 0,
|
|
855
|
+
"data-current": T === _ && R === k || void 0,
|
|
853
856
|
onClick: () => {
|
|
854
|
-
a({ year:
|
|
857
|
+
a({ year: _, month: k }), l(!1);
|
|
855
858
|
},
|
|
856
|
-
children: E(
|
|
859
|
+
children: E(v)
|
|
857
860
|
},
|
|
858
|
-
|
|
861
|
+
k
|
|
859
862
|
);
|
|
860
863
|
}) })
|
|
861
864
|
] })
|
|
@@ -879,58 +882,58 @@ function vt({
|
|
|
879
882
|
onChange: a,
|
|
880
883
|
swatches: n = He,
|
|
881
884
|
defaultOpen: s = !1,
|
|
882
|
-
open:
|
|
883
|
-
onOpenChange:
|
|
884
|
-
showInput:
|
|
885
|
+
open: r,
|
|
886
|
+
onOpenChange: o,
|
|
887
|
+
showInput: i = !0,
|
|
885
888
|
customLabel: c = "Cor personalizada",
|
|
886
|
-
className:
|
|
889
|
+
className: l
|
|
887
890
|
}) {
|
|
888
|
-
const
|
|
889
|
-
value:
|
|
891
|
+
const _ = n[0] ?? "#5961f7", [u, g] = ue({
|
|
892
|
+
value: r,
|
|
890
893
|
defaultValue: s,
|
|
891
|
-
onChange:
|
|
892
|
-
}), [
|
|
894
|
+
onChange: o
|
|
895
|
+
}), [p, y] = S(() => le(...re(t || _))), [z, E] = S("hex"), [L, $] = S(() => (t || _).replace("#", "")), M = K(null), T = K(null), R = K(null);
|
|
893
896
|
H(() => {
|
|
894
|
-
const N = ne(...oe(
|
|
895
|
-
(t ||
|
|
897
|
+
const N = ne(...oe(p.h, p.s, p.v));
|
|
898
|
+
(t || _).toLowerCase() !== N.toLowerCase() && y(le(...re(t || _)));
|
|
896
899
|
}, [t]), H(() => {
|
|
897
|
-
("#" +
|
|
900
|
+
("#" + L).toLowerCase() !== (t || _).toLowerCase() && $((t || _).replace("#", ""));
|
|
898
901
|
}, [t]);
|
|
899
|
-
const
|
|
900
|
-
const x = { ...
|
|
901
|
-
|
|
902
|
+
const v = (N) => {
|
|
903
|
+
const x = { ...p, ...N };
|
|
904
|
+
y(x), a(ne(...oe(x.h, x.s, x.v)));
|
|
902
905
|
}, m = (N) => {
|
|
903
906
|
var A;
|
|
904
|
-
const x = (A =
|
|
905
|
-
x &&
|
|
907
|
+
const x = (A = M.current) == null ? void 0 : A.getBoundingClientRect();
|
|
908
|
+
x && v({
|
|
906
909
|
s: Math.min(1, Math.max(0, (N.clientX - x.left) / x.width)),
|
|
907
910
|
v: 1 - Math.min(1, Math.max(0, (N.clientY - x.top) / x.height))
|
|
908
911
|
});
|
|
909
|
-
},
|
|
912
|
+
}, k = (N) => {
|
|
910
913
|
var A;
|
|
911
914
|
const x = (A = T.current) == null ? void 0 : A.getBoundingClientRect();
|
|
912
|
-
x &&
|
|
915
|
+
x && v({ h: Math.min(1, Math.max(0, (N.clientX - x.left) / x.width)) * 360 });
|
|
913
916
|
};
|
|
914
917
|
H(() => {
|
|
915
918
|
const N = (A) => {
|
|
916
|
-
R.current === "sv" ? m(A) : R.current === "hue" &&
|
|
919
|
+
R.current === "sv" ? m(A) : R.current === "hue" && k(A);
|
|
917
920
|
}, x = () => {
|
|
918
921
|
R.current = null;
|
|
919
922
|
};
|
|
920
923
|
return window.addEventListener("pointermove", N), window.addEventListener("pointerup", x), () => {
|
|
921
924
|
window.removeEventListener("pointermove", N), window.removeEventListener("pointerup", x);
|
|
922
925
|
};
|
|
923
|
-
}, [
|
|
924
|
-
const [
|
|
925
|
-
|
|
926
|
+
}, [p]);
|
|
927
|
+
const [d, b, C] = oe(p.h, p.s, p.v), D = ne(d, b, C), Y = `hsl(${p.h},100%,50%)`, O = n.some((N) => N.toLowerCase() === D.toLowerCase()), X = (N) => {
|
|
928
|
+
y(le(...re(N))), a(N);
|
|
926
929
|
}, G = (N) => {
|
|
927
930
|
const x = N.replace("#", "");
|
|
928
|
-
|
|
931
|
+
$(x), /^[0-9a-fA-F]{6}$/.test(x) && X("#" + x.toLowerCase());
|
|
929
932
|
}, J = (N, x) => {
|
|
930
|
-
const A = Math.max(0, Math.min(255, parseInt(x, 10) || 0)), V = [
|
|
933
|
+
const A = Math.max(0, Math.min(255, parseInt(x, 10) || 0)), V = [d, b, C];
|
|
931
934
|
V[N] = A, X(ne(...V));
|
|
932
935
|
};
|
|
933
|
-
return /* @__PURE__ */ h("div", { className: w("sui-colorpicker",
|
|
936
|
+
return /* @__PURE__ */ h("div", { className: w("sui-colorpicker", l), children: [
|
|
934
937
|
/* @__PURE__ */ h("div", { className: "sui-colorpicker__swatches", children: [
|
|
935
938
|
n.map((N) => {
|
|
936
939
|
const x = N.toLowerCase() === D.toLowerCase();
|
|
@@ -957,11 +960,11 @@ function vt({
|
|
|
957
960
|
type: "button",
|
|
958
961
|
title: c,
|
|
959
962
|
"aria-label": c,
|
|
960
|
-
"aria-expanded":
|
|
961
|
-
onClick: () =>
|
|
963
|
+
"aria-expanded": u,
|
|
964
|
+
onClick: () => g(!u),
|
|
962
965
|
className: "sui-colorpicker__wheel",
|
|
963
966
|
style: {
|
|
964
|
-
boxShadow: !O ||
|
|
967
|
+
boxShadow: !O || u ? "0 0 0 2px var(--surface-card), 0 0 0 4px var(--text-secondary)" : "inset 0 0 0 1px rgba(255,255,255,0.10)"
|
|
965
968
|
},
|
|
966
969
|
children: /* @__PURE__ */ e(
|
|
967
970
|
"span",
|
|
@@ -974,11 +977,11 @@ function vt({
|
|
|
974
977
|
}
|
|
975
978
|
)
|
|
976
979
|
] }),
|
|
977
|
-
|
|
980
|
+
u && /* @__PURE__ */ h("div", { className: "sui-colorpicker__panel", children: [
|
|
978
981
|
/* @__PURE__ */ e(
|
|
979
982
|
"div",
|
|
980
983
|
{
|
|
981
|
-
ref:
|
|
984
|
+
ref: M,
|
|
982
985
|
onPointerDown: (N) => {
|
|
983
986
|
R.current = "sv", m(N);
|
|
984
987
|
},
|
|
@@ -988,7 +991,7 @@ function vt({
|
|
|
988
991
|
"div",
|
|
989
992
|
{
|
|
990
993
|
className: "sui-colorpicker__knob",
|
|
991
|
-
style: { left: `${
|
|
994
|
+
style: { left: `${p.s * 100}%`, top: `${(1 - p.v) * 100}%`, background: D }
|
|
992
995
|
}
|
|
993
996
|
)
|
|
994
997
|
}
|
|
@@ -998,19 +1001,19 @@ function vt({
|
|
|
998
1001
|
{
|
|
999
1002
|
ref: T,
|
|
1000
1003
|
onPointerDown: (N) => {
|
|
1001
|
-
R.current = "hue",
|
|
1004
|
+
R.current = "hue", k(N);
|
|
1002
1005
|
},
|
|
1003
1006
|
className: "sui-colorpicker__hue",
|
|
1004
1007
|
children: /* @__PURE__ */ e(
|
|
1005
1008
|
"div",
|
|
1006
1009
|
{
|
|
1007
1010
|
className: "sui-colorpicker__knob",
|
|
1008
|
-
style: { left: `${
|
|
1011
|
+
style: { left: `${p.h / 360 * 100}%`, top: "50%", background: Y }
|
|
1009
1012
|
}
|
|
1010
1013
|
)
|
|
1011
1014
|
}
|
|
1012
1015
|
),
|
|
1013
|
-
|
|
1016
|
+
i && /* @__PURE__ */ h("div", { className: "sui-colorpicker__inputrow", children: [
|
|
1014
1017
|
/* @__PURE__ */ e(
|
|
1015
1018
|
"div",
|
|
1016
1019
|
{
|
|
@@ -1018,12 +1021,12 @@ function vt({
|
|
|
1018
1021
|
style: { background: D, boxShadow: `inset 0 0 0 1px rgba(255,255,255,0.18), 0 4px 16px ${U(D, 0.35)}` }
|
|
1019
1022
|
}
|
|
1020
1023
|
),
|
|
1021
|
-
/* @__PURE__ */ e("div", { className: "sui-colorpicker__field", children:
|
|
1024
|
+
/* @__PURE__ */ e("div", { className: "sui-colorpicker__field", children: z === "hex" ? /* @__PURE__ */ h(ee, { children: [
|
|
1022
1025
|
/* @__PURE__ */ e("span", { className: "sui-colorpicker__prefix", children: "#" }),
|
|
1023
1026
|
/* @__PURE__ */ e(
|
|
1024
1027
|
"input",
|
|
1025
1028
|
{
|
|
1026
|
-
value:
|
|
1029
|
+
value: L,
|
|
1027
1030
|
onChange: (N) => G(N.target.value),
|
|
1028
1031
|
spellCheck: !1,
|
|
1029
1032
|
maxLength: 6,
|
|
@@ -1035,7 +1038,7 @@ function vt({
|
|
|
1035
1038
|
/* @__PURE__ */ e(
|
|
1036
1039
|
"input",
|
|
1037
1040
|
{
|
|
1038
|
-
value: String([
|
|
1041
|
+
value: String([d, b, C][x]),
|
|
1039
1042
|
onChange: (A) => J(x, A.target.value),
|
|
1040
1043
|
spellCheck: !1,
|
|
1041
1044
|
maxLength: 3,
|
|
@@ -1051,10 +1054,10 @@ function vt({
|
|
|
1051
1054
|
"button",
|
|
1052
1055
|
{
|
|
1053
1056
|
type: "button",
|
|
1054
|
-
"aria-pressed":
|
|
1057
|
+
"aria-pressed": z === "hex",
|
|
1055
1058
|
onClick: () => E("hex"),
|
|
1056
1059
|
className: "sui-colorpicker__modetab",
|
|
1057
|
-
"data-active":
|
|
1060
|
+
"data-active": z === "hex" || void 0,
|
|
1058
1061
|
children: "HEX"
|
|
1059
1062
|
}
|
|
1060
1063
|
),
|
|
@@ -1062,10 +1065,10 @@ function vt({
|
|
|
1062
1065
|
"button",
|
|
1063
1066
|
{
|
|
1064
1067
|
type: "button",
|
|
1065
|
-
"aria-pressed":
|
|
1068
|
+
"aria-pressed": z === "rgb",
|
|
1066
1069
|
onClick: () => E("rgb"),
|
|
1067
1070
|
className: "sui-colorpicker__modetab",
|
|
1068
|
-
"data-active":
|
|
1071
|
+
"data-active": z === "rgb" || void 0,
|
|
1069
1072
|
children: "RGB"
|
|
1070
1073
|
}
|
|
1071
1074
|
)
|
|
@@ -1109,53 +1112,53 @@ function bt({
|
|
|
1109
1112
|
onChange: a,
|
|
1110
1113
|
color: n,
|
|
1111
1114
|
icons: s = Ve,
|
|
1112
|
-
searchable:
|
|
1113
|
-
searchPlaceholder:
|
|
1114
|
-
emptyText:
|
|
1115
|
+
searchable: r,
|
|
1116
|
+
searchPlaceholder: o = "Buscar ícone...",
|
|
1117
|
+
emptyText: i = "Nenhum ícone encontrado",
|
|
1115
1118
|
className: c
|
|
1116
1119
|
}) {
|
|
1117
|
-
const [
|
|
1118
|
-
if (!
|
|
1119
|
-
const
|
|
1120
|
-
return s.filter((
|
|
1121
|
-
}, [s,
|
|
1120
|
+
const [l, _] = S(""), u = r ?? s.length > 40, g = se(() => {
|
|
1121
|
+
if (!u || !l.trim()) return s;
|
|
1122
|
+
const p = q(l);
|
|
1123
|
+
return s.filter((y) => q(y).includes(p));
|
|
1124
|
+
}, [s, l, u]);
|
|
1122
1125
|
return /* @__PURE__ */ h("div", { className: w("sui-iconpicker", c), children: [
|
|
1123
|
-
|
|
1126
|
+
u && /* @__PURE__ */ e(
|
|
1124
1127
|
"input",
|
|
1125
1128
|
{
|
|
1126
1129
|
className: "sui-iconpicker__search",
|
|
1127
|
-
value:
|
|
1128
|
-
onChange: (
|
|
1129
|
-
placeholder:
|
|
1130
|
-
"aria-label":
|
|
1130
|
+
value: l,
|
|
1131
|
+
onChange: (p) => _(p.target.value),
|
|
1132
|
+
placeholder: o,
|
|
1133
|
+
"aria-label": o
|
|
1131
1134
|
}
|
|
1132
1135
|
),
|
|
1133
|
-
/* @__PURE__ */ h("div", { className: "sui-iconpicker__grid", "data-scroll":
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
const
|
|
1136
|
+
/* @__PURE__ */ h("div", { className: "sui-iconpicker__grid", "data-scroll": u || void 0, children: [
|
|
1137
|
+
g.length === 0 && /* @__PURE__ */ e("div", { className: "sui-iconpicker__empty", children: i }),
|
|
1138
|
+
g.map((p) => {
|
|
1139
|
+
const y = t === p;
|
|
1137
1140
|
return /* @__PURE__ */ e(
|
|
1138
1141
|
"button",
|
|
1139
1142
|
{
|
|
1140
1143
|
type: "button",
|
|
1141
|
-
title:
|
|
1142
|
-
"aria-label":
|
|
1143
|
-
"aria-pressed":
|
|
1144
|
-
onClick: () => a(
|
|
1144
|
+
title: p,
|
|
1145
|
+
"aria-label": p,
|
|
1146
|
+
"aria-pressed": y,
|
|
1147
|
+
onClick: () => a(p),
|
|
1145
1148
|
className: "sui-iconpicker__cell",
|
|
1146
|
-
"data-on":
|
|
1147
|
-
style:
|
|
1149
|
+
"data-on": y || void 0,
|
|
1150
|
+
style: y ? { background: n, borderColor: "transparent" } : void 0,
|
|
1148
1151
|
children: /* @__PURE__ */ e(
|
|
1149
1152
|
P,
|
|
1150
1153
|
{
|
|
1151
|
-
name:
|
|
1154
|
+
name: p,
|
|
1152
1155
|
size: 17,
|
|
1153
|
-
color:
|
|
1156
|
+
color: y ? "#fff" : "var(--text-secondary)",
|
|
1154
1157
|
strokeWidth: 1.9
|
|
1155
1158
|
}
|
|
1156
1159
|
)
|
|
1157
1160
|
},
|
|
1158
|
-
|
|
1161
|
+
p
|
|
1159
1162
|
);
|
|
1160
1163
|
})
|
|
1161
1164
|
] })
|
|
@@ -1166,23 +1169,23 @@ function gt({
|
|
|
1166
1169
|
value: a,
|
|
1167
1170
|
sublabel: n,
|
|
1168
1171
|
icon: s,
|
|
1169
|
-
accent:
|
|
1170
|
-
interactive:
|
|
1171
|
-
onClick:
|
|
1172
|
+
accent: r,
|
|
1173
|
+
interactive: o,
|
|
1174
|
+
onClick: i,
|
|
1172
1175
|
className: c
|
|
1173
1176
|
}) {
|
|
1174
|
-
const
|
|
1177
|
+
const l = r ? { "--sui-stat-accent": r } : void 0;
|
|
1175
1178
|
return /* @__PURE__ */ h(
|
|
1176
1179
|
"div",
|
|
1177
1180
|
{
|
|
1178
|
-
className: w("sui-statcard", (
|
|
1179
|
-
style:
|
|
1180
|
-
"data-accent":
|
|
1181
|
-
onClick:
|
|
1182
|
-
role:
|
|
1183
|
-
tabIndex:
|
|
1184
|
-
onKeyDown:
|
|
1185
|
-
(
|
|
1181
|
+
className: w("sui-statcard", (o || i) && "sui-statcard--interactive", c),
|
|
1182
|
+
style: l,
|
|
1183
|
+
"data-accent": r ? "" : void 0,
|
|
1184
|
+
onClick: i,
|
|
1185
|
+
role: i ? "button" : void 0,
|
|
1186
|
+
tabIndex: i ? 0 : void 0,
|
|
1187
|
+
onKeyDown: i ? (_) => {
|
|
1188
|
+
(_.key === "Enter" || _.key === " ") && (_.preventDefault(), i());
|
|
1186
1189
|
} : void 0,
|
|
1187
1190
|
children: [
|
|
1188
1191
|
/* @__PURE__ */ h("div", { className: "sui-statcard__head", children: [
|
|
@@ -1195,8 +1198,8 @@ function gt({
|
|
|
1195
1198
|
}
|
|
1196
1199
|
);
|
|
1197
1200
|
}
|
|
1198
|
-
function Nt({ icon: t, title: a, description: n, actions: s, dashed:
|
|
1199
|
-
return /* @__PURE__ */ h("div", { className: w("sui-emptystate",
|
|
1201
|
+
function Nt({ icon: t, title: a, description: n, actions: s, dashed: r, className: o }) {
|
|
1202
|
+
return /* @__PURE__ */ h("div", { className: w("sui-emptystate", r && "sui-emptystate--dashed", o), children: [
|
|
1200
1203
|
t && /* @__PURE__ */ e("div", { className: "sui-emptystate__icon", children: t }),
|
|
1201
1204
|
/* @__PURE__ */ e("div", { className: "sui-emptystate__title", children: a }),
|
|
1202
1205
|
n && /* @__PURE__ */ e("div", { className: "sui-emptystate__desc", children: n }),
|
|
@@ -1208,18 +1211,18 @@ function yt({
|
|
|
1208
1211
|
children: a,
|
|
1209
1212
|
side: n = "top",
|
|
1210
1213
|
align: s = "center",
|
|
1211
|
-
delayDuration:
|
|
1212
|
-
className:
|
|
1214
|
+
delayDuration: r = 200,
|
|
1215
|
+
className: o
|
|
1213
1216
|
}) {
|
|
1214
1217
|
return (
|
|
1215
1218
|
// Provider embutido para uso avulso; envolver a app com <TooltipProvider>
|
|
1216
1219
|
// é opcional (compartilha o timing entre tooltips). Providers aninhados são ok.
|
|
1217
|
-
/* @__PURE__ */ e(W.Provider, { delayDuration:
|
|
1220
|
+
/* @__PURE__ */ e(W.Provider, { delayDuration: r, children: /* @__PURE__ */ h(W.Root, { children: [
|
|
1218
1221
|
/* @__PURE__ */ e(W.Trigger, { asChild: !0, children: a }),
|
|
1219
1222
|
/* @__PURE__ */ e(W.Portal, { children: /* @__PURE__ */ h(
|
|
1220
1223
|
W.Content,
|
|
1221
1224
|
{
|
|
1222
|
-
className: w("sui-tooltip",
|
|
1225
|
+
className: w("sui-tooltip", o),
|
|
1223
1226
|
side: n,
|
|
1224
1227
|
align: s,
|
|
1225
1228
|
sideOffset: 6,
|
|
@@ -1266,9 +1269,10 @@ function je({ open: t, defaultOpen: a, onOpenChange: n, children: s }) {
|
|
|
1266
1269
|
function Qe({
|
|
1267
1270
|
title: t,
|
|
1268
1271
|
description: a,
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
+
icon: n,
|
|
1273
|
+
maxWidth: s = 480,
|
|
1274
|
+
hideClose: r,
|
|
1275
|
+
className: o,
|
|
1272
1276
|
children: i
|
|
1273
1277
|
}) {
|
|
1274
1278
|
return /* @__PURE__ */ h(F.Portal, { children: [
|
|
@@ -1276,15 +1280,18 @@ function Qe({
|
|
|
1276
1280
|
/* @__PURE__ */ h(
|
|
1277
1281
|
F.Content,
|
|
1278
1282
|
{
|
|
1279
|
-
className: w("sui-modal__content",
|
|
1280
|
-
style: { maxWidth:
|
|
1283
|
+
className: w("sui-modal__content", o),
|
|
1284
|
+
style: { maxWidth: s },
|
|
1281
1285
|
children: [
|
|
1282
1286
|
/* @__PURE__ */ h("div", { className: "sui-modal__header", children: [
|
|
1283
|
-
/* @__PURE__ */ h("div", { className: "sui-
|
|
1284
|
-
/* @__PURE__ */ e(
|
|
1285
|
-
|
|
1287
|
+
/* @__PURE__ */ h("div", { className: "sui-modal__headlead", children: [
|
|
1288
|
+
n != null && /* @__PURE__ */ e("div", { className: "sui-modal__icon", children: n }),
|
|
1289
|
+
/* @__PURE__ */ h("div", { className: "sui-modal__heading", children: [
|
|
1290
|
+
/* @__PURE__ */ e(F.Title, { className: "sui-modal__title", children: t }),
|
|
1291
|
+
a && /* @__PURE__ */ e(F.Description, { className: "sui-modal__desc", children: a })
|
|
1292
|
+
] })
|
|
1286
1293
|
] }),
|
|
1287
|
-
!
|
|
1294
|
+
!r && /* @__PURE__ */ e(F.Close, { className: "sui-modal__close", "aria-label": "Fechar", children: /* @__PURE__ */ e("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: /* @__PURE__ */ e(
|
|
1288
1295
|
"path",
|
|
1289
1296
|
{
|
|
1290
1297
|
d: "M6 6l12 12M18 6L6 18",
|
|
@@ -1317,107 +1324,108 @@ function Ct({
|
|
|
1317
1324
|
onOpenChange: a,
|
|
1318
1325
|
title: n,
|
|
1319
1326
|
message: s,
|
|
1320
|
-
confirmLabel:
|
|
1321
|
-
cancelLabel:
|
|
1322
|
-
busyLabel:
|
|
1327
|
+
confirmLabel: r = "Confirmar",
|
|
1328
|
+
cancelLabel: o = "Cancelar",
|
|
1329
|
+
busyLabel: i = "Aguarde...",
|
|
1323
1330
|
confirmVariant: c = "danger",
|
|
1324
|
-
icon:
|
|
1325
|
-
|
|
1326
|
-
|
|
1331
|
+
icon: l,
|
|
1332
|
+
hideCancel: _ = !1,
|
|
1333
|
+
onConfirm: u,
|
|
1334
|
+
formatError: g = Je
|
|
1327
1335
|
}) {
|
|
1328
|
-
const [
|
|
1329
|
-
if (!
|
|
1330
|
-
|
|
1336
|
+
const [p, y] = S(!1), [z, E] = S(null), L = async () => {
|
|
1337
|
+
if (!p) {
|
|
1338
|
+
y(!0), E(null);
|
|
1331
1339
|
try {
|
|
1332
|
-
await
|
|
1333
|
-
} catch (
|
|
1334
|
-
|
|
1340
|
+
await u(), a(!1);
|
|
1341
|
+
} catch (M) {
|
|
1342
|
+
E(g(M));
|
|
1335
1343
|
} finally {
|
|
1336
|
-
|
|
1344
|
+
y(!1);
|
|
1337
1345
|
}
|
|
1338
1346
|
}
|
|
1339
|
-
}, $ = (
|
|
1340
|
-
|
|
1347
|
+
}, $ = (M) => {
|
|
1348
|
+
p || (M || E(null), a(M));
|
|
1341
1349
|
};
|
|
1342
1350
|
return /* @__PURE__ */ e(F.Root, { open: t, onOpenChange: $, children: /* @__PURE__ */ h(F.Portal, { children: [
|
|
1343
1351
|
/* @__PURE__ */ e(F.Overlay, { className: "sui-confirm__overlay" }),
|
|
1344
1352
|
/* @__PURE__ */ h(F.Content, { className: "sui-confirm", children: [
|
|
1345
1353
|
/* @__PURE__ */ h("div", { className: "sui-confirm__head", children: [
|
|
1346
|
-
|
|
1354
|
+
l ?? /* @__PURE__ */ e(Se, { size: 44, radius: 12, bg: U(Ge, 0.15), children: /* @__PURE__ */ e(P, { name: "alert", size: 20, color: "var(--status-error-fg)" }) }),
|
|
1347
1355
|
/* @__PURE__ */ h("div", { children: [
|
|
1348
1356
|
/* @__PURE__ */ e(F.Title, { className: "sui-confirm__title", children: n }),
|
|
1349
1357
|
/* @__PURE__ */ e(F.Description, { className: "sui-confirm__message", children: s })
|
|
1350
1358
|
] })
|
|
1351
1359
|
] }),
|
|
1352
|
-
|
|
1360
|
+
z != null && /* @__PURE__ */ e("div", { className: "sui-confirm__error", role: "alert", children: z }),
|
|
1353
1361
|
/* @__PURE__ */ h("div", { className: "sui-confirm__actions", children: [
|
|
1354
|
-
/* @__PURE__ */ e(me, { variant: "secondary", fullWidth: !0, disabled:
|
|
1362
|
+
!_ && /* @__PURE__ */ e(me, { variant: "secondary", fullWidth: !0, disabled: p, onClick: () => $(!1), children: o }),
|
|
1355
1363
|
/* @__PURE__ */ e(
|
|
1356
1364
|
me,
|
|
1357
1365
|
{
|
|
1358
1366
|
variant: c,
|
|
1359
1367
|
fullWidth: !0,
|
|
1360
|
-
loading:
|
|
1361
|
-
onClick: () => void
|
|
1362
|
-
children:
|
|
1368
|
+
loading: p,
|
|
1369
|
+
onClick: () => void L(),
|
|
1370
|
+
children: p ? i : r
|
|
1363
1371
|
}
|
|
1364
1372
|
)
|
|
1365
1373
|
] })
|
|
1366
1374
|
] })
|
|
1367
1375
|
] }) });
|
|
1368
1376
|
}
|
|
1369
|
-
function Ze({ x: t, y: a, items: n, onClose: s, align:
|
|
1370
|
-
const
|
|
1377
|
+
function Ze({ x: t, y: a, items: n, onClose: s, align: r = "end", className: o }) {
|
|
1378
|
+
const i = K(null), [c, l] = S({ top: 0, left: 0 });
|
|
1371
1379
|
Ce(() => {
|
|
1372
|
-
|
|
1380
|
+
l(ve(i.current));
|
|
1373
1381
|
}, []), H(() => {
|
|
1374
|
-
var
|
|
1375
|
-
(
|
|
1382
|
+
var u, g;
|
|
1383
|
+
(g = (u = i.current) == null ? void 0 : u.querySelector(".sui-menu__item")) == null || g.focus({ preventScroll: !0 });
|
|
1376
1384
|
}, []), H(() => {
|
|
1377
|
-
const
|
|
1378
|
-
|
|
1385
|
+
const u = (g) => {
|
|
1386
|
+
g.key === "Escape" && s();
|
|
1379
1387
|
};
|
|
1380
|
-
return document.addEventListener("keydown",
|
|
1388
|
+
return document.addEventListener("keydown", u), () => document.removeEventListener("keydown", u);
|
|
1381
1389
|
}, [s]);
|
|
1382
|
-
const
|
|
1383
|
-
var
|
|
1384
|
-
if (
|
|
1385
|
-
|
|
1386
|
-
const
|
|
1387
|
-
(E =
|
|
1390
|
+
const _ = (u) => {
|
|
1391
|
+
var z, E;
|
|
1392
|
+
if (u.key !== "ArrowDown" && u.key !== "ArrowUp") return;
|
|
1393
|
+
u.preventDefault();
|
|
1394
|
+
const g = Array.from(((z = i.current) == null ? void 0 : z.querySelectorAll(".sui-menu__item")) ?? []), p = g.indexOf(document.activeElement), y = u.key === "ArrowDown" ? Math.min(p + 1, g.length - 1) : Math.max(p - 1, 0);
|
|
1395
|
+
(E = g[y]) == null || E.focus();
|
|
1388
1396
|
};
|
|
1389
1397
|
return /* @__PURE__ */ h(ee, { children: [
|
|
1390
1398
|
/* @__PURE__ */ e("div", { className: "sui-menu__backdrop", onClick: s }),
|
|
1391
1399
|
/* @__PURE__ */ e(
|
|
1392
1400
|
"div",
|
|
1393
1401
|
{
|
|
1394
|
-
ref:
|
|
1395
|
-
className: w("sui-menu",
|
|
1402
|
+
ref: i,
|
|
1403
|
+
className: w("sui-menu", o),
|
|
1396
1404
|
role: "menu",
|
|
1397
|
-
onKeyDown:
|
|
1405
|
+
onKeyDown: _,
|
|
1398
1406
|
style: {
|
|
1399
1407
|
left: t - c.left,
|
|
1400
1408
|
top: a + 6 - c.top,
|
|
1401
|
-
transform:
|
|
1409
|
+
transform: r === "end" ? "translateX(-100%)" : void 0
|
|
1402
1410
|
},
|
|
1403
1411
|
children: n.map(
|
|
1404
|
-
(
|
|
1412
|
+
(u, g) => u.sep ? /* @__PURE__ */ e("div", { className: "sui-menu__sep", role: "separator" }, g) : /* @__PURE__ */ h(
|
|
1405
1413
|
"button",
|
|
1406
1414
|
{
|
|
1407
1415
|
type: "button",
|
|
1408
1416
|
role: "menuitem",
|
|
1409
1417
|
onClick: () => {
|
|
1410
|
-
var
|
|
1411
|
-
(
|
|
1418
|
+
var p;
|
|
1419
|
+
(p = u.onClick) == null || p.call(u), s();
|
|
1412
1420
|
},
|
|
1413
1421
|
className: "sui-menu__item",
|
|
1414
|
-
"data-danger":
|
|
1422
|
+
"data-danger": u.danger || void 0,
|
|
1415
1423
|
children: [
|
|
1416
|
-
typeof
|
|
1417
|
-
/* @__PURE__ */ e("span", { children:
|
|
1424
|
+
typeof u.icon == "string" ? /* @__PURE__ */ e(P, { name: u.icon, size: 15, color: u.danger ? "var(--status-error-fg)" : "var(--text-secondary)" }) : u.icon,
|
|
1425
|
+
/* @__PURE__ */ e("span", { children: u.label })
|
|
1418
1426
|
]
|
|
1419
1427
|
},
|
|
1420
|
-
|
|
1428
|
+
g
|
|
1421
1429
|
)
|
|
1422
1430
|
)
|
|
1423
1431
|
}
|
|
@@ -1436,63 +1444,63 @@ function St({
|
|
|
1436
1444
|
data: a,
|
|
1437
1445
|
keyField: n = "id",
|
|
1438
1446
|
searchable: s = !0,
|
|
1439
|
-
searchPlaceholder:
|
|
1440
|
-
selectable:
|
|
1441
|
-
initialSelectedIds:
|
|
1447
|
+
searchPlaceholder: r = "Buscar...",
|
|
1448
|
+
selectable: o = !1,
|
|
1449
|
+
initialSelectedIds: i,
|
|
1442
1450
|
pageSize: c = 10,
|
|
1443
|
-
pageSizeOptions:
|
|
1444
|
-
onRowClick:
|
|
1445
|
-
toolbarTitle:
|
|
1446
|
-
toolbarActions:
|
|
1447
|
-
bulkActions:
|
|
1448
|
-
emptyMessage:
|
|
1449
|
-
loadingMessage:
|
|
1451
|
+
pageSizeOptions: l = null,
|
|
1452
|
+
onRowClick: _,
|
|
1453
|
+
toolbarTitle: u,
|
|
1454
|
+
toolbarActions: g,
|
|
1455
|
+
bulkActions: p,
|
|
1456
|
+
emptyMessage: y = "Nenhum registro encontrado.",
|
|
1457
|
+
loadingMessage: z = "Carregando...",
|
|
1450
1458
|
loading: E = !1,
|
|
1451
|
-
labels:
|
|
1452
|
-
className:
|
|
1459
|
+
labels: L,
|
|
1460
|
+
className: $
|
|
1453
1461
|
}) {
|
|
1454
|
-
const
|
|
1455
|
-
() => new Set(
|
|
1462
|
+
const M = { ...et, ...L }, [T, R] = S(""), [v, m] = S(null), [k, d] = S("asc"), [b, C] = S(
|
|
1463
|
+
() => new Set(i ?? [])
|
|
1456
1464
|
), [D, Y] = S(0), [O, X] = S(c), [G, J] = S(null), N = se(() => {
|
|
1457
1465
|
if (!T.trim()) return a;
|
|
1458
|
-
const
|
|
1466
|
+
const f = T.toLowerCase();
|
|
1459
1467
|
return a.filter(
|
|
1460
1468
|
(I) => t.some((B) => {
|
|
1461
1469
|
const Z = B.searchValue ? B.searchValue(I) : I[B.key];
|
|
1462
|
-
return Z != null && String(Z).toLowerCase().includes(
|
|
1470
|
+
return Z != null && String(Z).toLowerCase().includes(f);
|
|
1463
1471
|
})
|
|
1464
1472
|
);
|
|
1465
1473
|
}, [a, T, t]), x = se(() => {
|
|
1466
|
-
if (!
|
|
1467
|
-
const
|
|
1474
|
+
if (!v) return N;
|
|
1475
|
+
const f = t.find((B) => B.key === v), I = [...N];
|
|
1468
1476
|
return I.sort((B, Z) => {
|
|
1469
|
-
const te =
|
|
1477
|
+
const te = f != null && f.sortValue ? f.sortValue(B) : B[v], ae = f != null && f.sortValue ? f.sortValue(Z) : Z[v];
|
|
1470
1478
|
return te == null ? 1 : ae == null ? -1 : typeof te == "number" && typeof ae == "number" ? te - ae : String(te).localeCompare(String(ae));
|
|
1471
|
-
}),
|
|
1472
|
-
}, [N,
|
|
1479
|
+
}), k === "desc" && I.reverse(), I;
|
|
1480
|
+
}, [N, v, k, t]), A = Math.max(1, Math.ceil(x.length / O)), V = Math.min(D, A - 1), j = x.slice(V * O, V * O + O);
|
|
1473
1481
|
H(() => {
|
|
1474
1482
|
Y(0);
|
|
1475
|
-
}, [T,
|
|
1476
|
-
const be = (
|
|
1477
|
-
|
|
1478
|
-
}, he = j.length > 0 && j.every((
|
|
1479
|
-
const
|
|
1480
|
-
he ? j.forEach((I) =>
|
|
1481
|
-
}, Ne = (
|
|
1482
|
-
const I = new Set(
|
|
1483
|
-
I.has(
|
|
1483
|
+
}, [T, v, k, O]);
|
|
1484
|
+
const be = (f) => {
|
|
1485
|
+
f.sortable && (v !== f.key ? (m(f.key), d("asc")) : k === "asc" ? d("desc") : (m(null), d("asc")));
|
|
1486
|
+
}, he = j.length > 0 && j.every((f) => b.has(f[n])), ge = () => {
|
|
1487
|
+
const f = new Set(b);
|
|
1488
|
+
he ? j.forEach((I) => f.delete(I[n])) : j.forEach((I) => f.add(I[n])), C(f);
|
|
1489
|
+
}, Ne = (f) => {
|
|
1490
|
+
const I = new Set(b);
|
|
1491
|
+
I.has(f) ? I.delete(f) : I.add(f), C(I);
|
|
1484
1492
|
};
|
|
1485
|
-
return /* @__PURE__ */ h("div", { className: w("sui-datatable",
|
|
1486
|
-
(
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
/* @__PURE__ */ e("span", { children:
|
|
1493
|
+
return /* @__PURE__ */ h("div", { className: w("sui-datatable", $), children: [
|
|
1494
|
+
(u || s || g) && /* @__PURE__ */ h("div", { className: "sui-datatable__toolbar", children: [
|
|
1495
|
+
u && /* @__PURE__ */ e("h3", { className: "sui-datatable__title", children: u }),
|
|
1496
|
+
l && /* @__PURE__ */ h("div", { className: "sui-datatable__pagesize", children: [
|
|
1497
|
+
/* @__PURE__ */ e("span", { children: M.pageSizePrefix }),
|
|
1490
1498
|
/* @__PURE__ */ h(
|
|
1491
1499
|
"button",
|
|
1492
1500
|
{
|
|
1493
1501
|
type: "button",
|
|
1494
|
-
onClick: (
|
|
1495
|
-
const I =
|
|
1502
|
+
onClick: (f) => {
|
|
1503
|
+
const I = f.currentTarget.getBoundingClientRect();
|
|
1496
1504
|
J({ x: I.right, y: I.bottom });
|
|
1497
1505
|
},
|
|
1498
1506
|
className: "sui-datatable__pagesize-btn",
|
|
@@ -1508,16 +1516,16 @@ function St({
|
|
|
1508
1516
|
x: G.x,
|
|
1509
1517
|
y: G.y,
|
|
1510
1518
|
onClose: () => J(null),
|
|
1511
|
-
items:
|
|
1512
|
-
label:
|
|
1513
|
-
icon:
|
|
1519
|
+
items: l.map((f) => ({
|
|
1520
|
+
label: M.pageSizeItem(f),
|
|
1521
|
+
icon: f === O ? "check" : void 0,
|
|
1514
1522
|
onClick: () => {
|
|
1515
|
-
X(
|
|
1523
|
+
X(f), J(null);
|
|
1516
1524
|
}
|
|
1517
1525
|
}))
|
|
1518
1526
|
}
|
|
1519
1527
|
),
|
|
1520
|
-
/* @__PURE__ */ e("span", { children:
|
|
1528
|
+
/* @__PURE__ */ e("span", { children: M.pageSizeSuffix })
|
|
1521
1529
|
] }),
|
|
1522
1530
|
s && /* @__PURE__ */ h("div", { className: "sui-datatable__search", children: [
|
|
1523
1531
|
/* @__PURE__ */ e(P, { name: "search", size: 14, color: "var(--text-muted)" }),
|
|
@@ -1525,21 +1533,21 @@ function St({
|
|
|
1525
1533
|
"input",
|
|
1526
1534
|
{
|
|
1527
1535
|
value: T,
|
|
1528
|
-
onChange: (
|
|
1529
|
-
placeholder:
|
|
1530
|
-
"aria-label":
|
|
1536
|
+
onChange: (f) => R(f.target.value),
|
|
1537
|
+
placeholder: r,
|
|
1538
|
+
"aria-label": r
|
|
1531
1539
|
}
|
|
1532
1540
|
)
|
|
1533
1541
|
] }),
|
|
1534
|
-
/* @__PURE__ */ e("div", { className: "sui-datatable__actions", children:
|
|
1542
|
+
/* @__PURE__ */ e("div", { className: "sui-datatable__actions", children: g })
|
|
1535
1543
|
] }),
|
|
1536
|
-
|
|
1537
|
-
/* @__PURE__ */ e("span", { className: "sui-datatable__bulkcount", children:
|
|
1538
|
-
/* @__PURE__ */ e("div", { className: "sui-datatable__bulkactions", children:
|
|
1544
|
+
o && b.size > 0 && /* @__PURE__ */ h("div", { className: "sui-datatable__bulkbar", children: [
|
|
1545
|
+
/* @__PURE__ */ e("span", { className: "sui-datatable__bulkcount", children: M.selected(b.size) }),
|
|
1546
|
+
/* @__PURE__ */ e("div", { className: "sui-datatable__bulkactions", children: p == null ? void 0 : p(b, () => C(/* @__PURE__ */ new Set())) })
|
|
1539
1547
|
] }),
|
|
1540
1548
|
/* @__PURE__ */ e("div", { className: "sui-datatable__scroll", children: /* @__PURE__ */ h("table", { children: [
|
|
1541
1549
|
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
1542
|
-
|
|
1550
|
+
o && /* @__PURE__ */ e("th", { className: "sui-datatable__th sui-datatable__th--check", children: /* @__PURE__ */ e(
|
|
1543
1551
|
"input",
|
|
1544
1552
|
{
|
|
1545
1553
|
type: "checkbox",
|
|
@@ -1548,75 +1556,75 @@ function St({
|
|
|
1548
1556
|
"aria-label": "Selecionar página"
|
|
1549
1557
|
}
|
|
1550
1558
|
) }),
|
|
1551
|
-
t.map((
|
|
1559
|
+
t.map((f) => /* @__PURE__ */ e(
|
|
1552
1560
|
"th",
|
|
1553
1561
|
{
|
|
1554
1562
|
className: "sui-datatable__th",
|
|
1555
|
-
"data-align":
|
|
1556
|
-
"data-sortable":
|
|
1557
|
-
style: { width:
|
|
1558
|
-
onClick: () => be(
|
|
1559
|
-
"aria-sort":
|
|
1563
|
+
"data-align": f.align ?? "left",
|
|
1564
|
+
"data-sortable": f.sortable || void 0,
|
|
1565
|
+
style: { width: f.width },
|
|
1566
|
+
onClick: () => be(f),
|
|
1567
|
+
"aria-sort": v === f.key ? k === "asc" ? "ascending" : "descending" : void 0,
|
|
1560
1568
|
children: /* @__PURE__ */ h("span", { className: "sui-datatable__th-inner", children: [
|
|
1561
|
-
|
|
1562
|
-
|
|
1569
|
+
f.header,
|
|
1570
|
+
f.sortable && /* @__PURE__ */ e(
|
|
1563
1571
|
"span",
|
|
1564
1572
|
{
|
|
1565
1573
|
className: "sui-datatable__sort",
|
|
1566
|
-
"data-active":
|
|
1567
|
-
children:
|
|
1574
|
+
"data-active": v === f.key || void 0,
|
|
1575
|
+
children: v === f.key ? k === "asc" ? "▲" : "▼" : "▾"
|
|
1568
1576
|
}
|
|
1569
1577
|
)
|
|
1570
1578
|
] })
|
|
1571
1579
|
},
|
|
1572
|
-
|
|
1580
|
+
f.key
|
|
1573
1581
|
))
|
|
1574
1582
|
] }) }),
|
|
1575
1583
|
/* @__PURE__ */ h("tbody", { children: [
|
|
1576
1584
|
j.length === 0 && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
|
|
1577
1585
|
"td",
|
|
1578
1586
|
{
|
|
1579
|
-
colSpan: t.length + (
|
|
1587
|
+
colSpan: t.length + (o ? 1 : 0),
|
|
1580
1588
|
className: "sui-datatable__empty",
|
|
1581
|
-
children: E ?
|
|
1589
|
+
children: E ? z : y
|
|
1582
1590
|
}
|
|
1583
1591
|
) }),
|
|
1584
|
-
j.map((
|
|
1585
|
-
const I =
|
|
1592
|
+
j.map((f) => {
|
|
1593
|
+
const I = b.has(f[n]);
|
|
1586
1594
|
return /* @__PURE__ */ h(
|
|
1587
1595
|
"tr",
|
|
1588
1596
|
{
|
|
1589
|
-
onClick: () =>
|
|
1597
|
+
onClick: () => _ == null ? void 0 : _(f),
|
|
1590
1598
|
className: "sui-datatable__row",
|
|
1591
1599
|
"data-selected": I || void 0,
|
|
1592
|
-
"data-clickable":
|
|
1600
|
+
"data-clickable": _ ? !0 : void 0,
|
|
1593
1601
|
children: [
|
|
1594
|
-
|
|
1602
|
+
o && /* @__PURE__ */ e("td", { className: "sui-datatable__td", onClick: (B) => B.stopPropagation(), children: /* @__PURE__ */ e(
|
|
1595
1603
|
"input",
|
|
1596
1604
|
{
|
|
1597
1605
|
type: "checkbox",
|
|
1598
1606
|
checked: I,
|
|
1599
|
-
onChange: () => Ne(
|
|
1607
|
+
onChange: () => Ne(f[n]),
|
|
1600
1608
|
"aria-label": "Selecionar linha"
|
|
1601
1609
|
}
|
|
1602
1610
|
) }),
|
|
1603
|
-
t.map((B) => /* @__PURE__ */ e("td", { className: "sui-datatable__td", "data-align": B.align ?? "left", children: B.render ? B.render(
|
|
1611
|
+
t.map((B) => /* @__PURE__ */ e("td", { className: "sui-datatable__td", "data-align": B.align ?? "left", children: B.render ? B.render(f) : String(f[B.key] ?? "") }, B.key))
|
|
1604
1612
|
]
|
|
1605
1613
|
},
|
|
1606
|
-
String(
|
|
1614
|
+
String(f[n])
|
|
1607
1615
|
);
|
|
1608
1616
|
})
|
|
1609
1617
|
] })
|
|
1610
1618
|
] }) }),
|
|
1611
1619
|
x.length > 0 && /* @__PURE__ */ h("div", { className: "sui-datatable__footer", children: [
|
|
1612
|
-
/* @__PURE__ */ e("span", { className: "sui-datatable__range", children:
|
|
1620
|
+
/* @__PURE__ */ e("span", { className: "sui-datatable__range", children: M.range(V * O + 1, Math.min(x.length, (V + 1) * O), x.length) }),
|
|
1613
1621
|
/* @__PURE__ */ h("div", { className: "sui-datatable__pager", children: [
|
|
1614
1622
|
/* @__PURE__ */ e(
|
|
1615
1623
|
"button",
|
|
1616
1624
|
{
|
|
1617
1625
|
type: "button",
|
|
1618
1626
|
disabled: V === 0,
|
|
1619
|
-
onClick: () => Y((
|
|
1627
|
+
onClick: () => Y((f) => Math.max(0, f - 1)),
|
|
1620
1628
|
"aria-label": "Página anterior",
|
|
1621
1629
|
children: "‹"
|
|
1622
1630
|
}
|
|
@@ -1631,7 +1639,7 @@ function St({
|
|
|
1631
1639
|
{
|
|
1632
1640
|
type: "button",
|
|
1633
1641
|
disabled: V >= A - 1,
|
|
1634
|
-
onClick: () => Y((
|
|
1642
|
+
onClick: () => Y((f) => Math.min(A - 1, f + 1)),
|
|
1635
1643
|
"aria-label": "Próxima página",
|
|
1636
1644
|
children: "›"
|
|
1637
1645
|
}
|
|
@@ -1662,48 +1670,48 @@ function Dt({
|
|
|
1662
1670
|
logo: a,
|
|
1663
1671
|
topbarCenter: n,
|
|
1664
1672
|
topbarEnd: s,
|
|
1665
|
-
sidebarFooter:
|
|
1666
|
-
searchable:
|
|
1667
|
-
searchPlaceholder:
|
|
1673
|
+
sidebarFooter: r,
|
|
1674
|
+
searchable: o = !1,
|
|
1675
|
+
searchPlaceholder: i = "Procurar",
|
|
1668
1676
|
collapsed: c,
|
|
1669
|
-
defaultCollapsed:
|
|
1670
|
-
onCollapsedChange:
|
|
1671
|
-
mobileBreakpoint:
|
|
1672
|
-
menuButtonLabel:
|
|
1673
|
-
children:
|
|
1674
|
-
className:
|
|
1677
|
+
defaultCollapsed: l = !1,
|
|
1678
|
+
onCollapsedChange: _,
|
|
1679
|
+
mobileBreakpoint: u = 860,
|
|
1680
|
+
menuButtonLabel: g = "Menu",
|
|
1681
|
+
children: p,
|
|
1682
|
+
className: y
|
|
1675
1683
|
}) {
|
|
1676
|
-
const [
|
|
1684
|
+
const [z, E] = ue({
|
|
1677
1685
|
value: c,
|
|
1678
|
-
defaultValue:
|
|
1679
|
-
onChange:
|
|
1680
|
-
}), [
|
|
1681
|
-
const
|
|
1682
|
-
return
|
|
1686
|
+
defaultValue: l,
|
|
1687
|
+
onChange: _
|
|
1688
|
+
}), [L, $] = S(!1), [M, T] = S(""), v = tt() < u, m = v ? !0 : !z, k = se(() => {
|
|
1689
|
+
const b = q(M.trim());
|
|
1690
|
+
return b ? t.map((C) => ({
|
|
1683
1691
|
...C,
|
|
1684
1692
|
items: C.items.filter(
|
|
1685
|
-
(D) => typeof D.label == "string" ? q(D.label).includes(
|
|
1693
|
+
(D) => typeof D.label == "string" ? q(D.label).includes(b) : !0
|
|
1686
1694
|
)
|
|
1687
1695
|
})).filter((C) => C.items.length > 0) : t;
|
|
1688
|
-
}, [t,
|
|
1696
|
+
}, [t, M]), d = (b) => {
|
|
1689
1697
|
var C;
|
|
1690
|
-
(C =
|
|
1698
|
+
(C = b.onSelect) == null || C.call(b), $(!1);
|
|
1691
1699
|
};
|
|
1692
1700
|
return /* @__PURE__ */ h(
|
|
1693
1701
|
"div",
|
|
1694
1702
|
{
|
|
1695
|
-
className: w("sui-appshell",
|
|
1696
|
-
"data-mobile":
|
|
1697
|
-
"data-collapsed": !
|
|
1703
|
+
className: w("sui-appshell", y),
|
|
1704
|
+
"data-mobile": v || void 0,
|
|
1705
|
+
"data-collapsed": !v && z || void 0,
|
|
1698
1706
|
children: [
|
|
1699
1707
|
/* @__PURE__ */ h("header", { className: "sui-appshell__topbar", children: [
|
|
1700
1708
|
/* @__PURE__ */ h("div", { className: "sui-appshell__topbar-start", children: [
|
|
1701
1709
|
/* @__PURE__ */ e(
|
|
1702
1710
|
De,
|
|
1703
1711
|
{
|
|
1704
|
-
"aria-label":
|
|
1712
|
+
"aria-label": g,
|
|
1705
1713
|
variant: "ghost",
|
|
1706
|
-
onClick: () =>
|
|
1714
|
+
onClick: () => v ? $(!L) : E(!z),
|
|
1707
1715
|
children: /* @__PURE__ */ e(P, { name: "menu", size: 20 })
|
|
1708
1716
|
}
|
|
1709
1717
|
),
|
|
@@ -1712,27 +1720,27 @@ function Dt({
|
|
|
1712
1720
|
n && /* @__PURE__ */ e("div", { className: "sui-appshell__topbar-center", children: n }),
|
|
1713
1721
|
/* @__PURE__ */ e("div", { className: "sui-appshell__topbar-end", children: s })
|
|
1714
1722
|
] }),
|
|
1715
|
-
/* @__PURE__ */ h("aside", { className: "sui-appshell__sidebar", "data-open":
|
|
1716
|
-
|
|
1723
|
+
/* @__PURE__ */ h("aside", { className: "sui-appshell__sidebar", "data-open": v && L || void 0, children: [
|
|
1724
|
+
o && m && /* @__PURE__ */ h("div", { className: "sui-appshell__search", children: [
|
|
1717
1725
|
/* @__PURE__ */ e(P, { name: "search", size: 15, color: "var(--text-muted)" }),
|
|
1718
1726
|
/* @__PURE__ */ e(
|
|
1719
1727
|
"input",
|
|
1720
1728
|
{
|
|
1721
|
-
value:
|
|
1722
|
-
onChange: (
|
|
1723
|
-
placeholder:
|
|
1724
|
-
"aria-label":
|
|
1729
|
+
value: M,
|
|
1730
|
+
onChange: (b) => T(b.target.value),
|
|
1731
|
+
placeholder: i,
|
|
1732
|
+
"aria-label": i
|
|
1725
1733
|
}
|
|
1726
1734
|
)
|
|
1727
1735
|
] }),
|
|
1728
|
-
/* @__PURE__ */ e("div", { className: "sui-appshell__nav", children:
|
|
1729
|
-
m &&
|
|
1730
|
-
|
|
1736
|
+
/* @__PURE__ */ e("div", { className: "sui-appshell__nav", children: k.map((b, C) => /* @__PURE__ */ h("div", { className: "sui-appshell__navgroup", children: [
|
|
1737
|
+
m && b.label && /* @__PURE__ */ e("h4", { className: "sui-appshell__navlabel", children: b.label }),
|
|
1738
|
+
b.items.map((D) => /* @__PURE__ */ h(
|
|
1731
1739
|
"button",
|
|
1732
1740
|
{
|
|
1733
1741
|
type: "button",
|
|
1734
1742
|
title: typeof D.label == "string" ? D.label : void 0,
|
|
1735
|
-
onClick: () =>
|
|
1743
|
+
onClick: () => d(D),
|
|
1736
1744
|
className: "sui-appshell__navitem",
|
|
1737
1745
|
"data-active": D.active || void 0,
|
|
1738
1746
|
"data-icon-only": !m || void 0,
|
|
@@ -1745,16 +1753,16 @@ function Dt({
|
|
|
1745
1753
|
D.key
|
|
1746
1754
|
))
|
|
1747
1755
|
] }, C)) }),
|
|
1748
|
-
|
|
1756
|
+
r && /* @__PURE__ */ e("div", { className: "sui-appshell__sidebar-footer", children: r })
|
|
1749
1757
|
] }),
|
|
1750
|
-
/* @__PURE__ */ e("main", { className: "sui-appshell__content", children:
|
|
1751
|
-
|
|
1758
|
+
/* @__PURE__ */ e("main", { className: "sui-appshell__content", children: p }),
|
|
1759
|
+
v && L && /* @__PURE__ */ e("div", { className: "sui-appshell__scrim", onClick: () => $(!1) })
|
|
1752
1760
|
]
|
|
1753
1761
|
}
|
|
1754
1762
|
);
|
|
1755
1763
|
}
|
|
1756
|
-
function zt({ eyebrow: t, title: a, description: n, actions: s, className:
|
|
1757
|
-
return /* @__PURE__ */ h("div", { className: w("sui-pageheader",
|
|
1764
|
+
function zt({ eyebrow: t, title: a, description: n, actions: s, className: r }) {
|
|
1765
|
+
return /* @__PURE__ */ h("div", { className: w("sui-pageheader", r), children: [
|
|
1758
1766
|
/* @__PURE__ */ h("div", { className: "sui-pageheader__text", children: [
|
|
1759
1767
|
t && /* @__PURE__ */ e("span", { className: "sui-pageheader__eyebrow", children: t }),
|
|
1760
1768
|
/* @__PURE__ */ e("h1", { className: "sui-pageheader__title", children: a }),
|
|
@@ -1770,12 +1778,12 @@ export {
|
|
|
1770
1778
|
me as Button,
|
|
1771
1779
|
xt as Card,
|
|
1772
1780
|
vt as ColorPicker,
|
|
1773
|
-
|
|
1781
|
+
dt as Combobox,
|
|
1774
1782
|
Ct as ConfirmModal,
|
|
1775
1783
|
Ve as DEFAULT_PICKER_ICONS,
|
|
1776
1784
|
He as DEFAULT_SWATCHES,
|
|
1777
1785
|
St as DataTable,
|
|
1778
|
-
|
|
1786
|
+
_t as DateTimeInput,
|
|
1779
1787
|
Nt as EmptyState,
|
|
1780
1788
|
ct as FormField,
|
|
1781
1789
|
ze as Heading,
|
|
@@ -1784,13 +1792,13 @@ export {
|
|
|
1784
1792
|
Se as IconBox,
|
|
1785
1793
|
De as IconButton,
|
|
1786
1794
|
bt as IconPicker,
|
|
1787
|
-
|
|
1795
|
+
fe as Input,
|
|
1788
1796
|
Ee as Label,
|
|
1789
1797
|
Ze as Menu,
|
|
1790
1798
|
wt as Modal,
|
|
1791
1799
|
pt as MoneyInput,
|
|
1792
|
-
|
|
1793
|
-
|
|
1800
|
+
ft as MonthPicker,
|
|
1801
|
+
ut as MultiSelect,
|
|
1794
1802
|
Mt as PageContainer,
|
|
1795
1803
|
zt as PageHeader,
|
|
1796
1804
|
ot as ProgressBar,
|
|
@@ -1810,5 +1818,5 @@ export {
|
|
|
1810
1818
|
q as normalizeSearch,
|
|
1811
1819
|
Rt as registerIconAliases,
|
|
1812
1820
|
At as registerIcons,
|
|
1813
|
-
|
|
1821
|
+
ue as useControllableState
|
|
1814
1822
|
};
|