@tech-diefra/fluig-ui 1.2.39 → 1.2.41
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/components/Attachment/index.d.ts +3 -2
- package/dist/fluig-ui.css +1 -1
- package/dist/index.cjs +12 -12
- package/dist/index.js +558 -548
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useFormContext as
|
|
1
|
+
import { jsxs as N, jsx as r, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { memo as z, useMemo as B, useCallback as C, useState as L, useRef as G, useEffect as E, forwardRef as se, createElement as Z } from "react";
|
|
3
|
+
import { useFormContext as H, useController as X, useFormState as de } from "react-hook-form";
|
|
4
4
|
import { IMaskInput as le } from "react-imask";
|
|
5
|
-
import { useSection as
|
|
6
|
-
import { parse as ue, isValid as me, eachDayOfInterval as he, endOfWeek as fe, endOfMonth as pe, startOfWeek as
|
|
5
|
+
import { useSection as F, useFluigRuntime as I } from "@fluig-kit/ecm";
|
|
6
|
+
import { parse as ue, isValid as me, eachDayOfInterval as he, endOfWeek as fe, endOfMonth as pe, startOfWeek as ye, startOfMonth as ve, subMonths as ge, format as K, addMonths as be, isSameMonth as we, isSameDay as Ne, isToday as ke } from "date-fns";
|
|
7
7
|
const xe = {
|
|
8
8
|
cpf: "000.000.000-00",
|
|
9
9
|
cnpj: "00.000.000/0000-00",
|
|
@@ -14,45 +14,48 @@ function Re({
|
|
|
14
14
|
name: e,
|
|
15
15
|
label: t = "",
|
|
16
16
|
placeholder: n = "",
|
|
17
|
-
type:
|
|
18
|
-
mask:
|
|
19
|
-
className:
|
|
20
|
-
forceReadOnly:
|
|
21
|
-
forceHidden:
|
|
22
|
-
valueManual:
|
|
17
|
+
type: i = "text",
|
|
18
|
+
mask: s,
|
|
19
|
+
className: d = "",
|
|
20
|
+
forceReadOnly: l = !1,
|
|
21
|
+
forceHidden: o = !1,
|
|
22
|
+
valueManual: v,
|
|
23
23
|
onChangeManual: a,
|
|
24
|
-
errorManual:
|
|
24
|
+
errorManual: p
|
|
25
25
|
}) {
|
|
26
|
-
var
|
|
27
|
-
const g =
|
|
28
|
-
let
|
|
26
|
+
var S, O;
|
|
27
|
+
const g = v !== void 0 && !!a, { isReadOnly: $, isHidden: V } = F(), A = l || !!$(e), _ = o || !!V(e), { isView: W } = I();
|
|
28
|
+
let w = null;
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
w = H();
|
|
31
31
|
} catch {
|
|
32
32
|
}
|
|
33
|
-
const
|
|
34
|
-
() =>
|
|
35
|
-
[
|
|
36
|
-
), y =
|
|
37
|
-
if (!
|
|
38
|
-
const
|
|
39
|
-
return (Number(
|
|
33
|
+
const f = !g && w ? X({ name: e, control: w.control }) : null, u = !g && w ? de({ name: e }) : null, m = g ? v : f == null ? void 0 : f.field.value, c = g ? p : (O = (S = u == null ? void 0 : u.errors) == null ? void 0 : S[e]) == null ? void 0 : O.message, h = B(
|
|
34
|
+
() => s ? xe[s] ?? s : null,
|
|
35
|
+
[s]
|
|
36
|
+
), y = C((b) => {
|
|
37
|
+
if (!b) return "";
|
|
38
|
+
const T = b.replace(/\D/g, "");
|
|
39
|
+
return (Number(T) / 100).toLocaleString("pt-BR", {
|
|
40
40
|
style: "currency",
|
|
41
41
|
currency: "BRL"
|
|
42
42
|
});
|
|
43
|
-
}, []),
|
|
44
|
-
(
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
const
|
|
48
|
-
g ? a == null || a(
|
|
49
|
-
},
|
|
50
|
-
g ||
|
|
43
|
+
}, []), x = C(
|
|
44
|
+
(b) => i === "monetary" ? y(b) : b,
|
|
45
|
+
[i, y]
|
|
46
|
+
), D = (b) => {
|
|
47
|
+
const T = x(b);
|
|
48
|
+
g ? a == null || a(T) : f == null || f.field.onChange(T);
|
|
49
|
+
}, R = () => {
|
|
50
|
+
g || f == null || f.field.onBlur();
|
|
51
51
|
};
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
if (W)
|
|
53
|
+
return /* @__PURE__ */ N("div", { className: "form-group", children: [
|
|
54
|
+
/* @__PURE__ */ r("label", { children: t }),
|
|
55
|
+
/* @__PURE__ */ r("span", { className: "form-control", children: m || "-" })
|
|
56
|
+
] });
|
|
57
|
+
const k = `form-control ${A ? "readOnly" : ""} ${c ? "border-red" : ""} ${d}`;
|
|
58
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
|
|
56
59
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
57
60
|
h ? /* @__PURE__ */ r(
|
|
58
61
|
le,
|
|
@@ -61,12 +64,12 @@ function Re({
|
|
|
61
64
|
mask: h,
|
|
62
65
|
value: String(m ?? ""),
|
|
63
66
|
unmask: !1,
|
|
64
|
-
onAccept: (
|
|
67
|
+
onAccept: (b) => D(b),
|
|
65
68
|
placeholder: n,
|
|
66
|
-
readOnly:
|
|
67
|
-
className:
|
|
68
|
-
inputRef: g ||
|
|
69
|
-
onBlur:
|
|
69
|
+
readOnly: A,
|
|
70
|
+
className: k,
|
|
71
|
+
inputRef: g || f == null ? void 0 : f.field.ref,
|
|
72
|
+
onBlur: R
|
|
70
73
|
}
|
|
71
74
|
) : /* @__PURE__ */ r(
|
|
72
75
|
"input",
|
|
@@ -74,347 +77,350 @@ function Re({
|
|
|
74
77
|
type: "text",
|
|
75
78
|
name: e,
|
|
76
79
|
value: m ?? "",
|
|
77
|
-
onChange: (
|
|
78
|
-
onBlur:
|
|
80
|
+
onChange: (b) => D(b.target.value),
|
|
81
|
+
onBlur: R,
|
|
79
82
|
placeholder: n,
|
|
80
|
-
readOnly:
|
|
81
|
-
className:
|
|
83
|
+
readOnly: A,
|
|
84
|
+
className: k
|
|
82
85
|
}
|
|
83
86
|
),
|
|
84
|
-
|
|
87
|
+
c && /* @__PURE__ */ r("p", { className: "text-danger", children: String(c) })
|
|
85
88
|
] });
|
|
86
89
|
}
|
|
87
|
-
const
|
|
90
|
+
const Dt = z(Re);
|
|
88
91
|
function Se({
|
|
89
92
|
name: e,
|
|
90
93
|
label: t = "",
|
|
91
94
|
options: n = [],
|
|
92
|
-
placeholder:
|
|
93
|
-
labelKey:
|
|
94
|
-
valueKey:
|
|
95
|
-
enableSearch:
|
|
96
|
-
searchPlaceholder:
|
|
97
|
-
loading:
|
|
95
|
+
placeholder: i = "",
|
|
96
|
+
labelKey: s = "label",
|
|
97
|
+
valueKey: d = "value",
|
|
98
|
+
enableSearch: l = !1,
|
|
99
|
+
searchPlaceholder: o = "Buscar...",
|
|
100
|
+
loading: v = !1,
|
|
98
101
|
onSearchChange: a,
|
|
99
|
-
debounceTime:
|
|
102
|
+
debounceTime: p = 300,
|
|
100
103
|
onSelect: g,
|
|
101
|
-
forceReadOnly:
|
|
102
|
-
forceHidden:
|
|
103
|
-
valueManual:
|
|
104
|
-
onChangeManual:
|
|
105
|
-
errorManual:
|
|
104
|
+
forceReadOnly: $ = !1,
|
|
105
|
+
forceHidden: V = !1,
|
|
106
|
+
valueManual: A,
|
|
107
|
+
onChangeManual: _,
|
|
108
|
+
errorManual: W
|
|
106
109
|
}) {
|
|
107
110
|
var ne;
|
|
108
|
-
const
|
|
109
|
-
let y = "",
|
|
110
|
-
},
|
|
111
|
+
const w = A !== void 0 && !!_, { isReadOnly: f, isHidden: u } = F(), m = $ || !!f(e), c = V || !!u(e), { isView: h } = I();
|
|
112
|
+
let y = "", x = () => {
|
|
113
|
+
}, D, R = null, k = () => {
|
|
111
114
|
};
|
|
112
|
-
if (
|
|
113
|
-
y =
|
|
115
|
+
if (w)
|
|
116
|
+
y = A;
|
|
114
117
|
else
|
|
115
118
|
try {
|
|
116
|
-
const
|
|
117
|
-
y =
|
|
119
|
+
const P = H(), j = X({ name: e, control: P.control });
|
|
120
|
+
y = j.field.value, x = j.field.onChange, D = j.field.ref, R = (ne = j.fieldState) == null ? void 0 : ne.error, k = P.clearErrors;
|
|
118
121
|
} catch {
|
|
119
122
|
}
|
|
120
|
-
const [
|
|
121
|
-
|
|
123
|
+
const [S, O] = L(!1), [b, T] = L(""), q = G(null), U = G(a);
|
|
124
|
+
E(() => {
|
|
122
125
|
U.current = a;
|
|
123
|
-
}, [a]),
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
+
}, [a]), E(() => {
|
|
127
|
+
const P = (j) => {
|
|
128
|
+
q.current && !q.current.contains(j.target) && O(!1);
|
|
126
129
|
};
|
|
127
|
-
return document.addEventListener("mousedown",
|
|
128
|
-
}, []),
|
|
129
|
-
|
|
130
|
-
}, [
|
|
131
|
-
if (!
|
|
132
|
-
const
|
|
133
|
-
var
|
|
134
|
-
(
|
|
135
|
-
},
|
|
136
|
-
return () => clearTimeout(
|
|
137
|
-
}, [
|
|
138
|
-
const ee =
|
|
139
|
-
(
|
|
140
|
-
) : n ?? [], [n,
|
|
130
|
+
return document.addEventListener("mousedown", P), () => document.removeEventListener("mousedown", P);
|
|
131
|
+
}, []), E(() => {
|
|
132
|
+
S || T("");
|
|
133
|
+
}, [S]), E(() => {
|
|
134
|
+
if (!l) return;
|
|
135
|
+
const P = setTimeout(() => {
|
|
136
|
+
var j;
|
|
137
|
+
(j = U.current) == null || j.call(U, b);
|
|
138
|
+
}, p);
|
|
139
|
+
return () => clearTimeout(P);
|
|
140
|
+
}, [b, l, p]);
|
|
141
|
+
const ee = B(() => l && !a && b.trim() ? n.filter(
|
|
142
|
+
(P) => String((P == null ? void 0 : P[s]) ?? "").toLowerCase().includes(b.toLowerCase())
|
|
143
|
+
) : n ?? [], [n, l, a, b, s]), te = B(() => {
|
|
141
144
|
if (y == null) return "";
|
|
142
145
|
if (typeof y == "object")
|
|
143
|
-
return String(y[
|
|
144
|
-
const
|
|
145
|
-
(
|
|
146
|
+
return String(y[d] ?? "");
|
|
147
|
+
const P = (n || []).find(
|
|
148
|
+
(j) => String(j == null ? void 0 : j[d]) === String(y)
|
|
146
149
|
);
|
|
147
|
-
return String(
|
|
148
|
-
}, [y, n,
|
|
149
|
-
m || (
|
|
150
|
+
return String(P ? (P == null ? void 0 : P[s]) ?? "" : y);
|
|
151
|
+
}, [y, n, d, s]), oe = (P) => {
|
|
152
|
+
m || (w ? _ == null || _(P[d]) : (x(P[d]), k == null || k(e)), g == null || g(P), O(!1));
|
|
150
153
|
};
|
|
151
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ N(
|
|
152
155
|
"div",
|
|
153
156
|
{
|
|
154
|
-
className: `select-wrapper form-group ${
|
|
155
|
-
ref:
|
|
157
|
+
className: `select-wrapper form-group ${c ? "hidden" : ""}`,
|
|
158
|
+
ref: q,
|
|
156
159
|
children: [
|
|
157
160
|
/* @__PURE__ */ r("label", { className: "control-label", children: t }),
|
|
158
|
-
h ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */
|
|
159
|
-
/* @__PURE__ */
|
|
161
|
+
h ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */ N(ce, { children: [
|
|
162
|
+
/* @__PURE__ */ N(
|
|
160
163
|
"div",
|
|
161
164
|
{
|
|
162
|
-
className: `select-control ${
|
|
163
|
-
onClick: () => !m &&
|
|
164
|
-
ref:
|
|
165
|
+
className: `select-control ${R ? "border-red" : ""} ${m ? "readOnly" : ""}`,
|
|
166
|
+
onClick: () => !m && O((P) => !P),
|
|
167
|
+
ref: D,
|
|
165
168
|
children: [
|
|
166
|
-
/* @__PURE__ */ r("span", { className: `select-display ${m ? "readOnly" : ""}`, children: te ||
|
|
169
|
+
/* @__PURE__ */ r("span", { className: `select-display ${m ? "readOnly" : ""}`, children: te || i }),
|
|
167
170
|
/* @__PURE__ */ r("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
168
171
|
]
|
|
169
172
|
}
|
|
170
173
|
),
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
S && !m && /* @__PURE__ */ N("div", { className: "select-dropdown", children: [
|
|
175
|
+
l && /* @__PURE__ */ r("div", { className: "select-search", children: /* @__PURE__ */ r(
|
|
173
176
|
"input",
|
|
174
177
|
{
|
|
175
178
|
type: "text",
|
|
176
179
|
className: "select-search-input",
|
|
177
|
-
value:
|
|
178
|
-
onChange: (
|
|
179
|
-
placeholder:
|
|
180
|
+
value: b,
|
|
181
|
+
onChange: (P) => T(P.target.value),
|
|
182
|
+
placeholder: v ? "Carregando..." : o,
|
|
180
183
|
autoFocus: !0,
|
|
181
|
-
onClick: (
|
|
184
|
+
onClick: (P) => P.stopPropagation()
|
|
182
185
|
}
|
|
183
186
|
) }),
|
|
184
|
-
/* @__PURE__ */ r("ul", { className: "select-options", children:
|
|
187
|
+
/* @__PURE__ */ r("ul", { className: "select-options", children: v ? /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map((P) => /* @__PURE__ */ r(
|
|
185
188
|
"li",
|
|
186
189
|
{
|
|
187
|
-
onClick: () => oe(
|
|
190
|
+
onClick: () => oe(P),
|
|
188
191
|
className: "select-option handleHover",
|
|
189
|
-
children:
|
|
192
|
+
children: P[s]
|
|
190
193
|
},
|
|
191
|
-
|
|
194
|
+
P[d]
|
|
192
195
|
)) : /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
193
196
|
] })
|
|
194
197
|
] }),
|
|
195
|
-
!
|
|
196
|
-
(
|
|
198
|
+
!w && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: y || "" }),
|
|
199
|
+
(R || W) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((R == null ? void 0 : R.message) ?? W) })
|
|
197
200
|
]
|
|
198
201
|
}
|
|
199
202
|
);
|
|
200
203
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
204
|
+
const Vt = z(Se);
|
|
205
|
+
function Tt({
|
|
203
206
|
name: e,
|
|
204
207
|
options: t = [],
|
|
205
208
|
label: n = "",
|
|
206
|
-
valueKey:
|
|
207
|
-
labelKey:
|
|
208
|
-
forceReadOnly:
|
|
209
|
-
forceHidden:
|
|
210
|
-
valueManual:
|
|
211
|
-
onChangeManual:
|
|
209
|
+
valueKey: i = "value",
|
|
210
|
+
labelKey: s = "label",
|
|
211
|
+
forceReadOnly: d = !1,
|
|
212
|
+
forceHidden: l = !1,
|
|
213
|
+
valueManual: o,
|
|
214
|
+
onChangeManual: v
|
|
212
215
|
}) {
|
|
213
|
-
var
|
|
216
|
+
var D, R;
|
|
214
217
|
let a = null;
|
|
215
218
|
try {
|
|
216
|
-
a =
|
|
219
|
+
a = H();
|
|
217
220
|
} catch {
|
|
218
221
|
}
|
|
219
|
-
const
|
|
220
|
-
(
|
|
221
|
-
const
|
|
222
|
-
if (
|
|
223
|
-
|
|
222
|
+
const p = o !== void 0 && !!v, { isView: g, isReadOnly: $ } = I(), { isReadOnly: V, isHidden: A } = F(), _ = V ? V(e) : !1, W = A ? A(e) : !1, w = d || _, f = l || W, u = w || $ || g, m = () => t ? t.reduce(
|
|
223
|
+
(k, S) => {
|
|
224
|
+
const O = String(S[i]);
|
|
225
|
+
if (p)
|
|
226
|
+
k[O] = !!(o != null && o[O]);
|
|
224
227
|
else if (a) {
|
|
225
|
-
const
|
|
226
|
-
|
|
228
|
+
const b = a.getValues(O);
|
|
229
|
+
k[O] = b === "on";
|
|
227
230
|
} else
|
|
228
|
-
|
|
229
|
-
return
|
|
231
|
+
k[O] = !1;
|
|
232
|
+
return k;
|
|
230
233
|
},
|
|
231
234
|
{}
|
|
232
|
-
) : {},
|
|
233
|
-
|
|
234
|
-
if (
|
|
235
|
-
const
|
|
236
|
-
(
|
|
235
|
+
) : {}, c = !p && a ? a.watch(e) : void 0, h = B(() => p && o ? o : c && typeof c == "object" ? c : m(), [c, o, t]);
|
|
236
|
+
E(() => {
|
|
237
|
+
if (p || !a) return;
|
|
238
|
+
const k = a.getValues(e);
|
|
239
|
+
(!k || typeof k != "object") && a.setValue(e, h, {
|
|
237
240
|
shouldDirty: !1,
|
|
238
241
|
shouldValidate: !1
|
|
239
242
|
});
|
|
240
|
-
}, [h, e, a,
|
|
241
|
-
const y = (
|
|
243
|
+
}, [h, e, a, p]);
|
|
244
|
+
const y = (k, S) => {
|
|
242
245
|
if (u) return;
|
|
243
|
-
const
|
|
244
|
-
if (
|
|
245
|
-
|
|
246
|
+
const O = { ...h, [k]: S };
|
|
247
|
+
if (p) {
|
|
248
|
+
v && v(O);
|
|
246
249
|
return;
|
|
247
250
|
}
|
|
248
|
-
a && (a.setValue(e,
|
|
251
|
+
a && (a.setValue(e, O, {
|
|
249
252
|
shouldDirty: !0,
|
|
250
253
|
shouldValidate: !0
|
|
251
|
-
}), a.setValue(
|
|
252
|
-
},
|
|
253
|
-
return /* @__PURE__ */
|
|
254
|
+
}), a.setValue(k, S ? "on" : "", { shouldValidate: !1 }));
|
|
255
|
+
}, x = p ? null : (R = (D = a == null ? void 0 : a.formState) == null ? void 0 : D.errors) == null ? void 0 : R[e];
|
|
256
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
|
|
254
257
|
n && /* @__PURE__ */ r("label", { children: n }),
|
|
255
258
|
/* @__PURE__ */ r(
|
|
256
259
|
"div",
|
|
257
260
|
{
|
|
258
261
|
className: `checkbox-group-custom ${u ? "readOnly" : ""}`,
|
|
259
|
-
children: t.map((
|
|
260
|
-
const
|
|
261
|
-
return /* @__PURE__ */
|
|
262
|
-
!
|
|
263
|
-
/* @__PURE__ */
|
|
262
|
+
children: t.map((k) => {
|
|
263
|
+
const S = String(k[i]), O = h[S] === !0;
|
|
264
|
+
return /* @__PURE__ */ N("div", { children: [
|
|
265
|
+
!p && a && /* @__PURE__ */ r("input", { type: "hidden", ...a.register(S) }),
|
|
266
|
+
/* @__PURE__ */ N(
|
|
264
267
|
"label",
|
|
265
268
|
{
|
|
266
|
-
className: `custom-checkbox ${
|
|
269
|
+
className: `custom-checkbox ${O ? "checked" : ""} ${u ? "readOnly" : ""}`,
|
|
267
270
|
children: [
|
|
268
271
|
/* @__PURE__ */ r(
|
|
269
272
|
"input",
|
|
270
273
|
{
|
|
271
274
|
type: "checkbox",
|
|
272
|
-
checked:
|
|
275
|
+
checked: O,
|
|
273
276
|
disabled: u,
|
|
274
|
-
onChange: (
|
|
277
|
+
onChange: (b) => y(S, b.target.checked)
|
|
275
278
|
}
|
|
276
279
|
),
|
|
277
280
|
/* @__PURE__ */ r("span", { className: "checkmark" }),
|
|
278
|
-
/* @__PURE__ */ r("span", { children:
|
|
281
|
+
/* @__PURE__ */ r("span", { children: k[s] })
|
|
279
282
|
]
|
|
280
283
|
}
|
|
281
284
|
)
|
|
282
|
-
] },
|
|
285
|
+
] }, S);
|
|
283
286
|
})
|
|
284
287
|
}
|
|
285
288
|
),
|
|
286
|
-
|
|
289
|
+
x && /* @__PURE__ */ r("p", { className: "text-danger", children: String(x.message) })
|
|
287
290
|
] });
|
|
288
291
|
}
|
|
289
292
|
function Pe({
|
|
290
293
|
name: e,
|
|
291
294
|
label: t = "",
|
|
292
295
|
options: n = [],
|
|
293
|
-
valueKey:
|
|
294
|
-
labelKey:
|
|
295
|
-
iconKey:
|
|
296
|
-
forceReadOnly:
|
|
297
|
-
forceHidden:
|
|
298
|
-
valueManual:
|
|
296
|
+
valueKey: i = "value",
|
|
297
|
+
labelKey: s = "label",
|
|
298
|
+
iconKey: d = "icon",
|
|
299
|
+
forceReadOnly: l = !1,
|
|
300
|
+
forceHidden: o = !1,
|
|
301
|
+
valueManual: v,
|
|
299
302
|
onChangeManual: a,
|
|
300
|
-
errorManual:
|
|
303
|
+
errorManual: p
|
|
301
304
|
}) {
|
|
302
305
|
var y;
|
|
303
|
-
const g =
|
|
304
|
-
let
|
|
306
|
+
const g = v !== void 0 && !!a, { isReadOnly: $, isHidden: V } = F(), A = l || !!$(e), _ = o || !!V(e), { isView: W, isReadOnly: w } = I();
|
|
307
|
+
let f = null, u = null;
|
|
305
308
|
if (!g)
|
|
306
309
|
try {
|
|
307
|
-
const { control:
|
|
308
|
-
|
|
310
|
+
const { control: x } = H(), D = X({ name: e, control: x });
|
|
311
|
+
f = D.field, u = (y = D.fieldState) == null ? void 0 : y.error;
|
|
309
312
|
} catch {
|
|
310
313
|
}
|
|
311
|
-
const m =
|
|
312
|
-
(
|
|
313
|
-
m || (g ? a == null || a(
|
|
314
|
+
const m = A || w || W, c = g ? v : (f == null ? void 0 : f.value) ?? "", h = C(
|
|
315
|
+
(x) => {
|
|
316
|
+
m || (g ? a == null || a(x) : f == null || f.onChange(x));
|
|
314
317
|
},
|
|
315
|
-
[m, g, a,
|
|
318
|
+
[m, g, a, f]
|
|
316
319
|
);
|
|
317
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ N("div", { className: `form-group column ${_ ? "hidden" : ""}`, children: [
|
|
318
321
|
t && /* @__PURE__ */ r("label", { className: "control-label", children: t }),
|
|
319
322
|
/* @__PURE__ */ r(
|
|
320
323
|
"div",
|
|
321
324
|
{
|
|
322
325
|
className: `btn-group ${m ? "view-mode" : ""}`,
|
|
323
326
|
"data-field-name": e,
|
|
324
|
-
children: n.map((
|
|
325
|
-
const
|
|
326
|
-
return /* @__PURE__ */
|
|
327
|
+
children: n.map((x) => {
|
|
328
|
+
const D = x[i], R = c === D, k = x.color ? { "--customColor": x.color } : void 0;
|
|
329
|
+
return /* @__PURE__ */ N(
|
|
327
330
|
"label",
|
|
328
331
|
{
|
|
329
|
-
htmlFor: `${e}_${
|
|
330
|
-
style:
|
|
331
|
-
className: `btn fs-ellipsis ${
|
|
332
|
+
htmlFor: `${e}_${D}`,
|
|
333
|
+
style: k,
|
|
334
|
+
className: `btn fs-ellipsis ${R ? "active" : ""}`,
|
|
332
335
|
children: [
|
|
333
336
|
/* @__PURE__ */ r(
|
|
334
337
|
"input",
|
|
335
338
|
{
|
|
336
339
|
type: "radio",
|
|
337
|
-
id: `${e}_${
|
|
340
|
+
id: `${e}_${D}`,
|
|
338
341
|
name: e,
|
|
339
|
-
value:
|
|
340
|
-
checked:
|
|
342
|
+
value: D,
|
|
343
|
+
checked: R,
|
|
341
344
|
className: "hidden",
|
|
342
|
-
onChange: () => h(
|
|
345
|
+
onChange: () => h(D),
|
|
343
346
|
disabled: m
|
|
344
347
|
}
|
|
345
348
|
),
|
|
346
|
-
|
|
349
|
+
x[d] && /* @__PURE__ */ r("i", { className: `${x[d]} icon-sm` }),
|
|
347
350
|
" ",
|
|
348
|
-
|
|
351
|
+
x[s]
|
|
349
352
|
]
|
|
350
353
|
},
|
|
351
|
-
|
|
354
|
+
D
|
|
352
355
|
);
|
|
353
356
|
})
|
|
354
357
|
}
|
|
355
358
|
),
|
|
356
|
-
(u ||
|
|
359
|
+
(u || p) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? p) })
|
|
357
360
|
] });
|
|
358
361
|
}
|
|
359
|
-
const
|
|
362
|
+
const jt = z(Pe), $e = ({
|
|
360
363
|
name: e,
|
|
361
364
|
label: t = "",
|
|
362
365
|
placeholder: n = "",
|
|
363
|
-
className:
|
|
364
|
-
rows:
|
|
365
|
-
maxLength:
|
|
366
|
-
forceReadOnly:
|
|
367
|
-
forceHidden:
|
|
368
|
-
valueManual:
|
|
366
|
+
className: i = "",
|
|
367
|
+
rows: s = 4,
|
|
368
|
+
maxLength: d,
|
|
369
|
+
forceReadOnly: l = !1,
|
|
370
|
+
forceHidden: o = !1,
|
|
371
|
+
valueManual: v,
|
|
369
372
|
onChangeManual: a,
|
|
370
|
-
errorManual:
|
|
373
|
+
errorManual: p
|
|
371
374
|
}) => {
|
|
372
|
-
var
|
|
373
|
-
const g =
|
|
374
|
-
let
|
|
375
|
-
value:
|
|
376
|
-
onChange: (
|
|
375
|
+
var h;
|
|
376
|
+
const g = v !== void 0 && !!a, { isReadOnly: $, isHidden: V } = F(), A = l || !!$(e), _ = o || !!V(e), { isView: W } = I(), w = G(null);
|
|
377
|
+
let f = {
|
|
378
|
+
value: v ?? "",
|
|
379
|
+
onChange: (y) => a == null ? void 0 : a(y)
|
|
377
380
|
}, u = null;
|
|
378
381
|
if (!g)
|
|
379
382
|
try {
|
|
380
|
-
const { control:
|
|
381
|
-
|
|
383
|
+
const { control: y } = H(), x = X({ name: e, control: y });
|
|
384
|
+
f = x.field, u = (h = x.fieldState) == null ? void 0 : h.error;
|
|
382
385
|
} catch {
|
|
383
386
|
}
|
|
384
387
|
const m = () => {
|
|
385
|
-
|
|
388
|
+
w.current && (w.current.style.height = "auto", w.current.style.height = `${w.current.scrollHeight}px`);
|
|
386
389
|
};
|
|
387
|
-
|
|
390
|
+
if (E(() => {
|
|
388
391
|
m();
|
|
389
|
-
}, [
|
|
390
|
-
/* @__PURE__ */
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
392
|
+
}, [f.value]), W)
|
|
393
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
|
|
394
|
+
/* @__PURE__ */ r("label", { children: t }),
|
|
395
|
+
/* @__PURE__ */ r("span", { className: "form-control", children: f.value || "-" })
|
|
396
|
+
] });
|
|
397
|
+
const c = `form-control ${A ? "readOnly" : ""} ${u || p ? "border-red" : ""} ${i}`;
|
|
398
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
|
|
399
|
+
t && /* @__PURE__ */ r("label", { children: t }),
|
|
394
400
|
/* @__PURE__ */ r(
|
|
395
401
|
"textarea",
|
|
396
402
|
{
|
|
397
|
-
ref:
|
|
398
|
-
rows:
|
|
399
|
-
maxLength:
|
|
400
|
-
value:
|
|
403
|
+
ref: w,
|
|
404
|
+
rows: s,
|
|
405
|
+
maxLength: d,
|
|
406
|
+
value: f.value || "",
|
|
401
407
|
placeholder: n,
|
|
402
|
-
readOnly:
|
|
403
|
-
className:
|
|
408
|
+
readOnly: A,
|
|
409
|
+
className: c,
|
|
404
410
|
style: {
|
|
405
411
|
resize: "none",
|
|
406
412
|
maxHeight: "400px",
|
|
407
413
|
overflowY: "auto"
|
|
408
414
|
},
|
|
409
|
-
onChange: (
|
|
410
|
-
g ? a == null || a(
|
|
415
|
+
onChange: (y) => {
|
|
416
|
+
g ? a == null || a(y.target.value) : f.onChange(y);
|
|
411
417
|
},
|
|
412
418
|
onInput: m
|
|
413
419
|
}
|
|
414
420
|
),
|
|
415
|
-
(u ||
|
|
421
|
+
(u || p) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? p) })
|
|
416
422
|
] });
|
|
417
|
-
},
|
|
423
|
+
}, Ct = z($e);
|
|
418
424
|
function J(e) {
|
|
419
425
|
return (t = {}) => {
|
|
420
426
|
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
@@ -423,35 +429,35 @@ function J(e) {
|
|
|
423
429
|
}
|
|
424
430
|
function Q(e) {
|
|
425
431
|
return (t, n) => {
|
|
426
|
-
const
|
|
427
|
-
let
|
|
428
|
-
if (
|
|
429
|
-
const
|
|
430
|
-
|
|
432
|
+
const i = n != null && n.context ? String(n.context) : "standalone";
|
|
433
|
+
let s;
|
|
434
|
+
if (i === "formatting" && e.formattingValues) {
|
|
435
|
+
const l = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : l;
|
|
436
|
+
s = e.formattingValues[o] || e.formattingValues[l];
|
|
431
437
|
} else {
|
|
432
|
-
const
|
|
433
|
-
|
|
438
|
+
const l = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
439
|
+
s = e.values[o] || e.values[l];
|
|
434
440
|
}
|
|
435
|
-
const
|
|
436
|
-
return
|
|
441
|
+
const d = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
442
|
+
return s[d];
|
|
437
443
|
};
|
|
438
444
|
}
|
|
439
445
|
function Y(e) {
|
|
440
446
|
return (t, n = {}) => {
|
|
441
|
-
const
|
|
442
|
-
if (!
|
|
447
|
+
const i = n.width, s = i && e.matchPatterns[i] || e.matchPatterns[e.defaultMatchWidth], d = t.match(s);
|
|
448
|
+
if (!d)
|
|
443
449
|
return null;
|
|
444
|
-
const
|
|
450
|
+
const l = d[0], o = i && e.parsePatterns[i] || e.parsePatterns[e.defaultParseWidth], v = Array.isArray(o) ? Oe(o, (g) => g.test(l)) : (
|
|
445
451
|
// [TODO] -- I challenge you to fix the type
|
|
446
|
-
_e(
|
|
452
|
+
_e(o, (g) => g.test(l))
|
|
447
453
|
);
|
|
448
454
|
let a;
|
|
449
|
-
a = e.valueCallback ? e.valueCallback(
|
|
455
|
+
a = e.valueCallback ? e.valueCallback(v) : v, a = n.valueCallback ? (
|
|
450
456
|
// [TODO] -- I challenge you to fix the type
|
|
451
457
|
n.valueCallback(a)
|
|
452
458
|
) : a;
|
|
453
|
-
const
|
|
454
|
-
return { value: a, rest:
|
|
459
|
+
const p = t.slice(l.length);
|
|
460
|
+
return { value: a, rest: p };
|
|
455
461
|
};
|
|
456
462
|
}
|
|
457
463
|
function _e(e, t) {
|
|
@@ -459,24 +465,24 @@ function _e(e, t) {
|
|
|
459
465
|
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
460
466
|
return n;
|
|
461
467
|
}
|
|
462
|
-
function
|
|
468
|
+
function Oe(e, t) {
|
|
463
469
|
for (let n = 0; n < e.length; n++)
|
|
464
470
|
if (t(e[n]))
|
|
465
471
|
return n;
|
|
466
472
|
}
|
|
467
473
|
function Ae(e) {
|
|
468
474
|
return (t, n = {}) => {
|
|
469
|
-
const
|
|
470
|
-
if (!
|
|
471
|
-
const
|
|
472
|
-
if (!
|
|
473
|
-
let
|
|
474
|
-
|
|
475
|
-
const
|
|
476
|
-
return { value:
|
|
475
|
+
const i = t.match(e.matchPattern);
|
|
476
|
+
if (!i) return null;
|
|
477
|
+
const s = i[0], d = t.match(e.parsePattern);
|
|
478
|
+
if (!d) return null;
|
|
479
|
+
let l = e.valueCallback ? e.valueCallback(d[0]) : d[0];
|
|
480
|
+
l = n.valueCallback ? n.valueCallback(l) : l;
|
|
481
|
+
const o = t.slice(s.length);
|
|
482
|
+
return { value: l, rest: o };
|
|
477
483
|
};
|
|
478
484
|
}
|
|
479
|
-
const
|
|
485
|
+
const We = {
|
|
480
486
|
lessThanXSeconds: {
|
|
481
487
|
one: "menos de um segundo",
|
|
482
488
|
other: "menos de {{count}} segundos"
|
|
@@ -538,36 +544,36 @@ const Oe = {
|
|
|
538
544
|
one: "quase 1 ano",
|
|
539
545
|
other: "quase {{count}} anos"
|
|
540
546
|
}
|
|
541
|
-
},
|
|
542
|
-
let
|
|
543
|
-
const
|
|
544
|
-
return typeof
|
|
545
|
-
},
|
|
547
|
+
}, De = (e, t, n) => {
|
|
548
|
+
let i;
|
|
549
|
+
const s = We[e];
|
|
550
|
+
return typeof s == "string" ? i = s : t === 1 ? i = s.one : i = s.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "em " + i : "há " + i : i;
|
|
551
|
+
}, Ve = {
|
|
546
552
|
full: "EEEE, d 'de' MMMM 'de' y",
|
|
547
553
|
long: "d 'de' MMMM 'de' y",
|
|
548
554
|
medium: "d MMM y",
|
|
549
555
|
short: "dd/MM/yyyy"
|
|
550
|
-
},
|
|
556
|
+
}, Te = {
|
|
551
557
|
full: "HH:mm:ss zzzz",
|
|
552
558
|
long: "HH:mm:ss z",
|
|
553
559
|
medium: "HH:mm:ss",
|
|
554
560
|
short: "HH:mm"
|
|
555
|
-
},
|
|
561
|
+
}, je = {
|
|
556
562
|
full: "{{date}} 'às' {{time}}",
|
|
557
563
|
long: "{{date}} 'às' {{time}}",
|
|
558
564
|
medium: "{{date}}, {{time}}",
|
|
559
565
|
short: "{{date}}, {{time}}"
|
|
560
|
-
},
|
|
566
|
+
}, Ce = {
|
|
561
567
|
date: J({
|
|
562
|
-
formats:
|
|
568
|
+
formats: Ve,
|
|
563
569
|
defaultWidth: "full"
|
|
564
570
|
}),
|
|
565
571
|
time: J({
|
|
566
|
-
formats:
|
|
572
|
+
formats: Te,
|
|
567
573
|
defaultWidth: "full"
|
|
568
574
|
}),
|
|
569
575
|
dateTime: J({
|
|
570
|
-
formats:
|
|
576
|
+
formats: je,
|
|
571
577
|
defaultWidth: "full"
|
|
572
578
|
})
|
|
573
579
|
}, Ee = {
|
|
@@ -580,10 +586,10 @@ const Oe = {
|
|
|
580
586
|
tomorrow: "'amanhã às' p",
|
|
581
587
|
nextWeek: "eeee 'às' p",
|
|
582
588
|
other: "P"
|
|
583
|
-
},
|
|
584
|
-
const
|
|
585
|
-
return typeof
|
|
586
|
-
},
|
|
589
|
+
}, He = (e, t, n, i) => {
|
|
590
|
+
const s = Ee[e];
|
|
591
|
+
return typeof s == "function" ? s(t) : s;
|
|
592
|
+
}, Ie = {
|
|
587
593
|
narrow: ["AC", "DC"],
|
|
588
594
|
abbreviated: ["AC", "DC"],
|
|
589
595
|
wide: ["antes de cristo", "depois de cristo"]
|
|
@@ -710,7 +716,7 @@ const Oe = {
|
|
|
710
716
|
}, Ue = {
|
|
711
717
|
ordinalNumber: Xe,
|
|
712
718
|
era: Q({
|
|
713
|
-
values:
|
|
719
|
+
values: Ie,
|
|
714
720
|
defaultWidth: "wide"
|
|
715
721
|
}),
|
|
716
722
|
quarter: Q({
|
|
@@ -743,9 +749,9 @@ const Oe = {
|
|
|
743
749
|
narrow: /^[1234]/i,
|
|
744
750
|
abbreviated: /^T[1234]/i,
|
|
745
751
|
wide: /^[1234](º)? trimestre/i
|
|
746
|
-
}, Me = {
|
|
747
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
748
752
|
}, Ke = {
|
|
753
|
+
any: [/1/i, /2/i, /3/i, /4/i]
|
|
754
|
+
}, Me = {
|
|
749
755
|
narrow: /^[jfmajsond]/i,
|
|
750
756
|
abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
|
|
751
757
|
wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
|
|
@@ -790,7 +796,7 @@ const Oe = {
|
|
|
790
796
|
}, rt = {
|
|
791
797
|
narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
|
|
792
798
|
any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
|
|
793
|
-
},
|
|
799
|
+
}, st = {
|
|
794
800
|
any: {
|
|
795
801
|
am: /^a/i,
|
|
796
802
|
pm: /^p/i,
|
|
@@ -816,12 +822,12 @@ const Oe = {
|
|
|
816
822
|
quarter: Y({
|
|
817
823
|
matchPatterns: Ze,
|
|
818
824
|
defaultMatchWidth: "wide",
|
|
819
|
-
parsePatterns:
|
|
825
|
+
parsePatterns: Ke,
|
|
820
826
|
defaultParseWidth: "any",
|
|
821
827
|
valueCallback: (e) => e + 1
|
|
822
828
|
}),
|
|
823
829
|
month: Y({
|
|
824
|
-
matchPatterns:
|
|
830
|
+
matchPatterns: Me,
|
|
825
831
|
defaultMatchWidth: "wide",
|
|
826
832
|
parsePatterns: et,
|
|
827
833
|
defaultParseWidth: "any"
|
|
@@ -835,14 +841,14 @@ const Oe = {
|
|
|
835
841
|
dayPeriod: Y({
|
|
836
842
|
matchPatterns: rt,
|
|
837
843
|
defaultMatchWidth: "any",
|
|
838
|
-
parsePatterns:
|
|
844
|
+
parsePatterns: st,
|
|
839
845
|
defaultParseWidth: "any"
|
|
840
846
|
})
|
|
841
|
-
},
|
|
847
|
+
}, at = {
|
|
842
848
|
code: "pt-BR",
|
|
843
|
-
formatDistance:
|
|
844
|
-
formatLong:
|
|
845
|
-
formatRelative:
|
|
849
|
+
formatDistance: De,
|
|
850
|
+
formatLong: Ce,
|
|
851
|
+
formatRelative: He,
|
|
846
852
|
localize: Ue,
|
|
847
853
|
match: it,
|
|
848
854
|
options: {
|
|
@@ -856,7 +862,7 @@ const Oe = {
|
|
|
856
862
|
* This source code is licensed under the ISC license.
|
|
857
863
|
* See the LICENSE file in the root directory of this source tree.
|
|
858
864
|
*/
|
|
859
|
-
const ie = (...e) => e.filter((t, n,
|
|
865
|
+
const ie = (...e) => e.filter((t, n, i) => !!t && t.trim() !== "" && i.indexOf(t) === n).join(" ").trim();
|
|
860
866
|
/**
|
|
861
867
|
* @license lucide-react v0.575.0 - ISC
|
|
862
868
|
*
|
|
@@ -872,7 +878,7 @@ const ot = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
|
872
878
|
*/
|
|
873
879
|
const ct = (e) => e.replace(
|
|
874
880
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
875
|
-
(t, n,
|
|
881
|
+
(t, n, i) => i ? i.toUpperCase() : n.toLowerCase()
|
|
876
882
|
);
|
|
877
883
|
/**
|
|
878
884
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -919,32 +925,32 @@ const lt = (e) => {
|
|
|
919
925
|
* This source code is licensed under the ISC license.
|
|
920
926
|
* See the LICENSE file in the root directory of this source tree.
|
|
921
927
|
*/
|
|
922
|
-
const ut =
|
|
928
|
+
const ut = se(
|
|
923
929
|
({
|
|
924
930
|
color: e = "currentColor",
|
|
925
931
|
size: t = 24,
|
|
926
932
|
strokeWidth: n = 2,
|
|
927
|
-
absoluteStrokeWidth:
|
|
928
|
-
className:
|
|
929
|
-
children:
|
|
930
|
-
iconNode:
|
|
931
|
-
...
|
|
932
|
-
},
|
|
933
|
+
absoluteStrokeWidth: i,
|
|
934
|
+
className: s = "",
|
|
935
|
+
children: d,
|
|
936
|
+
iconNode: l,
|
|
937
|
+
...o
|
|
938
|
+
}, v) => Z(
|
|
933
939
|
"svg",
|
|
934
940
|
{
|
|
935
|
-
ref:
|
|
941
|
+
ref: v,
|
|
936
942
|
...dt,
|
|
937
943
|
width: t,
|
|
938
944
|
height: t,
|
|
939
945
|
stroke: e,
|
|
940
|
-
strokeWidth:
|
|
941
|
-
className: ie("lucide",
|
|
942
|
-
...!
|
|
943
|
-
...
|
|
946
|
+
strokeWidth: i ? Number(n) * 24 / Number(t) : n,
|
|
947
|
+
className: ie("lucide", s),
|
|
948
|
+
...!d && !lt(o) && { "aria-hidden": "true" },
|
|
949
|
+
...o
|
|
944
950
|
},
|
|
945
951
|
[
|
|
946
|
-
...
|
|
947
|
-
...Array.isArray(
|
|
952
|
+
...l.map(([a, p]) => Z(a, p)),
|
|
953
|
+
...Array.isArray(d) ? d : [d]
|
|
948
954
|
]
|
|
949
955
|
)
|
|
950
956
|
);
|
|
@@ -954,17 +960,17 @@ const ut = ae(
|
|
|
954
960
|
* This source code is licensed under the ISC license.
|
|
955
961
|
* See the LICENSE file in the root directory of this source tree.
|
|
956
962
|
*/
|
|
957
|
-
const
|
|
958
|
-
const n =
|
|
959
|
-
({ className:
|
|
960
|
-
ref:
|
|
963
|
+
const M = (e, t) => {
|
|
964
|
+
const n = se(
|
|
965
|
+
({ className: i, ...s }, d) => Z(ut, {
|
|
966
|
+
ref: d,
|
|
961
967
|
iconNode: t,
|
|
962
968
|
className: ie(
|
|
963
969
|
`lucide-${ot(re(e))}`,
|
|
964
970
|
`lucide-${e}`,
|
|
965
|
-
|
|
971
|
+
i
|
|
966
972
|
),
|
|
967
|
-
...
|
|
973
|
+
...s
|
|
968
974
|
})
|
|
969
975
|
);
|
|
970
976
|
return n.displayName = re(e), n;
|
|
@@ -980,108 +986,108 @@ const mt = [
|
|
|
980
986
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
981
987
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
982
988
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
983
|
-
], ht =
|
|
989
|
+
], ht = M("calendar", mt);
|
|
984
990
|
/**
|
|
985
991
|
* @license lucide-react v0.575.0 - ISC
|
|
986
992
|
*
|
|
987
993
|
* This source code is licensed under the ISC license.
|
|
988
994
|
* See the LICENSE file in the root directory of this source tree.
|
|
989
995
|
*/
|
|
990
|
-
const ft = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], pt =
|
|
996
|
+
const ft = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], pt = M("chevron-left", ft);
|
|
991
997
|
/**
|
|
992
998
|
* @license lucide-react v0.575.0 - ISC
|
|
993
999
|
*
|
|
994
1000
|
* This source code is licensed under the ISC license.
|
|
995
1001
|
* See the LICENSE file in the root directory of this source tree.
|
|
996
1002
|
*/
|
|
997
|
-
const
|
|
998
|
-
function
|
|
1003
|
+
const yt = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], vt = M("chevron-right", yt);
|
|
1004
|
+
function gt(e) {
|
|
999
1005
|
const t = G(null);
|
|
1000
|
-
return
|
|
1001
|
-
function n(
|
|
1002
|
-
t.current && !t.current.contains(
|
|
1006
|
+
return E(() => {
|
|
1007
|
+
function n(i) {
|
|
1008
|
+
t.current && !t.current.contains(i.target) && e();
|
|
1003
1009
|
}
|
|
1004
1010
|
return document.addEventListener("mousedown", n), () => {
|
|
1005
1011
|
document.removeEventListener("mousedown", n);
|
|
1006
1012
|
};
|
|
1007
1013
|
}, [e]), t;
|
|
1008
1014
|
}
|
|
1009
|
-
const
|
|
1015
|
+
const ae = "dd/MM/yyyy", bt = (e) => {
|
|
1010
1016
|
if (!e) return null;
|
|
1011
|
-
const t = ue(e,
|
|
1017
|
+
const t = ue(e, ae, /* @__PURE__ */ new Date());
|
|
1012
1018
|
return me(t) ? t : null;
|
|
1013
|
-
}, wt = (e) => e ?
|
|
1019
|
+
}, wt = (e) => e ? K(e, ae) : "", Nt = ({
|
|
1014
1020
|
name: e,
|
|
1015
1021
|
label: t = "",
|
|
1016
1022
|
placeholder: n = "dd/mm/aaaa",
|
|
1017
|
-
className:
|
|
1018
|
-
forceReadOnly:
|
|
1019
|
-
forceHidden:
|
|
1020
|
-
valueManual:
|
|
1021
|
-
onChangeManual:
|
|
1022
|
-
errorManual:
|
|
1023
|
+
className: i = "",
|
|
1024
|
+
forceReadOnly: s = !1,
|
|
1025
|
+
forceHidden: d = !1,
|
|
1026
|
+
valueManual: l,
|
|
1027
|
+
onChangeManual: o,
|
|
1028
|
+
errorManual: v
|
|
1023
1029
|
}) => {
|
|
1024
|
-
var
|
|
1025
|
-
const [a,
|
|
1026
|
-
let
|
|
1030
|
+
var k;
|
|
1031
|
+
const [a, p] = L(!1), [g, $] = L(/* @__PURE__ */ new Date()), V = gt(() => p(!1)), A = l !== void 0 && !!o;
|
|
1032
|
+
let _ = null;
|
|
1027
1033
|
try {
|
|
1028
|
-
|
|
1034
|
+
_ = H();
|
|
1029
1035
|
} catch {
|
|
1030
1036
|
}
|
|
1031
|
-
const { isView:
|
|
1037
|
+
const { isView: W } = I(), { isReadOnly: w, isHidden: f } = F(), u = s || !!w(e), m = d || !!f(e), c = !A && _ ? X({ name: e, control: _.control }) : null, h = A ? l : c == null ? void 0 : c.field.value, y = A ? v : (k = c == null ? void 0 : c.fieldState.error) == null ? void 0 : k.message, x = B(() => bt(h), [h]), D = (S) => {
|
|
1032
1038
|
if (u) return;
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
},
|
|
1036
|
-
const
|
|
1037
|
-
start:
|
|
1038
|
-
end: fe(pe(
|
|
1039
|
+
const O = wt(S);
|
|
1040
|
+
A ? o == null || o(O) : c == null || c.field.onChange(O), p(!1);
|
|
1041
|
+
}, R = (S) => {
|
|
1042
|
+
const O = he({
|
|
1043
|
+
start: ye(ve(S)),
|
|
1044
|
+
end: fe(pe(S))
|
|
1039
1045
|
});
|
|
1040
|
-
return /* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ N("div", { className: "dfe-calendar-pane", children: [
|
|
1047
|
+
/* @__PURE__ */ N("div", { className: "dfe-calendar-header", children: [
|
|
1042
1048
|
/* @__PURE__ */ r(
|
|
1043
1049
|
"button",
|
|
1044
1050
|
{
|
|
1045
1051
|
type: "button",
|
|
1046
|
-
onClick: (
|
|
1047
|
-
|
|
1052
|
+
onClick: (b) => {
|
|
1053
|
+
b.stopPropagation(), $(ge(g, 1));
|
|
1048
1054
|
},
|
|
1049
1055
|
className: "dfe-nav-btn",
|
|
1050
1056
|
children: /* @__PURE__ */ r(pt, { size: 16 })
|
|
1051
1057
|
}
|
|
1052
1058
|
),
|
|
1053
|
-
/* @__PURE__ */ r("span", { className: "dfe-month-label", children:
|
|
1059
|
+
/* @__PURE__ */ r("span", { className: "dfe-month-label", children: K(S, "MMMM yyyy", { locale: at }) }),
|
|
1054
1060
|
/* @__PURE__ */ r(
|
|
1055
1061
|
"button",
|
|
1056
1062
|
{
|
|
1057
1063
|
type: "button",
|
|
1058
|
-
onClick: (
|
|
1059
|
-
|
|
1064
|
+
onClick: (b) => {
|
|
1065
|
+
b.stopPropagation(), $(be(g, 1));
|
|
1060
1066
|
},
|
|
1061
1067
|
className: "dfe-nav-btn",
|
|
1062
1068
|
children: /* @__PURE__ */ r(vt, { size: 16 })
|
|
1063
1069
|
}
|
|
1064
1070
|
)
|
|
1065
1071
|
] }),
|
|
1066
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((
|
|
1067
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children:
|
|
1068
|
-
const
|
|
1072
|
+
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b, T) => /* @__PURE__ */ r("span", { children: b }, T)) }),
|
|
1073
|
+
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children: O.map((b, T) => {
|
|
1074
|
+
const q = !we(b, S), U = x && Ne(b, x);
|
|
1069
1075
|
return /* @__PURE__ */ r(
|
|
1070
1076
|
"div",
|
|
1071
1077
|
{
|
|
1072
|
-
onClick: () => !
|
|
1078
|
+
onClick: () => !q && D(b),
|
|
1073
1079
|
className: `dfe-calendar-day
|
|
1074
1080
|
${U ? "selected" : ""}
|
|
1075
|
-
${
|
|
1076
|
-
${ke(
|
|
1077
|
-
children:
|
|
1081
|
+
${q ? "outside" : ""}
|
|
1082
|
+
${ke(b) ? "today" : ""}`,
|
|
1083
|
+
children: K(b, "d")
|
|
1078
1084
|
},
|
|
1079
|
-
|
|
1085
|
+
T
|
|
1080
1086
|
);
|
|
1081
1087
|
}) })
|
|
1082
1088
|
] });
|
|
1083
1089
|
};
|
|
1084
|
-
return m ? null :
|
|
1090
|
+
return m ? null : W ? /* @__PURE__ */ N("div", { className: `form-group ${i}`, children: [
|
|
1085
1091
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1086
1092
|
/* @__PURE__ */ r(
|
|
1087
1093
|
"span",
|
|
@@ -1091,19 +1097,19 @@ const se = "dd/MM/yyyy", bt = (e) => {
|
|
|
1091
1097
|
children: h || "-"
|
|
1092
1098
|
}
|
|
1093
1099
|
)
|
|
1094
|
-
] }) : /* @__PURE__ */
|
|
1100
|
+
] }) : /* @__PURE__ */ N(
|
|
1095
1101
|
"div",
|
|
1096
1102
|
{
|
|
1097
|
-
ref:
|
|
1098
|
-
className: `form-group dfe-datepicker-container ${
|
|
1103
|
+
ref: V,
|
|
1104
|
+
className: `form-group dfe-datepicker-container ${i}`,
|
|
1099
1105
|
style: { position: "relative" },
|
|
1100
1106
|
children: [
|
|
1101
1107
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1102
|
-
/* @__PURE__ */
|
|
1108
|
+
/* @__PURE__ */ N(
|
|
1103
1109
|
"div",
|
|
1104
1110
|
{
|
|
1105
1111
|
className: `form-control dfe-datepicker-trigger ${y ? "border-red" : ""} ${u ? "disabled" : ""}`,
|
|
1106
|
-
onClick: () => !u &&
|
|
1112
|
+
onClick: () => !u && p(!a),
|
|
1107
1113
|
style: {
|
|
1108
1114
|
display: "flex",
|
|
1109
1115
|
alignItems: "center",
|
|
@@ -1122,380 +1128,384 @@ const se = "dd/MM/yyyy", bt = (e) => {
|
|
|
1122
1128
|
]
|
|
1123
1129
|
}
|
|
1124
1130
|
),
|
|
1125
|
-
a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children:
|
|
1131
|
+
a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children: R(g) }) }),
|
|
1126
1132
|
y && /* @__PURE__ */ r("p", { className: "text-danger", children: String(y) })
|
|
1127
1133
|
]
|
|
1128
1134
|
}
|
|
1129
1135
|
);
|
|
1130
|
-
}, Et =
|
|
1136
|
+
}, Et = z(Nt);
|
|
1131
1137
|
function kt({
|
|
1132
1138
|
mapping: e = {},
|
|
1133
1139
|
defaultLabel: t = "Não reconhecido",
|
|
1134
1140
|
className: n = "",
|
|
1135
|
-
hidden:
|
|
1136
|
-
label:
|
|
1141
|
+
hidden: i = !1,
|
|
1142
|
+
label: s
|
|
1137
1143
|
}) {
|
|
1138
|
-
const { activityId:
|
|
1139
|
-
if (!
|
|
1140
|
-
return /* @__PURE__ */
|
|
1141
|
-
|
|
1144
|
+
const { activityId: d } = I(), l = B(() => !e || d === null || d === void 0 ? null : e[d], [d, e]);
|
|
1145
|
+
if (!l)
|
|
1146
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
|
|
1147
|
+
s && /* @__PURE__ */ r("label", { children: s }),
|
|
1142
1148
|
/* @__PURE__ */ r("div", { className: `status-badge default ${n}`, children: t })
|
|
1143
1149
|
] });
|
|
1144
|
-
const
|
|
1145
|
-
"--customColor":
|
|
1150
|
+
const o = {
|
|
1151
|
+
"--customColor": l.color
|
|
1146
1152
|
};
|
|
1147
|
-
return /* @__PURE__ */
|
|
1148
|
-
|
|
1149
|
-
/* @__PURE__ */
|
|
1150
|
-
|
|
1151
|
-
/* @__PURE__ */ r("span", { children:
|
|
1153
|
+
return /* @__PURE__ */ N("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
|
|
1154
|
+
s && /* @__PURE__ */ r("label", { children: s }),
|
|
1155
|
+
/* @__PURE__ */ N("div", { className: `status-badge ${n}`, style: o, children: [
|
|
1156
|
+
l.icon && /* @__PURE__ */ r("i", { className: l.icon }),
|
|
1157
|
+
/* @__PURE__ */ r("span", { children: l.label })
|
|
1152
1158
|
] })
|
|
1153
1159
|
] });
|
|
1154
1160
|
}
|
|
1155
|
-
const
|
|
1161
|
+
const Ht = z(kt);
|
|
1156
1162
|
function xt({
|
|
1157
1163
|
name: e,
|
|
1158
1164
|
control: t,
|
|
1159
1165
|
defaultRowValue: n,
|
|
1160
|
-
isView:
|
|
1161
|
-
isReadOnly:
|
|
1162
|
-
filters:
|
|
1166
|
+
isView: i,
|
|
1167
|
+
isReadOnly: s,
|
|
1168
|
+
filters: d = []
|
|
1163
1169
|
}) {
|
|
1164
|
-
const { field:
|
|
1170
|
+
const { field: l } = X({ name: e, control: t }), [o, v] = L([]), [a, p] = L([]), g = () => Date.now() + Math.random(), $ = (m) => {
|
|
1165
1171
|
try {
|
|
1166
|
-
const
|
|
1167
|
-
return Array.isArray(
|
|
1172
|
+
const c = JSON.parse(m);
|
|
1173
|
+
return Array.isArray(c) ? c.map((h) => ({
|
|
1168
1174
|
...h,
|
|
1169
1175
|
_uid: h._uid || g()
|
|
1170
1176
|
})) : [];
|
|
1171
|
-
} catch (
|
|
1172
|
-
return console.error(`Erro ao ler dados da tabela "${e}":`,
|
|
1177
|
+
} catch (c) {
|
|
1178
|
+
return console.error(`Erro ao ler dados da tabela "${e}":`, c), [];
|
|
1173
1179
|
}
|
|
1174
1180
|
};
|
|
1175
|
-
|
|
1176
|
-
if (!(
|
|
1177
|
-
const m = JSON.stringify(
|
|
1178
|
-
if (
|
|
1179
|
-
const
|
|
1180
|
-
|
|
1181
|
+
E(() => {
|
|
1182
|
+
if (!(o.length > 0 && !i) && l.value && typeof l.value == "string") {
|
|
1183
|
+
const m = JSON.stringify(o);
|
|
1184
|
+
if (l.value === m) return;
|
|
1185
|
+
const c = $(l.value);
|
|
1186
|
+
v(c);
|
|
1181
1187
|
}
|
|
1182
|
-
}, [
|
|
1183
|
-
if (
|
|
1184
|
-
const m = JSON.stringify(
|
|
1185
|
-
|
|
1186
|
-
}, [
|
|
1187
|
-
const
|
|
1188
|
+
}, [l.value, i]), E(() => {
|
|
1189
|
+
if (s) return;
|
|
1190
|
+
const m = JSON.stringify(o);
|
|
1191
|
+
l.value !== m && l.onChange(m);
|
|
1192
|
+
}, [o, l, s]);
|
|
1193
|
+
const V = C(() => {
|
|
1188
1194
|
const m = { _uid: g(), ...n };
|
|
1189
|
-
|
|
1190
|
-
}, [n]),
|
|
1191
|
-
|
|
1192
|
-
(m) => m.filter((
|
|
1193
|
-
),
|
|
1194
|
-
}, [a]),
|
|
1195
|
-
(m,
|
|
1196
|
-
|
|
1195
|
+
v((c) => [...c, m]);
|
|
1196
|
+
}, [n]), A = C(() => {
|
|
1197
|
+
v(
|
|
1198
|
+
(m) => m.filter((c) => !a.includes(c._uid))
|
|
1199
|
+
), p([]);
|
|
1200
|
+
}, [a]), _ = C(
|
|
1201
|
+
(m, c, h) => {
|
|
1202
|
+
v(
|
|
1197
1203
|
(y) => y.map(
|
|
1198
|
-
(
|
|
1204
|
+
(x) => x._uid === m ? { ...x, [c]: h } : x
|
|
1199
1205
|
)
|
|
1200
1206
|
);
|
|
1201
1207
|
},
|
|
1202
1208
|
[]
|
|
1203
|
-
),
|
|
1204
|
-
|
|
1205
|
-
(
|
|
1209
|
+
), W = C((m) => {
|
|
1210
|
+
p(
|
|
1211
|
+
(c) => c.includes(m) ? c.filter((h) => h !== m) : [...c, m]
|
|
1206
1212
|
);
|
|
1207
|
-
}, []),
|
|
1213
|
+
}, []), w = C(
|
|
1208
1214
|
(m) => {
|
|
1209
|
-
|
|
1215
|
+
p(m ? o.map((c) => c._uid) : []);
|
|
1210
1216
|
},
|
|
1211
|
-
[
|
|
1212
|
-
),
|
|
1213
|
-
(m) =>
|
|
1214
|
-
if ("custom" in
|
|
1215
|
-
return
|
|
1216
|
-
const h = m[
|
|
1217
|
-
switch (
|
|
1217
|
+
[o]
|
|
1218
|
+
), f = o.length > 0 && a.length === o.length, u = B(() => !d || d.length === 0 ? o : o.filter(
|
|
1219
|
+
(m) => d.every((c) => {
|
|
1220
|
+
if ("custom" in c)
|
|
1221
|
+
return c.custom(m);
|
|
1222
|
+
const h = m[c.field];
|
|
1223
|
+
switch (c.operator) {
|
|
1218
1224
|
case "===":
|
|
1219
|
-
return h ===
|
|
1225
|
+
return h === c.value;
|
|
1220
1226
|
case "!==":
|
|
1221
|
-
return h !==
|
|
1227
|
+
return h !== c.value;
|
|
1222
1228
|
case ">":
|
|
1223
|
-
return h >
|
|
1229
|
+
return h > c.value;
|
|
1224
1230
|
case "<":
|
|
1225
|
-
return h <
|
|
1231
|
+
return h < c.value;
|
|
1226
1232
|
case ">=":
|
|
1227
|
-
return h >=
|
|
1233
|
+
return h >= c.value;
|
|
1228
1234
|
case "<=":
|
|
1229
|
-
return h <=
|
|
1235
|
+
return h <= c.value;
|
|
1230
1236
|
default:
|
|
1231
1237
|
return !0;
|
|
1232
1238
|
}
|
|
1233
1239
|
})
|
|
1234
|
-
), [
|
|
1240
|
+
), [o, d]);
|
|
1235
1241
|
return {
|
|
1236
|
-
field:
|
|
1237
|
-
tableRows:
|
|
1242
|
+
field: l,
|
|
1243
|
+
tableRows: o,
|
|
1238
1244
|
visibleRows: u,
|
|
1239
1245
|
selectedRowIds: a,
|
|
1240
|
-
isAllSelected:
|
|
1246
|
+
isAllSelected: f,
|
|
1241
1247
|
handle: {
|
|
1242
|
-
addRow:
|
|
1243
|
-
removeRows:
|
|
1244
|
-
updateCellValue:
|
|
1245
|
-
toggleSelection:
|
|
1246
|
-
toggleSelectAll:
|
|
1248
|
+
addRow: V,
|
|
1249
|
+
removeRows: A,
|
|
1250
|
+
updateCellValue: _,
|
|
1251
|
+
toggleSelection: W,
|
|
1252
|
+
toggleSelectAll: w
|
|
1247
1253
|
}
|
|
1248
1254
|
};
|
|
1249
1255
|
}
|
|
1250
|
-
const
|
|
1256
|
+
const It = ({
|
|
1251
1257
|
name: e,
|
|
1252
1258
|
title: t = "Tabela Dinâmica",
|
|
1253
1259
|
columns: n,
|
|
1254
|
-
defaultRowValue:
|
|
1255
|
-
forceReadOnly:
|
|
1256
|
-
layout:
|
|
1257
|
-
actions:
|
|
1258
|
-
filters:
|
|
1260
|
+
defaultRowValue: i = {},
|
|
1261
|
+
forceReadOnly: s = !1,
|
|
1262
|
+
layout: d = "fluid",
|
|
1263
|
+
actions: l = !0,
|
|
1264
|
+
filters: o = []
|
|
1259
1265
|
}) => {
|
|
1260
|
-
const { control:
|
|
1266
|
+
const { control: v } = H(), { isView: a, isReadOnly: p } = I(), { isReadOnly: g } = F(), $ = s || a || p || g && g(e), { field: V, visibleRows: A, selectedRowIds: _, isAllSelected: W, handle: w } = xt({
|
|
1261
1267
|
name: e,
|
|
1262
|
-
control:
|
|
1263
|
-
defaultRowValue:
|
|
1268
|
+
control: v,
|
|
1269
|
+
defaultRowValue: i,
|
|
1264
1270
|
isView: a,
|
|
1265
|
-
isReadOnly:
|
|
1266
|
-
filters:
|
|
1267
|
-
}),
|
|
1268
|
-
return /* @__PURE__ */
|
|
1269
|
-
/* @__PURE__ */ r("input", { type: "hidden", ...
|
|
1270
|
-
/* @__PURE__ */
|
|
1271
|
+
isReadOnly: !!$,
|
|
1272
|
+
filters: o
|
|
1273
|
+
}), f = d === "fixed";
|
|
1274
|
+
return /* @__PURE__ */ N("div", { className: `table-wrapper ${f ? "table-fixed" : "table-fluid"}`, children: [
|
|
1275
|
+
/* @__PURE__ */ r("input", { type: "hidden", ...V }),
|
|
1276
|
+
/* @__PURE__ */ N("div", { className: "header-handle", children: [
|
|
1271
1277
|
/* @__PURE__ */ r("h3", { children: t }),
|
|
1272
|
-
|
|
1273
|
-
/* @__PURE__ */
|
|
1278
|
+
!$ && l && /* @__PURE__ */ N("div", { className: "handle-actions", children: [
|
|
1279
|
+
/* @__PURE__ */ N(
|
|
1274
1280
|
"button",
|
|
1275
1281
|
{
|
|
1276
1282
|
type: "button",
|
|
1277
|
-
className: `btn ${
|
|
1278
|
-
disabled:
|
|
1279
|
-
onClick:
|
|
1283
|
+
className: `btn ${_.length > 0 ? "btn-danger" : "btn-primary"}`,
|
|
1284
|
+
disabled: _.length === 0,
|
|
1285
|
+
onClick: w.removeRows,
|
|
1280
1286
|
children: [
|
|
1281
1287
|
"Remover (",
|
|
1282
|
-
|
|
1288
|
+
_.length,
|
|
1283
1289
|
")"
|
|
1284
1290
|
]
|
|
1285
1291
|
}
|
|
1286
1292
|
),
|
|
1287
|
-
/* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick:
|
|
1293
|
+
/* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick: w.addRow, children: "Adicionar" })
|
|
1288
1294
|
] })
|
|
1289
1295
|
] }),
|
|
1290
|
-
/* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */
|
|
1291
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */
|
|
1292
|
-
|
|
1296
|
+
/* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */ N("table", { className: "table-custom", children: [
|
|
1297
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ N("tr", { children: [
|
|
1298
|
+
!$ && /* @__PURE__ */ r("th", { style: { width: "50px" }, children: /* @__PURE__ */ r(
|
|
1293
1299
|
"input",
|
|
1294
1300
|
{
|
|
1295
1301
|
type: "checkbox",
|
|
1296
|
-
checked:
|
|
1297
|
-
onChange: (u) =>
|
|
1302
|
+
checked: W,
|
|
1303
|
+
onChange: (u) => w.toggleSelectAll(u.target.checked)
|
|
1298
1304
|
}
|
|
1299
1305
|
) }),
|
|
1300
1306
|
n.map((u) => /* @__PURE__ */ r(
|
|
1301
1307
|
"th",
|
|
1302
1308
|
{
|
|
1303
|
-
style: u.width ? { minWidth:
|
|
1309
|
+
style: u.width ? { minWidth: f ? u.width : "100%" } : { width: "max-content" },
|
|
1304
1310
|
children: u.label
|
|
1305
1311
|
},
|
|
1306
1312
|
u.key
|
|
1307
1313
|
))
|
|
1308
1314
|
] }) }),
|
|
1309
|
-
/* @__PURE__ */
|
|
1310
|
-
|
|
1311
|
-
|
|
1315
|
+
/* @__PURE__ */ N("tbody", { children: [
|
|
1316
|
+
A.map((u, m) => /* @__PURE__ */ N("tr", { children: [
|
|
1317
|
+
!$ && /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r(
|
|
1312
1318
|
"input",
|
|
1313
1319
|
{
|
|
1314
1320
|
type: "checkbox",
|
|
1315
|
-
checked:
|
|
1316
|
-
onChange: () =>
|
|
1321
|
+
checked: _.includes(u._uid),
|
|
1322
|
+
onChange: () => w.toggleSelection(u._uid)
|
|
1317
1323
|
}
|
|
1318
1324
|
) }),
|
|
1319
|
-
n.map((
|
|
1325
|
+
n.map((c) => /* @__PURE__ */ r("td", { children: c.render ? c.render.length <= 1 ? c.render({
|
|
1320
1326
|
row: u,
|
|
1321
1327
|
index: m,
|
|
1322
|
-
updateRow: (h, y) =>
|
|
1323
|
-
isLocked:
|
|
1328
|
+
updateRow: (h, y) => w.updateCellValue(u._uid, h, y),
|
|
1329
|
+
isLocked: !!$,
|
|
1324
1330
|
isView: !!a
|
|
1325
|
-
}) :
|
|
1331
|
+
}) : c.render(
|
|
1326
1332
|
u,
|
|
1327
1333
|
m,
|
|
1328
|
-
(h, y) =>
|
|
1329
|
-
|
|
1334
|
+
(h, y) => w.updateCellValue(u._uid, h, y),
|
|
1335
|
+
!!$,
|
|
1330
1336
|
!!a
|
|
1331
|
-
) : u[
|
|
1337
|
+
) : u[c.key] }, `${u._uid}-${c.key}`))
|
|
1332
1338
|
] }, u._uid)),
|
|
1333
|
-
|
|
1339
|
+
A.length === 0 && /* @__PURE__ */ r("tr", { className: "empty-row", children: /* @__PURE__ */ r("td", { colSpan: 100, className: "text-center", children: $ ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
1334
1340
|
] })
|
|
1335
1341
|
] }) })
|
|
1336
1342
|
] });
|
|
1337
1343
|
}, Rt = (e, t) => {
|
|
1338
|
-
const [n,
|
|
1339
|
-
let
|
|
1344
|
+
const [n, i] = L(null);
|
|
1345
|
+
let s = null;
|
|
1340
1346
|
try {
|
|
1341
|
-
|
|
1347
|
+
s = H().watch;
|
|
1342
1348
|
} catch {
|
|
1343
1349
|
}
|
|
1344
|
-
const
|
|
1350
|
+
const d = t !== void 0 ? t : s ? s(e) : void 0, l = C(() => {
|
|
1345
1351
|
try {
|
|
1346
|
-
const
|
|
1347
|
-
if (
|
|
1348
|
-
const a =
|
|
1349
|
-
|
|
1352
|
+
const v = window.top.__REACT_ATTACHMENT_BRIDGE__;
|
|
1353
|
+
if (v) {
|
|
1354
|
+
const a = v.getAttachment(e, d);
|
|
1355
|
+
i(a || (d ? { name: d, documentId: 0 } : null));
|
|
1350
1356
|
} else
|
|
1351
|
-
|
|
1357
|
+
i(d ? { name: d, documentId: 0 } : null);
|
|
1352
1358
|
} catch {
|
|
1353
|
-
|
|
1359
|
+
i(d ? { name: d, documentId: 0 } : null);
|
|
1354
1360
|
}
|
|
1355
|
-
}, [e,
|
|
1356
|
-
return
|
|
1357
|
-
|
|
1358
|
-
const
|
|
1359
|
-
return () => clearInterval(
|
|
1360
|
-
}, [
|
|
1361
|
+
}, [e, d, t]);
|
|
1362
|
+
return E(() => {
|
|
1363
|
+
l();
|
|
1364
|
+
const o = setInterval(l, 2e3);
|
|
1365
|
+
return () => clearInterval(o);
|
|
1366
|
+
}, [l]), { attachment: n, sync: l };
|
|
1361
1367
|
}, St = ({
|
|
1362
1368
|
name: e,
|
|
1363
1369
|
label: t,
|
|
1364
1370
|
help: n,
|
|
1365
|
-
valueManual:
|
|
1366
|
-
onChangeManual:
|
|
1367
|
-
|
|
1371
|
+
valueManual: i,
|
|
1372
|
+
onChangeManual: s,
|
|
1373
|
+
forceReadOnly: d = !1,
|
|
1374
|
+
forceHidden: l = !1
|
|
1368
1375
|
}) => {
|
|
1369
|
-
const
|
|
1370
|
-
let
|
|
1376
|
+
const o = i !== void 0 && !!s, { isReadOnly: v, isHidden: a } = F(), p = d || !!v(e), g = l || !!a(e), { isView: $ } = I(), [V, A] = L(!1);
|
|
1377
|
+
let _ = null;
|
|
1371
1378
|
try {
|
|
1372
|
-
|
|
1379
|
+
_ = H().control;
|
|
1373
1380
|
} catch {
|
|
1374
1381
|
}
|
|
1375
|
-
const
|
|
1376
|
-
value:
|
|
1377
|
-
onChange: () =>
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
var u;
|
|
1382
|
+
const W = _ && !o ? X({ name: e, control: _ }).field : {
|
|
1383
|
+
value: i,
|
|
1384
|
+
onChange: (R) => s == null ? void 0 : s(R)
|
|
1385
|
+
}, { attachment: w, sync: f } = Rt(e, i), u = () => {
|
|
1386
|
+
var R;
|
|
1381
1387
|
try {
|
|
1382
|
-
const
|
|
1388
|
+
const k = window.top;
|
|
1383
1389
|
return {
|
|
1384
|
-
bridge:
|
|
1385
|
-
toast: (
|
|
1390
|
+
bridge: k.__REACT_ATTACHMENT_BRIDGE__,
|
|
1391
|
+
toast: (R = k.FLUIGC) == null ? void 0 : R.toast
|
|
1386
1392
|
};
|
|
1387
1393
|
} catch {
|
|
1388
1394
|
return { bridge: null, toast: null };
|
|
1389
1395
|
}
|
|
1390
|
-
},
|
|
1391
|
-
if (
|
|
1392
|
-
const
|
|
1393
|
-
|
|
1394
|
-
const
|
|
1395
|
-
if (!
|
|
1396
|
-
const { bridge:
|
|
1397
|
-
|
|
1398
|
-
o ?
|
|
1399
|
-
|
|
1400
|
-
}, 1e3),
|
|
1396
|
+
}, m = C(() => {
|
|
1397
|
+
if (p || $) return;
|
|
1398
|
+
const R = document.createElement("input");
|
|
1399
|
+
R.type = "file", R.onchange = (k) => {
|
|
1400
|
+
const S = k.target.files[0];
|
|
1401
|
+
if (!S) return;
|
|
1402
|
+
const { bridge: O, toast: b } = u();
|
|
1403
|
+
A(!0), O ? O.upload(S, e, (T) => {
|
|
1404
|
+
o ? s == null || s(T.name) : W.onChange(T.name), setTimeout(() => {
|
|
1405
|
+
A(!1), f();
|
|
1406
|
+
}, 1e3), b && b({
|
|
1401
1407
|
title: "Sucesso",
|
|
1402
1408
|
message: "Arquivo enviado",
|
|
1403
1409
|
type: "success"
|
|
1404
1410
|
});
|
|
1405
|
-
}) : (o ?
|
|
1406
|
-
},
|
|
1407
|
-
}, [e,
|
|
1408
|
-
if (
|
|
1409
|
-
const
|
|
1410
|
-
if (!
|
|
1411
|
-
const { bridge:
|
|
1412
|
-
|
|
1411
|
+
}) : (o ? s == null || s(S.name) : W.onChange(S.name), A(!1));
|
|
1412
|
+
}, R.click();
|
|
1413
|
+
}, [e, W, f, s, p, o, $]), c = (R) => {
|
|
1414
|
+
if (R.stopPropagation(), p || $) return;
|
|
1415
|
+
const k = (w == null ? void 0 : w.name) || i || W.value;
|
|
1416
|
+
if (!k) return;
|
|
1417
|
+
const { bridge: S, toast: O } = u();
|
|
1418
|
+
S ? S.removeByFileName(k) ? (o ? s == null || s("") : W.onChange(""), f()) : O && O({
|
|
1413
1419
|
title: "Erro",
|
|
1414
1420
|
message: "Erro ao remover anexo",
|
|
1415
1421
|
type: "danger"
|
|
1416
|
-
}) : (o ?
|
|
1417
|
-
},
|
|
1422
|
+
}) : (o ? s == null || s("") : W.onChange(""), f());
|
|
1423
|
+
}, h = !!w && !V, y = (w == null ? void 0 : w.name) || i || W.value, x = [
|
|
1418
1424
|
"fluig-attachment__box",
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1425
|
+
h ? "fluig-attachment__box--has-file" : "",
|
|
1426
|
+
V ? "fluig-attachment__box--uploading" : "",
|
|
1427
|
+
p ? "readOnly" : ""
|
|
1428
|
+
].join(" "), D = (p || $) && !h;
|
|
1429
|
+
return $ ? /* @__PURE__ */ N("div", { className: `form-group fluig-attachment ${g ? "hidden" : ""}`, children: [
|
|
1423
1430
|
t && /* @__PURE__ */ r("label", { className: "fluig-attachment__label", children: t }),
|
|
1424
|
-
/* @__PURE__ */
|
|
1431
|
+
/* @__PURE__ */ r("span", { className: "fluig-attachment__box readOnly", children: y || "-" })
|
|
1432
|
+
] }) : /* @__PURE__ */ N("div", { className: `form-group fluig-attachment ${g ? "hidden" : ""}`, children: [
|
|
1433
|
+
t && /* @__PURE__ */ r("label", { className: "fluig-attachment__label", children: t }),
|
|
1434
|
+
/* @__PURE__ */ N(
|
|
1425
1435
|
"div",
|
|
1426
1436
|
{
|
|
1427
|
-
className:
|
|
1428
|
-
style:
|
|
1437
|
+
className: x,
|
|
1438
|
+
style: D ? { pointerEvents: "none", opacity: 0.6, cursor: "not-allowed" } : {},
|
|
1429
1439
|
onClick: () => {
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
|
|
1440
|
+
if (h) {
|
|
1441
|
+
const R = u();
|
|
1442
|
+
R.bridge && y && R.bridge.view(y);
|
|
1433
1443
|
} else
|
|
1434
|
-
|
|
1444
|
+
m();
|
|
1435
1445
|
},
|
|
1436
1446
|
children: [
|
|
1437
|
-
/* @__PURE__ */
|
|
1447
|
+
/* @__PURE__ */ N("span", { className: "fluig-attachment__content", children: [
|
|
1438
1448
|
/* @__PURE__ */ r(
|
|
1439
1449
|
"i",
|
|
1440
1450
|
{
|
|
1441
|
-
className: `fluigicon icon-sm ${
|
|
1451
|
+
className: `fluigicon icon-sm ${V ? "fluigicon-loop-test" : h ? "fluigicon-file-pdf" : "fluigicon-paperclip"} fluig-attachment__icon`
|
|
1442
1452
|
}
|
|
1443
1453
|
),
|
|
1444
|
-
/* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children:
|
|
1454
|
+
/* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: V ? " Enviando..." : h ? y : p ? "Nenhum arquivo" : n || "Anexar" })
|
|
1445
1455
|
] }),
|
|
1446
|
-
|
|
1456
|
+
h && !p && !$ && /* @__PURE__ */ r(
|
|
1447
1457
|
"button",
|
|
1448
1458
|
{
|
|
1449
1459
|
type: "button",
|
|
1450
1460
|
className: "fluig-attachment__btn-remove btn btn-link text-danger",
|
|
1451
|
-
onClick:
|
|
1461
|
+
onClick: c,
|
|
1452
1462
|
children: /* @__PURE__ */ r("i", { className: "flaticon flaticon-trash icon-sm" })
|
|
1453
1463
|
}
|
|
1454
1464
|
)
|
|
1455
1465
|
]
|
|
1456
1466
|
}
|
|
1457
1467
|
),
|
|
1458
|
-
!o &&
|
|
1468
|
+
!o && _ && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: W.value || "" })
|
|
1459
1469
|
] });
|
|
1460
|
-
}, Lt =
|
|
1470
|
+
}, Lt = z(St);
|
|
1461
1471
|
function Ft({
|
|
1462
1472
|
title: e,
|
|
1463
1473
|
isOpen: t,
|
|
1464
1474
|
onOpen: n,
|
|
1465
|
-
onClose:
|
|
1466
|
-
content:
|
|
1467
|
-
footer:
|
|
1468
|
-
width:
|
|
1475
|
+
onClose: i,
|
|
1476
|
+
content: s,
|
|
1477
|
+
footer: d,
|
|
1478
|
+
width: l
|
|
1469
1479
|
}) {
|
|
1470
|
-
const
|
|
1471
|
-
(
|
|
1472
|
-
|
|
1480
|
+
const o = C(
|
|
1481
|
+
(v) => {
|
|
1482
|
+
v.key === "Escape" && i();
|
|
1473
1483
|
},
|
|
1474
|
-
[
|
|
1484
|
+
[i]
|
|
1475
1485
|
);
|
|
1476
|
-
return
|
|
1477
|
-
document.removeEventListener("keydown",
|
|
1478
|
-
}), [t,
|
|
1486
|
+
return E(() => (t && (document.addEventListener("keydown", o), n == null || n(), document.body.style.overflow = "hidden"), () => {
|
|
1487
|
+
document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
|
|
1488
|
+
}), [t, o, n]), t ? /* @__PURE__ */ r(
|
|
1479
1489
|
"div",
|
|
1480
1490
|
{
|
|
1481
1491
|
className: "modal-overlay",
|
|
1482
|
-
onClick:
|
|
1492
|
+
onClick: i,
|
|
1483
1493
|
"aria-modal": "true",
|
|
1484
1494
|
role: "dialog",
|
|
1485
|
-
children: /* @__PURE__ */
|
|
1495
|
+
children: /* @__PURE__ */ N(
|
|
1486
1496
|
"div",
|
|
1487
1497
|
{
|
|
1488
|
-
style: { maxWidth:
|
|
1498
|
+
style: { maxWidth: l },
|
|
1489
1499
|
className: "modal-container",
|
|
1490
|
-
onClick: (
|
|
1500
|
+
onClick: (v) => v.stopPropagation(),
|
|
1491
1501
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ N("div", { className: "modal-header", children: [
|
|
1493
1503
|
/* @__PURE__ */ r("h3", { children: e }),
|
|
1494
1504
|
/* @__PURE__ */ r(
|
|
1495
1505
|
"div",
|
|
1496
1506
|
{
|
|
1497
1507
|
className: "btn-close-modal",
|
|
1498
|
-
onClick:
|
|
1508
|
+
onClick: i,
|
|
1499
1509
|
role: "button",
|
|
1500
1510
|
"aria-label": "Fechar modal",
|
|
1501
1511
|
children: /* @__PURE__ */ r(
|
|
@@ -1508,8 +1518,8 @@ function Ft({
|
|
|
1508
1518
|
}
|
|
1509
1519
|
)
|
|
1510
1520
|
] }),
|
|
1511
|
-
/* @__PURE__ */ r("div", { className: "modal-content", children:
|
|
1512
|
-
|
|
1521
|
+
/* @__PURE__ */ r("div", { className: "modal-content", children: s }),
|
|
1522
|
+
d && /* @__PURE__ */ r("div", { className: "modal-footer", children: d })
|
|
1513
1523
|
]
|
|
1514
1524
|
}
|
|
1515
1525
|
)
|
|
@@ -1518,13 +1528,13 @@ function Ft({
|
|
|
1518
1528
|
}
|
|
1519
1529
|
export {
|
|
1520
1530
|
Lt as Attachment,
|
|
1521
|
-
|
|
1531
|
+
Tt as Checkbox,
|
|
1522
1532
|
Et as DatePicker,
|
|
1523
|
-
|
|
1533
|
+
Dt as Input,
|
|
1524
1534
|
Ft as Modal,
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1535
|
+
jt as RadioBtn,
|
|
1536
|
+
Vt as Select,
|
|
1537
|
+
It as SimpleTable,
|
|
1538
|
+
Ht as StatusBadge,
|
|
1539
|
+
Ct as TextArea
|
|
1530
1540
|
};
|