diefra_ecm_ui 1.0.7 → 1.0.9

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