@tech-diefra/fluig-ui 1.2.39 → 1.2.41

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