@tech-diefra/fluig-ui 1.2.28 → 1.2.30

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,8 +1,8 @@
1
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";
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
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 M } from "@fluig-kit/ecm";
5
+ import { useSection as E, useFluigRuntime as j } from "@fluig-kit/ecm";
6
6
  import ne, { registerLocale as ae } from "react-datepicker";
7
7
  import { parse as re, isValid as se, format as ie } from "date-fns";
8
8
  const oe = {
@@ -16,225 +16,225 @@ function le({
16
16
  label: r = "",
17
17
  placeholder: a = "",
18
18
  type: c = "text",
19
- mask: i,
19
+ mask: o,
20
20
  className: l = "",
21
21
  forceReadOnly: s = !1,
22
22
  forceHidden: n = !1
23
23
  }) {
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, "");
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
30
  return (Number(d) / 100).toLocaleString("pt-BR", {
31
31
  style: "currency",
32
32
  currency: "BRL"
33
33
  });
34
- }, []), f = $(
35
- (o) => c === "monetary" ? x(o) : o,
36
- [c, x]
34
+ }, []), h = S(
35
+ (i) => c === "monetary" ? P(i) : i,
36
+ [c, P]
37
37
  );
38
- return P ? /* @__PURE__ */ g("div", { className: "form-group", children: [
38
+ return R ? /* @__PURE__ */ g("div", { className: "form-group", children: [
39
39
  /* @__PURE__ */ t("label", { children: r }),
40
- /* @__PURE__ */ t("span", { className: "form-control", children: p.value || "-" })
41
- ] }) : /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
40
+ /* @__PURE__ */ t("span", { className: "form-control", children: w.value || "-" })
41
+ ] }) : /* @__PURE__ */ g("div", { className: `form-group ${y ? "hidden" : ""}`, children: [
42
42
  /* @__PURE__ */ t("label", { children: r }),
43
- v ? /* @__PURE__ */ t(
43
+ C ? /* @__PURE__ */ t(
44
44
  te,
45
45
  {
46
46
  name: e,
47
- mask: v,
48
- value: String(p.value ?? ""),
47
+ mask: C,
48
+ value: String(w.value ?? ""),
49
49
  unmask: !1,
50
- onAccept: (o) => p.onChange(f(o)),
50
+ onAccept: (i) => w.onChange(h(i)),
51
51
  placeholder: a,
52
- readOnly: h,
53
- className: `form-control ${N ? "border-red" : ""} ${l}`,
54
- inputRef: p.ref,
55
- onBlur: p.onBlur
52
+ readOnly: m,
53
+ className: `form-control ${p ? "border-red" : ""} ${l}`,
54
+ inputRef: w.ref,
55
+ onBlur: w.onBlur
56
56
  }
57
57
  ) : /* @__PURE__ */ t(
58
58
  "input",
59
59
  {
60
- ...p,
60
+ ...w,
61
61
  type: "text",
62
- value: p.value ?? "",
63
- onChange: (o) => p.onChange(f(o.target.value)),
62
+ value: w.value ?? "",
63
+ onChange: (i) => w.onChange(h(i.target.value)),
64
64
  placeholder: a,
65
- readOnly: h,
66
- className: `form-control ${N ? "border-red" : ""} ${l}`
65
+ readOnly: m,
66
+ className: `form-control ${p ? "border-red" : ""} ${l}`
67
67
  }
68
68
  ),
69
- N && /* @__PURE__ */ t("p", { className: "text-danger", children: String(N.message) })
69
+ p && /* @__PURE__ */ t("p", { className: "text-danger", children: String(p.message) })
70
70
  ] });
71
71
  }
72
- const it = T(le);
72
+ const it = O(le);
73
73
  function ce({
74
74
  name: e,
75
75
  label: r = "",
76
76
  options: a = [],
77
77
  placeholder: c = "",
78
- labelKey: i = "label",
78
+ labelKey: o = "label",
79
79
  valueKey: l = "value",
80
80
  enableSearch: s = !1,
81
81
  searchPlaceholder: n = "Buscar...",
82
- loading: m = !1,
82
+ loading: b = !1,
83
83
  onSearchChange: u,
84
- debounceTime: h = 300,
85
- onSelect: w,
86
- forceReadOnly: C = !1,
87
- forceHidden: P = !1
84
+ debounceTime: m = 300,
85
+ onSelect: y,
86
+ forceReadOnly: k = !1,
87
+ forceHidden: R = !1
88
88
  }) {
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 }
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
92
  } = I({
93
93
  name: e,
94
- control: x
95
- }), [_, A] = D(!1), [V, G] = D(""), L = B(null), z = B(u);
96
- O(() => {
94
+ control: P
95
+ }), [$, A] = M(!1), [V, G] = M(""), L = B(null), z = B(u);
96
+ D(() => {
97
97
  z.current = u;
98
- }, [u]), O(() => {
99
- const R = (F) => {
98
+ }, [u]), D(() => {
99
+ const x = (F) => {
100
100
  L.current && !L.current.contains(F.target) && A(!1);
101
101
  };
102
- return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
103
- }, []), O(() => {
104
- _ || G("");
105
- }, [_]), O(() => {
102
+ return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
103
+ }, []), D(() => {
104
+ $ || G("");
105
+ }, [$]), D(() => {
106
106
  if (!s) return;
107
- const R = setTimeout(() => {
107
+ const x = setTimeout(() => {
108
108
  z.current && z.current(V);
109
- }, h);
110
- return () => clearTimeout(R);
111
- }, [V, s, h]);
112
- const Q = j(() => s && !u && V.trim() ? a.filter(
113
- (R) => String((R == null ? void 0 : R[i]) ?? "").toLowerCase().includes(V.toLowerCase())
114
- ) : a ?? [], [a, s, u, V, 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)
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)
120
120
  );
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), A(!1));
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));
124
124
  };
