@tech-diefra/fluig-ui 1.1.2 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsxs as w, jsx as n, Fragment as Z } from "react/jsx-runtime";
2
- import { memo as F, useMemo as A, useCallback as $, useState as B, useRef as U, useEffect as D, forwardRef as K } from "react";
3
- import { useFormContext as j, useController as H, useFormState as ee } from "react-hook-form";
1
+ import { jsxs as y, jsx as a, Fragment as Z } from "react/jsx-runtime";
2
+ import { memo as F, useMemo as j, useCallback as V, useState as B, useRef as U, useEffect as D, 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 W } from "@fluig-kit/ecm";
5
+ import { useSection as A, 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 oe } from "date-fns";
7
+ import { parse as re, isValid as oe, format as ie } from "date-fns";
8
8
  const se = {
9
9
  cpf: "000.000.000-00",
10
10
  cnpj: "00.000.000/0000-00",
@@ -13,391 +13,391 @@ const se = {
13
13
  };
14
14
  function de({
15
15
  name: e,
16
- label: a = "",
16
+ label: r = "",
17
17
  placeholder: t = "",
18
- type: d = "text",
19
- mask: r,
20
- className: s = "",
21
- forceReadOnly: i = !1,
22
- forceHidden: l = !1
18
+ type: l = "text",
19
+ mask: i,
20
+ className: c = "",
21
+ forceReadOnly: s = !1,
22
+ forceHidden: d = !1
23
23
  }) {
24
- const { isReadOnly: N, isHidden: h } = T(), f = i || !!N(e), k = l || !!h(e), { control: R } = j(), { isView: S } = W(), { field: b } = H({ name: e, control: R }), { errors: p } = ee({ name: e }), g = p == null ? void 0 : p[e], m = A(() => r ? se[r] ?? r : null, [r]), u = $((o) => {
25
- if (!o) return "";
26
- const C = o.replace(/\D/g, "");
27
- return (Number(C) / 100).toLocaleString("pt-BR", {
24
+ const { isReadOnly: k, isHidden: m } = A(), w = s || !!k(e), N = d || !!m(e), { control: x } = T(), { isView: P } = W(), { field: g } = H({ name: e, control: x }), { errors: v } = ee({ name: e }), b = v == null ? void 0 : v[e], C = j(() => i ? se[i] ?? i : null, [i]), S = V((n) => {
25
+ if (!n) return "";
26
+ const o = n.replace(/\D/g, "");
27
+ return (Number(o) / 100).toLocaleString("pt-BR", {
28
28
  style: "currency",
29
29
  currency: "BRL"
30
30
  });
31
- }, []), c = $(
32
- (o) => d === "monetary" ? u(o) : o,
33
- [d, u]
31
+ }, []), h = V(
32
+ (n) => l === "monetary" ? S(n) : n,
33
+ [l, S]
34
34
  );
35
- return S ? /* @__PURE__ */ w("div", { className: "form-group", children: [
36
- /* @__PURE__ */ n("label", { children: a }),
37
- /* @__PURE__ */ n("span", { className: "form-control", children: b.value || "-" })
38
- ] }) : /* @__PURE__ */ w("div", { className: `form-group ${k ? "hidden" : ""}`, children: [
39
- /* @__PURE__ */ n("label", { children: a }),
40
- m ? /* @__PURE__ */ n(
35
+ return P ? /* @__PURE__ */ y("div", { className: "form-group", children: [
36
+ /* @__PURE__ */ a("label", { children: r }),
37
+ /* @__PURE__ */ a("span", { className: "form-control", children: g.value || "-" })
38
+ ] }) : /* @__PURE__ */ y("div", { className: `form-group ${N ? "hidden" : ""}`, children: [
39
+ /* @__PURE__ */ a("label", { children: r }),
40
+ C ? /* @__PURE__ */ a(
41
41
  te,
42
42
  {
43
43
  name: e,
44
- mask: m,
45
- value: String(b.value ?? ""),
44
+ mask: C,
45
+ value: String(g.value ?? ""),
46
46
  unmask: !1,
47
- onAccept: (o) => b.onChange(c(o)),
47
+ onAccept: (n) => g.onChange(h(n)),
48
48
  placeholder: t,
49
- readOnly: f,
50
- className: `form-control ${g ? "border-red" : ""} ${s}`,
51
- inputRef: b.ref,
52
- onBlur: b.onBlur
49
+ readOnly: w,
50
+ className: `form-control ${b ? "border-red" : ""} ${c}`,
51
+ inputRef: g.ref,
52
+ onBlur: g.onBlur
53
53
  }
54
- ) : /* @__PURE__ */ n(
54
+ ) : /* @__PURE__ */ a(
55
55
  "input",
56
56
  {
57
- ...b,
57
+ ...g,
58
58
  type: "text",
59
- value: b.value ?? "",
60
- onChange: (o) => b.onChange(c(o.target.value)),
59
+ value: g.value ?? "",
60
+ onChange: (n) => g.onChange(h(n.target.value)),
61
61
  placeholder: t,
62
- readOnly: f,
63
- className: `form-control ${g ? "border-red" : ""} ${s}`
62
+ readOnly: w,
63
+ className: `form-control ${b ? "border-red" : ""} ${c}`
64
64
  }
65
65
  ),
66
- g && /* @__PURE__ */ n("p", { className: "text-danger", children: String(g.message) })
66
+ b && /* @__PURE__ */ a("p", { className: "text-danger", children: String(b.message) })
67
67
  ] });
68
68
  }
69
69
  const rt = F(de);
70
70
  function le({
71
71
  name: e,
72
- label: a = "",
72
+ label: r = "",
73
73
  options: t = [],
74
- placeholder: d = "",
75
- labelKey: r = "label",
76
- valueKey: s = "value",
77
- enableSearch: i = !1,
78
- searchPlaceholder: l = "Buscar...",
79
- loading: N = !1,
80
- onSearchChange: h,
81
- debounceTime: f = 300,
82
- onSelect: k,
83
- forceReadOnly: R = !1,
84
- forceHidden: S = !1
74
+ placeholder: l = "",
75
+ labelKey: i = "label",
76
+ valueKey: c = "value",
77
+ enableSearch: s = !1,
78
+ searchPlaceholder: d = "Buscar...",
79
+ loading: k = !1,
80
+ onSearchChange: m,
81
+ debounceTime: w = 300,
82
+ onSelect: N,
83
+ forceReadOnly: x = !1,
84
+ forceHidden: P = !1
85
85
  }) {
86
- const { isReadOnly: b, isHidden: p } = T(), g = R || !!b(e), m = S || !!p(e), { control: u, clearErrors: c } = j(), { isView: o } = W(), {
87
- field: { onChange: C, value: x, ref: V },
88
- fieldState: { error: y }
86
+ const { isReadOnly: g, isHidden: v } = A(), b = x || !!g(e), C = P || !!v(e), { control: S, clearErrors: h } = T(), { isView: n } = W(), {
87
+ field: { onChange: o, value: u, ref: O },
88
+ fieldState: { error: f }
89
89
  } = H({
90
90
  name: e,
91
- control: u
92
- }), [P, O] = B(!1), [M, Y] = B(""), z = U(null), I = U(h);
91
+ control: S
92
+ }), [R, M] = B(!1), [$, Y] = B(""), z = U(null), I = U(m);
93
93
  D(() => {
94
- I.current = h;
95
- }, [h]), D(() => {
96
- const v = (_) => {
97
- z.current && !z.current.contains(_.target) && O(!1);
94
+ I.current = m;
95
+ }, [m]), D(() => {
96
+ const p = (_) => {
97
+ z.current && !z.current.contains(_.target) && M(!1);
98
98
  };
99
- return document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
99
+ return document.addEventListener("mousedown", p), () => document.removeEventListener("mousedown", p);
100
100
  }, []), D(() => {
101
- P || Y("");
102
- }, [P]), D(() => {
103
- if (!i) return;
104
- const v = setTimeout(() => {
105
- I.current && I.current(M);
106
- }, f);
107
- return () => clearTimeout(v);
108
- }, [M, i, f]);
109
- const Q = A(() => i && !h && M.trim() ? t.filter(
110
- (v) => String((v == null ? void 0 : v[r]) ?? "").toLowerCase().includes(M.toLowerCase())
111
- ) : t ?? [], [t, i, h, M, r]), J = A(() => {
112
- if (x == null) return "";
113
- if (typeof x == "object")
114
- return String(x[s] ?? "");
115
- const v = (t || []).find(
116
- (_) => String(_ == null ? void 0 : _[s]) === String(x)
101
+ R || Y("");
102
+ }, [R]), D(() => {
103
+ if (!s) return;
104
+ const p = setTimeout(() => {
105
+ I.current && I.current($);
106
+ }, w);
107
+ return () => clearTimeout(p);
108
+ }, [$, s, w]);
109
+ const Q = j(() => s && !m && $.trim() ? t.filter(
110
+ (p) => String((p == null ? void 0 : p[i]) ?? "").toLowerCase().includes($.toLowerCase())
111
+ ) : t ?? [], [t, s, m, $, i]), J = j(() => {
112
+ if (u == null) return "";
113
+ if (typeof u == "object")
114
+ return String(u[c] ?? "");
115
+ const p = (t || []).find(
116
+ (_) => String(_ == null ? void 0 : _[c]) === String(u)
117
117
  );
118
- return String(v ? (v == null ? void 0 : v[r]) ?? "" : x);
119
- }, [x, t, s, r]), G = (v) => {
120
- g || (C(v[s]), k && k(v), c(e), O(!1));
118
+ return String(p ? (p == null ? void 0 : p[i]) ?? "" : u);
119
+ }, [u, t, c, i]), G = (p) => {
120
+ b || (o(p[c]), N && N(p), h(e), M(!1));
121
121
  };
122
- return /* @__PURE__ */ w(
122
+ return /* @__PURE__ */ y(
123
123
  "div",
124
124
  {
125
- className: `select-wrapper form-group ${m ? "hidden" : ""}`,
125
+ className: `select-wrapper form-group ${C ? "hidden" : ""}`,
126
126
  ref: z,
127
127
  children: [
128
- /* @__PURE__ */ n("label", { className: "control-label", children: a }),
129
- o ? /* @__PURE__ */ n("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */ w(Z, { children: [
130
- /* @__PURE__ */ w(
128
+ /* @__PURE__ */ a("label", { className: "control-label", children: r }),
129
+ n ? /* @__PURE__ */ a("span", { className: "form-control", children: J || "-" }) : /* @__PURE__ */ y(Z, { children: [
130
+ /* @__PURE__ */ y(
131
131
  "div",
132
132
  {
133
- className: `select-control ${y ? "border-red" : ""} ${g ? "readOnly" : ""}`,
134
- onClick: () => !g && O((v) => !v),
135
- ref: V,
133
+ className: `select-control ${f ? "border-red" : ""} ${b ? "readOnly" : ""}`,
134
+ onClick: () => !b && M((p) => !p),
135
+ ref: O,
136
136
  children: [
137
- /* @__PURE__ */ n("span", { className: `select-display ${g ? "readOnly" : ""}`, children: J || d }),
138
- /* @__PURE__ */ n("i", { className: "flaticon flaticon-chevron-down select-icon" })
137
+ /* @__PURE__ */ a("span", { className: `select-display ${b ? "readOnly" : ""}`, children: J || l }),
138
+ /* @__PURE__ */ a("i", { className: "flaticon flaticon-chevron-down select-icon" })
139
139
  ]
140
140
  }
141
141
  ),
142
- P && !g && /* @__PURE__ */ w("div", { className: "select-dropdown", children: [
143
- i && /* @__PURE__ */ n("div", { className: "select-search", children: /* @__PURE__ */ n(
142
+ R && !b && /* @__PURE__ */ y("div", { className: "select-dropdown", children: [
143
+ s && /* @__PURE__ */ a("div", { className: "select-search", children: /* @__PURE__ */ a(
144
144
  "input",
145
145
  {
146
146
  type: "text",
147
147
  className: "select-search-input",
148
- value: M,
149
- onChange: (v) => Y(v.target.value),
150
- placeholder: N ? "Carregando..." : l,
148
+ value: $,
149
+ onChange: (p) => Y(p.target.value),
150
+ placeholder: k ? "Carregando..." : d,
151
151
  autoFocus: !0,
152
- onClick: (v) => v.stopPropagation()
152
+ onClick: (p) => p.stopPropagation()
153
153
  }
154
154
  ) }),
155
- /* @__PURE__ */ n("ul", { className: "select-options", children: N ? /* @__PURE__ */ n("li", { className: "select-option readOnly", children: "Carregando..." }) : Q.length > 0 ? Q.map((v) => /* @__PURE__ */ n(
155
+ /* @__PURE__ */ a("ul", { className: "select-options", children: k ? /* @__PURE__ */ a("li", { className: "select-option readOnly", children: "Carregando..." }) : Q.length > 0 ? Q.map((p) => /* @__PURE__ */ a(
156
156
  "li",
157
157
  {
158
- onClick: () => G(v),
158
+ onClick: () => G(p),
159
159
  className: "select-option handleHover",
160
- children: v[r]
160
+ children: p[i]
161
161
  },
162
- v[s]
163
- )) : /* @__PURE__ */ n("li", { className: "select-option readOnly", children: "Sem resultados" }) })
162
+ p[c]
163
+ )) : /* @__PURE__ */ a("li", { className: "select-option readOnly", children: "Sem resultados" }) })
164
164
  ] })
165
165
  ] }),
166
- /* @__PURE__ */ n("input", { type: "hidden", name: e, value: x || "" }),
167
- y && /* @__PURE__ */ n("p", { className: "text-danger", children: String(y.message) })
166
+ /* @__PURE__ */ a("input", { type: "hidden", name: e, value: u || "" }),
167
+ f && /* @__PURE__ */ a("p", { className: "text-danger", children: String(f.message) })
168
168
  ]
169
169
  }
170
170
  );
171
171
  }
172
- const it = F(le);
173
- function ot({
172
+ const ot = F(le);
173
+ function it({
174
174
  name: e,
175
- options: a = [],
175
+ options: r = [],
176
176
  label: t = "",
177
- valueKey: d = "value",
178
- labelKey: r = "label",
179
- forceReadOnly: s = !1,
180
- forceHidden: i = !1
177
+ valueKey: l = "value",
178
+ labelKey: i = "label",
179
+ forceReadOnly: c = !1,
180
+ forceHidden: s = !1
181
181
  }) {
182
- var x, V;
183
- const l = j(), { isView: N, isReadOnly: h } = W(), { isReadOnly: f, isHidden: k } = T(), R = f ? f(e) : !1, S = k ? k(e) : !1, b = s || R, p = i || S, g = b || h || N;
184
- if (!l || !e)
182
+ var u, O;
183
+ const d = T(), { isView: k, isReadOnly: m } = W(), { isReadOnly: w, isHidden: N } = A(), x = w ? w(e) : !1, P = N ? N(e) : !1, g = c || x, v = s || P, b = g || m || k;
184
+ if (!d || !e)
185
185
  return console.error("Checkbox requer contexto de formulário e nome."), null;
186
- const m = () => !a || !l ? {} : a.reduce((y, P) => {
187
- const O = P[d], M = l.getValues(O);
188
- return y[O] = M === "on", y;
189
- }, {}), u = l.watch(e), c = A(() => u && typeof u == "object" ? u : m(), [u, a, d]);
186
+ const C = () => !r || !d ? {} : r.reduce((f, R) => {
187
+ const M = R[l], $ = d.getValues(M);
188
+ return f[M] = $ === "on", f;
189
+ }, {}), S = d.watch(e), h = j(() => S && typeof S == "object" ? S : C(), [S, r, l]);
190
190
  D(() => {
191
- const y = l.getValues(e);
192
- (!y || typeof y != "object") && l.setValue(e, c, {
191
+ const f = d.getValues(e);
192
+ (!f || typeof f != "object") && d.setValue(e, h, {
193
193
  shouldDirty: !1,
194
194
  shouldValidate: !1
195
195
  });
196
- }, [c, e, l]);
197
- const o = (y, P) => {
198
- if (g) return;
199
- const O = { ...c, [y]: P };
200
- l.setValue(e, O, {
196
+ }, [h, e, d]);
197
+ const n = (f, R) => {
198
+ if (b) return;
199
+ const M = { ...h, [f]: R };
200
+ d.setValue(e, M, {
201
201
  shouldDirty: !0,
202
202
  shouldValidate: !0
203
- }), l.setValue(y, P ? "on" : "", { shouldValidate: !1 });
204
- }, C = (V = (x = l.formState) == null ? void 0 : x.errors) == null ? void 0 : V[e];
205
- return /* @__PURE__ */ w("div", { className: `form-group ${p ? "hidden" : ""}`, children: [
206
- t && /* @__PURE__ */ n("label", { children: t }),
207
- /* @__PURE__ */ n(
203
+ }), d.setValue(f, R ? "on" : "", { shouldValidate: !1 });
204
+ }, o = (O = (u = d.formState) == null ? void 0 : u.errors) == null ? void 0 : O[e];
205
+ return /* @__PURE__ */ y("div", { className: `form-group ${v ? "hidden" : ""}`, children: [
206
+ t && /* @__PURE__ */ a("label", { children: t }),
207
+ /* @__PURE__ */ a(
208
208
  "div",
209
209
  {
210
- className: `checkbox-group-custom ${g ? "readOnly" : ""}`,
211
- children: a.map((y) => {
212
- const P = String(y[d]), O = c[P] === !0;
213
- return /* @__PURE__ */ w("div", { children: [
214
- /* @__PURE__ */ n("input", { type: "hidden", ...l.register(P) }),
215
- /* @__PURE__ */ w(
210
+ className: `checkbox-group-custom ${b ? "readOnly" : ""}`,
211
+ children: r.map((f) => {
212
+ const R = String(f[l]), M = h[R] === !0;
213
+ return /* @__PURE__ */ y("div", { children: [
214
+ /* @__PURE__ */ a("input", { type: "hidden", ...d.register(R) }),
215
+ /* @__PURE__ */ y(
216
216
  "label",
217
217
  {
218
- className: `custom-checkbox ${O ? "checked" : ""} ${g ? "readOnly" : ""}`,
218
+ className: `custom-checkbox ${M ? "checked" : ""} ${b ? "readOnly" : ""}`,
219
219
  children: [
220
- /* @__PURE__ */ n(
220
+ /* @__PURE__ */ a(
221
221
  "input",
222
222
  {
223
223
  type: "checkbox",
224
- checked: O,
225
- disabled: g,
226
- onChange: (M) => o(P, M.target.checked)
224
+ checked: M,
225
+ disabled: b,
226
+ onChange: ($) => n(R, $.target.checked)
227
227
  }
228
228
  ),
229
- /* @__PURE__ */ n("span", { className: "checkmark" }),
230
- /* @__PURE__ */ n("span", { children: y[r] })
229
+ /* @__PURE__ */ a("span", { className: "checkmark" }),
230
+ /* @__PURE__ */ a("span", { children: f[i] })
231
231
  ]
232
232
  }
233
233
  )
234
- ] }, P);
234
+ ] }, R);
235
235
  })
236
236
  }
237
237
  ),
238
- C && /* @__PURE__ */ n("p", { className: "text-danger", children: String(C.message) })
238
+ o && /* @__PURE__ */ a("p", { className: "text-danger", children: String(o.message) })
239
239
  ] });
240
240
  }
241
241
  function ce({
242
242
  name: e,
243
- label: a = "",
243
+ label: r = "",
244
244
  options: t = [],
245
- valueKey: d = "value",
246
- labelKey: r = "label",
247
- iconKey: s = "icon",
248
- forceReadOnly: i = !1,
249
- forceHidden: l = !1
245
+ valueKey: l = "value",
246
+ labelKey: i = "label",
247
+ iconKey: c = "icon",
248
+ forceReadOnly: s = !1,
249
+ forceHidden: d = !1
250
250
  }) {
251
- const { isReadOnly: N, isHidden: h } = T(), f = i || !!N(e), k = l || !!h(e), { control: R } = j(), { isView: S, isReadOnly: b } = W(), {
252
- field: p,
253
- fieldState: { error: g }
251
+ const { isReadOnly: k, isHidden: m } = A(), w = s || !!k(e), N = d || !!m(e), { control: x } = T(), { isView: P, isReadOnly: g } = W(), {
252
+ field: v,
253
+ fieldState: { error: b }
254
254
  } = H({
255
255
  name: e,
256
- control: R
257
- }), m = f || b || S, u = p.value ?? "", c = $(
258
- (o) => {
259
- m || p.onChange(o);
256
+ control: x
257
+ }), C = w || g || P, S = v.value ?? "", h = V(
258
+ (n) => {
259
+ C || v.onChange(n);
260
260
  },
261
- [m, p]
261
+ [C, v]
262
262
  );
263
- return /* @__PURE__ */ w("div", { className: `form-group column ${k ? "hidden" : ""}`, children: [
264
- a && /* @__PURE__ */ n("label", { className: "control-label", children: a }),
265
- /* @__PURE__ */ n(
263
+ return /* @__PURE__ */ y("div", { className: `form-group column ${N ? "hidden" : ""}`, children: [
264
+ r && /* @__PURE__ */ a("label", { className: "control-label", children: r }),
265
+ /* @__PURE__ */ a(
266
266
  "div",
267
267
  {
268
- className: `btn-group ${m ? "view-mode" : ""}`,
268
+ className: `btn-group ${C ? "view-mode" : ""}`,
269
269
  "data-field-name": e,
270
- children: t.map((o) => {
271
- const C = o[d], x = u === C, V = o.color ? { "--customColor": o.color } : void 0;
272
- return /* @__PURE__ */ w(
270
+ children: t.map((n) => {
271
+ const o = n[l], u = S === o, O = n.color ? { "--customColor": n.color } : void 0;
272
+ return /* @__PURE__ */ y(
273
273
  "label",
274
274
  {
275
- htmlFor: `${e}_${C}`,
276
- style: V,
277
- className: `btn fs-ellipsis ${x ? "active" : ""}`,
275
+ htmlFor: `${e}_${o}`,
276
+ style: O,
277
+ className: `btn fs-ellipsis ${u ? "active" : ""}`,
278
278
  children: [
279
- /* @__PURE__ */ n(
279
+ /* @__PURE__ */ a(
280
280
  "input",
281
281
  {
282
282
  type: "radio",
283
- id: `${e}_${C}`,
283
+ id: `${e}_${o}`,
284
284
  name: e,
285
- value: C,
286
- checked: x,
285
+ value: o,
286
+ checked: u,
287
287
  className: "hidden",
288
- onChange: () => c(C),
289
- disabled: m
288
+ onChange: () => h(o),
289
+ disabled: C
290
290
  }
291
291
  ),
292
- o[s] && /* @__PURE__ */ n("i", { className: `${o[s]} icon-sm` }),
292
+ n[c] && /* @__PURE__ */ a("i", { className: `${n[c]} icon-sm` }),
293
293
  " ",
294
- o[r]
294
+ n[i]
295
295
  ]
296
296
  },
297
- C
297
+ o
298
298
  );
299
299
  })
300
300
  }
301
301
  ),
302
- g && /* @__PURE__ */ n("p", { className: "text-danger", children: String(g.message) })
302
+ b && /* @__PURE__ */ a("p", { className: "text-danger", children: String(b.message) })
303
303
  ] });
304
304
  }
305
305
  const st = F(ce), ue = ({
306
306
  name: e,
307
- label: a = "",
307
+ label: r = "",
308
308
  placeholder: t = "",
309
- className: d = "",
310
- rows: r = 4,
311
- maxLength: s,
312
- forceReadOnly: i = !1,
313
- forceHidden: l = !1
309
+ className: l = "",
310
+ rows: i = 4,
311
+ maxLength: c,
312
+ forceReadOnly: s = !1,
313
+ forceHidden: d = !1
314
314
  }) => {
315
- const { isReadOnly: N, isHidden: h } = T(), f = i || !!N(e), k = l || !!h(e), { control: R } = j(), { isView: S } = W(), {
316
- field: b,
317
- fieldState: { error: p }
315
+ const { isReadOnly: k, isHidden: m } = A(), w = s || !!k(e), N = d || !!m(e), { control: x } = T(), { isView: P } = W(), {
316
+ field: g,
317
+ fieldState: { error: v }
318
318
  } = H({
319
319
  name: e,
320
- control: R
320
+ control: x
321
321
  });
322
- return S ? /* @__PURE__ */ w("div", { className: `form-group ${k ? "hidden" : ""}`, children: [
323
- /* @__PURE__ */ n("label", { children: a }),
324
- /* @__PURE__ */ n("span", { className: "form-control", children: b.value || "-" })
325
- ] }) : /* @__PURE__ */ w("div", { className: `form-group ${k ? "hidden" : ""}`, children: [
326
- /* @__PURE__ */ n("label", { children: a }),
327
- /* @__PURE__ */ n(
322
+ return P ? /* @__PURE__ */ y("div", { className: `form-group ${N ? "hidden" : ""}`, children: [
323
+ /* @__PURE__ */ a("label", { children: r }),
324
+ /* @__PURE__ */ a("span", { className: "form-control", children: g.value || "-" })
325
+ ] }) : /* @__PURE__ */ y("div", { className: `form-group ${N ? "hidden" : ""}`, children: [
326
+ /* @__PURE__ */ a("label", { children: r }),
327
+ /* @__PURE__ */ a(
328
328
  "textarea",
329
329
  {
330
- ...b,
331
- rows: r,
332
- maxLength: s,
333
- value: b.value || "",
330
+ ...g,
331
+ rows: i,
332
+ maxLength: c,
333
+ value: g.value || "",
334
334
  placeholder: t,
335
- readOnly: f,
336
- className: `form-control ${p ? "border-red" : ""} ${d}`
335
+ readOnly: w,
336
+ className: `form-control ${v ? "border-red" : ""} ${l}`
337
337
  }
338
338
  ),
339
- p && /* @__PURE__ */ n("p", { className: "text-danger", children: String(p.message) })
339
+ v && /* @__PURE__ */ a("p", { className: "text-danger", children: String(v.message) })
340
340
  ] });
341
341
  }, dt = F(ue);
342
342
  function E(e) {
343
- return (a = {}) => {
344
- const t = a.width ? String(a.width) : e.defaultWidth;
343
+ return (r = {}) => {
344
+ const t = r.width ? String(r.width) : e.defaultWidth;
345
345
  return e.formats[t] || e.formats[e.defaultWidth];
346
346
  };
347
347
  }
348
348
  function q(e) {
349
- return (a, t) => {
350
- const d = t != null && t.context ? String(t.context) : "standalone";
351
- let r;
352
- if (d === "formatting" && e.formattingValues) {
353
- const i = e.defaultFormattingWidth || e.defaultWidth, l = t != null && t.width ? String(t.width) : i;
354
- r = e.formattingValues[l] || e.formattingValues[i];
349
+ return (r, t) => {
350
+ const l = t != null && t.context ? String(t.context) : "standalone";
351
+ let i;
352
+ if (l === "formatting" && e.formattingValues) {
353
+ const s = e.defaultFormattingWidth || e.defaultWidth, d = t != null && t.width ? String(t.width) : s;
354
+ i = e.formattingValues[d] || e.formattingValues[s];
355
355
  } else {
356
- const i = e.defaultWidth, l = t != null && t.width ? String(t.width) : e.defaultWidth;
357
- r = e.values[l] || e.values[i];
356
+ const s = e.defaultWidth, d = t != null && t.width ? String(t.width) : e.defaultWidth;
357
+ i = e.values[d] || e.values[s];
358
358
  }
359
- const s = e.argumentCallback ? e.argumentCallback(a) : a;
360
- return r[s];
359
+ const c = e.argumentCallback ? e.argumentCallback(r) : r;
360
+ return i[c];
361
361
  };
362
362
  }
363
363
  function L(e) {
364
- return (a, t = {}) => {
365
- const d = t.width, r = d && e.matchPatterns[d] || e.matchPatterns[e.defaultMatchWidth], s = a.match(r);
366
- if (!s)
364
+ return (r, t = {}) => {
365
+ const l = t.width, i = l && e.matchPatterns[l] || e.matchPatterns[e.defaultMatchWidth], c = r.match(i);
366
+ if (!c)
367
367
  return null;
368
- const i = s[0], l = d && e.parsePatterns[d] || e.parsePatterns[e.defaultParseWidth], N = Array.isArray(l) ? he(l, (k) => k.test(i)) : (
368
+ const s = c[0], d = l && e.parsePatterns[l] || e.parsePatterns[e.defaultParseWidth], k = Array.isArray(d) ? he(d, (N) => N.test(s)) : (
369
369
  // [TODO] -- I challenge you to fix the type
370
- me(l, (k) => k.test(i))
370
+ me(d, (N) => N.test(s))
371
371
  );
372
- let h;
373
- h = e.valueCallback ? e.valueCallback(N) : N, h = t.valueCallback ? (
372
+ let m;
373
+ m = e.valueCallback ? e.valueCallback(k) : k, m = t.valueCallback ? (
374
374
  // [TODO] -- I challenge you to fix the type
375
- t.valueCallback(h)
376
- ) : h;
377
- const f = a.slice(i.length);
378
- return { value: h, rest: f };
375
+ t.valueCallback(m)
376
+ ) : m;
377
+ const w = r.slice(s.length);
378
+ return { value: m, rest: w };
379
379
  };
380
380
  }
381
- function me(e, a) {
381
+ function me(e, r) {
382
382
  for (const t in e)
383
- if (Object.prototype.hasOwnProperty.call(e, t) && a(e[t]))
383
+ if (Object.prototype.hasOwnProperty.call(e, t) && r(e[t]))
384
384
  return t;
385
385
  }
386
- function he(e, a) {
386
+ function he(e, r) {
387
387
  for (let t = 0; t < e.length; t++)
388
- if (a(e[t]))
388
+ if (r(e[t]))
389
389
  return t;
390
390
  }
391
391
  function fe(e) {
392
- return (a, t = {}) => {
393
- const d = a.match(e.matchPattern);
394
- if (!d) return null;
395
- const r = d[0], s = a.match(e.parsePattern);
396
- if (!s) return null;
397
- let i = e.valueCallback ? e.valueCallback(s[0]) : s[0];
398
- i = t.valueCallback ? t.valueCallback(i) : i;
399
- const l = a.slice(r.length);
400
- return { value: i, rest: l };
392
+ return (r, t = {}) => {
393
+ const l = r.match(e.matchPattern);
394
+ if (!l) return null;
395
+ const i = l[0], c = r.match(e.parsePattern);
396
+ if (!c) return null;
397
+ let s = e.valueCallback ? e.valueCallback(c[0]) : c[0];
398
+ s = t.valueCallback ? t.valueCallback(s) : s;
399
+ const d = r.slice(i.length);
400
+ return { value: s, rest: d };
401
401
  };
402
402
  }
403
403
  const ge = {
@@ -462,10 +462,10 @@ const ge = {
462
462
  one: "quase 1 ano",
463
463
  other: "quase {{count}} anos"
464
464
  }
465
- }, be = (e, a, t) => {
466
- let d;
467
- const r = ge[e];
468
- return typeof r == "string" ? d = r : a === 1 ? d = r.one : d = r.other.replace("{{count}}", String(a)), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "em " + d : "há " + d : d;
465
+ }, be = (e, r, t) => {
466
+ let l;
467
+ const i = ge[e];
468
+ return typeof i == "string" ? l = i : r === 1 ? l = i.one : l = i.other.replace("{{count}}", String(r)), t != null && t.addSuffix ? t.comparison && t.comparison > 0 ? "em " + l : "há " + l : l;
469
469
  }, pe = {
470
470
  full: "EEEE, d 'de' MMMM 'de' y",
471
471
  long: "d 'de' MMMM 'de' y",
@@ -496,17 +496,17 @@ const ge = {
496
496
  })
497
497
  }, Ne = {
498
498
  lastWeek: (e) => {
499
- const a = e.getDay();
500
- return "'" + (a === 0 || a === 6 ? "último" : "última") + "' eeee 'às' p";
499
+ const r = e.getDay();
500
+ return "'" + (r === 0 || r === 6 ? "último" : "última") + "' eeee 'às' p";
501
501
  },
502
502
  yesterday: "'ontem às' p",
503
503
  today: "'hoje às' p",
504
504
  tomorrow: "'amanhã às' p",
505
505
  nextWeek: "eeee 'às' p",
506
506
  other: "P"
507
- }, ke = (e, a, t, d) => {
508
- const r = Ne[e];
509
- return typeof r == "function" ? r(a) : r;
507
+ }, ke = (e, r, t, l) => {
508
+ const i = Ne[e];
509
+ return typeof i == "function" ? i(r) : i;
510
510
  }, xe = {
511
511
  narrow: ["AC", "DC"],
512
512
  abbreviated: ["AC", "DC"],
@@ -628,9 +628,9 @@ const ge = {
628
628
  evening: "da tarde",
629
629
  night: "da noite"
630
630
  }
631
- }, Me = (e, a) => {
631
+ }, Me = (e, r) => {
632
632
  const t = Number(e);
633
- return (a == null ? void 0 : a.unit) === "week" ? t + "ª" : t + "º";
633
+ return (r == null ? void 0 : r.unit) === "week" ? t + "ª" : t + "º";
634
634
  }, $e = {
635
635
  ordinalNumber: Me,
636
636
  era: q({
@@ -777,281 +777,310 @@ const ge = {
777
777
  ae("pt-BR", Ie);
778
778
  const X = "dd/MM/yyyy", Ee = (e) => {
779
779
  if (!e) return null;
780
- const a = re(e, X, /* @__PURE__ */ new Date());
781
- return ie(a) ? a : null;
782
- }, Xe = (e) => e ? oe(e, X) : "", Ye = K(
783
- ({ shimRef: e, className: a, name: t, ...d }, r) => /* @__PURE__ */ n(
780
+ const r = re(e, X, /* @__PURE__ */ new Date());
781
+ return oe(r) ? r : null;
782
+ }, Xe = (e) => e ? ie(e, X) : "", Ye = K(
783
+ ({ shimRef: e, className: r, name: t, ...l }, i) => /* @__PURE__ */ a(
784
784
  "input",
785
785
  {
786
786
  name: t,
787
- ...d,
788
- className: a,
789
- ref: (s) => {
790
- typeof r == "function" ? r(s) : r && (r.current = s), e && e(s);
787
+ ...l,
788
+ className: r,
789
+ ref: (c) => {
790
+ typeof i == "function" ? i(c) : i && (i.current = c), e && e(c);
791
791
  }
792
792
  }
793
793
  )
794
794
  ), Qe = ({
795
795
  name: e,
796
- label: a = "",
796
+ label: r = "",
797
797
  placeholder: t = "dd/mm/aaaa",
798
- className: d = "",
799
- forceReadOnly: r = !1,
800
- forceHidden: s = !1
798
+ className: l = "",
799
+ forceReadOnly: i = !1,
800
+ forceHidden: c = !1
801
801
  }) => {
802
- const { control: i } = j(), { isView: l } = W(), { isReadOnly: N, isHidden: h } = T(), f = r || !!N(e), k = s || !!h(e), {
803
- field: { onChange: R, onBlur: S, value: b, ref: p },
804
- fieldState: { error: g }
802
+ const { control: s } = T(), { isView: d } = W(), { isReadOnly: k, isHidden: m } = A(), w = i || !!k(e), N = c || !!m(e), {
803
+ field: { onChange: x, onBlur: P, value: g, ref: v },
804
+ fieldState: { error: b }
805
805
  } = H({
806
806
  name: e,
807
- control: i
808
- }), m = A(() => Ee(b), [b]), u = $(
809
- (o) => {
810
- R(o ? Xe(o) : "");
807
+ control: s
808
+ }), C = j(() => Ee(g), [g]), S = V(
809
+ (n) => {
810
+ x(n ? Xe(n) : "");
811
811
  },
812
- [R]
813
- ), c = $(
814
- (o) => {
815
- var C, x;
816
- if (p(o), o && ((x = (C = i._fields) == null ? void 0 : C[e]) != null && x._f)) {
817
- const V = i._fields[e];
818
- V._f.ref = {
812
+ [x]
813
+ ), h = V(
814
+ (n) => {
815
+ var o, u;
816
+ if (v(n), n && ((u = (o = s._fields) == null ? void 0 : o[e]) != null && u._f)) {
817
+ const O = s._fields[e];
818
+ O._f.ref = {
819
819
  focus: () => {
820
- var y;
821
- return (y = o.focus) == null ? void 0 : y.call(o);
820
+ var f;
821
+ return (f = n.focus) == null ? void 0 : f.call(n);
822
822
  },
823
823
  select: () => {
824
- var y;
825
- return (y = o.select) == null ? void 0 : y.call(o);
824
+ var f;
825
+ return (f = n.select) == null ? void 0 : f.call(n);
826
826
  },
827
- setCustomValidity: (y) => {
828
- var P;
829
- return (P = o.setCustomValidity) == null ? void 0 : P.call(o, y);
827
+ setCustomValidity: (f) => {
828
+ var R;
829
+ return (R = n.setCustomValidity) == null ? void 0 : R.call(n, f);
830
830
  },
831
831
  reportValidity: () => {
832
- var y;
833
- return (y = o.reportValidity) == null ? void 0 : y.call(o);
832
+ var f;
833
+ return (f = n.reportValidity) == null ? void 0 : f.call(n);
834
834
  }
835
835
  };
836
836
  }
837
837
  },
838
- [p, i, e]
838
+ [v, s, e]
839
839
  );
840
- return k ? null : l ? /* @__PURE__ */ w("div", { className: "form-group", children: [
841
- /* @__PURE__ */ n("label", { children: a }),
842
- /* @__PURE__ */ n("span", { className: "form-control", children: b || "-" })
843
- ] }) : /* @__PURE__ */ w("div", { className: `form-group fluig-style-guide ${d}`, children: [
844
- a && /* @__PURE__ */ n("label", { className: "control-label", htmlFor: e, children: a }),
845
- /* @__PURE__ */ n("div", { className: `${g ? "border-red" : ""}`, children: /* @__PURE__ */ n(
840
+ return N ? null : d ? /* @__PURE__ */ y("div", { className: "form-group", children: [
841
+ /* @__PURE__ */ a("label", { children: r }),
842
+ /* @__PURE__ */ a("span", { className: "form-control", children: g || "-" })
843
+ ] }) : /* @__PURE__ */ y("div", { className: `form-group fluig-style-guide ${l}`, children: [
844
+ r && /* @__PURE__ */ a("label", { className: "control-label", htmlFor: e, children: r }),
845
+ /* @__PURE__ */ a("div", { className: `${b ? "border-red" : ""}`, children: /* @__PURE__ */ a(
846
846
  ne,
847
847
  {
848
848
  id: e,
849
849
  name: e,
850
- selected: m,
851
- onChange: u,
852
- onBlur: S,
850
+ selected: C,
851
+ onChange: S,
852
+ onBlur: P,
853
853
  dateFormat: X,
854
854
  placeholderText: t,
855
- disabled: f,
856
- readOnly: f,
855
+ disabled: w,
856
+ readOnly: w,
857
857
  locale: "pt-BR",
858
- className: `form-control ${g ? "border-red" : ""}`,
858
+ className: `form-control ${b ? "border-red" : ""}`,
859
859
  wrapperClassName: "w-100",
860
860
  showMonthDropdown: !0,
861
861
  showYearDropdown: !0,
862
862
  dropdownMode: "select",
863
- isClearable: !f && !!b,
863
+ isClearable: !w && !!g,
864
864
  autoComplete: "off",
865
- customInput: /* @__PURE__ */ n(Ye, { name: e, shimRef: c })
865
+ customInput: /* @__PURE__ */ a(Ye, { name: e, shimRef: h })
866
866
  }
867
867
  ) }),
868
- g && /* @__PURE__ */ n("span", { className: "help-block text-danger", children: String(g.message) })
868
+ b && /* @__PURE__ */ a("span", { className: "help-block text-danger", children: String(b.message) })
869
869
  ] });
870
870
  }, lt = F(Qe);
871
871
  function Je({
872
872
  mapping: e = {},
873
- defaultLabel: a = "Não reconhecido",
873
+ defaultLabel: r = "Não reconhecido",
874
874
  className: t = "",
875
- hidden: d = !1,
876
- label: r
875
+ hidden: l = !1,
876
+ label: i
877
877
  }) {
878
- const { activityId: s } = W(), i = A(() => !e || s === null || s === void 0 ? null : e[s], [s, e]);
879
- if (!i)
880
- return /* @__PURE__ */ w("div", { className: `form-group ${d ? "hidden" : ""}`, children: [
881
- r && /* @__PURE__ */ n("label", { children: r }),
882
- /* @__PURE__ */ n("div", { className: `status-badge default ${t}`, children: a })
878
+ const { activityId: c } = W(), s = j(() => !e || c === null || c === void 0 ? null : e[c], [c, e]);
879
+ if (!s)
880
+ return /* @__PURE__ */ y("div", { className: `form-group ${l ? "hidden" : ""}`, children: [
881
+ i && /* @__PURE__ */ a("label", { children: i }),
882
+ /* @__PURE__ */ a("div", { className: `status-badge default ${t}`, children: r })
883
883
  ] });
884
- const l = {
885
- "--customColor": i.color
884
+ const d = {
885
+ "--customColor": s.color
886
886
  };
887
- return /* @__PURE__ */ w("div", { className: `form-group ${d ? "hidden" : ""}`, children: [
888
- r && /* @__PURE__ */ n("label", { children: r }),
889
- /* @__PURE__ */ w("div", { className: `status-badge ${t}`, style: l, children: [
890
- i.icon && /* @__PURE__ */ n("i", { className: i.icon }),
891
- /* @__PURE__ */ n("span", { children: i.label })
887
+ return /* @__PURE__ */ y("div", { className: `form-group ${l ? "hidden" : ""}`, children: [
888
+ i && /* @__PURE__ */ a("label", { children: i }),
889
+ /* @__PURE__ */ y("div", { className: `status-badge ${t}`, style: d, children: [
890
+ s.icon && /* @__PURE__ */ a("i", { className: s.icon }),
891
+ /* @__PURE__ */ a("span", { children: s.label })
892
892
  ] })
893
893
  ] });
894
894
  }
895
895
  const ct = F(Je);
896
896
  function Ue({
897
897
  name: e,
898
- control: a,
898
+ control: r,
899
899
  defaultRowValue: t,
900
- isView: d,
901
- isReadOnly: r
900
+ isView: l,
901
+ isReadOnly: i,
902
+ filters: c = []
902
903
  }) {
903
- const { field: s } = H({ name: e, control: a }), [i, l] = B([]), [N, h] = B([]), f = () => Date.now() + Math.random(), k = (u) => {
904
+ const { field: s } = H({ name: e, control: r }), [d, k] = B([]), [m, w] = B([]), N = () => Date.now() + Math.random(), x = (n) => {
904
905
  try {
905
- const c = JSON.parse(u);
906
- return Array.isArray(c) ? c.map((o) => ({
907
- ...o,
908
- _uid: o._uid || f()
906
+ const o = JSON.parse(n);
907
+ return Array.isArray(o) ? o.map((u) => ({
908
+ ...u,
909
+ _uid: u._uid || N()
909
910
  })) : [];
910
- } catch (c) {
911
- return console.error(`Erro ao ler dados da tabela "${e}":`, c), [];
911
+ } catch (o) {
912
+ return console.error(`Erro ao ler dados da tabela "${e}":`, o), [];
912
913
  }
913
914
  };
914
915
  D(() => {
915
- if (!(i.length > 0 && !d) && s.value && typeof s.value == "string") {
916
- const u = JSON.stringify(i);
917
- if (s.value === u) return;
918
- const c = k(s.value);
919
- l(c);
916
+ if (!(d.length > 0 && !l) && s.value && typeof s.value == "string") {
917
+ const n = JSON.stringify(d);
918
+ if (s.value === n) return;
919
+ const o = x(s.value);
920
+ k(o);
920
921
  }
921
- }, [s.value, d]), D(() => {
922
- if (r) return;
923
- const u = JSON.stringify(i);
924
- s.value !== u && s.onChange(u);
925
- }, [i, s, r]);
926
- const R = $(() => {
927
- const u = { _uid: f(), ...t };
928
- l((c) => [...c, u]);
929
- }, [t]), S = $(() => {
930
- l(
931
- (u) => u.filter((c) => !N.includes(c._uid))
932
- ), h([]);
933
- }, [N]), b = $(
934
- (u, c, o) => {
935
- l(
936
- (C) => C.map(
937
- (x) => x._uid === u ? { ...x, [c]: o } : x
922
+ }, [s.value, l]), D(() => {
923
+ if (i) return;
924
+ const n = JSON.stringify(d);
925
+ s.value !== n && s.onChange(n);
926
+ }, [d, s, i]);
927
+ const P = V(() => {
928
+ const n = { _uid: N(), ...t };
929
+ k((o) => [...o, n]);
930
+ }, [t]), g = V(() => {
931
+ k(
932
+ (n) => n.filter((o) => !m.includes(o._uid))
933
+ ), w([]);
934
+ }, [m]), v = V(
935
+ (n, o, u) => {
936
+ k(
937
+ (O) => O.map(
938
+ (f) => f._uid === n ? { ...f, [o]: u } : f
938
939
  )
939
940
  );
940
941
  },
941
942
  []
942
- ), p = $((u) => {
943
- h(
944
- (c) => c.includes(u) ? c.filter((o) => o !== u) : [...c, u]
943
+ ), b = V((n) => {
944
+ w(
945
+ (o) => o.includes(n) ? o.filter((u) => u !== n) : [...o, n]
945
946
  );
946
- }, []), g = $(
947
- (u) => {
948
- h(u ? i.map((c) => c._uid) : []);
947
+ }, []), C = V(
948
+ (n) => {
949
+ w(n ? d.map((o) => o._uid) : []);
949
950
  },
950
- [i]
951
- ), m = i.length > 0 && N.length === i.length;
951
+ [d]
952
+ ), S = d.length > 0 && m.length === d.length, h = j(() => !c || c.length === 0 ? d : d.filter(
953
+ (n) => c.every((o) => {
954
+ if ("custom" in o)
955
+ return o.custom(n);
956
+ const u = n[o.field];
957
+ switch (o.operator) {
958
+ case "===":
959
+ return u === o.value;
960
+ case "!==":
961
+ return u !== o.value;
962
+ case ">":
963
+ return u > o.value;
964
+ case "<":
965
+ return u < o.value;
966
+ case ">=":
967
+ return u >= o.value;
968
+ case "<=":
969
+ return u <= o.value;
970
+ default:
971
+ return !0;
972
+ }
973
+ })
974
+ ), [d, c]);
952
975
  return {
953
976
  field: s,
954
- // Props do input hidden
955
- tableRows: i,
956
- // Dados da tabela
957
- selectedRowIds: N,
958
- // IDs selecionados
959
- isAllSelected: m,
960
- // Booleano se tudo está selecionado
961
- actions: {
962
- addRow: R,
963
- removeRows: S,
964
- updateCellValue: b,
965
- toggleSelection: p,
966
- toggleSelectAll: g
977
+ tableRows: d,
978
+ visibleRows: h,
979
+ selectedRowIds: m,
980
+ isAllSelected: S,
981
+ handle: {
982
+ addRow: P,
983
+ removeRows: g,
984
+ updateCellValue: v,
985
+ toggleSelection: b,
986
+ toggleSelectAll: C
967
987
  }
968
988
  };
969
989
  }
970
990
  const ut = ({
971
991
  name: e,
972
- title: a = "Tabela Dinâmica",
992
+ title: r = "Tabela Dinâmica",
973
993
  columns: t,
974
- defaultRowValue: d = {},
975
- forceReadOnly: r = !1,
976
- layout: s = "fluid"
977
- // 👈 NOVO
994
+ defaultRowValue: l = {},
995
+ forceReadOnly: i = !1,
996
+ layout: c = "fluid",
997
+ actions: s = !0,
998
+ filters: d = []
978
999
  }) => {
979
- const { control: i } = j(), { isView: l, isReadOnly: N } = W(), { isReadOnly: h } = T(), f = r || l || N || h && h(e), { field: k, tableRows: R, selectedRowIds: S, isAllSelected: b, actions: p } = Ue({
1000
+ const { control: k } = T(), { isView: m, isReadOnly: w } = W(), { isReadOnly: N } = A(), x = i || m || w || N && N(e), {
1001
+ field: P,
1002
+ // tableRows,
1003
+ visibleRows: g,
1004
+ selectedRowIds: v,
1005
+ isAllSelected: b,
1006
+ handle: C
1007
+ } = Ue({
980
1008
  name: e,
981
- control: i,
982
- defaultRowValue: d,
983
- isView: l,
984
- isReadOnly: !!f
985
- }), g = s === "fixed";
986
- return /* @__PURE__ */ w("div", { className: `table-wrapper ${g ? "table-fixed" : "table-fluid"}`, children: [
987
- /* @__PURE__ */ n("input", { type: "hidden", ...k }),
988
- /* @__PURE__ */ w("div", { className: "header-actions", children: [
989
- /* @__PURE__ */ n("h3", { children: a }),
990
- !f && /* @__PURE__ */ w("div", { children: [
991
- /* @__PURE__ */ w(
1009
+ control: k,
1010
+ defaultRowValue: l,
1011
+ isView: m,
1012
+ isReadOnly: !!x,
1013
+ filters: d
1014
+ }), S = c === "fixed";
1015
+ return /* @__PURE__ */ y("div", { className: `table-wrapper ${S ? "table-fixed" : "table-fluid"}`, children: [
1016
+ /* @__PURE__ */ a("input", { type: "hidden", ...P }),
1017
+ s && /* @__PURE__ */ y("div", { className: "header-handle", children: [
1018
+ /* @__PURE__ */ a("h3", { children: r }),
1019
+ !x && /* @__PURE__ */ y("div", { children: [
1020
+ /* @__PURE__ */ y(
992
1021
  "button",
993
1022
  {
994
1023
  type: "button",
995
- className: `btn ${S.length > 0 ? "btn-danger" : ""}`,
996
- disabled: S.length === 0,
997
- onClick: p.removeRows,
1024
+ className: `btn ${v.length > 0 ? "btn-danger" : ""}`,
1025
+ disabled: v.length === 0,
1026
+ onClick: C.removeRows,
998
1027
  children: [
999
1028
  "Remover (",
1000
- S.length,
1029
+ v.length,
1001
1030
  ")"
1002
1031
  ]
1003
1032
  }
1004
1033
  ),
1005
- /* @__PURE__ */ n("button", { type: "button", className: "btn-add", onClick: p.addRow, children: "Adicionar" })
1034
+ /* @__PURE__ */ a("button", { type: "button", className: "btn-add", onClick: C.addRow, children: "Adicionar" })
1006
1035
  ] })
1007
1036
  ] }),
1008
- /* @__PURE__ */ n("div", { className: "table-scroll", children: /* @__PURE__ */ w(
1037
+ /* @__PURE__ */ a("div", { className: "table-scroll", children: /* @__PURE__ */ y(
1009
1038
  "table",
1010
1039
  {
1011
1040
  className: "table-custom",
1012
1041
  style: {
1013
1042
  tableLayout: "fixed",
1014
- width: g ? "max-content" : "100%"
1043
+ width: S ? "max-content" : "100%"
1015
1044
  },
1016
1045
  children: [
1017
- /* @__PURE__ */ n("thead", { children: /* @__PURE__ */ w("tr", { children: [
1018
- !f && /* @__PURE__ */ n("th", { style: { width: "50px" }, children: /* @__PURE__ */ n(
1046
+ /* @__PURE__ */ a("thead", { children: /* @__PURE__ */ y("tr", { children: [
1047
+ !x && /* @__PURE__ */ a("th", { style: { width: "50px" }, children: /* @__PURE__ */ a(
1019
1048
  "input",
1020
1049
  {
1021
1050
  type: "checkbox",
1022
1051
  checked: b,
1023
- onChange: (m) => p.toggleSelectAll(m.target.checked)
1052
+ onChange: (h) => C.toggleSelectAll(h.target.checked)
1024
1053
  }
1025
1054
  ) }),
1026
- t.map((m) => /* @__PURE__ */ n(
1055
+ t.map((h) => /* @__PURE__ */ a(
1027
1056
  "th",
1028
1057
  {
1029
- style: m.width ? { width: m.width } : { width: "100%" },
1030
- children: m.label
1058
+ style: h.width ? { width: h.width } : { width: "100%" },
1059
+ children: h.label
1031
1060
  },
1032
- m.key
1061
+ h.key
1033
1062
  ))
1034
1063
  ] }) }),
1035
- /* @__PURE__ */ n("div", {}),
1036
- /* @__PURE__ */ w("tbody", { children: [
1037
- R.map((m, u) => /* @__PURE__ */ w("tr", { children: [
1038
- !f && /* @__PURE__ */ n("td", { children: /* @__PURE__ */ n(
1064
+ /* @__PURE__ */ a("div", {}),
1065
+ /* @__PURE__ */ y("tbody", { children: [
1066
+ g.map((h, n) => /* @__PURE__ */ y("tr", { children: [
1067
+ !x && /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
1039
1068
  "input",
1040
1069
  {
1041
1070
  type: "checkbox",
1042
- checked: S.includes(m._uid),
1043
- onChange: () => p.toggleSelection(m._uid)
1071
+ checked: v.includes(h._uid),
1072
+ onChange: () => C.toggleSelection(h._uid)
1044
1073
  }
1045
1074
  ) }),
1046
- t.map((c) => /* @__PURE__ */ n("td", { children: c.render ? c.render(
1047
- m,
1048
- u,
1049
- (o, C) => p.updateCellValue(m._uid, o, C),
1050
- !!f,
1051
- !!l
1052
- ) : m[c.key] }, `${m._uid}-${c.key}`))
1053
- ] }, m._uid)),
1054
- R.length === 0 && /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: 100, className: "text-center", children: f ? "Nenhum registro encontrado." : "Nenhum registro." }) })
1075
+ t.map((o) => /* @__PURE__ */ a("td", { children: o.render ? o.render(
1076
+ h,
1077
+ n,
1078
+ (u, O) => C.updateCellValue(h._uid, u, O),
1079
+ !!x,
1080
+ !!m
1081
+ ) : h[o.key] }, `${h._uid}-${o.key}`))
1082
+ ] }, h._uid)),
1083
+ g.length === 0 && /* @__PURE__ */ a("tr", { className: "empty-row", children: /* @__PURE__ */ a("td", { colSpan: 100, className: "text-center", children: x ? "Nenhum registro encontrado." : "Nenhum registro." }) })
1055
1084
  ] })
1056
1085
  ]
1057
1086
  }
@@ -1059,11 +1088,11 @@ const ut = ({
1059
1088
  ] });
1060
1089
  };
1061
1090
  export {
1062
- ot as Checkbox,
1091
+ it as Checkbox,
1063
1092
  lt as DatePicker,
1064
1093
  rt as Input,
1065
1094
  st as RadioBtn,
1066
- it as Select,
1095
+ ot as Select,
1067
1096
  ut as SimpleTable,
1068
1097
  ct as StatusBadge,
1069
1098
  dt as TextArea