diefra_ecm_ui 1.2.1 → 1.2.2

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,36 +1,36 @@
1
- import { jsx as e, jsxs as p, Fragment as ce } from "react/jsx-runtime";
2
- import { useCallback as P, useEffect as j, memo as q, useState as U, useMemo as Y, useRef as X, forwardRef as oe, createElement as M } from "react";
3
- import { useFormContext as J, useController as Q, useFormState as de } from "react-hook-form";
1
+ import { jsx as e, jsxs as v, Fragment as oe } from "react/jsx-runtime";
2
+ import { useCallback as P, useEffect as T, memo as q, useState as z, useMemo as U, useRef as te, forwardRef as de, createElement as se } from "react";
3
+ import { useFormContext as W, useController as Z, useFormState as ae } from "react-hook-form";
4
4
  import { IMaskInput as pe } from "react-imask";
5
- import { useSection as G, useFluigRuntime as z } from "@fluig-kit/ecm";
6
- import { isValid as ae, eachDayOfInterval as ve, endOfWeek as ye, endOfMonth as be, startOfWeek as ge, startOfMonth as Ne, getYear as ke, subMonths as we, setMonth as _e, setYear as Oe, addMonths as Re, isSameMonth as Se, isSameDay as xe, format as ue, isToday as $e, parse as Ae } from "date-fns";
7
- function Ie({ title: t, isOpen: i, onOpen: a, onClose: u, content: c, footer: d, width: m }) {
5
+ import { useSection as G, useFluigRuntime as Y } from "@fluig-kit/ecm";
6
+ import { isValid as ue, eachDayOfInterval as ve, endOfWeek as ye, endOfMonth as ge, startOfWeek as be, startOfMonth as Ne, getYear as ke, subMonths as we, setMonth as xe, setYear as Se, addMonths as _e, isSameMonth as Re, isSameDay as Oe, format as fe, isToday as $e, parse as Ae } from "date-fns";
7
+ function Ie({ title: t, isOpen: n, onOpen: u, onClose: f, content: c, footer: d, width: m }) {
8
8
  const o = P(
9
- (v) => {
10
- v.key === "Escape" && u();
9
+ (g) => {
10
+ g.key === "Escape" && f();
11
11
  },
12
- [u]
12
+ [f]
13
13
  );
14
- return j(() => (i && (document.addEventListener("keydown", o), a == null || a(), document.body.style.overflow = "hidden"), () => {
14
+ return T(() => (n && (document.addEventListener("keydown", o), u == null || u(), document.body.style.overflow = "hidden"), () => {
15
15
  document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
16
- }), [i, o, a]), i ? /* @__PURE__ */ e("div", { className: "modal-overlay", onClick: u, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ p("div", { style: { maxWidth: m }, className: "modal-container", onClick: (v) => v.stopPropagation(), children: [
17
- /* @__PURE__ */ p("div", { className: "modal-header", children: [
16
+ }), [n, o, u]), n ? /* @__PURE__ */ e("div", { className: "modal-overlay", onClick: f, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ v("div", { style: { maxWidth: m }, className: "modal-container", onClick: (g) => g.stopPropagation(), children: [
17
+ /* @__PURE__ */ v("div", { className: "modal-header", children: [
18
18
  /* @__PURE__ */ e("h3", { children: t }),
19
- /* @__PURE__ */ e("div", { className: "btn-close-modal", onClick: u, role: "button", "aria-label": "Fechar modal", children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-close icon-sm", "aria-hidden": "true" }) })
19
+ /* @__PURE__ */ e("div", { className: "btn-close-modal", onClick: f, role: "button", "aria-label": "Fechar modal", children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-close icon-sm", "aria-hidden": "true" }) })
20
20
  ] }),
21
21
  /* @__PURE__ */ e("div", { className: "modal-content", children: c }),
22
22
  d && /* @__PURE__ */ e("div", { className: "modal-footer", children: d })
23
23
  ] }) }) : null;
24
24
  }
25
- function Ve({ text: t, title: i = "Ajuda & Informações", width: a = "500px", className: u = "" }) {
26
- const [c, d] = U(!1), m = (o) => {
25
+ function Ee({ text: t, title: n = "Ajuda & Informações", width: u = "500px", className: f = "" }) {
26
+ const [c, d] = z(!1), m = (o) => {
27
27
  o.preventDefault(), o.stopPropagation(), d(!0);
28
28
  };
29
- return /* @__PURE__ */ p(ce, { children: [
29
+ return /* @__PURE__ */ v(oe, { children: [
30
30
  /* @__PURE__ */ e(
31
31
  "div",
32
32
  {
33
- className: `dfe-help-indicator ${u}`,
33
+ className: `dfe-help-indicator ${f}`,
34
34
  onClick: m,
35
35
  role: "button",
36
36
  tabIndex: 0,
@@ -42,289 +42,329 @@ function Ve({ text: t, title: i = "Ajuda & Informações", width: a = "500px", c
42
42
  /* @__PURE__ */ e(
43
43
  Ie,
44
44
  {
45
- title: i,
45
+ title: n,
46
46
  isOpen: c,
47
47
  onClose: () => d(!1),
48
- width: a,
48
+ width: u,
49
49
  content: /* @__PURE__ */ e("div", { className: "dfe-help-modal-body", children: t }),
50
50
  footer: /* @__PURE__ */ e("div", { className: "dfe-help-modal-footer", children: /* @__PURE__ */ e("button", { type: "button", className: "btn btn-info dfe-help-btn", onClick: () => d(!1), children: "Entendido" }) })
51
51
  }
52
52
  )
53
53
  ] });
54
54
  }
55
- const Z = q(Ve), De = {
55
+ const ee = q(Ee), Ve = {
56
56
  cpf: "000.000.000-00",
57
57
  cnpj: "00.000.000/0000-00",
58
58
  telefone: "(00) 00000-0000",
59
59
  cep: "00000-000"
60
60
  };
61
- function Ee({
61
+ function De({
62
62
  name: t,
63
- label: i = "",
64
- placeholder: a = "",
65
- type: u = "text",
63
+ label: n = "",
64
+ placeholder: u = "",
65
+ type: f = "text",
66
66
  mask: c,
67
67
  className: d = "",
68
68
  forceReadOnly: m = !1,
69
69
  forceHidden: o = !1,
70
- helpText: v,
71
- helpTitle: l,
72
- helpWidth: y,
73
- valueManual: $,
74
- onChangeManual: R,
75
- errorManual: C
70
+ prefix: g,
71
+ suffix: r,
72
+ helpText: h,
73
+ helpTitle: O,
74
+ helpWidth: A,
75
+ valueManual: B,
76
+ onChangeManual: b,
77
+ errorManual: _
76
78
  }) {
77
- var L, W;
78
- const b = $ !== void 0 && !!R, { isReadOnly: S, isHidden: E } = G(), O = m || !!S(t), g = o || !!E(t), { isView: r } = z();
79
- let n = null;
79
+ var K, M;
80
+ const $ = B !== void 0 && !!b, { isReadOnly: R, isHidden: N } = G(), s = m || !!R(t), i = o || !!N(t), { isView: l } = Y();
81
+ let a = null;
80
82
  try {
81
- n = J();
83
+ a = W();
82
84
  } catch {
83
85
  }
84
- const s = !b && n ? Q({ name: t, control: n.control }) : null, f = !b && n ? de({ name: t }) : null, N = b ? $ : s == null ? void 0 : s.field.value, I = b ? C : (W = (L = f == null ? void 0 : f.errors) == null ? void 0 : L[t]) == null ? void 0 : W.message, B = Y(() => c ? De[c] ?? c : null, [c]), V = P((H) => {
85
- if (!H) return "";
86
- const F = H.replace(/\D/g, "");
87
- return (Number(F) / 100).toFixed(2);
88
- }, []), _ = P((H) => {
89
- if (H === "" || H === null || H === void 0) return "";
90
- const F = Number(H);
91
- return isNaN(F) ? "" : F.toLocaleString("pt-BR", {
86
+ const p = !$ && a ? Z({ name: t, control: a.control }) : null, V = !$ && a ? ae({ name: t }) : null, L = $ ? B : p == null ? void 0 : p.field.value, I = $ ? _ : (M = (K = V == null ? void 0 : V.errors) == null ? void 0 : K[t]) == null ? void 0 : M.message, x = U(() => c ? Ve[c] ?? c : null, [c]), w = P((C) => {
87
+ if (!C) return "";
88
+ const j = C.replace(/\D/g, "");
89
+ return (Number(j) / 100).toFixed(2);
90
+ }, []), k = P((C) => {
91
+ if (C === "" || C === null || C === void 0) return "";
92
+ const j = Number(C);
93
+ return isNaN(j) ? "" : j.toLocaleString("pt-BR", {
92
94
  style: "currency",
93
95
  currency: "BRL"
94
96
  });
95
- }, []), w = (H) => {
96
- let F = H;
97
- u === "monetary" && (F = V(H)), b ? R == null || R(F) : s == null || s.field.onChange(F);
98
- }, k = () => {
99
- b || s == null || s.field.onBlur();
100
- }, A = Y(() => u === "monetary" ? _(N) : String(N ?? ""), [N, u, _]);
101
- if (g) return null;
102
- const h = `form-control ${O ? "readOnly" : ""} ${I ? "border-red" : ""} ${d}`, D = () => B ? /* @__PURE__ */ e(
97
+ }, []), D = (C) => {
98
+ let j = C;
99
+ f === "monetary" && (j = w(C)), $ ? b == null || b(j) : p == null || p.field.onChange(j);
100
+ }, y = () => {
101
+ $ || p == null || p.field.onBlur();
102
+ }, E = U(() => f === "monetary" ? k(L) : String(L ?? ""), [L, f, k]);
103
+ if (i) return null;
104
+ const H = `form-control ${s ? "readOnly" : ""} ${I ? "border-red" : ""} ${d}`, J = {
105
+ paddingLeft: g ? "36px" : void 0,
106
+ paddingRight: r ? "36px" : void 0,
107
+ width: "100%"
108
+ }, X = () => x ? /* @__PURE__ */ e(
103
109
  pe,
104
110
  {
105
- mask: B,
106
- value: A,
111
+ mask: x,
112
+ value: E,
107
113
  unmask: !0,
108
- onAccept: (H) => w(H),
109
- placeholder: a,
110
- readOnly: O,
111
- className: h,
112
- inputRef: b || s == null ? void 0 : s.field.ref,
113
- onBlur: k
114
+ onAccept: (C) => D(C),
115
+ placeholder: u,
116
+ readOnly: s,
117
+ className: H,
118
+ style: J,
119
+ inputRef: $ || p == null ? void 0 : p.field.ref,
120
+ onBlur: y
114
121
  }
115
122
  ) : /* @__PURE__ */ e(
116
123
  "input",
117
124
  {
118
- type: u === "number" ? "number" : "text",
119
- value: A,
120
- onChange: (H) => w(H.target.value),
121
- onBlur: k,
122
- placeholder: a,
123
- readOnly: O,
124
- className: h
125
+ type: f === "number" ? "number" : "text",
126
+ value: E,
127
+ onChange: (C) => D(C.target.value),
128
+ onBlur: y,
129
+ placeholder: u,
130
+ readOnly: s,
131
+ className: H,
132
+ style: J
125
133
  }
126
- );
127
- return r ? /* @__PURE__ */ p("div", { className: "form-group", children: [
128
- i && /* @__PURE__ */ e("label", { children: i }),
129
- /* @__PURE__ */ p("div", { className: v ? "dfe-flex-input-wrapper" : "", children: [
130
- /* @__PURE__ */ e("span", { className: h, children: A || "-" }),
131
- v && /* @__PURE__ */ e(Z, { text: v, title: l, width: y })
134
+ ), Q = ({ children: C }) => /* @__PURE__ */ v("div", { style: { position: "relative", flex: 1, display: "flex", alignItems: "center" }, children: [
135
+ g && /* @__PURE__ */ e(
136
+ "span",
137
+ {
138
+ style: {
139
+ position: "absolute",
140
+ left: "12px",
141
+ color: "var(--dfe-muted-fg)",
142
+ zIndex: 3,
143
+ fontWeight: 500,
144
+ fontSize: "13px",
145
+ pointerEvents: "none"
146
+ },
147
+ children: g
148
+ }
149
+ ),
150
+ C,
151
+ r && /* @__PURE__ */ e(
152
+ "span",
153
+ {
154
+ style: {
155
+ position: "absolute",
156
+ right: "12px",
157
+ color: "var(--dfe-muted-fg)",
158
+ zIndex: 3,
159
+ fontWeight: 500,
160
+ fontSize: "13px",
161
+ pointerEvents: "none"
162
+ },
163
+ children: r
164
+ }
165
+ )
166
+ ] });
167
+ return l ? /* @__PURE__ */ v("div", { className: "form-group", children: [
168
+ n && /* @__PURE__ */ e("label", { children: n }),
169
+ /* @__PURE__ */ v("div", { className: h ? "dfe-flex-input-wrapper" : "", children: [
170
+ /* @__PURE__ */ e(Q, { children: /* @__PURE__ */ e("span", { className: H, style: J, children: E || "-" }) }),
171
+ h && /* @__PURE__ */ e(ee, { text: h, title: O, width: A })
132
172
  ] })
133
- ] }) : /* @__PURE__ */ p("div", { className: `form-group ${g ? "hidden" : ""}`, children: [
134
- i && /* @__PURE__ */ e("label", { children: i }),
135
- /* @__PURE__ */ p("div", { className: v ? "dfe-flex-input-wrapper" : "", children: [
136
- D(),
137
- v && /* @__PURE__ */ e(Z, { text: v, title: l, width: y })
173
+ ] }) : /* @__PURE__ */ v("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
174
+ n && /* @__PURE__ */ e("label", { children: n }),
175
+ /* @__PURE__ */ v("div", { className: h ? "dfe-flex-input-wrapper" : "", children: [
176
+ /* @__PURE__ */ e(Q, { children: X() }),
177
+ h && /* @__PURE__ */ e(ee, { text: h, title: O, width: A })
138
178
  ] }),
139
- !b && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: N || "" }),
179
+ !$ && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: L || "" }),
140
180
  I && /* @__PURE__ */ e("p", { className: "text-danger", children: String(I) })
141
181
  ] });
142
182
  }
143
- const dt = q(Ee);
144
- function Be({
183
+ const dt = q(De);
184
+ function Le({
145
185
  name: t,
146
- label: i = "",
147
- options: a = [],
148
- placeholder: u = "",
186
+ label: n = "",
187
+ options: u = [],
188
+ placeholder: f = "",
149
189
  labelKey: c = "label",
150
190
  valueKey: d = "value",
151
191
  enableSearch: m = !1,
152
192
  searchPlaceholder: o = "Buscar...",
153
- loading: v = !1,
154
- onSearchChange: l,
155
- debounceTime: y = 300,
156
- onSelect: $,
157
- forceReadOnly: R = !1,
158
- forceHidden: C = !1,
193
+ loading: g = !1,
194
+ onSearchChange: r,
195
+ debounceTime: h = 300,
196
+ onSelect: O,
197
+ forceReadOnly: A = !1,
198
+ forceHidden: B = !1,
159
199
  helpText: b,
160
- helpTitle: S,
161
- helpWidth: E,
162
- valueManual: O,
163
- onChangeManual: g,
164
- errorManual: r
200
+ helpTitle: _,
201
+ helpWidth: $,
202
+ valueManual: R,
203
+ onChangeManual: N,
204
+ errorManual: s
165
205
  }) {
166
- var se;
167
- const n = O !== void 0 && !!g, { isReadOnly: s, isHidden: f } = G(), N = R || !!s(t), I = C || !!f(t), { isView: B } = z();
168
- let V = "", _ = () => {
169
- }, w, k = null, A = () => {
206
+ var j;
207
+ const i = R !== void 0 && !!N, { isReadOnly: l, isHidden: a } = G(), p = A || !!l(t), V = B || !!a(t), { isView: L } = Y();
208
+ let I = "", x = () => {
209
+ }, w, k = null, D = () => {
170
210
  };
171
- if (n)
172
- V = O;
211
+ if (i)
212
+ I = R;
173
213
  else
174
214
  try {
175
- const x = J(), T = Q({ name: t, control: x.control });
176
- V = T.field.value, _ = T.field.onChange, w = T.field.ref, k = (se = T.fieldState) == null ? void 0 : se.error, A = x.clearErrors;
215
+ const S = W(), F = Z({ name: t, control: S.control });
216
+ I = F.field.value, x = F.field.onChange, w = F.field.ref, k = (j = F.fieldState) == null ? void 0 : j.error, D = S.clearErrors;
177
217
  } catch {
178
218
  }
179
- const [h, D] = U(!1), [L, W] = U(""), H = X(null), F = X(l);
180
- j(() => {
181
- F.current = l;
182
- }, [l]), j(() => {
183
- const x = (T) => {
184
- H.current && !H.current.contains(T.target) && D(!1);
219
+ const [y, E] = z(!1), [H, J] = z(""), X = te(null), Q = te(r);
220
+ T(() => {
221
+ Q.current = r;
222
+ }, [r]), T(() => {
223
+ const S = (F) => {
224
+ X.current && !X.current.contains(F.target) && E(!1);
185
225
  };
186
- return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
187
- }, []), j(() => {
188
- h || W("");
189
- }, [h]), j(() => {
226
+ return document.addEventListener("mousedown", S), () => document.removeEventListener("mousedown", S);
227
+ }, []), T(() => {
228
+ y || J("");
229
+ }, [y]), T(() => {
190
230
  if (!m) return;
191
- const x = setTimeout(() => {
192
- var T;
193
- (T = F.current) == null || T.call(F, L);
194
- }, y);
195
- return () => clearTimeout(x);
196
- }, [L, m, y]);
197
- const K = Y(() => m && !l && L.trim() ? a.filter(
198
- (x) => String((x == null ? void 0 : x[c]) ?? "").toLowerCase().includes(L.toLowerCase())
199
- ) : a ?? [], [a, m, l, L, c]), te = Y(() => {
200
- if (V == null) return "";
201
- if (typeof V == "object")
202
- return String(V[d] ?? "");
203
- const x = (a || []).find((T) => String(T == null ? void 0 : T[d]) === String(V));
204
- return String(x ? (x == null ? void 0 : x[c]) ?? "" : V);
205
- }, [V, a, d, c]), he = (x) => {
206
- N || (n ? g == null || g(x[d]) : (_(x[d]), A == null || A(t)), $ == null || $(x), D(!1));
231
+ const S = setTimeout(() => {
232
+ var F;
233
+ (F = Q.current) == null || F.call(Q, H);
234
+ }, h);
235
+ return () => clearTimeout(S);
236
+ }, [H, m, h]);
237
+ const K = U(() => m && !r && H.trim() ? u.filter(
238
+ (S) => String((S == null ? void 0 : S[c]) ?? "").toLowerCase().includes(H.toLowerCase())
239
+ ) : u ?? [], [u, m, r, H, c]), M = U(() => {
240
+ if (I == null) return "";
241
+ if (typeof I == "object")
242
+ return String(I[d] ?? "");
243
+ const S = (u || []).find((F) => String(F == null ? void 0 : F[d]) === String(I));
244
+ return String(S ? (S == null ? void 0 : S[c]) ?? "" : I);
245
+ }, [I, u, d, c]), C = (S) => {
246
+ p || (i ? N == null || N(S[d]) : (x(S[d]), D == null || D(t)), O == null || O(S), E(!1));
207
247
  };
208
- return I ? null : /* @__PURE__ */ p("div", { className: `select-wrapper form-group ${I ? "hidden" : ""}`, ref: H, children: [
209
- /* @__PURE__ */ e("label", { className: "control-label", children: i }),
210
- B ? /* @__PURE__ */ p("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
211
- /* @__PURE__ */ e("span", { className: "form-control", style: b ? { flex: 1 } : void 0, children: te || "-" }),
212
- b && /* @__PURE__ */ e(Z, { text: b, title: S, width: E })
213
- ] }) : /* @__PURE__ */ p(ce, { children: [
214
- /* @__PURE__ */ p("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
215
- /* @__PURE__ */ p(
248
+ return V ? null : /* @__PURE__ */ v("div", { className: `select-wrapper form-group ${V ? "hidden" : ""}`, ref: X, children: [
249
+ /* @__PURE__ */ e("label", { className: "control-label", children: n }),
250
+ L ? /* @__PURE__ */ v("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
251
+ /* @__PURE__ */ e("span", { className: "form-control", style: b ? { flex: 1 } : void 0, children: M || "-" }),
252
+ b && /* @__PURE__ */ e(ee, { text: b, title: _, width: $ })
253
+ ] }) : /* @__PURE__ */ v(oe, { children: [
254
+ /* @__PURE__ */ v("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
255
+ /* @__PURE__ */ v(
216
256
  "div",
217
257
  {
218
- className: `select-control ${k ? "border-red" : ""} ${N ? "readOnly" : ""}`,
219
- onClick: () => !N && D((x) => !x),
258
+ className: `select-control ${k ? "border-red" : ""} ${p ? "readOnly" : ""}`,
259
+ onClick: () => !p && E((S) => !S),
220
260
  ref: w,
221
261
  style: b ? { flex: 1 } : void 0,
222
262
  children: [
223
- /* @__PURE__ */ e("span", { className: `select-display ${N ? "readOnly" : ""}`, children: te || u }),
263
+ /* @__PURE__ */ e("span", { className: `select-display ${p ? "readOnly" : ""}`, children: M || f }),
224
264
  /* @__PURE__ */ e("i", { className: "flaticon flaticon-chevron-down select-icon" })
225
265
  ]
226
266
  }
227
267
  ),
228
- b && /* @__PURE__ */ e(Z, { text: b, title: S, width: E })
268
+ b && /* @__PURE__ */ e(ee, { text: b, title: _, width: $ })
229
269
  ] }),
230
- h && !N && /* @__PURE__ */ p("div", { className: "select-dropdown", children: [
270
+ y && !p && /* @__PURE__ */ v("div", { className: "select-dropdown", children: [
231
271
  m && /* @__PURE__ */ e("div", { className: "select-search", children: /* @__PURE__ */ e(
232
272
  "input",
233
273
  {
234
274
  type: "text",
235
275
  className: "select-search-input",
236
- value: L,
237
- onChange: (x) => W(x.target.value),
238
- placeholder: v ? "Carregando..." : o,
276
+ value: H,
277
+ onChange: (S) => J(S.target.value),
278
+ placeholder: g ? "Carregando..." : o,
239
279
  autoFocus: !0,
240
- onClick: (x) => x.stopPropagation()
280
+ onClick: (S) => S.stopPropagation()
241
281
  }
242
282
  ) }),
243
- /* @__PURE__ */ e("ul", { className: "select-options", children: v ? /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Carregando..." }) : K.length > 0 ? K.map((x) => /* @__PURE__ */ e("li", { onClick: () => he(x), className: "select-option handleHover", children: x[c] }, x[d])) : /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Sem resultados" }) })
283
+ /* @__PURE__ */ e("ul", { className: "select-options", children: g ? /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Carregando..." }) : K.length > 0 ? K.map((S) => /* @__PURE__ */ e("li", { onClick: () => C(S), className: "select-option handleHover", children: S[c] }, S[d])) : /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Sem resultados" }) })
244
284
  ] })
245
285
  ] }),
246
- !n && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: V || "" }),
247
- (k || r) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((k == null ? void 0 : k.message) ?? r) })
286
+ !i && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: I || "" }),
287
+ (k || s) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((k == null ? void 0 : k.message) ?? s) })
248
288
  ] });
249
289
  }
250
- const re = q(Be);
290
+ const re = q(Le);
251
291
  function at({
252
292
  name: t,
253
- options: i = [],
254
- label: a = "",
255
- valueKey: u = "value",
293
+ options: n = [],
294
+ label: u = "",
295
+ valueKey: f = "value",
256
296
  labelKey: c = "label",
257
297
  forceReadOnly: d = !1,
258
298
  forceHidden: m = !1,
259
299
  valueManual: o,
260
- onChangeManual: v
300
+ onChangeManual: g
261
301
  }) {
262
- var B, V;
263
- let l = null;
302
+ var L, I;
303
+ let r = null;
264
304
  try {
265
- l = J();
305
+ r = W();
266
306
  } catch {
267
307
  }
268
- const y = o !== void 0 && !!v, { isView: $, isReadOnly: R } = z(), { isReadOnly: C, isHidden: b } = G(), S = C ? C(t) : !1, E = b ? b(t) : !1, O = d || S, g = m || E, r = O || R || $, n = () => i ? i.reduce(
269
- (_, w) => {
270
- const k = String(w[u]);
271
- if (y)
272
- _[k] = !!(o != null && o[k]);
273
- else if (l) {
274
- const A = l.getValues(k);
275
- _[k] = A === "on";
308
+ const h = o !== void 0 && !!g, { isView: O, isReadOnly: A } = Y(), { isReadOnly: B, isHidden: b } = G(), _ = B ? B(t) : !1, $ = b ? b(t) : !1, R = d || _, N = m || $, s = R || A || O, i = () => n ? n.reduce(
309
+ (x, w) => {
310
+ const k = String(w[f]);
311
+ if (h)
312
+ x[k] = !!(o != null && o[k]);
313
+ else if (r) {
314
+ const D = r.getValues(k);
315
+ x[k] = D === "on";
276
316
  } else
277
- _[k] = !1;
278
- return _;
317
+ x[k] = !1;
318
+ return x;
279
319
  },
280
320
  {}
281
- ) : {}, s = !y && l ? l.watch(t) : void 0, f = Y(() => y && o ? o : s && typeof s == "object" ? s : n(), [s, o, i]);
282
- j(() => {
283
- if (y || !l) return;
284
- const _ = l.getValues(t);
285
- (!_ || typeof _ != "object") && l.setValue(t, f, {
321
+ ) : {}, l = !h && r ? r.watch(t) : void 0, a = U(() => h && o ? o : l && typeof l == "object" ? l : i(), [l, o, n]);
322
+ T(() => {
323
+ if (h || !r) return;
324
+ const x = r.getValues(t);
325
+ (!x || typeof x != "object") && r.setValue(t, a, {
286
326
  shouldDirty: !1,
287
327
  shouldValidate: !1
288
328
  });
289
- }, [f, t, l, y]);
290
- const N = (_, w) => {
291
- if (r) return;
292
- const k = { ...f, [_]: w };
293
- if (y) {
294
- v && v(k);
329
+ }, [a, t, r, h]);
330
+ const p = (x, w) => {
331
+ if (s) return;
332
+ const k = { ...a, [x]: w };
333
+ if (h) {
334
+ g && g(k);
295
335
  return;
296
336
  }
297
- l && (l.setValue(t, k, {
337
+ r && (r.setValue(t, k, {
298
338
  shouldDirty: !0,
299
339
  shouldValidate: !0
300
- }), l.setValue(_, w ? "on" : "", { shouldValidate: !1 }));
301
- }, I = y ? null : (V = (B = l == null ? void 0 : l.formState) == null ? void 0 : B.errors) == null ? void 0 : V[t];
302
- return /* @__PURE__ */ p("div", { className: `form-group ${g ? "hidden" : ""}`, children: [
303
- a && /* @__PURE__ */ e("label", { children: a }),
340
+ }), r.setValue(x, w ? "on" : "", { shouldValidate: !1 }));
341
+ }, V = h ? null : (I = (L = r == null ? void 0 : r.formState) == null ? void 0 : L.errors) == null ? void 0 : I[t];
342
+ return /* @__PURE__ */ v("div", { className: `form-group ${N ? "hidden" : ""}`, children: [
343
+ u && /* @__PURE__ */ e("label", { children: u }),
304
344
  /* @__PURE__ */ e(
305
345
  "div",
306
346
  {
307
- className: `checkbox-group-custom ${r ? "readOnly" : ""}`,
308
- children: i.map((_) => {
309
- const w = String(_[u]), k = f[w] === !0;
310
- return /* @__PURE__ */ p("div", { children: [
311
- !y && l && /* @__PURE__ */ e("input", { type: "hidden", ...l.register(w) }),
312
- /* @__PURE__ */ p(
347
+ className: `checkbox-group-custom ${s ? "readOnly" : ""}`,
348
+ children: n.map((x) => {
349
+ const w = String(x[f]), k = a[w] === !0;
350
+ return /* @__PURE__ */ v("div", { children: [
351
+ !h && r && /* @__PURE__ */ e("input", { type: "hidden", ...r.register(w) }),
352
+ /* @__PURE__ */ v(
313
353
  "label",
314
354
  {
315
- className: `custom-checkbox ${k ? "checked" : ""} ${r ? "readOnly" : ""}`,
355
+ className: `custom-checkbox ${k ? "checked" : ""} ${s ? "readOnly" : ""}`,
316
356
  children: [
317
357
  /* @__PURE__ */ e(
318
358
  "input",
319
359
  {
320
360
  type: "checkbox",
321
361
  checked: k,
322
- disabled: r,
323
- onChange: (A) => N(w, A.target.checked)
362
+ disabled: s,
363
+ onChange: (D) => p(w, D.target.checked)
324
364
  }
325
365
  ),
326
366
  /* @__PURE__ */ e("span", { className: "checkmark" }),
327
- /* @__PURE__ */ e("span", { children: _[c] })
367
+ /* @__PURE__ */ e("span", { children: x[c] })
328
368
  ]
329
369
  }
330
370
  )
@@ -332,137 +372,137 @@ function at({
332
372
  })
333
373
  }
334
374
  ),
335
- I && /* @__PURE__ */ e("p", { className: "text-danger", children: String(I.message) })
375
+ V && /* @__PURE__ */ e("p", { className: "text-danger", children: String(V.message) })
336
376
  ] });
337
377
  }
338
- function Ce({
378
+ function Be({
339
379
  name: t,
340
- label: i = "",
341
- options: a = [],
342
- valueKey: u = "value",
380
+ label: n = "",
381
+ options: u = [],
382
+ valueKey: f = "value",
343
383
  labelKey: c = "label",
344
384
  iconKey: d = "icon",
345
385
  forceReadOnly: m = !1,
346
386
  forceHidden: o = !1,
347
- valueManual: v,
348
- onChangeManual: l,
349
- errorManual: y
387
+ valueManual: g,
388
+ onChangeManual: r,
389
+ errorManual: h
350
390
  }) {
351
- var B, V;
352
- const $ = v !== void 0 && !!l, { isReadOnly: R, isHidden: C } = G(), b = m || !!R(t), S = o || !!C(t), { isView: E, isReadOnly: O } = z();
353
- let g = null;
391
+ var L, I;
392
+ const O = g !== void 0 && !!r, { isReadOnly: A, isHidden: B } = G(), b = m || !!A(t), _ = o || !!B(t), { isView: $, isReadOnly: R } = Y();
393
+ let N = null;
354
394
  try {
355
- g = J();
395
+ N = W();
356
396
  } catch {
357
397
  }
358
- const r = !$ && g ? Q({ name: t, control: g.control, defaultValue: "" }) : null, n = !$ && g ? de({ name: t }) : null, s = $ ? y : (V = (B = n == null ? void 0 : n.errors) == null ? void 0 : B[t]) == null ? void 0 : V.message, f = b || O || E, N = $ ? v : (r == null ? void 0 : r.field.value) ?? "", I = P(
359
- (_) => {
360
- f || ($ ? l == null || l(_) : (r == null || r.field.onChange(_), r == null || r.field.onBlur()));
398
+ const s = !O && N ? Z({ name: t, control: N.control, defaultValue: "" }) : null, i = !O && N ? ae({ name: t }) : null, l = O ? h : (I = (L = i == null ? void 0 : i.errors) == null ? void 0 : L[t]) == null ? void 0 : I.message, a = b || R || $, p = O ? g : (s == null ? void 0 : s.field.value) ?? "", V = P(
399
+ (x) => {
400
+ a || (O ? r == null || r(x) : (s == null || s.field.onChange(x), s == null || s.field.onBlur()));
361
401
  },
362
- [f, $, l, r]
402
+ [a, O, r, s]
363
403
  );
364
- return /* @__PURE__ */ p("div", { className: `form-group column ${S ? "hidden" : ""}`, children: [
365
- i && /* @__PURE__ */ e("label", { className: "control-label", children: i }),
366
- /* @__PURE__ */ e("div", { className: `btn-group ${f ? "view-mode" : ""}`, "data-field-name": t, children: a.map((_) => {
367
- const w = _[u], k = N === w, A = _.color ? { "--customColor": _.color } : void 0;
404
+ return /* @__PURE__ */ v("div", { className: `form-group column ${_ ? "hidden" : ""}`, children: [
405
+ n && /* @__PURE__ */ e("label", { className: "control-label", children: n }),
406
+ /* @__PURE__ */ e("div", { className: `btn-group ${a ? "view-mode" : ""}`, "data-field-name": t, children: u.map((x) => {
407
+ const w = x[f], k = p === w, D = x.color ? { "--customColor": x.color } : void 0;
368
408
  return (
369
409
  // Trocado de <label> para <div> para evitar comportamentos nativos de clique do HTML
370
- /* @__PURE__ */ p(
410
+ /* @__PURE__ */ v(
371
411
  "div",
372
412
  {
373
- style: A,
413
+ style: D,
374
414
  className: `btn fs-ellipsis ${k ? "active" : ""}`,
375
- onClick: () => I(w),
415
+ onClick: () => V(w),
376
416
  children: [
377
- _[d] && /* @__PURE__ */ e("i", { className: `${_[d]} icon-sm` }),
417
+ x[d] && /* @__PURE__ */ e("i", { className: `${x[d]} icon-sm` }),
378
418
  " ",
379
- _[c]
419
+ x[c]
380
420
  ]
381
421
  },
382
422
  w
383
423
  )
384
424
  );
385
425
  }) }),
386
- !$ && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: N || "", ref: r == null ? void 0 : r.field.ref }),
387
- (s || y) && /* @__PURE__ */ e("p", { className: "text-danger", children: String(s ?? y) })
426
+ !O && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: p || "", ref: s == null ? void 0 : s.field.ref }),
427
+ (l || h) && /* @__PURE__ */ e("p", { className: "text-danger", children: String(l ?? h) })
388
428
  ] });
389
429
  }
390
- const ut = q(Ce), He = ({
430
+ const ut = q(Be), Ce = ({
391
431
  name: t,
392
- label: i = "",
393
- placeholder: a = "",
394
- className: u = "",
432
+ label: n = "",
433
+ placeholder: u = "",
434
+ className: f = "",
395
435
  rows: c = 4,
396
436
  maxLength: d,
397
437
  forceReadOnly: m = !1,
398
438
  forceHidden: o = !1,
399
- valueManual: v,
400
- onChangeManual: l,
401
- errorManual: y
439
+ valueManual: g,
440
+ onChangeManual: r,
441
+ errorManual: h
402
442
  }) => {
403
- var f;
404
- const $ = v !== void 0 && !!l, { isReadOnly: R, isHidden: C } = G(), b = m || !!R(t), S = o || !!C(t), { isView: E } = z(), O = X(null);
405
- let g = {
406
- value: v ?? "",
407
- onChange: (N) => l == null ? void 0 : l(N)
408
- }, r = null;
409
- if (!$)
443
+ var a;
444
+ const O = g !== void 0 && !!r, { isReadOnly: A, isHidden: B } = G(), b = m || !!A(t), _ = o || !!B(t), { isView: $ } = Y(), R = te(null);
445
+ let N = {
446
+ value: g ?? "",
447
+ onChange: (p) => r == null ? void 0 : r(p)
448
+ }, s = null;
449
+ if (!O)
410
450
  try {
411
- const { control: N } = J(), I = Q({ name: t, control: N });
412
- g = I.field, r = (f = I.fieldState) == null ? void 0 : f.error;
451
+ const { control: p } = W(), V = Z({ name: t, control: p });
452
+ N = V.field, s = (a = V.fieldState) == null ? void 0 : a.error;
413
453
  } catch {
414
454
  }
415
- const n = () => {
416
- O.current && (O.current.style.height = "auto", O.current.style.height = `${O.current.scrollHeight}px`);
455
+ const i = () => {
456
+ R.current && (R.current.style.height = "auto", R.current.style.height = `${R.current.scrollHeight}px`);
417
457
  };
418
- if (j(() => {
419
- n();
420
- }, [g.value]), E)
421
- return /* @__PURE__ */ p("div", { className: `form-group ${S ? "hidden" : ""}`, children: [
422
- /* @__PURE__ */ e("label", { children: i }),
423
- /* @__PURE__ */ e("span", { className: "form-control", children: g.value || "-" })
458
+ if (T(() => {
459
+ i();
460
+ }, [N.value]), $)
461
+ return /* @__PURE__ */ v("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
462
+ /* @__PURE__ */ e("label", { children: n }),
463
+ /* @__PURE__ */ e("span", { className: "form-control", children: N.value || "-" })
424
464
  ] });
425
- const s = `form-control ${b ? "readOnly" : ""} ${r || y ? "border-red" : ""} ${u}`;
426
- return /* @__PURE__ */ p("div", { className: `form-group ${S ? "hidden" : ""}`, children: [
427
- i && /* @__PURE__ */ e("label", { children: i }),
465
+ const l = `form-control ${b ? "readOnly" : ""} ${s || h ? "border-red" : ""} ${f}`;
466
+ return /* @__PURE__ */ v("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
467
+ n && /* @__PURE__ */ e("label", { children: n }),
428
468
  /* @__PURE__ */ e(
429
469
  "textarea",
430
470
  {
431
- ref: O,
471
+ ref: R,
432
472
  rows: c,
433
473
  maxLength: d,
434
- value: g.value || "",
435
- placeholder: a,
474
+ value: N.value || "",
475
+ placeholder: u,
436
476
  readOnly: b,
437
- className: s,
477
+ className: l,
438
478
  style: {
439
479
  resize: "none",
440
480
  maxHeight: "400px",
441
481
  overflowY: "auto"
442
482
  },
443
- onChange: (N) => {
444
- $ ? l == null || l(N.target.value) : g.onChange(N);
483
+ onChange: (p) => {
484
+ O ? r == null || r(p.target.value) : N.onChange(p);
445
485
  },
446
- onInput: n
486
+ onInput: i
447
487
  }
448
488
  ),
449
- (r || y) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((r == null ? void 0 : r.message) ?? y) })
489
+ (s || h) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((s == null ? void 0 : s.message) ?? h) })
450
490
  ] });
451
- }, ft = q(He);
491
+ }, ft = q(Ce);
452
492
  /**
453
493
  * @license lucide-react v0.575.0 - ISC
454
494
  *
455
495
  * This source code is licensed under the ISC license.
456
496
  * See the LICENSE file in the root directory of this source tree.
457
497
  */
458
- const fe = (...t) => t.filter((i, a, u) => !!i && i.trim() !== "" && u.indexOf(i) === a).join(" ").trim();
498
+ const me = (...t) => t.filter((n, u, f) => !!n && n.trim() !== "" && f.indexOf(n) === u).join(" ").trim();
459
499
  /**
460
500
  * @license lucide-react v0.575.0 - ISC
461
501
  *
462
502
  * This source code is licensed under the ISC license.
463
503
  * See the LICENSE file in the root directory of this source tree.
464
504
  */
465
- const Le = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
505
+ const He = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
466
506
  /**
467
507
  * @license lucide-react v0.575.0 - ISC
468
508
  *
@@ -471,7 +511,7 @@ const Le = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
471
511
  */
472
512
  const Fe = (t) => t.replace(
473
513
  /^([A-Z])|[\s-_]+(\w)/g,
474
- (i, a, u) => u ? u.toUpperCase() : a.toLowerCase()
514
+ (n, u, f) => f ? f.toUpperCase() : u.toLowerCase()
475
515
  );
476
516
  /**
477
517
  * @license lucide-react v0.575.0 - ISC
@@ -479,9 +519,9 @@ const Fe = (t) => t.replace(
479
519
  * This source code is licensed under the ISC license.
480
520
  * See the LICENSE file in the root directory of this source tree.
481
521
  */
482
- const ne = (t) => {
483
- const i = Fe(t);
484
- return i.charAt(0).toUpperCase() + i.slice(1);
522
+ const ie = (t) => {
523
+ const n = Fe(t);
524
+ return n.charAt(0).toUpperCase() + n.slice(1);
485
525
  };
486
526
  /**
487
527
  * @license lucide-react v0.575.0 - ISC
@@ -507,8 +547,8 @@ var Te = {
507
547
  * See the LICENSE file in the root directory of this source tree.
508
548
  */
509
549
  const je = (t) => {
510
- for (const i in t)
511
- if (i.startsWith("aria-") || i === "role" || i === "title")
550
+ for (const n in t)
551
+ if (n.startsWith("aria-") || n === "role" || n === "title")
512
552
  return !0;
513
553
  return !1;
514
554
  };
@@ -518,31 +558,31 @@ const je = (t) => {
518
558
  * This source code is licensed under the ISC license.
519
559
  * See the LICENSE file in the root directory of this source tree.
520
560
  */
521
- const Pe = oe(
561
+ const Pe = de(
522
562
  ({
523
563
  color: t = "currentColor",
524
- size: i = 24,
525
- strokeWidth: a = 2,
526
- absoluteStrokeWidth: u,
564
+ size: n = 24,
565
+ strokeWidth: u = 2,
566
+ absoluteStrokeWidth: f,
527
567
  className: c = "",
528
568
  children: d,
529
569
  iconNode: m,
530
570
  ...o
531
- }, v) => M(
571
+ }, g) => se(
532
572
  "svg",
533
573
  {
534
- ref: v,
574
+ ref: g,
535
575
  ...Te,
536
- width: i,
537
- height: i,
576
+ width: n,
577
+ height: n,
538
578
  stroke: t,
539
- strokeWidth: u ? Number(a) * 24 / Number(i) : a,
540
- className: fe("lucide", c),
579
+ strokeWidth: f ? Number(u) * 24 / Number(n) : u,
580
+ className: me("lucide", c),
541
581
  ...!d && !je(o) && { "aria-hidden": "true" },
542
582
  ...o
543
583
  },
544
584
  [
545
- ...m.map(([l, y]) => M(l, y)),
585
+ ...m.map(([r, h]) => se(r, h)),
546
586
  ...Array.isArray(d) ? d : [d]
547
587
  ]
548
588
  )
@@ -553,20 +593,20 @@ const Pe = oe(
553
593
  * This source code is licensed under the ISC license.
554
594
  * See the LICENSE file in the root directory of this source tree.
555
595
  */
556
- const ee = (t, i) => {
557
- const a = oe(
558
- ({ className: u, ...c }, d) => M(Pe, {
596
+ const ne = (t, n) => {
597
+ const u = de(
598
+ ({ className: f, ...c }, d) => se(Pe, {
559
599
  ref: d,
560
- iconNode: i,
561
- className: fe(
562
- `lucide-${Le(ne(t))}`,
600
+ iconNode: n,
601
+ className: me(
602
+ `lucide-${He(ie(t))}`,
563
603
  `lucide-${t}`,
564
- u
604
+ f
565
605
  ),
566
606
  ...c
567
607
  })
568
608
  );
569
- return a.displayName = ne(t), a;
609
+ return u.displayName = ie(t), u;
570
610
  };
571
611
  /**
572
612
  * @license lucide-react v0.575.0 - ISC
@@ -574,30 +614,30 @@ const ee = (t, i) => {
574
614
  * This source code is licensed under the ISC license.
575
615
  * See the LICENSE file in the root directory of this source tree.
576
616
  */
577
- const Ue = [
617
+ const ze = [
578
618
  ["path", { d: "M8 2v4", key: "1cmpym" }],
579
619
  ["path", { d: "M16 2v4", key: "4m81vk" }],
580
620
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
581
621
  ["path", { d: "M3 10h18", key: "8toen8" }]
582
- ], Ye = ee("calendar", Ue);
622
+ ], Ue = ne("calendar", ze);
583
623
  /**
584
624
  * @license lucide-react v0.575.0 - ISC
585
625
  *
586
626
  * This source code is licensed under the ISC license.
587
627
  * See the LICENSE file in the root directory of this source tree.
588
628
  */
589
- const Je = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ze = ee("chevron-left", Je);
629
+ const We = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Ye = ne("chevron-left", We);
590
630
  /**
591
631
  * @license lucide-react v0.575.0 - ISC
592
632
  *
593
633
  * This source code is licensed under the ISC license.
594
634
  * See the LICENSE file in the root directory of this source tree.
595
635
  */
596
- const qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ge = ee("chevron-right", qe), me = "dd/MM/yyyy", ie = (t) => {
636
+ const Je = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], qe = ne("chevron-right", Je), he = "dd/MM/yyyy", le = (t) => {
597
637
  if (!t) return null;
598
- const i = Ae(t, me, /* @__PURE__ */ new Date());
599
- return ae(i) ? i : null;
600
- }, We = (t) => t ? ue(t, me) : "", Qe = [
638
+ const n = Ae(t, he, /* @__PURE__ */ new Date());
639
+ return ue(n) ? n : null;
640
+ }, Ge = (t) => t ? fe(t, he) : "", Qe = [
601
641
  { value: 0, label: "Janeiro" },
602
642
  { value: 1, label: "Fevereiro" },
603
643
  { value: 2, label: "Março" },
@@ -610,89 +650,89 @@ const qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ge = ee("chevron-r
610
650
  { value: 9, label: "Outubro" },
611
651
  { value: 10, label: "Novembro" },
612
652
  { value: 11, label: "Dezembro" }
613
- ], le = 1940, Ze = 2100, Xe = Array.from({ length: Ze - le + 1 }, (t, i) => {
614
- const a = le + i;
615
- return { value: a, label: String(a) };
653
+ ], ce = 1940, Ze = 2100, Xe = Array.from({ length: Ze - ce + 1 }, (t, n) => {
654
+ const u = ce + n;
655
+ return { value: u, label: String(u) };
616
656
  });
617
657
  function Ke({
618
658
  name: t,
619
- label: i = "",
620
- placeholder: a = "dd/mm/aaaa",
621
- className: u = "",
659
+ label: n = "",
660
+ placeholder: u = "dd/mm/aaaa",
661
+ className: f = "",
622
662
  forceReadOnly: c = !1,
623
663
  forceHidden: d = !1,
624
664
  valueManual: m,
625
665
  onChangeManual: o,
626
- errorManual: v
666
+ errorManual: g
627
667
  }) {
628
- var A;
629
- const l = m !== void 0 && !!o, { isReadOnly: y, isHidden: $ } = G(), R = c || !!y(t), C = d || !!$(t), { isView: b } = z();
630
- let S = "", E = () => {
631
- }, O, g = null, r = () => {
668
+ var D;
669
+ const r = m !== void 0 && !!o, { isReadOnly: h, isHidden: O } = G(), A = c || !!h(t), B = d || !!O(t), { isView: b } = Y();
670
+ let _ = "", $ = () => {
671
+ }, R, N = null, s = () => {
632
672
  };
633
- if (l)
634
- S = m;
673
+ if (r)
674
+ _ = m;
635
675
  else
636
676
  try {
637
- const h = J(), D = Q({ name: t, control: h.control });
638
- S = D.field.value, E = D.field.onChange, O = D.field.ref, g = (A = D.fieldState) == null ? void 0 : A.error, r = h.clearErrors;
677
+ const y = W(), E = Z({ name: t, control: y.control });
678
+ _ = E.field.value, $ = E.field.onChange, R = E.field.ref, N = (D = E.fieldState) == null ? void 0 : D.error, s = y.clearErrors;
639
679
  } catch {
640
680
  }
641
- const [n, s] = U(!1), [f, N] = U(/* @__PURE__ */ new Date()), I = X(null);
642
- j(() => {
643
- if (n) {
644
- const h = ie(S);
645
- N(h && ae(h) ? h : /* @__PURE__ */ new Date());
681
+ const [i, l] = z(!1), [a, p] = z(/* @__PURE__ */ new Date()), V = te(null);
682
+ T(() => {
683
+ if (i) {
684
+ const y = le(_);
685
+ p(y && ue(y) ? y : /* @__PURE__ */ new Date());
646
686
  }
647
- }, [n, S]), j(() => {
648
- const h = (D) => {
649
- I.current && !I.current.contains(D.target) && s(!1);
687
+ }, [i, _]), T(() => {
688
+ const y = (E) => {
689
+ V.current && !V.current.contains(E.target) && l(!1);
650
690
  };
651
- return document.addEventListener("mousedown", h), () => document.removeEventListener("mousedown", h);
691
+ return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
652
692
  }, []);
653
- const B = Y(() => ie(S), [S]), V = (h) => {
654
- if (R) return;
655
- const D = We(h);
656
- l ? o == null || o(D) : (E(D), r == null || r(t)), s(!1);
657
- }, _ = Y(() => ve({
658
- start: ge(Ne(f)),
659
- end: ye(be(f))
660
- }), [f]), w = f.getMonth(), k = ke(f);
661
- return /* @__PURE__ */ p("div", { className: `dfe-datepicker-wrapper form-group ${C ? "hidden" : ""} ${u}`, ref: I, children: [
662
- /* @__PURE__ */ e("label", { className: "control-label", children: i }),
663
- b ? /* @__PURE__ */ e("span", { className: "form-control", children: S || "-" }) : (
693
+ const L = U(() => le(_), [_]), I = (y) => {
694
+ if (A) return;
695
+ const E = Ge(y);
696
+ r ? o == null || o(E) : ($(E), s == null || s(t)), l(!1);
697
+ }, x = U(() => ve({
698
+ start: be(Ne(a)),
699
+ end: ye(ge(a))
700
+ }), [a]), w = a.getMonth(), k = ke(a);
701
+ return /* @__PURE__ */ v("div", { className: `dfe-datepicker-wrapper form-group ${B ? "hidden" : ""} ${f}`, ref: V, children: [
702
+ /* @__PURE__ */ e("label", { className: "control-label", children: n }),
703
+ b ? /* @__PURE__ */ e("span", { className: "form-control", children: _ || "-" }) : (
664
704
  /* Container isolador de contexto posicional */
665
- /* @__PURE__ */ p("div", { className: "dfe-datepicker-inner-container", children: [
666
- /* @__PURE__ */ p(
705
+ /* @__PURE__ */ v("div", { className: "dfe-datepicker-inner-container", children: [
706
+ /* @__PURE__ */ v(
667
707
  "div",
668
708
  {
669
- className: `dfe-datepicker-control ${g ? "border-red" : ""} ${R ? "readOnly" : ""}`,
670
- onClick: () => !R && s((h) => !h),
671
- ref: O,
709
+ className: `dfe-datepicker-control ${N ? "border-red" : ""} ${A ? "readOnly" : ""}`,
710
+ onClick: () => !A && l((y) => !y),
711
+ ref: R,
672
712
  children: [
673
- /* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${R ? "readOnly" : ""}`, children: S || a }),
674
- /* @__PURE__ */ e(Ye, { size: 16, className: "dfe-datepicker-icon" })
713
+ /* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${A ? "readOnly" : ""}`, children: _ || u }),
714
+ /* @__PURE__ */ e(Ue, { size: 16, className: "dfe-datepicker-icon" })
675
715
  ]
676
716
  }
677
717
  ),
678
- n && !R && /* @__PURE__ */ p("div", { className: "dfe-datepicker-dropdown", onClick: (h) => h.stopPropagation(), children: [
679
- /* @__PURE__ */ p("div", { className: "dfe-datepicker-header", children: [
718
+ i && !A && /* @__PURE__ */ v("div", { className: "dfe-datepicker-dropdown", onClick: (y) => y.stopPropagation(), children: [
719
+ /* @__PURE__ */ v("div", { className: "dfe-datepicker-header", children: [
680
720
  /* @__PURE__ */ e(
681
721
  "button",
682
722
  {
683
723
  type: "button",
684
- onClick: () => N(we(f, 1)),
724
+ onClick: () => p(we(a, 1)),
685
725
  className: "dfe-datepicker-nav-btn",
686
- children: /* @__PURE__ */ e(ze, { size: 16 })
726
+ children: /* @__PURE__ */ e(Ye, { size: 16 })
687
727
  }
688
728
  ),
689
- /* @__PURE__ */ p("div", { className: "dfe-datepicker-selectors", children: [
729
+ /* @__PURE__ */ v("div", { className: "dfe-datepicker-selectors", children: [
690
730
  /* @__PURE__ */ e(
691
731
  re,
692
732
  {
693
733
  name: "datepicker_internal_month",
694
734
  valueManual: w,
695
- onChangeManual: (h) => N(_e(f, Number(h))),
735
+ onChangeManual: (y) => p(xe(a, Number(y))),
696
736
  options: Qe,
697
737
  placeholder: "Mês"
698
738
  }
@@ -702,7 +742,7 @@ function Ke({
702
742
  {
703
743
  name: "datepicker_internal_year",
704
744
  valueManual: k,
705
- onChangeManual: (h) => N(Oe(f, Number(h))),
745
+ onChangeManual: (y) => p(Se(a, Number(y))),
706
746
  options: Xe,
707
747
  enableSearch: !0,
708
748
  searchPlaceholder: "Buscar ano...",
@@ -714,55 +754,55 @@ function Ke({
714
754
  "button",
715
755
  {
716
756
  type: "button",
717
- onClick: () => N(Re(f, 1)),
757
+ onClick: () => p(_e(a, 1)),
718
758
  className: "dfe-datepicker-nav-btn",
719
- children: /* @__PURE__ */ e(Ge, { size: 16 })
759
+ children: /* @__PURE__ */ e(qe, { size: 16 })
720
760
  }
721
761
  )
722
762
  ] }),
723
- /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((h, D) => /* @__PURE__ */ e("span", { children: h }, D)) }),
724
- /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children: _.map((h, D) => {
725
- const L = !Se(h, f), W = B && xe(h, B);
763
+ /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((y, E) => /* @__PURE__ */ e("span", { children: y }, E)) }),
764
+ /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children: x.map((y, E) => {
765
+ const H = !Re(y, a), J = L && Oe(y, L);
726
766
  return /* @__PURE__ */ e(
727
767
  "div",
728
768
  {
729
- onClick: () => !L && V(h),
769
+ onClick: () => !H && I(y),
730
770
  className: `dfe-datepicker-day
731
- ${W ? "selected" : "handleHover"}
732
- ${L ? "outside" : ""}
733
- ${$e(h) ? "today" : ""}`,
734
- children: ue(h, "d")
771
+ ${J ? "selected" : "handleHover"}
772
+ ${H ? "outside" : ""}
773
+ ${$e(y) ? "today" : ""}`,
774
+ children: fe(y, "d")
735
775
  },
736
- D
776
+ E
737
777
  );
738
778
  }) })
739
779
  ] })
740
780
  ] })
741
781
  ),
742
- !l && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: S || "" }),
743
- (g || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((g == null ? void 0 : g.message) ?? v) })
782
+ !r && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: _ || "" }),
783
+ (N || g) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((N == null ? void 0 : N.message) ?? g) })
744
784
  ] });
745
785
  }
746
786
  const mt = q(Ke);
747
787
  function Me({
748
788
  mapping: t = {},
749
- defaultLabel: i = "Não reconhecido",
750
- className: a = "",
751
- hidden: u = !1,
789
+ defaultLabel: n = "Não reconhecido",
790
+ className: u = "",
791
+ hidden: f = !1,
752
792
  label: c
753
793
  }) {
754
- const { activityId: d } = z(), m = Y(() => !t || d === null || d === void 0 ? null : t[d], [d, t]);
794
+ const { activityId: d } = Y(), m = U(() => !t || d === null || d === void 0 ? null : t[d], [d, t]);
755
795
  if (!m)
756
- return /* @__PURE__ */ p("div", { className: `form-group ${u ? "hidden" : ""}`, children: [
796
+ return /* @__PURE__ */ v("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
757
797
  c && /* @__PURE__ */ e("label", { children: c }),
758
- /* @__PURE__ */ e("div", { className: `status-badge default ${a}`, children: i })
798
+ /* @__PURE__ */ e("div", { className: `status-badge default ${u}`, children: n })
759
799
  ] });
760
800
  const o = {
761
801
  "--customColor": m.color
762
802
  };
763
- return /* @__PURE__ */ p("div", { className: `form-group ${u ? "hidden" : ""}`, children: [
803
+ return /* @__PURE__ */ v("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
764
804
  c && /* @__PURE__ */ e("label", { children: c }),
765
- /* @__PURE__ */ p("div", { className: `status-badge ${a}`, style: o, children: [
805
+ /* @__PURE__ */ v("div", { className: `status-badge ${u}`, style: o, children: [
766
806
  m.icon && /* @__PURE__ */ e("i", { className: m.icon }),
767
807
  /* @__PURE__ */ e("span", { children: m.label })
768
808
  ] })
@@ -771,67 +811,67 @@ function Me({
771
811
  const ht = q(Me);
772
812
  function et({
773
813
  name: t,
774
- control: i,
775
- defaultRowValue: a,
776
- isView: u,
814
+ control: n,
815
+ defaultRowValue: u,
816
+ isView: f,
777
817
  isReadOnly: c,
778
818
  filters: d = []
779
819
  }) {
780
- const { field: m } = Q({ name: t, control: i }), [o, v] = U([]), [l, y] = U([]), $ = () => Date.now() + Math.random(), R = (n) => {
820
+ const { field: m } = Z({ name: t, control: n }), [o, g] = z([]), [r, h] = z([]), O = () => Date.now() + Math.random(), A = (i) => {
781
821
  try {
782
- const s = JSON.parse(n);
783
- return Array.isArray(s) ? s.map((f) => ({
784
- ...f,
785
- _uid: f._uid || $()
822
+ const l = JSON.parse(i);
823
+ return Array.isArray(l) ? l.map((a) => ({
824
+ ...a,
825
+ _uid: a._uid || O()
786
826
  })) : [];
787
- } catch (s) {
788
- return console.error(`Erro ao ler dados da tabela "${t}":`, s), [];
827
+ } catch (l) {
828
+ return console.error(`Erro ao ler dados da tabela "${t}":`, l), [];
789
829
  }
790
830
  };
791
- j(() => {
792
- if (!(o.length > 0 && !u) && m.value && typeof m.value == "string") {
793
- const n = JSON.stringify(o);
794
- if (m.value === n) return;
795
- const s = R(m.value);
796
- v(s);
831
+ T(() => {
832
+ if (!(o.length > 0 && !f) && m.value && typeof m.value == "string") {
833
+ const i = JSON.stringify(o);
834
+ if (m.value === i) return;
835
+ const l = A(m.value);
836
+ g(l);
797
837
  }
798
- }, [m.value, u]), j(() => {
838
+ }, [m.value, f]), T(() => {
799
839
  if (c) return;
800
- const n = JSON.stringify(o);
801
- m.value !== n && m.onChange(n);
840
+ const i = JSON.stringify(o);
841
+ m.value !== i && m.onChange(i);
802
842
  }, [o, m, c]);
803
- const C = P(() => {
804
- const n = { _uid: $(), ...a };
805
- v((s) => [...s, n]);
806
- }, [a]), b = P(() => {
807
- v((n) => n.filter((s) => !l.includes(s._uid))), y([]);
808
- }, [l]), S = P((n, s, f) => {
809
- v((N) => N.map((I) => I._uid === n ? { ...I, [s]: f } : I));
810
- }, []), E = P((n) => {
811
- y((s) => s.includes(n) ? s.filter((f) => f !== n) : [...s, n]);
812
- }, []), O = P(
813
- (n) => {
814
- y(n ? o.map((s) => s._uid) : []);
843
+ const B = P(() => {
844
+ const i = { _uid: O(), ...u };
845
+ g((l) => [...l, i]);
846
+ }, [u]), b = P(() => {
847
+ g((i) => i.filter((l) => !r.includes(l._uid))), h([]);
848
+ }, [r]), _ = P((i, l, a) => {
849
+ g((p) => p.map((V) => V._uid === i ? { ...V, [l]: a } : V));
850
+ }, []), $ = P((i) => {
851
+ h((l) => l.includes(i) ? l.filter((a) => a !== i) : [...l, i]);
852
+ }, []), R = P(
853
+ (i) => {
854
+ h(i ? o.map((l) => l._uid) : []);
815
855
  },
816
856
  [o]
817
- ), g = o.length > 0 && l.length === o.length, r = Y(() => !d || d.length === 0 ? o : o.filter(
818
- (n) => d.every((s) => {
819
- if ("custom" in s)
820
- return s.custom(n);
821
- const f = n[s.field];
822
- switch (s.operator) {
857
+ ), N = o.length > 0 && r.length === o.length, s = U(() => !d || d.length === 0 ? o : o.filter(
858
+ (i) => d.every((l) => {
859
+ if ("custom" in l)
860
+ return l.custom(i);
861
+ const a = i[l.field];
862
+ switch (l.operator) {
823
863
  case "===":
824
- return f === s.value;
864
+ return a === l.value;
825
865
  case "!==":
826
- return f !== s.value;
866
+ return a !== l.value;
827
867
  case ">":
828
- return f > s.value;
868
+ return a > l.value;
829
869
  case "<":
830
- return f < s.value;
870
+ return a < l.value;
831
871
  case ">=":
832
- return f >= s.value;
872
+ return a >= l.value;
833
873
  case "<=":
834
- return f <= s.value;
874
+ return a <= l.value;
835
875
  default:
836
876
  return !0;
837
877
  }
@@ -840,151 +880,151 @@ function et({
840
880
  return {
841
881
  field: m,
842
882
  tableRows: o,
843
- visibleRows: r,
844
- selectedRowIds: l,
845
- isAllSelected: g,
883
+ visibleRows: s,
884
+ selectedRowIds: r,
885
+ isAllSelected: N,
846
886
  handle: {
847
- addRow: C,
887
+ addRow: B,
848
888
  removeRows: b,
849
- updateCellValue: S,
850
- toggleSelection: E,
851
- toggleSelectAll: O
889
+ updateCellValue: _,
890
+ toggleSelection: $,
891
+ toggleSelectAll: R
852
892
  }
853
893
  };
854
894
  }
855
895
  const pt = ({
856
896
  name: t,
857
- title: i = "Tabela Dinâmica",
858
- columns: a,
859
- defaultRowValue: u = {},
897
+ title: n = "Tabela Dinâmica",
898
+ columns: u,
899
+ defaultRowValue: f = {},
860
900
  forceReadOnly: c = !1,
861
901
  layout: d = "fluid",
862
902
  actions: m = !0,
863
903
  filters: o = []
864
904
  }) => {
865
- const { control: v } = J(), { isView: l, isReadOnly: y } = z(), { isReadOnly: $ } = G(), R = c || l || y || $ && $(t), { field: C, visibleRows: b, selectedRowIds: S, isAllSelected: E, handle: O } = et({
905
+ const { control: g } = W(), { isView: r, isReadOnly: h } = Y(), { isReadOnly: O } = G(), A = c || r || h || O && O(t), { field: B, visibleRows: b, selectedRowIds: _, isAllSelected: $, handle: R } = et({
866
906
  name: t,
867
- control: v,
868
- defaultRowValue: u,
869
- isView: l,
870
- isReadOnly: !!R,
907
+ control: g,
908
+ defaultRowValue: f,
909
+ isView: r,
910
+ isReadOnly: !!A,
871
911
  filters: o
872
- }), g = d === "fixed";
873
- return /* @__PURE__ */ p("div", { className: `table-wrapper ${g ? "table-fixed" : "table-fluid"}`, children: [
874
- /* @__PURE__ */ e("input", { type: "hidden", ...C }),
875
- /* @__PURE__ */ p("div", { className: "header-handle", children: [
876
- /* @__PURE__ */ e("h3", { children: i }),
877
- !R && m && /* @__PURE__ */ p("div", { className: "handle-actions", children: [
878
- /* @__PURE__ */ p(
912
+ }), N = d === "fixed";
913
+ return /* @__PURE__ */ v("div", { className: `table-wrapper ${N ? "table-fixed" : "table-fluid"}`, children: [
914
+ /* @__PURE__ */ e("input", { type: "hidden", ...B }),
915
+ /* @__PURE__ */ v("div", { className: "header-handle", children: [
916
+ /* @__PURE__ */ e("h3", { children: n }),
917
+ !A && m && /* @__PURE__ */ v("div", { className: "handle-actions", children: [
918
+ /* @__PURE__ */ v(
879
919
  "button",
880
920
  {
881
921
  type: "button",
882
- className: `btn ${S.length > 0 ? "btn-danger" : "btn-primary"}`,
883
- disabled: S.length === 0,
884
- onClick: O.removeRows,
922
+ className: `btn ${_.length > 0 ? "btn-danger" : "btn-primary"}`,
923
+ disabled: _.length === 0,
924
+ onClick: R.removeRows,
885
925
  children: [
886
926
  "Remover (",
887
- S.length,
927
+ _.length,
888
928
  ")"
889
929
  ]
890
930
  }
891
931
  ),
892
- /* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: O.addRow, children: "Adicionar" })
932
+ /* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: R.addRow, children: "Adicionar" })
893
933
  ] })
894
934
  ] }),
895
- /* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */ p("table", { className: "table-custom", children: [
896
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ p("tr", { children: [
897
- !R && /* @__PURE__ */ e("th", { style: { width: "50px" }, children: /* @__PURE__ */ e(
935
+ /* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */ v("table", { className: "table-custom", children: [
936
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ v("tr", { children: [
937
+ !A && /* @__PURE__ */ e("th", { style: { width: "50px" }, children: /* @__PURE__ */ e(
898
938
  "input",
899
939
  {
900
940
  type: "checkbox",
901
- checked: E,
902
- onChange: (r) => O.toggleSelectAll(r.target.checked)
941
+ checked: $,
942
+ onChange: (s) => R.toggleSelectAll(s.target.checked)
903
943
  }
904
944
  ) }),
905
- a.map((r) => /* @__PURE__ */ e(
945
+ u.map((s) => /* @__PURE__ */ e(
906
946
  "th",
907
947
  {
908
- style: r.width ? { minWidth: g ? r.width : "100%" } : { width: "max-content" },
909
- children: r.label
948
+ style: s.width ? { minWidth: N ? s.width : "100%" } : { width: "max-content" },
949
+ children: s.label
910
950
  },
911
- String(r.key)
951
+ String(s.key)
912
952
  ))
913
953
  ] }) }),
914
- /* @__PURE__ */ p("tbody", { children: [
915
- b.map((r, n) => /* @__PURE__ */ p("tr", { children: [
916
- !R && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
954
+ /* @__PURE__ */ v("tbody", { children: [
955
+ b.map((s, i) => /* @__PURE__ */ v("tr", { children: [
956
+ !A && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
917
957
  "input",
918
958
  {
919
959
  type: "checkbox",
920
- checked: S.includes(r._uid),
921
- onChange: () => O.toggleSelection(r._uid)
960
+ checked: _.includes(s._uid),
961
+ onChange: () => R.toggleSelection(s._uid)
922
962
  }
923
963
  ) }),
924
- a.map((s) => /* @__PURE__ */ e("td", { children: s.render ? s.render.length <= 1 ? s.render({
925
- row: r,
926
- index: n,
927
- updateRow: (f, N) => O.updateCellValue(r._uid, String(f), N),
928
- isLocked: !!R,
929
- isView: !!l
930
- }) : s.render(
931
- r,
932
- n,
933
- (f, N) => O.updateCellValue(r._uid, f, N),
934
- !!R,
935
- !!l
936
- ) : r[s.key] }, `${r._uid}-${String(s.key)}`))
937
- ] }, r._uid)),
938
- b.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children: R ? "Nenhum registro encontrado." : "Nenhum registro." }) })
964
+ u.map((l) => /* @__PURE__ */ e("td", { children: l.render ? l.render.length <= 1 ? l.render({
965
+ row: s,
966
+ index: i,
967
+ updateRow: (a, p) => R.updateCellValue(s._uid, String(a), p),
968
+ isLocked: !!A,
969
+ isView: !!r
970
+ }) : l.render(
971
+ s,
972
+ i,
973
+ (a, p) => R.updateCellValue(s._uid, a, p),
974
+ !!A,
975
+ !!r
976
+ ) : s[l.key] }, `${s._uid}-${String(l.key)}`))
977
+ ] }, s._uid)),
978
+ b.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children: A ? "Nenhum registro encontrado." : "Nenhum registro." }) })
939
979
  ] })
940
980
  ] }) })
941
981
  ] });
942
- }, tt = (t, i) => {
943
- const [a, u] = U(null);
982
+ }, tt = (t, n) => {
983
+ const [u, f] = z(null);
944
984
  let c = null;
945
985
  try {
946
- c = J().watch;
986
+ c = W().watch;
947
987
  } catch {
948
988
  }
949
- const d = i !== void 0 ? i : c ? c(t) : void 0, m = P(() => {
989
+ const d = n !== void 0 ? n : c ? c(t) : void 0, m = P(() => {
950
990
  try {
951
- const v = window.top.__REACT_ATTACHMENT_BRIDGE__;
952
- if (v) {
953
- const l = v.getAttachment(t, d);
954
- u(l || (d ? { name: d, documentId: 0 } : null));
991
+ const g = window.top.__REACT_ATTACHMENT_BRIDGE__;
992
+ if (g) {
993
+ const r = g.getAttachment(t, d);
994
+ f(r || (d ? { name: d, documentId: 0 } : null));
955
995
  } else
956
- u(d ? { name: d, documentId: 0 } : null);
996
+ f(d ? { name: d, documentId: 0 } : null);
957
997
  } catch {
958
- u(d ? { name: d, documentId: 0 } : null);
998
+ f(d ? { name: d, documentId: 0 } : null);
959
999
  }
960
- }, [t, d, i]);
961
- return j(() => {
1000
+ }, [t, d, n]);
1001
+ return T(() => {
962
1002
  m();
963
1003
  const o = setInterval(m, 2e3);
964
1004
  return () => clearInterval(o);
965
- }, [m]), { attachment: a, sync: m };
1005
+ }, [m]), { attachment: u, sync: m };
966
1006
  }, st = ({
967
1007
  name: t,
968
- label: i,
969
- help: a,
970
- valueManual: u,
1008
+ label: n,
1009
+ help: u,
1010
+ valueManual: f,
971
1011
  onChangeManual: c,
972
1012
  forceReadOnly: d = !1,
973
1013
  forceHidden: m = !1,
974
1014
  helpText: o,
975
- helpTitle: v,
976
- helpWidth: l
1015
+ helpTitle: g,
1016
+ helpWidth: r
977
1017
  }) => {
978
- const y = !!c, { isReadOnly: $, isHidden: R } = G(), { isView: C } = z(), b = d || C || !!$(t), S = m || !!R(t), [E, O] = U(!1);
979
- let g = null;
1018
+ const h = !!c, { isReadOnly: O, isHidden: A } = G(), { isView: B } = Y(), b = d || B || !!O(t), _ = m || !!A(t), [$, R] = z(!1);
1019
+ let N = null;
980
1020
  try {
981
- g = J().control;
1021
+ N = W().control;
982
1022
  } catch {
983
1023
  }
984
- const r = g && !y ? Q({ name: t, control: g }).field : {
985
- value: u,
1024
+ const s = N && !h ? Z({ name: t, control: N }).field : {
1025
+ value: f,
986
1026
  onChange: (w) => c == null ? void 0 : c(w)
987
- }, { attachment: n, sync: s } = tt(t, u), f = () => {
1027
+ }, { attachment: i, sync: l } = tt(t, f), a = () => {
988
1028
  var w;
989
1029
  try {
990
1030
  const k = window.top;
@@ -995,87 +1035,87 @@ const pt = ({
995
1035
  } catch {
996
1036
  return { bridge: null, toast: null };
997
1037
  }
998
- }, N = P(() => {
1038
+ }, p = P(() => {
999
1039
  if (b) return;
1000
1040
  const w = document.createElement("input");
1001
1041
  w.type = "file", w.onchange = (k) => {
1002
- const A = k.target.files[0];
1003
- if (!A) return;
1004
- const { bridge: h, toast: D } = f();
1005
- O(!0), h ? h.upload(A, t, (L) => {
1006
- y ? c == null || c(L.name) : r.onChange(L.name), setTimeout(() => {
1007
- O(!1), s();
1008
- }, 1e3), D && D({
1042
+ const D = k.target.files[0];
1043
+ if (!D) return;
1044
+ const { bridge: y, toast: E } = a();
1045
+ R(!0), y ? y.upload(D, t, (H) => {
1046
+ h ? c == null || c(H.name) : s.onChange(H.name), setTimeout(() => {
1047
+ R(!1), l();
1048
+ }, 1e3), E && E({
1009
1049
  title: "Sucesso",
1010
1050
  message: "Arquivo enviado",
1011
1051
  type: "success"
1012
1052
  });
1013
- }) : (y ? c == null || c(A.name) : r.onChange(A.name), O(!1));
1053
+ }) : (h ? c == null || c(D.name) : s.onChange(D.name), R(!1));
1014
1054
  }, w.click();
1015
- }, [t, r, s, c, b, y]), I = (w) => {
1055
+ }, [t, s, l, c, b, h]), V = (w) => {
1016
1056
  if (w.stopPropagation(), b) return;
1017
- const k = (n == null ? void 0 : n.name) || u || r.value;
1057
+ const k = (i == null ? void 0 : i.name) || f || s.value;
1018
1058
  if (!k) return;
1019
- const { bridge: A, toast: h } = f();
1020
- A ? A.removeByFileName(k) ? (y ? c == null || c("") : r.onChange(""), s()) : h && h({
1059
+ const { bridge: D, toast: y } = a();
1060
+ D ? D.removeByFileName(k) ? (h ? c == null || c("") : s.onChange(""), l()) : y && y({
1021
1061
  title: "Erro",
1022
1062
  message: "Erro ao remover anexo",
1023
1063
  type: "danger"
1024
- }) : (y ? c == null || c("") : r.onChange(""), s());
1025
- }, B = !!n && !E, V = (n == null ? void 0 : n.name) || u || r.value, _ = [
1064
+ }) : (h ? c == null || c("") : s.onChange(""), l());
1065
+ }, L = !!i && !$, I = (i == null ? void 0 : i.name) || f || s.value, x = [
1026
1066
  "fluig-attachment__box",
1027
- B ? "fluig-attachment__box--has-file" : "",
1028
- E ? "fluig-attachment__box--uploading" : "",
1029
- b && !B ? "readOnly" : "",
1030
- b && B ? "fluig-attachment__box--readonly-view" : ""
1067
+ L ? "fluig-attachment__box--has-file" : "",
1068
+ $ ? "fluig-attachment__box--uploading" : "",
1069
+ b && !L ? "readOnly" : "",
1070
+ b && L ? "fluig-attachment__box--readonly-view" : ""
1031
1071
  ].join(" ");
1032
- return S ? null : /* @__PURE__ */ p("div", { className: "form-group fluig-attachment", children: [
1033
- i && /* @__PURE__ */ e("label", { className: "fluig-attachment__label", children: i }),
1034
- /* @__PURE__ */ p("div", { className: o ? "dfe-flex-input-wrapper" : "", children: [
1035
- /* @__PURE__ */ p(
1072
+ return _ ? null : /* @__PURE__ */ v("div", { className: "form-group fluig-attachment", children: [
1073
+ n && /* @__PURE__ */ e("label", { className: "fluig-attachment__label", children: n }),
1074
+ /* @__PURE__ */ v("div", { className: o ? "dfe-flex-input-wrapper" : "", children: [
1075
+ /* @__PURE__ */ v(
1036
1076
  "div",
1037
1077
  {
1038
- className: _,
1078
+ className: x,
1039
1079
  style: o ? { flex: 1 } : void 0,
1040
1080
  onClick: () => {
1041
- if (B) {
1042
- const w = f(), k = (n == null ? void 0 : n.physicalFileName) || (n == null ? void 0 : n.description) || (n == null ? void 0 : n.name) || V;
1081
+ if (L) {
1082
+ const w = a(), k = (i == null ? void 0 : i.physicalFileName) || (i == null ? void 0 : i.description) || (i == null ? void 0 : i.name) || I;
1043
1083
  w.bridge && k && w.bridge.view(k);
1044
1084
  } else
1045
- N();
1085
+ p();
1046
1086
  },
1047
1087
  children: [
1048
- /* @__PURE__ */ p("span", { className: "fluig-attachment__content", children: [
1088
+ /* @__PURE__ */ v("span", { className: "fluig-attachment__content", children: [
1049
1089
  /* @__PURE__ */ e(
1050
1090
  "i",
1051
1091
  {
1052
- className: `flaticon icon-sm ${E ? "flaticon-loading" : B ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1092
+ className: `flaticon icon-sm ${$ ? "flaticon-loading" : L ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1053
1093
  }
1054
1094
  ),
1055
- /* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children: E ? " Enviando..." : B ? V : b ? "Nenhum arquivo" : a || "Anexar" })
1095
+ /* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children: $ ? " Enviando..." : L ? I : b ? "Nenhum arquivo" : u || "Anexar" })
1056
1096
  ] }),
1057
- B && !b && /* @__PURE__ */ e(
1097
+ L && !b && /* @__PURE__ */ e(
1058
1098
  "button",
1059
1099
  {
1060
1100
  type: "button",
1061
1101
  className: "fluig-attachment__btn-remove btn btn-link text-danger",
1062
- onClick: I,
1102
+ onClick: V,
1063
1103
  children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-trash icon-sm" })
1064
1104
  }
1065
1105
  )
1066
1106
  ]
1067
1107
  }
1068
1108
  ),
1069
- o && /* @__PURE__ */ e(Z, { text: o, title: v, width: l })
1109
+ o && /* @__PURE__ */ e(ee, { text: o, title: g, width: r })
1070
1110
  ] }),
1071
- !y && g && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: r.value || "" })
1111
+ !h && N && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: s.value || "" })
1072
1112
  ] });
1073
1113
  }, vt = q(st);
1074
1114
  export {
1075
1115
  vt as Attachment,
1076
1116
  at as Checkbox,
1077
1117
  mt as DatePicker,
1078
- Z as Help,
1118
+ ee as Help,
1079
1119
  dt as Input,
1080
1120
  Ie as Modal,
1081
1121
  ut as RadioBtn,