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