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