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