diefra_ecm_ui 1.0.9 → 1.2.0

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,866 +1,477 @@
1
- import { jsxs as k, jsx as r, Fragment as ce } from "react/jsx-runtime";
2
- import { memo as z, useMemo as B, useCallback as C, useState as I, useRef as G, useEffect as E, forwardRef as ie, createElement as Z } from "react";
3
- import { useFormContext as H, useController as X, useFormState as se } from "react-hook-form";
4
- import { IMaskInput as le } from "react-imask";
5
- import { useSection as F, useFluigRuntime as L } from "@fluig-kit/ecm";
6
- import { parse as ue, isValid as me, eachDayOfInterval as fe, endOfWeek as he, endOfMonth as pe, startOfWeek as ye, startOfMonth as ve, subMonths as ge, format as K, addMonths as be, isSameMonth as we, isSameDay as Ne, isToday as ke } from "date-fns";
7
- const xe = {
1
+ import { jsx as e, jsxs as h, Fragment as ce } from "react/jsx-runtime";
2
+ import { useCallback as j, useEffect as T, memo as q, useState as P, useMemo as z, useRef as X, forwardRef as de, createElement as K } from "react";
3
+ import { useFormContext as U, useController as W, useFormState as oe } from "react-hook-form";
4
+ import { IMaskInput as pe } from "react-imask";
5
+ import { useSection as G, useFluigRuntime as Y } 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 Se, isSameMonth as Re, isSameDay as $e, format as ue, isToday as xe, parse as Ae } from "date-fns";
7
+ function Ie({ title: t, isOpen: l, onOpen: a, onClose: f, content: c, footer: o, width: m }) {
8
+ const d = j(
9
+ (p) => {
10
+ p.key === "Escape" && f();
11
+ },
12
+ [f]
13
+ );
14
+ return T(() => (l && (document.addEventListener("keydown", d), a == null || a(), document.body.style.overflow = "hidden"), () => {
15
+ document.removeEventListener("keydown", d), document.body.style.overflow = "auto";
16
+ }), [l, d, a]), l ? /* @__PURE__ */ e("div", { className: "modal-overlay", onClick: f, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ h("div", { style: { maxWidth: m }, className: "modal-container", onClick: (p) => p.stopPropagation(), children: [
17
+ /* @__PURE__ */ h("div", { className: "modal-header", children: [
18
+ /* @__PURE__ */ e("h3", { children: t }),
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
+ ] }),
21
+ /* @__PURE__ */ e("div", { className: "modal-content", children: c }),
22
+ o && /* @__PURE__ */ e("div", { className: "modal-footer", children: o })
23
+ ] }) }) : null;
24
+ }
25
+ function Ve({ text: t, title: l = "Ajuda & Informações", width: a = "500px", className: f = "" }) {
26
+ const [c, o] = P(!1), m = (d) => {
27
+ d.preventDefault(), d.stopPropagation(), o(!0);
28
+ };
29
+ return /* @__PURE__ */ h(ce, { children: [
30
+ /* @__PURE__ */ e(
31
+ "div",
32
+ {
33
+ className: `dfe-help-indicator ${f}`,
34
+ onClick: m,
35
+ role: "button",
36
+ tabIndex: 0,
37
+ "aria-label": "Botão de ajuda",
38
+ title: "Clique para obter ajuda",
39
+ children: /* @__PURE__ */ e("span", { children: "?" })
40
+ }
41
+ ),
42
+ /* @__PURE__ */ e(
43
+ Ie,
44
+ {
45
+ title: l,
46
+ isOpen: c,
47
+ onClose: () => o(!1),
48
+ width: a,
49
+ content: /* @__PURE__ */ e("div", { className: "dfe-help-modal-body", children: t }),
50
+ footer: /* @__PURE__ */ e("div", { className: "dfe-help-modal-footer", children: /* @__PURE__ */ e("button", { type: "button", className: "btn btn-info dfe-help-btn", onClick: () => o(!1), children: "Entendido" }) })
51
+ }
52
+ )
53
+ ] });
54
+ }
55
+ const Z = q(Ve), Ee = {
8
56
  cpf: "000.000.000-00",
9
57
  cnpj: "00.000.000/0000-00",
10
58
  telefone: "(00) 00000-0000",
11
59
  cep: "00000-000"
12
60
  };
