diefra_ecm_ui 1.0.6 → 1.0.7

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,6 +1,6 @@
1
- import { jsxs as x, jsx as r, Fragment as de } from "react/jsx-runtime";
1
+ import { jsxs as x, jsx as r, Fragment as ce } from "react/jsx-runtime";
2
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 ce } from "react-hook-form";
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
5
  import { useSection as I, useFluigRuntime as L } from "@fluig-kit/ecm";
6
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";
@@ -16,75 +16,75 @@ function Se({
16
16
  placeholder: n = "",
17
17
  type: i = "text",
18
18
  mask: s,
19
- className: c = "",
19
+ className: d = "",
20
20
  forceReadOnly: l = !1,
21
21
  forceHidden: o = !1,
22
- valueManual: v,
22
+ valueManual: g,
23
23
  onChangeManual: a,
24
- errorManual: w
24
+ errorManual: N
25
25
  }) {
26
- var $, A;
27
- const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W } = L();
28
- let h = null;
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();
28
+ let p = null;
29
29
  try {
30
- h = H();
30
+ p = H();
31
31
  } catch {
32
32
  }
33
- const y = !p && h ? X({ name: e, control: h.control }) : null, u = !p && h ? ce({ name: e }) : null, m = p ? v : y == null ? void 0 : y.field.value, d = p ? w : (A = ($ = u == null ? void 0 : u.errors) == null ? void 0 : $[e]) == null ? void 0 : A.message, f = B(
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
34
  () => s ? xe[s] ?? s : null,
35
35
  [s]
36
- ), g = C((b) => {
37
- if (!b) return "";
38
- const j = b.replace(/\D/g, "");
36
+ ), b = C((w) => {
37
+ if (!w) return "";
38
+ const j = w.replace(/\D/g, "");
39
39
  return (Number(j) / 100).toLocaleString("pt-BR", {
40
40
  style: "currency",
41
41
  currency: "BRL"
42
42
  });
43
- }, []), S = C(
44
- (b) => i === "monetary" ? g(b) : b,
45
- [i, g]
46
- ), N = (b) => {
47
- const j = S(b);
48
- p ? a == null || a(j) : y == null || y.field.onChange(j);
49
- }, O = () => {
50
- p || y == null || y.field.onBlur();
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();
51
51
  };
52
- if (W)
52
+ if (A)
53
53
  return /* @__PURE__ */ x("div", { className: "form-group", children: [
54
54
  /* @__PURE__ */ r("label", { children: t }),
55
- /* @__PURE__ */ r("span", { className: "form-control", children: m || "-" })
55
+ /* @__PURE__ */ r("span", { className: "form-control", children: f || "-" })
56
56
  ] });
57
- const k = `form-control ${_ ? "readOnly" : ""} ${d ? "border-red" : ""} ${c}`;
57
+ const v = `form-control ${_ ? "readOnly" : ""} ${c ? "border-red" : ""} ${d}`;
58
58
  return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
59
59
  t && /* @__PURE__ */ r("label", { children: t }),
60
- f ? /* @__PURE__ */ r(
60
+ h ? /* @__PURE__ */ r(
61
61
  le,
62
62
  {
63
63
  name: e,
64
- mask: f,
65
- value: String(m ?? ""),
64
+ mask: h,
65
+ value: String(f ?? ""),
66
66
  unmask: !1,
67
- onAccept: (b) => N(b),
67
+ onAccept: (w) => O(w),
68
68
  placeholder: n,
69
69
  readOnly: _,
70
- className: k,
71
- inputRef: p || y == null ? void 0 : y.field.ref,
72
- onBlur: O
70
+ className: v,
71
+ inputRef: y || u == null ? void 0 : u.field.ref,
72
+ onBlur: k
73
73
  }
74
74
  ) : /* @__PURE__ */ r(
75
75
  "input",
76
76
  {
77
77
  type: "text",
78
78
  name: e,
79
- value: m ?? "",
80
- onChange: (b) => N(b.target.value),
81
- onBlur: O,
79
+ value: f ?? "",
80
+ onChange: (w) => O(w.target.value),
81
+ onBlur: k,
82
82
  placeholder: n,
83
83
  readOnly: _,
84
- className: k
84
+ className: v
85
85
  }
86
86
  ),
87
- d && /* @__PURE__ */ r("p", { className: "text-danger", children: String(d) })
87
+ c && /* @__PURE__ */ r("p", { className: "text-danger", children: String(c) })
88
88
  ] });
89
89
  }
90
90
  const Vt = z(Se);
@@ -94,109 +94,109 @@ function Re({
94
94
  options: n = [],
95
95
  placeholder: i = "",
96
96
  labelKey: s = "label",
97
- valueKey: c = "value",
97
+ valueKey: d = "value",
98
98
  enableSearch: l = !1,
99
99
  searchPlaceholder: o = "Buscar...",
100
- loading: v = !1,
100
+ loading: g = !1,
101
101
  onSearchChange: a,
102
- debounceTime: w = 300,
103
- onSelect: p,
104
- forceReadOnly: V = !1,
105
- forceHidden: D = !1,
102
+ debounceTime: N = 300,
103
+ onSelect: y,
104
+ forceReadOnly: W = !1,
105
+ forceHidden: V = !1,
106
106
  valueManual: _,
107
107
  onChangeManual: P,
108
- errorManual: W
108
+ errorManual: A
109
109
  }) {
110
110
  var ne;
111
- const h = _ !== void 0 && !!P, { isReadOnly: y, isHidden: u } = I(), m = V || !!y(e), d = D || !!u(e), { isView: f } = L();
112
- let g = "", S = () => {
113
- }, N, O = null, k = () => {
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 = () => {
114
114
  };
115
- if (h)
116
- g = _;
115
+ if (p)
116
+ b = _;
117
117
  else
118
118
  try {
119
119
  const R = H(), T = X({ name: e, control: R.control });
120
- g = T.field.value, S = T.field.onChange, N = T.field.ref, O = (ne = T.fieldState) == null ? void 0 : ne.error, k = R.clearErrors;
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;
121
121
  } catch {
122
122
  }
123
- const [$, A] = F(!1), [b, j] = F(""), q = G(null), U = G(a);
123
+ const [S, $] = F(!1), [w, j] = F(""), 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) && A(!1);
128
+ q.current && !q.current.contains(T.target) && $(!1);
129
129
  };
130
130
  return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
131
131
  }, []), E(() => {
132
- $ || j("");
133
- }, [$]), E(() => {
132
+ S || j("");
133
+ }, [S]), E(() => {
134
134
  if (!l) return;
135
135
  const R = setTimeout(() => {
136
136
  var T;
137
- (T = U.current) == null || T.call(U, b);
138
- }, w);
137
+ (T = U.current) == null || T.call(U, w);
138
+ }, N);
139
139
  return () => clearTimeout(R);
