@tech-diefra/fluig-ui 1.2.29 → 1.2.31

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