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