140
- }, [b, l, w]);
141
- const ee = B(() => l && !a && b.trim() ? n.filter(
142
- (R) => String((R == null ? void 0 : R[s]) ?? "").toLowerCase().includes(b.toLowerCase())
143
- ) : n ?? [], [n, l, a, b, s]), te = B(() => {
144
- if (g == null) return "";
145
- if (typeof g == "object")
146
- return String(g[c] ?? "");
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] ?? "");
147
147
  const R = (n || []).find(
148
- (T) => String(T == null ? void 0 : T[c]) === String(g)
148
+ (T) => String(T == null ? void 0 : T[d]) === String(b)
149
149
  );
150
- return String(R ? (R == null ? void 0 : R[s]) ?? "" : g);
151
- }, [g, n, c, s]), oe = (R) => {
152
- m || (h ? P == null || P(R[c]) : (S(R[c]), k == null || k(e)), p == null || p(R), A(!1));
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));
153
153
  };
154
154
  return /* @__PURE__ */ x(
155
155
  "div",
156
156
  {
157
- className: `select-wrapper form-group ${d ? "hidden" : ""}`,
157
+ className: `select-wrapper form-group ${c ? "hidden" : ""}`,
158
158
  ref: q,
159
159
  children: [
160
160
  /* @__PURE__ */ r("label", { className: "control-label", children: t }),
161
- f ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */ x(de, { children: [
161
+ h ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */ x(ce, { children: [
162
162
  /* @__PURE__ */ x(
163
163
  "div",
164
164
  {
165
- className: `select-control ${O ? "border-red" : ""} ${m ? "readOnly" : ""}`,
166
- onClick: () => !m && A((R) => !R),
167
- ref: N,
165
+ className: `select-control ${k ? "border-red" : ""} ${f ? "readOnly" : ""}`,
166
+ onClick: () => !f && $((R) => !R),
167
+ ref: O,
168
168
  children: [
169
- /* @__PURE__ */ r("span", { className: `select-display ${m ? "readOnly" : ""}`, children: te || i }),
169
+ /* @__PURE__ */ r("span", { className: `select-display ${f ? "readOnly" : ""}`, children: te || i }),
170
170
  /* @__PURE__ */ r("i", { className: "flaticon flaticon-chevron-down select-icon" })
171
171
  ]
172
172
  }
173
173
  ),
174
- $ && !m && /* @__PURE__ */ x("div", { className: "select-dropdown", children: [
174
+ S && !f && /* @__PURE__ */ x("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: b,
180
+ value: w,
181
181
  onChange: (R) => j(R.target.value),
182
- placeholder: v ? "Carregando..." : o,
182
+ placeholder: g ? "Carregando..." : o,
183
183
  autoFocus: !0,
184
184
  onClick: (R) => R.stopPropagation()
185
185
  }
186
186
  ) }),
187
- /* @__PURE__ */ r("ul", { className: "select-options", children: v ? /* @__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: g ? /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map((R) => /* @__PURE__ */ r(
188
188
  "li",
189
189
  {
190
190
  onClick: () => oe(R),
191
191
  className: "select-option handleHover",
192
192
  children: R[s]
193
193
  },
194
- R[c]
194
+ R[d]
195
195
  )) : /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Sem resultados" }) })
196
196
  ] })
197
197
  ] }),
198
- !h && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: g || "" }),
199
- (O || W) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((O == null ? void 0 : O.message) ?? W) })
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) })
200
200
  ]
201
201
  }
202
202
  );
@@ -208,85 +208,85 @@ function Tt({
208
208
  label: n = "",
209
209
  valueKey: i = "value",
210
210
  labelKey: s = "label",
211
- forceReadOnly: c = !1,
211
+ forceReadOnly: d = !1,
212
212
  forceHidden: l = !1,
213
213
  valueManual: o,
214
- onChangeManual: v
214
+ onChangeManual: g
215
215
  }) {
216
- var N, O;
216
+ var O, k;
217
217
  let a = null;
218
218
  try {
219
219
  a = H();
220
220
  } catch {
221
221
  }
222
- const w = o !== void 0 && !!v, { isView: p, isReadOnly: V } = L(), { isReadOnly: D, isHidden: _ } = I(), P = D ? D(e) : !1, W = _ ? _(e) : !1, h = c || P, y = l || W, u = h || V || p, m = () => t ? t.reduce(
223
- (k, $) => {
224
- const A = String($[i]);
225
- if (w)
226
- k[A] = !!(o != null && o[A]);
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]);
225
+ if (N)
226
+ v[$] = !!(o != null && o[$]);
227
227
  else if (a) {
228
- const b = a.getValues(A);
229
- k[A] = b === "on";
228
+ const w = a.getValues($);
229
+ v[$] = w === "on";
230
230
  } else
231
- k[A] = !1;
232
- return k;
231
+ v[$] = !1;
232
+ return v;
233
233
  },
234
234
  {}
