diefra_ecm_ui 1.2.5 → 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/index.cjs +25 -15
- package/dist/index.js +678 -645
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,37 +1,64 @@
|
|
|
1
|
-
import { jsx as e, jsxs as
|
|
2
|
-
import { useCallback as
|
|
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 Y(() => (
|
|
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
|
-
className: `dfe-help-indicator ${
|
|
34
|
-
onClick:
|
|
60
|
+
className: `dfe-help-indicator ${a}`,
|
|
61
|
+
onClick: p,
|
|
35
62
|
role: "button",
|
|
36
63
|
tabIndex: 0,
|
|
37
64
|
"aria-label": "Botão de ajuda",
|
|
@@ -40,463 +67,463 @@ function Ee({ text: t, title: c = "Ajuda & Informações", width: p = "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:
|
|
65
|
-
type:
|
|
66
|
-
mask:
|
|
67
|
-
className:
|
|
68
|
-
forceReadOnly:
|
|
69
|
-
forceHidden:
|
|
70
|
-
prefix:
|
|
90
|
+
label: i = "",
|
|
91
|
+
placeholder: h = "",
|
|
92
|
+
type: a = "text",
|
|
93
|
+
mask: o,
|
|
94
|
+
className: d = "",
|
|
95
|
+
forceReadOnly: p = !1,
|
|
96
|
+
forceHidden: n = !1,
|
|
97
|
+
prefix: g,
|
|
71
98
|
suffix: r,
|
|
72
|
-
helpText:
|
|
73
|
-
helpTitle:
|
|
74
|
-
helpWidth:
|
|
75
|
-
valueManual:
|
|
76
|
-
onChangeManual:
|
|
77
|
-
errorManual:
|
|
99
|
+
helpText: m,
|
|
100
|
+
helpTitle: A,
|
|
101
|
+
helpWidth: I,
|
|
102
|
+
valueManual: j,
|
|
103
|
+
onChangeManual: y,
|
|
104
|
+
errorManual: H
|
|
78
105
|
}) {
|
|
79
|
-
var Q,
|
|
80
|
-
const
|
|
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();
|
|
81
108
|
let f = null;
|
|
82
109
|
try {
|
|
83
|
-
f =
|
|
110
|
+
f = Z();
|
|
84
111
|
} catch {
|
|
85
112
|
}
|
|
86
|
-
const
|
|
87
|
-
(
|
|
88
|
-
if (
|
|
89
|
-
let
|
|
90
|
-
if (
|
|
91
|
-
const
|
|
92
|
-
return isNaN(
|
|
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);
|
|
117
|
+
if (a === "monetary") {
|
|
118
|
+
const T = Number(F);
|
|
119
|
+
return isNaN(T) ? "" : T.toLocaleString("pt-BR", { style: "currency", currency: "BRL" });
|
|
93
120
|
}
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
121
|
+
if (a === "number") {
|
|
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 (r &&
|
|
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 B =
|
|
115
|
-
if (r && B.endsWith(r) && (B = B.slice(0, -r.length)),
|
|
116
|
-
const
|
|
117
|
-
B =
|
|
118
|
-
} else
|
|
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
|
-
inputMode:
|
|
144
|
-
value:
|
|
145
|
-
onChange:
|
|
146
|
-
onBlur:
|
|
147
|
-
placeholder:
|
|
148
|
-
readOnly:
|
|
149
|
-
className:
|
|
170
|
+
inputMode: a === "number" || a === "monetary" ? "numeric" : void 0,
|
|
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
|
-
!
|
|
191
|
+
!R && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: L || "" }),
|
|
165
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:
|
|
173
|
-
placeholder:
|
|
174
|
-
labelKey:
|
|
175
|
-
valueKey:
|
|
176
|
-
enableSearch:
|
|
177
|
-
searchPlaceholder:
|
|
178
|
-
loading:
|
|
198
|
+
label: i = "",
|
|
199
|
+
options: h = [],
|
|
200
|
+
placeholder: a = "",
|
|
201
|
+
labelKey: o = "label",
|
|
202
|
+
valueKey: d = "value",
|
|
203
|
+
enableSearch: p = !1,
|
|
204
|
+
searchPlaceholder: n = "Buscar...",
|
|
205
|
+
loading: g = !1,
|
|
179
206
|
onSearchChange: r,
|
|
180
|
-
debounceTime:
|
|
181
|
-
onSelect:
|
|
182
|
-
forceReadOnly:
|
|
183
|
-
forceHidden:
|
|
184
|
-
helpText:
|
|
185
|
-
helpTitle:
|
|
186
|
-
helpWidth:
|
|
187
|
-
valueManual:
|
|
207
|
+
debounceTime: m = 300,
|
|
208
|
+
onSelect: A,
|
|
209
|
+
forceReadOnly: I = !1,
|
|
210
|
+
forceHidden: j = !1,
|
|
211
|
+
helpText: y,
|
|
212
|
+
helpTitle: H,
|
|
213
|
+
helpWidth: R,
|
|
214
|
+
valueManual: _,
|
|
188
215
|
onChangeManual: S,
|
|
189
|
-
errorManual:
|
|
216
|
+
errorManual: s
|
|
190
217
|
}) {
|
|
191
218
|
var B;
|
|
192
|
-
const
|
|
219
|
+
const c = _ !== void 0 && !!S, { isReadOnly: l, isHidden: f } = te(), u = I || !!l(t), D = j || !!f(t), { isView: L } = X();
|
|
193
220
|
let V = "", $ = () => {
|
|
194
|
-
},
|
|
221
|
+
}, x, b = null, E = () => {
|
|
195
222
|
};
|
|
196
|
-
if (
|
|
197
|
-
V =
|
|
223
|
+
if (c)
|
|
224
|
+
V = _;
|
|
198
225
|
else
|
|
199
226
|
try {
|
|
200
|
-
const
|
|
201
|
-
V =
|
|
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 [
|
|
231
|
+
const [C, W] = J(!1), [U, Q] = J(""), K = M(null), F = M(r);
|
|
205
232
|
Y(() => {
|
|
206
|
-
|
|
233
|
+
F.current = r;
|
|
207
234
|
}, [r]), Y(() => {
|
|
208
|
-
const
|
|
209
|
-
|
|
235
|
+
const k = (P) => {
|
|
236
|
+
K.current && !K.current.contains(P.target) && W(!1);
|
|
210
237
|
};
|
|
211
|
-
return document.addEventListener("mousedown",
|
|
238
|
+
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
212
239
|
}, []), Y(() => {
|
|
213
|
-
|
|
214
|
-
}, [
|
|
215
|
-
if (!
|
|
216
|
-
const
|
|
217
|
-
var
|
|
218
|
-
(
|
|
219
|
-
},
|
|
220
|
-
return () => clearTimeout(
|
|
221
|
-
}, [
|
|
222
|
-
const
|
|
223
|
-
(
|
|
224
|
-
) :
|
|
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(() => {
|
|
225
252
|
if (V == null) return "";
|
|
226
253
|
if (typeof V == "object")
|
|
227
|
-
return String(V[
|
|
228
|
-
const
|
|
229
|
-
return String(
|
|
230
|
-
}, [V,
|
|
231
|
-
|
|
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:
|
|
237
|
-
|
|
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:
|
|
246
|
-
style:
|
|
270
|
+
className: `select-control ${b ? "border-red" : ""} ${u ? "readOnly" : ""}`,
|
|
271
|
+
onClick: () => !u && W((k) => !k),
|
|
272
|
+
ref: x,
|
|
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
|
-
|
|
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:
|
|
280
|
-
valueKey:
|
|
281
|
-
labelKey:
|
|
282
|
-
forceReadOnly:
|
|
283
|
-
forceHidden:
|
|
284
|
-
valueManual:
|
|
285
|
-
onChangeManual:
|
|
305
|
+
options: i = [],
|
|
306
|
+
label: h = "",
|
|
307
|
+
valueKey: a = "value",
|
|
308
|
+
labelKey: o = "label",
|
|
309
|
+
forceReadOnly: d = !1,
|
|
310
|
+
forceHidden: p = !1,
|
|
311
|
+
valueManual: n,
|
|
312
|
+
onChangeManual: g
|
|
286
313
|
}) {
|
|
287
|
-
var
|
|
314
|
+
var L, V;
|
|
288
315
|
let r = null;
|
|
289
316
|
try {
|
|
290
|
-
r =
|
|
317
|
+
r = Z();
|
|
291
318
|
} catch {
|
|
292
319
|
}
|
|
293
|
-
const
|
|
294
|
-
($,
|
|
295
|
-
const
|
|
296
|
-
if (
|
|
297
|
-
$[
|
|
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]);
|
|
298
325
|
else if (r) {
|
|
299
|
-
const
|
|
300
|
-
$[
|
|
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 = !
|
|
333
|
+
) : {}, l = !m && r ? r.watch(t) : void 0, f = q(() => m && n ? n : l && typeof l == "object" ? l : c(), [l, n, i]);
|
|
307
334
|
Y(() => {
|
|
308
|
-
if (
|
|
335
|
+
if (m || !r) return;
|
|
309
336
|
const $ = r.getValues(t);
|
|
310
337
|
(!$ || typeof $ != "object") && r.setValue(t, f, {
|
|
311
338
|
shouldDirty: !1,
|
|
312
339
|
shouldValidate: !1
|
|
313
340
|
});
|
|
314
|
-
}, [f, t, r,
|
|
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
|
-
r && (r.setValue(t,
|
|
349
|
+
r && (r.setValue(t, b, {
|
|
323
350
|
shouldDirty: !0,
|
|
324
351
|
shouldValidate: !0
|
|
325
|
-
}), r.setValue($,
|
|
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:
|
|
367
|
-
valueKey:
|
|
368
|
-
labelKey:
|
|
369
|
-
iconKey:
|
|
370
|
-
forceReadOnly:
|
|
371
|
-
forceHidden:
|
|
372
|
-
valueManual:
|
|
392
|
+
label: i = "",
|
|
393
|
+
options: h = [],
|
|
394
|
+
valueKey: a = "value",
|
|
395
|
+
labelKey: o = "label",
|
|
396
|
+
iconKey: d = "icon",
|
|
397
|
+
forceReadOnly: p = !1,
|
|
398
|
+
forceHidden: n = !1,
|
|
399
|
+
valueManual: g,
|
|
373
400
|
onChangeManual: r,
|
|
374
|
-
errorManual:
|
|
401
|
+
errorManual: m
|
|
375
402
|
}) {
|
|
376
|
-
var
|
|
377
|
-
const
|
|
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();
|
|
378
405
|
let S = null;
|
|
379
406
|
try {
|
|
380
|
-
S =
|
|
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
|
-
f || (
|
|
412
|
+
f || (A ? r == null || r($) : (s == null || s.field.onChange($), s == null || s.field.onBlur()));
|
|
386
413
|
},
|
|
387
|
-
[f,
|
|
414
|
+
[f, A, r, s]
|
|
388
415
|
);
|
|
389
|
-
return /* @__PURE__ */
|
|
390
|
-
|
|
391
|
-
/* @__PURE__ */ e("div", { className: `btn-group ${f ? "view-mode" : ""}`, "data-field-name": t, children:
|
|
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
|
-
!
|
|
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:
|
|
419
|
-
className:
|
|
420
|
-
rows:
|
|
421
|
-
maxLength:
|
|
422
|
-
forceReadOnly:
|
|
423
|
-
forceHidden:
|
|
424
|
-
valueManual:
|
|
444
|
+
label: i = "",
|
|
445
|
+
placeholder: h = "",
|
|
446
|
+
className: a = "",
|
|
447
|
+
rows: o = 4,
|
|
448
|
+
maxLength: d,
|
|
449
|
+
forceReadOnly: p = !1,
|
|
450
|
+
forceHidden: n = !1,
|
|
451
|
+
valueManual: g,
|
|
425
452
|
onChangeManual: r,
|
|
426
|
-
errorManual:
|
|
453
|
+
errorManual: m
|
|
427
454
|
}) => {
|
|
428
455
|
var f;
|
|
429
|
-
const
|
|
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);
|
|
430
457
|
let S = {
|
|
431
|
-
value:
|
|
432
|
-
onChange: (
|
|
433
|
-
},
|
|
434
|
-
if (!
|
|
458
|
+
value: g ?? "",
|
|
459
|
+
onChange: (u) => r == null ? void 0 : r(u)
|
|
460
|
+
}, s = null;
|
|
461
|
+
if (!A)
|
|
435
462
|
try {
|
|
436
|
-
const { control:
|
|
437
|
-
S =
|
|
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
470
|
if (Y(() => {
|
|
444
|
-
|
|
445
|
-
}, [S.value]),
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
/* @__PURE__ */ e("label", { children:
|
|
471
|
+
c();
|
|
472
|
+
}, [S.value]), R)
|
|
473
|
+
return /* @__PURE__ */ v("div", { className: `form-group ${H ? "hidden" : ""}`, children: [
|
|
474
|
+
/* @__PURE__ */ e("label", { children: i }),
|
|
448
475
|
/* @__PURE__ */ e("span", { className: "form-control", children: S.value || "-" })
|
|
449
476
|
] });
|
|
450
|
-
const l = `form-control ${
|
|
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:
|
|
483
|
+
ref: _,
|
|
484
|
+
rows: o,
|
|
485
|
+
maxLength: d,
|
|
459
486
|
value: S.value || "",
|
|
460
|
-
placeholder:
|
|
461
|
-
readOnly:
|
|
487
|
+
placeholder: h,
|
|
488
|
+
readOnly: y,
|
|
462
489
|
className: l,
|
|
463
490
|
style: {
|
|
464
491
|
resize: "none",
|
|
465
492
|
maxHeight: "400px",
|
|
466
493
|
overflowY: "auto"
|
|
467
494
|
},
|
|
468
|
-
onChange: (
|
|
469
|
-
|
|
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 Ce = (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 de = (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 Pe = {
|
|
|
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 Ye = (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:
|
|
551
|
-
absoluteStrokeWidth:
|
|
552
|
-
className:
|
|
553
|
-
children:
|
|
554
|
-
iconNode:
|
|
555
|
-
...
|
|
556
|
-
},
|
|
576
|
+
size: i = 24,
|
|
577
|
+
strokeWidth: h = 2,
|
|
578
|
+
absoluteStrokeWidth: a,
|
|
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:
|
|
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 We = fe(
|
|
|
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:
|
|
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,37 +626,37 @@ const ne = (t, c) => {
|
|
|
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);
|
|
622
649
|
/**
|
|
623
650
|
* @license lucide-react v0.575.0 - ISC
|
|
624
651
|
*
|
|
625
652
|
* This source code is licensed under the ISC license.
|
|
626
653
|
* See the LICENSE file in the root directory of this source tree.
|
|
627
654
|
*/
|
|
628
|
-
const
|
|
655
|
+
const Ke = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Me = ce("chevron-right", Ke), ye = "dd/MM/yyyy", le = (t) => {
|
|
629
656
|
if (!t) return null;
|
|
630
|
-
const
|
|
631
|
-
return
|
|
632
|
-
},
|
|
657
|
+
const i = Le(t, ye, /* @__PURE__ */ new Date());
|
|
658
|
+
return de(i) ? i : null;
|
|
659
|
+
}, et = (t) => t ? ve(t, ye) : "", ue = [
|
|
633
660
|
"Janeiro",
|
|
634
661
|
"Fevereiro",
|
|
635
662
|
"Março",
|
|
@@ -643,82 +670,88 @@ const Qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ze = ne("chevron-r
|
|
|
643
670
|
"Novembro",
|
|
644
671
|
"Dezembro"
|
|
645
672
|
];
|
|
646
|
-
function
|
|
673
|
+
function tt({
|
|
647
674
|
name: t,
|
|
648
|
-
label:
|
|
649
|
-
placeholder:
|
|
650
|
-
className:
|
|
651
|
-
forceReadOnly:
|
|
652
|
-
forceHidden:
|
|
653
|
-
valueManual:
|
|
654
|
-
onChangeManual:
|
|
655
|
-
errorManual:
|
|
675
|
+
label: i = "",
|
|
676
|
+
placeholder: h = "dd/mm/aaaa",
|
|
677
|
+
className: a = "",
|
|
678
|
+
forceReadOnly: o = !1,
|
|
679
|
+
forceHidden: d = !1,
|
|
680
|
+
valueManual: p,
|
|
681
|
+
onChangeManual: n,
|
|
682
|
+
errorManual: g
|
|
656
683
|
}) {
|
|
657
|
-
var
|
|
658
|
-
const r =
|
|
659
|
-
let
|
|
660
|
-
},
|
|
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 = () => {
|
|
661
688
|
};
|
|
662
689
|
if (r)
|
|
663
|
-
|
|
690
|
+
H = p;
|
|
664
691
|
else
|
|
665
692
|
try {
|
|
666
|
-
const
|
|
667
|
-
|
|
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;
|
|
668
695
|
} catch {
|
|
669
696
|
}
|
|
670
|
-
const [
|
|
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);
|
|
671
698
|
Y(() => {
|
|
672
|
-
|
|
673
|
-
}, [
|
|
674
|
-
if (
|
|
675
|
-
const
|
|
676
|
-
|
|
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);
|
|
677
704
|
}
|
|
678
|
-
}, [
|
|
679
|
-
const
|
|
680
|
-
|
|
705
|
+
}, [c, D]), Y(() => {
|
|
706
|
+
const N = (w) => {
|
|
707
|
+
E.current && !E.current.contains(w.target) && (l(!1), $(!1), b(!1));
|
|
681
708
|
};
|
|
682
|
-
return document.addEventListener("mousedown",
|
|
709
|
+
return document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
683
710
|
}, []), Y(() => {
|
|
684
|
-
V &&
|
|
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
|
+
}
|
|
685
715
|
}, [V]), Y(() => {
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
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);
|
|
703
736
|
}
|
|
704
|
-
},
|
|
705
|
-
start:
|
|
706
|
-
end:
|
|
707
|
-
}), [f]),
|
|
708
|
-
return /* @__PURE__ */
|
|
709
|
-
/* @__PURE__ */ e("label", { className: "control-label", children:
|
|
710
|
-
|
|
711
|
-
/* @__PURE__ */
|
|
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: [
|
|
712
745
|
/* @__PURE__ */ e(
|
|
713
746
|
"input",
|
|
714
747
|
{
|
|
715
748
|
type: "text",
|
|
716
749
|
className: "dfe-datepicker-input",
|
|
717
|
-
value:
|
|
718
|
-
onChange:
|
|
719
|
-
placeholder:
|
|
720
|
-
readOnly:
|
|
721
|
-
ref:
|
|
750
|
+
value: D,
|
|
751
|
+
onChange: T,
|
|
752
|
+
placeholder: h,
|
|
753
|
+
readOnly: I,
|
|
754
|
+
ref: _,
|
|
722
755
|
maxLength: 10
|
|
723
756
|
}
|
|
724
757
|
),
|
|
@@ -727,88 +760,88 @@ function Ke({
|
|
|
727
760
|
{
|
|
728
761
|
type: "button",
|
|
729
762
|
className: "dfe-datepicker-trigger-btn",
|
|
730
|
-
onClick: () => !
|
|
731
|
-
disabled:
|
|
763
|
+
onClick: () => !I && l((N) => !N),
|
|
764
|
+
disabled: I,
|
|
732
765
|
tabIndex: -1,
|
|
733
|
-
children: /* @__PURE__ */ e(
|
|
766
|
+
children: /* @__PURE__ */ e(Ge, { size: 16, className: "dfe-datepicker-icon" })
|
|
734
767
|
}
|
|
735
768
|
)
|
|
736
769
|
] }),
|
|
737
|
-
|
|
738
|
-
/* @__PURE__ */
|
|
770
|
+
c && !I && /* @__PURE__ */ v("div", { className: "dfe-datepicker-dropdown", onClick: (N) => N.stopPropagation(), children: [
|
|
771
|
+
/* @__PURE__ */ v("div", { className: "dfe-datepicker-header", children: [
|
|
739
772
|
/* @__PURE__ */ e(
|
|
740
773
|
"button",
|
|
741
774
|
{
|
|
742
775
|
type: "button",
|
|
743
|
-
onClick: () =>
|
|
776
|
+
onClick: () => u(_e(f, 1)),
|
|
744
777
|
className: "dfe-datepicker-nav-btn",
|
|
745
|
-
children: /* @__PURE__ */ e(
|
|
778
|
+
children: /* @__PURE__ */ e(Xe, { size: 16 })
|
|
746
779
|
}
|
|
747
780
|
),
|
|
748
|
-
/* @__PURE__ */
|
|
749
|
-
/* @__PURE__ */
|
|
750
|
-
/* @__PURE__ */
|
|
781
|
+
/* @__PURE__ */ v("div", { className: "dfe-datepicker-selectors-native", children: [
|
|
782
|
+
/* @__PURE__ */ v("div", { className: "dfe-datepicker-selector-wrapper", children: [
|
|
783
|
+
/* @__PURE__ */ v(
|
|
751
784
|
"button",
|
|
752
785
|
{
|
|
753
786
|
type: "button",
|
|
754
787
|
className: "dfe-datepicker-selector-btn",
|
|
755
788
|
onClick: () => {
|
|
756
|
-
|
|
789
|
+
b(!x), $(!1);
|
|
757
790
|
},
|
|
758
791
|
children: [
|
|
759
|
-
|
|
792
|
+
ue[B],
|
|
760
793
|
" ",
|
|
761
|
-
/* @__PURE__ */ e(
|
|
794
|
+
/* @__PURE__ */ e(fe, { size: 14 })
|
|
762
795
|
]
|
|
763
796
|
}
|
|
764
797
|
),
|
|
765
|
-
|
|
766
|
-
const
|
|
798
|
+
x && /* @__PURE__ */ e("div", { className: "dfe-datepicker-listbox", ref: Q, children: ue.map((N, w) => {
|
|
799
|
+
const z = B === w;
|
|
767
800
|
return /* @__PURE__ */ e(
|
|
768
801
|
"button",
|
|
769
802
|
{
|
|
770
803
|
type: "button",
|
|
771
|
-
ref:
|
|
772
|
-
className: `dfe-datepicker-listbox-item ${
|
|
804
|
+
ref: z ? W : null,
|
|
805
|
+
className: `dfe-datepicker-listbox-item ${z ? "selected" : ""}`,
|
|
773
806
|
onClick: () => {
|
|
774
|
-
|
|
807
|
+
u(Oe(f, w)), b(!1);
|
|
775
808
|
},
|
|
776
|
-
children:
|
|
809
|
+
children: N
|
|
777
810
|
},
|
|
778
|
-
|
|
811
|
+
w
|
|
779
812
|
);
|
|
780
813
|
}) })
|
|
781
814
|
] }),
|
|
782
|
-
/* @__PURE__ */
|
|
783
|
-
/* @__PURE__ */
|
|
815
|
+
/* @__PURE__ */ v("div", { className: "dfe-datepicker-selector-wrapper", children: [
|
|
816
|
+
/* @__PURE__ */ v(
|
|
784
817
|
"button",
|
|
785
818
|
{
|
|
786
819
|
type: "button",
|
|
787
820
|
className: "dfe-datepicker-selector-btn",
|
|
788
821
|
onClick: () => {
|
|
789
|
-
$(!V),
|
|
822
|
+
$(!V), b(!1);
|
|
790
823
|
},
|
|
791
824
|
children: [
|
|
792
|
-
|
|
825
|
+
k,
|
|
793
826
|
" ",
|
|
794
|
-
/* @__PURE__ */ e(
|
|
827
|
+
/* @__PURE__ */ e(fe, { size: 14 })
|
|
795
828
|
]
|
|
796
829
|
}
|
|
797
830
|
),
|
|
798
|
-
V && /* @__PURE__ */ e("div", { className: "dfe-datepicker-listbox", children:
|
|
799
|
-
const
|
|
831
|
+
V && /* @__PURE__ */ e("div", { className: "dfe-datepicker-listbox", ref: U, children: K.map((N) => {
|
|
832
|
+
const w = k === N;
|
|
800
833
|
return /* @__PURE__ */ e(
|
|
801
834
|
"button",
|
|
802
835
|
{
|
|
803
836
|
type: "button",
|
|
804
|
-
ref:
|
|
805
|
-
className: `dfe-datepicker-listbox-item ${
|
|
837
|
+
ref: w ? C : null,
|
|
838
|
+
className: `dfe-datepicker-listbox-item ${w ? "selected" : ""}`,
|
|
806
839
|
onClick: () => {
|
|
807
|
-
|
|
840
|
+
u(Ae(f, N)), $(!1);
|
|
808
841
|
},
|
|
809
|
-
children:
|
|
842
|
+
children: N
|
|
810
843
|
},
|
|
811
|
-
|
|
844
|
+
N
|
|
812
845
|
);
|
|
813
846
|
}) })
|
|
814
847
|
] })
|
|
@@ -817,110 +850,110 @@ function Ke({
|
|
|
817
850
|
"button",
|
|
818
851
|
{
|
|
819
852
|
type: "button",
|
|
820
|
-
onClick: () =>
|
|
853
|
+
onClick: () => u(Ie(f, 1)),
|
|
821
854
|
className: "dfe-datepicker-nav-btn",
|
|
822
|
-
children: /* @__PURE__ */ e(
|
|
855
|
+
children: /* @__PURE__ */ e(Me, { size: 16 })
|
|
823
856
|
}
|
|
824
857
|
)
|
|
825
858
|
] }),
|
|
826
|
-
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((
|
|
827
|
-
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children:
|
|
828
|
-
const
|
|
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);
|
|
829
862
|
return /* @__PURE__ */ e(
|
|
830
863
|
"div",
|
|
831
864
|
{
|
|
832
|
-
onClick: () => !
|
|
865
|
+
onClick: () => !z && O(N),
|
|
833
866
|
className: `dfe-datepicker-day
|
|
834
|
-
${
|
|
835
|
-
${
|
|
836
|
-
${
|
|
837
|
-
children:
|
|
867
|
+
${ne ? "selected" : "handleHover"}
|
|
868
|
+
${z ? "outside" : ""}
|
|
869
|
+
${He(N) ? "today" : ""}`,
|
|
870
|
+
children: ve(N, "d")
|
|
838
871
|
},
|
|
839
|
-
|
|
872
|
+
w
|
|
840
873
|
);
|
|
841
874
|
}) })
|
|
842
875
|
] })
|
|
843
876
|
] }),
|
|
844
|
-
!r && /* @__PURE__ */ e("input", { type: "hidden", name: t, value:
|
|
845
|
-
(S ||
|
|
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) })
|
|
846
879
|
] });
|
|
847
880
|
}
|
|
848
|
-
const
|
|
849
|
-
function
|
|
881
|
+
const yt = ee(tt);
|
|
882
|
+
function rt({
|
|
850
883
|
mapping: t = {},
|
|
851
|
-
defaultLabel:
|
|
852
|
-
className:
|
|
853
|
-
hidden:
|
|
854
|
-
label:
|
|
884
|
+
defaultLabel: i = "Não reconhecido",
|
|
885
|
+
className: h = "",
|
|
886
|
+
hidden: a = !1,
|
|
887
|
+
label: o
|
|
855
888
|
}) {
|
|
856
|
-
const { activityId:
|
|
857
|
-
if (!
|
|
858
|
-
return /* @__PURE__ */
|
|
859
|
-
|
|
860
|
-
/* @__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 })
|
|
861
894
|
] });
|
|
862
|
-
const
|
|
863
|
-
"--customColor":
|
|
895
|
+
const n = {
|
|
896
|
+
"--customColor": p.color
|
|
864
897
|
};
|
|
865
|
-
return /* @__PURE__ */
|
|
866
|
-
|
|
867
|
-
/* @__PURE__ */
|
|
868
|
-
|
|
869
|
-
/* @__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 })
|
|
870
903
|
] })
|
|
871
904
|
] });
|
|
872
905
|
}
|
|
873
|
-
const
|
|
874
|
-
function
|
|
906
|
+
const bt = ee(rt);
|
|
907
|
+
function st({
|
|
875
908
|
name: t,
|
|
876
|
-
control:
|
|
877
|
-
defaultRowValue:
|
|
878
|
-
isView:
|
|
879
|
-
isReadOnly:
|
|
880
|
-
filters:
|
|
909
|
+
control: i,
|
|
910
|
+
defaultRowValue: h,
|
|
911
|
+
isView: a,
|
|
912
|
+
isReadOnly: o,
|
|
913
|
+
filters: d = []
|
|
881
914
|
}) {
|
|
882
|
-
const { field:
|
|
915
|
+
const { field: p } = re({ name: t, control: i }), [n, g] = J([]), [r, m] = J([]), A = () => Date.now() + Math.random(), I = (c) => {
|
|
883
916
|
try {
|
|
884
|
-
const l = JSON.parse(
|
|
917
|
+
const l = JSON.parse(c);
|
|
885
918
|
return Array.isArray(l) ? l.map((f) => ({
|
|
886
919
|
...f,
|
|
887
|
-
_uid: f._uid ||
|
|
920
|
+
_uid: f._uid || A()
|
|
888
921
|
})) : [];
|
|
889
922
|
} catch (l) {
|
|
890
923
|
return console.error(`Erro ao ler dados da tabela "${t}":`, l), [];
|
|
891
924
|
}
|
|
892
925
|
};
|
|
893
926
|
Y(() => {
|
|
894
|
-
if (!(
|
|
895
|
-
const
|
|
896
|
-
if (
|
|
897
|
-
const l =
|
|
898
|
-
|
|
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);
|
|
899
932
|
}
|
|
900
|
-
}, [
|
|
901
|
-
if (
|
|
902
|
-
const
|
|
903
|
-
|
|
904
|
-
}, [
|
|
905
|
-
const
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
}, [
|
|
909
|
-
|
|
910
|
-
}, [r]),
|
|
911
|
-
|
|
912
|
-
}, []),
|
|
913
|
-
|
|
914
|
-
}, []),
|
|
915
|
-
(
|
|
916
|
-
|
|
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) : []);
|
|
917
950
|
},
|
|
918
|
-
[
|
|
919
|
-
), S =
|
|
920
|
-
(
|
|
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) => {
|
|
921
954
|
if ("custom" in l)
|
|
922
|
-
return l.custom(
|
|
923
|
-
const f =
|
|
955
|
+
return l.custom(c);
|
|
956
|
+
const f = c[l.field];
|
|
924
957
|
switch (l.operator) {
|
|
925
958
|
case "===":
|
|
926
959
|
return f === l.value;
|
|
@@ -938,251 +971,251 @@ function et({
|
|
|
938
971
|
return !0;
|
|
939
972
|
}
|
|
940
973
|
})
|
|
941
|
-
), [
|
|
974
|
+
), [n, d]);
|
|
942
975
|
return {
|
|
943
|
-
field:
|
|
944
|
-
tableRows:
|
|
945
|
-
visibleRows:
|
|
976
|
+
field: p,
|
|
977
|
+
tableRows: n,
|
|
978
|
+
visibleRows: s,
|
|
946
979
|
selectedRowIds: r,
|
|
947
980
|
isAllSelected: S,
|
|
948
981
|
handle: {
|
|
949
|
-
addRow:
|
|
950
|
-
removeRows:
|
|
951
|
-
updateCellValue:
|
|
952
|
-
toggleSelection:
|
|
953
|
-
toggleSelectAll:
|
|
982
|
+
addRow: j,
|
|
983
|
+
removeRows: y,
|
|
984
|
+
updateCellValue: H,
|
|
985
|
+
toggleSelection: R,
|
|
986
|
+
toggleSelectAll: _
|
|
954
987
|
}
|
|
955
988
|
};
|
|
956
989
|
}
|
|
957
|
-
const
|
|
990
|
+
const Nt = ({
|
|
958
991
|
name: t,
|
|
959
|
-
title:
|
|
960
|
-
columns:
|
|
961
|
-
defaultRowValue:
|
|
962
|
-
forceReadOnly:
|
|
963
|
-
layout:
|
|
964
|
-
actions:
|
|
965
|
-
filters:
|
|
992
|
+
title: i = "Tabela Dinâmica",
|
|
993
|
+
columns: h,
|
|
994
|
+
defaultRowValue: a = {},
|
|
995
|
+
forceReadOnly: o = !1,
|
|
996
|
+
layout: d = "fluid",
|
|
997
|
+
actions: p = !0,
|
|
998
|
+
filters: n = []
|
|
966
999
|
}) => {
|
|
967
|
-
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({
|
|
968
1001
|
name: t,
|
|
969
|
-
control:
|
|
970
|
-
defaultRowValue:
|
|
1002
|
+
control: g,
|
|
1003
|
+
defaultRowValue: a,
|
|
971
1004
|
isView: r,
|
|
972
|
-
isReadOnly: !!
|
|
973
|
-
filters:
|
|
974
|
-
}), S =
|
|
975
|
-
return /* @__PURE__ */
|
|
976
|
-
/* @__PURE__ */ e("input", { type: "hidden", ...
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */ e("h3", { children:
|
|
979
|
-
!
|
|
980
|
-
/* @__PURE__ */
|
|
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(
|
|
981
1014
|
"button",
|
|
982
1015
|
{
|
|
983
1016
|
type: "button",
|
|
984
|
-
className: `btn ${
|
|
985
|
-
disabled:
|
|
986
|
-
onClick:
|
|
1017
|
+
className: `btn ${H.length > 0 ? "btn-danger" : "btn-primary"}`,
|
|
1018
|
+
disabled: H.length === 0,
|
|
1019
|
+
onClick: _.removeRows,
|
|
987
1020
|
children: [
|
|
988
1021
|
"Remover (",
|
|
989
|
-
|
|
1022
|
+
H.length,
|
|
990
1023
|
")"
|
|
991
1024
|
]
|
|
992
1025
|
}
|
|
993
1026
|
),
|
|
994
|
-
/* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick:
|
|
1027
|
+
/* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: _.addRow, children: "Adicionar" })
|
|
995
1028
|
] })
|
|
996
1029
|
] }),
|
|
997
|
-
/* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */
|
|
998
|
-
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */
|
|
999
|
-
!
|
|
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(
|
|
1000
1033
|
"input",
|
|
1001
1034
|
{
|
|
1002
1035
|
type: "checkbox",
|
|
1003
|
-
checked:
|
|
1004
|
-
onChange: (
|
|
1036
|
+
checked: R,
|
|
1037
|
+
onChange: (s) => _.toggleSelectAll(s.target.checked)
|
|
1005
1038
|
}
|
|
1006
1039
|
) }),
|
|
1007
|
-
|
|
1040
|
+
h.map((s) => /* @__PURE__ */ e(
|
|
1008
1041
|
"th",
|
|
1009
1042
|
{
|
|
1010
|
-
style:
|
|
1011
|
-
children:
|
|
1043
|
+
style: s.width ? { minWidth: S ? s.width : "100%" } : { width: "max-content" },
|
|
1044
|
+
children: s.label
|
|
1012
1045
|
},
|
|
1013
|
-
String(
|
|
1046
|
+
String(s.key)
|
|
1014
1047
|
))
|
|
1015
1048
|
] }) }),
|
|
1016
|
-
/* @__PURE__ */
|
|
1017
|
-
|
|
1018
|
-
!
|
|
1049
|
+
/* @__PURE__ */ v("tbody", { children: [
|
|
1050
|
+
y.map((s, c) => /* @__PURE__ */ v("tr", { children: [
|
|
1051
|
+
!I && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1019
1052
|
"input",
|
|
1020
1053
|
{
|
|
1021
1054
|
type: "checkbox",
|
|
1022
|
-
checked:
|
|
1023
|
-
onChange: () =>
|
|
1055
|
+
checked: H.includes(s._uid),
|
|
1056
|
+
onChange: () => _.toggleSelection(s._uid)
|
|
1024
1057
|
}
|
|
1025
1058
|
) }),
|
|
1026
|
-
|
|
1027
|
-
row:
|
|
1028
|
-
index:
|
|
1029
|
-
updateRow: (f,
|
|
1030
|
-
isLocked: !!
|
|
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,
|
|
1031
1064
|
isView: !!r
|
|
1032
1065
|
}) : l.render(
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
(f,
|
|
1036
|
-
!!
|
|
1066
|
+
s,
|
|
1067
|
+
c,
|
|
1068
|
+
(f, u) => _.updateCellValue(s._uid, f, u),
|
|
1069
|
+
!!I,
|
|
1037
1070
|
!!r
|
|
1038
|
-
) :
|
|
1039
|
-
] },
|
|
1040
|
-
|
|
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." }) })
|
|
1041
1074
|
] })
|
|
1042
1075
|
] }) })
|
|
1043
1076
|
] });
|
|
1044
|
-
},
|
|
1045
|
-
const [
|
|
1046
|
-
let
|
|
1077
|
+
}, nt = (t, i) => {
|
|
1078
|
+
const [h, a] = J(null);
|
|
1079
|
+
let o = null;
|
|
1047
1080
|
try {
|
|
1048
|
-
|
|
1081
|
+
o = Z().watch;
|
|
1049
1082
|
} catch {
|
|
1050
1083
|
}
|
|
1051
|
-
const
|
|
1084
|
+
const d = i !== void 0 ? i : o ? o(t) : void 0, p = G(() => {
|
|
1052
1085
|
try {
|
|
1053
|
-
const
|
|
1054
|
-
if (
|
|
1055
|
-
const r =
|
|
1056
|
-
|
|
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));
|
|
1057
1090
|
} else
|
|
1058
|
-
|
|
1091
|
+
a(d ? { name: d, documentId: 0 } : null);
|
|
1059
1092
|
} catch {
|
|
1060
|
-
|
|
1093
|
+
a(d ? { name: d, documentId: 0 } : null);
|
|
1061
1094
|
}
|
|
1062
|
-
}, [t,
|
|
1095
|
+
}, [t, d, i]);
|
|
1063
1096
|
return Y(() => {
|
|
1064
|
-
|
|
1065
|
-
const
|
|
1066
|
-
return () => clearInterval(
|
|
1067
|
-
}, [
|
|
1068
|
-
},
|
|
1097
|
+
p();
|
|
1098
|
+
const n = setInterval(p, 2e3);
|
|
1099
|
+
return () => clearInterval(n);
|
|
1100
|
+
}, [p]), { attachment: h, sync: p };
|
|
1101
|
+
}, it = ({
|
|
1069
1102
|
name: t,
|
|
1070
|
-
label:
|
|
1071
|
-
help:
|
|
1072
|
-
valueManual:
|
|
1073
|
-
onChangeManual:
|
|
1074
|
-
forceReadOnly:
|
|
1075
|
-
forceHidden:
|
|
1076
|
-
helpText:
|
|
1077
|
-
helpTitle:
|
|
1103
|
+
label: i,
|
|
1104
|
+
help: h,
|
|
1105
|
+
valueManual: a,
|
|
1106
|
+
onChangeManual: o,
|
|
1107
|
+
forceReadOnly: d = !1,
|
|
1108
|
+
forceHidden: p = !1,
|
|
1109
|
+
helpText: n,
|
|
1110
|
+
helpTitle: g,
|
|
1078
1111
|
helpWidth: r
|
|
1079
1112
|
}) => {
|
|
1080
|
-
const
|
|
1113
|
+
const m = !!o, { isReadOnly: A, isHidden: I } = te(), { isView: j } = X(), y = d || j || !!A(t), H = p || !!I(t), [R, _] = J(!1);
|
|
1081
1114
|
let S = null;
|
|
1082
1115
|
try {
|
|
1083
|
-
S =
|
|
1116
|
+
S = Z().control;
|
|
1084
1117
|
} catch {
|
|
1085
1118
|
}
|
|
1086
|
-
const
|
|
1087
|
-
value:
|
|
1088
|
-
onChange: (
|
|
1089
|
-
}, { attachment:
|
|
1090
|
-
var
|
|
1119
|
+
const s = S && !m ? re({ name: t, control: S }).field : {
|
|
1120
|
+
value: a,
|
|
1121
|
+
onChange: (x) => o == null ? void 0 : o(x)
|
|
1122
|
+
}, { attachment: c, sync: l } = nt(t, a), f = () => {
|
|
1123
|
+
var x;
|
|
1091
1124
|
try {
|
|
1092
|
-
const
|
|
1125
|
+
const b = window.top;
|
|
1093
1126
|
return {
|
|
1094
|
-
bridge:
|
|
1095
|
-
toast: (
|
|
1127
|
+
bridge: b.__REACT_ATTACHMENT_BRIDGE__,
|
|
1128
|
+
toast: (x = b.FLUIGC) == null ? void 0 : x.toast
|
|
1096
1129
|
};
|
|
1097
1130
|
} catch {
|
|
1098
1131
|
return { bridge: null, toast: null };
|
|
1099
1132
|
}
|
|
1100
|
-
},
|
|
1101
|
-
if (
|
|
1102
|
-
const
|
|
1103
|
-
|
|
1104
|
-
const
|
|
1105
|
-
if (!
|
|
1106
|
-
const { bridge:
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
}, 1e3),
|
|
1133
|
+
}, u = G(() => {
|
|
1134
|
+
if (y) return;
|
|
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({
|
|
1111
1144
|
title: "Sucesso",
|
|
1112
1145
|
message: "Arquivo enviado",
|
|
1113
1146
|
type: "success"
|
|
1114
1147
|
});
|
|
1115
|
-
}) : (
|
|
1116
|
-
},
|
|
1117
|
-
}, [t,
|
|
1118
|
-
if (
|
|
1119
|
-
const
|
|
1120
|
-
if (!
|
|
1121
|
-
const { bridge:
|
|
1122
|
-
|
|
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({
|
|
1123
1156
|
title: "Erro",
|
|
1124
1157
|
message: "Erro ao remover anexo",
|
|
1125
1158
|
type: "danger"
|
|
1126
|
-
}) : (
|
|
1127
|
-
},
|
|
1159
|
+
}) : (m ? o == null || o("") : s.onChange(""), l());
|
|
1160
|
+
}, L = !!c && !R, V = (c == null ? void 0 : c.name) || a || s.value, $ = [
|
|
1128
1161
|
"fluig-attachment__box",
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
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" : ""
|
|
1133
1166
|
].join(" ");
|
|
1134
|
-
return
|
|
1135
|
-
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
-
/* @__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(
|
|
1138
1171
|
"div",
|
|
1139
1172
|
{
|
|
1140
1173
|
className: $,
|
|
1141
|
-
style:
|
|
1174
|
+
style: n ? { flex: 1 } : void 0,
|
|
1142
1175
|
onClick: () => {
|
|
1143
|
-
if (
|
|
1144
|
-
const
|
|
1145
|
-
|
|
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);
|
|
1146
1179
|
} else
|
|
1147
|
-
|
|
1180
|
+
u();
|
|
1148
1181
|
},
|
|
1149
1182
|
children: [
|
|
1150
|
-
/* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ v("span", { className: "fluig-attachment__content", children: [
|
|
1151
1184
|
/* @__PURE__ */ e(
|
|
1152
1185
|
"i",
|
|
1153
1186
|
{
|
|
1154
|
-
className: `flaticon icon-sm ${
|
|
1187
|
+
className: `flaticon icon-sm ${R ? "flaticon-loading" : L ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
|
|
1155
1188
|
}
|
|
1156
1189
|
),
|
|
1157
|
-
/* @__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" })
|
|
1158
1191
|
] }),
|
|
1159
|
-
|
|
1192
|
+
L && !y && /* @__PURE__ */ e(
|
|
1160
1193
|
"button",
|
|
1161
1194
|
{
|
|
1162
1195
|
type: "button",
|
|
1163
1196
|
className: "fluig-attachment__btn-remove btn btn-link text-danger",
|
|
1164
|
-
onClick:
|
|
1197
|
+
onClick: D,
|
|
1165
1198
|
children: /* @__PURE__ */ e("i", { className: "flaticon flaticon-trash icon-sm" })
|
|
1166
1199
|
}
|
|
1167
1200
|
)
|
|
1168
1201
|
]
|
|
1169
1202
|
}
|
|
1170
1203
|
),
|
|
1171
|
-
|
|
1204
|
+
n && /* @__PURE__ */ e(ie, { text: n, title: g, width: r })
|
|
1172
1205
|
] }),
|
|
1173
|
-
!
|
|
1206
|
+
!m && S && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: s.value || "" })
|
|
1174
1207
|
] });
|
|
1175
|
-
},
|
|
1208
|
+
}, wt = ee(it);
|
|
1176
1209
|
export {
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
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
|
|
1188
1221
|
};
|