diefra_ecm_ui 1.0.2 → 1.0.3

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