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