@tech-diefra/fluig-ui 1.2.20 → 1.2.22
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/Attachment/index.d.ts +4 -9
- package/dist/index.cjs +1 -1
- package/dist/index.js +474 -467
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useFormContext as W, useController as
|
|
1
|
+
import { jsxs as g, jsx as t, Fragment as U } from "react/jsx-runtime";
|
|
2
|
+
import { memo as T, useMemo as j, useCallback as S, useState as _, useRef as B, useEffect as O, forwardRef as K } from "react";
|
|
3
|
+
import { useFormContext as W, useController as I, useFormState as ee } from "react-hook-form";
|
|
4
4
|
import { IMaskInput as te } from "react-imask";
|
|
5
|
-
import { useSection as
|
|
5
|
+
import { useSection as E, useFluigRuntime as D } from "@fluig-kit/ecm";
|
|
6
6
|
import ne, { registerLocale as ae } from "react-datepicker";
|
|
7
7
|
import { parse as re, isValid as se, format as oe } from "date-fns";
|
|
8
8
|
const ie = {
|
|
@@ -15,15 +15,15 @@ function le({
|
|
|
15
15
|
name: e,
|
|
16
16
|
label: r = "",
|
|
17
17
|
placeholder: a = "",
|
|
18
|
-
type:
|
|
19
|
-
mask:
|
|
20
|
-
className:
|
|
21
|
-
forceReadOnly:
|
|
18
|
+
type: l = "text",
|
|
19
|
+
mask: o,
|
|
20
|
+
className: c = "",
|
|
21
|
+
forceReadOnly: s = !1,
|
|
22
22
|
forceHidden: n = !1
|
|
23
23
|
}) {
|
|
24
|
-
const { isReadOnly:
|
|
25
|
-
() =>
|
|
26
|
-
[
|
|
24
|
+
const { isReadOnly: h, isHidden: u } = E(), m = s || !!h(e), w = n || !!u(e), { control: y } = W(), { isView: k } = D(), { field: p } = I({ name: e, control: y }), { errors: b } = ee({ name: e }), f = b == null ? void 0 : b[e], x = j(
|
|
25
|
+
() => o ? ie[o] ?? o : null,
|
|
26
|
+
[o]
|
|
27
27
|
), P = S((i) => {
|
|
28
28
|
if (!i) return "";
|
|
29
29
|
const d = i.replace(/\D/g, "");
|
|
@@ -31,206 +31,206 @@ function le({
|
|
|
31
31
|
style: "currency",
|
|
32
32
|
currency: "BRL"
|
|
33
33
|
});
|
|
34
|
-
}, []),
|
|
35
|
-
(i) =>
|
|
36
|
-
[
|
|
34
|
+
}, []), N = S(
|
|
35
|
+
(i) => l === "monetary" ? P(i) : i,
|
|
36
|
+
[l, P]
|
|
37
37
|
);
|
|
38
|
-
return
|
|
38
|
+
return k ? /* @__PURE__ */ g("div", { className: "form-group", children: [
|
|
39
39
|
/* @__PURE__ */ t("label", { children: r }),
|
|
40
|
-
/* @__PURE__ */ t("span", { className: "form-control", children:
|
|
41
|
-
] }) : /* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: p.value || "-" })
|
|
41
|
+
] }) : /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
|
|
42
42
|
/* @__PURE__ */ t("label", { children: r }),
|
|
43
|
-
|
|
43
|
+
x ? /* @__PURE__ */ t(
|
|
44
44
|
te,
|
|
45
45
|
{
|
|
46
46
|
name: e,
|
|
47
|
-
mask:
|
|
48
|
-
value: String(
|
|
47
|
+
mask: x,
|
|
48
|
+
value: String(p.value ?? ""),
|
|
49
49
|
unmask: !1,
|
|
50
|
-
onAccept: (i) =>
|
|
50
|
+
onAccept: (i) => p.onChange(N(i)),
|
|
51
51
|
placeholder: a,
|
|
52
|
-
readOnly:
|
|
53
|
-
className: `form-control ${
|
|
54
|
-
inputRef:
|
|
55
|
-
onBlur:
|
|
52
|
+
readOnly: m,
|
|
53
|
+
className: `form-control ${f ? "border-red" : ""} ${c}`,
|
|
54
|
+
inputRef: p.ref,
|
|
55
|
+
onBlur: p.onBlur
|
|
56
56
|
}
|
|
57
57
|
) : /* @__PURE__ */ t(
|
|
58
58
|
"input",
|
|
59
59
|
{
|
|
60
|
-
...
|
|
60
|
+
...p,
|
|
61
61
|
type: "text",
|
|
62
|
-
value:
|
|
63
|
-
onChange: (i) =>
|
|
62
|
+
value: p.value ?? "",
|
|
63
|
+
onChange: (i) => p.onChange(N(i.target.value)),
|
|
64
64
|
placeholder: a,
|
|
65
|
-
readOnly:
|
|
66
|
-
className: `form-control ${
|
|
65
|
+
readOnly: m,
|
|
66
|
+
className: `form-control ${f ? "border-red" : ""} ${c}`
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
|
|
69
|
+
f && /* @__PURE__ */ t("p", { className: "text-danger", children: String(f.message) })
|
|
70
70
|
] });
|
|
71
71
|
}
|
|
72
|
-
const
|
|
72
|
+
const ot = T(le);
|
|
73
73
|
function ce({
|
|
74
74
|
name: e,
|
|
75
75
|
label: r = "",
|
|
76
76
|
options: a = [],
|
|
77
|
-
placeholder:
|
|
78
|
-
labelKey:
|
|
79
|
-
valueKey:
|
|
80
|
-
enableSearch:
|
|
77
|
+
placeholder: l = "",
|
|
78
|
+
labelKey: o = "label",
|
|
79
|
+
valueKey: c = "value",
|
|
80
|
+
enableSearch: s = !1,
|
|
81
81
|
searchPlaceholder: n = "Buscar...",
|
|
82
|
-
loading:
|
|
83
|
-
onSearchChange:
|
|
84
|
-
debounceTime:
|
|
85
|
-
onSelect:
|
|
82
|
+
loading: h = !1,
|
|
83
|
+
onSearchChange: u,
|
|
84
|
+
debounceTime: m = 300,
|
|
85
|
+
onSelect: w,
|
|
86
86
|
forceReadOnly: y = !1,
|
|
87
|
-
forceHidden:
|
|
87
|
+
forceHidden: k = !1
|
|
88
88
|
}) {
|
|
89
|
-
const { isReadOnly:
|
|
90
|
-
field: { onChange: d, value:
|
|
91
|
-
fieldState: { error:
|
|
92
|
-
} =
|
|
89
|
+
const { isReadOnly: p, isHidden: b } = E(), f = y || !!p(e), x = k || !!b(e), { control: P, clearErrors: N } = W(), { isView: i } = D(), {
|
|
90
|
+
field: { onChange: d, value: v, ref: M },
|
|
91
|
+
fieldState: { error: C }
|
|
92
|
+
} = I({
|
|
93
93
|
name: e,
|
|
94
94
|
control: P
|
|
95
|
-
}), [$,
|
|
95
|
+
}), [$, A] = _(!1), [V, G] = _(""), L = B(null), z = B(u);
|
|
96
96
|
O(() => {
|
|
97
|
-
z.current =
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
100
|
-
|
|
97
|
+
z.current = u;
|
|
98
|
+
}, [u]), O(() => {
|
|
99
|
+
const R = (F) => {
|
|
100
|
+
L.current && !L.current.contains(F.target) && A(!1);
|
|
101
101
|
};
|
|
102
|
-
return document.addEventListener("mousedown",
|
|
102
|
+
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
103
103
|
}, []), O(() => {
|
|
104
104
|
$ || G("");
|
|
105
105
|
}, [$]), O(() => {
|
|
106
|
-
if (!
|
|
107
|
-
const
|
|
108
|
-
z.current && z.current(
|
|
109
|
-
},
|
|
110
|
-
return () => clearTimeout(
|
|
111
|
-
}, [
|
|
112
|
-
const Q = j(() =>
|
|
113
|
-
(
|
|
114
|
-
) : a ?? [], [a,
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
117
|
-
return String(
|
|
118
|
-
const
|
|
119
|
-
(F) => String(F == null ? void 0 : F[
|
|
106
|
+
if (!s) return;
|
|
107
|
+
const R = setTimeout(() => {
|
|
108
|
+
z.current && z.current(V);
|
|
109
|
+
}, m);
|
|
110
|
+
return () => clearTimeout(R);
|
|
111
|
+
}, [V, s, m]);
|
|
112
|
+
const Q = j(() => s && !u && V.trim() ? a.filter(
|
|
113
|
+
(R) => String((R == null ? void 0 : R[o]) ?? "").toLowerCase().includes(V.toLowerCase())
|
|
114
|
+
) : a ?? [], [a, s, u, V, o]), J = j(() => {
|
|
115
|
+
if (v == null) return "";
|
|
116
|
+
if (typeof v == "object")
|
|
117
|
+
return String(v[c] ?? "");
|
|
118
|
+
const R = (a || []).find(
|
|
119
|
+
(F) => String(F == null ? void 0 : F[c]) === String(v)
|
|
120
120
|
);
|
|
121
|
-
return String(
|
|
122
|
-
}, [
|
|
123
|
-
|
|
121
|
+
return String(R ? (R == null ? void 0 : R[o]) ?? "" : v);
|
|
122
|
+
}, [v, a, c, o]), Z = (R) => {
|
|
123
|
+
f || (d(R[c]), w && w(R), N(e), A(!1));
|
|
124
124
|
};
|
|
125
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ g(
|
|
126
126
|
"div",
|
|
127
127
|
{
|
|
128
|
-
className: `select-wrapper form-group ${
|
|
129
|
-
ref:
|
|
128
|
+
className: `select-wrapper form-group ${x ? "hidden" : ""}`,
|
|
129
|
+
ref: L,
|
|
130
130
|
children: [
|
|
131
131
|
/* @__PURE__ */ t("label", { className: "control-label", children: r }),
|
|
132
|
-
i ? /* @__PURE__ */ t("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */
|
|
133
|
-
/* @__PURE__ */
|
|
132
|
+
i ? /* @__PURE__ */ t("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */ g(U, { children: [
|
|
133
|
+
/* @__PURE__ */ g(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
|
-
className: `select-control ${
|
|
137
|
-
onClick: () => !
|
|
136
|
+
className: `select-control ${C ? "border-red" : ""} ${f ? "readOnly" : ""}`,
|
|
137
|
+
onClick: () => !f && A((R) => !R),
|
|
138
138
|
ref: M,
|
|
139
139
|
children: [
|
|
140
|
-
/* @__PURE__ */ t("span", { className: `select-display ${
|
|
140
|
+
/* @__PURE__ */ t("span", { className: `select-display ${f ? "readOnly" : ""}`, children: J || l }),
|
|
141
141
|
/* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
$ && !
|
|
146
|
-
|
|
145
|
+
$ && !f && /* @__PURE__ */ g("div", { className: "select-dropdown", children: [
|
|
146
|
+
s && /* @__PURE__ */ t("div", { className: "select-search", children: /* @__PURE__ */ t(
|
|
147
147
|
"input",
|
|
148
148
|
{
|
|
149
149
|
type: "text",
|
|
150
150
|
className: "select-search-input",
|
|
151
|
-
value:
|
|
152
|
-
onChange: (
|
|
153
|
-
placeholder:
|
|
151
|
+
value: V,
|
|
152
|
+
onChange: (R) => G(R.target.value),
|
|
153
|
+
placeholder: h ? "Carregando..." : n,
|
|
154
154
|
autoFocus: !0,
|
|
155
|
-
onClick: (
|
|
155
|
+
onClick: (R) => R.stopPropagation()
|
|
156
156
|
}
|
|
157
157
|
) }),
|
|
158
|
-
/* @__PURE__ */ t("ul", { className: "select-options", children:
|
|
158
|
+
/* @__PURE__ */ t("ul", { className: "select-options", children: h ? /* @__PURE__ */ t("li", { className: "select-option readOnly", children: "Carregando..." }) : Q.length > 0 ? Q.map((R) => /* @__PURE__ */ t(
|
|
159
159
|
"li",
|
|
160
160
|
{
|
|
161
|
-
onClick: () => Z(
|
|
161
|
+
onClick: () => Z(R),
|
|
162
162
|
className: "select-option handleHover",
|
|
163
|
-
children:
|
|
163
|
+
children: R[o]
|
|
164
164
|
},
|
|
165
|
-
|
|
165
|
+
R[c]
|
|
166
166
|
)) : /* @__PURE__ */ t("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
167
167
|
] })
|
|
168
168
|
] }),
|
|
169
|
-
/* @__PURE__ */ t("input", { type: "hidden", name: e, value:
|
|
170
|
-
|
|
169
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: e, value: v || "" }),
|
|
170
|
+
C && /* @__PURE__ */ t("p", { className: "text-danger", children: String(C.message) })
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
175
|
+
const it = T(ce);
|
|
176
|
+
function lt({
|
|
177
177
|
name: e,
|
|
178
178
|
options: r = [],
|
|
179
179
|
label: a = "",
|
|
180
|
-
valueKey:
|
|
181
|
-
labelKey:
|
|
182
|
-
forceReadOnly:
|
|
183
|
-
forceHidden:
|
|
180
|
+
valueKey: l = "value",
|
|
181
|
+
labelKey: o = "label",
|
|
182
|
+
forceReadOnly: c = !1,
|
|
183
|
+
forceHidden: s = !1
|
|
184
184
|
}) {
|
|
185
|
-
var
|
|
186
|
-
const n = W(), { isView:
|
|
185
|
+
var v, M;
|
|
186
|
+
const n = W(), { isView: h, isReadOnly: u } = D(), { isReadOnly: m, isHidden: w } = E(), y = m ? m(e) : !1, k = w ? w(e) : !1, p = c || y, b = s || k, f = p || u || h;
|
|
187
187
|
if (!n || !e)
|
|
188
188
|
return console.error("Checkbox requer contexto de formulário e nome."), null;
|
|
189
|
-
const
|
|
190
|
-
const
|
|
191
|
-
return
|
|
192
|
-
}, {}), P = n.watch(e),
|
|
189
|
+
const x = () => !r || !n ? {} : r.reduce((C, $) => {
|
|
190
|
+
const A = $[l], V = n.getValues(A);
|
|
191
|
+
return C[A] = V === "on", C;
|
|
192
|
+
}, {}), P = n.watch(e), N = j(() => P && typeof P == "object" ? P : x(), [P, r, l]);
|
|
193
193
|
O(() => {
|
|
194
|
-
const
|
|
195
|
-
(!
|
|
194
|
+
const C = n.getValues(e);
|
|
195
|
+
(!C || typeof C != "object") && n.setValue(e, N, {
|
|
196
196
|
shouldDirty: !1,
|
|
197
197
|
shouldValidate: !1
|
|
198
198
|
});
|
|
199
|
-
}, [
|
|
200
|
-
const i = (
|
|
201
|
-
if (
|
|
202
|
-
const
|
|
203
|
-
n.setValue(e,
|
|
199
|
+
}, [N, e, n]);
|
|
200
|
+
const i = (C, $) => {
|
|
201
|
+
if (f) return;
|
|
202
|
+
const A = { ...N, [C]: $ };
|
|
203
|
+
n.setValue(e, A, {
|
|
204
204
|
shouldDirty: !0,
|
|
205
205
|
shouldValidate: !0
|
|
206
|
-
}), n.setValue(
|
|
207
|
-
}, d = (M = (
|
|
208
|
-
return /* @__PURE__ */
|
|
206
|
+
}), n.setValue(C, $ ? "on" : "", { shouldValidate: !1 });
|
|
207
|
+
}, d = (M = (v = n.formState) == null ? void 0 : v.errors) == null ? void 0 : M[e];
|
|
208
|
+
return /* @__PURE__ */ g("div", { className: `form-group ${b ? "hidden" : ""}`, children: [
|
|
209
209
|
a && /* @__PURE__ */ t("label", { children: a }),
|
|
210
210
|
/* @__PURE__ */ t(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
|
-
className: `checkbox-group-custom ${
|
|
214
|
-
children: r.map((
|
|
215
|
-
const $ = String(
|
|
216
|
-
return /* @__PURE__ */
|
|
213
|
+
className: `checkbox-group-custom ${f ? "readOnly" : ""}`,
|
|
214
|
+
children: r.map((C) => {
|
|
215
|
+
const $ = String(C[l]), A = N[$] === !0;
|
|
216
|
+
return /* @__PURE__ */ g("div", { children: [
|
|
217
217
|
/* @__PURE__ */ t("input", { type: "hidden", ...n.register($) }),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ g(
|
|
219
219
|
"label",
|
|
220
220
|
{
|
|
221
|
-
className: `custom-checkbox ${
|
|
221
|
+
className: `custom-checkbox ${A ? "checked" : ""} ${f ? "readOnly" : ""}`,
|
|
222
222
|
children: [
|
|
223
223
|
/* @__PURE__ */ t(
|
|
224
224
|
"input",
|
|
225
225
|
{
|
|
226
226
|
type: "checkbox",
|
|
227
|
-
checked:
|
|
228
|
-
disabled:
|
|
229
|
-
onChange: (
|
|
227
|
+
checked: A,
|
|
228
|
+
disabled: f,
|
|
229
|
+
onChange: (V) => i($, V.target.checked)
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
232
|
/* @__PURE__ */ t("span", { className: "checkmark" }),
|
|
233
|
-
/* @__PURE__ */ t("span", { children:
|
|
233
|
+
/* @__PURE__ */ t("span", { children: C[o] })
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
)
|
|
@@ -245,39 +245,39 @@ function de({
|
|
|
245
245
|
name: e,
|
|
246
246
|
label: r = "",
|
|
247
247
|
options: a = [],
|
|
248
|
-
valueKey:
|
|
249
|
-
labelKey:
|
|
250
|
-
iconKey:
|
|
251
|
-
forceReadOnly:
|
|
248
|
+
valueKey: l = "value",
|
|
249
|
+
labelKey: o = "label",
|
|
250
|
+
iconKey: c = "icon",
|
|
251
|
+
forceReadOnly: s = !1,
|
|
252
252
|
forceHidden: n = !1
|
|
253
253
|
}) {
|
|
254
|
-
const { isReadOnly:
|
|
255
|
-
field:
|
|
256
|
-
fieldState: { error:
|
|
257
|
-
} =
|
|
254
|
+
const { isReadOnly: h, isHidden: u } = E(), m = s || !!h(e), w = n || !!u(e), { control: y } = W(), { isView: k, isReadOnly: p } = D(), {
|
|
255
|
+
field: b,
|
|
256
|
+
fieldState: { error: f }
|
|
257
|
+
} = I({
|
|
258
258
|
name: e,
|
|
259
259
|
control: y
|
|
260
|
-
}),
|
|
260
|
+
}), x = m || p || k, P = b.value ?? "", N = S(
|
|
261
261
|
(i) => {
|
|
262
|
-
|
|
262
|
+
x || b.onChange(i);
|
|
263
263
|
},
|
|
264
|
-
[
|
|
264
|
+
[x, b]
|
|
265
265
|
);
|
|
266
|
-
return /* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ g("div", { className: `form-group column ${w ? "hidden" : ""}`, children: [
|
|
267
267
|
r && /* @__PURE__ */ t("label", { className: "control-label", children: r }),
|
|
268
268
|
/* @__PURE__ */ t(
|
|
269
269
|
"div",
|
|
270
270
|
{
|
|
271
|
-
className: `btn-group ${
|
|
271
|
+
className: `btn-group ${x ? "view-mode" : ""}`,
|
|
272
272
|
"data-field-name": e,
|
|
273
273
|
children: a.map((i) => {
|
|
274
|
-
const d = i[
|
|
275
|
-
return /* @__PURE__ */
|
|
274
|
+
const d = i[l], v = P === d, M = i.color ? { "--customColor": i.color } : void 0;
|
|
275
|
+
return /* @__PURE__ */ g(
|
|
276
276
|
"label",
|
|
277
277
|
{
|
|
278
278
|
htmlFor: `${e}_${d}`,
|
|
279
279
|
style: M,
|
|
280
|
-
className: `btn fs-ellipsis ${
|
|
280
|
+
className: `btn fs-ellipsis ${v ? "active" : ""}`,
|
|
281
281
|
children: [
|
|
282
282
|
/* @__PURE__ */ t(
|
|
283
283
|
"input",
|
|
@@ -286,15 +286,15 @@ function de({
|
|
|
286
286
|
id: `${e}_${d}`,
|
|
287
287
|
name: e,
|
|
288
288
|
value: d,
|
|
289
|
-
checked:
|
|
289
|
+
checked: v,
|
|
290
290
|
className: "hidden",
|
|
291
|
-
onChange: () =>
|
|
292
|
-
disabled:
|
|
291
|
+
onChange: () => N(d),
|
|
292
|
+
disabled: x
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
|
-
i[
|
|
295
|
+
i[c] && /* @__PURE__ */ t("i", { className: `${i[c]} icon-sm` }),
|
|
296
296
|
" ",
|
|
297
|
-
i[
|
|
297
|
+
i[o]
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
300
|
d
|
|
@@ -302,46 +302,46 @@ function de({
|
|
|
302
302
|
})
|
|
303
303
|
}
|
|
304
304
|
),
|
|
305
|
-
|
|
305
|
+
f && /* @__PURE__ */ t("p", { className: "text-danger", children: String(f.message) })
|
|
306
306
|
] });
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const ct = T(de), ue = ({
|
|
309
309
|
name: e,
|
|
310
310
|
label: r = "",
|
|
311
311
|
placeholder: a = "",
|
|
312
|
-
className:
|
|
313
|
-
rows:
|
|
314
|
-
maxLength:
|
|
315
|
-
forceReadOnly:
|
|
312
|
+
className: l = "",
|
|
313
|
+
rows: o = 4,
|
|
314
|
+
maxLength: c,
|
|
315
|
+
forceReadOnly: s = !1,
|
|
316
316
|
forceHidden: n = !1
|
|
317
317
|
}) => {
|
|
318
|
-
const { isReadOnly:
|
|
319
|
-
field:
|
|
320
|
-
fieldState: { error:
|
|
321
|
-
} =
|
|
318
|
+
const { isReadOnly: h, isHidden: u } = E(), m = s || !!h(e), w = n || !!u(e), { control: y } = W(), { isView: k } = D(), {
|
|
319
|
+
field: p,
|
|
320
|
+
fieldState: { error: b }
|
|
321
|
+
} = I({
|
|
322
322
|
name: e,
|
|
323
323
|
control: y
|
|
324
324
|
});
|
|
325
|
-
return
|
|
325
|
+
return k ? /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
|
|
326
326
|
/* @__PURE__ */ t("label", { children: r }),
|
|
327
|
-
/* @__PURE__ */ t("span", { className: "form-control", children:
|
|
328
|
-
] }) : /* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: p.value || "-" })
|
|
328
|
+
] }) : /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
|
|
329
329
|
/* @__PURE__ */ t("label", { children: r }),
|
|
330
330
|
/* @__PURE__ */ t(
|
|
331
331
|
"textarea",
|
|
332
332
|
{
|
|
333
|
-
...
|
|
334
|
-
rows:
|
|
335
|
-
maxLength:
|
|
336
|
-
value:
|
|
333
|
+
...p,
|
|
334
|
+
rows: o,
|
|
335
|
+
maxLength: c,
|
|
336
|
+
value: p.value || "",
|
|
337
337
|
placeholder: a,
|
|
338
|
-
readOnly:
|
|
339
|
-
className: `form-control ${
|
|
338
|
+
readOnly: m,
|
|
339
|
+
className: `form-control ${b ? "border-red" : ""} ${l}`
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
|
|
342
|
+
b && /* @__PURE__ */ t("p", { className: "text-danger", children: String(b.message) })
|
|
343
343
|
] });
|
|
344
|
-
},
|
|
344
|
+
}, dt = T(ue);
|
|
345
345
|
function X(e) {
|
|
346
346
|
return (r = {}) => {
|
|
347
347
|
const a = r.width ? String(r.width) : e.defaultWidth;
|
|
@@ -350,35 +350,35 @@ function X(e) {
|
|
|
350
350
|
}
|
|
351
351
|
function H(e) {
|
|
352
352
|
return (r, a) => {
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
const
|
|
357
|
-
|
|
353
|
+
const l = a != null && a.context ? String(a.context) : "standalone";
|
|
354
|
+
let o;
|
|
355
|
+
if (l === "formatting" && e.formattingValues) {
|
|
356
|
+
const s = e.defaultFormattingWidth || e.defaultWidth, n = a != null && a.width ? String(a.width) : s;
|
|
357
|
+
o = e.formattingValues[n] || e.formattingValues[s];
|
|
358
358
|
} else {
|
|
359
|
-
const
|
|
360
|
-
|
|
359
|
+
const s = e.defaultWidth, n = a != null && a.width ? String(a.width) : e.defaultWidth;
|
|
360
|
+
o = e.values[n] || e.values[s];
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
return
|
|
362
|
+
const c = e.argumentCallback ? e.argumentCallback(r) : r;
|
|
363
|
+
return o[c];
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
366
|
function q(e) {
|
|
367
367
|
return (r, a = {}) => {
|
|
368
|
-
const
|
|
369
|
-
if (!
|
|
368
|
+
const l = a.width, o = l && e.matchPatterns[l] || e.matchPatterns[e.defaultMatchWidth], c = r.match(o);
|
|
369
|
+
if (!c)
|
|
370
370
|
return null;
|
|
371
|
-
const
|
|
371
|
+
const s = c[0], n = l && e.parsePatterns[l] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(n) ? he(n, (w) => w.test(s)) : (
|
|
372
372
|
// [TODO] -- I challenge you to fix the type
|
|
373
|
-
me(n, (
|
|
373
|
+
me(n, (w) => w.test(s))
|
|
374
374
|
);
|
|
375
|
-
let
|
|
376
|
-
|
|
375
|
+
let u;
|
|
376
|
+
u = e.valueCallback ? e.valueCallback(h) : h, u = a.valueCallback ? (
|
|
377
377
|
// [TODO] -- I challenge you to fix the type
|
|
378
|
-
a.valueCallback(
|
|
379
|
-
) :
|
|
380
|
-
const
|
|
381
|
-
return { value:
|
|
378
|
+
a.valueCallback(u)
|
|
379
|
+
) : u;
|
|
380
|
+
const m = r.slice(s.length);
|
|
381
|
+
return { value: u, rest: m };
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function me(e, r) {
|
|
@@ -393,14 +393,14 @@ function he(e, r) {
|
|
|
393
393
|
}
|
|
394
394
|
function fe(e) {
|
|
395
395
|
return (r, a = {}) => {
|
|
396
|
-
const
|
|
397
|
-
if (!c) return null;
|
|
398
|
-
const s = c[0], l = r.match(e.parsePattern);
|
|
396
|
+
const l = r.match(e.matchPattern);
|
|
399
397
|
if (!l) return null;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
const o = l[0], c = r.match(e.parsePattern);
|
|
399
|
+
if (!c) return null;
|
|
400
|
+
let s = e.valueCallback ? e.valueCallback(c[0]) : c[0];
|
|
401
|
+
s = a.valueCallback ? a.valueCallback(s) : s;
|
|
402
|
+
const n = r.slice(o.length);
|
|
403
|
+
return { value: s, rest: n };
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
const ge = {
|
|
@@ -466,9 +466,9 @@ const ge = {
|
|
|
466
466
|
other: "quase {{count}} anos"
|
|
467
467
|
}
|
|
468
468
|
}, pe = (e, r, a) => {
|
|
469
|
-
let
|
|
470
|
-
const
|
|
471
|
-
return typeof
|
|
469
|
+
let l;
|
|
470
|
+
const o = ge[e];
|
|
471
|
+
return typeof o == "string" ? l = o : r === 1 ? l = o.one : l = o.other.replace("{{count}}", String(r)), a != null && a.addSuffix ? a.comparison && a.comparison > 0 ? "em " + l : "há " + l : l;
|
|
472
472
|
}, be = {
|
|
473
473
|
full: "EEEE, d 'de' MMMM 'de' y",
|
|
474
474
|
long: "d 'de' MMMM 'de' y",
|
|
@@ -507,9 +507,9 @@ const ge = {
|
|
|
507
507
|
tomorrow: "'amanhã às' p",
|
|
508
508
|
nextWeek: "eeee 'às' p",
|
|
509
509
|
other: "P"
|
|
510
|
-
}, ke = (e, r, a,
|
|
511
|
-
const
|
|
512
|
-
return typeof
|
|
510
|
+
}, ke = (e, r, a, l) => {
|
|
511
|
+
const o = we[e];
|
|
512
|
+
return typeof o == "function" ? o(r) : o;
|
|
513
513
|
}, Ce = {
|
|
514
514
|
narrow: ["AC", "DC"],
|
|
515
515
|
abbreviated: ["AC", "DC"],
|
|
@@ -634,7 +634,7 @@ const ge = {
|
|
|
634
634
|
}, Me = (e, r) => {
|
|
635
635
|
const a = Number(e);
|
|
636
636
|
return (r == null ? void 0 : r.unit) === "week" ? a + "ª" : a + "º";
|
|
637
|
-
},
|
|
637
|
+
}, Ae = {
|
|
638
638
|
ordinalNumber: Me,
|
|
639
639
|
era: H({
|
|
640
640
|
values: Ce,
|
|
@@ -659,7 +659,7 @@ const ge = {
|
|
|
659
659
|
formattingValues: Se,
|
|
660
660
|
defaultFormattingWidth: "wide"
|
|
661
661
|
})
|
|
662
|
-
},
|
|
662
|
+
}, Ve = /^(\d+)[ºªo]?/i, Oe = /\d+/i, We = {
|
|
663
663
|
narrow: /^(ac|dc|a|d)/i,
|
|
664
664
|
abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
|
|
665
665
|
wide: /^(antes de cristo|depois de cristo)/i
|
|
@@ -728,9 +728,9 @@ const ge = {
|
|
|
728
728
|
evening: /tarde/i,
|
|
729
729
|
night: /noite/i
|
|
730
730
|
}
|
|
731
|
-
},
|
|
731
|
+
}, Be = {
|
|
732
732
|
ordinalNumber: fe({
|
|
733
|
-
matchPattern:
|
|
733
|
+
matchPattern: Ve,
|
|
734
734
|
parsePattern: Oe,
|
|
735
735
|
valueCallback: (e) => parseInt(e, 10)
|
|
736
736
|
}),
|
|
@@ -765,32 +765,32 @@ const ge = {
|
|
|
765
765
|
parsePatterns: qe,
|
|
766
766
|
defaultParseWidth: "any"
|
|
767
767
|
})
|
|
768
|
-
},
|
|
768
|
+
}, Le = {
|
|
769
769
|
code: "pt-BR",
|
|
770
770
|
formatDistance: pe,
|
|
771
771
|
formatLong: Ne,
|
|
772
772
|
formatRelative: ke,
|
|
773
|
-
localize:
|
|
774
|
-
match:
|
|
773
|
+
localize: Ae,
|
|
774
|
+
match: Be,
|
|
775
775
|
options: {
|
|
776
776
|
weekStartsOn: 0,
|
|
777
777
|
firstWeekContainsDate: 1
|
|
778
778
|
}
|
|
779
779
|
};
|
|
780
|
-
ae("pt-BR",
|
|
780
|
+
ae("pt-BR", Le);
|
|
781
781
|
const Y = "dd/MM/yyyy", ze = (e) => {
|
|
782
782
|
if (!e) return null;
|
|
783
783
|
const r = re(e, Y, /* @__PURE__ */ new Date());
|
|
784
784
|
return se(r) ? r : null;
|
|
785
785
|
}, Xe = (e) => e ? oe(e, Y) : "", Ue = K(
|
|
786
|
-
({ shimRef: e, className: r, name: a, ...
|
|
786
|
+
({ shimRef: e, className: r, name: a, ...l }, o) => /* @__PURE__ */ t(
|
|
787
787
|
"input",
|
|
788
788
|
{
|
|
789
789
|
name: a,
|
|
790
|
-
...
|
|
790
|
+
...l,
|
|
791
791
|
className: r,
|
|
792
|
-
ref: (
|
|
793
|
-
typeof
|
|
792
|
+
ref: (c) => {
|
|
793
|
+
typeof o == "function" ? o(c) : o && (o.current = c), e && e(c);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
)
|
|
@@ -798,345 +798,349 @@ const Y = "dd/MM/yyyy", ze = (e) => {
|
|
|
798
798
|
name: e,
|
|
799
799
|
label: r = "",
|
|
800
800
|
placeholder: a = "dd/mm/aaaa",
|
|
801
|
-
className:
|
|
802
|
-
forceReadOnly:
|
|
803
|
-
forceHidden:
|
|
801
|
+
className: l = "",
|
|
802
|
+
forceReadOnly: o = !1,
|
|
803
|
+
forceHidden: c = !1
|
|
804
804
|
}) => {
|
|
805
|
-
const { control:
|
|
806
|
-
field: { onChange: y, onBlur:
|
|
807
|
-
fieldState: { error:
|
|
808
|
-
} =
|
|
805
|
+
const { control: s } = W(), { isView: n } = D(), { isReadOnly: h, isHidden: u } = E(), m = o || !!h(e), w = c || !!u(e), {
|
|
806
|
+
field: { onChange: y, onBlur: k, value: p, ref: b },
|
|
807
|
+
fieldState: { error: f }
|
|
808
|
+
} = I({
|
|
809
809
|
name: e,
|
|
810
|
-
control:
|
|
811
|
-
}),
|
|
810
|
+
control: s
|
|
811
|
+
}), x = j(() => ze(p), [p]), P = S(
|
|
812
812
|
(i) => {
|
|
813
813
|
y(i ? Xe(i) : "");
|
|
814
814
|
},
|
|
815
815
|
[y]
|
|
816
|
-
),
|
|
816
|
+
), N = S(
|
|
817
817
|
(i) => {
|
|
818
|
-
var d,
|
|
819
|
-
if (
|
|
820
|
-
const M =
|
|
818
|
+
var d, v;
|
|
819
|
+
if (b(i), i && ((v = (d = s._fields) == null ? void 0 : d[e]) != null && v._f)) {
|
|
820
|
+
const M = s._fields[e];
|
|
821
821
|
M._f.ref = {
|
|
822
822
|
focus: () => {
|
|
823
|
-
var
|
|
824
|
-
return (
|
|
823
|
+
var C;
|
|
824
|
+
return (C = i.focus) == null ? void 0 : C.call(i);
|
|
825
825
|
},
|
|
826
826
|
select: () => {
|
|
827
|
-
var
|
|
828
|
-
return (
|
|
827
|
+
var C;
|
|
828
|
+
return (C = i.select) == null ? void 0 : C.call(i);
|
|
829
829
|
},
|
|
830
|
-
setCustomValidity: (
|
|
830
|
+
setCustomValidity: (C) => {
|
|
831
831
|
var $;
|
|
832
|
-
return ($ = i.setCustomValidity) == null ? void 0 : $.call(i,
|
|
832
|
+
return ($ = i.setCustomValidity) == null ? void 0 : $.call(i, C);
|
|
833
833
|
},
|
|
834
834
|
reportValidity: () => {
|
|
835
|
-
var
|
|
836
|
-
return (
|
|
835
|
+
var C;
|
|
836
|
+
return (C = i.reportValidity) == null ? void 0 : C.call(i);
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
},
|
|
841
|
-
[
|
|
841
|
+
[b, s, e]
|
|
842
842
|
);
|
|
843
|
-
return
|
|
843
|
+
return w ? null : n ? /* @__PURE__ */ g("div", { className: "form-group", children: [
|
|
844
844
|
/* @__PURE__ */ t("label", { children: r }),
|
|
845
|
-
/* @__PURE__ */ t("span", { className: "form-control", children:
|
|
846
|
-
] }) : /* @__PURE__ */
|
|
845
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: p || "-" })
|
|
846
|
+
] }) : /* @__PURE__ */ g("div", { className: `form-group fluig-style-guide ${l}`, children: [
|
|
847
847
|
r && /* @__PURE__ */ t("label", { className: "control-label", htmlFor: e, children: r }),
|
|
848
|
-
/* @__PURE__ */ t("div", { className: `${
|
|
848
|
+
/* @__PURE__ */ t("div", { className: `${f ? "border-red" : ""}`, children: /* @__PURE__ */ t(
|
|
849
849
|
ne,
|
|
850
850
|
{
|
|
851
851
|
id: e,
|
|
852
852
|
name: e,
|
|
853
|
-
selected:
|
|
853
|
+
selected: x,
|
|
854
854
|
onChange: P,
|
|
855
|
-
onBlur:
|
|
855
|
+
onBlur: k,
|
|
856
856
|
dateFormat: Y,
|
|
857
857
|
placeholderText: a,
|
|
858
|
-
disabled:
|
|
859
|
-
readOnly:
|
|
858
|
+
disabled: m,
|
|
859
|
+
readOnly: m,
|
|
860
860
|
locale: "pt-BR",
|
|
861
|
-
className: `form-control ${
|
|
861
|
+
className: `form-control ${f ? "border-red" : ""}`,
|
|
862
862
|
wrapperClassName: "w-100",
|
|
863
863
|
showMonthDropdown: !0,
|
|
864
864
|
showYearDropdown: !0,
|
|
865
865
|
dropdownMode: "select",
|
|
866
|
-
isClearable: !
|
|
866
|
+
isClearable: !m && !!p,
|
|
867
867
|
autoComplete: "off",
|
|
868
|
-
customInput: /* @__PURE__ */ t(Ue, { name: e, shimRef:
|
|
868
|
+
customInput: /* @__PURE__ */ t(Ue, { name: e, shimRef: N })
|
|
869
869
|
}
|
|
870
870
|
) }),
|
|
871
|
-
|
|
871
|
+
f && /* @__PURE__ */ t("span", { className: "help-block text-danger", children: String(f.message) })
|
|
872
872
|
] });
|
|
873
|
-
},
|
|
873
|
+
}, ut = T(Ye);
|
|
874
874
|
function Ge({
|
|
875
875
|
mapping: e = {},
|
|
876
876
|
defaultLabel: r = "Não reconhecido",
|
|
877
877
|
className: a = "",
|
|
878
|
-
hidden:
|
|
879
|
-
label:
|
|
878
|
+
hidden: l = !1,
|
|
879
|
+
label: o
|
|
880
880
|
}) {
|
|
881
|
-
const { activityId:
|
|
882
|
-
if (!
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
|
|
881
|
+
const { activityId: c } = D(), s = j(() => !e || c === null || c === void 0 ? null : e[c], [c, e]);
|
|
882
|
+
if (!s)
|
|
883
|
+
return /* @__PURE__ */ g("div", { className: `form-group ${l ? "hidden" : ""}`, children: [
|
|
884
|
+
o && /* @__PURE__ */ t("label", { children: o }),
|
|
885
885
|
/* @__PURE__ */ t("div", { className: `status-badge default ${a}`, children: r })
|
|
886
886
|
] });
|
|
887
887
|
const n = {
|
|
888
|
-
"--customColor":
|
|
888
|
+
"--customColor": s.color
|
|
889
889
|
};
|
|
890
|
-
return /* @__PURE__ */
|
|
891
|
-
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
|
|
894
|
-
/* @__PURE__ */ t("span", { children:
|
|
890
|
+
return /* @__PURE__ */ g("div", { className: `form-group ${l ? "hidden" : ""}`, children: [
|
|
891
|
+
o && /* @__PURE__ */ t("label", { children: o }),
|
|
892
|
+
/* @__PURE__ */ g("div", { className: `status-badge ${a}`, style: n, children: [
|
|
893
|
+
s.icon && /* @__PURE__ */ t("i", { className: s.icon }),
|
|
894
|
+
/* @__PURE__ */ t("span", { children: s.label })
|
|
895
895
|
] })
|
|
896
896
|
] });
|
|
897
897
|
}
|
|
898
|
-
const
|
|
898
|
+
const mt = T(Ge);
|
|
899
899
|
function Qe({
|
|
900
900
|
name: e,
|
|
901
901
|
control: r,
|
|
902
902
|
defaultRowValue: a,
|
|
903
|
-
isView:
|
|
904
|
-
isReadOnly:
|
|
905
|
-
filters:
|
|
903
|
+
isView: l,
|
|
904
|
+
isReadOnly: o,
|
|
905
|
+
filters: c = []
|
|
906
906
|
}) {
|
|
907
|
-
const { field:
|
|
907
|
+
const { field: s } = I({ name: e, control: r }), [n, h] = _([]), [u, m] = _([]), w = () => Date.now() + Math.random(), y = (i) => {
|
|
908
908
|
try {
|
|
909
909
|
const d = JSON.parse(i);
|
|
910
|
-
return Array.isArray(d) ? d.map((
|
|
911
|
-
...
|
|
912
|
-
_uid:
|
|
910
|
+
return Array.isArray(d) ? d.map((v) => ({
|
|
911
|
+
...v,
|
|
912
|
+
_uid: v._uid || w()
|
|
913
913
|
})) : [];
|
|
914
914
|
} catch (d) {
|
|
915
915
|
return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
918
|
O(() => {
|
|
919
|
-
if (!(n.length > 0 && !
|
|
919
|
+
if (!(n.length > 0 && !l) && s.value && typeof s.value == "string") {
|
|
920
920
|
const i = JSON.stringify(n);
|
|
921
|
-
if (
|
|
922
|
-
const d = y(
|
|
923
|
-
|
|
921
|
+
if (s.value === i) return;
|
|
922
|
+
const d = y(s.value);
|
|
923
|
+
h(d);
|
|
924
924
|
}
|
|
925
|
-
}, [
|
|
926
|
-
if (
|
|
925
|
+
}, [s.value, l]), O(() => {
|
|
926
|
+
if (o) return;
|
|
927
927
|
const i = JSON.stringify(n);
|
|
928
|
-
|
|
929
|
-
}, [n,
|
|
930
|
-
const
|
|
931
|
-
const i = { _uid:
|
|
932
|
-
|
|
933
|
-
}, [a]),
|
|
934
|
-
|
|
935
|
-
(i) => i.filter((d) => !
|
|
936
|
-
),
|
|
937
|
-
}, [
|
|
938
|
-
(i, d,
|
|
939
|
-
|
|
928
|
+
s.value !== i && s.onChange(i);
|
|
929
|
+
}, [n, s, o]);
|
|
930
|
+
const k = S(() => {
|
|
931
|
+
const i = { _uid: w(), ...a };
|
|
932
|
+
h((d) => [...d, i]);
|
|
933
|
+
}, [a]), p = S(() => {
|
|
934
|
+
h(
|
|
935
|
+
(i) => i.filter((d) => !u.includes(d._uid))
|
|
936
|
+
), m([]);
|
|
937
|
+
}, [u]), b = S(
|
|
938
|
+
(i, d, v) => {
|
|
939
|
+
h(
|
|
940
940
|
(M) => M.map(
|
|
941
|
-
(
|
|
941
|
+
(C) => C._uid === i ? { ...C, [d]: v } : C
|
|
942
942
|
)
|
|
943
943
|
);
|
|
944
944
|
},
|
|
945
945
|
[]
|
|
946
|
-
),
|
|
947
|
-
|
|
948
|
-
(d) => d.includes(i) ? d.filter((
|
|
946
|
+
), f = S((i) => {
|
|
947
|
+
m(
|
|
948
|
+
(d) => d.includes(i) ? d.filter((v) => v !== i) : [...d, i]
|
|
949
949
|
);
|
|
950
|
-
}, []),
|
|
950
|
+
}, []), x = S(
|
|
951
951
|
(i) => {
|
|
952
|
-
|
|
952
|
+
m(i ? n.map((d) => d._uid) : []);
|
|
953
953
|
},
|
|
954
954
|
[n]
|
|
955
|
-
), P = n.length > 0 &&
|
|
956
|
-
(i) =>
|
|
955
|
+
), P = n.length > 0 && u.length === n.length, N = j(() => !c || c.length === 0 ? n : n.filter(
|
|
956
|
+
(i) => c.every((d) => {
|
|
957
957
|
if ("custom" in d)
|
|
958
958
|
return d.custom(i);
|
|
959
|
-
const
|
|
959
|
+
const v = i[d.field];
|
|
960
960
|
switch (d.operator) {
|
|
961
961
|
case "===":
|
|
962
|
-
return
|
|
962
|
+
return v === d.value;
|
|
963
963
|
case "!==":
|
|
964
|
-
return
|
|
964
|
+
return v !== d.value;
|
|
965
965
|
case ">":
|
|
966
|
-
return
|
|
966
|
+
return v > d.value;
|
|
967
967
|
case "<":
|
|
968
|
-
return
|
|
968
|
+
return v < d.value;
|
|
969
969
|
case ">=":
|
|
970
|
-
return
|
|
970
|
+
return v >= d.value;
|
|
971
971
|
case "<=":
|
|
972
|
-
return
|
|
972
|
+
return v <= d.value;
|
|
973
973
|
default:
|
|
974
974
|
return !0;
|
|
975
975
|
}
|
|
976
976
|
})
|
|
977
|
-
), [n,
|
|
977
|
+
), [n, c]);
|
|
978
978
|
return {
|
|
979
|
-
field:
|
|
979
|
+
field: s,
|
|
980
980
|
tableRows: n,
|
|
981
|
-
visibleRows:
|
|
982
|
-
selectedRowIds:
|
|
981
|
+
visibleRows: N,
|
|
982
|
+
selectedRowIds: u,
|
|
983
983
|
isAllSelected: P,
|
|
984
984
|
handle: {
|
|
985
|
-
addRow:
|
|
986
|
-
removeRows:
|
|
987
|
-
updateCellValue:
|
|
988
|
-
toggleSelection:
|
|
989
|
-
toggleSelectAll:
|
|
985
|
+
addRow: k,
|
|
986
|
+
removeRows: p,
|
|
987
|
+
updateCellValue: b,
|
|
988
|
+
toggleSelection: f,
|
|
989
|
+
toggleSelectAll: x
|
|
990
990
|
}
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const ht = ({
|
|
994
994
|
name: e,
|
|
995
995
|
title: r = "Tabela Dinâmica",
|
|
996
996
|
columns: a,
|
|
997
|
-
defaultRowValue:
|
|
998
|
-
forceReadOnly:
|
|
999
|
-
layout:
|
|
1000
|
-
actions:
|
|
997
|
+
defaultRowValue: l = {},
|
|
998
|
+
forceReadOnly: o = !1,
|
|
999
|
+
layout: c = "fluid",
|
|
1000
|
+
actions: s = !0,
|
|
1001
1001
|
filters: n = []
|
|
1002
1002
|
}) => {
|
|
1003
|
-
const { control:
|
|
1003
|
+
const { control: h } = W(), { isView: u, isReadOnly: m } = D(), { isReadOnly: w } = E(), y = o || u || m || w && w(e), { field: k, visibleRows: p, selectedRowIds: b, isAllSelected: f, handle: x } = Qe({
|
|
1004
1004
|
name: e,
|
|
1005
|
-
control:
|
|
1006
|
-
defaultRowValue:
|
|
1007
|
-
isView:
|
|
1005
|
+
control: h,
|
|
1006
|
+
defaultRowValue: l,
|
|
1007
|
+
isView: u,
|
|
1008
1008
|
isReadOnly: !!y,
|
|
1009
1009
|
filters: n
|
|
1010
|
-
}), P =
|
|
1011
|
-
return /* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */ t("input", { type: "hidden", ...
|
|
1013
|
-
/* @__PURE__ */
|
|
1010
|
+
}), P = c === "fixed";
|
|
1011
|
+
return /* @__PURE__ */ g("div", { className: `table-wrapper ${P ? "table-fixed" : "table-fluid"}`, children: [
|
|
1012
|
+
/* @__PURE__ */ t("input", { type: "hidden", ...k }),
|
|
1013
|
+
/* @__PURE__ */ g("div", { className: "header-handle", children: [
|
|
1014
1014
|
/* @__PURE__ */ t("h3", { children: r }),
|
|
1015
|
-
!y &&
|
|
1016
|
-
/* @__PURE__ */
|
|
1015
|
+
!y && s && /* @__PURE__ */ g("div", { className: "handle-actions", children: [
|
|
1016
|
+
/* @__PURE__ */ g(
|
|
1017
1017
|
"button",
|
|
1018
1018
|
{
|
|
1019
1019
|
type: "button",
|
|
1020
|
-
className: `btn ${
|
|
1021
|
-
disabled:
|
|
1022
|
-
onClick:
|
|
1020
|
+
className: `btn ${b.length > 0 ? "btn-danger" : ""}`,
|
|
1021
|
+
disabled: b.length === 0,
|
|
1022
|
+
onClick: x.removeRows,
|
|
1023
1023
|
children: [
|
|
1024
1024
|
"Remover (",
|
|
1025
|
-
|
|
1025
|
+
b.length,
|
|
1026
1026
|
")"
|
|
1027
1027
|
]
|
|
1028
1028
|
}
|
|
1029
1029
|
),
|
|
1030
|
-
/* @__PURE__ */ t("button", { type: "button", className: "btn-add", onClick:
|
|
1030
|
+
/* @__PURE__ */ t("button", { type: "button", className: "btn-add", onClick: x.addRow, children: "Adicionar" })
|
|
1031
1031
|
] })
|
|
1032
1032
|
] }),
|
|
1033
|
-
/* @__PURE__ */ t("div", { className: "table-scroll", children: /* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */
|
|
1033
|
+
/* @__PURE__ */ t("div", { className: "table-scroll", children: /* @__PURE__ */ g("table", { className: "table-custom", children: [
|
|
1034
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ g("tr", { children: [
|
|
1035
1035
|
!y && /* @__PURE__ */ t("th", { style: { width: "50px" }, children: /* @__PURE__ */ t(
|
|
1036
1036
|
"input",
|
|
1037
1037
|
{
|
|
1038
1038
|
type: "checkbox",
|
|
1039
|
-
checked:
|
|
1040
|
-
onChange: (
|
|
1039
|
+
checked: f,
|
|
1040
|
+
onChange: (N) => x.toggleSelectAll(N.target.checked)
|
|
1041
1041
|
}
|
|
1042
1042
|
) }),
|
|
1043
|
-
a.map((
|
|
1043
|
+
a.map((N) => /* @__PURE__ */ t(
|
|
1044
1044
|
"th",
|
|
1045
1045
|
{
|
|
1046
|
-
style:
|
|
1047
|
-
children:
|
|
1046
|
+
style: N.width ? { minWidth: P ? N.width : "100%" } : { width: "max-content" },
|
|
1047
|
+
children: N.label
|
|
1048
1048
|
},
|
|
1049
|
-
|
|
1049
|
+
N.key
|
|
1050
1050
|
))
|
|
1051
1051
|
] }) }),
|
|
1052
|
-
/* @__PURE__ */
|
|
1053
|
-
|
|
1052
|
+
/* @__PURE__ */ g("tbody", { children: [
|
|
1053
|
+
p.map((N, i) => /* @__PURE__ */ g("tr", { children: [
|
|
1054
1054
|
!y && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
|
|
1055
1055
|
"input",
|
|
1056
1056
|
{
|
|
1057
1057
|
type: "checkbox",
|
|
1058
|
-
checked:
|
|
1059
|
-
onChange: () =>
|
|
1058
|
+
checked: b.includes(N._uid),
|
|
1059
|
+
onChange: () => x.toggleSelection(N._uid)
|
|
1060
1060
|
}
|
|
1061
1061
|
) }),
|
|
1062
1062
|
a.map((d) => /* @__PURE__ */ t("td", { children: d.render ? d.render.length <= 1 ? d.render({
|
|
1063
|
-
row:
|
|
1063
|
+
row: N,
|
|
1064
1064
|
index: i,
|
|
1065
|
-
updateRow: (
|
|
1065
|
+
updateRow: (v, M) => x.updateCellValue(N._uid, v, M),
|
|
1066
1066
|
isLocked: !!y,
|
|
1067
|
-
isView: !!
|
|
1067
|
+
isView: !!u
|
|
1068
1068
|
}) : d.render(
|
|
1069
|
-
|
|
1069
|
+
N,
|
|
1070
1070
|
i,
|
|
1071
|
-
(
|
|
1071
|
+
(v, M) => x.updateCellValue(N._uid, v, M),
|
|
1072
1072
|
!!y,
|
|
1073
|
-
!!
|
|
1074
|
-
) :
|
|
1075
|
-
] },
|
|
1076
|
-
|
|
1073
|
+
!!u
|
|
1074
|
+
) : N[d.key] }, `${N._uid}-${d.key}`))
|
|
1075
|
+
] }, N._uid)),
|
|
1076
|
+
p.length === 0 && /* @__PURE__ */ t("tr", { className: "empty-row", children: /* @__PURE__ */ t("td", { colSpan: 100, className: "text-center", children: y ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
1077
1077
|
] })
|
|
1078
1078
|
] }) })
|
|
1079
1079
|
] });
|
|
1080
1080
|
}, Je = (e) => {
|
|
1081
|
-
const [r, a] = _(null), { watch:
|
|
1081
|
+
const [r, a] = _(null), { watch: l } = W(), o = l(e), c = S(() => {
|
|
1082
1082
|
try {
|
|
1083
1083
|
const n = window.top.__REACT_ATTACHMENT_BRIDGE__;
|
|
1084
1084
|
if (n) {
|
|
1085
|
-
const
|
|
1086
|
-
a(
|
|
1085
|
+
const h = n.getAttachment(e);
|
|
1086
|
+
a(h || (o ? { name: o, documentId: 0 } : null));
|
|
1087
1087
|
} else
|
|
1088
|
-
a(
|
|
1088
|
+
a(o ? { name: o, documentId: 0 } : null);
|
|
1089
1089
|
} catch {
|
|
1090
|
-
a(
|
|
1090
|
+
a(o ? { name: o, documentId: 0 } : null);
|
|
1091
1091
|
}
|
|
1092
|
-
}, [e,
|
|
1092
|
+
}, [e, o]);
|
|
1093
1093
|
return O(() => {
|
|
1094
|
-
|
|
1095
|
-
const
|
|
1096
|
-
return () => clearInterval(
|
|
1097
|
-
}, [
|
|
1098
|
-
}
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
label: r,
|
|
1102
|
-
help: a,
|
|
1103
|
-
className: c = ""
|
|
1104
|
-
}) {
|
|
1105
|
-
const [s, l] = _(!1), { control: o } = W(), { field: n } = T({ name: e, control: o }), { attachment: g, sync: m } = Je(e), { bridge: u, toast: v } = (() => {
|
|
1106
|
-
var h;
|
|
1094
|
+
c();
|
|
1095
|
+
const s = setInterval(c, 2e3);
|
|
1096
|
+
return () => clearInterval(s);
|
|
1097
|
+
}, [c]), { attachment: r, sync: c };
|
|
1098
|
+
}, Ze = ({ name: e, label: r, help: a }) => {
|
|
1099
|
+
const [l, o] = _(!1), { control: c } = W(), { field: s } = I({ name: e, control: c }), { attachment: n, sync: h } = Je(e), u = () => {
|
|
1100
|
+
var k;
|
|
1107
1101
|
try {
|
|
1108
1102
|
const p = window.top;
|
|
1109
1103
|
return {
|
|
1110
1104
|
bridge: p.__REACT_ATTACHMENT_BRIDGE__,
|
|
1111
|
-
toast: (
|
|
1105
|
+
toast: (k = p.FLUIGC) == null ? void 0 : k.toast
|
|
1112
1106
|
};
|
|
1113
1107
|
} catch {
|
|
1114
1108
|
return { bridge: null, toast: null };
|
|
1115
1109
|
}
|
|
1116
|
-
}
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1110
|
+
}, m = S(() => {
|
|
1111
|
+
const k = document.createElement("input");
|
|
1112
|
+
k.type = "file", k.onchange = (p) => {
|
|
1113
|
+
const b = p.target.files[0];
|
|
1114
|
+
if (!b) return;
|
|
1115
|
+
const { bridge: f, toast: x } = u();
|
|
1116
|
+
o(!0), f ? f.upload(b, e, (P) => {
|
|
1117
|
+
s.onChange(P.name), setTimeout(() => {
|
|
1118
|
+
o(!1), h();
|
|
1119
|
+
}, 1e3), x && x({
|
|
1120
|
+
title: "Sucesso",
|
|
1121
|
+
message: "Arquivo enviado",
|
|
1122
|
+
type: "success"
|
|
1123
|
+
});
|
|
1124
|
+
}) : (s.onChange(b.name), o(!1));
|
|
1125
|
+
}, k.click();
|
|
1126
|
+
}, [e, s, h]), w = (k) => {
|
|
1127
|
+
k.stopPropagation();
|
|
1128
|
+
const p = (n == null ? void 0 : n.name) || s.value;
|
|
1129
|
+
if (!p) return;
|
|
1130
|
+
const { bridge: b, toast: f } = u();
|
|
1131
|
+
b ? b.removeByFileName(p) ? (s.onChange(""), h(), f && f({
|
|
1128
1132
|
title: "Sucesso",
|
|
1129
1133
|
message: "Anexo removido",
|
|
1130
1134
|
type: "success"
|
|
1131
|
-
})) :
|
|
1135
|
+
})) : f && f({
|
|
1132
1136
|
title: "Erro",
|
|
1133
|
-
message: "
|
|
1137
|
+
message: "Erro ao remover anexo",
|
|
1134
1138
|
type: "danger"
|
|
1135
|
-
}) :
|
|
1136
|
-
};
|
|
1137
|
-
return /* @__PURE__ */
|
|
1139
|
+
}) : (s.onChange(""), h());
|
|
1140
|
+
}, y = !!n && !l;
|
|
1141
|
+
return /* @__PURE__ */ g("div", { className: "form-group", children: [
|
|
1138
1142
|
r && /* @__PURE__ */ t("label", { children: r }),
|
|
1139
|
-
/* @__PURE__ */
|
|
1143
|
+
/* @__PURE__ */ g(
|
|
1140
1144
|
"div",
|
|
1141
1145
|
{
|
|
1142
1146
|
className: "attachment-container",
|
|
@@ -1144,73 +1148,76 @@ function ht({
|
|
|
1144
1148
|
border: `1px ${y ? "solid #5cb85c" : "dashed #ccc"}`,
|
|
1145
1149
|
padding: "10px",
|
|
1146
1150
|
borderRadius: "4px",
|
|
1147
|
-
cursor: "pointer",
|
|
1148
1151
|
display: "flex",
|
|
1149
1152
|
justifyContent: "space-between",
|
|
1150
1153
|
alignItems: "center",
|
|
1151
|
-
|
|
1154
|
+
cursor: l ? "wait" : "pointer",
|
|
1155
|
+
backgroundColor: l ? "#f9f9f9" : "white"
|
|
1152
1156
|
},
|
|
1153
|
-
onClick: y ? () =>
|
|
1157
|
+
onClick: y ? () => {
|
|
1158
|
+
var k;
|
|
1159
|
+
return (k = u().bridge) == null ? void 0 : k.view(n.name);
|
|
1160
|
+
} : m,
|
|
1154
1161
|
children: [
|
|
1155
|
-
/* @__PURE__ */
|
|
1162
|
+
/* @__PURE__ */ g("span", { children: [
|
|
1156
1163
|
/* @__PURE__ */ t(
|
|
1157
1164
|
"i",
|
|
1158
1165
|
{
|
|
1159
|
-
className: `fluigicon ${
|
|
1166
|
+
className: `fluigicon ${l ? "fluigicon-loop-test" : y ? "fluigicon-file-pdf" : "fluigicon-paperclip"}`
|
|
1160
1167
|
}
|
|
1161
1168
|
),
|
|
1162
|
-
|
|
1169
|
+
l ? " Enviando..." : y ? ` ${n.name}` : ` ${a || "Anexar"}`
|
|
1163
1170
|
] }),
|
|
1164
1171
|
y && /* @__PURE__ */ t(
|
|
1165
1172
|
"button",
|
|
1166
1173
|
{
|
|
1167
1174
|
type: "button",
|
|
1168
1175
|
className: "btn btn-link text-danger",
|
|
1169
|
-
onClick:
|
|
1176
|
+
onClick: w,
|
|
1170
1177
|
children: /* @__PURE__ */ t("i", { className: "fluigicon fluigicon-trash" })
|
|
1171
1178
|
}
|
|
1172
1179
|
)
|
|
1173
1180
|
]
|
|
1174
1181
|
}
|
|
1175
1182
|
),
|
|
1176
|
-
/* @__PURE__ */ t("input", { type: "hidden",
|
|
1183
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: e, value: s.value || "" })
|
|
1177
1184
|
] });
|
|
1178
|
-
}
|
|
1179
|
-
function
|
|
1185
|
+
}, ft = T(Ze);
|
|
1186
|
+
function gt({
|
|
1180
1187
|
items: e,
|
|
1181
1188
|
time: r = 0,
|
|
1182
1189
|
showNavigation: a = !0,
|
|
1183
|
-
progressBar:
|
|
1190
|
+
progressBar: l = !0
|
|
1184
1191
|
}) {
|
|
1185
|
-
const [
|
|
1186
|
-
|
|
1187
|
-
}, [e.length]),
|
|
1188
|
-
|
|
1192
|
+
const [o, c] = _(0), [s, n] = _(0), h = B(null), u = B(null), m = S(() => {
|
|
1193
|
+
c((b) => (b + 1) % e.length), n(0);
|
|
1194
|
+
}, [e.length]), w = S(() => {
|
|
1195
|
+
c((b) => (b - 1 + e.length) % e.length), n(0);
|
|
1189
1196
|
}, [e.length]);
|
|
1190
1197
|
if (O(() => {
|
|
1191
1198
|
if (r > 0 && e.length > 1) {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1194
|
-
n((
|
|
1199
|
+
const f = 100 / r * 100;
|
|
1200
|
+
h.current = setInterval(m, r), u.current = setInterval(() => {
|
|
1201
|
+
n((x) => x >= 100 ? 0 : x + f);
|
|
1195
1202
|
}, 100);
|
|
1196
1203
|
}
|
|
1197
1204
|
return () => {
|
|
1198
|
-
|
|
1205
|
+
h.current && clearInterval(h.current), u.current && clearInterval(u.current);
|
|
1199
1206
|
};
|
|
1200
|
-
}, [r,
|
|
1201
|
-
const y = e[
|
|
1202
|
-
return /* @__PURE__ */
|
|
1203
|
-
/* @__PURE__ */
|
|
1204
|
-
a && e.length > 1 && /* @__PURE__ */
|
|
1205
|
-
/* @__PURE__ */ t("button", { className: "nav-btn prev", onClick:
|
|
1206
|
-
/* @__PURE__ */ t("button", { className: "nav-btn next", onClick:
|
|
1207
|
+
}, [r, m, e.length, o]), !e || e.length === 0) return null;
|
|
1208
|
+
const y = e[o], k = typeof y == "string" ? y : y.url, p = /\.(jpg|jpeg|png|gif|webp)$/i.test(k);
|
|
1209
|
+
return /* @__PURE__ */ g("div", { className: "carousel-root", children: [
|
|
1210
|
+
/* @__PURE__ */ g("div", { className: "carousel-viewport", children: [
|
|
1211
|
+
a && e.length > 1 && /* @__PURE__ */ g(U, { children: [
|
|
1212
|
+
/* @__PURE__ */ t("button", { className: "nav-btn prev", onClick: w, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-left" }) }),
|
|
1213
|
+
/* @__PURE__ */ t("button", { className: "nav-btn next", onClick: m, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-right" }) })
|
|
1207
1214
|
] }),
|
|
1208
|
-
/* @__PURE__ */ t("div", { className: "carousel-media", children:
|
|
1215
|
+
/* @__PURE__ */ t("div", { className: "carousel-media", children: p ? /* @__PURE__ */ t("img", { src: k, alt: "Slide", className: "carousel-image" }) : /* @__PURE__ */ g("div", { className: "carousel-file-fallback", children: [
|
|
1209
1216
|
/* @__PURE__ */ t("i", { className: "flaticon flaticon-file icon-xl" }),
|
|
1210
1217
|
/* @__PURE__ */ t(
|
|
1211
1218
|
"a",
|
|
1212
1219
|
{
|
|
1213
|
-
href:
|
|
1220
|
+
href: k,
|
|
1214
1221
|
target: "_blank",
|
|
1215
1222
|
rel: "noreferrer",
|
|
1216
1223
|
className: "btn-open",
|
|
@@ -1218,40 +1225,40 @@ function ft({
|
|
|
1218
1225
|
}
|
|
1219
1226
|
)
|
|
1220
1227
|
] }) }),
|
|
1221
|
-
e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-dots", children: e.map((
|
|
1228
|
+
e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-dots", children: e.map((b, f) => /* @__PURE__ */ t(
|
|
1222
1229
|
"div",
|
|
1223
1230
|
{
|
|
1224
|
-
className: `dot ${
|
|
1231
|
+
className: `dot ${f === o ? "active" : ""}`,
|
|
1225
1232
|
onClick: () => {
|
|
1226
|
-
|
|
1233
|
+
c(f), n(0);
|
|
1227
1234
|
}
|
|
1228
1235
|
},
|
|
1229
|
-
|
|
1236
|
+
f
|
|
1230
1237
|
)) })
|
|
1231
1238
|
] }),
|
|
1232
|
-
|
|
1239
|
+
l && r > 0 && e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-progress-container", children: /* @__PURE__ */ t(
|
|
1233
1240
|
"div",
|
|
1234
1241
|
{
|
|
1235
1242
|
className: "carousel-progress-bar",
|
|
1236
|
-
style: { width: `${
|
|
1243
|
+
style: { width: `${s}%` }
|
|
1237
1244
|
}
|
|
1238
1245
|
) })
|
|
1239
1246
|
] });
|
|
1240
1247
|
}
|
|
1241
|
-
function
|
|
1248
|
+
function pt({
|
|
1242
1249
|
title: e,
|
|
1243
1250
|
isOpen: r,
|
|
1244
1251
|
onOpen: a,
|
|
1245
|
-
onClose:
|
|
1246
|
-
content:
|
|
1247
|
-
footer:
|
|
1248
|
-
width:
|
|
1252
|
+
onClose: l,
|
|
1253
|
+
content: o,
|
|
1254
|
+
footer: c,
|
|
1255
|
+
width: s
|
|
1249
1256
|
}) {
|
|
1250
1257
|
const n = S(
|
|
1251
|
-
(
|
|
1252
|
-
|
|
1258
|
+
(h) => {
|
|
1259
|
+
h.key === "Escape" && l();
|
|
1253
1260
|
},
|
|
1254
|
-
[
|
|
1261
|
+
[l]
|
|
1255
1262
|
);
|
|
1256
1263
|
return O(() => (r && (document.addEventListener("keydown", n), a == null || a(), document.body.style.overflow = "hidden"), () => {
|
|
1257
1264
|
document.removeEventListener("keydown", n), document.body.style.overflow = "auto";
|
|
@@ -1259,23 +1266,23 @@ function gt({
|
|
|
1259
1266
|
"div",
|
|
1260
1267
|
{
|
|
1261
1268
|
className: "modal-overlay",
|
|
1262
|
-
onClick:
|
|
1269
|
+
onClick: l,
|
|
1263
1270
|
"aria-modal": "true",
|
|
1264
1271
|
role: "dialog",
|
|
1265
|
-
children: /* @__PURE__ */
|
|
1272
|
+
children: /* @__PURE__ */ g(
|
|
1266
1273
|
"div",
|
|
1267
1274
|
{
|
|
1268
|
-
style: { maxWidth:
|
|
1275
|
+
style: { maxWidth: s },
|
|
1269
1276
|
className: "modal-container",
|
|
1270
|
-
onClick: (
|
|
1277
|
+
onClick: (h) => h.stopPropagation(),
|
|
1271
1278
|
children: [
|
|
1272
|
-
/* @__PURE__ */
|
|
1279
|
+
/* @__PURE__ */ g("div", { className: "modal-header", children: [
|
|
1273
1280
|
/* @__PURE__ */ t("h3", { children: e }),
|
|
1274
1281
|
/* @__PURE__ */ t(
|
|
1275
1282
|
"div",
|
|
1276
1283
|
{
|
|
1277
1284
|
className: "btn-close-modal",
|
|
1278
|
-
onClick:
|
|
1285
|
+
onClick: l,
|
|
1279
1286
|
role: "button",
|
|
1280
1287
|
"aria-label": "Fechar modal",
|
|
1281
1288
|
children: /* @__PURE__ */ t(
|
|
@@ -1288,66 +1295,66 @@ function gt({
|
|
|
1288
1295
|
}
|
|
1289
1296
|
)
|
|
1290
1297
|
] }),
|
|
1291
|
-
/* @__PURE__ */ t("div", { className: "modal-content", children:
|
|
1292
|
-
|
|
1298
|
+
/* @__PURE__ */ t("div", { className: "modal-content", children: o }),
|
|
1299
|
+
c && /* @__PURE__ */ t("div", { className: "modal-footer", children: c })
|
|
1293
1300
|
]
|
|
1294
1301
|
}
|
|
1295
1302
|
)
|
|
1296
1303
|
}
|
|
1297
1304
|
) : null;
|
|
1298
1305
|
}
|
|
1299
|
-
function
|
|
1306
|
+
function bt({
|
|
1300
1307
|
logo: e,
|
|
1301
1308
|
childs: r,
|
|
1302
1309
|
footer: a,
|
|
1303
|
-
contentExternal:
|
|
1304
|
-
bg:
|
|
1305
|
-
color:
|
|
1306
|
-
onSelect:
|
|
1310
|
+
contentExternal: l,
|
|
1311
|
+
bg: o,
|
|
1312
|
+
color: c,
|
|
1313
|
+
onSelect: s
|
|
1307
1314
|
}) {
|
|
1308
|
-
return /* @__PURE__ */
|
|
1309
|
-
/* @__PURE__ */
|
|
1315
|
+
return /* @__PURE__ */ g("div", { className: "main-container dfea", children: [
|
|
1316
|
+
/* @__PURE__ */ g("div", { className: "sidebar-wrapper", style: { backgroundColor: `${o}` }, children: [
|
|
1310
1317
|
e && /* @__PURE__ */ t("div", { className: "sidebar-logo", children: /* @__PURE__ */ t("img", { src: e, alt: "", width: "auto", height: "28px" }) }),
|
|
1311
1318
|
/* @__PURE__ */ t("ul", { className: "sidebar-childs-content", children: r == null ? void 0 : r.map(
|
|
1312
1319
|
(n) => {
|
|
1313
|
-
var
|
|
1314
|
-
return n != null && n.options && ((
|
|
1315
|
-
/* @__PURE__ */
|
|
1320
|
+
var h, u;
|
|
1321
|
+
return n != null && n.options && ((h = n == null ? void 0 : n.options) == null ? void 0 : h.length) > 0 ? /* @__PURE__ */ t(U, { children: /* @__PURE__ */ g("ul", { className: "sidebar-child sidebar-options-content", children: [
|
|
1322
|
+
/* @__PURE__ */ g(
|
|
1316
1323
|
"li",
|
|
1317
1324
|
{
|
|
1318
1325
|
className: "sidebar-child",
|
|
1319
1326
|
onClick: () => {
|
|
1320
|
-
var
|
|
1321
|
-
(
|
|
1327
|
+
var m;
|
|
1328
|
+
(m = n.action) == null || m.call(n), s == null || s(n.id);
|
|
1322
1329
|
},
|
|
1323
|
-
style: { color: `${
|
|
1330
|
+
style: { color: `${c}` },
|
|
1324
1331
|
children: [
|
|
1325
1332
|
n.icon && /* @__PURE__ */ t("i", { className: n.icon }),
|
|
1326
1333
|
n.label
|
|
1327
1334
|
]
|
|
1328
1335
|
}
|
|
1329
1336
|
),
|
|
1330
|
-
(
|
|
1337
|
+
(u = n.options) == null ? void 0 : u.map((m) => /* @__PURE__ */ t(
|
|
1331
1338
|
"li",
|
|
1332
1339
|
{
|
|
1333
1340
|
className: "sidebar-option",
|
|
1334
1341
|
onClick: () => {
|
|
1335
|
-
var
|
|
1336
|
-
(
|
|
1342
|
+
var w;
|
|
1343
|
+
(w = m.action) == null || w.call(m), s == null || s(m.id);
|
|
1337
1344
|
},
|
|
1338
|
-
style: { color: `${
|
|
1339
|
-
children:
|
|
1345
|
+
style: { color: `${c}` },
|
|
1346
|
+
children: m.label
|
|
1340
1347
|
}
|
|
1341
1348
|
))
|
|
1342
|
-
] }) }) : /* @__PURE__ */
|
|
1349
|
+
] }) }) : /* @__PURE__ */ g(
|
|
1343
1350
|
"li",
|
|
1344
1351
|
{
|
|
1345
1352
|
className: "sidebar-child",
|
|
1346
1353
|
onClick: () => {
|
|
1347
|
-
var
|
|
1348
|
-
(
|
|
1354
|
+
var m;
|
|
1355
|
+
(m = n.action) == null || m.call(n), s == null || s(n.id);
|
|
1349
1356
|
},
|
|
1350
|
-
style: { color: `${
|
|
1357
|
+
style: { color: `${c}` },
|
|
1351
1358
|
children: [
|
|
1352
1359
|
n.icon && /* @__PURE__ */ t("i", { className: n.icon }),
|
|
1353
1360
|
n.label
|
|
@@ -1358,20 +1365,20 @@ function pt({
|
|
|
1358
1365
|
) }),
|
|
1359
1366
|
a && /* @__PURE__ */ t("div", { className: "sidebar-footer", children: a })
|
|
1360
1367
|
] }),
|
|
1361
|
-
/* @__PURE__ */ t("div", { className: "sidebar-content-external", children:
|
|
1368
|
+
/* @__PURE__ */ t("div", { className: "sidebar-content-external", children: l })
|
|
1362
1369
|
] });
|
|
1363
1370
|
}
|
|
1364
1371
|
export {
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1372
|
+
ft as Attachment,
|
|
1373
|
+
gt as Carousel,
|
|
1374
|
+
lt as Checkbox,
|
|
1375
|
+
ut as DatePicker,
|
|
1376
|
+
ot as Input,
|
|
1377
|
+
pt as Modal,
|
|
1378
|
+
ct as RadioBtn,
|
|
1379
|
+
it as Select,
|
|
1380
|
+
bt as Sidebar,
|
|
1381
|
+
ht as SimpleTable,
|
|
1382
|
+
mt as StatusBadge,
|
|
1383
|
+
dt as TextArea
|
|
1377
1384
|
};
|