235
- ) : {}, d = !w && a ? a.watch(e) : void 0, f = B(() => w && o ? o : d && typeof d == "object" ? d : m(), [d, o, t]);
235
+ ) : {}, c = !N && a ? a.watch(e) : void 0, h = B(() => N && o ? o : c && typeof c == "object" ? c : f(), [c, o, t]);
236
236
  E(() => {
237
- if (w || !a) return;
238
- const k = a.getValues(e);
239
- (!k || typeof k != "object") && a.setValue(e, f, {
237
+ if (N || !a) return;
238
+ const v = a.getValues(e);
239
+ (!v || typeof v != "object") && a.setValue(e, h, {
240
240
  shouldDirty: !1,
241
241
  shouldValidate: !1
242
242
  });
243
- }, [f, e, a, w]);
244
- const g = (k, $) => {
245
- if (u) return;
246
- const A = { ...f, [k]: $ };
247
- if (w) {
248
- v && v(A);
243
+ }, [h, e, a, N]);
244
+ const b = (v, S) => {
245
+ if (m) return;
246
+ const $ = { ...h, [v]: S };
247
+ if (N) {
248
+ g && g($);
249
249
  return;
250
250
  }
251
- a && (a.setValue(e, A, {
251
+ a && (a.setValue(e, $, {
252
252
  shouldDirty: !0,
253
253
  shouldValidate: !0
254
- }), a.setValue(k, $ ? "on" : "", { shouldValidate: !1 }));
255
- }, S = w ? null : (O = (N = a == null ? void 0 : a.formState) == null ? void 0 : N.errors) == null ? void 0 : O[e];
256
- return /* @__PURE__ */ x("div", { className: `form-group ${y ? "hidden" : ""}`, children: [
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: [
257
257
  n && /* @__PURE__ */ r("label", { children: n }),
258
258
  /* @__PURE__ */ r(
259
259
  "div",
260
260
  {
261
- className: `checkbox-group-custom ${u ? "readOnly" : ""}`,
262
- children: t.map((k) => {
263
- const $ = String(k[i]), A = f[$] === !0;
261
+ className: `checkbox-group-custom ${m ? "readOnly" : ""}`,
262
+ children: t.map((v) => {
263
+ const S = String(v[i]), $ = h[S] === !0;
264
264
  return /* @__PURE__ */ x("div", { children: [
265
- !w && a && /* @__PURE__ */ r("input", { type: "hidden", ...a.register($) }),
265
+ !N && a && /* @__PURE__ */ r("input", { type: "hidden", ...a.register(S) }),
266
266
  /* @__PURE__ */ x(
267
267
  "label",
268
268
  {
269
- className: `custom-checkbox ${A ? "checked" : ""} ${u ? "readOnly" : ""}`,
269
+ className: `custom-checkbox ${$ ? "checked" : ""} ${m ? "readOnly" : ""}`,
270
270
  children: [
271
271
  /* @__PURE__ */ r(
272
272
  "input",
273
273
  {
274
274
  type: "checkbox",
275
- checked: A,
276
- disabled: u,
277
- onChange: (b) => g($, b.target.checked)
275
+ checked: $,
276
+ disabled: m,
277
+ onChange: (w) => b(S, w.target.checked)
278
278
  }
279
279
  ),
280
280
  /* @__PURE__ */ r("span", { className: "checkmark" }),
281
- /* @__PURE__ */ r("span", { children: k[s] })
281
+ /* @__PURE__ */ r("span", { children: v[s] })
282
282
  ]
283
283
  }
284
284
  )
285
- ] }, $);
285
+ ] }, S);
286
286
  })
287
287
  }
288
288
  ),
289
- S && /* @__PURE__ */ r("p", { className: "text-danger", children: String(S.message) })
289
+ D && /* @__PURE__ */ r("p", { className: "text-danger", children: String(D.message) })
290
290
  ] });
291
291
  }
292
292
  function Pe({
@@ -295,68 +295,63 @@ function Pe({
295
295
  options: n = [],
296
296
  valueKey: i = "value",
297
297
  labelKey: s = "label",
298
- iconKey: c = "icon",
298
+ iconKey: d = "icon",
299
299
  forceReadOnly: l = !1,
300
300
  forceHidden: o = !1,
301
- valueManual: v,
301
+ valueManual: g,
302
302
  onChangeManual: a,
303
- errorManual: w
303
+ errorManual: N
304
304
  }) {
305
- var g;
306
- const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W, isReadOnly: h } = L();
307
- let y = null, u = null;
308
- if (!p)
309
- try {
310
- const { control: S } = H(), N = X({ name: e, control: S });
311
- y = N.field, u = (g = N.fieldState) == null ? void 0 : g.error;
312
- } catch {
313
- }
314
- const m = _ || h || W, d = p ? v : (y == null ? void 0 : y.value) ?? "", f = C(
315
- (S) => {
316
- m || (p ? a == null || a(S) : y == null || y.onChange(S));
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;
308
+ try {
309
+ f = H();
310
+ } catch {
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));
317
317
  },
318
- [m, p, a, y]
318
+ [h, y, a, u]
319
319
  );
320
320
  return /* @__PURE__ */ x("div", { className: `form-group column ${P ? "hidden" : ""}`, children: [
321
321
  t && /* @__PURE__ */ r("label", { className: "control-label", children: t }),
322
- /* @__PURE__ */ r(
323
- "div",
324
- {
325
- className: `btn-group ${m ? "view-mode" : ""}`,
326
- "data-field-name": e,
327
- children: n.map((S) => {
328
- const N = S[i], O = d === N, k = S.color ? { "--customColor": S.color } : void 0;
329
- return /* @__PURE__ */ x(
330
- "label",
331
- {
332
- htmlFor: `${e}_${N}`,
333
- style: k,
334
- className: `btn fs-ellipsis ${O ? "active" : ""}`,
335
- children: [
336
- /* @__PURE__ */ r(
337
- "input",
338
- {
339
- type: "radio",
340
- id: `${e}_${N}`,
341
- name: e,
342
- value: N,
343
- checked: O,
344
- className: "hidden",
345
- onChange: () => f(N),
346
- disabled: m
347
- }
348
- ),
349
- S[c] && /* @__PURE__ */ r("i", { className: `${S[c]} icon-sm` }),
350
- " ",
351
- S[s]
352
- ]
353
- },
354
- N
355
- );
356
- })
357
- }
358
- ),
359
- (u || w) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? w) })
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
352
+ );
353
+ }) }),
354
+ (m || N) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((m == null ? void 0 : m.message) ?? N) })
360
355
  ] });
361
356
  }
362
357
  const jt = z(Pe), $e = ({
@@ -365,60 +360,60 @@ const jt = z(Pe), $e = ({
365
360
  placeholder: n = "",
366
361
  className: i = "",
367
362
  rows: s = 4,
368
- maxLength: c,
363
+ maxLength: d,
369
364
  forceReadOnly: l = !1,
370
365
  forceHidden: o = !1,
371
- valueManual: v,
366
+ valueManual: g,
372
367
  onChangeManual: a,
373
- errorManual: w
368
+ errorManual: N
374
369
  }) => {
375
- var f;
376
- const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W } = L(), h = G(null);
377
- let y = {
378
- value: v ?? "",
379
- onChange: (g) => a == null ? void 0 : a(g)
380
- }, u = null;
381
- if (!p)
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)
382
377
  try {
383
- const { control: g } = H(), S = X({ name: e, control: g });
384
- y = S.field, u = (f = S.fieldState) == null ? void 0 : f.error;
378
+ const { control: b } = H(), D = X({ name: e, control: b });
379
+ u = D.field, m = (h = D.fieldState) == null ? void 0 : h.error;
385
380
  } catch {
386
381
  }
387
- const m = () => {
388
- h.current && (h.current.style.height = "auto", h.current.style.height = `${h.current.scrollHeight}px`);
382
+ const f = () => {
383
+ p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
389
384
  };
390
385
  if (E(() => {
391
- m();
392
- }, [y.value]), W)
386
+ f();
387
+ }, [u.value]), A)
393
388
  return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
394
389
  /* @__PURE__ */ r("label", { children: t }),
395
- /* @__PURE__ */ r("span", { className: "form-control", children: y.value || "-" })
390
+ /* @__PURE__ */ r("span", { className: "form-control", children: u.value || "-" })
396
391
  ] });
