@tech-diefra/fluig-ui 1.2.25 → 1.2.27

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