13
- function Re({
14
- name: e,
15
- label: t = "",
16
- placeholder: n = "",
17
- type: s = "text",
18
- mask: i,
19
- className: c = "",
20
- forceReadOnly: l = !1,
21
- forceHidden: o = !1,
22
- valueManual: b,
23
- onChangeManual: a,
24
- errorManual: N
61
+ function De({
62
+ name: t,
63
+ label: l = "",
64
+ placeholder: a = "",
65
+ type: f = "text",
66
+ mask: c,
67
+ className: o = "",
68
+ forceReadOnly: m = !1,
69
+ forceHidden: d = !1,
70
+ helpText: p,
71
+ helpTitle: i,
72
+ helpWidth: v,
73
+ valueManual: x,
74
+ onChangeManual: S,
75
+ errorManual: C
25
76
  }) {
26
- var x, P;
27
- const h = b !== void 0 && !!a, { isReadOnly: W, isHidden: V } = F(), O = l || !!W(e), S = o || !!V(e), { isView: A } = L();
28
- let p = null;
77
+ var E, L;
78
+ const y = x !== void 0 && !!S, { isReadOnly: R, isHidden: D } = G(), _ = m || !!R(t), g = d || !!D(t), { isView: r } = Y();
79
+ let n = null;
29
80
  try {
30
- p = H();
81
+ n = U();
31
82
  } catch {
32
83
  }
33
- const v = !h && p ? X({ name: e, control: p.control }) : null, u = !h && p ? se({ name: e }) : null, m = h ? b : v == null ? void 0 : v.field.value, d = h ? N : (P = (x = u == null ? void 0 : u.errors) == null ? void 0 : x[e]) == null ? void 0 : P.message, f = B(
34
- () => i ? xe[i] ?? i : null,
35
- [i]
36
- ), w = C((g) => {
37
- if (!g) return "";
38
- const j = g.replace(/\D/g, "");
39
- return (Number(j) / 100).toLocaleString("pt-BR", {
84
+ const s = !y && n ? W({ name: t, control: n.control }) : null, u = !y && n ? oe({ name: t }) : null, k = y ? x : s == null ? void 0 : s.field.value, I = y ? C : (L = (E = u == null ? void 0 : u.errors) == null ? void 0 : E[t]) == null ? void 0 : L.message, B = z(() => c ? Ee[c] ?? c : null, [c]), V = j((H) => {
85
+ if (!H) return "";
86
+ const J = H.replace(/\D/g, "");
87
+ return (Number(J) / 100).toLocaleString("pt-BR", {
40
88
  style: "currency",
41
89
  currency: "BRL"
42
90
  });
43
- }, []), D = C(
44
- (g) => s === "monetary" ? w(g) : g,
45
- [s, w]
46
- ), $ = (g) => {
47
- const j = D(g);
48
- h ? a == null || a(j) : v == null || v.field.onChange(j);
49
- }, _ = () => {
50
- h || v == null || v.field.onBlur();
91
+ }, []), O = j(
92
+ (H) => f === "monetary" ? V(H) : H,
93
+ [f, V]
94
+ ), w = (H) => {
95
+ const J = O(H);
96
+ y ? S == null || S(J) : s == null || s.field.onChange(J);
97
+ }, N = () => {
98
+ y || s == null || s.field.onBlur();
51
99
  };
52
- if (A)
53
- return /* @__PURE__ */ k("div", { className: "form-group", children: [
54
- /* @__PURE__ */ r("label", { children: t }),
55
- /* @__PURE__ */ r("span", { className: "form-control", children: m || "-" })
56
- ] });
57
- const y = `form-control ${O ? "readOnly" : ""} ${d ? "border-red" : ""} ${c}`;
58
- return /* @__PURE__ */ k("div", { className: `form-group ${S ? "hidden" : ""}`, children: [
59
- t && /* @__PURE__ */ r("label", { children: t }),
60
- f ? /* @__PURE__ */ r(
61
- le,
62
- {
63
- name: e,
64
- mask: f,
65
- value: String(m ?? ""),
66
- unmask: !1,
67
- onAccept: (g) => $(g),
68
- placeholder: n,
69
- readOnly: O,
70
- className: y,
71
- inputRef: h || v == null ? void 0 : v.field.ref,
72
- onBlur: _
73
- }
74
- ) : /* @__PURE__ */ r(
75
- "input",
76
- {
77
- type: "text",
78
- name: e,
79
- value: m ?? "",
80
- onChange: (g) => $(g.target.value),
81
- onBlur: _,
82
- placeholder: n,
83
- readOnly: O,
84
- className: y
85
- }
86
- ),
87
- d && /* @__PURE__ */ r("p", { className: "text-danger", children: String(d) })
100
+ if (g) return null;
101
+ const A = `form-control ${_ ? "readOnly" : ""} ${I ? "border-red" : ""} ${o}`, b = () => B ? /* @__PURE__ */ e(
102
+ pe,
103
+ {
104
+ name: t,
105
+ mask: B,
106
+ value: String(k ?? ""),
107
+ unmask: !1,
108
+ onAccept: (H) => w(H),
109
+ placeholder: a,
110
+ readOnly: _,
111
+ className: A,
112
+ inputRef: y || s == null ? void 0 : s.field.ref,
113
+ onBlur: N
114
+ }
115
+ ) : /* @__PURE__ */ e(
116
+ "input",
117
+ {
118
+ type: f === "number" ? "number" : "text",
119
+ name: t,
120
+ value: k ?? "",
121
+ onChange: (H) => w(H.target.value),
122
+ onBlur: N,
123
+ placeholder: a,
124
+ readOnly: _,
125
+ className: A
126
+ }
127
+ );
128
+ return r ? /* @__PURE__ */ h("div", { className: "form-group", children: [
129
+ l && /* @__PURE__ */ e("label", { children: l }),
130
+ /* @__PURE__ */ h("div", { className: p ? "dfe-flex-input-wrapper" : "", children: [
131
+ /* @__PURE__ */ e("span", { className: A, children: k || "-" }),
132
+ p && /* @__PURE__ */ e(Z, { text: p, title: i, width: v })
133
+ ] })
134
+ ] }) : /* @__PURE__ */ h("div", { className: `form-group ${g ? "hidden" : ""}`, children: [
135
+ l && /* @__PURE__ */ e("label", { children: l }),
136
+ /* @__PURE__ */ h("div", { className: p ? "dfe-flex-input-wrapper" : "", children: [
137
+ b(),
138
+ p && /* @__PURE__ */ e(Z, { text: p, title: i, width: v })
139
+ ] }),
140
+ I && /* @__PURE__ */ e("p", { className: "text-danger", children: String(I) })
88
141
  ] });
89
142
  }
90
- const Vt = z(Re);
91
- function Se({
92
- name: e,
93
- label: t = "",
94
- options: n = [],
95
- placeholder: s = "",
96
- labelKey: i = "label",
97
- valueKey: c = "value",
98
- enableSearch: l = !1,
99
- searchPlaceholder: o = "Buscar...",
100
- loading: b = !1,
101
- onSearchChange: a,
102
- debounceTime: N = 300,
103
- onSelect: h,
104
- forceReadOnly: W = !1,
105
- forceHidden: V = !1,
106
- valueManual: O,
107
- onChangeManual: S,
108
- errorManual: A
143
+ const ot = q(De);
144
+ function Be({
145
+ name: t,
146
+ label: l = "",
147
+ options: a = [],
148
+ placeholder: f = "",
149
+ labelKey: c = "label",
150
+ valueKey: o = "value",
151
+ enableSearch: m = !1,
152
+ searchPlaceholder: d = "Buscar...",
153
+ loading: p = !1,
154
+ onSearchChange: i,
155
+ debounceTime: v = 300,
156
+ onSelect: x,
157
+ forceReadOnly: S = !1,
158
+ forceHidden: C = !1,
159
+ helpText: y,
160
+ helpTitle: R,
161
+ helpWidth: D,
162
+ valueManual: _,
163
+ onChangeManual: g,
164
+ errorManual: r
109
165
  }) {
110
- var ne;
111
- const p = O !== void 0 && !!S, { isReadOnly: v, isHidden: u } = F(), m = W || !!v(e), d = V || !!u(e), { isView: f } = L();
112
- let w = "", D = () => {
113
- }, $, _ = null, y = () => {
166
+ var se;
167
+ const n = _ !== void 0 && !!g, { isReadOnly: s, isHidden: u } = G(), k = S || !!s(t), I = C || !!u(t), { isView: B } = Y();
168
+ let V = "", O = () => {
169
+ }, w, N = null, A = () => {
114
170
  };
115
- if (p)
116
- w = O;
171
+ if (n)
172
+ V = _;
117
173
  else
118
174
  try {
119
- const R = H(), T = X({ name: e, control: R.control });
120
- w = T.field.value, D = T.field.onChange, $ = T.field.ref, _ = (ne = T.fieldState) == null ? void 0 : ne.error, y = R.clearErrors;
175
+ const $ = U(), F = W({ name: t, control: $.control });
176
+ V = F.field.value, O = F.field.onChange, w = F.field.ref, N = (se = F.fieldState) == null ? void 0 : se.error, A = $.clearErrors;
121
177
  } catch {
122
178
  }
123
- const [x, P] = I(!1), [g, j] = I(""), q = G(null), U = G(a);
124
- E(() => {
125
- U.current = a;
126
- }, [a]), E(() => {
127
- const R = (T) => {
128
- q.current && !q.current.contains(T.target) && P(!1);
179
+ const [b, E] = P(!1), [L, H] = P(""), J = X(null), Q = X(i);
180
+ T(() => {
181
+ Q.current = i;
182
+ }, [i]), T(() => {
183
+ const $ = (F) => {
184
+ J.current && !J.current.contains(F.target) && E(!1);
129
185
  };
130
- return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
131
- }, []), E(() => {
132
- x || j("");
133
- }, [x]), E(() => {
134
- if (!l) return;
135
- const R = setTimeout(() => {
136
- var T;
137
- (T = U.current) == null || T.call(U, g);
138
- }, N);
139
- return () => clearTimeout(R);
140
- }, [g, l, N]);
141
- const ee = B(() => l && !a && g.trim() ? n.filter(
142
- (R) => String((R == null ? void 0 : R[i]) ?? "").toLowerCase().includes(g.toLowerCase())
143
- ) : n ?? [], [n, l, a, g, i]), te = B(() => {
144
- if (w == null) return "";
145
- if (typeof w == "object")
146
- return String(w[c] ?? "");
147
- const R = (n || []).find(
148
- (T) => String(T == null ? void 0 : T[c]) === String(w)
149
- );
150
- return String(R ? (R == null ? void 0 : R[i]) ?? "" : w);
151
- }, [w, n, c, i]), de = (R) => {
152
- m || (p ? S == null || S(R[c]) : (D(R[c]), y == null || y(e)), h == null || h(R), P(!1));
186
+ return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
187
+ }, []), T(() => {
188
+ b || H("");
189
+ }, [b]), T(() => {
190
+ if (!m) return;
191
+ const $ = setTimeout(() => {
192
+ var F;
193
+ (F = Q.current) == null || F.call(Q, L);
194
+ }, v);
195
+ return () => clearTimeout($);
196
+ }, [L, m, v]);
197
+ const ee = z(() => m && !i && L.trim() ? a.filter(
198
+ ($) => String(($ == null ? void 0 : $[c]) ?? "").toLowerCase().includes(L.toLowerCase())
199
+ ) : a ?? [], [a, m, i, L, c]), te = z(() => {
200
+ if (V == null) return "";
201
+ if (typeof V == "object")
202
+ return String(V[o] ?? "");
203
+ const $ = (a || []).find((F) => String(F == null ? void 0 : F[o]) === String(V));
204
+ return String($ ? ($ == null ? void 0 : $[c]) ?? "" : V);
205
+ }, [V, a, o, c]), he = ($) => {
206
+ k || (n ? g == null || g($[o]) : (O($[o]), A == null || A(t)), x == null || x($), E(!1));
153
207
  };
154
- return /* @__PURE__ */ k(
155
- "div",
156
- {
157
- className: `select-wrapper form-group ${d ? "hidden" : ""}`,
158
- ref: q,
159
- children: [
160
- /* @__PURE__ */ r("label", { className: "control-label", children: t }),
161
- f ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */ k(ce, { children: [
162
- /* @__PURE__ */ k(
163
- "div",
164
- {
165
- className: `select-control ${_ ? "border-red" : ""} ${m ? "readOnly" : ""}`,
166
- onClick: () => !m && P((R) => !R),
167
- ref: $,
168
- children: [
169
- /* @__PURE__ */ r("span", { className: `select-display ${m ? "readOnly" : ""}`, children: te || s }),
170
- /* @__PURE__ */ r("i", { className: "flaticon flaticon-chevron-down select-icon" })
171
- ]
172
- }
173
- ),
174
- x && !m && /* @__PURE__ */ k("div", { className: "select-dropdown", children: [
175
- l && /* @__PURE__ */ r("div", { className: "select-search", children: /* @__PURE__ */ r(
176
- "input",
177
- {
178
- type: "text",
179
- className: "select-search-input",
180
- value: g,
181
- onChange: (R) => j(R.target.value),
182
- placeholder: b ? "Carregando..." : o,
183
- autoFocus: !0,
184
- onClick: (R) => R.stopPropagation()
185
- }
186
- ) }),
187
- /* @__PURE__ */ r("ul", { className: "select-options", children: b ? /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map((R) => /* @__PURE__ */ r(
188
- "li",
189
- {
190
- onClick: () => de(R),
191
- className: "select-option handleHover",
192
- children: R[i]
193
- },
194
- R[c]
195
- )) : /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Sem resultados" }) })
196
- ] })
197
- ] }),
198
- !p && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: w || "" }),
199
- (_ || A) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((_ == null ? void 0 : _.message) ?? A) })
200
- ]
201
- }
202
- );
208
+ return I ? null : /* @__PURE__ */ h("div", { className: `select-wrapper form-group ${I ? "hidden" : ""}`, ref: J, children: [
209
+ /* @__PURE__ */ e("label", { className: "control-label", children: l }),
210
+ B ? /* @__PURE__ */ h("div", { className: y ? "dfe-flex-input-wrapper" : "", children: [
211
+ /* @__PURE__ */ e("span", { className: "form-control", style: y ? { flex: 1 } : void 0, children: te || "-" }),
212
+ y && /* @__PURE__ */ e(Z, { text: y, title: R, width: D })
213
+ ] }) : /* @__PURE__ */ h(ce, { children: [
214
+ /* @__PURE__ */ h("div", { className: y ? "dfe-flex-input-wrapper" : "", children: [
215
+ /* @__PURE__ */ h(
216
+ "div",
217
+ {
218
+ className: `select-control ${N ? "border-red" : ""} ${k ? "readOnly" : ""}`,
219
+ onClick: () => !k && E(($) => !$),
220
+ ref: w,
221
+ style: y ? { flex: 1 } : void 0,
222
+ children: [
223
+ /* @__PURE__ */ e("span", { className: `select-display ${k ? "readOnly" : ""}`, children: te || f }),
224
+ /* @__PURE__ */ e("i", { className: "flaticon flaticon-chevron-down select-icon" })
225
+ ]
226
+ }
227
+ ),
228
+ y && /* @__PURE__ */ e(Z, { text: y, title: R, width: D })
229
+ ] }),
230
+ b && !k && /* @__PURE__ */ h("div", { className: "select-dropdown", children: [
231
+ m && /* @__PURE__ */ e("div", { className: "select-search", children: /* @__PURE__ */ e(
232
+ "input",
233
+ {
234
+ type: "text",
235
+ className: "select-search-input",
236
+ value: L,
237
+ onChange: ($) => H($.target.value),
238
+ placeholder: p ? "Carregando..." : d,
239
+ autoFocus: !0,
240
+ onClick: ($) => $.stopPropagation()
241
+ }
242
+ ) }),
243
+ /* @__PURE__ */ e("ul", { className: "select-options", children: p ? /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map(($) => /* @__PURE__ */ e("li", { onClick: () => he($), className: "select-option handleHover", children: $[c] }, $[o])) : /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Sem resultados" }) })
244
+ ] })
245
+ ] }),
246
+ !n && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: V || "" }),
247
+ (N || r) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((N == null ? void 0 : N.message) ?? r) })
248
+ ] });
203
249
  }
204
- const Dt = z(Se);
205
- function Tt({
206
- name: e,
207
- options: t = [],
208
- label: n = "",
209
- valueKey: s = "value",
210
- labelKey: i = "label",
211
- forceReadOnly: c = !1,
212
- forceHidden: l = !1,
213
- valueManual: o,
214
- onChangeManual: b
250
+ const re = q(Be);
251
+ function at({
252
+ name: t,
253
+ options: l = [],
254
+ label: a = "",
255
+ valueKey: f = "value",
256
+ labelKey: c = "label",
257
+ forceReadOnly: o = !1,
258
+ forceHidden: m = !1,
259
+ valueManual: d,
260
+ onChangeManual: p
215
261
  }) {
216
- var $, _;
217
- let a = null;
262
+ var B, V;
263
+ let i = null;
218
264
  try {
219
- a = H();
265
+ i = U();
220
266
  } catch {
221
267
  }
222
- const N = o !== void 0 && !!b, { isView: h, isReadOnly: W } = L(), { isReadOnly: V, isHidden: O } = F(), S = V ? V(e) : !1, A = O ? O(e) : !1, p = c || S, v = l || A, u = p || W || h, m = () => t ? t.reduce(
223
- (y, x) => {
224
- const P = String(x[s]);
225
- if (N)
226
- y[P] = !!(o != null && o[P]);
227
- else if (a) {
228
- const g = a.getValues(P);
229
- y[P] = g === "on";
268
+ const v = d !== void 0 && !!p, { isView: x, isReadOnly: S } = Y(), { isReadOnly: C, isHidden: y } = G(), R = C ? C(t) : !1, D = y ? y(t) : !1, _ = o || R, g = m || D, r = _ || S || x, n = () => l ? l.reduce(
269
+ (O, w) => {
270
+ const N = String(w[f]);
271
+ if (v)
272
+ O[N] = !!(d != null && d[N]);
273
+ else if (i) {
274
+ const A = i.getValues(N);
275
+ O[N] = A === "on";
230
276
  } else
231
- y[P] = !1;
232
- return y;
277
+ O[N] = !1;
278
+ return O;
233
279
  },
234
280
  {}
235
- ) : {}, d = !N && a ? a.watch(e) : void 0, f = B(() => N && o ? o : d && typeof d == "object" ? d : m(), [d, o, t]);
236
- E(() => {
237
- if (N || !a) return;
238
- const y = a.getValues(e);
239
- (!y || typeof y != "object") && a.setValue(e, f, {
281
+ ) : {}, s = !v && i ? i.watch(t) : void 0, u = z(() => v && d ? d : s && typeof s == "object" ? s : n(), [s, d, l]);
282
+ T(() => {
283
+ if (v || !i) return;
284
+ const O = i.getValues(t);
285
+ (!O || typeof O != "object") && i.setValue(t, u, {
240
286
  shouldDirty: !1,
241
287
  shouldValidate: !1
242
288
  });
243
- }, [f, e, a, N]);
244
- const w = (y, x) => {
245
- if (u) return;
246
- const P = { ...f, [y]: x };
247
- if (N) {
248
- b && b(P);
289
+ }, [u, t, i, v]);
290
+ const k = (O, w) => {
291
+ if (r) return;
292
+ const N = { ...u, [O]: w };
293
+ if (v) {
294
+ p && p(N);
249
295
  return;
250
296
  }
251
- a && (a.setValue(e, P, {
297
+ i && (i.setValue(t, N, {
252
298
  shouldDirty: !0,
253
299
  shouldValidate: !0
254
- }), a.setValue(y, x ? "on" : "", { shouldValidate: !1 }));
255
- }, D = N ? null : (_ = ($ = a == null ? void 0 : a.formState) == null ? void 0 : $.errors) == null ? void 0 : _[e];
256
- return /* @__PURE__ */ k("div", { className: `form-group ${v ? "hidden" : ""}`, children: [
257
- n && /* @__PURE__ */ r("label", { children: n }),
258
- /* @__PURE__ */ r(
300
+ }), i.setValue(O, w ? "on" : "", { shouldValidate: !1 }));
301
+ }, I = v ? null : (V = (B = i == null ? void 0 : i.formState) == null ? void 0 : B.errors) == null ? void 0 : V[t];
302
+ return /* @__PURE__ */ h("div", { className: `form-group ${g ? "hidden" : ""}`, children: [
303
+ a && /* @__PURE__ */ e("label", { children: a }),
304
+ /* @__PURE__ */ e(
259
305
  "div",
260
306
  {
261
- className: `checkbox-group-custom ${u ? "readOnly" : ""}`,
262
- children: t.map((y) => {
263
- const x = String(y[s]), P = f[x] === !0;
264
- return /* @__PURE__ */ k("div", { children: [
265
- !N && a && /* @__PURE__ */ r("input", { type: "hidden", ...a.register(x) }),
266
- /* @__PURE__ */ k(
307
+ className: `checkbox-group-custom ${r ? "readOnly" : ""}`,
308
+ children: l.map((O) => {
309
+ const w = String(O[f]), N = u[w] === !0;
310
+ return /* @__PURE__ */ h("div", { children: [
311
+ !v && i && /* @__PURE__ */ e("input", { type: "hidden", ...i.register(w) }),
312
+ /* @__PURE__ */ h(
267
313
  "label",
268
314
  {
269
- className: `custom-checkbox ${P ? "checked" : ""} ${u ? "readOnly" : ""}`,
315
+ className: `custom-checkbox ${N ? "checked" : ""} ${r ? "readOnly" : ""}`,
270
316
  children: [
271
- /* @__PURE__ */ r(
317
+ /* @__PURE__ */ e(
272
318
  "input",
273
319
  {
274
320
  type: "checkbox",
275
- checked: P,
276
- disabled: u,
277
- onChange: (g) => w(x, g.target.checked)
321
+ checked: N,
322
+ disabled: r,
323
+ onChange: (A) => k(w, A.target.checked)
278
324
  }
279
325
  ),
280
- /* @__PURE__ */ r("span", { className: "checkmark" }),
281
- /* @__PURE__ */ r("span", { children: y[i] })
326
+ /* @__PURE__ */ e("span", { className: "checkmark" }),
327
+ /* @__PURE__ */ e("span", { children: O[c] })
282
328
  ]
283
329
  }
284
330
  )
285
- ] }, x);
331
+ ] }, w);
286
332
  })
287
333
  }
288
334
  ),
289
- D && /* @__PURE__ */ r("p", { className: "text-danger", children: String(D.message) })
335
+ I && /* @__PURE__ */ e("p", { className: "text-danger", children: String(I.message) })
290
336
  ] });
291
337
  }
292
- function Pe({
293
- name: e,
294
- label: t = "",
295
- options: n = [],
296
- valueKey: s = "value",
297
- labelKey: i = "label",
298
- iconKey: c = "icon",
299
- forceReadOnly: l = !1,
300
- forceHidden: o = !1,
301
- valueManual: b,
302
- onChangeManual: a,
303
- errorManual: N
338
+ function Ce({
339
+ name: t,
340
+ label: l = "",
341
+ options: a = [],
342
+ valueKey: f = "value",
343
+ labelKey: c = "label",
344
+ iconKey: o = "icon",
345
+ forceReadOnly: m = !1,
346
+ forceHidden: d = !1,
347
+ valueManual: p,
348
+ onChangeManual: i,
349
+ errorManual: v
304
350
  }) {
305
- var $, _;
306
- const h = b !== void 0 && !!a, { isReadOnly: W, isHidden: V } = F(), O = l || !!W(e), S = o || !!V(e), { isView: A, isReadOnly: p } = L();
307
- let v = null;
351
+ var B, V;
352
+ const x = p !== void 0 && !!i, { isReadOnly: S, isHidden: C } = G(), y = m || !!S(t), R = d || !!C(t), { isView: D, isReadOnly: _ } = Y();
353
+ let g = null;
308
354
  try {
309
- v = H();
355
+ g = U();
310
356
  } catch {
311
357
  }
312
- const u = !h && v ? X({ name: e, control: v.control, defaultValue: "" }) : null, m = !h && v ? se({ name: e }) : null, d = h ? N : (_ = ($ = m == null ? void 0 : m.errors) == null ? void 0 : $[e]) == null ? void 0 : _.message, f = O || p || A, w = h ? b : (u == null ? void 0 : u.field.value) ?? "", D = C(
313
- (y) => {
314
- f || (h ? a == null || a(y) : (u == null || u.field.onChange(y), u == null || u.field.onBlur()));
358
+ const r = !x && g ? W({ name: t, control: g.control, defaultValue: "" }) : null, n = !x && g ? oe({ name: t }) : null, s = x ? v : (V = (B = n == null ? void 0 : n.errors) == null ? void 0 : B[t]) == null ? void 0 : V.message, u = y || _ || D, k = x ? p : (r == null ? void 0 : r.field.value) ?? "", I = j(
359
+ (O) => {
360
+ u || (x ? i == null || i(O) : (r == null || r.field.onChange(O), r == null || r.field.onBlur()));
315
361
  },
316
- [f, h, a, u]
362
+ [u, x, i, r]
317
363
  );
318
- return /* @__PURE__ */ k("div", { className: `form-group column ${S ? "hidden" : ""}`, children: [
319
- t && /* @__PURE__ */ r("label", { className: "control-label", children: t }),
320
- /* @__PURE__ */ r("div", { className: `btn-group ${f ? "view-mode" : ""}`, "data-field-name": e, children: n.map((y) => {
321
- const x = y[s], P = w === x, g = y.color ? { "--customColor": y.color } : void 0;
364
+ return /* @__PURE__ */ h("div", { className: `form-group column ${R ? "hidden" : ""}`, children: [
365
+ l && /* @__PURE__ */ e("label", { className: "control-label", children: l }),
366
+ /* @__PURE__ */ e("div", { className: `btn-group ${u ? "view-mode" : ""}`, "data-field-name": t, children: a.map((O) => {
367
+ const w = O[f], N = k === w, A = O.color ? { "--customColor": O.color } : void 0;
322
368
  return (
323
369
  // Trocado de <label> para <div> para evitar comportamentos nativos de clique do HTML
324
- /* @__PURE__ */ k(
370
+ /* @__PURE__ */ h(
325
371
  "div",
326
372
  {
327
- style: g,
328
- className: `btn fs-ellipsis ${P ? "active" : ""}`,
329
- onClick: () => D(x),
373
+ style: A,
374
+ className: `btn fs-ellipsis ${N ? "active" : ""}`,
375
+ onClick: () => I(w),
330
376
  children: [
331
- y[c] && /* @__PURE__ */ r("i", { className: `${y[c]} icon-sm` }),
377
+ O[o] && /* @__PURE__ */ e("i", { className: `${O[o]} icon-sm` }),
332
378
  " ",
333
- y[i]
379
+ O[c]
334
380
  ]
335
381
  },
336
- x
382
+ w
337
383
  )
338
384
  );
339
385
  }) }),
340
- !h && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: w || "" }),
341
- (d || N) && /* @__PURE__ */ r("p", { className: "text-danger", children: String(d ?? N) })
386
+ !x && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: k || "", ref: r == null ? void 0 : r.field.ref }),
387
+ (s || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String(s ?? v) })
342
388
  ] });
343
389
  }
344
- const jt = z(Pe), Oe = ({
345
- name: e,
346
- label: t = "",
347
- placeholder: n = "",
348
- className: s = "",
349
- rows: i = 4,
350
- maxLength: c,
351
- forceReadOnly: l = !1,
352
- forceHidden: o = !1,
353
- valueManual: b,
354
- onChangeManual: a,
355
- errorManual: N
390
+ const ut = q(Ce), He = ({
391
+ name: t,
392
+ label: l = "",
393
+ placeholder: a = "",
394
+ className: f = "",
395
+ rows: c = 4,
396
+ maxLength: o,
397
+ forceReadOnly: m = !1,
398
+ forceHidden: d = !1,
399
+ valueManual: p,
400
+ onChangeManual: i,
401
+ errorManual: v
356
402
  }) => {
357
- var f;
358
- const h = b !== void 0 && !!a, { isReadOnly: W, isHidden: V } = F(), O = l || !!W(e), S = o || !!V(e), { isView: A } = L(), p = G(null);
359
- let v = {
360
- value: b ?? "",
361
- onChange: (w) => a == null ? void 0 : a(w)
362
- }, u = null;
363
- if (!h)
403
+ var u;
404
+ const x = p !== void 0 && !!i, { isReadOnly: S, isHidden: C } = G(), y = m || !!S(t), R = d || !!C(t), { isView: D } = Y(), _ = X(null);
405
+ let g = {
406
+ value: p ?? "",
407
+ onChange: (k) => i == null ? void 0 : i(k)
408
+ }, r = null;
409
+ if (!x)
364
410
  try {
365
- const { control: w } = H(), D = X({ name: e, control: w });
366
- v = D.field, u = (f = D.fieldState) == null ? void 0 : f.error;
411
+ const { control: k } = U(), I = W({ name: t, control: k });
412
+ g = I.field, r = (u = I.fieldState) == null ? void 0 : u.error;
367
413
  } catch {
368
414
  }
369
- const m = () => {
370
- p.current && (p.current.style.height = "auto", p.current.style.height = `${p.current.scrollHeight}px`);
415
+ const n = () => {
416
+ _.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
371
417
  };
372
- if (E(() => {
373
- m();
374
- }, [v.value]), A)
375
- return /* @__PURE__ */ k("div", { className: `form-group ${S ? "hidden" : ""}`, children: [
376
- /* @__PURE__ */ r("label", { children: t }),
377
- /* @__PURE__ */ r("span", { className: "form-control", children: v.value || "-" })
418
+ if (T(() => {
419
+ n();
420
+ }, [g.value]), D)
421
+ return /* @__PURE__ */ h("div", { className: `form-group ${R ? "hidden" : ""}`, children: [
422
+ /* @__PURE__ */ e("label", { children: l }),
423
+ /* @__PURE__ */ e("span", { className: "form-control", children: g.value || "-" })
378
424
  ] });
379
- const d = `form-control ${O ? "readOnly" : ""} ${u || N ? "border-red" : ""} ${s}`;
380
- return /* @__PURE__ */ k("div", { className: `form-group ${S ? "hidden" : ""}`, children: [
381
- t && /* @__PURE__ */ r("label", { children: t }),
382
- /* @__PURE__ */ r(
425
+ const s = `form-control ${y ? "readOnly" : ""} ${r || v ? "border-red" : ""} ${f}`;
426
+ return /* @__PURE__ */ h("div", { className: `form-group ${R ? "hidden" : ""}`, children: [
427
+ l && /* @__PURE__ */ e("label", { children: l }),
428
+ /* @__PURE__ */ e(
383
429
  "textarea",
384
430
  {
385
- ref: p,
386
- rows: i,
387
- maxLength: c,
388
- value: v.value || "",
389
- placeholder: n,
390
- readOnly: O,
391
- className: d,
431
+ ref: _,
432
+ rows: c,
433
+ maxLength: o,
434
+ value: g.value || "",
435
+ placeholder: a,
436
+ readOnly: y,
437
+ className: s,
392
438
  style: {
393
439
  resize: "none",
394
440
  maxHeight: "400px",
395
441
  overflowY: "auto"
396
442
  },
397
- onChange: (w) => {
398
- h ? a == null || a(w.target.value) : v.onChange(w);
443
+ onChange: (k) => {
444
+ x ? i == null || i(k.target.value) : g.onChange(k);
399
445
  },
400
- onInput: m
446
+ onInput: n
401
447
  }
402
448
  ),
403
- (u || N) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? N) })
449
+ (r || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((r == null ? void 0 : r.message) ?? v) })
404
450
  ] });
405
- }, Ct = z(Oe);
406
- function J(e) {
407
- return (t = {}) => {
408
- const n = t.width ? String(t.width) : e.defaultWidth;
409
- return e.formats[n] || e.formats[e.defaultWidth];
410
- };
411
- }
412
- function Q(e) {
413
- return (t, n) => {
414
- const s = n != null && n.context ? String(n.context) : "standalone";
415
- let i;
416
- if (s === "formatting" && e.formattingValues) {
417
- const l = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : l;
418
- i = e.formattingValues[o] || e.formattingValues[l];
419
- } else {
420
- const l = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
421
- i = e.values[o] || e.values[l];
422
- }
423
- const c = e.argumentCallback ? e.argumentCallback(t) : t;
424
- return i[c];
425
- };
426
- }
427
- function Y(e) {
428
- return (t, n = {}) => {
429
- const s = n.width, i = s && e.matchPatterns[s] || e.matchPatterns[e.defaultMatchWidth], c = t.match(i);
430
- if (!c)
431
- return null;
432
- const l = c[0], o = s && e.parsePatterns[s] || e.parsePatterns[e.defaultParseWidth], b = Array.isArray(o) ? $e(o, (h) => h.test(l)) : (
433
- // [TODO] -- I challenge you to fix the type
434
- _e(o, (h) => h.test(l))
435
- );
436
- let a;
437
- a = e.valueCallback ? e.valueCallback(b) : b, a = n.valueCallback ? (
438
- // [TODO] -- I challenge you to fix the type
439
- n.valueCallback(a)
440
- ) : a;
441
- const N = t.slice(l.length);
442
- return { value: a, rest: N };
443
- };
444
- }
445
- function _e(e, t) {
446
- for (const n in e)
447
- if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
448
- return n;
449
- }
450
- function $e(e, t) {
451
- for (let n = 0; n < e.length; n++)
452
- if (t(e[n]))
453
- return n;
454
- }
455
- function Ae(e) {
456
- return (t, n = {}) => {
457
- const s = t.match(e.matchPattern);
458
- if (!s) return null;
459
- const i = s[0], c = t.match(e.parsePattern);
460
- if (!c) return null;
461
- let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
462
- l = n.valueCallback ? n.valueCallback(l) : l;
463
- const o = t.slice(i.length);
464
- return { value: l, rest: o };
465
- };
466
- }
467
- const We = {
468
- lessThanXSeconds: {
469
- one: "menos de um segundo",
470
- other: "menos de {{count}} segundos"
471
- },
472
- xSeconds: {
473
- one: "1 segundo",
474
- other: "{{count}} segundos"
475
- },
476
- halfAMinute: "meio minuto",
477
- lessThanXMinutes: {
478
- one: "menos de um minuto",
479
- other: "menos de {{count}} minutos"
480
- },
481
- xMinutes: {
482
- one: "1 minuto",
483
- other: "{{count}} minutos"
484
- },
485
- aboutXHours: {
486
- one: "cerca de 1 hora",
487
- other: "cerca de {{count}} horas"
488
- },
489
- xHours: {
490
- one: "1 hora",
491
- other: "{{count}} horas"
492
- },
493
- xDays: {
494
- one: "1 dia",
495
- other: "{{count}} dias"
496
- },
497
- aboutXWeeks: {
498
- one: "cerca de 1 semana",
499
- other: "cerca de {{count}} semanas"
500
- },
501
- xWeeks: {
502
- one: "1 semana",
503
- other: "{{count}} semanas"
504
- },
505
- aboutXMonths: {
506
- one: "cerca de 1 mês",
507
- other: "cerca de {{count}} meses"
508
- },
509
- xMonths: {
510
- one: "1 mês",
511
- other: "{{count}} meses"
512
- },
513
- aboutXYears: {
514
- one: "cerca de 1 ano",
515
- other: "cerca de {{count}} anos"
516
- },
517
- xYears: {
518
- one: "1 ano",
519
- other: "{{count}} anos"
520
- },
521
- overXYears: {
522
- one: "mais de 1 ano",
523
- other: "mais de {{count}} anos"
524
- },
525
- almostXYears: {
526
- one: "quase 1 ano",
527
- other: "quase {{count}} anos"
528
- }
529
- }, Ve = (e, t, n) => {
530
- let s;
531
- const i = We[e];
532
- return typeof i == "string" ? s = i : t === 1 ? s = i.one : s = i.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "em " + s : "há " + s : s;
533
- }, De = {
534
- full: "EEEE, d 'de' MMMM 'de' y",
535
- long: "d 'de' MMMM 'de' y",
536
- medium: "d MMM y",
537
- short: "dd/MM/yyyy"
538
- }, Te = {
539
- full: "HH:mm:ss zzzz",
540
- long: "HH:mm:ss z",
541
- medium: "HH:mm:ss",
542
- short: "HH:mm"
543
- }, je = {
544
- full: "{{date}} 'às' {{time}}",
545
- long: "{{date}} 'às' {{time}}",
546
- medium: "{{date}}, {{time}}",
547
- short: "{{date}}, {{time}}"
548
- }, Ce = {
549
- date: J({
550
- formats: De,
551
- defaultWidth: "full"
552
- }),
553
- time: J({
554
- formats: Te,
555
- defaultWidth: "full"
556
- }),
557
- dateTime: J({
558
- formats: je,
559
- defaultWidth: "full"
560
- })
561
- }, Ee = {
562
- lastWeek: (e) => {
563
- const t = e.getDay();
564
- return "'" + (t === 0 || t === 6 ? "último" : "última") + "' eeee 'às' p";
565
- },
566
- yesterday: "'ontem às' p",
567
- today: "'hoje às' p",
568
- tomorrow: "'amanhã às' p",
569
- nextWeek: "eeee 'às' p",
570
- other: "P"
571
- }, He = (e, t, n, s) => {
572
- const i = Ee[e];
573
- return typeof i == "function" ? i(t) : i;
574
- }, Le = {
575
- narrow: ["AC", "DC"],
576
- abbreviated: ["AC", "DC"],
577
- wide: ["antes de cristo", "depois de cristo"]
578
- }, Ie = {
579
- narrow: ["1", "2", "3", "4"],
580
- abbreviated: ["T1", "T2", "T3", "T4"],
581
- wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
582
- }, Fe = {
583
- narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
584
- abbreviated: [
585
- "jan",
586
- "fev",
587
- "mar",
588
- "abr",
589
- "mai",
590
- "jun",
591
- "jul",
592
- "ago",
593
- "set",
594
- "out",
595
- "nov",
596
- "dez"
597
- ],
598
- wide: [
599
- "janeiro",
600
- "fevereiro",
601
- "março",
602
- "abril",
603
- "maio",
604
- "junho",
605
- "julho",
606
- "agosto",
607
- "setembro",
608
- "outubro",
609
- "novembro",
610
- "dezembro"
611
- ]
612
- }, qe = {
613
- narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
614
- short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
615
- abbreviated: [
616
- "domingo",
617
- "segunda",
618
- "terça",
619
- "quarta",
620
- "quinta",
621
- "sexta",
622
- "sábado"
623
- ],
624
- wide: [
625
- "domingo",
626
- "segunda-feira",
627
- "terça-feira",
628
- "quarta-feira",
629
- "quinta-feira",
630
- "sexta-feira",
631
- "sábado"
632
- ]
633
- }, Be = {
634
- narrow: {
635
- am: "a",
636
- pm: "p",
637
- midnight: "mn",
638
- noon: "md",
639
- morning: "manhã",
640
- afternoon: "tarde",
641
- evening: "tarde",
642
- night: "noite"
643
- },
644
- abbreviated: {
645
- am: "AM",
646
- pm: "PM",
647
- midnight: "meia-noite",
648
- noon: "meio-dia",
649
- morning: "manhã",
650
- afternoon: "tarde",
651
- evening: "tarde",
652
- night: "noite"
653
- },
654
- wide: {
655
- am: "a.m.",
656
- pm: "p.m.",
657
- midnight: "meia-noite",
658
- noon: "meio-dia",
659
- morning: "manhã",
660
- afternoon: "tarde",
661
- evening: "tarde",
662
- night: "noite"
663
- }
664
- }, ze = {
665
- narrow: {
666
- am: "a",
667
- pm: "p",
668
- midnight: "mn",
669
- noon: "md",
670
- morning: "da manhã",
671
- afternoon: "da tarde",
672
- evening: "da tarde",
673
- night: "da noite"
674
- },
675
- abbreviated: {
676
- am: "AM",
677
- pm: "PM",
678
- midnight: "meia-noite",
679
- noon: "meio-dia",
680
- morning: "da manhã",
681
- afternoon: "da tarde",
682
- evening: "da tarde",
683
- night: "da noite"
684
- },
685
- wide: {
686
- am: "a.m.",
687
- pm: "p.m.",
688
- midnight: "meia-noite",
689
- noon: "meio-dia",
690
- morning: "da manhã",
691
- afternoon: "da tarde",
692
- evening: "da tarde",
693
- night: "da noite"
694
- }
695
- }, Xe = (e, t) => {
696
- const n = Number(e);
697
- return (t == null ? void 0 : t.unit) === "week" ? n + "ª" : n + "º";
698
- }, Ue = {
699
- ordinalNumber: Xe,
700
- era: Q({
701
- values: Le,
702
- defaultWidth: "wide"
703
- }),
704
- quarter: Q({
705
- values: Ie,
706
- defaultWidth: "wide",
707
- argumentCallback: (e) => e - 1
708
- }),
709
- month: Q({
710
- values: Fe,
711
- defaultWidth: "wide"
712
- }),
713
- day: Q({
714
- values: qe,
715
- defaultWidth: "wide"
716
- }),
717
- dayPeriod: Q({
718
- values: Be,
719
- defaultWidth: "wide",
720
- formattingValues: ze,
721
- defaultFormattingWidth: "wide"
722
- })
723
- }, Qe = /^(\d+)[ºªo]?/i, Ye = /\d+/i, Ge = {
724
- narrow: /^(ac|dc|a|d)/i,
725
- abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
726
- wide: /^(antes de cristo|depois de cristo)/i
727
- }, Je = {
728
- any: [/^ac/i, /^dc/i],
729
- wide: [/^antes de cristo/i, /^depois de cristo/i]
730
- }, Ze = {
731
- narrow: /^[1234]/i,
732
- abbreviated: /^T[1234]/i,
733
- wide: /^[1234](º)? trimestre/i
734
- }, Ke = {
735
- any: [/1/i, /2/i, /3/i, /4/i]
736
- }, Me = {
737
- narrow: /^[jfmajsond]/i,
738
- abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
739
- wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
740
- }, et = {
741
- narrow: [
742
- /^j/i,
743
- /^f/i,
744
- /^m/i,
745
- /^a/i,
746
- /^m/i,
747
- /^j/i,
748
- /^j/i,
749
- /^a/i,
750
- /^s/i,
751
- /^o/i,
752
- /^n/i,
753
- /^d/i
754
- ],
755
- any: [
756
- /^ja/i,
757
- /^fev/i,
758
- /^mar/i,
759
- /^abr/i,
760
- /^mai/i,
761
- /^jun/i,
762
- /^jul/i,
763
- /^ago/i,
764
- /^set/i,
765
- /^out/i,
766
- /^nov/i,
767
- /^dez/i
768
- ]
769
- }, tt = {
770
- narrow: /^(dom|[23456]ª?|s[aá]b)/i,
771
- short: /^(dom|[23456]ª?|s[aá]b)/i,
772
- abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
773
- wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
774
- }, nt = {
775
- short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
776
- narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
777
- any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
778
- }, rt = {
779
- narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
780
- any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
781
- }, it = {
782
- any: {
783
- am: /^a/i,
784
- pm: /^p/i,
785
- midnight: /^mn|^meia[-\s]noite/i,
786
- noon: /^md|^meio[-\s]dia/i,
787
- morning: /manhã/i,
788
- afternoon: /tarde/i,
789
- evening: /tarde/i,
790
- night: /noite/i
791
- }
792
- }, st = {
793
- ordinalNumber: Ae({
794
- matchPattern: Qe,
795
- parsePattern: Ye,
796
- valueCallback: (e) => parseInt(e, 10)
797
- }),
798
- era: Y({
799
- matchPatterns: Ge,
800
- defaultMatchWidth: "wide",
801
- parsePatterns: Je,
802
- defaultParseWidth: "any"
803
- }),
804
- quarter: Y({
805
- matchPatterns: Ze,
806
- defaultMatchWidth: "wide",
807
- parsePatterns: Ke,
808
- defaultParseWidth: "any",
809
- valueCallback: (e) => e + 1
810
- }),
811
- month: Y({
812
- matchPatterns: Me,
813
- defaultMatchWidth: "wide",
814
- parsePatterns: et,
815
- defaultParseWidth: "any"
816
- }),
817
- day: Y({
818
- matchPatterns: tt,
819
- defaultMatchWidth: "wide",
820
- parsePatterns: nt,
821
- defaultParseWidth: "any"
822
- }),
823
- dayPeriod: Y({
824
- matchPatterns: rt,
825
- defaultMatchWidth: "any",
826
- parsePatterns: it,
827
- defaultParseWidth: "any"
828
- })
829
- }, at = {
830
- code: "pt-BR",
831
- formatDistance: Ve,
832
- formatLong: Ce,
833
- formatRelative: He,
834
- localize: Ue,
835
- match: st,
836
- options: {
837
- weekStartsOn: 0,
838
- firstWeekContainsDate: 1
839
- }
840
- };
451
+ }, ft = q(He);
841
452
  /**
842
453
  * @license lucide-react v0.575.0 - ISC
843
454
  *
844
455
  * This source code is licensed under the ISC license.
845
456
  * See the LICENSE file in the root directory of this source tree.
846
457
  */
847
- const ae = (...e) => e.filter((t, n, s) => !!t && t.trim() !== "" && s.indexOf(t) === n).join(" ").trim();
458
+ const fe = (...t) => t.filter((l, a, f) => !!l && l.trim() !== "" && f.indexOf(l) === a).join(" ").trim();
848
459
  /**
849
460
  * @license lucide-react v0.575.0 - ISC
850
461
  *
851
462
  * This source code is licensed under the ISC license.
852
463
  * See the LICENSE file in the root directory of this source tree.
853
464
  */
854
- const ot = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
465
+ const Le = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
855
466
  /**
856
467
  * @license lucide-react v0.575.0 - ISC
857
468
  *
858
469
  * This source code is licensed under the ISC license.
859
470
  * See the LICENSE file in the root directory of this source tree.
860
471
  */
861
- const dt = (e) => e.replace(
472
+ const Fe = (t) => t.replace(
862
473
  /^([A-Z])|[\s-_]+(\w)/g,
863
- (t, n, s) => s ? s.toUpperCase() : n.toLowerCase()
474
+ (l, a, f) => f ? f.toUpperCase() : a.toLowerCase()
864
475
  );
865
476
  /**
866
477
  * @license lucide-react v0.575.0 - ISC
@@ -868,9 +479,9 @@ const dt = (e) => e.replace(
868
479
  * This source code is licensed under the ISC license.
869
480
  * See the LICENSE file in the root directory of this source tree.
870
481
  */
871
- const re = (e) => {
872
- const t = dt(e);
873
- return t.charAt(0).toUpperCase() + t.slice(1);
482
+ const ne = (t) => {
483
+ const l = Fe(t);
484
+ return l.charAt(0).toUpperCase() + l.slice(1);
874
485
  };
875
486
  /**
876
487
  * @license lucide-react v0.575.0 - ISC
@@ -878,7 +489,7 @@ const re = (e) => {
878
489
  * This source code is licensed under the ISC license.
879
490
  * See the LICENSE file in the root directory of this source tree.
880
491
  */
881
- var ct = {
492
+ var Te = {
882
493
  xmlns: "http://www.w3.org/2000/svg",
883
494
  width: 24,
884
495
  height: 24,
@@ -895,9 +506,9 @@ var ct = {
895
506
  * This source code is licensed under the ISC license.
896
507
  * See the LICENSE file in the root directory of this source tree.
897
508
  */
898
- const lt = (e) => {
899
- for (const t in e)
900
- if (t.startsWith("aria-") || t === "role" || t === "title")
509
+ const je = (t) => {
510
+ for (const l in t)
511
+ if (l.startsWith("aria-") || l === "role" || l === "title")
901
512
  return !0;
902
513
  return !1;
903
514
  };
@@ -907,32 +518,32 @@ const lt = (e) => {
907
518
  * This source code is licensed under the ISC license.
908
519
  * See the LICENSE file in the root directory of this source tree.
909
520
  */
910
- const ut = ie(
521
+ const Pe = de(
911
522
  ({
912
- color: e = "currentColor",
913
- size: t = 24,
914
- strokeWidth: n = 2,
915
- absoluteStrokeWidth: s,
916
- className: i = "",
917
- children: c,
918
- iconNode: l,
919
- ...o
920
- }, b) => Z(
523
+ color: t = "currentColor",
524
+ size: l = 24,
525
+ strokeWidth: a = 2,
526
+ absoluteStrokeWidth: f,
527
+ className: c = "",
528
+ children: o,
529
+ iconNode: m,
530
+ ...d
531
+ }, p) => K(
921
532
  "svg",
922
533
  {
923
- ref: b,
924
- ...ct,
925
- width: t,
926
- height: t,
927
- stroke: e,
928
- strokeWidth: s ? Number(n) * 24 / Number(t) : n,
929
- className: ae("lucide", i),
930
- ...!c && !lt(o) && { "aria-hidden": "true" },
931
- ...o
534
+ ref: p,
535
+ ...Te,
536
+ width: l,
537
+ height: l,
538
+ stroke: t,
539
+ strokeWidth: f ? Number(a) * 24 / Number(l) : a,
540
+ className: fe("lucide", c),
541
+ ...!o && !je(d) && { "aria-hidden": "true" },
542
+ ...d
932
543
  },
933
544
  [
934
- ...l.map(([a, N]) => Z(a, N)),
935
- ...Array.isArray(c) ? c : [c]
545
+ ...m.map(([i, v]) => K(i, v)),
546
+ ...Array.isArray(o) ? o : [o]
936
547
  ]
937
548
  )
938
549
  );
@@ -942,20 +553,20 @@ const ut = ie(
942
553
  * This source code is licensed under the ISC license.
943
554
  * See the LICENSE file in the root directory of this source tree.
944
555
  */
945
- const M = (e, t) => {
946
- const n = ie(
947
- ({ className: s, ...i }, c) => Z(ut, {
948
- ref: c,
949
- iconNode: t,
950
- className: ae(
951
- `lucide-${ot(re(e))}`,
952
- `lucide-${e}`,
953
- s
556
+ const M = (t, l) => {
557
+ const a = de(
558
+ ({ className: f, ...c }, o) => K(Pe, {
559
+ ref: o,
560
+ iconNode: l,
561
+ className: fe(
562
+ `lucide-${Le(ne(t))}`,
563
+ `lucide-${t}`,
564
+ f
954
565
  ),
955
- ...i
566
+ ...c
956
567
  })
957
568
  );
958
- return n.displayName = re(e), n;
569
+ return a.displayName = ne(t), a;
959
570
  };
960
571
  /**
961
572
  * @license lucide-react v0.575.0 - ISC
@@ -963,532 +574,513 @@ const M = (e, t) => {
963
574
  * This source code is licensed under the ISC license.
964
575
  * See the LICENSE file in the root directory of this source tree.
965
576
  */
966
- const mt = [
577
+ const Ue = [
967
578
  ["path", { d: "M8 2v4", key: "1cmpym" }],
968
579
  ["path", { d: "M16 2v4", key: "4m81vk" }],
969
580
  ["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
970
581
  ["path", { d: "M3 10h18", key: "8toen8" }]
971
- ], ft = M("calendar", mt);
582
+ ], Ye = M("calendar", Ue);
972
583
  /**
973
584
  * @license lucide-react v0.575.0 - ISC
974
585
  *
975
586
  * This source code is licensed under the ISC license.
976
587
  * See the LICENSE file in the root directory of this source tree.
977
588
  */
978
- const ht = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], pt = M("chevron-left", ht);
589
+ const Je = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ze = M("chevron-left", Je);
979
590
  /**
980
591
  * @license lucide-react v0.575.0 - ISC
981
592
  *
982
593
  * This source code is licensed under the ISC license.
983
594
  * See the LICENSE file in the root directory of this source tree.
984
595
  */
985
- const yt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], vt = M("chevron-right", yt);
986
- function gt(e) {
987
- const t = G(null);
988
- return E(() => {
989
- function n(s) {
990
- t.current && !t.current.contains(s.target) && e();
596
+ const qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ge = M("chevron-right", qe), me = "dd/MM/yyyy", le = (t) => {
597
+ if (!t) return null;
598
+ const l = Ae(t, me, /* @__PURE__ */ new Date());
599
+ return ae(l) ? l : null;
600
+ }, We = (t) => t ? ue(t, me) : "", Qe = [
601
+ { value: 0, label: "Janeiro" },
602
+ { value: 1, label: "Fevereiro" },
603
+ { value: 2, label: "Março" },
604
+ { value: 3, label: "Abril" },
605
+ { value: 4, label: "Maio" },
606
+ { value: 5, label: "Junho" },
607
+ { value: 6, label: "Julho" },
608
+ { value: 7, label: "Agosto" },
609
+ { value: 8, label: "Setembro" },
610
+ { value: 9, label: "Outubro" },
611
+ { value: 10, label: "Novembro" },
612
+ { value: 11, label: "Dezembro" }
613
+ ], ie = 1940, Ze = 2100, Xe = Array.from({ length: Ze - ie + 1 }, (t, l) => {
614
+ const a = ie + l;
615
+ return { value: a, label: String(a) };
616
+ });
617
+ function Ke({
618
+ name: t,
619
+ label: l = "",
620
+ placeholder: a = "dd/mm/aaaa",
621
+ className: f = "",
622
+ forceReadOnly: c = !1,
623
+ forceHidden: o = !1,
624
+ valueManual: m,
625
+ onChangeManual: d,
626
+ errorManual: p
627
+ }) {
628
+ var A;
629
+ const i = m !== void 0 && !!d, { isReadOnly: v, isHidden: x } = G(), S = c || !!v(t), C = o || !!x(t), { isView: y } = Y();
630
+ let R = "", D = () => {
631
+ }, _, g = null, r = () => {
632
+ };
633
+ if (i)
634
+ R = m;
635
+ else
636
+ try {
637
+ const b = U(), E = W({ name: t, control: b.control });
638
+ R = E.field.value, D = E.field.onChange, _ = E.field.ref, g = (A = E.fieldState) == null ? void 0 : A.error, r = b.clearErrors;
639
+ } catch {
640
+ }
641
+ const [n, s] = P(!1), [u, k] = P(/* @__PURE__ */ new Date()), I = X(null);
642
+ T(() => {
643
+ if (n) {
644
+ const b = le(R);
645
+ k(b && ae(b) ? b : /* @__PURE__ */ new Date());
991
646
  }
992
- return document.addEventListener("mousedown", n), () => {
993
- document.removeEventListener("mousedown", n);
647
+ }, [n, R]), T(() => {
648
+ const b = (E) => {
649
+ I.current && !I.current.contains(E.target) && s(!1);
994
650
  };
995
- }, [e]), t;
996
- }
997
- const oe = "dd/MM/yyyy", bt = (e) => {
998
- if (!e) return null;
999
- const t = ue(e, oe, /* @__PURE__ */ new Date());
1000
- return me(t) ? t : null;
1001
- }, wt = (e) => e ? K(e, oe) : "", Nt = ({
1002
- name: e,
1003
- label: t = "",
1004
- placeholder: n = "dd/mm/aaaa",
1005
- className: s = "",
1006
- forceReadOnly: i = !1,
1007
- forceHidden: c = !1,
1008
- valueManual: l,
1009
- onChangeManual: o,
1010
- errorManual: b
1011
- }) => {
1012
- var y;
1013
- const [a, N] = I(!1), [h, W] = I(/* @__PURE__ */ new Date()), V = gt(() => N(!1)), O = l !== void 0 && !!o;
1014
- let S = null;
1015
- try {
1016
- S = H();
1017
- } catch {
1018
- }
1019
- const { isView: A } = L(), { isReadOnly: p, isHidden: v } = F(), u = i || !!p(e), m = c || !!v(e), d = !O && S ? X({ name: e, control: S.control }) : null, f = O ? l : d == null ? void 0 : d.field.value, w = O ? b : (y = d == null ? void 0 : d.fieldState.error) == null ? void 0 : y.message, D = B(() => bt(f), [f]), $ = (x) => {
1020
- if (u) return;
1021
- const P = wt(x);
1022
- O ? o == null || o(P) : d == null || d.field.onChange(P), N(!1);
1023
- }, _ = (x) => {
1024
- const P = fe({
1025
- start: ye(ve(x)),
1026
- end: he(pe(x))
1027
- });
1028
- return /* @__PURE__ */ k("div", { className: "dfe-calendar-pane", children: [
1029
- /* @__PURE__ */ k("div", { className: "dfe-calendar-header", children: [
1030
- /* @__PURE__ */ r(
1031
- "button",
1032
- {
1033
- type: "button",
1034
- onClick: (g) => {
1035
- g.stopPropagation(), W(ge(h, 1));
1036
- },
1037
- className: "dfe-nav-btn",
1038
- children: /* @__PURE__ */ r(pt, { size: 16 })
1039
- }
1040
- ),
1041
- /* @__PURE__ */ r("span", { className: "dfe-month-label", children: K(x, "MMMM yyyy", { locale: at }) }),
1042
- /* @__PURE__ */ r(
1043
- "button",
1044
- {
1045
- type: "button",
1046
- onClick: (g) => {
1047
- g.stopPropagation(), W(be(h, 1));
1048
- },
1049
- className: "dfe-nav-btn",
1050
- children: /* @__PURE__ */ r(vt, { size: 16 })
1051
- }
1052
- )
1053
- ] }),
1054
- /* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((g, j) => /* @__PURE__ */ r("span", { children: g }, j)) }),
1055
- /* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children: P.map((g, j) => {
1056
- const q = !we(g, x), U = D && Ne(g, D);
1057
- return /* @__PURE__ */ r(
651
+ return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
652
+ }, []);
653
+ const B = z(() => le(R), [R]), V = (b) => {
654
+ if (S) return;
655
+ const E = We(b);
656
+ i ? d == null || d(E) : (D(E), r == null || r(t)), s(!1);
657
+ }, O = z(() => ve({
658
+ start: ge(Ne(u)),
659
+ end: ye(be(u))
660
+ }), [u]), w = u.getMonth(), N = ke(u);
661
+ return /* @__PURE__ */ h("div", { className: `dfe-datepicker-wrapper form-group ${C ? "hidden" : ""} ${f}`, ref: I, children: [
662
+ /* @__PURE__ */ e("label", { className: "control-label", children: l }),
663
+ y ? /* @__PURE__ */ e("span", { className: "form-control", children: R || "-" }) : (
664
+ /* Container isolador de contexto posicional */
665
+ /* @__PURE__ */ h("div", { className: "dfe-datepicker-inner-container", children: [
666
+ /* @__PURE__ */ h(
1058
667
  "div",
1059
668
  {
1060
- onClick: () => !q && $(g),
1061
- className: `dfe-calendar-day
1062
- ${U ? "selected" : ""}
1063
- ${q ? "outside" : ""}
1064
- ${ke(g) ? "today" : ""}`,
1065
- children: K(g, "d")
1066
- },
1067
- j
1068
- );
1069
- }) })
1070
- ] });
1071
- };
1072
- return m ? null : A ? /* @__PURE__ */ k("div", { className: `form-group ${s}`, children: [
1073
- t && /* @__PURE__ */ r("label", { children: t }),
1074
- /* @__PURE__ */ r("span", { className: "form-control readOnly", style: { display: "block", height: "auto" }, children: f || "-" })
1075
- ] }) : /* @__PURE__ */ k(
1076
- "div",
1077
- {
1078
- ref: V,
1079
- className: `form-group dfe-datepicker-container ${s}`,
1080
- style: { position: "relative" },
1081
- children: [
1082
- t && /* @__PURE__ */ r("label", { children: t }),
1083
- /* @__PURE__ */ k(
1084
- "div",
1085
- {
1086
- className: `form-control dfe-datepicker-trigger ${w ? "border-red" : ""} ${u ? "disabled" : ""}`,
1087
- onClick: () => !u && N(!a),
1088
- style: {
1089
- display: "flex",
1090
- alignItems: "center",
1091
- cursor: u ? "default" : "pointer"
1092
- },
669
+ className: `dfe-datepicker-control ${g ? "border-red" : ""} ${S ? "readOnly" : ""}`,
670
+ onClick: () => !S && s((b) => !b),
671
+ ref: _,
1093
672
  children: [
1094
- /* @__PURE__ */ r(ft, { size: 16, className: "dfe-calendar-icon", style: { marginRight: "8px", opacity: 0.5 } }),
1095
- /* @__PURE__ */ r("span", { children: f || n })
673
+ /* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${S ? "readOnly" : ""}`, children: R || a }),
674
+ /* @__PURE__ */ e(Ye, { size: 16, className: "dfe-datepicker-icon" })
1096
675
  ]
1097
676
  }
1098
677
  ),
1099
- a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children: _(h) }) }),
1100
- w && /* @__PURE__ */ r("p", { className: "text-danger", children: String(w) })
1101
- ]
1102
- }
1103
- );
1104
- }, Et = z(Nt);
1105
- function kt({
1106
- mapping: e = {},
1107
- defaultLabel: t = "Não reconhecido",
1108
- className: n = "",
1109
- hidden: s = !1,
1110
- label: i
678
+ n && !S && /* @__PURE__ */ h("div", { className: "dfe-datepicker-dropdown", onClick: (b) => b.stopPropagation(), children: [
679
+ /* @__PURE__ */ h("div", { className: "dfe-datepicker-header", children: [
680
+ /* @__PURE__ */ e(
681
+ "button",
682
+ {
683
+ type: "button",
684
+ onClick: () => k(we(u, 1)),
685
+ className: "dfe-datepicker-nav-btn",
686
+ children: /* @__PURE__ */ e(ze, { size: 16 })
687
+ }
688
+ ),
689
+ /* @__PURE__ */ h("div", { className: "dfe-datepicker-selectors", children: [
690
+ /* @__PURE__ */ e(
691
+ re,
692
+ {
693
+ name: "datepicker_internal_month",
694
+ valueManual: w,
695
+ onChangeManual: (b) => k(_e(u, Number(b))),
696
+ options: Qe,
697
+ placeholder: "Mês"
698
+ }
699
+ ),
700
+ /* @__PURE__ */ e(
701
+ re,
702
+ {
703
+ name: "datepicker_internal_year",
704
+ valueManual: N,
705
+ onChangeManual: (b) => k(Oe(u, Number(b))),
706
+ options: Xe,
707
+ enableSearch: !0,
708
+ searchPlaceholder: "Buscar ano...",
709
+ placeholder: "Ano"
710
+ }
711
+ )
712
+ ] }),
713
+ /* @__PURE__ */ e(
714
+ "button",
715
+ {
716
+ type: "button",
717
+ onClick: () => k(Se(u, 1)),
718
+ className: "dfe-datepicker-nav-btn",
719
+ children: /* @__PURE__ */ e(Ge, { size: 16 })
720
+ }
721
+ )
722
+ ] }),
723
+ /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b, E) => /* @__PURE__ */ e("span", { children: b }, E)) }),
724
+ /* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children: O.map((b, E) => {
725
+ const L = !Re(b, u), H = B && $e(b, B);
726
+ return /* @__PURE__ */ e(
727
+ "div",
728
+ {
729
+ onClick: () => !L && V(b),
730
+ className: `dfe-datepicker-day
731
+ ${H ? "selected" : "handleHover"}
732
+ ${L ? "outside" : ""}
733
+ ${xe(b) ? "today" : ""}`,
734
+ children: ue(b, "d")
735
+ },
736
+ E
737
+ );
738
+ }) })
739
+ ] })
740
+ ] })
741
+ ),
742
+ !i && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: R || "" }),
743
+ (g || p) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((g == null ? void 0 : g.message) ?? p) })
744
+ ] });
745
+ }
746
+ const mt = q(Ke);
747
+ function Me({
748
+ mapping: t = {},
749
+ defaultLabel: l = "Não reconhecido",
750
+ className: a = "",
751
+ hidden: f = !1,
752
+ label: c
1111
753
  }) {
1112
- const { activityId: c } = L(), l = B(() => !e || c === null || c === void 0 ? null : e[c], [c, e]);
1113
- if (!l)
1114
- return /* @__PURE__ */ k("div", { className: `form-group ${s ? "hidden" : ""}`, children: [
1115
- i && /* @__PURE__ */ r("label", { children: i }),
1116
- /* @__PURE__ */ r("div", { className: `status-badge default ${n}`, children: t })
754
+ const { activityId: o } = Y(), m = z(() => !t || o === null || o === void 0 ? null : t[o], [o, t]);
755
+ if (!m)
756
+ return /* @__PURE__ */ h("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
757
+ c && /* @__PURE__ */ e("label", { children: c }),
758
+ /* @__PURE__ */ e("div", { className: `status-badge default ${a}`, children: l })
1117
759
  ] });
1118
- const o = {
1119
- "--customColor": l.color
760
+ const d = {
761
+ "--customColor": m.color
1120
762
  };
1121
- return /* @__PURE__ */ k("div", { className: `form-group ${s ? "hidden" : ""}`, children: [
1122
- i && /* @__PURE__ */ r("label", { children: i }),
1123
- /* @__PURE__ */ k("div", { className: `status-badge ${n}`, style: o, children: [
1124
- l.icon && /* @__PURE__ */ r("i", { className: l.icon }),
1125
- /* @__PURE__ */ r("span", { children: l.label })
763
+ return /* @__PURE__ */ h("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
764
+ c && /* @__PURE__ */ e("label", { children: c }),
765
+ /* @__PURE__ */ h("div", { className: `status-badge ${a}`, style: d, children: [
766
+ m.icon && /* @__PURE__ */ e("i", { className: m.icon }),
767
+ /* @__PURE__ */ e("span", { children: m.label })
1126
768
  ] })
1127
769
  ] });
1128
770
  }
1129
- const Ht = z(kt);
1130
- function xt({
1131
- name: e,
1132
- control: t,
1133
- defaultRowValue: n,
1134
- isView: s,
1135
- isReadOnly: i,
1136
- filters: c = []
771
+ const ht = q(Me);
772
+ function et({
773
+ name: t,
774
+ control: l,
775
+ defaultRowValue: a,
776
+ isView: f,
777
+ isReadOnly: c,
778
+ filters: o = []
1137
779
  }) {
1138
- const { field: l } = X({ name: e, control: t }), [o, b] = I([]), [a, N] = I([]), h = () => Date.now() + Math.random(), W = (m) => {
780
+ const { field: m } = W({ name: t, control: l }), [d, p] = P([]), [i, v] = P([]), x = () => Date.now() + Math.random(), S = (n) => {
1139
781
  try {
1140
- const d = JSON.parse(m);
1141
- return Array.isArray(d) ? d.map((f) => ({
1142
- ...f,
1143
- _uid: f._uid || h()
782
+ const s = JSON.parse(n);
783
+ return Array.isArray(s) ? s.map((u) => ({
784
+ ...u,
785
+ _uid: u._uid || x()
1144
786
  })) : [];
1145
- } catch (d) {
1146
- return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
787
+ } catch (s) {
788
+ return console.error(`Erro ao ler dados da tabela "${t}":`, s), [];
1147
789
  }
1148
790
  };
1149
- E(() => {
1150
- if (!(o.length > 0 && !s) && l.value && typeof l.value == "string") {
1151
- const m = JSON.stringify(o);
1152
- if (l.value === m) return;
1153
- const d = W(l.value);
1154
- b(d);
791
+ T(() => {
792
+ if (!(d.length > 0 && !f) && m.value && typeof m.value == "string") {
793
+ const n = JSON.stringify(d);
794
+ if (m.value === n) return;
795
+ const s = S(m.value);
796
+ p(s);
1155
797
  }
1156
- }, [l.value, s]), E(() => {
1157
- if (i) return;
1158
- const m = JSON.stringify(o);
1159
- l.value !== m && l.onChange(m);
1160
- }, [o, l, i]);
1161
- const V = C(() => {
1162
- const m = { _uid: h(), ...n };
1163
- b((d) => [...d, m]);
1164
- }, [n]), O = C(() => {
1165
- b((m) => m.filter((d) => !a.includes(d._uid))), N([]);
1166
- }, [a]), S = C((m, d, f) => {
1167
- b((w) => w.map((D) => D._uid === m ? { ...D, [d]: f } : D));
1168
- }, []), A = C((m) => {
1169
- N((d) => d.includes(m) ? d.filter((f) => f !== m) : [...d, m]);
1170
- }, []), p = C(
1171
- (m) => {
1172
- N(m ? o.map((d) => d._uid) : []);
798
+ }, [m.value, f]), T(() => {
799
+ if (c) return;
800
+ const n = JSON.stringify(d);
801
+ m.value !== n && m.onChange(n);
802
+ }, [d, m, c]);
803
+ const C = j(() => {
804
+ const n = { _uid: x(), ...a };
805
+ p((s) => [...s, n]);
806
+ }, [a]), y = j(() => {
807
+ p((n) => n.filter((s) => !i.includes(s._uid))), v([]);
808
+ }, [i]), R = j((n, s, u) => {
809
+ p((k) => k.map((I) => I._uid === n ? { ...I, [s]: u } : I));
810
+ }, []), D = j((n) => {
811
+ v((s) => s.includes(n) ? s.filter((u) => u !== n) : [...s, n]);
812
+ }, []), _ = j(
813
+ (n) => {
814
+ v(n ? d.map((s) => s._uid) : []);
1173
815
  },
1174
- [o]
1175
- ), v = o.length > 0 && a.length === o.length, u = B(() => !c || c.length === 0 ? o : o.filter(
1176
- (m) => c.every((d) => {
1177
- if ("custom" in d)
1178
- return d.custom(m);
1179
- const f = m[d.field];
1180
- switch (d.operator) {
816
+ [d]
817
+ ), g = d.length > 0 && i.length === d.length, r = z(() => !o || o.length === 0 ? d : d.filter(
818
+ (n) => o.every((s) => {
819
+ if ("custom" in s)
820
+ return s.custom(n);
821
+ const u = n[s.field];
822
+ switch (s.operator) {
1181
823
  case "===":
1182
- return f === d.value;
824
+ return u === s.value;
1183
825
  case "!==":
1184
- return f !== d.value;
826
+ return u !== s.value;
1185
827
  case ">":
1186
- return f > d.value;
828
+ return u > s.value;
1187
829
  case "<":
1188
- return f < d.value;
830
+ return u < s.value;
1189
831
  case ">=":
1190
- return f >= d.value;
832
+ return u >= s.value;
1191
833
  case "<=":
1192
- return f <= d.value;
834
+ return u <= s.value;
1193
835
  default:
1194
836
  return !0;
1195
837
  }
1196
838
  })
1197
- ), [o, c]);
839
+ ), [d, o]);
1198
840
  return {
1199
- field: l,
1200
- tableRows: o,
1201
- visibleRows: u,
1202
- selectedRowIds: a,
1203
- isAllSelected: v,
841
+ field: m,
842
+ tableRows: d,
843
+ visibleRows: r,
844
+ selectedRowIds: i,
845
+ isAllSelected: g,
1204
846
  handle: {
1205
- addRow: V,
1206
- removeRows: O,
1207
- updateCellValue: S,
1208
- toggleSelection: A,
1209
- toggleSelectAll: p
847
+ addRow: C,
848
+ removeRows: y,
849
+ updateCellValue: R,
850
+ toggleSelection: D,
851
+ toggleSelectAll: _
1210
852
  }
1211
853
  };
1212
854
  }
1213
- const Lt = ({
1214
- name: e,
1215
- title: t = "Tabela Dinâmica",
1216
- columns: n,
1217
- defaultRowValue: s = {},
1218
- forceReadOnly: i = !1,
1219
- layout: c = "fluid",
1220
- actions: l = !0,
1221
- filters: o = []
855
+ const pt = ({
856
+ name: t,
857
+ title: l = "Tabela Dinâmica",
858
+ columns: a,
859
+ defaultRowValue: f = {},
860
+ forceReadOnly: c = !1,
861
+ layout: o = "fluid",
862
+ actions: m = !0,
863
+ filters: d = []
1222
864
  }) => {
1223
- const { control: b } = H(), { isView: a, isReadOnly: N } = L(), { isReadOnly: h } = F(), W = i || a || N || h && h(e), { field: V, visibleRows: O, selectedRowIds: S, isAllSelected: A, handle: p } = xt({
1224
- name: e,
1225
- control: b,
1226
- defaultRowValue: s,
1227
- isView: a,
1228
- isReadOnly: !!W,
1229
- filters: o
1230
- }), v = c === "fixed";
1231
- return /* @__PURE__ */ k("div", { className: `table-wrapper ${v ? "table-fixed" : "table-fluid"}`, children: [
1232
- /* @__PURE__ */ r("input", { type: "hidden", ...V }),
1233
- /* @__PURE__ */ k("div", { className: "header-handle", children: [
1234
- /* @__PURE__ */ r("h3", { children: t }),
1235
- !W && l && /* @__PURE__ */ k("div", { className: "handle-actions", children: [
1236
- /* @__PURE__ */ k(
865
+ const { control: p } = U(), { isView: i, isReadOnly: v } = Y(), { isReadOnly: x } = G(), S = c || i || v || x && x(t), { field: C, visibleRows: y, selectedRowIds: R, isAllSelected: D, handle: _ } = et({
866
+ name: t,
867
+ control: p,
868
+ defaultRowValue: f,
869
+ isView: i,
870
+ isReadOnly: !!S,
871
+ filters: d
872
+ }), g = o === "fixed";
873
+ return /* @__PURE__ */ h("div", { className: `table-wrapper ${g ? "table-fixed" : "table-fluid"}`, children: [
874
+ /* @__PURE__ */ e("input", { type: "hidden", ...C }),
875
+ /* @__PURE__ */ h("div", { className: "header-handle", children: [
876
+ /* @__PURE__ */ e("h3", { children: l }),
877
+ !S && m && /* @__PURE__ */ h("div", { className: "handle-actions", children: [
878
+ /* @__PURE__ */ h(
1237
879
  "button",
1238
880
  {
1239
881
  type: "button",
1240
- className: `btn ${S.length > 0 ? "btn-danger" : "btn-primary"}`,
1241
- disabled: S.length === 0,
1242
- onClick: p.removeRows,
882
+ className: `btn ${R.length > 0 ? "btn-danger" : "btn-primary"}`,
883
+ disabled: R.length === 0,
884
+ onClick: _.removeRows,
1243
885
  children: [
1244
886
  "Remover (",
1245
- S.length,
887
+ R.length,
1246
888
  ")"
1247
889
  ]
1248
890
  }
1249
891
  ),
1250
- /* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick: p.addRow, children: "Adicionar" })
892
+ /* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: _.addRow, children: "Adicionar" })
1251
893
  ] })
1252
894
  ] }),
1253
- /* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */ k("table", { className: "table-custom", children: [
1254
- /* @__PURE__ */ r("thead", { children: /* @__PURE__ */ k("tr", { children: [
1255
- !W && /* @__PURE__ */ r("th", { style: { width: "50px" }, children: /* @__PURE__ */ r(
895
+ /* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */ h("table", { className: "table-custom", children: [
896
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ h("tr", { children: [
897
+ !S && /* @__PURE__ */ e("th", { style: { width: "50px" }, children: /* @__PURE__ */ e(
1256
898
  "input",
1257
899
  {
1258
900
  type: "checkbox",
1259
- checked: A,
1260
- onChange: (u) => p.toggleSelectAll(u.target.checked)
901
+ checked: D,
902
+ onChange: (r) => _.toggleSelectAll(r.target.checked)
1261
903
  }
1262
904
  ) }),
1263
- n.map((u) => /* @__PURE__ */ r(
905
+ a.map((r) => /* @__PURE__ */ e(
1264
906
  "th",
1265
907
  {
1266
- style: u.width ? { minWidth: v ? u.width : "100%" } : { width: "max-content" },
1267
- children: u.label
908
+ style: r.width ? { minWidth: g ? r.width : "100%" } : { width: "max-content" },
909
+ children: r.label
1268
910
  },
1269
- String(u.key)
911
+ String(r.key)
1270
912
  ))
1271
913
  ] }) }),
1272
- /* @__PURE__ */ k("tbody", { children: [
1273
- O.map((u, m) => /* @__PURE__ */ k("tr", { children: [
1274
- !W && /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r(
914
+ /* @__PURE__ */ h("tbody", { children: [
915
+ y.map((r, n) => /* @__PURE__ */ h("tr", { children: [
916
+ !S && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
1275
917
  "input",
1276
918
  {
1277
919
  type: "checkbox",
1278
- checked: S.includes(u._uid),
1279
- onChange: () => p.toggleSelection(u._uid)
920
+ checked: R.includes(r._uid),
921
+ onChange: () => _.toggleSelection(r._uid)
1280
922
  }
1281
923
  ) }),
1282
- n.map((d) => /* @__PURE__ */ r("td", { children: d.render ? d.render.length <= 1 ? d.render({
1283
- row: u,
1284
- index: m,
1285
- updateRow: (f, w) => p.updateCellValue(u._uid, String(f), w),
1286
- isLocked: !!W,
1287
- isView: !!a
1288
- }) : d.render(
1289
- u,
1290
- m,
1291
- (f, w) => p.updateCellValue(u._uid, f, w),
1292
- !!W,
1293
- !!a
1294
- ) : u[d.key] }, `${u._uid}-${String(d.key)}`))
1295
- ] }, u._uid)),
1296
- O.length === 0 && /* @__PURE__ */ r("tr", { className: "empty-row", children: /* @__PURE__ */ r("td", { colSpan: 100, className: "text-center", children: W ? "Nenhum registro encontrado." : "Nenhum registro." }) })
924
+ a.map((s) => /* @__PURE__ */ e("td", { children: s.render ? s.render.length <= 1 ? s.render({
925
+ row: r,
926
+ index: n,
927
+ updateRow: (u, k) => _.updateCellValue(r._uid, String(u), k),
928
+ isLocked: !!S,
929
+ isView: !!i
930
+ }) : s.render(
931
+ r,
932
+ n,
933
+ (u, k) => _.updateCellValue(r._uid, u, k),
934
+ !!S,
935
+ !!i
936
+ ) : r[s.key] }, `${r._uid}-${String(s.key)}`))
937
+ ] }, r._uid)),
938
+ y.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children: S ? "Nenhum registro encontrado." : "Nenhum registro." }) })
1297
939
  ] })
1298
940
  ] }) })
1299
941
  ] });
1300
- }, Rt = (e, t) => {
1301
- const [n, s] = I(null);
1302
- let i = null;
942
+ }, tt = (t, l) => {
943
+ const [a, f] = P(null);
944
+ let c = null;
1303
945
  try {
1304
- i = H().watch;
946
+ c = U().watch;
1305
947
  } catch {
1306
948
  }
1307
- const c = t !== void 0 ? t : i ? i(e) : void 0, l = C(() => {
949
+ const o = l !== void 0 ? l : c ? c(t) : void 0, m = j(() => {
1308
950
  try {
1309
- const b = window.top.__REACT_ATTACHMENT_BRIDGE__;
1310
- if (b) {
1311
- const a = b.getAttachment(e, c);
1312
- s(a || (c ? { name: c, documentId: 0 } : null));
951
+ const p = window.top.__REACT_ATTACHMENT_BRIDGE__;
952
+ if (p) {
953
+ const i = p.getAttachment(t, o);
954
+ f(i || (o ? { name: o, documentId: 0 } : null));
1313
955
  } else
1314
- s(c ? { name: c, documentId: 0 } : null);
956
+ f(o ? { name: o, documentId: 0 } : null);
1315
957
  } catch {
1316
- s(c ? { name: c, documentId: 0 } : null);
958
+ f(o ? { name: o, documentId: 0 } : null);
1317
959
  }
1318
- }, [e, c, t]);
1319
- return E(() => {
1320
- l();
1321
- const o = setInterval(l, 2e3);
1322
- return () => clearInterval(o);
1323
- }, [l]), { attachment: n, sync: l };
1324
- }, St = ({
1325
- name: e,
1326
- label: t,
1327
- help: n,
1328
- valueManual: s,
1329
- onChangeManual: i,
1330
- forceReadOnly: c = !1,
1331
- forceHidden: l = !1
960
+ }, [t, o, l]);
961
+ return T(() => {
962
+ m();
963
+ const d = setInterval(m, 2e3);
964
+ return () => clearInterval(d);
965
+ }, [m]), { attachment: a, sync: m };
966
+ }, st = ({
967
+ name: t,
968
+ label: l,
969
+ help: a,
970
+ valueManual: f,
971
+ onChangeManual: c,
972
+ forceReadOnly: o = !1,
973
+ forceHidden: m = !1,
974
+ helpText: d,
975
+ helpTitle: p,
976
+ helpWidth: i
1332
977
  }) => {
1333
- const o = !!i, { isReadOnly: b, isHidden: a } = F(), { isView: N } = L(), h = c || N || !!b(e), W = l || !!a(e), [V, O] = I(!1);
1334
- let S = null;
978
+ const v = !!c, { isReadOnly: x, isHidden: S } = G(), { isView: C } = Y(), y = o || C || !!x(t), R = m || !!S(t), [D, _] = P(!1);
979
+ let g = null;
1335
980
  try {
1336
- S = H().control;
981
+ g = U().control;
1337
982
  } catch {
1338
983
  }
1339
- const A = S && !o ? X({ name: e, control: S }).field : {
1340
- value: s,
1341
- onChange: ($) => i == null ? void 0 : i($)
1342
- }, { attachment: p, sync: v } = Rt(e, s), u = () => {
1343
- var $;
984
+ const r = g && !v ? W({ name: t, control: g }).field : {
985
+ value: f,
986
+ onChange: (w) => c == null ? void 0 : c(w)
987
+ }, { attachment: n, sync: s } = tt(t, f), u = () => {
988
+ var w;
1344
989
  try {
1345
- const _ = window.top;
990
+ const N = window.top;
1346
991
  return {
1347
- bridge: _.__REACT_ATTACHMENT_BRIDGE__,
1348
- toast: ($ = _.FLUIGC) == null ? void 0 : $.toast
992
+ bridge: N.__REACT_ATTACHMENT_BRIDGE__,
993
+ toast: (w = N.FLUIGC) == null ? void 0 : w.toast
1349
994
  };
1350
995
  } catch {
1351
996
  return { bridge: null, toast: null };
1352
997
  }
1353
- }, m = C(() => {
1354
- if (h) return;
1355
- const $ = document.createElement("input");
1356
- $.type = "file", $.onchange = (_) => {
1357
- const y = _.target.files[0];
1358
- if (!y) return;
1359
- const { bridge: x, toast: P } = u();
1360
- O(!0), x ? x.upload(y, e, (g) => {
1361
- o ? i == null || i(g.name) : A.onChange(g.name), setTimeout(() => {
1362
- O(!1), v();
1363
- }, 1e3), P && P({
998
+ }, k = j(() => {
999
+ if (y) return;
1000
+ const w = document.createElement("input");
1001
+ w.type = "file", w.onchange = (N) => {
1002
+ const A = N.target.files[0];
1003
+ if (!A) return;
1004
+ const { bridge: b, toast: E } = u();
1005
+ _(!0), b ? b.upload(A, t, (L) => {
1006
+ v ? c == null || c(L.name) : r.onChange(L.name), setTimeout(() => {
1007
+ _(!1), s();
1008
+ }, 1e3), E && E({
1364
1009
  title: "Sucesso",
1365
1010
  message: "Arquivo enviado",
1366
1011
  type: "success"
1367
1012
  });
1368
- }) : (o ? i == null || i(y.name) : A.onChange(y.name), O(!1));
1369
- }, $.click();
1370
- }, [e, A, v, i, h, o]), d = ($) => {
1371
- if ($.stopPropagation(), h) return;
1372
- const _ = (p == null ? void 0 : p.name) || s || A.value;
1373
- if (!_) return;
1374
- const { bridge: y, toast: x } = u();
1375
- y ? y.removeByFileName(_) ? (o ? i == null || i("") : A.onChange(""), v()) : x && x({
1013
+ }) : (v ? c == null || c(A.name) : r.onChange(A.name), _(!1));
1014
+ }, w.click();
1015
+ }, [t, r, s, c, y, v]), I = (w) => {
1016
+ if (w.stopPropagation(), y) return;
1017
+ const N = (n == null ? void 0 : n.name) || f || r.value;
1018
+ if (!N) return;
1019
+ const { bridge: A, toast: b } = u();
1020
+ A ? A.removeByFileName(N) ? (v ? c == null || c("") : r.onChange(""), s()) : b && b({
1376
1021
  title: "Erro",
1377
1022
  message: "Erro ao remover anexo",
1378
1023
  type: "danger"
1379
- }) : (o ? i == null || i("") : A.onChange(""), v());
1380
- }, f = !!p && !V, w = (p == null ? void 0 : p.name) || s || A.value, D = [
1024
+ }) : (v ? c == null || c("") : r.onChange(""), s());
1025
+ }, B = !!n && !D, V = (n == null ? void 0 : n.name) || f || r.value, O = [
1381
1026
  "fluig-attachment__box",
1382
- f ? "fluig-attachment__box--has-file" : "",
1383
- V ? "fluig-attachment__box--uploading" : "",
1384
- h && !f ? "readOnly" : "",
1385
- h && f ? "fluig-attachment__box--readonly-view" : ""
1027
+ B ? "fluig-attachment__box--has-file" : "",
1028
+ D ? "fluig-attachment__box--uploading" : "",
1029
+ y && !B ? "readOnly" : "",
1030
+ y && B ? "fluig-attachment__box--readonly-view" : ""
1386
1031
  ].join(" ");
1387
- return W ? null : /* @__PURE__ */ k("div", { className: "form-group fluig-attachment", children: [
1388
- t && /* @__PURE__ */ r("label", { className: "fluig-attachment__label", children: t }),
1389
- /* @__PURE__ */ k(
1390
- "div",
1391
- {
1392
- className: D,
1393
- onClick: () => {
1394
- if (f) {
1395
- const $ = u(), _ = (p == null ? void 0 : p.physicalFileName) || (p == null ? void 0 : p.description) || (p == null ? void 0 : p.name) || w;
1396
- $.bridge && _ && $.bridge.view(_);
1397
- } else
1398
- m();
1399
- },
1400
- children: [
1401
- /* @__PURE__ */ k("span", { className: "fluig-attachment__content", children: [
1402
- /* @__PURE__ */ r(
1403
- "i",
1404
- {
1405
- className: `flaticon icon-sm ${V ? "flaticon-loading" : f ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1406
- }
1407
- ),
1408
- /* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: V ? " Enviando..." : f ? w : h ? "Nenhum arquivo" : n || "Anexar" })
1409
- ] }),
1410
- f && !h && /* @__PURE__ */ r(
1411
- "button",
1412
- {
1413
- type: "button",
1414
- className: "fluig-attachment__btn-remove btn btn-link text-danger",
1415
- onClick: d,
1416
- children: /* @__PURE__ */ r("i", { className: "flaticon flaticon-trash icon-sm" })
1417
- }
1418
- )
1419
- ]
1420
- }
1421
- ),
1422
- !o && S && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: A.value || "" })
1423
- ] });
1424
- }, It = z(St);
1425
- function Ft({
1426
- title: e,
1427
- isOpen: t,
1428
- onOpen: n,
1429
- onClose: s,
1430
- content: i,
1431
- footer: c,
1432
- width: l
1433
- }) {
1434
- const o = C(
1435
- (b) => {
1436
- b.key === "Escape" && s();
1437
- },
1438
- [s]
1439
- );
1440
- return E(() => (t && (document.addEventListener("keydown", o), n == null || n(), document.body.style.overflow = "hidden"), () => {
1441
- document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
1442
- }), [t, o, n]), t ? /* @__PURE__ */ r(
1443
- "div",
1444
- {
1445
- className: "modal-overlay",
1446
- onClick: s,
1447
- "aria-modal": "true",
1448
- role: "dialog",
1449
- children: /* @__PURE__ */ k(
1032
+ return R ? null : /* @__PURE__ */ h("div", { className: "form-group fluig-attachment", children: [
1033
+ l && /* @__PURE__ */ e("label", { className: "fluig-attachment__label", children: l }),
1034
+ /* @__PURE__ */ h("div", { className: d ? "dfe-flex-input-wrapper" : "", children: [
1035
+ /* @__PURE__ */ h(
1450
1036
  "div",
1451
1037
  {
1452
- style: { maxWidth: l },
1453
- className: "modal-container",
1454
- onClick: (b) => b.stopPropagation(),
1038
+ className: O,
1039
+ style: d ? { flex: 1 } : void 0,
1040
+ onClick: () => {
1041
+ if (B) {
1042
+ const w = u(), N = (n == null ? void 0 : n.physicalFileName) || (n == null ? void 0 : n.description) || (n == null ? void 0 : n.name) || V;
1043
+ w.bridge && N && w.bridge.view(N);
1044
+ } else
1045
+ k();
1046
+ },
1455
1047
  children: [
1456
- /* @__PURE__ */ k("div", { className: "modal-header", children: [
1457
- /* @__PURE__ */ r("h3", { children: e }),
1458
- /* @__PURE__ */ r(
1459
- "div",
1048
+ /* @__PURE__ */ h("span", { className: "fluig-attachment__content", children: [
1049
+ /* @__PURE__ */ e(
1050
+ "i",
1460
1051
  {
1461
- className: "btn-close-modal",
1462
- onClick: s,
1463
- role: "button",
1464
- "aria-label": "Fechar modal",
1465
- children: /* @__PURE__ */ r(
1466
- "i",
1467
- {
1468
- className: "flaticon flaticon-close icon-md",
1469
- "aria-hidden": "true"
1470
- }
1471
- )
1052
+ className: `flaticon icon-sm ${D ? "flaticon-loading" : B ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
1472
1053
  }
1473
- )
1054
+ ),
1055
+ /* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children: D ? " Enviando..." : B ? V : y ? "Nenhum arquivo" : a || "Anexar" })
1474
1056
  ] }),
1475
- /* @__PURE__ */ r("div", { className: "modal-content", children: i }),
1476
- c && /* @__PURE__ */ r("div", { className: "modal-footer", children: c })
1057
+ B && !y && /* @__PURE__ */ e(
1058
+ "button",
1059
+ {
1060
+ type: "button",
1061
+ className: "fluig-attachment__btn-remove btn btn-link text-danger",
1062
+ onClick: I,
1063
+ children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-trash icon-sm" })
1064
+ }
1065
+ )
1477
1066
  ]
1478
1067
  }
1479
- )
1480
- }
1481
- ) : null;
1482
- }
1068
+ ),
1069
+ d && /* @__PURE__ */ e(Z, { text: d, title: p, width: i })
1070
+ ] }),
1071
+ !v && g && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: r.value || "" })
1072
+ ] });
1073
+ }, vt = q(st);
1483
1074
  export {
1484
- It as Attachment,
1485
- Tt as Checkbox,
1486
- Et as DatePicker,
1487
- Vt as Input,
1488
- Ft as Modal,
1489
- jt as RadioBtn,
1490
- Dt as Select,
1491
- Lt as SimpleTable,
1492
- Ht as StatusBadge,
1493
- Ct as TextArea
1075
+ vt as Attachment,
1076
+ at as Checkbox,
1077
+ mt as DatePicker,
1078
+ Z as Help,
1079
+ ot as Input,
1080
+ Ie as Modal,
1081
+ ut as RadioBtn,
1082
+ re as Select,
1083
+ pt as SimpleTable,
1084
+ ht as StatusBadge,
1085
+ ft as TextArea
1494
1086
  };