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