397
- const d = `form-control ${_ ? "readOnly" : ""} ${u || w ? "border-red" : ""} ${i}`;
392
+ const c = `form-control ${_ ? "readOnly" : ""} ${m || N ? "border-red" : ""} ${i}`;
398
393
  return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
399
394
  t && /* @__PURE__ */ r("label", { children: t }),
400
395
  /* @__PURE__ */ r(
401
396
  "textarea",
402
397
  {
403
- ref: h,
398
+ ref: p,
404
399
  rows: s,
405
- maxLength: c,
406
- value: y.value || "",
400
+ maxLength: d,
401
+ value: u.value || "",
407
402
  placeholder: n,
408
403
  readOnly: _,
409
- className: d,
404
+ className: c,
410
405
  style: {
411
406
  resize: "none",
412
407
  maxHeight: "400px",
413
408
  overflowY: "auto"
414
409
  },
415
- onChange: (g) => {
416
- p ? a == null || a(g.target.value) : y.onChange(g);
410
+ onChange: (b) => {
411
+ y ? a == null || a(b.target.value) : u.onChange(b);
417
412
  },
418
- onInput: m
413
+ onInput: f
419
414
  }
420
415
  ),
421
- (u || w) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? w) })
416
+ (m || N) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((m == null ? void 0 : m.message) ?? N) })
422
417
  ] });
423
418
  }, Ct = z($e);
424
419
  function J(e) {
@@ -438,26 +433,26 @@ function Q(e) {
438
433
  const l = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
439
434
  s = e.values[o] || e.values[l];
440
435
  }
441
- const c = e.argumentCallback ? e.argumentCallback(t) : t;
442
- return s[c];
436
+ const d = e.argumentCallback ? e.argumentCallback(t) : t;
437
+ return s[d];
443
438
  };
444
439
  }
