diefra_ecm_ui 1.2.1 → 1.2.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/components/Input/index.d.ts +3 -1
- package/dist/index.cjs +13 -13
- package/dist/index.js +590 -552
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useCallback as
|
|
3
|
-
import { useFormContext as
|
|
1
|
+
import { jsx as e, jsxs as y, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as U, useEffect as P, memo as q, useState as Y, useMemo as J, useRef as ee, forwardRef as oe, createElement as te } from "react";
|
|
3
|
+
import { useFormContext as W, useController as Z, useFormState as ae } from "react-hook-form";
|
|
4
4
|
import { IMaskInput as pe } from "react-imask";
|
|
5
5
|
import { useSection as G, useFluigRuntime as z } from "@fluig-kit/ecm";
|
|
6
|
-
import { isValid as
|
|
7
|
-
function Ie({ title: t, isOpen:
|
|
8
|
-
const
|
|
9
|
-
(
|
|
10
|
-
|
|
6
|
+
import { isValid as ue, eachDayOfInterval as ve, endOfWeek as ye, endOfMonth as ge, startOfWeek as be, startOfMonth as Ne, getYear as ke, subMonths as we, setMonth as $e, setYear as Oe, addMonths as _e, isSameMonth as Re, isSameDay as Se, format as fe, isToday as Ae, parse as xe } from "date-fns";
|
|
7
|
+
function Ie({ title: t, isOpen: n, onOpen: f, onClose: o, content: c, footer: a, width: m }) {
|
|
8
|
+
const d = U(
|
|
9
|
+
(p) => {
|
|
10
|
+
p.key === "Escape" && o();
|
|
11
11
|
},
|
|
12
|
-
[
|
|
12
|
+
[o]
|
|
13
13
|
);
|
|
14
|
-
return
|
|
15
|
-
document.removeEventListener("keydown",
|
|
16
|
-
}), [
|
|
17
|
-
/* @__PURE__ */
|
|
14
|
+
return P(() => (n && (document.addEventListener("keydown", d), f == null || f(), document.body.style.overflow = "hidden"), () => {
|
|
15
|
+
document.removeEventListener("keydown", d), document.body.style.overflow = "auto";
|
|
16
|
+
}), [n, d, f]), n ? /* @__PURE__ */ e("div", { className: "modal-overlay", onClick: o, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ y("div", { style: { maxWidth: m }, className: "modal-container", onClick: (p) => p.stopPropagation(), children: [
|
|
17
|
+
/* @__PURE__ */ y("div", { className: "modal-header", children: [
|
|
18
18
|
/* @__PURE__ */ e("h3", { children: t }),
|
|
19
|
-
/* @__PURE__ */ e("div", { className: "btn-close-modal", onClick:
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "btn-close-modal", onClick: o, role: "button", "aria-label": "Fechar modal", children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-close icon-sm", "aria-hidden": "true" }) })
|
|
20
20
|
] }),
|
|
21
21
|
/* @__PURE__ */ e("div", { className: "modal-content", children: c }),
|
|
22
|
-
|
|
22
|
+
a && /* @__PURE__ */ e("div", { className: "modal-footer", children: a })
|
|
23
23
|
] }) }) : null;
|
|
24
24
|
}
|
|
25
|
-
function Ve({ text: t, title:
|
|
26
|
-
const [c,
|
|
27
|
-
|
|
25
|
+
function Ve({ text: t, title: n = "Ajuda & Informações", width: f = "500px", className: o = "" }) {
|
|
26
|
+
const [c, a] = Y(!1), m = (d) => {
|
|
27
|
+
d.preventDefault(), d.stopPropagation(), a(!0);
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */
|
|
29
|
+
return /* @__PURE__ */ y(de, { children: [
|
|
30
30
|
/* @__PURE__ */ e(
|
|
31
31
|
"div",
|
|
32
32
|
{
|
|
33
|
-
className: `dfe-help-indicator ${
|
|
33
|
+
className: `dfe-help-indicator ${o}`,
|
|
34
34
|
onClick: m,
|
|
35
35
|
role: "button",
|
|
36
36
|
tabIndex: 0,
|
|
@@ -42,17 +42,17 @@ function Ve({ text: t, title: i = "Ajuda & Informações", width: a = "500px", c
|
|
|
42
42
|
/* @__PURE__ */ e(
|
|
43
43
|
Ie,
|
|
44
44
|
{
|
|
45
|
-
title:
|
|
45
|
+
title: n,
|
|
46
46
|
isOpen: c,
|
|
47
|
-
onClose: () =>
|
|
48
|
-
width:
|
|
47
|
+
onClose: () => a(!1),
|
|
48
|
+
width: f,
|
|
49
49
|
content: /* @__PURE__ */ e("div", { className: "dfe-help-modal-body", children: t }),
|
|
50
|
-
footer: /* @__PURE__ */ e("div", { className: "dfe-help-modal-footer", children: /* @__PURE__ */ e("button", { type: "button", className: "btn btn-info dfe-help-btn", onClick: () =>
|
|
50
|
+
footer: /* @__PURE__ */ e("div", { className: "dfe-help-modal-footer", children: /* @__PURE__ */ e("button", { type: "button", className: "btn btn-info dfe-help-btn", onClick: () => a(!1), children: "Entendido" }) })
|
|
51
51
|
}
|
|
52
52
|
)
|
|
53
53
|
] });
|
|
54
54
|
}
|
|
55
|
-
const
|
|
55
|
+
const M = q(Ve), De = {
|
|
56
56
|
cpf: "000.000.000-00",
|
|
57
57
|
cnpj: "00.000.000/0000-00",
|
|
58
58
|
telefone: "(00) 00000-0000",
|
|
@@ -60,256 +60,294 @@ const Z = q(Ve), De = {
|
|
|
60
60
|
};
|
|
61
61
|
function Ee({
|
|
62
62
|
name: t,
|
|
63
|
-
label:
|
|
64
|
-
placeholder:
|
|
65
|
-
type:
|
|
63
|
+
label: n = "",
|
|
64
|
+
placeholder: f = "",
|
|
65
|
+
type: o = "text",
|
|
66
66
|
mask: c,
|
|
67
|
-
className:
|
|
67
|
+
className: a = "",
|
|
68
68
|
forceReadOnly: m = !1,
|
|
69
|
-
forceHidden:
|
|
69
|
+
forceHidden: d = !1,
|
|
70
|
+
prefix: p,
|
|
71
|
+
suffix: s,
|
|
70
72
|
helpText: v,
|
|
71
|
-
helpTitle:
|
|
72
|
-
helpWidth:
|
|
73
|
-
valueManual:
|
|
74
|
-
onChangeManual:
|
|
75
|
-
errorManual:
|
|
73
|
+
helpTitle: x,
|
|
74
|
+
helpWidth: I,
|
|
75
|
+
valueManual: F,
|
|
76
|
+
onChangeManual: b,
|
|
77
|
+
errorManual: _
|
|
76
78
|
}) {
|
|
77
|
-
var
|
|
78
|
-
const
|
|
79
|
-
let
|
|
79
|
+
var K, Q;
|
|
80
|
+
const R = F !== void 0 && !!b, { isReadOnly: S, isHidden: N } = G(), r = m || !!S(t), i = d || !!N(t), { isView: l } = z();
|
|
81
|
+
let u = null;
|
|
80
82
|
try {
|
|
81
|
-
|
|
83
|
+
u = W();
|
|
82
84
|
} catch {
|
|
83
85
|
}
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
86
|
+
const h = !R && u ? Z({ name: t, control: u.control }) : null, E = !R && u ? ae({ name: t }) : null, H = R ? F : h == null ? void 0 : h.field.value, V = R ? _ : (Q = (K = E == null ? void 0 : E.errors) == null ? void 0 : K[t]) == null ? void 0 : Q.message, O = J(() => c ? De[c] ?? c : null, [c]), $ = U(
|
|
87
|
+
(C) => {
|
|
88
|
+
if (!C) return "";
|
|
89
|
+
let w = C;
|
|
90
|
+
if (s)
|
|
91
|
+
if (w.endsWith(s))
|
|
92
|
+
w = w.slice(0, -s.length);
|
|
93
|
+
else {
|
|
94
|
+
const L = w.lastIndexOf(s);
|
|
95
|
+
L !== -1 && (w = w.substring(0, L) + w.substring(L + s.length));
|
|
96
|
+
}
|
|
97
|
+
if (p)
|
|
98
|
+
if (w.startsWith(p))
|
|
99
|
+
w = w.slice(p.length);
|
|
100
|
+
else {
|
|
101
|
+
const L = w.indexOf(p);
|
|
102
|
+
L !== -1 && (w = w.substring(0, L) + w.substring(L + p.length));
|
|
103
|
+
}
|
|
104
|
+
if (o === "monetary") {
|
|
105
|
+
const L = w.replace(/\D/g, "");
|
|
106
|
+
return L ? (Number(L) / 100).toFixed(2) : "";
|
|
107
|
+
}
|
|
108
|
+
return o === "number" && (w = w.replace(/[^\d.,-]/g, ""), w = w.replace(/\./g, "").replace(",", ".")), w;
|
|
109
|
+
},
|
|
110
|
+
[p, s, o]
|
|
111
|
+
), k = U(
|
|
112
|
+
(C) => {
|
|
113
|
+
if (C === "" || C === null || C === void 0) return "";
|
|
114
|
+
let w = String(C);
|
|
115
|
+
if (o === "monetary") {
|
|
116
|
+
const L = Number(C);
|
|
117
|
+
return isNaN(L) ? "" : L.toLocaleString("pt-BR", { style: "currency", currency: "BRL" });
|
|
118
|
+
}
|
|
119
|
+
if (o === "number") {
|
|
120
|
+
w = w.replace(".", ",");
|
|
121
|
+
const L = w.split(",");
|
|
122
|
+
L[0] = L[0].replace(/\B(?=(\d{3})+(?!\d))/g, "."), w = L.join(",");
|
|
123
|
+
}
|
|
124
|
+
return p && (w = `${p}${w}`), s && (w = `${w}${s}`), w;
|
|
125
|
+
},
|
|
126
|
+
[p, s, o]
|
|
127
|
+
), B = (C) => {
|
|
128
|
+
const w = `${p || ""}${s || ""}`;
|
|
129
|
+
if (!C || C === p || C === s || C === w) {
|
|
130
|
+
R ? b == null || b("") : h == null || h.field.onChange("");
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const L = $(C);
|
|
134
|
+
R ? b == null || b(L) : h == null || h.field.onChange(L);
|
|
135
|
+
}, g = () => {
|
|
136
|
+
R || h == null || h.field.onBlur();
|
|
137
|
+
}, D = J(() => k(H), [H, k]);
|
|
138
|
+
if (i) return null;
|
|
139
|
+
const j = `form-control ${r ? "readOnly" : ""} ${V ? "border-red" : ""} ${a}`, X = () => O ? /* @__PURE__ */ e(
|
|
103
140
|
pe,
|
|
104
141
|
{
|
|
105
|
-
mask:
|
|
106
|
-
value:
|
|
142
|
+
mask: O,
|
|
143
|
+
value: D,
|
|
107
144
|
unmask: !0,
|
|
108
|
-
onAccept: (
|
|
109
|
-
placeholder:
|
|
110
|
-
readOnly:
|
|
111
|
-
className:
|
|
112
|
-
inputRef:
|
|
113
|
-
onBlur:
|
|
145
|
+
onAccept: (C) => B(C),
|
|
146
|
+
placeholder: f,
|
|
147
|
+
readOnly: r,
|
|
148
|
+
className: j,
|
|
149
|
+
inputRef: R || h == null ? void 0 : h.field.ref,
|
|
150
|
+
onBlur: g
|
|
114
151
|
}
|
|
115
152
|
) : /* @__PURE__ */ e(
|
|
116
153
|
"input",
|
|
117
154
|
{
|
|
118
|
-
type:
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
155
|
+
type: "text",
|
|
156
|
+
inputMode: o === "number" || o === "monetary" ? "numeric" : void 0,
|
|
157
|
+
value: D,
|
|
158
|
+
onChange: (C) => B(C.target.value),
|
|
159
|
+
onBlur: g,
|
|
160
|
+
placeholder: f,
|
|
161
|
+
readOnly: r,
|
|
162
|
+
className: j
|
|
125
163
|
}
|
|
126
164
|
);
|
|
127
|
-
return
|
|
128
|
-
|
|
129
|
-
/* @__PURE__ */
|
|
130
|
-
/* @__PURE__ */ e("span", { className:
|
|
131
|
-
v && /* @__PURE__ */ e(
|
|
165
|
+
return l ? /* @__PURE__ */ y("div", { className: "form-group", children: [
|
|
166
|
+
n && /* @__PURE__ */ e("label", { children: n }),
|
|
167
|
+
/* @__PURE__ */ y("div", { className: v ? "dfe-flex-input-wrapper" : "", children: [
|
|
168
|
+
/* @__PURE__ */ e("span", { className: j, children: D || "-" }),
|
|
169
|
+
v && /* @__PURE__ */ e(M, { text: v, title: x, width: I })
|
|
132
170
|
] })
|
|
133
|
-
] }) : /* @__PURE__ */
|
|
134
|
-
|
|
135
|
-
/* @__PURE__ */
|
|
136
|
-
|
|
137
|
-
v && /* @__PURE__ */ e(
|
|
171
|
+
] }) : /* @__PURE__ */ y("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
|
|
172
|
+
n && /* @__PURE__ */ e("label", { children: n }),
|
|
173
|
+
/* @__PURE__ */ y("div", { className: v ? "dfe-flex-input-wrapper" : "", children: [
|
|
174
|
+
X(),
|
|
175
|
+
v && /* @__PURE__ */ e(M, { text: v, title: x, width: I })
|
|
138
176
|
] }),
|
|
139
|
-
!
|
|
140
|
-
|
|
177
|
+
!R && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: H || "" }),
|
|
178
|
+
V && /* @__PURE__ */ e("p", { className: "text-danger", children: String(V) })
|
|
141
179
|
] });
|
|
142
180
|
}
|
|
143
|
-
const
|
|
181
|
+
const ot = q(Ee);
|
|
144
182
|
function Be({
|
|
145
183
|
name: t,
|
|
146
|
-
label:
|
|
147
|
-
options:
|
|
148
|
-
placeholder:
|
|
184
|
+
label: n = "",
|
|
185
|
+
options: f = [],
|
|
186
|
+
placeholder: o = "",
|
|
149
187
|
labelKey: c = "label",
|
|
150
|
-
valueKey:
|
|
188
|
+
valueKey: a = "value",
|
|
151
189
|
enableSearch: m = !1,
|
|
152
|
-
searchPlaceholder:
|
|
153
|
-
loading:
|
|
154
|
-
onSearchChange:
|
|
155
|
-
debounceTime:
|
|
156
|
-
onSelect:
|
|
157
|
-
forceReadOnly:
|
|
158
|
-
forceHidden:
|
|
190
|
+
searchPlaceholder: d = "Buscar...",
|
|
191
|
+
loading: p = !1,
|
|
192
|
+
onSearchChange: s,
|
|
193
|
+
debounceTime: v = 300,
|
|
194
|
+
onSelect: x,
|
|
195
|
+
forceReadOnly: I = !1,
|
|
196
|
+
forceHidden: F = !1,
|
|
159
197
|
helpText: b,
|
|
160
|
-
helpTitle:
|
|
161
|
-
helpWidth:
|
|
162
|
-
valueManual:
|
|
163
|
-
onChangeManual:
|
|
198
|
+
helpTitle: _,
|
|
199
|
+
helpWidth: R,
|
|
200
|
+
valueManual: S,
|
|
201
|
+
onChangeManual: N,
|
|
164
202
|
errorManual: r
|
|
165
203
|
}) {
|
|
166
|
-
var
|
|
167
|
-
const
|
|
168
|
-
let V = "",
|
|
169
|
-
},
|
|
204
|
+
var re;
|
|
205
|
+
const i = S !== void 0 && !!N, { isReadOnly: l, isHidden: u } = G(), h = I || !!l(t), E = F || !!u(t), { isView: H } = z();
|
|
206
|
+
let V = "", O = () => {
|
|
207
|
+
}, $, k = null, B = () => {
|
|
170
208
|
};
|
|
171
|
-
if (
|
|
172
|
-
V =
|
|
209
|
+
if (i)
|
|
210
|
+
V = S;
|
|
173
211
|
else
|
|
174
212
|
try {
|
|
175
|
-
const
|
|
176
|
-
V = T.field.value,
|
|
213
|
+
const A = W(), T = Z({ name: t, control: A.control });
|
|
214
|
+
V = T.field.value, O = T.field.onChange, $ = T.field.ref, k = (re = T.fieldState) == null ? void 0 : re.error, B = A.clearErrors;
|
|
177
215
|
} catch {
|
|
178
216
|
}
|
|
179
|
-
const [
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}, [
|
|
183
|
-
const
|
|
184
|
-
|
|
217
|
+
const [g, D] = Y(!1), [j, X] = Y(""), K = ee(null), Q = ee(s);
|
|
218
|
+
P(() => {
|
|
219
|
+
Q.current = s;
|
|
220
|
+
}, [s]), P(() => {
|
|
221
|
+
const A = (T) => {
|
|
222
|
+
K.current && !K.current.contains(T.target) && D(!1);
|
|
185
223
|
};
|
|
186
|
-
return document.addEventListener("mousedown",
|
|
187
|
-
}, []),
|
|
188
|
-
|
|
189
|
-
}, [
|
|
224
|
+
return document.addEventListener("mousedown", A), () => document.removeEventListener("mousedown", A);
|
|
225
|
+
}, []), P(() => {
|
|
226
|
+
g || X("");
|
|
227
|
+
}, [g]), P(() => {
|
|
190
228
|
if (!m) return;
|
|
191
|
-
const
|
|
229
|
+
const A = setTimeout(() => {
|
|
192
230
|
var T;
|
|
193
|
-
(T =
|
|
194
|
-
},
|
|
195
|
-
return () => clearTimeout(
|
|
196
|
-
}, [
|
|
197
|
-
const
|
|
198
|
-
(
|
|
199
|
-
) :
|
|
231
|
+
(T = Q.current) == null || T.call(Q, j);
|
|
232
|
+
}, v);
|
|
233
|
+
return () => clearTimeout(A);
|
|
234
|
+
}, [j, m, v]);
|
|
235
|
+
const C = J(() => m && !s && j.trim() ? f.filter(
|
|
236
|
+
(A) => String((A == null ? void 0 : A[c]) ?? "").toLowerCase().includes(j.toLowerCase())
|
|
237
|
+
) : f ?? [], [f, m, s, j, c]), w = J(() => {
|
|
200
238
|
if (V == null) return "";
|
|
201
239
|
if (typeof V == "object")
|
|
202
|
-
return String(V[
|
|
203
|
-
const
|
|
204
|
-
return String(
|
|
205
|
-
}, [V,
|
|
206
|
-
|
|
240
|
+
return String(V[a] ?? "");
|
|
241
|
+
const A = (f || []).find((T) => String(T == null ? void 0 : T[a]) === String(V));
|
|
242
|
+
return String(A ? (A == null ? void 0 : A[c]) ?? "" : V);
|
|
243
|
+
}, [V, f, a, c]), L = (A) => {
|
|
244
|
+
h || (i ? N == null || N(A[a]) : (O(A[a]), B == null || B(t)), x == null || x(A), D(!1));
|
|
207
245
|
};
|
|
208
|
-
return
|
|
209
|
-
/* @__PURE__ */ e("label", { className: "control-label", children:
|
|
210
|
-
|
|
211
|
-
/* @__PURE__ */ e("span", { className: "form-control", style: b ? { flex: 1 } : void 0, children:
|
|
212
|
-
b && /* @__PURE__ */ e(
|
|
213
|
-
] }) : /* @__PURE__ */
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
-
/* @__PURE__ */
|
|
246
|
+
return E ? null : /* @__PURE__ */ y("div", { className: `select-wrapper form-group ${E ? "hidden" : ""}`, ref: K, children: [
|
|
247
|
+
/* @__PURE__ */ e("label", { className: "control-label", children: n }),
|
|
248
|
+
H ? /* @__PURE__ */ y("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
|
|
249
|
+
/* @__PURE__ */ e("span", { className: "form-control", style: b ? { flex: 1 } : void 0, children: w || "-" }),
|
|
250
|
+
b && /* @__PURE__ */ e(M, { text: b, title: _, width: R })
|
|
251
|
+
] }) : /* @__PURE__ */ y(de, { children: [
|
|
252
|
+
/* @__PURE__ */ y("div", { className: b ? "dfe-flex-input-wrapper" : "", children: [
|
|
253
|
+
/* @__PURE__ */ y(
|
|
216
254
|
"div",
|
|
217
255
|
{
|
|
218
|
-
className: `select-control ${k ? "border-red" : ""} ${
|
|
219
|
-
onClick: () => !
|
|
220
|
-
ref:
|
|
256
|
+
className: `select-control ${k ? "border-red" : ""} ${h ? "readOnly" : ""}`,
|
|
257
|
+
onClick: () => !h && D((A) => !A),
|
|
258
|
+
ref: $,
|
|
221
259
|
style: b ? { flex: 1 } : void 0,
|
|
222
260
|
children: [
|
|
223
|
-
/* @__PURE__ */ e("span", { className: `select-display ${
|
|
261
|
+
/* @__PURE__ */ e("span", { className: `select-display ${h ? "readOnly" : ""}`, children: w || o }),
|
|
224
262
|
/* @__PURE__ */ e("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
225
263
|
]
|
|
226
264
|
}
|
|
227
265
|
),
|
|
228
|
-
b && /* @__PURE__ */ e(
|
|
266
|
+
b && /* @__PURE__ */ e(M, { text: b, title: _, width: R })
|
|
229
267
|
] }),
|
|
230
|
-
|
|
268
|
+
g && !h && /* @__PURE__ */ y("div", { className: "select-dropdown", children: [
|
|
231
269
|
m && /* @__PURE__ */ e("div", { className: "select-search", children: /* @__PURE__ */ e(
|
|
232
270
|
"input",
|
|
233
271
|
{
|
|
234
272
|
type: "text",
|
|
235
273
|
className: "select-search-input",
|
|
236
|
-
value:
|
|
237
|
-
onChange: (
|
|
238
|
-
placeholder:
|
|
274
|
+
value: j,
|
|
275
|
+
onChange: (A) => X(A.target.value),
|
|
276
|
+
placeholder: p ? "Carregando..." : d,
|
|
239
277
|
autoFocus: !0,
|
|
240
|
-
onClick: (
|
|
278
|
+
onClick: (A) => A.stopPropagation()
|
|
241
279
|
}
|
|
242
280
|
) }),
|
|
243
|
-
/* @__PURE__ */ e("ul", { className: "select-options", children:
|
|
281
|
+
/* @__PURE__ */ e("ul", { className: "select-options", children: p ? /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Carregando..." }) : C.length > 0 ? C.map((A) => /* @__PURE__ */ e("li", { onClick: () => L(A), className: "select-option handleHover", children: A[c] }, A[a])) : /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
244
282
|
] })
|
|
245
283
|
] }),
|
|
246
|
-
!
|
|
284
|
+
!i && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: V || "" }),
|
|
247
285
|
(k || r) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((k == null ? void 0 : k.message) ?? r) })
|
|
248
286
|
] });
|
|
249
287
|
}
|
|
250
|
-
const
|
|
288
|
+
const ne = q(Be);
|
|
251
289
|
function at({
|
|
252
290
|
name: t,
|
|
253
|
-
options:
|
|
254
|
-
label:
|
|
255
|
-
valueKey:
|
|
291
|
+
options: n = [],
|
|
292
|
+
label: f = "",
|
|
293
|
+
valueKey: o = "value",
|
|
256
294
|
labelKey: c = "label",
|
|
257
|
-
forceReadOnly:
|
|
295
|
+
forceReadOnly: a = !1,
|
|
258
296
|
forceHidden: m = !1,
|
|
259
|
-
valueManual:
|
|
260
|
-
onChangeManual:
|
|
297
|
+
valueManual: d,
|
|
298
|
+
onChangeManual: p
|
|
261
299
|
}) {
|
|
262
|
-
var
|
|
263
|
-
let
|
|
300
|
+
var H, V;
|
|
301
|
+
let s = null;
|
|
264
302
|
try {
|
|
265
|
-
|
|
303
|
+
s = W();
|
|
266
304
|
} catch {
|
|
267
305
|
}
|
|
268
|
-
const
|
|
269
|
-
(
|
|
270
|
-
const k = String(
|
|
271
|
-
if (
|
|
272
|
-
|
|
273
|
-
else if (
|
|
274
|
-
const
|
|
275
|
-
|
|
306
|
+
const v = d !== void 0 && !!p, { isView: x, isReadOnly: I } = z(), { isReadOnly: F, isHidden: b } = G(), _ = F ? F(t) : !1, R = b ? b(t) : !1, S = a || _, N = m || R, r = S || I || x, i = () => n ? n.reduce(
|
|
307
|
+
(O, $) => {
|
|
308
|
+
const k = String($[o]);
|
|
309
|
+
if (v)
|
|
310
|
+
O[k] = !!(d != null && d[k]);
|
|
311
|
+
else if (s) {
|
|
312
|
+
const B = s.getValues(k);
|
|
313
|
+
O[k] = B === "on";
|
|
276
314
|
} else
|
|
277
|
-
|
|
278
|
-
return
|
|
315
|
+
O[k] = !1;
|
|
316
|
+
return O;
|
|
279
317
|
},
|
|
280
318
|
{}
|
|
281
|
-
) : {},
|
|
282
|
-
|
|
283
|
-
if (
|
|
284
|
-
const
|
|
285
|
-
(!
|
|
319
|
+
) : {}, l = !v && s ? s.watch(t) : void 0, u = J(() => v && d ? d : l && typeof l == "object" ? l : i(), [l, d, n]);
|
|
320
|
+
P(() => {
|
|
321
|
+
if (v || !s) return;
|
|
322
|
+
const O = s.getValues(t);
|
|
323
|
+
(!O || typeof O != "object") && s.setValue(t, u, {
|
|
286
324
|
shouldDirty: !1,
|
|
287
325
|
shouldValidate: !1
|
|
288
326
|
});
|
|
289
|
-
}, [
|
|
290
|
-
const
|
|
327
|
+
}, [u, t, s, v]);
|
|
328
|
+
const h = (O, $) => {
|
|
291
329
|
if (r) return;
|
|
292
|
-
const k = { ...
|
|
293
|
-
if (
|
|
294
|
-
|
|
330
|
+
const k = { ...u, [O]: $ };
|
|
331
|
+
if (v) {
|
|
332
|
+
p && p(k);
|
|
295
333
|
return;
|
|
296
334
|
}
|
|
297
|
-
|
|
335
|
+
s && (s.setValue(t, k, {
|
|
298
336
|
shouldDirty: !0,
|
|
299
337
|
shouldValidate: !0
|
|
300
|
-
}),
|
|
301
|
-
},
|
|
302
|
-
return /* @__PURE__ */
|
|
303
|
-
|
|
338
|
+
}), s.setValue(O, $ ? "on" : "", { shouldValidate: !1 }));
|
|
339
|
+
}, E = v ? null : (V = (H = s == null ? void 0 : s.formState) == null ? void 0 : H.errors) == null ? void 0 : V[t];
|
|
340
|
+
return /* @__PURE__ */ y("div", { className: `form-group ${N ? "hidden" : ""}`, children: [
|
|
341
|
+
f && /* @__PURE__ */ e("label", { children: f }),
|
|
304
342
|
/* @__PURE__ */ e(
|
|
305
343
|
"div",
|
|
306
344
|
{
|
|
307
345
|
className: `checkbox-group-custom ${r ? "readOnly" : ""}`,
|
|
308
|
-
children:
|
|
309
|
-
const
|
|
310
|
-
return /* @__PURE__ */
|
|
311
|
-
!
|
|
312
|
-
/* @__PURE__ */
|
|
346
|
+
children: n.map((O) => {
|
|
347
|
+
const $ = String(O[o]), k = u[$] === !0;
|
|
348
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
349
|
+
!v && s && /* @__PURE__ */ e("input", { type: "hidden", ...s.register($) }),
|
|
350
|
+
/* @__PURE__ */ y(
|
|
313
351
|
"label",
|
|
314
352
|
{
|
|
315
353
|
className: `custom-checkbox ${k ? "checked" : ""} ${r ? "readOnly" : ""}`,
|
|
@@ -320,149 +358,149 @@ function at({
|
|
|
320
358
|
type: "checkbox",
|
|
321
359
|
checked: k,
|
|
322
360
|
disabled: r,
|
|
323
|
-
onChange: (
|
|
361
|
+
onChange: (B) => h($, B.target.checked)
|
|
324
362
|
}
|
|
325
363
|
),
|
|
326
364
|
/* @__PURE__ */ e("span", { className: "checkmark" }),
|
|
327
|
-
/* @__PURE__ */ e("span", { children:
|
|
365
|
+
/* @__PURE__ */ e("span", { children: O[c] })
|
|
328
366
|
]
|
|
329
367
|
}
|
|
330
368
|
)
|
|
331
|
-
] },
|
|
369
|
+
] }, $);
|
|
332
370
|
})
|
|
333
371
|
}
|
|
334
372
|
),
|
|
335
|
-
|
|
373
|
+
E && /* @__PURE__ */ e("p", { className: "text-danger", children: String(E.message) })
|
|
336
374
|
] });
|
|
337
375
|
}
|
|
338
|
-
function
|
|
376
|
+
function He({
|
|
339
377
|
name: t,
|
|
340
|
-
label:
|
|
341
|
-
options:
|
|
342
|
-
valueKey:
|
|
378
|
+
label: n = "",
|
|
379
|
+
options: f = [],
|
|
380
|
+
valueKey: o = "value",
|
|
343
381
|
labelKey: c = "label",
|
|
344
|
-
iconKey:
|
|
382
|
+
iconKey: a = "icon",
|
|
345
383
|
forceReadOnly: m = !1,
|
|
346
|
-
forceHidden:
|
|
347
|
-
valueManual:
|
|
348
|
-
onChangeManual:
|
|
349
|
-
errorManual:
|
|
384
|
+
forceHidden: d = !1,
|
|
385
|
+
valueManual: p,
|
|
386
|
+
onChangeManual: s,
|
|
387
|
+
errorManual: v
|
|
350
388
|
}) {
|
|
351
|
-
var
|
|
352
|
-
const
|
|
353
|
-
let
|
|
389
|
+
var H, V;
|
|
390
|
+
const x = p !== void 0 && !!s, { isReadOnly: I, isHidden: F } = G(), b = m || !!I(t), _ = d || !!F(t), { isView: R, isReadOnly: S } = z();
|
|
391
|
+
let N = null;
|
|
354
392
|
try {
|
|
355
|
-
|
|
393
|
+
N = W();
|
|
356
394
|
} catch {
|
|
357
395
|
}
|
|
358
|
-
const r =
|
|
359
|
-
(
|
|
360
|
-
|
|
396
|
+
const r = !x && N ? Z({ name: t, control: N.control, defaultValue: "" }) : null, i = !x && N ? ae({ name: t }) : null, l = x ? v : (V = (H = i == null ? void 0 : i.errors) == null ? void 0 : H[t]) == null ? void 0 : V.message, u = b || S || R, h = x ? p : (r == null ? void 0 : r.field.value) ?? "", E = U(
|
|
397
|
+
(O) => {
|
|
398
|
+
u || (x ? s == null || s(O) : (r == null || r.field.onChange(O), r == null || r.field.onBlur()));
|
|
361
399
|
},
|
|
362
|
-
[
|
|
400
|
+
[u, x, s, r]
|
|
363
401
|
);
|
|
364
|
-
return /* @__PURE__ */
|
|
365
|
-
|
|
366
|
-
/* @__PURE__ */ e("div", { className: `btn-group ${
|
|
367
|
-
const
|
|
402
|
+
return /* @__PURE__ */ y("div", { className: `form-group column ${_ ? "hidden" : ""}`, children: [
|
|
403
|
+
n && /* @__PURE__ */ e("label", { className: "control-label", children: n }),
|
|
404
|
+
/* @__PURE__ */ e("div", { className: `btn-group ${u ? "view-mode" : ""}`, "data-field-name": t, children: f.map((O) => {
|
|
405
|
+
const $ = O[o], k = h === $, B = O.color ? { "--customColor": O.color } : void 0;
|
|
368
406
|
return (
|
|
369
407
|
// Trocado de <label> para <div> para evitar comportamentos nativos de clique do HTML
|
|
370
|
-
/* @__PURE__ */
|
|
408
|
+
/* @__PURE__ */ y(
|
|
371
409
|
"div",
|
|
372
410
|
{
|
|
373
|
-
style:
|
|
411
|
+
style: B,
|
|
374
412
|
className: `btn fs-ellipsis ${k ? "active" : ""}`,
|
|
375
|
-
onClick: () =>
|
|
413
|
+
onClick: () => E($),
|
|
376
414
|
children: [
|
|
377
|
-
|
|
415
|
+
O[a] && /* @__PURE__ */ e("i", { className: `${O[a]} icon-sm` }),
|
|
378
416
|
" ",
|
|
379
|
-
|
|
417
|
+
O[c]
|
|
380
418
|
]
|
|
381
419
|
},
|
|
382
|
-
|
|
420
|
+
$
|
|
383
421
|
)
|
|
384
422
|
);
|
|
385
423
|
}) }),
|
|
386
|
-
|
|
387
|
-
(
|
|
424
|
+
!x && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: h || "", ref: r == null ? void 0 : r.field.ref }),
|
|
425
|
+
(l || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String(l ?? v) })
|
|
388
426
|
] });
|
|
389
427
|
}
|
|
390
|
-
const ut = q(
|
|
428
|
+
const ut = q(He), Le = ({
|
|
391
429
|
name: t,
|
|
392
|
-
label:
|
|
393
|
-
placeholder:
|
|
394
|
-
className:
|
|
430
|
+
label: n = "",
|
|
431
|
+
placeholder: f = "",
|
|
432
|
+
className: o = "",
|
|
395
433
|
rows: c = 4,
|
|
396
|
-
maxLength:
|
|
434
|
+
maxLength: a,
|
|
397
435
|
forceReadOnly: m = !1,
|
|
398
|
-
forceHidden:
|
|
399
|
-
valueManual:
|
|
400
|
-
onChangeManual:
|
|
401
|
-
errorManual:
|
|
436
|
+
forceHidden: d = !1,
|
|
437
|
+
valueManual: p,
|
|
438
|
+
onChangeManual: s,
|
|
439
|
+
errorManual: v
|
|
402
440
|
}) => {
|
|
403
|
-
var
|
|
404
|
-
const
|
|
405
|
-
let
|
|
406
|
-
value:
|
|
407
|
-
onChange: (
|
|
441
|
+
var u;
|
|
442
|
+
const x = p !== void 0 && !!s, { isReadOnly: I, isHidden: F } = G(), b = m || !!I(t), _ = d || !!F(t), { isView: R } = z(), S = ee(null);
|
|
443
|
+
let N = {
|
|
444
|
+
value: p ?? "",
|
|
445
|
+
onChange: (h) => s == null ? void 0 : s(h)
|
|
408
446
|
}, r = null;
|
|
409
|
-
if (
|
|
447
|
+
if (!x)
|
|
410
448
|
try {
|
|
411
|
-
const { control:
|
|
412
|
-
|
|
449
|
+
const { control: h } = W(), E = Z({ name: t, control: h });
|
|
450
|
+
N = E.field, r = (u = E.fieldState) == null ? void 0 : u.error;
|
|
413
451
|
} catch {
|
|
414
452
|
}
|
|
415
|
-
const
|
|
416
|
-
|
|
453
|
+
const i = () => {
|
|
454
|
+
S.current && (S.current.style.height = "auto", S.current.style.height = `${S.current.scrollHeight}px`);
|
|
417
455
|
};
|
|
418
|
-
if (
|
|
419
|
-
|
|
420
|
-
}, [
|
|
421
|
-
return /* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */ e("label", { children:
|
|
423
|
-
/* @__PURE__ */ e("span", { className: "form-control", children:
|
|
456
|
+
if (P(() => {
|
|
457
|
+
i();
|
|
458
|
+
}, [N.value]), R)
|
|
459
|
+
return /* @__PURE__ */ y("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
|
|
460
|
+
/* @__PURE__ */ e("label", { children: n }),
|
|
461
|
+
/* @__PURE__ */ e("span", { className: "form-control", children: N.value || "-" })
|
|
424
462
|
] });
|
|
425
|
-
const
|
|
426
|
-
return /* @__PURE__ */
|
|
427
|
-
|
|
463
|
+
const l = `form-control ${b ? "readOnly" : ""} ${r || v ? "border-red" : ""} ${o}`;
|
|
464
|
+
return /* @__PURE__ */ y("div", { className: `form-group ${_ ? "hidden" : ""}`, children: [
|
|
465
|
+
n && /* @__PURE__ */ e("label", { children: n }),
|
|
428
466
|
/* @__PURE__ */ e(
|
|
429
467
|
"textarea",
|
|
430
468
|
{
|
|
431
|
-
ref:
|
|
469
|
+
ref: S,
|
|
432
470
|
rows: c,
|
|
433
|
-
maxLength:
|
|
434
|
-
value:
|
|
435
|
-
placeholder:
|
|
471
|
+
maxLength: a,
|
|
472
|
+
value: N.value || "",
|
|
473
|
+
placeholder: f,
|
|
436
474
|
readOnly: b,
|
|
437
|
-
className:
|
|
475
|
+
className: l,
|
|
438
476
|
style: {
|
|
439
477
|
resize: "none",
|
|
440
478
|
maxHeight: "400px",
|
|
441
479
|
overflowY: "auto"
|
|
442
480
|
},
|
|
443
|
-
onChange: (
|
|
444
|
-
|
|
481
|
+
onChange: (h) => {
|
|
482
|
+
x ? s == null || s(h.target.value) : N.onChange(h);
|
|
445
483
|
},
|
|
446
|
-
onInput:
|
|
484
|
+
onInput: i
|
|
447
485
|
}
|
|
448
486
|
),
|
|
449
|
-
(r ||
|
|
487
|
+
(r || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((r == null ? void 0 : r.message) ?? v) })
|
|
450
488
|
] });
|
|
451
|
-
}, ft = q(
|
|
489
|
+
}, ft = q(Le);
|
|
452
490
|
/**
|
|
453
491
|
* @license lucide-react v0.575.0 - ISC
|
|
454
492
|
*
|
|
455
493
|
* This source code is licensed under the ISC license.
|
|
456
494
|
* See the LICENSE file in the root directory of this source tree.
|
|
457
495
|
*/
|
|
458
|
-
const
|
|
496
|
+
const me = (...t) => t.filter((n, f, o) => !!n && n.trim() !== "" && o.indexOf(n) === f).join(" ").trim();
|
|
459
497
|
/**
|
|
460
498
|
* @license lucide-react v0.575.0 - ISC
|
|
461
499
|
*
|
|
462
500
|
* This source code is licensed under the ISC license.
|
|
463
501
|
* See the LICENSE file in the root directory of this source tree.
|
|
464
502
|
*/
|
|
465
|
-
const
|
|
503
|
+
const Ce = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
466
504
|
/**
|
|
467
505
|
* @license lucide-react v0.575.0 - ISC
|
|
468
506
|
*
|
|
@@ -471,7 +509,7 @@ const Le = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
|
471
509
|
*/
|
|
472
510
|
const Fe = (t) => t.replace(
|
|
473
511
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
474
|
-
(
|
|
512
|
+
(n, f, o) => o ? o.toUpperCase() : f.toLowerCase()
|
|
475
513
|
);
|
|
476
514
|
/**
|
|
477
515
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -479,9 +517,9 @@ const Fe = (t) => t.replace(
|
|
|
479
517
|
* This source code is licensed under the ISC license.
|
|
480
518
|
* See the LICENSE file in the root directory of this source tree.
|
|
481
519
|
*/
|
|
482
|
-
const
|
|
483
|
-
const
|
|
484
|
-
return
|
|
520
|
+
const ie = (t) => {
|
|
521
|
+
const n = Fe(t);
|
|
522
|
+
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
485
523
|
};
|
|
486
524
|
/**
|
|
487
525
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -489,7 +527,7 @@ const ne = (t) => {
|
|
|
489
527
|
* This source code is licensed under the ISC license.
|
|
490
528
|
* See the LICENSE file in the root directory of this source tree.
|
|
491
529
|
*/
|
|
492
|
-
var
|
|
530
|
+
var je = {
|
|
493
531
|
xmlns: "http://www.w3.org/2000/svg",
|
|
494
532
|
width: 24,
|
|
495
533
|
height: 24,
|
|
@@ -506,9 +544,9 @@ var Te = {
|
|
|
506
544
|
* This source code is licensed under the ISC license.
|
|
507
545
|
* See the LICENSE file in the root directory of this source tree.
|
|
508
546
|
*/
|
|
509
|
-
const
|
|
510
|
-
for (const
|
|
511
|
-
if (
|
|
547
|
+
const Te = (t) => {
|
|
548
|
+
for (const n in t)
|
|
549
|
+
if (n.startsWith("aria-") || n === "role" || n === "title")
|
|
512
550
|
return !0;
|
|
513
551
|
return !1;
|
|
514
552
|
};
|
|
@@ -521,29 +559,29 @@ const je = (t) => {
|
|
|
521
559
|
const Pe = oe(
|
|
522
560
|
({
|
|
523
561
|
color: t = "currentColor",
|
|
524
|
-
size:
|
|
525
|
-
strokeWidth:
|
|
526
|
-
absoluteStrokeWidth:
|
|
562
|
+
size: n = 24,
|
|
563
|
+
strokeWidth: f = 2,
|
|
564
|
+
absoluteStrokeWidth: o,
|
|
527
565
|
className: c = "",
|
|
528
|
-
children:
|
|
566
|
+
children: a,
|
|
529
567
|
iconNode: m,
|
|
530
|
-
...
|
|
531
|
-
},
|
|
568
|
+
...d
|
|
569
|
+
}, p) => te(
|
|
532
570
|
"svg",
|
|
533
571
|
{
|
|
534
|
-
ref:
|
|
535
|
-
...
|
|
536
|
-
width:
|
|
537
|
-
height:
|
|
572
|
+
ref: p,
|
|
573
|
+
...je,
|
|
574
|
+
width: n,
|
|
575
|
+
height: n,
|
|
538
576
|
stroke: t,
|
|
539
|
-
strokeWidth:
|
|
540
|
-
className:
|
|
541
|
-
...!
|
|
542
|
-
...
|
|
577
|
+
strokeWidth: o ? Number(f) * 24 / Number(n) : f,
|
|
578
|
+
className: me("lucide", c),
|
|
579
|
+
...!a && !Te(d) && { "aria-hidden": "true" },
|
|
580
|
+
...d
|
|
543
581
|
},
|
|
544
582
|
[
|
|
545
|
-
...m.map(([
|
|
546
|
-
...Array.isArray(
|
|
583
|
+
...m.map(([s, v]) => te(s, v)),
|
|
584
|
+
...Array.isArray(a) ? a : [a]
|
|
547
585
|
]
|
|
548
586
|
)
|
|
549
587
|
);
|
|
@@ -553,20 +591,20 @@ const Pe = oe(
|
|
|
553
591
|
* This source code is licensed under the ISC license.
|
|
554
592
|
* See the LICENSE file in the root directory of this source tree.
|
|
555
593
|
*/
|
|
556
|
-
const
|
|
557
|
-
const
|
|
558
|
-
({ className:
|
|
559
|
-
ref:
|
|
560
|
-
iconNode:
|
|
561
|
-
className:
|
|
562
|
-
`lucide-${
|
|
594
|
+
const se = (t, n) => {
|
|
595
|
+
const f = oe(
|
|
596
|
+
({ className: o, ...c }, a) => te(Pe, {
|
|
597
|
+
ref: a,
|
|
598
|
+
iconNode: n,
|
|
599
|
+
className: me(
|
|
600
|
+
`lucide-${Ce(ie(t))}`,
|
|
563
601
|
`lucide-${t}`,
|
|
564
|
-
|
|
602
|
+
o
|
|
565
603
|
),
|
|
566
604
|
...c
|
|
567
605
|
})
|
|
568
606
|
);
|
|
569
|
-
return
|
|
607
|
+
return f.displayName = ie(t), f;
|
|
570
608
|
};
|
|
571
609
|
/**
|
|
572
610
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -579,25 +617,25 @@ const Ue = [
|
|
|
579
617
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
580
618
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
581
619
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
582
|
-
], Ye =
|
|
620
|
+
], Ye = se("calendar", Ue);
|
|
583
621
|
/**
|
|
584
622
|
* @license lucide-react v0.575.0 - ISC
|
|
585
623
|
*
|
|
586
624
|
* This source code is licensed under the ISC license.
|
|
587
625
|
* See the LICENSE file in the root directory of this source tree.
|
|
588
626
|
*/
|
|
589
|
-
const Je = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]],
|
|
627
|
+
const Je = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], We = se("chevron-left", Je);
|
|
590
628
|
/**
|
|
591
629
|
* @license lucide-react v0.575.0 - ISC
|
|
592
630
|
*
|
|
593
631
|
* This source code is licensed under the ISC license.
|
|
594
632
|
* See the LICENSE file in the root directory of this source tree.
|
|
595
633
|
*/
|
|
596
|
-
const
|
|
634
|
+
const ze = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], qe = se("chevron-right", ze), he = "dd/MM/yyyy", le = (t) => {
|
|
597
635
|
if (!t) return null;
|
|
598
|
-
const
|
|
599
|
-
return
|
|
600
|
-
},
|
|
636
|
+
const n = xe(t, he, /* @__PURE__ */ new Date());
|
|
637
|
+
return ue(n) ? n : null;
|
|
638
|
+
}, Ge = (t) => t ? fe(t, he) : "", Qe = [
|
|
601
639
|
{ value: 0, label: "Janeiro" },
|
|
602
640
|
{ value: 1, label: "Fevereiro" },
|
|
603
641
|
{ value: 2, label: "Março" },
|
|
@@ -610,99 +648,99 @@ const qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ge = ee("chevron-r
|
|
|
610
648
|
{ value: 9, label: "Outubro" },
|
|
611
649
|
{ value: 10, label: "Novembro" },
|
|
612
650
|
{ value: 11, label: "Dezembro" }
|
|
613
|
-
],
|
|
614
|
-
const
|
|
615
|
-
return { value:
|
|
651
|
+
], ce = 1940, Ze = 2100, Xe = Array.from({ length: Ze - ce + 1 }, (t, n) => {
|
|
652
|
+
const f = ce + n;
|
|
653
|
+
return { value: f, label: String(f) };
|
|
616
654
|
});
|
|
617
655
|
function Ke({
|
|
618
656
|
name: t,
|
|
619
|
-
label:
|
|
620
|
-
placeholder:
|
|
621
|
-
className:
|
|
657
|
+
label: n = "",
|
|
658
|
+
placeholder: f = "dd/mm/aaaa",
|
|
659
|
+
className: o = "",
|
|
622
660
|
forceReadOnly: c = !1,
|
|
623
|
-
forceHidden:
|
|
661
|
+
forceHidden: a = !1,
|
|
624
662
|
valueManual: m,
|
|
625
|
-
onChangeManual:
|
|
626
|
-
errorManual:
|
|
663
|
+
onChangeManual: d,
|
|
664
|
+
errorManual: p
|
|
627
665
|
}) {
|
|
628
|
-
var
|
|
629
|
-
const
|
|
630
|
-
let
|
|
631
|
-
},
|
|
666
|
+
var B;
|
|
667
|
+
const s = m !== void 0 && !!d, { isReadOnly: v, isHidden: x } = G(), I = c || !!v(t), F = a || !!x(t), { isView: b } = z();
|
|
668
|
+
let _ = "", R = () => {
|
|
669
|
+
}, S, N = null, r = () => {
|
|
632
670
|
};
|
|
633
|
-
if (
|
|
634
|
-
|
|
671
|
+
if (s)
|
|
672
|
+
_ = m;
|
|
635
673
|
else
|
|
636
674
|
try {
|
|
637
|
-
const
|
|
638
|
-
|
|
675
|
+
const g = W(), D = Z({ name: t, control: g.control });
|
|
676
|
+
_ = D.field.value, R = D.field.onChange, S = D.field.ref, N = (B = D.fieldState) == null ? void 0 : B.error, r = g.clearErrors;
|
|
639
677
|
} catch {
|
|
640
678
|
}
|
|
641
|
-
const [
|
|
642
|
-
|
|
643
|
-
if (
|
|
644
|
-
const
|
|
645
|
-
|
|
679
|
+
const [i, l] = Y(!1), [u, h] = Y(/* @__PURE__ */ new Date()), E = ee(null);
|
|
680
|
+
P(() => {
|
|
681
|
+
if (i) {
|
|
682
|
+
const g = le(_);
|
|
683
|
+
h(g && ue(g) ? g : /* @__PURE__ */ new Date());
|
|
646
684
|
}
|
|
647
|
-
}, [
|
|
648
|
-
const
|
|
649
|
-
|
|
685
|
+
}, [i, _]), P(() => {
|
|
686
|
+
const g = (D) => {
|
|
687
|
+
E.current && !E.current.contains(D.target) && l(!1);
|
|
650
688
|
};
|
|
651
|
-
return document.addEventListener("mousedown",
|
|
689
|
+
return document.addEventListener("mousedown", g), () => document.removeEventListener("mousedown", g);
|
|
652
690
|
}, []);
|
|
653
|
-
const
|
|
654
|
-
if (
|
|
655
|
-
const D =
|
|
656
|
-
|
|
657
|
-
},
|
|
658
|
-
start:
|
|
659
|
-
end: ye(
|
|
660
|
-
}), [
|
|
661
|
-
return /* @__PURE__ */
|
|
662
|
-
/* @__PURE__ */ e("label", { className: "control-label", children:
|
|
663
|
-
b ? /* @__PURE__ */ e("span", { className: "form-control", children:
|
|
691
|
+
const H = J(() => le(_), [_]), V = (g) => {
|
|
692
|
+
if (I) return;
|
|
693
|
+
const D = Ge(g);
|
|
694
|
+
s ? d == null || d(D) : (R(D), r == null || r(t)), l(!1);
|
|
695
|
+
}, O = J(() => ve({
|
|
696
|
+
start: be(Ne(u)),
|
|
697
|
+
end: ye(ge(u))
|
|
698
|
+
}), [u]), $ = u.getMonth(), k = ke(u);
|
|
699
|
+
return /* @__PURE__ */ y("div", { className: `dfe-datepicker-wrapper form-group ${F ? "hidden" : ""} ${o}`, ref: E, children: [
|
|
700
|
+
/* @__PURE__ */ e("label", { className: "control-label", children: n }),
|
|
701
|
+
b ? /* @__PURE__ */ e("span", { className: "form-control", children: _ || "-" }) : (
|
|
664
702
|
/* Container isolador de contexto posicional */
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
/* @__PURE__ */
|
|
703
|
+
/* @__PURE__ */ y("div", { className: "dfe-datepicker-inner-container", children: [
|
|
704
|
+
/* @__PURE__ */ y(
|
|
667
705
|
"div",
|
|
668
706
|
{
|
|
669
|
-
className: `dfe-datepicker-control ${
|
|
670
|
-
onClick: () => !
|
|
671
|
-
ref:
|
|
707
|
+
className: `dfe-datepicker-control ${N ? "border-red" : ""} ${I ? "readOnly" : ""}`,
|
|
708
|
+
onClick: () => !I && l((g) => !g),
|
|
709
|
+
ref: S,
|
|
672
710
|
children: [
|
|
673
|
-
/* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${
|
|
711
|
+
/* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${I ? "readOnly" : ""}`, children: _ || f }),
|
|
674
712
|
/* @__PURE__ */ e(Ye, { size: 16, className: "dfe-datepicker-icon" })
|
|
675
713
|
]
|
|
676
714
|
}
|
|
677
715
|
),
|
|
678
|
-
|
|
679
|
-
/* @__PURE__ */
|
|
716
|
+
i && !I && /* @__PURE__ */ y("div", { className: "dfe-datepicker-dropdown", onClick: (g) => g.stopPropagation(), children: [
|
|
717
|
+
/* @__PURE__ */ y("div", { className: "dfe-datepicker-header", children: [
|
|
680
718
|
/* @__PURE__ */ e(
|
|
681
719
|
"button",
|
|
682
720
|
{
|
|
683
721
|
type: "button",
|
|
684
|
-
onClick: () =>
|
|
722
|
+
onClick: () => h(we(u, 1)),
|
|
685
723
|
className: "dfe-datepicker-nav-btn",
|
|
686
|
-
children: /* @__PURE__ */ e(
|
|
724
|
+
children: /* @__PURE__ */ e(We, { size: 16 })
|
|
687
725
|
}
|
|
688
726
|
),
|
|
689
|
-
/* @__PURE__ */
|
|
727
|
+
/* @__PURE__ */ y("div", { className: "dfe-datepicker-selectors", children: [
|
|
690
728
|
/* @__PURE__ */ e(
|
|
691
|
-
|
|
729
|
+
ne,
|
|
692
730
|
{
|
|
693
731
|
name: "datepicker_internal_month",
|
|
694
|
-
valueManual:
|
|
695
|
-
onChangeManual: (
|
|
732
|
+
valueManual: $,
|
|
733
|
+
onChangeManual: (g) => h($e(u, Number(g))),
|
|
696
734
|
options: Qe,
|
|
697
735
|
placeholder: "Mês"
|
|
698
736
|
}
|
|
699
737
|
),
|
|
700
738
|
/* @__PURE__ */ e(
|
|
701
|
-
|
|
739
|
+
ne,
|
|
702
740
|
{
|
|
703
741
|
name: "datepicker_internal_year",
|
|
704
742
|
valueManual: k,
|
|
705
|
-
onChangeManual: (
|
|
743
|
+
onChangeManual: (g) => h(Oe(u, Number(g))),
|
|
706
744
|
options: Xe,
|
|
707
745
|
enableSearch: !0,
|
|
708
746
|
searchPlaceholder: "Buscar ano...",
|
|
@@ -714,24 +752,24 @@ function Ke({
|
|
|
714
752
|
"button",
|
|
715
753
|
{
|
|
716
754
|
type: "button",
|
|
717
|
-
onClick: () =>
|
|
755
|
+
onClick: () => h(_e(u, 1)),
|
|
718
756
|
className: "dfe-datepicker-nav-btn",
|
|
719
|
-
children: /* @__PURE__ */ e(
|
|
757
|
+
children: /* @__PURE__ */ e(qe, { size: 16 })
|
|
720
758
|
}
|
|
721
759
|
)
|
|
722
760
|
] }),
|
|
723
|
-
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((
|
|
724
|
-
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children:
|
|
725
|
-
const
|
|
761
|
+
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((g, D) => /* @__PURE__ */ e("span", { children: g }, D)) }),
|
|
762
|
+
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children: O.map((g, D) => {
|
|
763
|
+
const j = !Re(g, u), X = H && Se(g, H);
|
|
726
764
|
return /* @__PURE__ */ e(
|
|
727
765
|
"div",
|
|
728
766
|
{
|
|
729
|
-
onClick: () => !
|
|
767
|
+
onClick: () => !j && V(g),
|
|
730
768
|
className: `dfe-datepicker-day
|
|
731
|
-
${
|
|
732
|
-
${
|
|
733
|
-
${
|
|
734
|
-
children:
|
|
769
|
+
${X ? "selected" : "handleHover"}
|
|
770
|
+
${j ? "outside" : ""}
|
|
771
|
+
${Ae(g) ? "today" : ""}`,
|
|
772
|
+
children: fe(g, "d")
|
|
735
773
|
},
|
|
736
774
|
D
|
|
737
775
|
);
|
|
@@ -739,30 +777,30 @@ function Ke({
|
|
|
739
777
|
] })
|
|
740
778
|
] })
|
|
741
779
|
),
|
|
742
|
-
!
|
|
743
|
-
(
|
|
780
|
+
!s && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: _ || "" }),
|
|
781
|
+
(N || p) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((N == null ? void 0 : N.message) ?? p) })
|
|
744
782
|
] });
|
|
745
783
|
}
|
|
746
784
|
const mt = q(Ke);
|
|
747
785
|
function Me({
|
|
748
786
|
mapping: t = {},
|
|
749
|
-
defaultLabel:
|
|
750
|
-
className:
|
|
751
|
-
hidden:
|
|
787
|
+
defaultLabel: n = "Não reconhecido",
|
|
788
|
+
className: f = "",
|
|
789
|
+
hidden: o = !1,
|
|
752
790
|
label: c
|
|
753
791
|
}) {
|
|
754
|
-
const { activityId:
|
|
792
|
+
const { activityId: a } = z(), m = J(() => !t || a === null || a === void 0 ? null : t[a], [a, t]);
|
|
755
793
|
if (!m)
|
|
756
|
-
return /* @__PURE__ */
|
|
794
|
+
return /* @__PURE__ */ y("div", { className: `form-group ${o ? "hidden" : ""}`, children: [
|
|
757
795
|
c && /* @__PURE__ */ e("label", { children: c }),
|
|
758
|
-
/* @__PURE__ */ e("div", { className: `status-badge default ${
|
|
796
|
+
/* @__PURE__ */ e("div", { className: `status-badge default ${f}`, children: n })
|
|
759
797
|
] });
|
|
760
|
-
const
|
|
798
|
+
const d = {
|
|
761
799
|
"--customColor": m.color
|
|
762
800
|
};
|
|
763
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ y("div", { className: `form-group ${o ? "hidden" : ""}`, children: [
|
|
764
802
|
c && /* @__PURE__ */ e("label", { children: c }),
|
|
765
|
-
/* @__PURE__ */
|
|
803
|
+
/* @__PURE__ */ y("div", { className: `status-badge ${f}`, style: d, children: [
|
|
766
804
|
m.icon && /* @__PURE__ */ e("i", { className: m.icon }),
|
|
767
805
|
/* @__PURE__ */ e("span", { children: m.label })
|
|
768
806
|
] })
|
|
@@ -771,315 +809,315 @@ function Me({
|
|
|
771
809
|
const ht = q(Me);
|
|
772
810
|
function et({
|
|
773
811
|
name: t,
|
|
774
|
-
control:
|
|
775
|
-
defaultRowValue:
|
|
776
|
-
isView:
|
|
812
|
+
control: n,
|
|
813
|
+
defaultRowValue: f,
|
|
814
|
+
isView: o,
|
|
777
815
|
isReadOnly: c,
|
|
778
|
-
filters:
|
|
816
|
+
filters: a = []
|
|
779
817
|
}) {
|
|
780
|
-
const { field: m } =
|
|
818
|
+
const { field: m } = Z({ name: t, control: n }), [d, p] = Y([]), [s, v] = Y([]), x = () => Date.now() + Math.random(), I = (i) => {
|
|
781
819
|
try {
|
|
782
|
-
const
|
|
783
|
-
return Array.isArray(
|
|
784
|
-
...
|
|
785
|
-
_uid:
|
|
820
|
+
const l = JSON.parse(i);
|
|
821
|
+
return Array.isArray(l) ? l.map((u) => ({
|
|
822
|
+
...u,
|
|
823
|
+
_uid: u._uid || x()
|
|
786
824
|
})) : [];
|
|
787
|
-
} catch (
|
|
788
|
-
return console.error(`Erro ao ler dados da tabela "${t}":`,
|
|
825
|
+
} catch (l) {
|
|
826
|
+
return console.error(`Erro ao ler dados da tabela "${t}":`, l), [];
|
|
789
827
|
}
|
|
790
828
|
};
|
|
791
|
-
|
|
792
|
-
if (!(
|
|
793
|
-
const
|
|
794
|
-
if (m.value ===
|
|
795
|
-
const
|
|
796
|
-
|
|
829
|
+
P(() => {
|
|
830
|
+
if (!(d.length > 0 && !o) && m.value && typeof m.value == "string") {
|
|
831
|
+
const i = JSON.stringify(d);
|
|
832
|
+
if (m.value === i) return;
|
|
833
|
+
const l = I(m.value);
|
|
834
|
+
p(l);
|
|
797
835
|
}
|
|
798
|
-
}, [m.value,
|
|
836
|
+
}, [m.value, o]), P(() => {
|
|
799
837
|
if (c) return;
|
|
800
|
-
const
|
|
801
|
-
m.value !==
|
|
802
|
-
}, [
|
|
803
|
-
const
|
|
804
|
-
const
|
|
805
|
-
|
|
806
|
-
}, [
|
|
807
|
-
|
|
808
|
-
}, [
|
|
809
|
-
|
|
810
|
-
}, []),
|
|
811
|
-
|
|
812
|
-
}, []),
|
|
813
|
-
(
|
|
814
|
-
|
|
838
|
+
const i = JSON.stringify(d);
|
|
839
|
+
m.value !== i && m.onChange(i);
|
|
840
|
+
}, [d, m, c]);
|
|
841
|
+
const F = U(() => {
|
|
842
|
+
const i = { _uid: x(), ...f };
|
|
843
|
+
p((l) => [...l, i]);
|
|
844
|
+
}, [f]), b = U(() => {
|
|
845
|
+
p((i) => i.filter((l) => !s.includes(l._uid))), v([]);
|
|
846
|
+
}, [s]), _ = U((i, l, u) => {
|
|
847
|
+
p((h) => h.map((E) => E._uid === i ? { ...E, [l]: u } : E));
|
|
848
|
+
}, []), R = U((i) => {
|
|
849
|
+
v((l) => l.includes(i) ? l.filter((u) => u !== i) : [...l, i]);
|
|
850
|
+
}, []), S = U(
|
|
851
|
+
(i) => {
|
|
852
|
+
v(i ? d.map((l) => l._uid) : []);
|
|
815
853
|
},
|
|
816
|
-
[
|
|
817
|
-
),
|
|
818
|
-
(
|
|
819
|
-
if ("custom" in
|
|
820
|
-
return
|
|
821
|
-
const
|
|
822
|
-
switch (
|
|
854
|
+
[d]
|
|
855
|
+
), N = d.length > 0 && s.length === d.length, r = J(() => !a || a.length === 0 ? d : d.filter(
|
|
856
|
+
(i) => a.every((l) => {
|
|
857
|
+
if ("custom" in l)
|
|
858
|
+
return l.custom(i);
|
|
859
|
+
const u = i[l.field];
|
|
860
|
+
switch (l.operator) {
|
|
823
861
|
case "===":
|
|
824
|
-
return
|
|
862
|
+
return u === l.value;
|
|
825
863
|
case "!==":
|
|
826
|
-
return
|
|
864
|
+
return u !== l.value;
|
|
827
865
|
case ">":
|
|
828
|
-
return
|
|
866
|
+
return u > l.value;
|
|
829
867
|
case "<":
|
|
830
|
-
return
|
|
868
|
+
return u < l.value;
|
|
831
869
|
case ">=":
|
|
832
|
-
return
|
|
870
|
+
return u >= l.value;
|
|
833
871
|
case "<=":
|
|
834
|
-
return
|
|
872
|
+
return u <= l.value;
|
|
835
873
|
default:
|
|
836
874
|
return !0;
|
|
837
875
|
}
|
|
838
876
|
})
|
|
839
|
-
), [
|
|
877
|
+
), [d, a]);
|
|
840
878
|
return {
|
|
841
879
|
field: m,
|
|
842
|
-
tableRows:
|
|
880
|
+
tableRows: d,
|
|
843
881
|
visibleRows: r,
|
|
844
|
-
selectedRowIds:
|
|
845
|
-
isAllSelected:
|
|
882
|
+
selectedRowIds: s,
|
|
883
|
+
isAllSelected: N,
|
|
846
884
|
handle: {
|
|
847
|
-
addRow:
|
|
885
|
+
addRow: F,
|
|
848
886
|
removeRows: b,
|
|
849
|
-
updateCellValue:
|
|
850
|
-
toggleSelection:
|
|
851
|
-
toggleSelectAll:
|
|
887
|
+
updateCellValue: _,
|
|
888
|
+
toggleSelection: R,
|
|
889
|
+
toggleSelectAll: S
|
|
852
890
|
}
|
|
853
891
|
};
|
|
854
892
|
}
|
|
855
893
|
const pt = ({
|
|
856
894
|
name: t,
|
|
857
|
-
title:
|
|
858
|
-
columns:
|
|
859
|
-
defaultRowValue:
|
|
895
|
+
title: n = "Tabela Dinâmica",
|
|
896
|
+
columns: f,
|
|
897
|
+
defaultRowValue: o = {},
|
|
860
898
|
forceReadOnly: c = !1,
|
|
861
|
-
layout:
|
|
899
|
+
layout: a = "fluid",
|
|
862
900
|
actions: m = !0,
|
|
863
|
-
filters:
|
|
901
|
+
filters: d = []
|
|
864
902
|
}) => {
|
|
865
|
-
const { control:
|
|
903
|
+
const { control: p } = W(), { isView: s, isReadOnly: v } = z(), { isReadOnly: x } = G(), I = c || s || v || x && x(t), { field: F, visibleRows: b, selectedRowIds: _, isAllSelected: R, handle: S } = et({
|
|
866
904
|
name: t,
|
|
867
|
-
control:
|
|
868
|
-
defaultRowValue:
|
|
869
|
-
isView:
|
|
870
|
-
isReadOnly: !!
|
|
871
|
-
filters:
|
|
872
|
-
}),
|
|
873
|
-
return /* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */ e("input", { type: "hidden", ...
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */ e("h3", { children:
|
|
877
|
-
!
|
|
878
|
-
/* @__PURE__ */
|
|
905
|
+
control: p,
|
|
906
|
+
defaultRowValue: o,
|
|
907
|
+
isView: s,
|
|
908
|
+
isReadOnly: !!I,
|
|
909
|
+
filters: d
|
|
910
|
+
}), N = a === "fixed";
|
|
911
|
+
return /* @__PURE__ */ y("div", { className: `table-wrapper ${N ? "table-fixed" : "table-fluid"}`, children: [
|
|
912
|
+
/* @__PURE__ */ e("input", { type: "hidden", ...F }),
|
|
913
|
+
/* @__PURE__ */ y("div", { className: "header-handle", children: [
|
|
914
|
+
/* @__PURE__ */ e("h3", { children: n }),
|
|
915
|
+
!I && m && /* @__PURE__ */ y("div", { className: "handle-actions", children: [
|
|
916
|
+
/* @__PURE__ */ y(
|
|
879
917
|
"button",
|
|
880
918
|
{
|
|
881
919
|
type: "button",
|
|
882
|
-
className: `btn ${
|
|
883
|
-
disabled:
|
|
884
|
-
onClick:
|
|
920
|
+
className: `btn ${_.length > 0 ? "btn-danger" : "btn-primary"}`,
|
|
921
|
+
disabled: _.length === 0,
|
|
922
|
+
onClick: S.removeRows,
|
|
885
923
|
children: [
|
|
886
924
|
"Remover (",
|
|
887
|
-
|
|
925
|
+
_.length,
|
|
888
926
|
")"
|
|
889
927
|
]
|
|
890
928
|
}
|
|
891
929
|
),
|
|
892
|
-
/* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick:
|
|
930
|
+
/* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: S.addRow, children: "Adicionar" })
|
|
893
931
|
] })
|
|
894
932
|
] }),
|
|
895
|
-
/* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */
|
|
896
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
897
|
-
!
|
|
933
|
+
/* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */ y("table", { className: "table-custom", children: [
|
|
934
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ y("tr", { children: [
|
|
935
|
+
!I && /* @__PURE__ */ e("th", { style: { width: "50px" }, children: /* @__PURE__ */ e(
|
|
898
936
|
"input",
|
|
899
937
|
{
|
|
900
938
|
type: "checkbox",
|
|
901
|
-
checked:
|
|
902
|
-
onChange: (r) =>
|
|
939
|
+
checked: R,
|
|
940
|
+
onChange: (r) => S.toggleSelectAll(r.target.checked)
|
|
903
941
|
}
|
|
904
942
|
) }),
|
|
905
|
-
|
|
943
|
+
f.map((r) => /* @__PURE__ */ e(
|
|
906
944
|
"th",
|
|
907
945
|
{
|
|
908
|
-
style: r.width ? { minWidth:
|
|
946
|
+
style: r.width ? { minWidth: N ? r.width : "100%" } : { width: "max-content" },
|
|
909
947
|
children: r.label
|
|
910
948
|
},
|
|
911
949
|
String(r.key)
|
|
912
950
|
))
|
|
913
951
|
] }) }),
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
b.map((r,
|
|
916
|
-
!
|
|
952
|
+
/* @__PURE__ */ y("tbody", { children: [
|
|
953
|
+
b.map((r, i) => /* @__PURE__ */ y("tr", { children: [
|
|
954
|
+
!I && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
917
955
|
"input",
|
|
918
956
|
{
|
|
919
957
|
type: "checkbox",
|
|
920
|
-
checked:
|
|
921
|
-
onChange: () =>
|
|
958
|
+
checked: _.includes(r._uid),
|
|
959
|
+
onChange: () => S.toggleSelection(r._uid)
|
|
922
960
|
}
|
|
923
961
|
) }),
|
|
924
|
-
|
|
962
|
+
f.map((l) => /* @__PURE__ */ e("td", { children: l.render ? l.render.length <= 1 ? l.render({
|
|
925
963
|
row: r,
|
|
926
|
-
index:
|
|
927
|
-
updateRow: (
|
|
928
|
-
isLocked: !!
|
|
929
|
-
isView: !!
|
|
930
|
-
}) :
|
|
964
|
+
index: i,
|
|
965
|
+
updateRow: (u, h) => S.updateCellValue(r._uid, String(u), h),
|
|
966
|
+
isLocked: !!I,
|
|
967
|
+
isView: !!s
|
|
968
|
+
}) : l.render(
|
|
931
969
|
r,
|
|
932
|
-
|
|
933
|
-
(
|
|
934
|
-
!!
|
|
935
|
-
!!
|
|
936
|
-
) : r[
|
|
970
|
+
i,
|
|
971
|
+
(u, h) => S.updateCellValue(r._uid, u, h),
|
|
972
|
+
!!I,
|
|
973
|
+
!!s
|
|
974
|
+
) : r[l.key] }, `${r._uid}-${String(l.key)}`))
|
|
937
975
|
] }, r._uid)),
|
|
938
|
-
b.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children:
|
|
976
|
+
b.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children: I ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
939
977
|
] })
|
|
940
978
|
] }) })
|
|
941
979
|
] });
|
|
942
|
-
}, tt = (t,
|
|
943
|
-
const [
|
|
980
|
+
}, tt = (t, n) => {
|
|
981
|
+
const [f, o] = Y(null);
|
|
944
982
|
let c = null;
|
|
945
983
|
try {
|
|
946
|
-
c =
|
|
984
|
+
c = W().watch;
|
|
947
985
|
} catch {
|
|
948
986
|
}
|
|
949
|
-
const
|
|
987
|
+
const a = n !== void 0 ? n : c ? c(t) : void 0, m = U(() => {
|
|
950
988
|
try {
|
|
951
|
-
const
|
|
952
|
-
if (
|
|
953
|
-
const
|
|
954
|
-
|
|
989
|
+
const p = window.top.__REACT_ATTACHMENT_BRIDGE__;
|
|
990
|
+
if (p) {
|
|
991
|
+
const s = p.getAttachment(t, a);
|
|
992
|
+
o(s || (a ? { name: a, documentId: 0 } : null));
|
|
955
993
|
} else
|
|
956
|
-
|
|
994
|
+
o(a ? { name: a, documentId: 0 } : null);
|
|
957
995
|
} catch {
|
|
958
|
-
|
|
996
|
+
o(a ? { name: a, documentId: 0 } : null);
|
|
959
997
|
}
|
|
960
|
-
}, [t,
|
|
961
|
-
return
|
|
998
|
+
}, [t, a, n]);
|
|
999
|
+
return P(() => {
|
|
962
1000
|
m();
|
|
963
|
-
const
|
|
964
|
-
return () => clearInterval(
|
|
965
|
-
}, [m]), { attachment:
|
|
1001
|
+
const d = setInterval(m, 2e3);
|
|
1002
|
+
return () => clearInterval(d);
|
|
1003
|
+
}, [m]), { attachment: f, sync: m };
|
|
966
1004
|
}, st = ({
|
|
967
1005
|
name: t,
|
|
968
|
-
label:
|
|
969
|
-
help:
|
|
970
|
-
valueManual:
|
|
1006
|
+
label: n,
|
|
1007
|
+
help: f,
|
|
1008
|
+
valueManual: o,
|
|
971
1009
|
onChangeManual: c,
|
|
972
|
-
forceReadOnly:
|
|
1010
|
+
forceReadOnly: a = !1,
|
|
973
1011
|
forceHidden: m = !1,
|
|
974
|
-
helpText:
|
|
975
|
-
helpTitle:
|
|
976
|
-
helpWidth:
|
|
1012
|
+
helpText: d,
|
|
1013
|
+
helpTitle: p,
|
|
1014
|
+
helpWidth: s
|
|
977
1015
|
}) => {
|
|
978
|
-
const
|
|
979
|
-
let
|
|
1016
|
+
const v = !!c, { isReadOnly: x, isHidden: I } = G(), { isView: F } = z(), b = a || F || !!x(t), _ = m || !!I(t), [R, S] = Y(!1);
|
|
1017
|
+
let N = null;
|
|
980
1018
|
try {
|
|
981
|
-
|
|
1019
|
+
N = W().control;
|
|
982
1020
|
} catch {
|
|
983
1021
|
}
|
|
984
|
-
const r =
|
|
985
|
-
value:
|
|
986
|
-
onChange: (
|
|
987
|
-
}, { attachment:
|
|
988
|
-
var
|
|
1022
|
+
const r = N && !v ? Z({ name: t, control: N }).field : {
|
|
1023
|
+
value: o,
|
|
1024
|
+
onChange: ($) => c == null ? void 0 : c($)
|
|
1025
|
+
}, { attachment: i, sync: l } = tt(t, o), u = () => {
|
|
1026
|
+
var $;
|
|
989
1027
|
try {
|
|
990
1028
|
const k = window.top;
|
|
991
1029
|
return {
|
|
992
1030
|
bridge: k.__REACT_ATTACHMENT_BRIDGE__,
|
|
993
|
-
toast: (
|
|
1031
|
+
toast: ($ = k.FLUIGC) == null ? void 0 : $.toast
|
|
994
1032
|
};
|
|
995
1033
|
} catch {
|
|
996
1034
|
return { bridge: null, toast: null };
|
|
997
1035
|
}
|
|
998
|
-
},
|
|
1036
|
+
}, h = U(() => {
|
|
999
1037
|
if (b) return;
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
const
|
|
1003
|
-
if (!
|
|
1004
|
-
const { bridge:
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1038
|
+
const $ = document.createElement("input");
|
|
1039
|
+
$.type = "file", $.onchange = (k) => {
|
|
1040
|
+
const B = k.target.files[0];
|
|
1041
|
+
if (!B) return;
|
|
1042
|
+
const { bridge: g, toast: D } = u();
|
|
1043
|
+
S(!0), g ? g.upload(B, t, (j) => {
|
|
1044
|
+
v ? c == null || c(j.name) : r.onChange(j.name), setTimeout(() => {
|
|
1045
|
+
S(!1), l();
|
|
1008
1046
|
}, 1e3), D && D({
|
|
1009
1047
|
title: "Sucesso",
|
|
1010
1048
|
message: "Arquivo enviado",
|
|
1011
1049
|
type: "success"
|
|
1012
1050
|
});
|
|
1013
|
-
}) : (
|
|
1014
|
-
},
|
|
1015
|
-
}, [t, r,
|
|
1016
|
-
if (
|
|
1017
|
-
const k = (
|
|
1051
|
+
}) : (v ? c == null || c(B.name) : r.onChange(B.name), S(!1));
|
|
1052
|
+
}, $.click();
|
|
1053
|
+
}, [t, r, l, c, b, v]), E = ($) => {
|
|
1054
|
+
if ($.stopPropagation(), b) return;
|
|
1055
|
+
const k = (i == null ? void 0 : i.name) || o || r.value;
|
|
1018
1056
|
if (!k) return;
|
|
1019
|
-
const { bridge:
|
|
1020
|
-
|
|
1057
|
+
const { bridge: B, toast: g } = u();
|
|
1058
|
+
B ? B.removeByFileName(k) ? (v ? c == null || c("") : r.onChange(""), l()) : g && g({
|
|
1021
1059
|
title: "Erro",
|
|
1022
1060
|
message: "Erro ao remover anexo",
|
|
1023
1061
|
type: "danger"
|
|
1024
|
-
}) : (
|
|
1025
|
-
},
|
|
1062
|
+
}) : (v ? c == null || c("") : r.onChange(""), l());
|
|
1063
|
+
}, H = !!i && !R, V = (i == null ? void 0 : i.name) || o || r.value, O = [
|
|
1026
1064
|
"fluig-attachment__box",
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
b && !
|
|
1030
|
-
b &&
|
|
1065
|
+
H ? "fluig-attachment__box--has-file" : "",
|
|
1066
|
+
R ? "fluig-attachment__box--uploading" : "",
|
|
1067
|
+
b && !H ? "readOnly" : "",
|
|
1068
|
+
b && H ? "fluig-attachment__box--readonly-view" : ""
|
|
1031
1069
|
].join(" ");
|
|
1032
|
-
return
|
|
1033
|
-
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
/* @__PURE__ */
|
|
1070
|
+
return _ ? null : /* @__PURE__ */ y("div", { className: "form-group fluig-attachment", children: [
|
|
1071
|
+
n && /* @__PURE__ */ e("label", { className: "fluig-attachment__label", children: n }),
|
|
1072
|
+
/* @__PURE__ */ y("div", { className: d ? "dfe-flex-input-wrapper" : "", children: [
|
|
1073
|
+
/* @__PURE__ */ y(
|
|
1036
1074
|
"div",
|
|
1037
1075
|
{
|
|
1038
|
-
className:
|
|
1039
|
-
style:
|
|
1076
|
+
className: O,
|
|
1077
|
+
style: d ? { flex: 1 } : void 0,
|
|
1040
1078
|
onClick: () => {
|
|
1041
|
-
if (
|
|
1042
|
-
const
|
|
1043
|
-
|
|
1079
|
+
if (H) {
|
|
1080
|
+
const $ = u(), k = (i == null ? void 0 : i.physicalFileName) || (i == null ? void 0 : i.description) || (i == null ? void 0 : i.name) || V;
|
|
1081
|
+
$.bridge && k && $.bridge.view(k);
|
|
1044
1082
|
} else
|
|
1045
|
-
|
|
1083
|
+
h();
|
|
1046
1084
|
},
|
|
1047
1085
|
children: [
|
|
1048
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ y("span", { className: "fluig-attachment__content", children: [
|
|
1049
1087
|
/* @__PURE__ */ e(
|
|
1050
1088
|
"i",
|
|
1051
1089
|
{
|
|
1052
|
-
className: `flaticon icon-sm ${
|
|
1090
|
+
className: `flaticon icon-sm ${R ? "flaticon-loading" : H ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
|
|
1053
1091
|
}
|
|
1054
1092
|
),
|
|
1055
|
-
/* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children:
|
|
1093
|
+
/* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children: R ? " Enviando..." : H ? V : b ? "Nenhum arquivo" : f || "Anexar" })
|
|
1056
1094
|
] }),
|
|
1057
|
-
|
|
1095
|
+
H && !b && /* @__PURE__ */ e(
|
|
1058
1096
|
"button",
|
|
1059
1097
|
{
|
|
1060
1098
|
type: "button",
|
|
1061
1099
|
className: "fluig-attachment__btn-remove btn btn-link text-danger",
|
|
1062
|
-
onClick:
|
|
1100
|
+
onClick: E,
|
|
1063
1101
|
children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-trash icon-sm" })
|
|
1064
1102
|
}
|
|
1065
1103
|
)
|
|
1066
1104
|
]
|
|
1067
1105
|
}
|
|
1068
1106
|
),
|
|
1069
|
-
|
|
1107
|
+
d && /* @__PURE__ */ e(M, { text: d, title: p, width: s })
|
|
1070
1108
|
] }),
|
|
1071
|
-
!
|
|
1109
|
+
!v && N && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: r.value || "" })
|
|
1072
1110
|
] });
|
|
1073
1111
|
}, vt = q(st);
|
|
1074
1112
|
export {
|
|
1075
1113
|
vt as Attachment,
|
|
1076
1114
|
at as Checkbox,
|
|
1077
1115
|
mt as DatePicker,
|
|
1078
|
-
|
|
1079
|
-
|
|
1116
|
+
M as Help,
|
|
1117
|
+
ot as Input,
|
|
1080
1118
|
Ie as Modal,
|
|
1081
1119
|
ut as RadioBtn,
|
|
1082
|
-
|
|
1120
|
+
ne as Select,
|
|
1083
1121
|
pt as SimpleTable,
|
|
1084
1122
|
ht as StatusBadge,
|
|
1085
1123
|
ft as TextArea
|