@tech-diefra/fluig-ui 1.2.30 → 1.2.31

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