445
440
  function Y(e) {
446
441
  return (t, n = {}) => {
447
- const i = n.width, s = i && e.matchPatterns[i] || e.matchPatterns[e.defaultMatchWidth], c = t.match(s);
448
- if (!c)
442
+ const i = n.width, s = i && e.matchPatterns[i] || e.matchPatterns[e.defaultMatchWidth], d = t.match(s);
443
+ if (!d)
449
444
  return null;
450
- const l = c[0], o = i && e.parsePatterns[i] || e.parsePatterns[e.defaultParseWidth], v = Array.isArray(o) ? Oe(o, (p) => p.test(l)) : (
445
+ const l = d[0], o = i && e.parsePatterns[i] || e.parsePatterns[e.defaultParseWidth], g = Array.isArray(o) ? Oe(o, (y) => y.test(l)) : (
451
446
  // [TODO] -- I challenge you to fix the type
452
- _e(o, (p) => p.test(l))
447
+ _e(o, (y) => y.test(l))
453
448
  );
454
449
  let a;
455
- a = e.valueCallback ? e.valueCallback(v) : v, a = n.valueCallback ? (
450
+ a = e.valueCallback ? e.valueCallback(g) : g, a = n.valueCallback ? (
456
451
  // [TODO] -- I challenge you to fix the type
457
452
  n.valueCallback(a)
458
453
  ) : a;
459
- const w = t.slice(l.length);
460
- return { value: a, rest: w };
454
+ const N = t.slice(l.length);
455
+ return { value: a, rest: N };
461
456
  };
462
457
  }
463
458
  function _e(e, t) {
@@ -474,9 +469,9 @@ function Ae(e) {
474
469
  return (t, n = {}) => {
475
470
  const i = t.match(e.matchPattern);
476
471
  if (!i) return null;
477
- const s = i[0], c = t.match(e.parsePattern);
478
- if (!c) return null;
479
- let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
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];
480
475
  l = n.valueCallback ? n.valueCallback(l) : l;
481
476
  const o = t.slice(s.length);
482
477
  return { value: l, rest: o };
@@ -876,7 +871,7 @@ const ot = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
876
871
  * This source code is licensed under the ISC license.
877
872
  * See the LICENSE file in the root directory of this source tree.
878
873
  */
879
- const dt = (e) => e.replace(
874
+ const ct = (e) => e.replace(
880
875
  /^([A-Z])|[\s-_]+(\w)/g,
881
876
  (t, n, i) => i ? i.toUpperCase() : n.toLowerCase()
882
877
  );
@@ -887,7 +882,7 @@ const dt = (e) => e.replace(
887
882
  * See the LICENSE file in the root directory of this source tree.
888
883
  */
889
884
  const re = (e) => {
890
- const t = dt(e);
885
+ const t = ct(e);
891
886
  return t.charAt(0).toUpperCase() + t.slice(1);
892
887
  };
893
888
  /**
@@ -896,7 +891,7 @@ const re = (e) => {
896
891
  * This source code is licensed under the ISC license.
897
892
  * See the LICENSE file in the root directory of this source tree.
898
893
  */
899
- var ct = {
894
+ var dt = {
900
895
  xmlns: "http://www.w3.org/2000/svg",
901
896
  width: 24,
902
897
  height: 24,
@@ -932,25 +927,25 @@ const ut = se(
932
927
  strokeWidth: n = 2,
933
928
  absoluteStrokeWidth: i,
934
929
  className: s = "",
935
- children: c,
930
+ children: d,
936
931
  iconNode: l,
937
932
  ...o
938
- }, v) => Z(
933
+ }, g) => Z(
939
934
  "svg",
940
935
  {
941
- ref: v,
942
- ...ct,
936
+ ref: g,
937
+ ...dt,
943
938
  width: t,
944
939
  height: t,
945
940
  stroke: e,
946
941
  strokeWidth: i ? Number(n) * 24 / Number(t) : n,
947
942
  className: ie("lucide", s),
948
- ...!c && !lt(o) && { "aria-hidden": "true" },
943
+ ...!d && !lt(o) && { "aria-hidden": "true" },
949
944
  ...o
950
945
  },
951
946
  [
952
- ...l.map(([a, w]) => Z(a, w)),
953
- ...Array.isArray(c) ? c : [c]
947
+ ...l.map(([a, N]) => Z(a, N)),
948
+ ...Array.isArray(d) ? d : [d]
954
949
  ]
955
950
  )
956
951
  );
@@ -962,8 +957,8 @@ const ut = se(
962
957
  */
963
958
  const M = (e, t) => {
964
959
  const n = se(
965
- ({ className: i, ...s }, c) => Z(ut, {
966
- ref: c,
960
+ ({ className: i, ...s }, d) => Z(ut, {
961
+ ref: d,
967
962
  iconNode: t,
968
963
  className: ie(
969
964
  `lucide-${ot(re(e))}`,
@@ -1022,26 +1017,26 @@ const ae = "dd/MM/yyyy", bt = (e) => {
1022
1017
  placeholder: n = "dd/mm/aaaa",
1023
1018
  className: i = "",
1024
1019
  forceReadOnly: s = !1,
1025
- forceHidden: c = !1,
1020
+ forceHidden: d = !1,
1026
1021
  valueManual: l,
1027
1022
  onChangeManual: o,
1028
- errorManual: v
1023
+ errorManual: g
1029
1024
  }) => {
1030
- var k;
1031
- const [a, w] = F(!1), [p, V] = F(/* @__PURE__ */ new Date()), D = gt(() => w(!1)), _ = l !== void 0 && !!o;
1025
+ var v;
1026
+ const [a, N] = F(!1), [y, W] = F(/* @__PURE__ */ new Date()), V = gt(() => N(!1)), _ = l !== void 0 && !!o;
1032
1027
  let P = null;
1033
1028
  try {
1034
1029
  P = H();
1035
1030
  } catch {
1036
1031
  }
1037
- const { isView: W } = L(), { isReadOnly: h, isHidden: y } = I(), u = s || !!h(e), m = c || !!y(e), d = !_ && P ? X({ name: e, control: P.control }) : null, f = _ ? l : d == null ? void 0 : d.field.value, g = _ ? v : (k = d == null ? void 0 : d.fieldState.error) == null ? void 0 : k.message, S = B(() => bt(f), [f]), N = ($) => {
1038
- if (u) return;
1039
- const A = wt($);
1040
- _ ? o == null || o(A) : d == null || d.field.onChange(A), w(!1);
1041
- }, O = ($) => {
1042
- const A = he({
1043
- start: ye(ve($)),
1044
- end: fe(pe($))
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))
1045
1040
  });
1046
1041
  return /* @__PURE__ */ x("div", { className: "dfe-calendar-pane", children: [
1047
1042
  /* @__PURE__ */ x("div", { className: "dfe-calendar-header", children: [
@@ -1049,51 +1044,51 @@ const ae = "dd/MM/yyyy", bt = (e) => {
1049
1044
  "button",
1050
1045
  {
1051
1046
  type: "button",
1052
- onClick: (b) => {
1053
- b.stopPropagation(), V(ge(p, 1));
1047
+ onClick: (w) => {
1048
+ w.stopPropagation(), W(ge(y, 1));
1054
1049
  },
1055
1050
  className: "dfe-nav-btn",
1056
1051
  children: /* @__PURE__ */ r(pt, { size: 16 })
1057
1052
  }
1058
1053
  ),
1059
- /* @__PURE__ */ r("span", { className: "dfe-month-label", children: K($, "MMMM yyyy", { locale: at }) }),
1054
+ /* @__PURE__ */ r("span", { className: "dfe-month-label", children: K(S, "MMMM yyyy", { locale: at }) }),
1060
1055
  /* @__PURE__ */ r(
1061
1056
  "button",
1062
1057
  {
1063
1058
  type: "button",
1064
- onClick: (b) => {
1065
- b.stopPropagation(), V(be(p, 1));
1059
+ onClick: (w) => {
1060
+ w.stopPropagation(), W(be(y, 1));
1066
1061
  },
1067
1062
  className: "dfe-nav-btn",
1068
1063
  children: /* @__PURE__ */ r(vt, { size: 16 })
1069
1064
  }
1070
1065
  )
1071
1066
  ] }),
1072
- /* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b, j) => /* @__PURE__ */ r("span", { children: b }, j)) }),
1073
- /* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children: A.map((b, j) => {
1074
- const q = !we(b, $), U = S && Ne(b, S);
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);
1075
1070
  return /* @__PURE__ */ r(
1076
1071
  "div",
1077
1072
  {
1078
- onClick: () => !q && N(b),
1073
+ onClick: () => !q && O(w),
1079
1074
  className: `dfe-calendar-day
1080
1075
  ${U ? "selected" : ""}
1081
1076
  ${q ? "outside" : ""}
1082
- ${ke(b) ? "today" : ""}`,
1083
- children: K(b, "d")
1077
+ ${ke(w) ? "today" : ""}`,
1078
+ children: K(w, "d")
1084
1079
  },
1085
1080
  j
1086
1081
  );
1087
1082
  }) })
1088
1083
  ] });
1089
1084
  };
1090
- return m ? null : W ? /* @__PURE__ */ x("div", { className: `form-group ${i}`, children: [
1085
+ return f ? null : A ? /* @__PURE__ */ x("div", { className: `form-group ${i}`, children: [
1091
1086
  t && /* @__PURE__ */ r("label", { children: t }),
1092
- /* @__PURE__ */ r("span", { className: "form-control readOnly", style: { display: "block", height: "auto" }, children: f || "-" })
1087
+ /* @__PURE__ */ r("span", { className: "form-control readOnly", style: { display: "block", height: "auto" }, children: h || "-" })
1093
1088
  ] }) : /* @__PURE__ */ x(
1094
1089
  "div",
1095
1090
  {
1096
- ref: D,
1091
+ ref: V,
1097
1092
  className: `form-group dfe-datepicker-container ${i}`,
1098
1093
  style: { position: "relative" },
1099
1094
  children: [
@@ -1101,21 +1096,21 @@ const ae = "dd/MM/yyyy", bt = (e) => {
1101
1096
  /* @__PURE__ */ x(
1102
1097
  "div",
1103
1098
  {
1104
- className: `form-control dfe-datepicker-trigger ${g ? "border-red" : ""} ${u ? "disabled" : ""}`,
1105
- onClick: () => !u && w(!a),
1099
+ className: `form-control dfe-datepicker-trigger ${b ? "border-red" : ""} ${m ? "disabled" : ""}`,
1100
+ onClick: () => !m && N(!a),
1106
1101
  style: {
1107
1102
  display: "flex",
1108
1103
  alignItems: "center",
1109
- cursor: u ? "default" : "pointer"
1104
+ cursor: m ? "default" : "pointer"
1110
1105
  },
1111
1106
  children: [
1112
1107
  /* @__PURE__ */ r(ht, { size: 16, className: "dfe-calendar-icon", style: { marginRight: "8px", opacity: 0.5 } }),
1113
- /* @__PURE__ */ r("span", { children: f || n })
1108
+ /* @__PURE__ */ r("span", { children: h || n })
1114
1109
  ]
1115
1110
  }
1116
1111
  ),
1117
- a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children: O(p) }) }),
1118
- g && /* @__PURE__ */ r("p", { className: "text-danger", children: String(g) })
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) })
1119
1114
  ]
1120
1115
  }
1121
1116
  );
@@ -1127,7 +1122,7 @@ function kt({
1127
1122
  hidden: i = !1,
1128
1123
  label: s
1129
1124
  }) {
1130
- const { activityId: c } = L(), l = B(() => !e || c === null || c === void 0 ? null : e[c], [c, e]);
1125
+ const { activityId: d } = L(), l = B(() => !e || d === null || d === void 0 ? null : e[d], [d, e]);
1131
1126
  if (!l)
1132
1127
  return /* @__PURE__ */ x("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
1133
1128
  s && /* @__PURE__ */ r("label", { children: s }),
@@ -1151,80 +1146,80 @@ function xt({
1151
1146
  defaultRowValue: n,
1152
1147
  isView: i,
1153
1148
  isReadOnly: s,
1154
- filters: c = []
1149
+ filters: d = []
1155
1150
  }) {
1156
- const { field: l } = X({ name: e, control: t }), [o, v] = F([]), [a, w] = F([]), p = () => Date.now() + Math.random(), V = (m) => {
1151
+ const { field: l } = X({ name: e, control: t }), [o, g] = F([]), [a, N] = F([]), y = () => Date.now() + Math.random(), W = (f) => {
1157
1152
  try {
1158
- const d = JSON.parse(m);
1159
- return Array.isArray(d) ? d.map((f) => ({
1160
- ...f,
1161
- _uid: f._uid || p()
1153
+ const c = JSON.parse(f);
1154
+ return Array.isArray(c) ? c.map((h) => ({
1155
+ ...h,
1156
+ _uid: h._uid || y()
1162
1157
  })) : [];
1163
- } catch (d) {
1164
- return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
1158
+ } catch (c) {
1159
+ return console.error(`Erro ao ler dados da tabela "${e}":`, c), [];
1165
1160
  }
1166
1161
  };
1167
1162
  E(() => {
1168
1163
  if (!(o.length > 0 && !i) && l.value && typeof l.value == "string") {
1169
- const m = JSON.stringify(o);
1170
- if (l.value === m) return;
1171
- const d = V(l.value);
1172
- v(d);
1164
+ const f = JSON.stringify(o);
1165
+ if (l.value === f) return;
1166
+ const c = W(l.value);
1167
+ g(c);
1173
1168
  }
1174
1169
  }, [l.value, i]), E(() => {
1175
1170
  if (s) return;
1176
- const m = JSON.stringify(o);
1177
- l.value !== m && l.onChange(m);
1171
+ const f = JSON.stringify(o);
1172
+ l.value !== f && l.onChange(f);
1178
1173
  }, [o, l, s]);
1179
- const D = C(() => {
1180
- const m = { _uid: p(), ...n };
1181
- v((d) => [...d, m]);
1174
+ const V = C(() => {
1175
+ const f = { _uid: y(), ...n };
1176
+ g((c) => [...c, f]);
1182
1177
  }, [n]), _ = C(() => {
1183
- v((m) => m.filter((d) => !a.includes(d._uid))), w([]);
1184
- }, [a]), P = C((m, d, f) => {
1185
- v((g) => g.map((S) => S._uid === m ? { ...S, [d]: f } : S));
1186
- }, []), W = C((m) => {
1187
- w((d) => d.includes(m) ? d.filter((f) => f !== m) : [...d, m]);
1188
- }, []), h = C(
1189
- (m) => {
1190
- w(m ? o.map((d) => d._uid) : []);
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]);
1183
+ }, []), p = C(
1184
+ (f) => {
1185
+ N(f ? o.map((c) => c._uid) : []);
1191
1186
  },
1192
1187
  [o]
1193
- ), y = o.length > 0 && a.length === o.length, u = B(() => !c || c.length === 0 ? o : o.filter(
1194
- (m) => c.every((d) => {
1195
- if ("custom" in d)
1196
- return d.custom(m);
1197
- const f = m[d.field];
1198
- switch (d.operator) {
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) {
1199
1194
  case "===":
1200
- return f === d.value;
1195
+ return h === c.value;
1201
1196
  case "!==":
1202
- return f !== d.value;
1197
+ return h !== c.value;
1203
1198
  case ">":
1204
- return f > d.value;
1199
+ return h > c.value;
1205
1200
  case "<":
1206
- return f < d.value;
1201
+ return h < c.value;
1207
1202
  case ">=":
1208
- return f >= d.value;
1203
+ return h >= c.value;
1209
1204
  case "<=":
1210
- return f <= d.value;
1205
+ return h <= c.value;
1211
1206
  default:
1212
1207
  return !0;
1213
1208
  }
1214
1209
  })
1215
- ), [o, c]);
1210
+ ), [o, d]);
1216
1211
  return {
1217
1212
  field: l,
1218
1213
  tableRows: o,
1219
- visibleRows: u,
1214
+ visibleRows: m,
1220
1215
  selectedRowIds: a,
1221
- isAllSelected: y,
1216
+ isAllSelected: u,
1222
1217
  handle: {
1223
- addRow: D,
1218
+ addRow: V,
1224
1219
  removeRows: _,
1225
1220
  updateCellValue: P,
1226
- toggleSelection: W,
1227
- toggleSelectAll: h
1221
+ toggleSelection: A,
1222
+ toggleSelectAll: p
1228
1223
  }
1229
1224
  };
1230
1225
  }
@@ -1234,30 +1229,30 @@ const Lt = ({
1234
1229
  columns: n,
1235
1230
  defaultRowValue: i = {},
1236
1231
  forceReadOnly: s = !1,
1237
- layout: c = "fluid",
1232
+ layout: d = "fluid",
1238
1233
  actions: l = !0,
1239
1234
  filters: o = []
1240
1235
  }) => {
1241
- const { control: v } = H(), { isView: a, isReadOnly: w } = L(), { isReadOnly: p } = I(), V = s || a || w || p && p(e), { field: D, visibleRows: _, selectedRowIds: P, isAllSelected: W, handle: h } = xt({
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({
1242
1237
  name: e,
1243
- control: v,
1238
+ control: g,
1244
1239
  defaultRowValue: i,
1245
1240
  isView: a,
1246
- isReadOnly: !!V,
1241
+ isReadOnly: !!W,
1247
1242
  filters: o
1248
- }), y = c === "fixed";
1249
- return /* @__PURE__ */ x("div", { className: `table-wrapper ${y ? "table-fixed" : "table-fluid"}`, children: [
1250
- /* @__PURE__ */ r("input", { type: "hidden", ...D }),
1243
+ }), u = d === "fixed";
1244
+ return /* @__PURE__ */ x("div", { className: `table-wrapper ${u ? "table-fixed" : "table-fluid"}`, children: [
1245
+ /* @__PURE__ */ r("input", { type: "hidden", ...V }),
1251
1246
  /* @__PURE__ */ x("div", { className: "header-handle", children: [
1252
1247
  /* @__PURE__ */ r("h3", { children: t }),
1253
- !V && l && /* @__PURE__ */ x("div", { className: "handle-actions", children: [
1248
+ !W && l && /* @__PURE__ */ x("div", { className: "handle-actions", children: [
1254
1249
  /* @__PURE__ */ x(
1255
1250
  "button",
1256
1251
  {
1257
1252
  type: "button",
1258
1253
  className: `btn ${P.length > 0 ? "btn-danger" : "btn-primary"}`,
1259
1254
  disabled: P.length === 0,
1260
- onClick: h.removeRows,
1255
+ onClick: p.removeRows,
1261
1256
  children: [
1262
1257
  "Remover (",
1263
1258
  P.length,
@@ -1265,53 +1260,53 @@ const Lt = ({
1265
1260
  ]
1266
1261
  }
1267
1262
  ),
1268
- /* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick: h.addRow, children: "Adicionar" })
1263
+ /* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick: p.addRow, children: "Adicionar" })
1269
1264
  ] })
1270
1265
  ] }),
1271
1266
  /* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */ x("table", { className: "table-custom", children: [
1272
1267
  /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ x("tr", { children: [
1273
- !V && /* @__PURE__ */ r("th", { style: { width: "50px" }, children: /* @__PURE__ */ r(
1268
+ !W && /* @__PURE__ */ r("th", { style: { width: "50px" }, children: /* @__PURE__ */ r(
1274
1269
  "input",
1275
1270
  {
1276
1271
  type: "checkbox",
1277
- checked: W,
1278
- onChange: (u) => h.toggleSelectAll(u.target.checked)
1272
+ checked: A,
1273
+ onChange: (m) => p.toggleSelectAll(m.target.checked)
1279
1274
  }
1280
1275
  ) }),
1281
- n.map((u) => /* @__PURE__ */ r(
1276
+ n.map((m) => /* @__PURE__ */ r(
1282
1277
  "th",
1283
1278
  {
1284
- style: u.width ? { minWidth: y ? u.width : "100%" } : { width: "max-content" },
1285
- children: u.label
1279
+ style: m.width ? { minWidth: u ? m.width : "100%" } : { width: "max-content" },
1280
+ children: m.label
1286
1281
  },
1287
- String(u.key)
1282
+ String(m.key)
1288
1283
  ))
1289
1284
  ] }) }),
1290
1285
  /* @__PURE__ */ x("tbody", { children: [
1291
- _.map((u, m) => /* @__PURE__ */ x("tr", { children: [
1292
- !V && /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r(
1286
+ _.map((m, f) => /* @__PURE__ */ x("tr", { children: [
1287
+ !W && /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r(
1293
1288
  "input",
1294
1289
  {
1295
1290
  type: "checkbox",
1296
- checked: P.includes(u._uid),
1297
- onChange: () => h.toggleSelection(u._uid)
1291
+ checked: P.includes(m._uid),
1292
+ onChange: () => p.toggleSelection(m._uid)
1298
1293
  }
1299
1294
  ) }),
1300
- n.map((d) => /* @__PURE__ */ r("td", { children: d.render ? d.render.length <= 1 ? d.render({
1301
- row: u,
1302
- index: m,
1303
- updateRow: (f, g) => h.updateCellValue(u._uid, String(f), g),
1304
- isLocked: !!V,
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),
1299
+ isLocked: !!W,
1305
1300
  isView: !!a
1306
- }) : d.render(
1307
- u,
1301
+ }) : c.render(
1308
1302
  m,
1309
- (f, g) => h.updateCellValue(u._uid, f, g),
1310
- !!V,
1303
+ f,
1304
+ (h, b) => p.updateCellValue(m._uid, h, b),
1305
+ !!W,
1311
1306
  !!a
1312
- ) : u[d.key] }, `${u._uid}-${String(d.key)}`))
1313
- ] }, u._uid)),
1314
- _.length === 0 && /* @__PURE__ */ r("tr", { className: "empty-row", children: /* @__PURE__ */ r("td", { colSpan: 100, className: "text-center", children: V ? "Nenhum registro encontrado." : "Nenhum registro." }) })
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." }) })
1315
1310
  ] })
1316
1311
  ] }) })
1317
1312
  ] });
@@ -1322,18 +1317,18 @@ const Lt = ({
1322
1317
  s = H().watch;
1323
1318
  } catch {
1324
1319
  }
1325
- const c = t !== void 0 ? t : s ? s(e) : void 0, l = C(() => {
1320
+ const d = t !== void 0 ? t : s ? s(e) : void 0, l = C(() => {
1326
1321
  try {
1327
- const v = window.top.__REACT_ATTACHMENT_BRIDGE__;
1328
- if (v) {
1329
- const a = v.getAttachment(e, c);
1330
- i(a || (c ? { name: c, documentId: 0 } : null));
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));
1331
1326
  } else
1332
- i(c ? { name: c, documentId: 0 } : null);
1327
+ i(d ? { name: d, documentId: 0 } : null);
1333
1328
  } catch {
1334
- i(c ? { name: c, documentId: 0 } : null);
1329
+ i(d ? { name: d, documentId: 0 } : null);
1335
1330
  }
1336
- }, [e, c, t]);
1331
+ }, [e, d, t]);
1337
1332
  return E(() => {
1338
1333
  l();
1339
1334
  const o = setInterval(l, 2e3);
@@ -1345,99 +1340,99 @@ const Lt = ({
1345
1340
  help: n,
1346
1341
  valueManual: i,
1347
1342
  onChangeManual: s,
1348
- forceReadOnly: c = !1,
1343
+ forceReadOnly: d = !1,
1349
1344
  forceHidden: l = !1
1350
1345
  }) => {
1351
- const o = !!s, { isReadOnly: v, isHidden: a } = I(), { isView: w } = L(), p = c || w || !!v(e), V = l || !!a(e), [D, _] = F(!1);
1346
+ const o = !!s, { isReadOnly: g, isHidden: a } = I(), { isView: N } = L(), y = d || N || !!g(e), W = l || !!a(e), [V, _] = F(!1);
1352
1347
  let P = null;
1353
1348
  try {
1354
1349
  P = H().control;
1355
1350
  } catch {
1356
1351
  }
1357
- const W = P && !o ? X({ name: e, control: P }).field : {
1352
+ const A = P && !o ? X({ name: e, control: P }).field : {
1358
1353
  value: i,
1359
- onChange: (N) => s == null ? void 0 : s(N)
1360
- }, { attachment: h, sync: y } = St(e, i), u = () => {
1361
- var N;
1354
+ onChange: (O) => s == null ? void 0 : s(O)
1355
+ }, { attachment: p, sync: u } = St(e, i), m = () => {
1356
+ var O;
1362
1357
  try {
1363
- const O = window.top;
1358
+ const k = window.top;
1364
1359
  return {
1365
- bridge: O.__REACT_ATTACHMENT_BRIDGE__,
1366
- toast: (N = O.FLUIGC) == null ? void 0 : N.toast
1360
+ bridge: k.__REACT_ATTACHMENT_BRIDGE__,
1361
+ toast: (O = k.FLUIGC) == null ? void 0 : O.toast
1367
1362
  };
1368
1363
  } catch {
1369
1364
  return { bridge: null, toast: null };
1370
1365
  }
1371
- }, m = C(() => {
1372
- if (p) return;
1373
- const N = document.createElement("input");
1374
- N.type = "file", N.onchange = (O) => {
1375
- const k = O.target.files[0];
1376
- if (!k) return;
1377
- const { bridge: $, toast: A } = u();
1378
- _(!0), $ ? $.upload(k, e, (b) => {
1379
- o ? s == null || s(b.name) : W.onChange(b.name), setTimeout(() => {
1380
- _(!1), y();
1381
- }, 1e3), A && A({
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), $ && $({
1382
1377
  title: "Sucesso",
1383
1378
  message: "Arquivo enviado",
1384
1379
  type: "success"
1385
1380
  });
1386
- }) : (o ? s == null || s(k.name) : W.onChange(k.name), _(!1));
1387
- }, N.click();
1388
- }, [e, W, y, s, p, o]), d = (N) => {
1389
- if (N.stopPropagation(), p) return;
1390
- const O = (h == null ? void 0 : h.name) || i || W.value;
1391
- if (!O) return;
1392
- const { bridge: k, toast: $ } = u();
1393
- k ? k.removeByFileName(O) ? (o ? s == null || s("") : W.onChange(""), y()) : $ && $({
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({
1394
1389
  title: "Erro",
1395
1390
  message: "Erro ao remover anexo",
1396
1391
  type: "danger"
1397
- }) : (o ? s == null || s("") : W.onChange(""), y());
1398
- }, f = !!h && !D, g = (h == null ? void 0 : h.name) || i || W.value, S = [
1392
+ }) : (o ? s == null || s("") : A.onChange(""), u());
1393
+ }, h = !!p && !V, b = (p == null ? void 0 : p.name) || i || A.value, D = [
1399
1394
  "fluig-attachment__box",
1400
- f ? "fluig-attachment__box--has-file" : "",
1401
- D ? "fluig-attachment__box--uploading" : "",
1402
- p && !f ? "readOnly" : "",
1403
- p && f ? "fluig-attachment__box--readonly-view" : ""
1395
+ h ? "fluig-attachment__box--has-file" : "",
1396
+ V ? "fluig-attachment__box--uploading" : "",
1397
+ y && !h ? "readOnly" : "",
1398
+ y && h ? "fluig-attachment__box--readonly-view" : ""
1404
1399
  ].join(" ");
1405
- return V ? null : /* @__PURE__ */ x("div", { className: "form-group fluig-attachment", children: [
1400
+ return W ? null : /* @__PURE__ */ x("div", { className: "form-group fluig-attachment", children: [
1406
1401
  t && /* @__PURE__ */ r("label", { className: "fluig-attachment__label", children: t }),
1407
1402
  /* @__PURE__ */ x(
1408
1403
  "div",
1409
1404
  {
1410
- className: S,
1405
+ className: D,
1411
1406
  onClick: () => {
1412
- if (f) {
1413
- const N = u(), O = (h == null ? void 0 : h.physicalFileName) || (h == null ? void 0 : h.description) || (h == null ? void 0 : h.name) || g;
1414
- N.bridge && O && N.bridge.view(O);
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);
1415
1410
  } else
1416
- m();
1411
+ f();
1417
1412
  },
1418
1413
  children: [
1419
1414
  /* @__PURE__ */ x("span", { className: "fluig-attachment__content", children: [
1420
1415
  /* @__PURE__ */ r(
1421
1416
  "i",
1422
1417
  {
1423
- className: `flaticon icon-sm ${D ? "flaticon-loading" : f ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1418
+ className: `flaticon icon-sm ${V ? "flaticon-loading" : h ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1424
1419
  }
1425
1420
  ),
1426
- /* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: D ? " Enviando..." : f ? g : p ? "Nenhum arquivo" : n || "Anexar" })
1421
+ /* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: V ? " Enviando..." : h ? b : y ? "Nenhum arquivo" : n || "Anexar" })
1427
1422
  ] }),
1428
- f && !p && /* @__PURE__ */ r(
1423
+ h && !y && /* @__PURE__ */ r(
1429
1424
  "button",
1430
1425
  {
1431
1426
  type: "button",
1432
1427
  className: "fluig-attachment__btn-remove btn btn-link text-danger",
1433
- onClick: d,
1428
+ onClick: c,
1434
1429
  children: /* @__PURE__ */ r("i", { className: "flaticon flaticon-trash icon-sm" })
1435
1430
  }
1436
1431
  )
1437
1432
  ]
1438
1433
  }
1439
1434
  ),
1440
- !o && P && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: W.value || "" })
1435
+ !o && P && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: A.value || "" })
1441
1436
  ] });
1442
1437
  }, Ft = z(Rt);
1443
1438
  function It({
@@ -1446,12 +1441,12 @@ function It({
1446
1441
  onOpen: n,
1447
1442
  onClose: i,
1448
1443
  content: s,
1449
- footer: c,
1444
+ footer: d,
1450
1445
  width: l
1451
1446
  }) {
1452
1447
  const o = C(
1453
- (v) => {
1454
- v.key === "Escape" && i();
1448
+ (g) => {
1449
+ g.key === "Escape" && i();
1455
1450
  },
1456
1451
  [i]
1457
1452
  );
@@ -1469,7 +1464,7 @@ function It({
1469
1464
  {
1470
1465
  style: { maxWidth: l },
1471
1466
  className: "modal-container",
1472
- onClick: (v) => v.stopPropagation(),
1467
+ onClick: (g) => g.stopPropagation(),
1473
1468
  children: [
1474
1469
  /* @__PURE__ */ x("div", { className: "modal-header", children: [
1475
1470
  /* @__PURE__ */ r("h3", { children: e }),
@@ -1491,7 +1486,7 @@ function It({
1491
1486
  )
1492
1487
  ] }),
1493
1488
  /* @__PURE__ */ r("div", { className: "modal-content", children: s }),
1494
- c && /* @__PURE__ */ r("div", { className: "modal-footer", children: c })
1489
+ d && /* @__PURE__ */ r("div", { className: "modal-footer", children: d })
1495
1490
  ]
1496
1491
  }
1497
1492
  )