@tech-diefra/fluig-ui 1.2.43 → 1.2.45

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