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