125
125
  return /* @__PURE__ */ g(
126
126
  "div",
127
127
  {
128
- className: `select-wrapper form-group ${v ? "hidden" : ""}`,
128
+ className: `select-wrapper form-group ${C ? "hidden" : ""}`,
129
129
  ref: L,
130
130
  children: [
131
131
  /* @__PURE__ */ t("label", { className: "control-label", children: r }),
132
- o ? /* @__PURE__ */ t("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */ g(U, { children: [
132
+ i ? /* @__PURE__ */ t("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */ g(U, { children: [
133
133
  /* @__PURE__ */ g(
134
134
  "div",
135
135
  {
136
- className: `select-control ${k ? "border-red" : ""} ${N ? "readOnly" : ""}`,
137
- onClick: () => !N && A((R) => !R),
138
- ref: S,
136
+ className: `select-control ${N ? "border-red" : ""} ${p ? "readOnly" : ""}`,
137
+ onClick: () => !p && A((x) => !x),
138
+ ref: _,
139
139
  children: [
140
- /* @__PURE__ */ t("span", { className: `select-display ${N ? "readOnly" : ""}`, children: J || c }),
140
+ /* @__PURE__ */ t("span", { className: `select-display ${p ? "readOnly" : ""}`, children: J || c }),
141
141
  /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-down select-icon" })
142
142
  ]
143
143
  }
144
144
  ),
145
- _ && !N && /* @__PURE__ */ g("div", { className: "select-dropdown", children: [
145
+ $ && !p && /* @__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
151
  value: V,
152
- onChange: (R) => G(R.target.value),
153
- placeholder: m ? "Carregando..." : n,
152
+ onChange: (x) => G(x.target.value),
153
+ placeholder: b ? "Carregando..." : n,
154
154
  autoFocus: !0,
155
- onClick: (R) => R.stopPropagation()
155
+ onClick: (x) => x.stopPropagation()
156
156
  }
157
157
  ) }),
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(
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(
159
159
  "li",
160
160
  {
161
- onClick: () => Z(R),
161
+ onClick: () => Z(x),
162
162
  className: "select-option handleHover",
163
- children: R[i]
163
+ children: x[o]
164
164
  },
165
- R[l]
165
+ x[l]
166
166
  )) : /* @__PURE__ */ t("li", { className: "select-option readOnly", children: "Sem resultados" }) })
167
167
  ] })
168
168
  ] }),
169
- /* @__PURE__ */ t("input", { type: "hidden", name: e, value: b || "" }),
170
- k && /* @__PURE__ */ t("p", { className: "text-danger", children: String(k.message) })
169
+ /* @__PURE__ */ t("input", { type: "hidden", name: e, value: f || "" }),
170
+ N && /* @__PURE__ */ t("p", { className: "text-danger", children: String(N.message) })
171
171
  ]
172
172
  }
173
173
  );
174
174
  }
