@tech-diefra/fluig-ui 1.2.14 → 1.2.16

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