175
- const ot = T(ce);
175
+ const ot = O(ce);
176
176
  function lt({
177
177
  name: e,
178
178
  options: r = [],
179
179
  label: a = "",
180
180
  valueKey: c = "value",
181
- labelKey: i = "label",
181
+ labelKey: o = "label",
182
182
  forceReadOnly: l = !1,
183
183
  forceHidden: s = !1
184
184
  }) {
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;
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
187
  if (!n || !e)
188
188
  return console.error("Checkbox requer contexto de formulário e nome."), null;
189
- const v = () => !r || !n ? {} : r.reduce((k, _) => {
190
- const A = _[c], V = n.getValues(A);
191
- return k[A] = V === "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, {
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, {
196
196
  shouldDirty: !1,
197
197
  shouldValidate: !1
198
198
  });
199
- }, [f, e, n]);
200
- const o = (k, _) => {
201
- if (N) return;
202
- const A = { ...f, [k]: _ };
199
+ }, [h, e, n]);
200
+ const i = (N, $) => {
201
+ if (p) return;
202
+ const A = { ...h, [N]: $ };
203
203
  n.setValue(e, A, {
204
204
  shouldDirty: !0,
205
205
  shouldValidate: !0
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: [
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: [
209
209
  a && /* @__PURE__ */ t("label", { children: a }),
210
210
  /* @__PURE__ */ t(
211
211
  "div",
212
212
  {
213
- className: `checkbox-group-custom ${N ? "readOnly" : ""}`,
214
- children: r.map((k) => {
215
- const _ = String(k[c]), A = f[_] === !0;
213
+ className: `checkbox-group-custom ${p ? "readOnly" : ""}`,
214
+ children: r.map((N) => {
215
+ const $ = String(N[c]), A = h[$] === !0;
216
216
  return /* @__PURE__ */ g("div", { children: [
217
- /* @__PURE__ */ t("input", { type: "hidden", ...n.register(_) }),
217
+ /* @__PURE__ */ t("input", { type: "hidden", ...n.register($) }),
218
218
  /* @__PURE__ */ g(
219
219
  "label",
220
220
  {
221
- className: `custom-checkbox ${A ? "checked" : ""} ${N ? "readOnly" : ""}`,
221
+ className: `custom-checkbox ${A ? "checked" : ""} ${p ? "readOnly" : ""}`,
222
222
  children: [
223
223
  /* @__PURE__ */ t(
224
224
  "input",
225
225
  {
226
226
  type: "checkbox",
227
227
  checked: A,
228
- disabled: N,
229
- onChange: (V) => o(_, V.target.checked)
228
+ disabled: p,
229
+ onChange: (V) => i($, V.target.checked)
230
230
  }
231
231
  ),
232
232
  /* @__PURE__ */ t("span", { className: "checkmark" }),
233
- /* @__PURE__ */ t("span", { children: k[i] })
233
+ /* @__PURE__ */ t("span", { children: N[o] })
234
234
  ]
235
235
  }
236
236
  )
237
- ] }, _);
237
+ ] }, $);
238
238
  })
239
239
  }
240
240
  ),
@@ -246,38 +246,38 @@ function de({
246
246
  label: r = "",
247
247
  options: a = [],
248
248
  valueKey: c = "value",
249
- labelKey: i = "label",
249
+ labelKey: o = "label",
250
250
  iconKey: l = "icon",
251
251
  forceReadOnly: s = !1,
252
252
  forceHidden: n = !1
253
253
  }) {
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 }
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
257
  } = I({
258
258
  name: e,
259
- control: C
260
- }), v = h || p || P, x = y.value ?? "", f = $(
261
- (o) => {
262
- v || y.onChange(o);
259
+ control: k
260
+ }), C = m || w || R, P = v.value ?? "", h = S(
261
+ (i) => {
262
+ C || v.onChange(i);
263
263
  },
264
- [v, y]
264
+ [C, v]
265
265
  );
266
- return /* @__PURE__ */ g("div", { className: `form-group column ${w ? "hidden" : ""}`, children: [
266
+ return /* @__PURE__ */ g("div", { className: `form-group column ${y ? "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 ${v ? "view-mode" : ""}`,
271
+ className: `btn-group ${C ? "view-mode" : ""}`,
272
272
  "data-field-name": e,
273
- children: a.map((o) => {
274
- const d = o[c], b = x === d, S = o.color ? { "--customColor": o.color } : void 0;
273
+ children: a.map((i) => {
274
+ const d = i[c], f = P === d, _ = i.color ? { "--customColor": i.color } : void 0;
275
275
  return /* @__PURE__ */ g(
276
276
  "label",
277
277
  {
278
278
  htmlFor: `${e}_${d}`,
279
- style: S,
280
- className: `btn fs-ellipsis ${b ? "active" : ""}`,
279
+ style: _,
280
+ className: `btn fs-ellipsis ${f ? "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: b,
289
+ checked: f,
290
290
  className: "hidden",
291
- onChange: () => f(d),
292
- disabled: v
291
+ onChange: () => h(d),
292
+ disabled: C
293
293
  }
294
294
  ),
295
- o[l] && /* @__PURE__ */ t("i", { className: `${o[l]} icon-sm` }),
295
+ i[l] && /* @__PURE__ */ t("i", { className: `${i[l]} icon-sm` }),
296
296
  " ",
297
- o[i]
297
+ i[o]
298
298
  ]
299
299
  },
300
300
  d
@@ -302,46 +302,46 @@ function de({
302
302
  })
303
303
  }
304
304
  ),
305
- N && /* @__PURE__ */ t("p", { className: "text-danger", children: String(N.message) })
305
+ p && /* @__PURE__ */ t("p", { className: "text-danger", children: String(p.message) })
306
306
  ] });
307
307
  }
308
- const ct = T(de), ue = ({
308
+ const ct = O(de), ue = ({
309
309
  name: e,
310
310
  label: r = "",
311
311
  placeholder: a = "",
312
312
  className: c = "",
313
- rows: i = 4,
313
+ rows: o = 4,
314
314
  maxLength: l,
315
315
  forceReadOnly: s = !1,
316
316
  forceHidden: n = !1
317
317
  }) => {
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 }
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
321
  } = I({
322
322
  name: e,
323
- control: C
323
+ control: k
324
324
  });
325
- return P ? /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
325
+ return R ? /* @__PURE__ */ g("div", { className: `form-group ${y ? "hidden" : ""}`, children: [
326
326
  /* @__PURE__ */ t("label", { children: r }),
327
- /* @__PURE__ */ t("span", { className: "form-control", children: p.value || "-" })
328
- ] }) : /* @__PURE__ */ g("div", { className: `form-group ${w ? "hidden" : ""}`, children: [
327
+ /* @__PURE__ */ t("span", { className: "form-control", children: w.value || "-" })
328
+ ] }) : /* @__PURE__ */ g("div", { className: `form-group ${y ? "hidden" : ""}`, children: [
329
329
  /* @__PURE__ */ t("label", { children: r }),
330
330
  /* @__PURE__ */ t(
331
331
  "textarea",
332
332
  {
333
- ...p,
334
- rows: i,
333
+ ...w,
334
+ rows: o,
335
335
  maxLength: l,
336
- value: p.value || "",
336
+ value: w.value || "",
337
337
  placeholder: a,
338
- readOnly: h,
339
- className: `form-control ${y ? "border-red" : ""} ${c}`
338
+ readOnly: m,
339
+ className: `form-control ${v ? "border-red" : ""} ${c}`
340
340
  }
341
341
  ),
342
- y && /* @__PURE__ */ t("p", { className: "text-danger", children: String(y.message) })
342
+ v && /* @__PURE__ */ t("p", { className: "text-danger", children: String(v.message) })
343
343
  ] });
344
- }, dt = T(ue);
344
+ }, dt = O(ue);
345
345
  function X(e) {
346
346
  return (r = {}) => {
347
347
  const a = r.width ? String(r.width) : e.defaultWidth;
@@ -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 i;
354
+ let o;
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
- i = e.formattingValues[n] || e.formattingValues[s];
357
+ o = 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
- i = e.values[n] || e.values[s];
360
+ o = e.values[n] || e.values[s];
361
361
  }
362
362
  const l = e.argumentCallback ? e.argumentCallback(r) : r;
363
- return i[l];
363
+ return o[l];
364
364
  };
365
365
  }
366
366
  function q(e) {
367
367
  return (r, a = {}) => {
368
- const c = a.width, i = c && e.matchPatterns[c] || e.matchPatterns[e.defaultMatchWidth], l = r.match(i);
368
+ const c = a.width, o = c && e.matchPatterns[c] || e.matchPatterns[e.defaultMatchWidth], l = r.match(o);
369
369
  if (!l)
370
370
  return null;
371
- const s = l[0], n = c && e.parsePatterns[c] || e.parsePatterns[e.defaultParseWidth], m = Array.isArray(n) ? he(n, (w) => w.test(s)) : (
371
+ const s = l[0], n = c && e.parsePatterns[c] || e.parsePatterns[e.defaultParseWidth], b = Array.isArray(n) ? he(n, (y) => y.test(s)) : (
372
372
  // [TODO] -- I challenge you to fix the type
373
- me(n, (w) => w.test(s))
373
+ me(n, (y) => y.test(s))
374
374
  );
375
375
  let u;
376
- u = e.valueCallback ? e.valueCallback(m) : m, u = a.valueCallback ? (
376
+ u = e.valueCallback ? e.valueCallback(b) : b, u = a.valueCallback ? (
377
377
  // [TODO] -- I challenge you to fix the type
378
378
  a.valueCallback(u)
379
379
  ) : u;
380
- const h = r.slice(s.length);
381
- return { value: u, rest: h };
380
+ const m = r.slice(s.length);
381
+ return { value: u, rest: m };
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 i = c[0], l = r.match(e.parsePattern);
398
+ const o = 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(i.length);
402
+ const n = r.slice(o.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 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;
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
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 i = we[e];
512
- return typeof i == "function" ? i(r) : i;
511
+ const o = we[e];
512
+ return typeof o == "function" ? o(r) : o;
513
513
  }, Ce = {
514
514
  narrow: ["AC", "DC"],
515
515
  abbreviated: ["AC", "DC"],
@@ -659,20 +659,20 @@ const ge = {
659
659
  formattingValues: $e,
660
660
  defaultFormattingWidth: "wide"
661
661
  })
662
- }, Ve = /^(\d+)[ºªo]?/i, Oe = /\d+/i, We = {
662
+ }, Ve = /^(\d+)[ºªo]?/i, De = /\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
- }, De = {
666
+ }, Me = {
667
667
  any: [/^ac/i, /^dc/i],
668
668
  wide: [/^antes de cristo/i, /^depois de cristo/i]
669
- }, Me = {
669
+ }, je = {
670
670
  narrow: /^[1234]/i,
671
671
  abbreviated: /^T[1234]/i,
672
672
  wide: /^[1234](º)? trimestre/i
673
- }, je = {
674
- any: [/1/i, /2/i, /3/i, /4/i]
675
673
  }, Te = {
674
+ any: [/1/i, /2/i, /3/i, /4/i]
675
+ }, Oe = {
676
676
  narrow: /^[jfmajsond]/i,
677
677
  abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
678
678
  wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
@@ -731,24 +731,24 @@ const ge = {
731
731
  }, Be = {
732
732
  ordinalNumber: fe({
733
733
  matchPattern: Ve,
734
- parsePattern: Oe,
734
+ parsePattern: De,
735
735
  valueCallback: (e) => parseInt(e, 10)
736
736
  }),
737
737
  era: q({
738
738
  matchPatterns: We,
739
739
  defaultMatchWidth: "wide",
740
- parsePatterns: De,
740
+ parsePatterns: Me,
741
741
  defaultParseWidth: "any"
742
742
  }),
743
743
  quarter: q({
744
- matchPatterns: Me,
744
+ matchPatterns: je,
745
745
  defaultMatchWidth: "wide",
746
- parsePatterns: je,
746
+ parsePatterns: Te,
747
747
  defaultParseWidth: "any",
748
748
  valueCallback: (e) => e + 1
749
749
  }),
750
750
  month: q({
751
- matchPatterns: Te,
751
+ matchPatterns: Oe,
752
752
  defaultMatchWidth: "wide",
753
753
  parsePatterns: Ie,
754
754
  defaultParseWidth: "any"
@@ -783,14 +783,14 @@ const Y = "dd/MM/yyyy", ze = (e) => {
783
783
  const r = re(e, Y, /* @__PURE__ */ new Date());
784
784
  return se(r) ? r : null;
785
785
  }, Xe = (e) => e ? ie(e, Y) : "", Ue = K(
786
- ({ shimRef: e, className: r, name: a, ...c }, i) => /* @__PURE__ */ t(
786
+ ({ shimRef: e, className: r, name: a, ...c }, o) => /* @__PURE__ */ t(
787
787
  "input",
788
788
  {
789
789
  name: a,
790
790
  ...c,
791
791
  className: r,
792
792
  ref: (l) => {
793
- typeof i == "function" ? i(l) : i && (i.current = l), e && e(l);
793
+ typeof o == "function" ? o(l) : o && (o.current = l), e && e(l);
794
794
  }
795
795
  }
796
796
  )
@@ -799,177 +799,177 @@ const Y = "dd/MM/yyyy", ze = (e) => {
799
799
  label: r = "",
800
800
  placeholder: a = "dd/mm/aaaa",
801
801
  className: c = "",
802
- forceReadOnly: i = !1,
802
+ forceReadOnly: o = !1,
803
803
  forceHidden: l = !1
804
804
  }) => {
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 }
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
808
  } = I({
809
809
  name: e,
810
810
  control: s
811
- }), v = j(() => ze(p), [p]), x = $(
812
- (o) => {
813
- C(o ? Xe(o) : "");
811
+ }), C = T(() => ze(w), [w]), P = S(
812
+ (i) => {
813
+ k(i ? Xe(i) : "");
814
814
  },
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
- const S = s._fields[e];
821
- S._f.ref = {
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
822
  focus: () => {
823
- var k;
824
- return (k = o.focus) == null ? void 0 : k.call(o);
823
+ var N;
824
+ return (N = i.focus) == null ? void 0 : N.call(i);
825
825
  },
826
826
  select: () => {
827
- var k;
828
- return (k = o.select) == null ? void 0 : k.call(o);
827
+ var N;
828
+ return (N = i.select) == null ? void 0 : N.call(i);
829
829
  },
830
- setCustomValidity: (k) => {
831
- var _;
832
- return (_ = o.setCustomValidity) == null ? void 0 : _.call(o, k);
830
+ setCustomValidity: (N) => {
831
+ var $;
832
+ return ($ = i.setCustomValidity) == null ? void 0 : $.call(i, N);
833
833
  },
834
834
  reportValidity: () => {
835
- var k;
836
- return (k = o.reportValidity) == null ? void 0 : k.call(o);
835
+ var N;
836
+ return (N = i.reportValidity) == null ? void 0 : N.call(i);
837
837
  }
838
838
  };
839
839
  }
840
840
  },
841
- [y, s, e]
841
+ [v, s, e]
842
842
  );
843
- return w ? null : n ? /* @__PURE__ */ g("div", { className: "form-group", children: [
843
+ return y ? null : n ? /* @__PURE__ */ g("div", { className: "form-group", children: [
844
844
  /* @__PURE__ */ t("label", { children: r }),
845
- /* @__PURE__ */ t("span", { className: "form-control", children: p || "-" })
845
+ /* @__PURE__ */ t("span", { className: "form-control", children: w || "-" })
846
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: `${N ? "border-red" : ""}`, children: /* @__PURE__ */ t(
848
+ /* @__PURE__ */ t("div", { className: `${p ? "border-red" : ""}`, children: /* @__PURE__ */ t(
849
849
  ne,
850
850
  {
851
851
  id: e,
852
852
  name: e,
853
- selected: v,
854
- onChange: x,
855
- onBlur: P,
853
+ selected: C,
854
+ onChange: P,
855
+ onBlur: R,
856
856
  dateFormat: Y,
857
857
  placeholderText: a,
858
- disabled: h,
859
- readOnly: h,
858
+ disabled: m,
859
+ readOnly: m,
860
860
  locale: "pt-BR",
861
- className: `form-control ${N ? "border-red" : ""}`,
861
+ className: `form-control ${p ? "border-red" : ""}`,
862
862
  wrapperClassName: "w-100",
863
863
  showMonthDropdown: !0,
864
864
  showYearDropdown: !0,
865
865
  dropdownMode: "select",
866
- isClearable: !h && !!p,
866
+ isClearable: !m && !!w,
867
867
  autoComplete: "off",
868
- customInput: /* @__PURE__ */ t(Ue, { name: e, shimRef: f })
868
+ customInput: /* @__PURE__ */ t(Ue, { name: e, shimRef: h })
869
869
  }
870
870
  ) }),
871
- N && /* @__PURE__ */ t("span", { className: "help-block text-danger", children: String(N.message) })
871
+ p && /* @__PURE__ */ t("span", { className: "help-block text-danger", children: String(p.message) })
872
872
  ] });
873
- }, ut = T(Ye);
873
+ }, ut = O(Ye);
874
874
  function Ge({
875
875
  mapping: e = {},
876
876
  defaultLabel: r = "Não reconhecido",
877
877
  className: a = "",
878
878
  hidden: c = !1,
879
- label: i
879
+ label: o
880
880
  }) {
881
- const { activityId: l } = M(), s = j(() => !e || l === null || l === void 0 ? null : e[l], [l, e]);
881
+ const { activityId: l } = j(), s = T(() => !e || l === null || l === void 0 ? null : e[l], [l, e]);
882
882
  if (!s)
883
883
  return /* @__PURE__ */ g("div", { className: `form-group ${c ? "hidden" : ""}`, children: [
884
- i && /* @__PURE__ */ t("label", { children: i }),
884
+ o && /* @__PURE__ */ t("label", { children: o }),
885
885
  /* @__PURE__ */ t("div", { className: `status-badge default ${a}`, children: r })
886
886
  ] });
887
887
  const n = {
888
888
  "--customColor": s.color
889
889
  };
890
890
  return /* @__PURE__ */ g("div", { className: `form-group ${c ? "hidden" : ""}`, children: [
891
- i && /* @__PURE__ */ t("label", { children: i }),
891
+ o && /* @__PURE__ */ t("label", { children: o }),
892
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
  ] })
896
896
  ] });
897
897
  }
898
- const mt = T(Ge);
898
+ const mt = O(Ge);
899
899
  function Qe({
900
900
  name: e,
901
901
  control: r,
902
902
  defaultRowValue: a,
903
903
  isView: c,
904
- isReadOnly: i,
904
+ isReadOnly: o,
905
905
  filters: l = []
906
906
  }) {
907
- const { field: s } = I({ name: e, control: r }), [n, m] = D([]), [u, h] = D([]), w = () => Date.now() + Math.random(), C = (o) => {
907
+ const { field: s } = I({ name: e, control: r }), [n, b] = M([]), [u, m] = M([]), y = () => Date.now() + Math.random(), k = (i) => {
908
908
  try {
909
- const d = JSON.parse(o);
910
- return Array.isArray(d) ? d.map((b) => ({
911
- ...b,
912
- _uid: b._uid || w()
909
+ const d = JSON.parse(i);
910
+ return Array.isArray(d) ? d.map((f) => ({
911
+ ...f,
912
+ _uid: f._uid || y()
913
913
  })) : [];
914
914
  } catch (d) {
915
915
  return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
916
916
  }
917
917
  };
918
- O(() => {
918
+ D(() => {
919
919
  if (!(n.length > 0 && !c) && s.value && typeof s.value == "string") {
920
- const o = JSON.stringify(n);
921
- if (s.value === o) return;
922
- const d = C(s.value);
923
- m(d);
920
+ const i = JSON.stringify(n);
921
+ if (s.value === i) return;
922
+ const d = k(s.value);
923
+ b(d);
924
924
  }
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
- const P = $(() => {
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
- (S) => S.map(
941
- (k) => k._uid === o ? { ...k, [d]: b } : k
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
942
942
  )
943
943
  );
944
944
  },
945
945
  []
946
- ), N = $((o) => {
947
- h(
948
- (d) => d.includes(o) ? d.filter((b) => b !== o) : [...d, o]
946
+ ), p = S((i) => {
947
+ m(
948
+ (d) => d.includes(i) ? d.filter((f) => f !== i) : [...d, i]
949
949
  );
950
- }, []), v = $(
951
- (o) => {
952
- h(o ? n.map((d) => d._uid) : []);
950
+ }, []), C = S(
951
+ (i) => {
952
+ m(i ? n.map((d) => d._uid) : []);
953
953
  },
954
954
  [n]
955
- ), x = n.length > 0 && u.length === n.length, f = j(() => !l || l.length === 0 ? n : n.filter(
956
- (o) => l.every((d) => {
955
+ ), P = n.length > 0 && u.length === n.length, h = T(() => !l || l.length === 0 ? n : n.filter(
956
+ (i) => l.every((d) => {
957
957
  if ("custom" in d)
958
- return d.custom(o);
959
- const b = o[d.field];
958
+ return d.custom(i);
959
+ const f = i[d.field];
960
960
  switch (d.operator) {
961
961
  case "===":
962
- return b === d.value;
962
+ return f === d.value;
963
963
  case "!==":
964
- return b !== d.value;
964
+ return f !== d.value;
965
965
  case ">":
966
- return b > d.value;
966
+ return f > d.value;
967
967
  case "<":
968
- return b < d.value;
968
+ return f < d.value;
969
969
  case ">=":
970
- return b >= d.value;
970
+ return f >= d.value;
971
971
  case "<=":
972
- return b <= d.value;
972
+ return f <= 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: f,
981
+ visibleRows: h,
982
982
  selectedRowIds: u,
983
- isAllSelected: x,
983
+ isAllSelected: P,
984
984
  handle: {
985
- addRow: P,
986
- removeRows: p,
987
- updateCellValue: y,
988
- toggleSelection: N,
989
- toggleSelectAll: v
985
+ addRow: R,
986
+ removeRows: w,
987
+ updateCellValue: v,
988
+ toggleSelection: p,
989
+ toggleSelectAll: C
990
990
  }
991
991
  };
992
992
  }
@@ -995,94 +995,94 @@ const ht = ({
995
995
  title: r = "Tabela Dinâmica",
996
996
  columns: a,
997
997
  defaultRowValue: c = {},
998
- forceReadOnly: i = !1,
998
+ forceReadOnly: o = !1,
999
999
  layout: l = "fluid",
1000
1000
  actions: s = !0,
1001
1001
  filters: n = []
1002
1002
  }) => {
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({
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({
1004
1004
  name: e,
1005
- control: m,
1005
+ control: b,
1006
1006
  defaultRowValue: c,
1007
1007
  isView: u,
1008
- isReadOnly: !!C,
1008
+ isReadOnly: !!k,
1009
1009
  filters: n
1010
- }), x = l === "fixed";
1011
- return /* @__PURE__ */ g("div", { className: `table-wrapper ${x ? "table-fixed" : "table-fluid"}`, children: [
1012
- /* @__PURE__ */ t("input", { type: "hidden", ...P }),
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
1013
  /* @__PURE__ */ g("div", { className: "header-handle", children: [
1014
1014
  /* @__PURE__ */ t("h3", { children: r }),
1015
- !C && s && /* @__PURE__ */ g("div", { className: "handle-actions", children: [
1015
+ !k && s && /* @__PURE__ */ g("div", { className: "handle-actions", children: [
1016
1016
  /* @__PURE__ */ g(
1017
1017
  "button",
1018
1018
  {
1019
1019
  type: "button",
1020
- className: `btn ${y.length > 0 ? "btn-danger" : ""}`,
1021
- disabled: y.length === 0,
1022
- onClick: v.removeRows,
1020
+ className: `btn ${v.length > 0 ? "btn-danger" : ""}`,
1021
+ disabled: v.length === 0,
1022
+ onClick: C.removeRows,
1023
1023
  children: [
1024
1024
  "Remover (",
1025
- y.length,
1025
+ v.length,
1026
1026
  ")"
1027
1027
  ]
1028
1028
  }
1029
1029
  ),
1030
- /* @__PURE__ */ t("button", { type: "button", className: "btn-add", onClick: v.addRow, children: "Adicionar" })
1030
+ /* @__PURE__ */ t("button", { type: "button", className: "btn-add", onClick: C.addRow, children: "Adicionar" })
1031
1031
  ] })
1032
1032
  ] }),
1033
1033
  /* @__PURE__ */ t("div", { className: "table-scroll", children: /* @__PURE__ */ g("table", { className: "table-custom", children: [
1034
1034
  /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ g("tr", { children: [
1035
- !C && /* @__PURE__ */ t("th", { style: { width: "50px" }, children: /* @__PURE__ */ t(
1035
+ !k && /* @__PURE__ */ t("th", { style: { width: "50px" }, children: /* @__PURE__ */ t(
1036
1036
  "input",
1037
1037
  {
1038
1038
  type: "checkbox",
1039
- checked: N,
1040
- onChange: (f) => v.toggleSelectAll(f.target.checked)
1039
+ checked: p,
1040
+ onChange: (h) => C.toggleSelectAll(h.target.checked)
1041
1041
  }
1042
1042
  ) }),
1043
- a.map((f) => /* @__PURE__ */ t(
1043
+ a.map((h) => /* @__PURE__ */ t(
1044
1044
  "th",
1045
1045
  {
1046
- style: f.width ? { minWidth: x ? f.width : "100%" } : { width: "max-content" },
1047
- children: f.label
1046
+ style: h.width ? { minWidth: P ? h.width : "100%" } : { width: "max-content" },
1047
+ children: h.label
1048
1048
  },
1049
- f.key
1049
+ h.key
1050
1050
  ))
1051
1051
  ] }) }),
1052
1052
  /* @__PURE__ */ g("tbody", { children: [
1053
- p.map((f, o) => /* @__PURE__ */ g("tr", { children: [
1054
- !C && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
1053
+ w.map((h, i) => /* @__PURE__ */ g("tr", { children: [
1054
+ !k && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
1055
1055
  "input",
1056
1056
  {
1057
1057
  type: "checkbox",
1058
- checked: y.includes(f._uid),
1059
- onChange: () => v.toggleSelection(f._uid)
1058
+ checked: v.includes(h._uid),
1059
+ onChange: () => C.toggleSelection(h._uid)
1060
1060
  }
1061
1061
  ) }),
1062
1062
  a.map((d) => /* @__PURE__ */ t("td", { children: d.render ? d.render.length <= 1 ? d.render({
1063
- row: f,
1064
- index: o,
1065
- updateRow: (b, S) => v.updateCellValue(f._uid, b, S),
1066
- isLocked: !!C,
1063
+ row: h,
1064
+ index: i,
1065
+ updateRow: (f, _) => C.updateCellValue(h._uid, f, _),
1066
+ isLocked: !!k,
1067
1067
  isView: !!u
1068
1068
  }) : d.render(
1069
- f,
1070
- o,
1071
- (b, S) => v.updateCellValue(f._uid, b, S),
1072
- !!C,
1069
+ h,
1070
+ i,
1071
+ (f, _) => C.updateCellValue(h._uid, f, _),
1072
+ !!k,
1073
1073
  !!u
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." }) })
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." }) })
1077
1077
  ] })
1078
1078
  ] }) })
1079
1079
  ] });
1080
1080
  }, Je = (e, r) => {
1081
- const [a, c] = D(null), { watch: i } = W(), l = r !== void 0 ? r : i(e), s = $(() => {
1081
+ const [a, c] = M(null), { watch: o } = W(), l = r !== void 0 ? r : o(e), s = S(() => {
1082
1082
  try {
1083
- const m = window.top.__REACT_ATTACHMENT_BRIDGE__;
1084
- if (m) {
1085
- const u = m.getAttachment(e, l);
1083
+ const b = window.top.__REACT_ATTACHMENT_BRIDGE__;
1084
+ if (b) {
1085
+ const u = b.getAttachment(e, l);
1086
1086
  c(u || (l ? { name: l, documentId: 0 } : null));
1087
1087
  } else
1088
1088
  c(l ? { name: l, documentId: 0 } : null);
@@ -1090,7 +1090,7 @@ const ht = ({
1090
1090
  c(l ? { name: l, documentId: 0 } : null);
1091
1091
  }
1092
1092
  }, [e, l, r]);
1093
- return O(() => {
1093
+ return D(() => {
1094
1094
  s();
1095
1095
  const n = setInterval(s, 2e3);
1096
1096
  return () => clearInterval(n);
@@ -1100,123 +1100,126 @@ const ht = ({
1100
1100
  label: r,
1101
1101
  help: a,
1102
1102
  valueManual: c,
1103
- onChangeManual: i
1103
+ onChangeManual: o,
1104
+ readOnly: l
1104
1105
  }) => {
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;
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;
1107
1108
  try {
1108
- const x = window.top;
1109
+ const i = window.top;
1109
1110
  return {
1110
- bridge: x.__REACT_ATTACHMENT_BRIDGE__,
1111
- toast: (v = x.FLUIGC) == null ? void 0 : v.toast
1111
+ bridge: i.__REACT_ATTACHMENT_BRIDGE__,
1112
+ toast: (h = i.FLUIGC) == null ? void 0 : h.toast
1112
1113
  };
1113
1114
  } catch {
1114
1115
  return { bridge: null, toast: null };
1115
1116
  }
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({
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), _ && _({
1126
1128
  title: "Sucesso",
1127
1129
  message: "Arquivo enviado",
1128
1130
  type: "success"
1129
1131
  });
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
+ }) : (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({
1138
1140
  title: "Erro",
1139
1141
  message: "Erro ao remover anexo",
1140
1142
  type: "danger"
1141
- }) : (i ? i("") : m.onChange(""), h());
1142
- }, p = !!u && !l, y = (u == null ? void 0 : u.name) || c || m.value, N = [
1143
+ }) : (o ? o("") : u.onChange(""), y());
1144
+ }, v = !!m && !s, p = (m == null ? void 0 : m.name) || c || u.value, C = [
1143
1145
  "fluig-attachment__box",
1144
- p ? "fluig-attachment__box--has-file" : "",
1145
- l ? "fluig-attachment__box--uploading" : ""
1146
+ v ? "fluig-attachment__box--has-file" : "",
1147
+ s ? "fluig-attachment__box--uploading" : ""
1146
1148
  ].join(" ");
1147
1149
  return /* @__PURE__ */ g("div", { className: "form-group fluig-attachment", children: [
1148
1150
  r && /* @__PURE__ */ t("label", { className: "fluig-attachment__label", children: r }),
1149
1151
  /* @__PURE__ */ g(
1150
1152
  "div",
1151
1153
  {
1152
- className: N,
1154
+ className: C,
1155
+ style: l && !v ? { pointerEvents: "none", opacity: 0.6, cursor: "not-allowed" } : {},
1153
1156
  onClick: () => {
1154
- if (p) {
1155
- const v = w();
1156
- v.bridge && y && v.bridge.view(y);
1157
+ if (v) {
1158
+ const h = k();
1159
+ h.bridge && p && h.bridge.view(p);
1157
1160
  } else
1158
- C();
1161
+ R();
1159
1162
  },
1160
1163
  children: [
1161
1164
  /* @__PURE__ */ g("span", { className: "fluig-attachment__content", children: [
1162
1165
  /* @__PURE__ */ t(
1163
1166
  "i",
1164
1167
  {
1165
- className: `fluigicon icon-sm ${l ? "fluigicon-loop-test" : p ? "fluigicon-file-pdf" : "fluigicon-paperclip"} fluig-attachment__icon`
1168
+ className: `fluigicon icon-sm ${s ? "fluigicon-loop-test" : v ? "fluigicon-file-pdf" : "fluigicon-paperclip"} fluig-attachment__icon`
1166
1169
  }
1167
1170
  ),
1168
- /* @__PURE__ */ t("span", { className: "fluig-attachment__filename", children: l ? " Enviando..." : p ? y : a || "Anexar" })
1171
+ /* @__PURE__ */ t("span", { className: "fluig-attachment__filename", children: s ? " Enviando..." : v ? p : l ? "Nenhum arquivo" : a || "Anexar" })
1169
1172
  ] }),
1170
- p && /* @__PURE__ */ t(
1173
+ v && !l && /* @__PURE__ */ t(
1171
1174
  "button",
1172
1175
  {
1173
1176
  type: "button",
1174
1177
  className: "fluig-attachment__btn-remove btn btn-link text-danger",
1175
- onClick: P,
1178
+ onClick: w,
1176
1179
  children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-trash icon-sm", "aria-hidden": "true" })
1177
1180
  }
1178
1181
  )
1179
1182
  ]
1180
1183
  }
1181
1184
  ),
1182
- !i && /* @__PURE__ */ t("input", { type: "hidden", name: e, value: m.value || "" })
1185
+ !o && /* @__PURE__ */ t("input", { type: "hidden", name: e, value: u.value || "" })
1183
1186
  ] });
1184
- }, ft = T(Ze);
1187
+ }, ft = O(Ze);
1185
1188
  function gt({
1186
1189
  items: e,
1187
1190
  time: r = 0,
1188
1191
  showNavigation: a = !0,
1189
1192
  progressBar: c = !0
1190
1193
  }) {
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);
1193
- }, [e.length]), w = $(() => {
1194
- l((y) => (y - 1 + e.length) % e.length), n(0);
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);
1195
1198
  }, [e.length]);
1196
- if (O(() => {
1199
+ if (D(() => {
1197
1200
  if (r > 0 && e.length > 1) {
1198
- const N = 100 / r * 100;
1199
- m.current = setInterval(h, r), u.current = setInterval(() => {
1200
- n((v) => v >= 100 ? 0 : v + N);
1201
+ const p = 100 / r * 100;
1202
+ b.current = setInterval(m, r), u.current = setInterval(() => {
1203
+ n((C) => C >= 100 ? 0 : C + p);
1201
1204
  }, 100);
1202
1205
  }
1203
1206
  return () => {
1204
- m.current && clearInterval(m.current), u.current && clearInterval(u.current);
1207
+ b.current && clearInterval(b.current), u.current && clearInterval(u.current);
1205
1208
  };
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);
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);
1208
1211
  return /* @__PURE__ */ g("div", { className: "carousel-root", children: [
1209
1212
  /* @__PURE__ */ g("div", { className: "carousel-viewport", children: [
1210
1213
  a && e.length > 1 && /* @__PURE__ */ g(U, { children: [
1211
- /* @__PURE__ */ t("button", { className: "nav-btn prev", onClick: w, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-left" }) }),
1212
- /* @__PURE__ */ t("button", { className: "nav-btn next", onClick: h, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-right" }) })
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" }) })
1213
1216
  ] }),
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: [
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: [
1215
1218
  /* @__PURE__ */ t("i", { className: "flaticon flaticon-file icon-xl" }),
1216
1219
  /* @__PURE__ */ t(
1217
1220
  "a",
1218
1221
  {
1219
- href: P,
1222
+ href: R,
1220
1223
  target: "_blank",
1221
1224
  rel: "noreferrer",
1222
1225
  className: "btn-open",
@@ -1224,15 +1227,15 @@ function gt({
1224
1227
  }
1225
1228
  )
1226
1229
  ] }) }),
1227
- e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-dots", children: e.map((y, N) => /* @__PURE__ */ t(
1230
+ e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-dots", children: e.map((v, p) => /* @__PURE__ */ t(
1228
1231
  "div",
1229
1232
  {
1230
- className: `dot ${N === i ? "active" : ""}`,
1233
+ className: `dot ${p === o ? "active" : ""}`,
1231
1234
  onClick: () => {
1232
- l(N), n(0);
1235
+ l(p), n(0);
1233
1236
  }
1234
1237
  },
1235
- N
1238
+ p
1236
1239
  )) })
1237
1240
  ] }),
1238
1241
  c && r > 0 && e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-progress-container", children: /* @__PURE__ */ t(
@@ -1249,17 +1252,17 @@ function bt({
1249
1252
  isOpen: r,
1250
1253
  onOpen: a,
1251
1254
  onClose: c,
1252
- content: i,
1255
+ content: o,
1253
1256
  footer: l,
1254
1257
  width: s
1255
1258
  }) {
1256
- const n = $(
1257
- (m) => {
1258
- m.key === "Escape" && c();
1259
+ const n = S(
1260
+ (b) => {
1261
+ b.key === "Escape" && c();
1259
1262
  },
1260
1263
  [c]
1261
1264
  );
1262
- return O(() => (r && (document.addEventListener("keydown", n), a == null || a(), document.body.style.overflow = "hidden"), () => {
1265
+ return D(() => (r && (document.addEventListener("keydown", n), a == null || a(), document.body.style.overflow = "hidden"), () => {
1263
1266
  document.removeEventListener("keydown", n), document.body.style.overflow = "auto";
1264
1267
  }), [r, n, a]), r ? /* @__PURE__ */ t(
1265
1268
  "div",
@@ -1273,7 +1276,7 @@ function bt({
1273
1276
  {
1274
1277
  style: { maxWidth: s },
1275
1278
  className: "modal-container",
1276
- onClick: (m) => m.stopPropagation(),
1279
+ onClick: (b) => b.stopPropagation(),
1277
1280
  children: [
1278
1281
  /* @__PURE__ */ g("div", { className: "modal-header", children: [
1279
1282
  /* @__PURE__ */ t("h3", { children: e }),
@@ -1294,7 +1297,7 @@ function bt({
1294
1297
  }
1295
1298
  )
1296
1299
  ] }),
1297
- /* @__PURE__ */ t("div", { className: "modal-content", children: i }),
1300
+ /* @__PURE__ */ t("div", { className: "modal-content", children: o }),
1298
1301
  l && /* @__PURE__ */ t("div", { className: "modal-footer", children: l })
1299
1302
  ]
1300
1303
  }
@@ -1307,24 +1310,24 @@ function vt({
1307
1310
  childs: r,
1308
1311
  footer: a,
1309
1312
  contentExternal: c,
1310
- bg: i,
1313
+ bg: o,
1311
1314
  color: l,
1312
1315
  onSelect: s
1313
1316
  }) {
1314
1317
  return /* @__PURE__ */ g("div", { className: "main-container dfea", children: [
1315
- /* @__PURE__ */ g("div", { className: "sidebar-wrapper", style: { backgroundColor: `${i}` }, children: [
1318
+ /* @__PURE__ */ g("div", { className: "sidebar-wrapper", style: { backgroundColor: `${o}` }, children: [
1316
1319
  e && /* @__PURE__ */ t("div", { className: "sidebar-logo", children: /* @__PURE__ */ t("img", { src: e, alt: "", width: "auto", height: "28px" }) }),
1317
1320
  /* @__PURE__ */ t("ul", { className: "sidebar-childs-content", children: r == null ? void 0 : r.map(
1318
1321
  (n) => {
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: [
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: [
1321
1324
  /* @__PURE__ */ g(
1322
1325
  "li",
1323
1326
  {
1324
1327
  className: "sidebar-child",
1325
1328
  onClick: () => {
1326
- var h;
1327
- (h = n.action) == null || h.call(n), s == null || s(n.id);
1329
+ var m;
1330
+ (m = n.action) == null || m.call(n), s == null || s(n.id);
1328
1331
  },
1329
1332
  style: { color: `${l}` },
1330
1333
  children: [
@@ -1333,16 +1336,16 @@ function vt({
1333
1336
  ]
1334
1337
  }
1335
1338
  ),
1336
- (u = n.options) == null ? void 0 : u.map((h) => /* @__PURE__ */ t(
1339
+ (u = n.options) == null ? void 0 : u.map((m) => /* @__PURE__ */ t(
1337
1340
  "li",
1338
1341
  {
1339
1342
  className: "sidebar-option",
1340
1343
  onClick: () => {
1341
- var w;
1342
- (w = h.action) == null || w.call(h), s == null || s(h.id);
1344
+ var y;
1345
+ (y = m.action) == null || y.call(m), s == null || s(m.id);
1343
1346
  },
1344
1347
  style: { color: `${l}` },
1345
- children: h.label
1348
+ children: m.label
1346
1349
  }
1347
1350
  ))
1348
1351
  ] }) }) : /* @__PURE__ */ g(
@@ -1350,8 +1353,8 @@ function vt({
1350
1353
  {
1351
1354
  className: "sidebar-child",
1352
1355
  onClick: () => {
1353
- var h;
1354
- (h = n.action) == null || h.call(n), s == null || s(n.id);
1356
+ var m;
1357
+ (m = n.action) == null || m.call(n), s == null || s(n.id);
1355
1358
  },
1356
1359
  style: { color: `${l}` },
1357
1360
  children: [