diefra_ecm_ui 1.0.9 → 1.2.0
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/DatePicker/index.d.ts +2 -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 +794 -1202
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,866 +1,477 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { useFormContext as
|
|
4
|
-
import { IMaskInput as
|
|
5
|
-
import { useSection as
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { jsx as e, jsxs as h, Fragment as ce } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as j, useEffect as T, memo as q, useState as P, useMemo as z, useRef as X, forwardRef as de, createElement as K } from "react";
|
|
3
|
+
import { useFormContext as U, useController as W, useFormState as oe } from "react-hook-form";
|
|
4
|
+
import { IMaskInput as pe } from "react-imask";
|
|
5
|
+
import { useSection as G, useFluigRuntime as Y } 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 Se, isSameMonth as Re, isSameDay as $e, format as ue, isToday as xe, parse as Ae } from "date-fns";
|
|
7
|
+
function Ie({ title: t, isOpen: l, onOpen: a, onClose: f, content: c, footer: o, width: m }) {
|
|
8
|
+
const d = j(
|
|
9
|
+
(p) => {
|
|
10
|
+
p.key === "Escape" && f();
|
|
11
|
+
},
|
|
12
|
+
[f]
|
|
13
|
+
);
|
|
14
|
+
return T(() => (l && (document.addEventListener("keydown", d), a == null || a(), document.body.style.overflow = "hidden"), () => {
|
|
15
|
+
document.removeEventListener("keydown", d), document.body.style.overflow = "auto";
|
|
16
|
+
}), [l, d, a]), l ? /* @__PURE__ */ e("div", { className: "modal-overlay", onClick: f, "aria-modal": "true", role: "dialog", children: /* @__PURE__ */ h("div", { style: { maxWidth: m }, className: "modal-container", onClick: (p) => p.stopPropagation(), children: [
|
|
17
|
+
/* @__PURE__ */ h("div", { className: "modal-header", children: [
|
|
18
|
+
/* @__PURE__ */ e("h3", { children: t }),
|
|
19
|
+
/* @__PURE__ */ e("div", { className: "btn-close-modal", onClick: f, 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
|
+
o && /* @__PURE__ */ e("div", { className: "modal-footer", children: o })
|
|
23
|
+
] }) }) : null;
|
|
24
|
+
}
|
|
25
|
+
function Ve({ text: t, title: l = "Ajuda & Informações", width: a = "500px", className: f = "" }) {
|
|
26
|
+
const [c, o] = P(!1), m = (d) => {
|
|
27
|
+
d.preventDefault(), d.stopPropagation(), o(!0);
|
|
28
|
+
};
|
|
29
|
+
return /* @__PURE__ */ h(ce, { children: [
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: `dfe-help-indicator ${f}`,
|
|
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: l,
|
|
46
|
+
isOpen: c,
|
|
47
|
+
onClose: () => o(!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: () => o(!1), children: "Entendido" }) })
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
}
|
|
55
|
+
const Z = q(Ve), Ee = {
|
|
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:
|
|
18
|
-
mask:
|
|
19
|
-
className:
|
|
20
|
-
forceReadOnly:
|
|
21
|
-
forceHidden:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
61
|
+
function De({
|
|
62
|
+
name: t,
|
|
63
|
+
label: l = "",
|
|
64
|
+
placeholder: a = "",
|
|
65
|
+
type: f = "text",
|
|
66
|
+
mask: c,
|
|
67
|
+
className: o = "",
|
|
68
|
+
forceReadOnly: m = !1,
|
|
69
|
+
forceHidden: d = !1,
|
|
70
|
+
helpText: p,
|
|
71
|
+
helpTitle: i,
|
|
72
|
+
helpWidth: v,
|
|
73
|
+
valueManual: x,
|
|
74
|
+
onChangeManual: S,
|
|
75
|
+
errorManual: C
|
|
25
76
|
}) {
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
let
|
|
77
|
+
var E, L;
|
|
78
|
+
const y = x !== void 0 && !!S, { isReadOnly: R, isHidden: D } = G(), _ = m || !!R(t), g = d || !!D(t), { isView: r } = Y();
|
|
79
|
+
let n = null;
|
|
29
80
|
try {
|
|
30
|
-
|
|
81
|
+
n = U();
|
|
31
82
|
} catch {
|
|
32
83
|
}
|
|
33
|
-
const
|
|
34
|
-
()
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
if (!g) return "";
|
|
38
|
-
const j = g.replace(/\D/g, "");
|
|
39
|
-
return (Number(j) / 100).toLocaleString("pt-BR", {
|
|
84
|
+
const s = !y && n ? W({ name: t, control: n.control }) : null, u = !y && n ? oe({ name: t }) : null, k = y ? x : s == null ? void 0 : s.field.value, I = y ? C : (L = (E = u == null ? void 0 : u.errors) == null ? void 0 : E[t]) == null ? void 0 : L.message, B = z(() => c ? Ee[c] ?? c : null, [c]), V = j((H) => {
|
|
85
|
+
if (!H) return "";
|
|
86
|
+
const J = H.replace(/\D/g, "");
|
|
87
|
+
return (Number(J) / 100).toLocaleString("pt-BR", {
|
|
40
88
|
style: "currency",
|
|
41
89
|
currency: "BRL"
|
|
42
90
|
});
|
|
43
|
-
}, []),
|
|
44
|
-
(
|
|
45
|
-
[
|
|
46
|
-
),
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
91
|
+
}, []), O = j(
|
|
92
|
+
(H) => f === "monetary" ? V(H) : H,
|
|
93
|
+
[f, V]
|
|
94
|
+
), w = (H) => {
|
|
95
|
+
const J = O(H);
|
|
96
|
+
y ? S == null || S(J) : s == null || s.field.onChange(J);
|
|
97
|
+
}, N = () => {
|
|
98
|
+
y || s == null || s.field.onBlur();
|
|
51
99
|
};
|
|
52
|
-
if (
|
|
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
|
-
|
|
100
|
+
if (g) return null;
|
|
101
|
+
const A = `form-control ${_ ? "readOnly" : ""} ${I ? "border-red" : ""} ${o}`, b = () => B ? /* @__PURE__ */ e(
|
|
102
|
+
pe,
|
|
103
|
+
{
|
|
104
|
+
name: t,
|
|
105
|
+
mask: B,
|
|
106
|
+
value: String(k ?? ""),
|
|
107
|
+
unmask: !1,
|
|
108
|
+
onAccept: (H) => w(H),
|
|
109
|
+
placeholder: a,
|
|
110
|
+
readOnly: _,
|
|
111
|
+
className: A,
|
|
112
|
+
inputRef: y || s == null ? void 0 : s.field.ref,
|
|
113
|
+
onBlur: N
|
|
114
|
+
}
|
|
115
|
+
) : /* @__PURE__ */ e(
|
|
116
|
+
"input",
|
|
117
|
+
{
|
|
118
|
+
type: f === "number" ? "number" : "text",
|
|
119
|
+
name: t,
|
|
120
|
+
value: k ?? "",
|
|
121
|
+
onChange: (H) => w(H.target.value),
|
|
122
|
+
onBlur: N,
|
|
123
|
+
placeholder: a,
|
|
124
|
+
readOnly: _,
|
|
125
|
+
className: A
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
return r ? /* @__PURE__ */ h("div", { className: "form-group", children: [
|
|
129
|
+
l && /* @__PURE__ */ e("label", { children: l }),
|
|
130
|
+
/* @__PURE__ */ h("div", { className: p ? "dfe-flex-input-wrapper" : "", children: [
|
|
131
|
+
/* @__PURE__ */ e("span", { className: A, children: k || "-" }),
|
|
132
|
+
p && /* @__PURE__ */ e(Z, { text: p, title: i, width: v })
|
|
133
|
+
] })
|
|
134
|
+
] }) : /* @__PURE__ */ h("div", { className: `form-group ${g ? "hidden" : ""}`, children: [
|
|
135
|
+
l && /* @__PURE__ */ e("label", { children: l }),
|
|
136
|
+
/* @__PURE__ */ h("div", { className: p ? "dfe-flex-input-wrapper" : "", children: [
|
|
137
|
+
b(),
|
|
138
|
+
p && /* @__PURE__ */ e(Z, { text: p, title: i, width: v })
|
|
139
|
+
] }),
|
|
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:
|
|
96
|
-
labelKey:
|
|
97
|
-
valueKey:
|
|
98
|
-
enableSearch:
|
|
99
|
-
searchPlaceholder:
|
|
100
|
-
loading:
|
|
101
|
-
onSearchChange:
|
|
102
|
-
debounceTime:
|
|
103
|
-
onSelect:
|
|
104
|
-
forceReadOnly:
|
|
105
|
-
forceHidden:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
143
|
+
const ot = q(De);
|
|
144
|
+
function Be({
|
|
145
|
+
name: t,
|
|
146
|
+
label: l = "",
|
|
147
|
+
options: a = [],
|
|
148
|
+
placeholder: f = "",
|
|
149
|
+
labelKey: c = "label",
|
|
150
|
+
valueKey: o = "value",
|
|
151
|
+
enableSearch: m = !1,
|
|
152
|
+
searchPlaceholder: d = "Buscar...",
|
|
153
|
+
loading: p = !1,
|
|
154
|
+
onSearchChange: i,
|
|
155
|
+
debounceTime: v = 300,
|
|
156
|
+
onSelect: x,
|
|
157
|
+
forceReadOnly: S = !1,
|
|
158
|
+
forceHidden: C = !1,
|
|
159
|
+
helpText: y,
|
|
160
|
+
helpTitle: R,
|
|
161
|
+
helpWidth: D,
|
|
162
|
+
valueManual: _,
|
|
163
|
+
onChangeManual: g,
|
|
164
|
+
errorManual: r
|
|
109
165
|
}) {
|
|
110
|
-
var
|
|
111
|
-
const
|
|
112
|
-
let
|
|
113
|
-
},
|
|
166
|
+
var se;
|
|
167
|
+
const n = _ !== void 0 && !!g, { isReadOnly: s, isHidden: u } = G(), k = S || !!s(t), I = C || !!u(t), { isView: B } = Y();
|
|
168
|
+
let V = "", O = () => {
|
|
169
|
+
}, w, N = null, A = () => {
|
|
114
170
|
};
|
|
115
|
-
if (
|
|
116
|
-
|
|
171
|
+
if (n)
|
|
172
|
+
V = _;
|
|
117
173
|
else
|
|
118
174
|
try {
|
|
119
|
-
const
|
|
120
|
-
|
|
175
|
+
const $ = U(), F = W({ name: t, control: $.control });
|
|
176
|
+
V = F.field.value, O = F.field.onChange, w = F.field.ref, N = (se = F.fieldState) == null ? void 0 : se.error, A = $.clearErrors;
|
|
121
177
|
} catch {
|
|
122
178
|
}
|
|
123
|
-
const [
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}, [
|
|
127
|
-
const
|
|
128
|
-
|
|
179
|
+
const [b, E] = P(!1), [L, H] = P(""), J = X(null), Q = X(i);
|
|
180
|
+
T(() => {
|
|
181
|
+
Q.current = i;
|
|
182
|
+
}, [i]), T(() => {
|
|
183
|
+
const $ = (F) => {
|
|
184
|
+
J.current && !J.current.contains(F.target) && E(!1);
|
|
129
185
|
};
|
|
130
|
-
return document.addEventListener("mousedown",
|
|
131
|
-
}, []),
|
|
132
|
-
|
|
133
|
-
}, [
|
|
134
|
-
if (!
|
|
135
|
-
const
|
|
136
|
-
var
|
|
137
|
-
(
|
|
138
|
-
},
|
|
139
|
-
return () => clearTimeout(
|
|
140
|
-
}, [
|
|
141
|
-
const ee =
|
|
142
|
-
(
|
|
143
|
-
) :
|
|
144
|
-
if (
|
|
145
|
-
if (typeof
|
|
146
|
-
return String(
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}, [w, n, c, i]), de = (R) => {
|
|
152
|
-
m || (p ? S == null || S(R[c]) : (D(R[c]), y == null || y(e)), h == null || h(R), P(!1));
|
|
186
|
+
return document.addEventListener("mousedown", $), () => document.removeEventListener("mousedown", $);
|
|
187
|
+
}, []), T(() => {
|
|
188
|
+
b || H("");
|
|
189
|
+
}, [b]), T(() => {
|
|
190
|
+
if (!m) return;
|
|
191
|
+
const $ = setTimeout(() => {
|
|
192
|
+
var F;
|
|
193
|
+
(F = Q.current) == null || F.call(Q, L);
|
|
194
|
+
}, v);
|
|
195
|
+
return () => clearTimeout($);
|
|
196
|
+
}, [L, m, v]);
|
|
197
|
+
const ee = z(() => m && !i && L.trim() ? a.filter(
|
|
198
|
+
($) => String(($ == null ? void 0 : $[c]) ?? "").toLowerCase().includes(L.toLowerCase())
|
|
199
|
+
) : a ?? [], [a, m, i, L, c]), te = z(() => {
|
|
200
|
+
if (V == null) return "";
|
|
201
|
+
if (typeof V == "object")
|
|
202
|
+
return String(V[o] ?? "");
|
|
203
|
+
const $ = (a || []).find((F) => String(F == null ? void 0 : F[o]) === String(V));
|
|
204
|
+
return String($ ? ($ == null ? void 0 : $[c]) ?? "" : V);
|
|
205
|
+
}, [V, a, o, c]), he = ($) => {
|
|
206
|
+
k || (n ? g == null || g($[o]) : (O($[o]), A == null || A(t)), x == null || x($), E(!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__ */ r("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
196
|
-
] })
|
|
197
|
-
] }),
|
|
198
|
-
!p && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: w || "" }),
|
|
199
|
-
(_ || A) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((_ == null ? void 0 : _.message) ?? A) })
|
|
200
|
-
]
|
|
201
|
-
}
|
|
202
|
-
);
|
|
208
|
+
return I ? null : /* @__PURE__ */ h("div", { className: `select-wrapper form-group ${I ? "hidden" : ""}`, ref: J, children: [
|
|
209
|
+
/* @__PURE__ */ e("label", { className: "control-label", children: l }),
|
|
210
|
+
B ? /* @__PURE__ */ h("div", { className: y ? "dfe-flex-input-wrapper" : "", children: [
|
|
211
|
+
/* @__PURE__ */ e("span", { className: "form-control", style: y ? { flex: 1 } : void 0, children: te || "-" }),
|
|
212
|
+
y && /* @__PURE__ */ e(Z, { text: y, title: R, width: D })
|
|
213
|
+
] }) : /* @__PURE__ */ h(ce, { children: [
|
|
214
|
+
/* @__PURE__ */ h("div", { className: y ? "dfe-flex-input-wrapper" : "", children: [
|
|
215
|
+
/* @__PURE__ */ h(
|
|
216
|
+
"div",
|
|
217
|
+
{
|
|
218
|
+
className: `select-control ${N ? "border-red" : ""} ${k ? "readOnly" : ""}`,
|
|
219
|
+
onClick: () => !k && E(($) => !$),
|
|
220
|
+
ref: w,
|
|
221
|
+
style: y ? { flex: 1 } : void 0,
|
|
222
|
+
children: [
|
|
223
|
+
/* @__PURE__ */ e("span", { className: `select-display ${k ? "readOnly" : ""}`, children: te || f }),
|
|
224
|
+
/* @__PURE__ */ e("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
),
|
|
228
|
+
y && /* @__PURE__ */ e(Z, { text: y, title: R, width: D })
|
|
229
|
+
] }),
|
|
230
|
+
b && !k && /* @__PURE__ */ h("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: ($) => H($.target.value),
|
|
238
|
+
placeholder: p ? "Carregando..." : d,
|
|
239
|
+
autoFocus: !0,
|
|
240
|
+
onClick: ($) => $.stopPropagation()
|
|
241
|
+
}
|
|
242
|
+
) }),
|
|
243
|
+
/* @__PURE__ */ e("ul", { className: "select-options", children: p ? /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map(($) => /* @__PURE__ */ e("li", { onClick: () => he($), className: "select-option handleHover", children: $[c] }, $[o])) : /* @__PURE__ */ e("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
244
|
+
] })
|
|
245
|
+
] }),
|
|
246
|
+
!n && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: V || "" }),
|
|
247
|
+
(N || r) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((N == null ? void 0 : N.message) ?? r) })
|
|
248
|
+
] });
|
|
203
249
|
}
|
|
204
|
-
const
|
|
205
|
-
function
|
|
206
|
-
name:
|
|
207
|
-
options:
|
|
208
|
-
label:
|
|
209
|
-
valueKey:
|
|
210
|
-
labelKey:
|
|
211
|
-
forceReadOnly:
|
|
212
|
-
forceHidden:
|
|
213
|
-
valueManual:
|
|
214
|
-
onChangeManual:
|
|
250
|
+
const re = q(Be);
|
|
251
|
+
function at({
|
|
252
|
+
name: t,
|
|
253
|
+
options: l = [],
|
|
254
|
+
label: a = "",
|
|
255
|
+
valueKey: f = "value",
|
|
256
|
+
labelKey: c = "label",
|
|
257
|
+
forceReadOnly: o = !1,
|
|
258
|
+
forceHidden: m = !1,
|
|
259
|
+
valueManual: d,
|
|
260
|
+
onChangeManual: p
|
|
215
261
|
}) {
|
|
216
|
-
var
|
|
217
|
-
let
|
|
262
|
+
var B, V;
|
|
263
|
+
let i = null;
|
|
218
264
|
try {
|
|
219
|
-
|
|
265
|
+
i = U();
|
|
220
266
|
} catch {
|
|
221
267
|
}
|
|
222
|
-
const
|
|
223
|
-
(
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
|
|
227
|
-
else if (
|
|
228
|
-
const
|
|
229
|
-
|
|
268
|
+
const v = d !== void 0 && !!p, { isView: x, isReadOnly: S } = Y(), { isReadOnly: C, isHidden: y } = G(), R = C ? C(t) : !1, D = y ? y(t) : !1, _ = o || R, g = m || D, r = _ || S || x, n = () => l ? l.reduce(
|
|
269
|
+
(O, w) => {
|
|
270
|
+
const N = String(w[f]);
|
|
271
|
+
if (v)
|
|
272
|
+
O[N] = !!(d != null && d[N]);
|
|
273
|
+
else if (i) {
|
|
274
|
+
const A = i.getValues(N);
|
|
275
|
+
O[N] = A === "on";
|
|
230
276
|
} else
|
|
231
|
-
|
|
232
|
-
return
|
|
277
|
+
O[N] = !1;
|
|
278
|
+
return O;
|
|
233
279
|
},
|
|
234
280
|
{}
|
|
235
|
-
) : {},
|
|
236
|
-
|
|
237
|
-
if (
|
|
238
|
-
const
|
|
239
|
-
(!
|
|
281
|
+
) : {}, s = !v && i ? i.watch(t) : void 0, u = z(() => v && d ? d : s && typeof s == "object" ? s : n(), [s, d, l]);
|
|
282
|
+
T(() => {
|
|
283
|
+
if (v || !i) return;
|
|
284
|
+
const O = i.getValues(t);
|
|
285
|
+
(!O || typeof O != "object") && i.setValue(t, u, {
|
|
240
286
|
shouldDirty: !1,
|
|
241
287
|
shouldValidate: !1
|
|
242
288
|
});
|
|
243
|
-
}, [
|
|
244
|
-
const
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
|
|
289
|
+
}, [u, t, i, v]);
|
|
290
|
+
const k = (O, w) => {
|
|
291
|
+
if (r) return;
|
|
292
|
+
const N = { ...u, [O]: w };
|
|
293
|
+
if (v) {
|
|
294
|
+
p && p(N);
|
|
249
295
|
return;
|
|
250
296
|
}
|
|
251
|
-
|
|
297
|
+
i && (i.setValue(t, N, {
|
|
252
298
|
shouldDirty: !0,
|
|
253
299
|
shouldValidate: !0
|
|
254
|
-
}),
|
|
255
|
-
},
|
|
256
|
-
return /* @__PURE__ */
|
|
257
|
-
|
|
258
|
-
/* @__PURE__ */
|
|
300
|
+
}), i.setValue(O, w ? "on" : "", { shouldValidate: !1 }));
|
|
301
|
+
}, I = v ? null : (V = (B = i == null ? void 0 : i.formState) == null ? void 0 : B.errors) == null ? void 0 : V[t];
|
|
302
|
+
return /* @__PURE__ */ h("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: l.map((O) => {
|
|
309
|
+
const w = String(O[f]), N = u[w] === !0;
|
|
310
|
+
return /* @__PURE__ */ h("div", { children: [
|
|
311
|
+
!v && i && /* @__PURE__ */ e("input", { type: "hidden", ...i.register(w) }),
|
|
312
|
+
/* @__PURE__ */ h(
|
|
267
313
|
"label",
|
|
268
314
|
{
|
|
269
|
-
className: `custom-checkbox ${
|
|
315
|
+
className: `custom-checkbox ${N ? "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: N,
|
|
322
|
+
disabled: r,
|
|
323
|
+
onChange: (A) => k(w, A.target.checked)
|
|
278
324
|
}
|
|
279
325
|
),
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
326
|
+
/* @__PURE__ */ e("span", { className: "checkmark" }),
|
|
327
|
+
/* @__PURE__ */ e("span", { children: O[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:
|
|
297
|
-
labelKey:
|
|
298
|
-
iconKey:
|
|
299
|
-
forceReadOnly:
|
|
300
|
-
forceHidden:
|
|
301
|
-
valueManual:
|
|
302
|
-
onChangeManual:
|
|
303
|
-
errorManual:
|
|
338
|
+
function Ce({
|
|
339
|
+
name: t,
|
|
340
|
+
label: l = "",
|
|
341
|
+
options: a = [],
|
|
342
|
+
valueKey: f = "value",
|
|
343
|
+
labelKey: c = "label",
|
|
344
|
+
iconKey: o = "icon",
|
|
345
|
+
forceReadOnly: m = !1,
|
|
346
|
+
forceHidden: d = !1,
|
|
347
|
+
valueManual: p,
|
|
348
|
+
onChangeManual: i,
|
|
349
|
+
errorManual: v
|
|
304
350
|
}) {
|
|
305
|
-
var
|
|
306
|
-
const
|
|
307
|
-
let
|
|
351
|
+
var B, V;
|
|
352
|
+
const x = p !== void 0 && !!i, { isReadOnly: S, isHidden: C } = G(), y = m || !!S(t), R = d || !!C(t), { isView: D, isReadOnly: _ } = Y();
|
|
353
|
+
let g = null;
|
|
308
354
|
try {
|
|
309
|
-
|
|
355
|
+
g = U();
|
|
310
356
|
} catch {
|
|
311
357
|
}
|
|
312
|
-
const
|
|
313
|
-
(
|
|
314
|
-
|
|
358
|
+
const r = !x && g ? W({ name: t, control: g.control, defaultValue: "" }) : null, n = !x && g ? oe({ name: t }) : null, s = x ? v : (V = (B = n == null ? void 0 : n.errors) == null ? void 0 : B[t]) == null ? void 0 : V.message, u = y || _ || D, k = x ? p : (r == null ? void 0 : r.field.value) ?? "", I = j(
|
|
359
|
+
(O) => {
|
|
360
|
+
u || (x ? i == null || i(O) : (r == null || r.field.onChange(O), r == null || r.field.onBlur()));
|
|
315
361
|
},
|
|
316
|
-
[
|
|
362
|
+
[u, x, i, r]
|
|
317
363
|
);
|
|
318
|
-
return /* @__PURE__ */
|
|
319
|
-
|
|
320
|
-
/* @__PURE__ */
|
|
321
|
-
const
|
|
364
|
+
return /* @__PURE__ */ h("div", { className: `form-group column ${R ? "hidden" : ""}`, children: [
|
|
365
|
+
l && /* @__PURE__ */ e("label", { className: "control-label", children: l }),
|
|
366
|
+
/* @__PURE__ */ e("div", { className: `btn-group ${u ? "view-mode" : ""}`, "data-field-name": t, children: a.map((O) => {
|
|
367
|
+
const w = O[f], N = k === w, A = O.color ? { "--customColor": O.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__ */ h(
|
|
325
371
|
"div",
|
|
326
372
|
{
|
|
327
|
-
style:
|
|
328
|
-
className: `btn fs-ellipsis ${
|
|
329
|
-
onClick: () =>
|
|
373
|
+
style: A,
|
|
374
|
+
className: `btn fs-ellipsis ${N ? "active" : ""}`,
|
|
375
|
+
onClick: () => I(w),
|
|
330
376
|
children: [
|
|
331
|
-
|
|
377
|
+
O[o] && /* @__PURE__ */ e("i", { className: `${O[o]} icon-sm` }),
|
|
332
378
|
" ",
|
|
333
|
-
|
|
379
|
+
O[c]
|
|
334
380
|
]
|
|
335
381
|
},
|
|
336
|
-
|
|
382
|
+
w
|
|
337
383
|
)
|
|
338
384
|
);
|
|
339
385
|
}) }),
|
|
340
|
-
!
|
|
341
|
-
(
|
|
386
|
+
!x && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: k || "", ref: r == null ? void 0 : r.field.ref }),
|
|
387
|
+
(s || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String(s ?? v) })
|
|
342
388
|
] });
|
|
343
389
|
}
|
|
344
|
-
const
|
|
345
|
-
name:
|
|
346
|
-
label:
|
|
347
|
-
placeholder:
|
|
348
|
-
className:
|
|
349
|
-
rows:
|
|
350
|
-
maxLength:
|
|
351
|
-
forceReadOnly:
|
|
352
|
-
forceHidden:
|
|
353
|
-
valueManual:
|
|
354
|
-
onChangeManual:
|
|
355
|
-
errorManual:
|
|
390
|
+
const ut = q(Ce), He = ({
|
|
391
|
+
name: t,
|
|
392
|
+
label: l = "",
|
|
393
|
+
placeholder: a = "",
|
|
394
|
+
className: f = "",
|
|
395
|
+
rows: c = 4,
|
|
396
|
+
maxLength: o,
|
|
397
|
+
forceReadOnly: m = !1,
|
|
398
|
+
forceHidden: d = !1,
|
|
399
|
+
valueManual: p,
|
|
400
|
+
onChangeManual: i,
|
|
401
|
+
errorManual: v
|
|
356
402
|
}) => {
|
|
357
|
-
var
|
|
358
|
-
const
|
|
359
|
-
let
|
|
360
|
-
value:
|
|
361
|
-
onChange: (
|
|
362
|
-
},
|
|
363
|
-
if (!
|
|
403
|
+
var u;
|
|
404
|
+
const x = p !== void 0 && !!i, { isReadOnly: S, isHidden: C } = G(), y = m || !!S(t), R = d || !!C(t), { isView: D } = Y(), _ = X(null);
|
|
405
|
+
let g = {
|
|
406
|
+
value: p ?? "",
|
|
407
|
+
onChange: (k) => i == null ? void 0 : i(k)
|
|
408
|
+
}, r = null;
|
|
409
|
+
if (!x)
|
|
364
410
|
try {
|
|
365
|
-
const { control:
|
|
366
|
-
|
|
411
|
+
const { control: k } = U(), I = W({ name: t, control: k });
|
|
412
|
+
g = I.field, r = (u = I.fieldState) == null ? void 0 : u.error;
|
|
367
413
|
} catch {
|
|
368
414
|
}
|
|
369
|
-
const
|
|
370
|
-
|
|
415
|
+
const n = () => {
|
|
416
|
+
_.current && (_.current.style.height = "auto", _.current.style.height = `${_.current.scrollHeight}px`);
|
|
371
417
|
};
|
|
372
|
-
if (
|
|
373
|
-
|
|
374
|
-
}, [
|
|
375
|
-
return /* @__PURE__ */
|
|
376
|
-
/* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
418
|
+
if (T(() => {
|
|
419
|
+
n();
|
|
420
|
+
}, [g.value]), D)
|
|
421
|
+
return /* @__PURE__ */ h("div", { className: `form-group ${R ? "hidden" : ""}`, children: [
|
|
422
|
+
/* @__PURE__ */ e("label", { children: l }),
|
|
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 ${y ? "readOnly" : ""} ${r || v ? "border-red" : ""} ${f}`;
|
|
426
|
+
return /* @__PURE__ */ h("div", { className: `form-group ${R ? "hidden" : ""}`, children: [
|
|
427
|
+
l && /* @__PURE__ */ e("label", { children: l }),
|
|
428
|
+
/* @__PURE__ */ e(
|
|
383
429
|
"textarea",
|
|
384
430
|
{
|
|
385
|
-
ref:
|
|
386
|
-
rows:
|
|
387
|
-
maxLength:
|
|
388
|
-
value:
|
|
389
|
-
placeholder:
|
|
390
|
-
readOnly:
|
|
391
|
-
className:
|
|
431
|
+
ref: _,
|
|
432
|
+
rows: c,
|
|
433
|
+
maxLength: o,
|
|
434
|
+
value: g.value || "",
|
|
435
|
+
placeholder: a,
|
|
436
|
+
readOnly: y,
|
|
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: (k) => {
|
|
444
|
+
x ? i == null || i(k.target.value) : g.onChange(k);
|
|
399
445
|
},
|
|
400
|
-
onInput:
|
|
446
|
+
onInput: n
|
|
401
447
|
}
|
|
402
448
|
),
|
|
403
|
-
(
|
|
449
|
+
(r || v) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((r == null ? void 0 : r.message) ?? v) })
|
|
404
450
|
] });
|
|
405
|
-
},
|
|
406
|
-
function J(e) {
|
|
407
|
-
return (t = {}) => {
|
|
408
|
-
const n = t.width ? String(t.width) : e.defaultWidth;
|
|
409
|
-
return e.formats[n] || e.formats[e.defaultWidth];
|
|
410
|
-
};
|
|
411
|
-
}
|
|
412
|
-
function Q(e) {
|
|
413
|
-
return (t, n) => {
|
|
414
|
-
const s = n != null && n.context ? String(n.context) : "standalone";
|
|
415
|
-
let i;
|
|
416
|
-
if (s === "formatting" && e.formattingValues) {
|
|
417
|
-
const l = e.defaultFormattingWidth || e.defaultWidth, o = n != null && n.width ? String(n.width) : l;
|
|
418
|
-
i = e.formattingValues[o] || e.formattingValues[l];
|
|
419
|
-
} else {
|
|
420
|
-
const l = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
421
|
-
i = e.values[o] || e.values[l];
|
|
422
|
-
}
|
|
423
|
-
const c = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
424
|
-
return i[c];
|
|
425
|
-
};
|
|
426
|
-
}
|
|
427
|
-
function Y(e) {
|
|
428
|
-
return (t, n = {}) => {
|
|
429
|
-
const s = n.width, i = s && e.matchPatterns[s] || e.matchPatterns[e.defaultMatchWidth], c = t.match(i);
|
|
430
|
-
if (!c)
|
|
431
|
-
return null;
|
|
432
|
-
const l = c[0], o = s && e.parsePatterns[s] || e.parsePatterns[e.defaultParseWidth], b = Array.isArray(o) ? $e(o, (h) => h.test(l)) : (
|
|
433
|
-
// [TODO] -- I challenge you to fix the type
|
|
434
|
-
_e(o, (h) => h.test(l))
|
|
435
|
-
);
|
|
436
|
-
let a;
|
|
437
|
-
a = e.valueCallback ? e.valueCallback(b) : b, a = n.valueCallback ? (
|
|
438
|
-
// [TODO] -- I challenge you to fix the type
|
|
439
|
-
n.valueCallback(a)
|
|
440
|
-
) : a;
|
|
441
|
-
const N = t.slice(l.length);
|
|
442
|
-
return { value: a, rest: N };
|
|
443
|
-
};
|
|
444
|
-
}
|
|
445
|
-
function _e(e, t) {
|
|
446
|
-
for (const n in e)
|
|
447
|
-
if (Object.prototype.hasOwnProperty.call(e, n) && t(e[n]))
|
|
448
|
-
return n;
|
|
449
|
-
}
|
|
450
|
-
function $e(e, t) {
|
|
451
|
-
for (let n = 0; n < e.length; n++)
|
|
452
|
-
if (t(e[n]))
|
|
453
|
-
return n;
|
|
454
|
-
}
|
|
455
|
-
function Ae(e) {
|
|
456
|
-
return (t, n = {}) => {
|
|
457
|
-
const s = t.match(e.matchPattern);
|
|
458
|
-
if (!s) return null;
|
|
459
|
-
const i = s[0], c = t.match(e.parsePattern);
|
|
460
|
-
if (!c) return null;
|
|
461
|
-
let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
|
|
462
|
-
l = n.valueCallback ? n.valueCallback(l) : l;
|
|
463
|
-
const o = t.slice(i.length);
|
|
464
|
-
return { value: l, rest: o };
|
|
465
|
-
};
|
|
466
|
-
}
|
|
467
|
-
const We = {
|
|
468
|
-
lessThanXSeconds: {
|
|
469
|
-
one: "menos de um segundo",
|
|
470
|
-
other: "menos de {{count}} segundos"
|
|
471
|
-
},
|
|
472
|
-
xSeconds: {
|
|
473
|
-
one: "1 segundo",
|
|
474
|
-
other: "{{count}} segundos"
|
|
475
|
-
},
|
|
476
|
-
halfAMinute: "meio minuto",
|
|
477
|
-
lessThanXMinutes: {
|
|
478
|
-
one: "menos de um minuto",
|
|
479
|
-
other: "menos de {{count}} minutos"
|
|
480
|
-
},
|
|
481
|
-
xMinutes: {
|
|
482
|
-
one: "1 minuto",
|
|
483
|
-
other: "{{count}} minutos"
|
|
484
|
-
},
|
|
485
|
-
aboutXHours: {
|
|
486
|
-
one: "cerca de 1 hora",
|
|
487
|
-
other: "cerca de {{count}} horas"
|
|
488
|
-
},
|
|
489
|
-
xHours: {
|
|
490
|
-
one: "1 hora",
|
|
491
|
-
other: "{{count}} horas"
|
|
492
|
-
},
|
|
493
|
-
xDays: {
|
|
494
|
-
one: "1 dia",
|
|
495
|
-
other: "{{count}} dias"
|
|
496
|
-
},
|
|
497
|
-
aboutXWeeks: {
|
|
498
|
-
one: "cerca de 1 semana",
|
|
499
|
-
other: "cerca de {{count}} semanas"
|
|
500
|
-
},
|
|
501
|
-
xWeeks: {
|
|
502
|
-
one: "1 semana",
|
|
503
|
-
other: "{{count}} semanas"
|
|
504
|
-
},
|
|
505
|
-
aboutXMonths: {
|
|
506
|
-
one: "cerca de 1 mês",
|
|
507
|
-
other: "cerca de {{count}} meses"
|
|
508
|
-
},
|
|
509
|
-
xMonths: {
|
|
510
|
-
one: "1 mês",
|
|
511
|
-
other: "{{count}} meses"
|
|
512
|
-
},
|
|
513
|
-
aboutXYears: {
|
|
514
|
-
one: "cerca de 1 ano",
|
|
515
|
-
other: "cerca de {{count}} anos"
|
|
516
|
-
},
|
|
517
|
-
xYears: {
|
|
518
|
-
one: "1 ano",
|
|
519
|
-
other: "{{count}} anos"
|
|
520
|
-
},
|
|
521
|
-
overXYears: {
|
|
522
|
-
one: "mais de 1 ano",
|
|
523
|
-
other: "mais de {{count}} anos"
|
|
524
|
-
},
|
|
525
|
-
almostXYears: {
|
|
526
|
-
one: "quase 1 ano",
|
|
527
|
-
other: "quase {{count}} anos"
|
|
528
|
-
}
|
|
529
|
-
}, Ve = (e, t, n) => {
|
|
530
|
-
let s;
|
|
531
|
-
const i = We[e];
|
|
532
|
-
return typeof i == "string" ? s = i : t === 1 ? s = i.one : s = i.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "em " + s : "há " + s : s;
|
|
533
|
-
}, De = {
|
|
534
|
-
full: "EEEE, d 'de' MMMM 'de' y",
|
|
535
|
-
long: "d 'de' MMMM 'de' y",
|
|
536
|
-
medium: "d MMM y",
|
|
537
|
-
short: "dd/MM/yyyy"
|
|
538
|
-
}, Te = {
|
|
539
|
-
full: "HH:mm:ss zzzz",
|
|
540
|
-
long: "HH:mm:ss z",
|
|
541
|
-
medium: "HH:mm:ss",
|
|
542
|
-
short: "HH:mm"
|
|
543
|
-
}, je = {
|
|
544
|
-
full: "{{date}} 'às' {{time}}",
|
|
545
|
-
long: "{{date}} 'às' {{time}}",
|
|
546
|
-
medium: "{{date}}, {{time}}",
|
|
547
|
-
short: "{{date}}, {{time}}"
|
|
548
|
-
}, Ce = {
|
|
549
|
-
date: J({
|
|
550
|
-
formats: De,
|
|
551
|
-
defaultWidth: "full"
|
|
552
|
-
}),
|
|
553
|
-
time: J({
|
|
554
|
-
formats: Te,
|
|
555
|
-
defaultWidth: "full"
|
|
556
|
-
}),
|
|
557
|
-
dateTime: J({
|
|
558
|
-
formats: je,
|
|
559
|
-
defaultWidth: "full"
|
|
560
|
-
})
|
|
561
|
-
}, Ee = {
|
|
562
|
-
lastWeek: (e) => {
|
|
563
|
-
const t = e.getDay();
|
|
564
|
-
return "'" + (t === 0 || t === 6 ? "último" : "última") + "' eeee 'às' p";
|
|
565
|
-
},
|
|
566
|
-
yesterday: "'ontem às' p",
|
|
567
|
-
today: "'hoje às' p",
|
|
568
|
-
tomorrow: "'amanhã às' p",
|
|
569
|
-
nextWeek: "eeee 'às' p",
|
|
570
|
-
other: "P"
|
|
571
|
-
}, He = (e, t, n, s) => {
|
|
572
|
-
const i = Ee[e];
|
|
573
|
-
return typeof i == "function" ? i(t) : i;
|
|
574
|
-
}, Le = {
|
|
575
|
-
narrow: ["AC", "DC"],
|
|
576
|
-
abbreviated: ["AC", "DC"],
|
|
577
|
-
wide: ["antes de cristo", "depois de cristo"]
|
|
578
|
-
}, Ie = {
|
|
579
|
-
narrow: ["1", "2", "3", "4"],
|
|
580
|
-
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
581
|
-
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
582
|
-
}, Fe = {
|
|
583
|
-
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
584
|
-
abbreviated: [
|
|
585
|
-
"jan",
|
|
586
|
-
"fev",
|
|
587
|
-
"mar",
|
|
588
|
-
"abr",
|
|
589
|
-
"mai",
|
|
590
|
-
"jun",
|
|
591
|
-
"jul",
|
|
592
|
-
"ago",
|
|
593
|
-
"set",
|
|
594
|
-
"out",
|
|
595
|
-
"nov",
|
|
596
|
-
"dez"
|
|
597
|
-
],
|
|
598
|
-
wide: [
|
|
599
|
-
"janeiro",
|
|
600
|
-
"fevereiro",
|
|
601
|
-
"março",
|
|
602
|
-
"abril",
|
|
603
|
-
"maio",
|
|
604
|
-
"junho",
|
|
605
|
-
"julho",
|
|
606
|
-
"agosto",
|
|
607
|
-
"setembro",
|
|
608
|
-
"outubro",
|
|
609
|
-
"novembro",
|
|
610
|
-
"dezembro"
|
|
611
|
-
]
|
|
612
|
-
}, qe = {
|
|
613
|
-
narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
|
|
614
|
-
short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
|
|
615
|
-
abbreviated: [
|
|
616
|
-
"domingo",
|
|
617
|
-
"segunda",
|
|
618
|
-
"terça",
|
|
619
|
-
"quarta",
|
|
620
|
-
"quinta",
|
|
621
|
-
"sexta",
|
|
622
|
-
"sábado"
|
|
623
|
-
],
|
|
624
|
-
wide: [
|
|
625
|
-
"domingo",
|
|
626
|
-
"segunda-feira",
|
|
627
|
-
"terça-feira",
|
|
628
|
-
"quarta-feira",
|
|
629
|
-
"quinta-feira",
|
|
630
|
-
"sexta-feira",
|
|
631
|
-
"sábado"
|
|
632
|
-
]
|
|
633
|
-
}, Be = {
|
|
634
|
-
narrow: {
|
|
635
|
-
am: "a",
|
|
636
|
-
pm: "p",
|
|
637
|
-
midnight: "mn",
|
|
638
|
-
noon: "md",
|
|
639
|
-
morning: "manhã",
|
|
640
|
-
afternoon: "tarde",
|
|
641
|
-
evening: "tarde",
|
|
642
|
-
night: "noite"
|
|
643
|
-
},
|
|
644
|
-
abbreviated: {
|
|
645
|
-
am: "AM",
|
|
646
|
-
pm: "PM",
|
|
647
|
-
midnight: "meia-noite",
|
|
648
|
-
noon: "meio-dia",
|
|
649
|
-
morning: "manhã",
|
|
650
|
-
afternoon: "tarde",
|
|
651
|
-
evening: "tarde",
|
|
652
|
-
night: "noite"
|
|
653
|
-
},
|
|
654
|
-
wide: {
|
|
655
|
-
am: "a.m.",
|
|
656
|
-
pm: "p.m.",
|
|
657
|
-
midnight: "meia-noite",
|
|
658
|
-
noon: "meio-dia",
|
|
659
|
-
morning: "manhã",
|
|
660
|
-
afternoon: "tarde",
|
|
661
|
-
evening: "tarde",
|
|
662
|
-
night: "noite"
|
|
663
|
-
}
|
|
664
|
-
}, ze = {
|
|
665
|
-
narrow: {
|
|
666
|
-
am: "a",
|
|
667
|
-
pm: "p",
|
|
668
|
-
midnight: "mn",
|
|
669
|
-
noon: "md",
|
|
670
|
-
morning: "da manhã",
|
|
671
|
-
afternoon: "da tarde",
|
|
672
|
-
evening: "da tarde",
|
|
673
|
-
night: "da noite"
|
|
674
|
-
},
|
|
675
|
-
abbreviated: {
|
|
676
|
-
am: "AM",
|
|
677
|
-
pm: "PM",
|
|
678
|
-
midnight: "meia-noite",
|
|
679
|
-
noon: "meio-dia",
|
|
680
|
-
morning: "da manhã",
|
|
681
|
-
afternoon: "da tarde",
|
|
682
|
-
evening: "da tarde",
|
|
683
|
-
night: "da noite"
|
|
684
|
-
},
|
|
685
|
-
wide: {
|
|
686
|
-
am: "a.m.",
|
|
687
|
-
pm: "p.m.",
|
|
688
|
-
midnight: "meia-noite",
|
|
689
|
-
noon: "meio-dia",
|
|
690
|
-
morning: "da manhã",
|
|
691
|
-
afternoon: "da tarde",
|
|
692
|
-
evening: "da tarde",
|
|
693
|
-
night: "da noite"
|
|
694
|
-
}
|
|
695
|
-
}, Xe = (e, t) => {
|
|
696
|
-
const n = Number(e);
|
|
697
|
-
return (t == null ? void 0 : t.unit) === "week" ? n + "ª" : n + "º";
|
|
698
|
-
}, Ue = {
|
|
699
|
-
ordinalNumber: Xe,
|
|
700
|
-
era: Q({
|
|
701
|
-
values: Le,
|
|
702
|
-
defaultWidth: "wide"
|
|
703
|
-
}),
|
|
704
|
-
quarter: Q({
|
|
705
|
-
values: Ie,
|
|
706
|
-
defaultWidth: "wide",
|
|
707
|
-
argumentCallback: (e) => e - 1
|
|
708
|
-
}),
|
|
709
|
-
month: Q({
|
|
710
|
-
values: Fe,
|
|
711
|
-
defaultWidth: "wide"
|
|
712
|
-
}),
|
|
713
|
-
day: Q({
|
|
714
|
-
values: qe,
|
|
715
|
-
defaultWidth: "wide"
|
|
716
|
-
}),
|
|
717
|
-
dayPeriod: Q({
|
|
718
|
-
values: Be,
|
|
719
|
-
defaultWidth: "wide",
|
|
720
|
-
formattingValues: ze,
|
|
721
|
-
defaultFormattingWidth: "wide"
|
|
722
|
-
})
|
|
723
|
-
}, Qe = /^(\d+)[ºªo]?/i, Ye = /\d+/i, Ge = {
|
|
724
|
-
narrow: /^(ac|dc|a|d)/i,
|
|
725
|
-
abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
|
|
726
|
-
wide: /^(antes de cristo|depois de cristo)/i
|
|
727
|
-
}, Je = {
|
|
728
|
-
any: [/^ac/i, /^dc/i],
|
|
729
|
-
wide: [/^antes de cristo/i, /^depois de cristo/i]
|
|
730
|
-
}, Ze = {
|
|
731
|
-
narrow: /^[1234]/i,
|
|
732
|
-
abbreviated: /^T[1234]/i,
|
|
733
|
-
wide: /^[1234](º)? trimestre/i
|
|
734
|
-
}, Ke = {
|
|
735
|
-
any: [/1/i, /2/i, /3/i, /4/i]
|
|
736
|
-
}, Me = {
|
|
737
|
-
narrow: /^[jfmajsond]/i,
|
|
738
|
-
abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
|
|
739
|
-
wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
|
|
740
|
-
}, et = {
|
|
741
|
-
narrow: [
|
|
742
|
-
/^j/i,
|
|
743
|
-
/^f/i,
|
|
744
|
-
/^m/i,
|
|
745
|
-
/^a/i,
|
|
746
|
-
/^m/i,
|
|
747
|
-
/^j/i,
|
|
748
|
-
/^j/i,
|
|
749
|
-
/^a/i,
|
|
750
|
-
/^s/i,
|
|
751
|
-
/^o/i,
|
|
752
|
-
/^n/i,
|
|
753
|
-
/^d/i
|
|
754
|
-
],
|
|
755
|
-
any: [
|
|
756
|
-
/^ja/i,
|
|
757
|
-
/^fev/i,
|
|
758
|
-
/^mar/i,
|
|
759
|
-
/^abr/i,
|
|
760
|
-
/^mai/i,
|
|
761
|
-
/^jun/i,
|
|
762
|
-
/^jul/i,
|
|
763
|
-
/^ago/i,
|
|
764
|
-
/^set/i,
|
|
765
|
-
/^out/i,
|
|
766
|
-
/^nov/i,
|
|
767
|
-
/^dez/i
|
|
768
|
-
]
|
|
769
|
-
}, tt = {
|
|
770
|
-
narrow: /^(dom|[23456]ª?|s[aá]b)/i,
|
|
771
|
-
short: /^(dom|[23456]ª?|s[aá]b)/i,
|
|
772
|
-
abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
|
|
773
|
-
wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
|
|
774
|
-
}, nt = {
|
|
775
|
-
short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
776
|
-
narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
777
|
-
any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
|
|
778
|
-
}, rt = {
|
|
779
|
-
narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
|
|
780
|
-
any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
|
|
781
|
-
}, it = {
|
|
782
|
-
any: {
|
|
783
|
-
am: /^a/i,
|
|
784
|
-
pm: /^p/i,
|
|
785
|
-
midnight: /^mn|^meia[-\s]noite/i,
|
|
786
|
-
noon: /^md|^meio[-\s]dia/i,
|
|
787
|
-
morning: /manhã/i,
|
|
788
|
-
afternoon: /tarde/i,
|
|
789
|
-
evening: /tarde/i,
|
|
790
|
-
night: /noite/i
|
|
791
|
-
}
|
|
792
|
-
}, st = {
|
|
793
|
-
ordinalNumber: Ae({
|
|
794
|
-
matchPattern: Qe,
|
|
795
|
-
parsePattern: Ye,
|
|
796
|
-
valueCallback: (e) => parseInt(e, 10)
|
|
797
|
-
}),
|
|
798
|
-
era: Y({
|
|
799
|
-
matchPatterns: Ge,
|
|
800
|
-
defaultMatchWidth: "wide",
|
|
801
|
-
parsePatterns: Je,
|
|
802
|
-
defaultParseWidth: "any"
|
|
803
|
-
}),
|
|
804
|
-
quarter: Y({
|
|
805
|
-
matchPatterns: Ze,
|
|
806
|
-
defaultMatchWidth: "wide",
|
|
807
|
-
parsePatterns: Ke,
|
|
808
|
-
defaultParseWidth: "any",
|
|
809
|
-
valueCallback: (e) => e + 1
|
|
810
|
-
}),
|
|
811
|
-
month: Y({
|
|
812
|
-
matchPatterns: Me,
|
|
813
|
-
defaultMatchWidth: "wide",
|
|
814
|
-
parsePatterns: et,
|
|
815
|
-
defaultParseWidth: "any"
|
|
816
|
-
}),
|
|
817
|
-
day: Y({
|
|
818
|
-
matchPatterns: tt,
|
|
819
|
-
defaultMatchWidth: "wide",
|
|
820
|
-
parsePatterns: nt,
|
|
821
|
-
defaultParseWidth: "any"
|
|
822
|
-
}),
|
|
823
|
-
dayPeriod: Y({
|
|
824
|
-
matchPatterns: rt,
|
|
825
|
-
defaultMatchWidth: "any",
|
|
826
|
-
parsePatterns: it,
|
|
827
|
-
defaultParseWidth: "any"
|
|
828
|
-
})
|
|
829
|
-
}, at = {
|
|
830
|
-
code: "pt-BR",
|
|
831
|
-
formatDistance: Ve,
|
|
832
|
-
formatLong: Ce,
|
|
833
|
-
formatRelative: He,
|
|
834
|
-
localize: Ue,
|
|
835
|
-
match: st,
|
|
836
|
-
options: {
|
|
837
|
-
weekStartsOn: 0,
|
|
838
|
-
firstWeekContainsDate: 1
|
|
839
|
-
}
|
|
840
|
-
};
|
|
451
|
+
}, ft = q(He);
|
|
841
452
|
/**
|
|
842
453
|
* @license lucide-react v0.575.0 - ISC
|
|
843
454
|
*
|
|
844
455
|
* This source code is licensed under the ISC license.
|
|
845
456
|
* See the LICENSE file in the root directory of this source tree.
|
|
846
457
|
*/
|
|
847
|
-
const
|
|
458
|
+
const fe = (...t) => t.filter((l, a, f) => !!l && l.trim() !== "" && f.indexOf(l) === a).join(" ").trim();
|
|
848
459
|
/**
|
|
849
460
|
* @license lucide-react v0.575.0 - ISC
|
|
850
461
|
*
|
|
851
462
|
* This source code is licensed under the ISC license.
|
|
852
463
|
* See the LICENSE file in the root directory of this source tree.
|
|
853
464
|
*/
|
|
854
|
-
const
|
|
465
|
+
const Le = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
855
466
|
/**
|
|
856
467
|
* @license lucide-react v0.575.0 - ISC
|
|
857
468
|
*
|
|
858
469
|
* This source code is licensed under the ISC license.
|
|
859
470
|
* See the LICENSE file in the root directory of this source tree.
|
|
860
471
|
*/
|
|
861
|
-
const
|
|
472
|
+
const Fe = (t) => t.replace(
|
|
862
473
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
863
|
-
(
|
|
474
|
+
(l, a, f) => f ? f.toUpperCase() : a.toLowerCase()
|
|
864
475
|
);
|
|
865
476
|
/**
|
|
866
477
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -868,9 +479,9 @@ const dt = (e) => e.replace(
|
|
|
868
479
|
* This source code is licensed under the ISC license.
|
|
869
480
|
* See the LICENSE file in the root directory of this source tree.
|
|
870
481
|
*/
|
|
871
|
-
const
|
|
872
|
-
const
|
|
873
|
-
return
|
|
482
|
+
const ne = (t) => {
|
|
483
|
+
const l = Fe(t);
|
|
484
|
+
return l.charAt(0).toUpperCase() + l.slice(1);
|
|
874
485
|
};
|
|
875
486
|
/**
|
|
876
487
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -878,7 +489,7 @@ const re = (e) => {
|
|
|
878
489
|
* This source code is licensed under the ISC license.
|
|
879
490
|
* See the LICENSE file in the root directory of this source tree.
|
|
880
491
|
*/
|
|
881
|
-
var
|
|
492
|
+
var Te = {
|
|
882
493
|
xmlns: "http://www.w3.org/2000/svg",
|
|
883
494
|
width: 24,
|
|
884
495
|
height: 24,
|
|
@@ -895,9 +506,9 @@ var ct = {
|
|
|
895
506
|
* This source code is licensed under the ISC license.
|
|
896
507
|
* See the LICENSE file in the root directory of this source tree.
|
|
897
508
|
*/
|
|
898
|
-
const
|
|
899
|
-
for (const
|
|
900
|
-
if (
|
|
509
|
+
const je = (t) => {
|
|
510
|
+
for (const l in t)
|
|
511
|
+
if (l.startsWith("aria-") || l === "role" || l === "title")
|
|
901
512
|
return !0;
|
|
902
513
|
return !1;
|
|
903
514
|
};
|
|
@@ -907,32 +518,32 @@ const lt = (e) => {
|
|
|
907
518
|
* This source code is licensed under the ISC license.
|
|
908
519
|
* See the LICENSE file in the root directory of this source tree.
|
|
909
520
|
*/
|
|
910
|
-
const
|
|
521
|
+
const Pe = de(
|
|
911
522
|
({
|
|
912
|
-
color:
|
|
913
|
-
size:
|
|
914
|
-
strokeWidth:
|
|
915
|
-
absoluteStrokeWidth:
|
|
916
|
-
className:
|
|
917
|
-
children:
|
|
918
|
-
iconNode:
|
|
919
|
-
...
|
|
920
|
-
},
|
|
523
|
+
color: t = "currentColor",
|
|
524
|
+
size: l = 24,
|
|
525
|
+
strokeWidth: a = 2,
|
|
526
|
+
absoluteStrokeWidth: f,
|
|
527
|
+
className: c = "",
|
|
528
|
+
children: o,
|
|
529
|
+
iconNode: m,
|
|
530
|
+
...d
|
|
531
|
+
}, p) => K(
|
|
921
532
|
"svg",
|
|
922
533
|
{
|
|
923
|
-
ref:
|
|
924
|
-
...
|
|
925
|
-
width:
|
|
926
|
-
height:
|
|
927
|
-
stroke:
|
|
928
|
-
strokeWidth:
|
|
929
|
-
className:
|
|
930
|
-
...!
|
|
931
|
-
...
|
|
534
|
+
ref: p,
|
|
535
|
+
...Te,
|
|
536
|
+
width: l,
|
|
537
|
+
height: l,
|
|
538
|
+
stroke: t,
|
|
539
|
+
strokeWidth: f ? Number(a) * 24 / Number(l) : a,
|
|
540
|
+
className: fe("lucide", c),
|
|
541
|
+
...!o && !je(d) && { "aria-hidden": "true" },
|
|
542
|
+
...d
|
|
932
543
|
},
|
|
933
544
|
[
|
|
934
|
-
...
|
|
935
|
-
...Array.isArray(
|
|
545
|
+
...m.map(([i, v]) => K(i, v)),
|
|
546
|
+
...Array.isArray(o) ? o : [o]
|
|
936
547
|
]
|
|
937
548
|
)
|
|
938
549
|
);
|
|
@@ -942,20 +553,20 @@ const ut = ie(
|
|
|
942
553
|
* This source code is licensed under the ISC license.
|
|
943
554
|
* See the LICENSE file in the root directory of this source tree.
|
|
944
555
|
*/
|
|
945
|
-
const M = (
|
|
946
|
-
const
|
|
947
|
-
({ className:
|
|
948
|
-
ref:
|
|
949
|
-
iconNode:
|
|
950
|
-
className:
|
|
951
|
-
`lucide-${
|
|
952
|
-
`lucide-${
|
|
953
|
-
|
|
556
|
+
const M = (t, l) => {
|
|
557
|
+
const a = de(
|
|
558
|
+
({ className: f, ...c }, o) => K(Pe, {
|
|
559
|
+
ref: o,
|
|
560
|
+
iconNode: l,
|
|
561
|
+
className: fe(
|
|
562
|
+
`lucide-${Le(ne(t))}`,
|
|
563
|
+
`lucide-${t}`,
|
|
564
|
+
f
|
|
954
565
|
),
|
|
955
|
-
...
|
|
566
|
+
...c
|
|
956
567
|
})
|
|
957
568
|
);
|
|
958
|
-
return
|
|
569
|
+
return a.displayName = ne(t), a;
|
|
959
570
|
};
|
|
960
571
|
/**
|
|
961
572
|
* @license lucide-react v0.575.0 - ISC
|
|
@@ -963,532 +574,513 @@ const M = (e, t) => {
|
|
|
963
574
|
* This source code is licensed under the ISC license.
|
|
964
575
|
* See the LICENSE file in the root directory of this source tree.
|
|
965
576
|
*/
|
|
966
|
-
const
|
|
577
|
+
const Ue = [
|
|
967
578
|
["path", { d: "M8 2v4", key: "1cmpym" }],
|
|
968
579
|
["path", { d: "M16 2v4", key: "4m81vk" }],
|
|
969
580
|
["rect", { width: "18", height: "18", x: "3", y: "4", rx: "2", key: "1hopcy" }],
|
|
970
581
|
["path", { d: "M3 10h18", key: "8toen8" }]
|
|
971
|
-
],
|
|
582
|
+
], Ye = M("calendar", Ue);
|
|
972
583
|
/**
|
|
973
584
|
* @license lucide-react v0.575.0 - ISC
|
|
974
585
|
*
|
|
975
586
|
* This source code is licensed under the ISC license.
|
|
976
587
|
* See the LICENSE file in the root directory of this source tree.
|
|
977
588
|
*/
|
|
978
|
-
const
|
|
589
|
+
const Je = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], ze = M("chevron-left", Je);
|
|
979
590
|
/**
|
|
980
591
|
* @license lucide-react v0.575.0 - ISC
|
|
981
592
|
*
|
|
982
593
|
* This source code is licensed under the ISC license.
|
|
983
594
|
* See the LICENSE file in the root directory of this source tree.
|
|
984
595
|
*/
|
|
985
|
-
const
|
|
986
|
-
|
|
987
|
-
const
|
|
988
|
-
return
|
|
989
|
-
|
|
990
|
-
|
|
596
|
+
const qe = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Ge = M("chevron-right", qe), me = "dd/MM/yyyy", le = (t) => {
|
|
597
|
+
if (!t) return null;
|
|
598
|
+
const l = Ae(t, me, /* @__PURE__ */ new Date());
|
|
599
|
+
return ae(l) ? l : null;
|
|
600
|
+
}, We = (t) => t ? ue(t, me) : "", Qe = [
|
|
601
|
+
{ value: 0, label: "Janeiro" },
|
|
602
|
+
{ value: 1, label: "Fevereiro" },
|
|
603
|
+
{ value: 2, label: "Março" },
|
|
604
|
+
{ value: 3, label: "Abril" },
|
|
605
|
+
{ value: 4, label: "Maio" },
|
|
606
|
+
{ value: 5, label: "Junho" },
|
|
607
|
+
{ value: 6, label: "Julho" },
|
|
608
|
+
{ value: 7, label: "Agosto" },
|
|
609
|
+
{ value: 8, label: "Setembro" },
|
|
610
|
+
{ value: 9, label: "Outubro" },
|
|
611
|
+
{ value: 10, label: "Novembro" },
|
|
612
|
+
{ value: 11, label: "Dezembro" }
|
|
613
|
+
], ie = 1940, Ze = 2100, Xe = Array.from({ length: Ze - ie + 1 }, (t, l) => {
|
|
614
|
+
const a = ie + l;
|
|
615
|
+
return { value: a, label: String(a) };
|
|
616
|
+
});
|
|
617
|
+
function Ke({
|
|
618
|
+
name: t,
|
|
619
|
+
label: l = "",
|
|
620
|
+
placeholder: a = "dd/mm/aaaa",
|
|
621
|
+
className: f = "",
|
|
622
|
+
forceReadOnly: c = !1,
|
|
623
|
+
forceHidden: o = !1,
|
|
624
|
+
valueManual: m,
|
|
625
|
+
onChangeManual: d,
|
|
626
|
+
errorManual: p
|
|
627
|
+
}) {
|
|
628
|
+
var A;
|
|
629
|
+
const i = m !== void 0 && !!d, { isReadOnly: v, isHidden: x } = G(), S = c || !!v(t), C = o || !!x(t), { isView: y } = Y();
|
|
630
|
+
let R = "", D = () => {
|
|
631
|
+
}, _, g = null, r = () => {
|
|
632
|
+
};
|
|
633
|
+
if (i)
|
|
634
|
+
R = m;
|
|
635
|
+
else
|
|
636
|
+
try {
|
|
637
|
+
const b = U(), E = W({ name: t, control: b.control });
|
|
638
|
+
R = E.field.value, D = E.field.onChange, _ = E.field.ref, g = (A = E.fieldState) == null ? void 0 : A.error, r = b.clearErrors;
|
|
639
|
+
} catch {
|
|
640
|
+
}
|
|
641
|
+
const [n, s] = P(!1), [u, k] = P(/* @__PURE__ */ new Date()), I = X(null);
|
|
642
|
+
T(() => {
|
|
643
|
+
if (n) {
|
|
644
|
+
const b = le(R);
|
|
645
|
+
k(b && ae(b) ? b : /* @__PURE__ */ new Date());
|
|
991
646
|
}
|
|
992
|
-
|
|
993
|
-
|
|
647
|
+
}, [n, R]), T(() => {
|
|
648
|
+
const b = (E) => {
|
|
649
|
+
I.current && !I.current.contains(E.target) && s(!1);
|
|
994
650
|
};
|
|
995
|
-
|
|
996
|
-
}
|
|
997
|
-
const
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
},
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
className:
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
}) => {
|
|
1012
|
-
var y;
|
|
1013
|
-
const [a, N] = I(!1), [h, W] = I(/* @__PURE__ */ new Date()), V = gt(() => N(!1)), O = l !== void 0 && !!o;
|
|
1014
|
-
let S = null;
|
|
1015
|
-
try {
|
|
1016
|
-
S = H();
|
|
1017
|
-
} catch {
|
|
1018
|
-
}
|
|
1019
|
-
const { isView: A } = L(), { isReadOnly: p, isHidden: v } = F(), u = i || !!p(e), m = c || !!v(e), d = !O && S ? X({ name: e, control: S.control }) : null, f = O ? l : d == null ? void 0 : d.field.value, w = O ? b : (y = d == null ? void 0 : d.fieldState.error) == null ? void 0 : y.message, D = B(() => bt(f), [f]), $ = (x) => {
|
|
1020
|
-
if (u) return;
|
|
1021
|
-
const P = wt(x);
|
|
1022
|
-
O ? o == null || o(P) : d == null || d.field.onChange(P), N(!1);
|
|
1023
|
-
}, _ = (x) => {
|
|
1024
|
-
const P = fe({
|
|
1025
|
-
start: ye(ve(x)),
|
|
1026
|
-
end: he(pe(x))
|
|
1027
|
-
});
|
|
1028
|
-
return /* @__PURE__ */ k("div", { className: "dfe-calendar-pane", children: [
|
|
1029
|
-
/* @__PURE__ */ k("div", { className: "dfe-calendar-header", children: [
|
|
1030
|
-
/* @__PURE__ */ r(
|
|
1031
|
-
"button",
|
|
1032
|
-
{
|
|
1033
|
-
type: "button",
|
|
1034
|
-
onClick: (g) => {
|
|
1035
|
-
g.stopPropagation(), W(ge(h, 1));
|
|
1036
|
-
},
|
|
1037
|
-
className: "dfe-nav-btn",
|
|
1038
|
-
children: /* @__PURE__ */ r(pt, { size: 16 })
|
|
1039
|
-
}
|
|
1040
|
-
),
|
|
1041
|
-
/* @__PURE__ */ r("span", { className: "dfe-month-label", children: K(x, "MMMM yyyy", { locale: at }) }),
|
|
1042
|
-
/* @__PURE__ */ r(
|
|
1043
|
-
"button",
|
|
1044
|
-
{
|
|
1045
|
-
type: "button",
|
|
1046
|
-
onClick: (g) => {
|
|
1047
|
-
g.stopPropagation(), W(be(h, 1));
|
|
1048
|
-
},
|
|
1049
|
-
className: "dfe-nav-btn",
|
|
1050
|
-
children: /* @__PURE__ */ r(vt, { size: 16 })
|
|
1051
|
-
}
|
|
1052
|
-
)
|
|
1053
|
-
] }),
|
|
1054
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((g, j) => /* @__PURE__ */ r("span", { children: g }, j)) }),
|
|
1055
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children: P.map((g, j) => {
|
|
1056
|
-
const q = !we(g, x), U = D && Ne(g, D);
|
|
1057
|
-
return /* @__PURE__ */ r(
|
|
651
|
+
return document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b);
|
|
652
|
+
}, []);
|
|
653
|
+
const B = z(() => le(R), [R]), V = (b) => {
|
|
654
|
+
if (S) return;
|
|
655
|
+
const E = We(b);
|
|
656
|
+
i ? d == null || d(E) : (D(E), r == null || r(t)), s(!1);
|
|
657
|
+
}, O = z(() => ve({
|
|
658
|
+
start: ge(Ne(u)),
|
|
659
|
+
end: ye(be(u))
|
|
660
|
+
}), [u]), w = u.getMonth(), N = ke(u);
|
|
661
|
+
return /* @__PURE__ */ h("div", { className: `dfe-datepicker-wrapper form-group ${C ? "hidden" : ""} ${f}`, ref: I, children: [
|
|
662
|
+
/* @__PURE__ */ e("label", { className: "control-label", children: l }),
|
|
663
|
+
y ? /* @__PURE__ */ e("span", { className: "form-control", children: R || "-" }) : (
|
|
664
|
+
/* Container isolador de contexto posicional */
|
|
665
|
+
/* @__PURE__ */ h("div", { className: "dfe-datepicker-inner-container", children: [
|
|
666
|
+
/* @__PURE__ */ h(
|
|
1058
667
|
"div",
|
|
1059
668
|
{
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
${q ? "outside" : ""}
|
|
1064
|
-
${ke(g) ? "today" : ""}`,
|
|
1065
|
-
children: K(g, "d")
|
|
1066
|
-
},
|
|
1067
|
-
j
|
|
1068
|
-
);
|
|
1069
|
-
}) })
|
|
1070
|
-
] });
|
|
1071
|
-
};
|
|
1072
|
-
return m ? null : A ? /* @__PURE__ */ k("div", { className: `form-group ${s}`, children: [
|
|
1073
|
-
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1074
|
-
/* @__PURE__ */ r("span", { className: "form-control readOnly", style: { display: "block", height: "auto" }, children: f || "-" })
|
|
1075
|
-
] }) : /* @__PURE__ */ k(
|
|
1076
|
-
"div",
|
|
1077
|
-
{
|
|
1078
|
-
ref: V,
|
|
1079
|
-
className: `form-group dfe-datepicker-container ${s}`,
|
|
1080
|
-
style: { position: "relative" },
|
|
1081
|
-
children: [
|
|
1082
|
-
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1083
|
-
/* @__PURE__ */ k(
|
|
1084
|
-
"div",
|
|
1085
|
-
{
|
|
1086
|
-
className: `form-control dfe-datepicker-trigger ${w ? "border-red" : ""} ${u ? "disabled" : ""}`,
|
|
1087
|
-
onClick: () => !u && N(!a),
|
|
1088
|
-
style: {
|
|
1089
|
-
display: "flex",
|
|
1090
|
-
alignItems: "center",
|
|
1091
|
-
cursor: u ? "default" : "pointer"
|
|
1092
|
-
},
|
|
669
|
+
className: `dfe-datepicker-control ${g ? "border-red" : ""} ${S ? "readOnly" : ""}`,
|
|
670
|
+
onClick: () => !S && s((b) => !b),
|
|
671
|
+
ref: _,
|
|
1093
672
|
children: [
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
/* @__PURE__ */
|
|
673
|
+
/* @__PURE__ */ e("span", { className: `dfe-datepicker-display ${S ? "readOnly" : ""}`, children: R || a }),
|
|
674
|
+
/* @__PURE__ */ e(Ye, { size: 16, className: "dfe-datepicker-icon" })
|
|
1096
675
|
]
|
|
1097
676
|
}
|
|
1098
677
|
),
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
678
|
+
n && !S && /* @__PURE__ */ h("div", { className: "dfe-datepicker-dropdown", onClick: (b) => b.stopPropagation(), children: [
|
|
679
|
+
/* @__PURE__ */ h("div", { className: "dfe-datepicker-header", children: [
|
|
680
|
+
/* @__PURE__ */ e(
|
|
681
|
+
"button",
|
|
682
|
+
{
|
|
683
|
+
type: "button",
|
|
684
|
+
onClick: () => k(we(u, 1)),
|
|
685
|
+
className: "dfe-datepicker-nav-btn",
|
|
686
|
+
children: /* @__PURE__ */ e(ze, { size: 16 })
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ h("div", { className: "dfe-datepicker-selectors", children: [
|
|
690
|
+
/* @__PURE__ */ e(
|
|
691
|
+
re,
|
|
692
|
+
{
|
|
693
|
+
name: "datepicker_internal_month",
|
|
694
|
+
valueManual: w,
|
|
695
|
+
onChangeManual: (b) => k(_e(u, Number(b))),
|
|
696
|
+
options: Qe,
|
|
697
|
+
placeholder: "Mês"
|
|
698
|
+
}
|
|
699
|
+
),
|
|
700
|
+
/* @__PURE__ */ e(
|
|
701
|
+
re,
|
|
702
|
+
{
|
|
703
|
+
name: "datepicker_internal_year",
|
|
704
|
+
valueManual: N,
|
|
705
|
+
onChangeManual: (b) => k(Oe(u, Number(b))),
|
|
706
|
+
options: Xe,
|
|
707
|
+
enableSearch: !0,
|
|
708
|
+
searchPlaceholder: "Buscar ano...",
|
|
709
|
+
placeholder: "Ano"
|
|
710
|
+
}
|
|
711
|
+
)
|
|
712
|
+
] }),
|
|
713
|
+
/* @__PURE__ */ e(
|
|
714
|
+
"button",
|
|
715
|
+
{
|
|
716
|
+
type: "button",
|
|
717
|
+
onClick: () => k(Se(u, 1)),
|
|
718
|
+
className: "dfe-datepicker-nav-btn",
|
|
719
|
+
children: /* @__PURE__ */ e(Ge, { size: 16 })
|
|
720
|
+
}
|
|
721
|
+
)
|
|
722
|
+
] }),
|
|
723
|
+
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b, E) => /* @__PURE__ */ e("span", { children: b }, E)) }),
|
|
724
|
+
/* @__PURE__ */ e("div", { className: "dfe-datepicker-grid", children: O.map((b, E) => {
|
|
725
|
+
const L = !Re(b, u), H = B && $e(b, B);
|
|
726
|
+
return /* @__PURE__ */ e(
|
|
727
|
+
"div",
|
|
728
|
+
{
|
|
729
|
+
onClick: () => !L && V(b),
|
|
730
|
+
className: `dfe-datepicker-day
|
|
731
|
+
${H ? "selected" : "handleHover"}
|
|
732
|
+
${L ? "outside" : ""}
|
|
733
|
+
${xe(b) ? "today" : ""}`,
|
|
734
|
+
children: ue(b, "d")
|
|
735
|
+
},
|
|
736
|
+
E
|
|
737
|
+
);
|
|
738
|
+
}) })
|
|
739
|
+
] })
|
|
740
|
+
] })
|
|
741
|
+
),
|
|
742
|
+
!i && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: R || "" }),
|
|
743
|
+
(g || p) && /* @__PURE__ */ e("p", { className: "text-danger", children: String((g == null ? void 0 : g.message) ?? p) })
|
|
744
|
+
] });
|
|
745
|
+
}
|
|
746
|
+
const mt = q(Ke);
|
|
747
|
+
function Me({
|
|
748
|
+
mapping: t = {},
|
|
749
|
+
defaultLabel: l = "Não reconhecido",
|
|
750
|
+
className: a = "",
|
|
751
|
+
hidden: f = !1,
|
|
752
|
+
label: c
|
|
1111
753
|
}) {
|
|
1112
|
-
const { activityId:
|
|
1113
|
-
if (!
|
|
1114
|
-
return /* @__PURE__ */
|
|
1115
|
-
|
|
1116
|
-
/* @__PURE__ */
|
|
754
|
+
const { activityId: o } = Y(), m = z(() => !t || o === null || o === void 0 ? null : t[o], [o, t]);
|
|
755
|
+
if (!m)
|
|
756
|
+
return /* @__PURE__ */ h("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
|
|
757
|
+
c && /* @__PURE__ */ e("label", { children: c }),
|
|
758
|
+
/* @__PURE__ */ e("div", { className: `status-badge default ${a}`, children: l })
|
|
1117
759
|
] });
|
|
1118
|
-
const
|
|
1119
|
-
"--customColor":
|
|
760
|
+
const d = {
|
|
761
|
+
"--customColor": m.color
|
|
1120
762
|
};
|
|
1121
|
-
return /* @__PURE__ */
|
|
1122
|
-
|
|
1123
|
-
/* @__PURE__ */
|
|
1124
|
-
|
|
1125
|
-
/* @__PURE__ */
|
|
763
|
+
return /* @__PURE__ */ h("div", { className: `form-group ${f ? "hidden" : ""}`, children: [
|
|
764
|
+
c && /* @__PURE__ */ e("label", { children: c }),
|
|
765
|
+
/* @__PURE__ */ h("div", { className: `status-badge ${a}`, style: d, children: [
|
|
766
|
+
m.icon && /* @__PURE__ */ e("i", { className: m.icon }),
|
|
767
|
+
/* @__PURE__ */ e("span", { children: m.label })
|
|
1126
768
|
] })
|
|
1127
769
|
] });
|
|
1128
770
|
}
|
|
1129
|
-
const
|
|
1130
|
-
function
|
|
1131
|
-
name:
|
|
1132
|
-
control:
|
|
1133
|
-
defaultRowValue:
|
|
1134
|
-
isView:
|
|
1135
|
-
isReadOnly:
|
|
1136
|
-
filters:
|
|
771
|
+
const ht = q(Me);
|
|
772
|
+
function et({
|
|
773
|
+
name: t,
|
|
774
|
+
control: l,
|
|
775
|
+
defaultRowValue: a,
|
|
776
|
+
isView: f,
|
|
777
|
+
isReadOnly: c,
|
|
778
|
+
filters: o = []
|
|
1137
779
|
}) {
|
|
1138
|
-
const { field:
|
|
780
|
+
const { field: m } = W({ name: t, control: l }), [d, p] = P([]), [i, v] = P([]), x = () => Date.now() + Math.random(), S = (n) => {
|
|
1139
781
|
try {
|
|
1140
|
-
const
|
|
1141
|
-
return Array.isArray(
|
|
1142
|
-
...
|
|
1143
|
-
_uid:
|
|
782
|
+
const s = JSON.parse(n);
|
|
783
|
+
return Array.isArray(s) ? s.map((u) => ({
|
|
784
|
+
...u,
|
|
785
|
+
_uid: u._uid || x()
|
|
1144
786
|
})) : [];
|
|
1145
|
-
} catch (
|
|
1146
|
-
return console.error(`Erro ao ler dados da tabela "${
|
|
787
|
+
} catch (s) {
|
|
788
|
+
return console.error(`Erro ao ler dados da tabela "${t}":`, s), [];
|
|
1147
789
|
}
|
|
1148
790
|
};
|
|
1149
|
-
|
|
1150
|
-
if (!(
|
|
1151
|
-
const
|
|
1152
|
-
if (
|
|
1153
|
-
const
|
|
1154
|
-
|
|
791
|
+
T(() => {
|
|
792
|
+
if (!(d.length > 0 && !f) && m.value && typeof m.value == "string") {
|
|
793
|
+
const n = JSON.stringify(d);
|
|
794
|
+
if (m.value === n) return;
|
|
795
|
+
const s = S(m.value);
|
|
796
|
+
p(s);
|
|
1155
797
|
}
|
|
1156
|
-
}, [
|
|
1157
|
-
if (
|
|
1158
|
-
const
|
|
1159
|
-
|
|
1160
|
-
}, [
|
|
1161
|
-
const
|
|
1162
|
-
const
|
|
1163
|
-
|
|
1164
|
-
}, [
|
|
1165
|
-
|
|
1166
|
-
}, [
|
|
1167
|
-
|
|
1168
|
-
}, []),
|
|
1169
|
-
|
|
1170
|
-
}, []),
|
|
1171
|
-
(
|
|
1172
|
-
|
|
798
|
+
}, [m.value, f]), T(() => {
|
|
799
|
+
if (c) return;
|
|
800
|
+
const n = JSON.stringify(d);
|
|
801
|
+
m.value !== n && m.onChange(n);
|
|
802
|
+
}, [d, m, c]);
|
|
803
|
+
const C = j(() => {
|
|
804
|
+
const n = { _uid: x(), ...a };
|
|
805
|
+
p((s) => [...s, n]);
|
|
806
|
+
}, [a]), y = j(() => {
|
|
807
|
+
p((n) => n.filter((s) => !i.includes(s._uid))), v([]);
|
|
808
|
+
}, [i]), R = j((n, s, u) => {
|
|
809
|
+
p((k) => k.map((I) => I._uid === n ? { ...I, [s]: u } : I));
|
|
810
|
+
}, []), D = j((n) => {
|
|
811
|
+
v((s) => s.includes(n) ? s.filter((u) => u !== n) : [...s, n]);
|
|
812
|
+
}, []), _ = j(
|
|
813
|
+
(n) => {
|
|
814
|
+
v(n ? d.map((s) => s._uid) : []);
|
|
1173
815
|
},
|
|
1174
|
-
[
|
|
1175
|
-
),
|
|
1176
|
-
(
|
|
1177
|
-
if ("custom" in
|
|
1178
|
-
return
|
|
1179
|
-
const
|
|
1180
|
-
switch (
|
|
816
|
+
[d]
|
|
817
|
+
), g = d.length > 0 && i.length === d.length, r = z(() => !o || o.length === 0 ? d : d.filter(
|
|
818
|
+
(n) => o.every((s) => {
|
|
819
|
+
if ("custom" in s)
|
|
820
|
+
return s.custom(n);
|
|
821
|
+
const u = n[s.field];
|
|
822
|
+
switch (s.operator) {
|
|
1181
823
|
case "===":
|
|
1182
|
-
return
|
|
824
|
+
return u === s.value;
|
|
1183
825
|
case "!==":
|
|
1184
|
-
return
|
|
826
|
+
return u !== s.value;
|
|
1185
827
|
case ">":
|
|
1186
|
-
return
|
|
828
|
+
return u > s.value;
|
|
1187
829
|
case "<":
|
|
1188
|
-
return
|
|
830
|
+
return u < s.value;
|
|
1189
831
|
case ">=":
|
|
1190
|
-
return
|
|
832
|
+
return u >= s.value;
|
|
1191
833
|
case "<=":
|
|
1192
|
-
return
|
|
834
|
+
return u <= s.value;
|
|
1193
835
|
default:
|
|
1194
836
|
return !0;
|
|
1195
837
|
}
|
|
1196
838
|
})
|
|
1197
|
-
), [
|
|
839
|
+
), [d, o]);
|
|
1198
840
|
return {
|
|
1199
|
-
field:
|
|
1200
|
-
tableRows:
|
|
1201
|
-
visibleRows:
|
|
1202
|
-
selectedRowIds:
|
|
1203
|
-
isAllSelected:
|
|
841
|
+
field: m,
|
|
842
|
+
tableRows: d,
|
|
843
|
+
visibleRows: r,
|
|
844
|
+
selectedRowIds: i,
|
|
845
|
+
isAllSelected: g,
|
|
1204
846
|
handle: {
|
|
1205
|
-
addRow:
|
|
1206
|
-
removeRows:
|
|
1207
|
-
updateCellValue:
|
|
1208
|
-
toggleSelection:
|
|
1209
|
-
toggleSelectAll:
|
|
847
|
+
addRow: C,
|
|
848
|
+
removeRows: y,
|
|
849
|
+
updateCellValue: R,
|
|
850
|
+
toggleSelection: D,
|
|
851
|
+
toggleSelectAll: _
|
|
1210
852
|
}
|
|
1211
853
|
};
|
|
1212
854
|
}
|
|
1213
|
-
const
|
|
1214
|
-
name:
|
|
1215
|
-
title:
|
|
1216
|
-
columns:
|
|
1217
|
-
defaultRowValue:
|
|
1218
|
-
forceReadOnly:
|
|
1219
|
-
layout:
|
|
1220
|
-
actions:
|
|
1221
|
-
filters:
|
|
855
|
+
const pt = ({
|
|
856
|
+
name: t,
|
|
857
|
+
title: l = "Tabela Dinâmica",
|
|
858
|
+
columns: a,
|
|
859
|
+
defaultRowValue: f = {},
|
|
860
|
+
forceReadOnly: c = !1,
|
|
861
|
+
layout: o = "fluid",
|
|
862
|
+
actions: m = !0,
|
|
863
|
+
filters: d = []
|
|
1222
864
|
}) => {
|
|
1223
|
-
const { control:
|
|
1224
|
-
name:
|
|
1225
|
-
control:
|
|
1226
|
-
defaultRowValue:
|
|
1227
|
-
isView:
|
|
1228
|
-
isReadOnly: !!
|
|
1229
|
-
filters:
|
|
1230
|
-
}),
|
|
1231
|
-
return /* @__PURE__ */
|
|
1232
|
-
/* @__PURE__ */
|
|
1233
|
-
/* @__PURE__ */
|
|
1234
|
-
/* @__PURE__ */
|
|
1235
|
-
!
|
|
1236
|
-
/* @__PURE__ */
|
|
865
|
+
const { control: p } = U(), { isView: i, isReadOnly: v } = Y(), { isReadOnly: x } = G(), S = c || i || v || x && x(t), { field: C, visibleRows: y, selectedRowIds: R, isAllSelected: D, handle: _ } = et({
|
|
866
|
+
name: t,
|
|
867
|
+
control: p,
|
|
868
|
+
defaultRowValue: f,
|
|
869
|
+
isView: i,
|
|
870
|
+
isReadOnly: !!S,
|
|
871
|
+
filters: d
|
|
872
|
+
}), g = o === "fixed";
|
|
873
|
+
return /* @__PURE__ */ h("div", { className: `table-wrapper ${g ? "table-fixed" : "table-fluid"}`, children: [
|
|
874
|
+
/* @__PURE__ */ e("input", { type: "hidden", ...C }),
|
|
875
|
+
/* @__PURE__ */ h("div", { className: "header-handle", children: [
|
|
876
|
+
/* @__PURE__ */ e("h3", { children: l }),
|
|
877
|
+
!S && m && /* @__PURE__ */ h("div", { className: "handle-actions", children: [
|
|
878
|
+
/* @__PURE__ */ h(
|
|
1237
879
|
"button",
|
|
1238
880
|
{
|
|
1239
881
|
type: "button",
|
|
1240
|
-
className: `btn ${
|
|
1241
|
-
disabled:
|
|
1242
|
-
onClick:
|
|
882
|
+
className: `btn ${R.length > 0 ? "btn-danger" : "btn-primary"}`,
|
|
883
|
+
disabled: R.length === 0,
|
|
884
|
+
onClick: _.removeRows,
|
|
1243
885
|
children: [
|
|
1244
886
|
"Remover (",
|
|
1245
|
-
|
|
887
|
+
R.length,
|
|
1246
888
|
")"
|
|
1247
889
|
]
|
|
1248
890
|
}
|
|
1249
891
|
),
|
|
1250
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ e("button", { type: "button", className: "btn-add", onClick: _.addRow, children: "Adicionar" })
|
|
1251
893
|
] })
|
|
1252
894
|
] }),
|
|
1253
|
-
/* @__PURE__ */
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
!
|
|
895
|
+
/* @__PURE__ */ e("div", { className: "table-scroll", children: /* @__PURE__ */ h("table", { className: "table-custom", children: [
|
|
896
|
+
/* @__PURE__ */ e("thead", { children: /* @__PURE__ */ h("tr", { children: [
|
|
897
|
+
!S && /* @__PURE__ */ e("th", { style: { width: "50px" }, children: /* @__PURE__ */ e(
|
|
1256
898
|
"input",
|
|
1257
899
|
{
|
|
1258
900
|
type: "checkbox",
|
|
1259
|
-
checked:
|
|
1260
|
-
onChange: (
|
|
901
|
+
checked: D,
|
|
902
|
+
onChange: (r) => _.toggleSelectAll(r.target.checked)
|
|
1261
903
|
}
|
|
1262
904
|
) }),
|
|
1263
|
-
|
|
905
|
+
a.map((r) => /* @__PURE__ */ e(
|
|
1264
906
|
"th",
|
|
1265
907
|
{
|
|
1266
|
-
style:
|
|
1267
|
-
children:
|
|
908
|
+
style: r.width ? { minWidth: g ? r.width : "100%" } : { width: "max-content" },
|
|
909
|
+
children: r.label
|
|
1268
910
|
},
|
|
1269
|
-
String(
|
|
911
|
+
String(r.key)
|
|
1270
912
|
))
|
|
1271
913
|
] }) }),
|
|
1272
|
-
/* @__PURE__ */
|
|
1273
|
-
|
|
1274
|
-
!
|
|
914
|
+
/* @__PURE__ */ h("tbody", { children: [
|
|
915
|
+
y.map((r, n) => /* @__PURE__ */ h("tr", { children: [
|
|
916
|
+
!S && /* @__PURE__ */ e("td", { children: /* @__PURE__ */ e(
|
|
1275
917
|
"input",
|
|
1276
918
|
{
|
|
1277
919
|
type: "checkbox",
|
|
1278
|
-
checked:
|
|
1279
|
-
onChange: () =>
|
|
920
|
+
checked: R.includes(r._uid),
|
|
921
|
+
onChange: () => _.toggleSelection(r._uid)
|
|
1280
922
|
}
|
|
1281
923
|
) }),
|
|
1282
|
-
|
|
1283
|
-
row:
|
|
1284
|
-
index:
|
|
1285
|
-
updateRow: (
|
|
1286
|
-
isLocked: !!
|
|
1287
|
-
isView: !!
|
|
1288
|
-
}) :
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
(
|
|
1292
|
-
!!
|
|
1293
|
-
!!
|
|
1294
|
-
) :
|
|
1295
|
-
] },
|
|
1296
|
-
|
|
924
|
+
a.map((s) => /* @__PURE__ */ e("td", { children: s.render ? s.render.length <= 1 ? s.render({
|
|
925
|
+
row: r,
|
|
926
|
+
index: n,
|
|
927
|
+
updateRow: (u, k) => _.updateCellValue(r._uid, String(u), k),
|
|
928
|
+
isLocked: !!S,
|
|
929
|
+
isView: !!i
|
|
930
|
+
}) : s.render(
|
|
931
|
+
r,
|
|
932
|
+
n,
|
|
933
|
+
(u, k) => _.updateCellValue(r._uid, u, k),
|
|
934
|
+
!!S,
|
|
935
|
+
!!i
|
|
936
|
+
) : r[s.key] }, `${r._uid}-${String(s.key)}`))
|
|
937
|
+
] }, r._uid)),
|
|
938
|
+
y.length === 0 && /* @__PURE__ */ e("tr", { className: "empty-row", children: /* @__PURE__ */ e("td", { colSpan: 100, className: "text-center", children: S ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
1297
939
|
] })
|
|
1298
940
|
] }) })
|
|
1299
941
|
] });
|
|
1300
|
-
},
|
|
1301
|
-
const [
|
|
1302
|
-
let
|
|
942
|
+
}, tt = (t, l) => {
|
|
943
|
+
const [a, f] = P(null);
|
|
944
|
+
let c = null;
|
|
1303
945
|
try {
|
|
1304
|
-
|
|
946
|
+
c = U().watch;
|
|
1305
947
|
} catch {
|
|
1306
948
|
}
|
|
1307
|
-
const
|
|
949
|
+
const o = l !== void 0 ? l : c ? c(t) : void 0, m = j(() => {
|
|
1308
950
|
try {
|
|
1309
|
-
const
|
|
1310
|
-
if (
|
|
1311
|
-
const
|
|
1312
|
-
|
|
951
|
+
const p = window.top.__REACT_ATTACHMENT_BRIDGE__;
|
|
952
|
+
if (p) {
|
|
953
|
+
const i = p.getAttachment(t, o);
|
|
954
|
+
f(i || (o ? { name: o, documentId: 0 } : null));
|
|
1313
955
|
} else
|
|
1314
|
-
|
|
956
|
+
f(o ? { name: o, documentId: 0 } : null);
|
|
1315
957
|
} catch {
|
|
1316
|
-
|
|
958
|
+
f(o ? { name: o, documentId: 0 } : null);
|
|
1317
959
|
}
|
|
1318
|
-
}, [
|
|
1319
|
-
return
|
|
1320
|
-
|
|
1321
|
-
const
|
|
1322
|
-
return () => clearInterval(
|
|
1323
|
-
}, [
|
|
1324
|
-
},
|
|
1325
|
-
name:
|
|
1326
|
-
label:
|
|
1327
|
-
help:
|
|
1328
|
-
valueManual:
|
|
1329
|
-
onChangeManual:
|
|
1330
|
-
forceReadOnly:
|
|
1331
|
-
forceHidden:
|
|
960
|
+
}, [t, o, l]);
|
|
961
|
+
return T(() => {
|
|
962
|
+
m();
|
|
963
|
+
const d = setInterval(m, 2e3);
|
|
964
|
+
return () => clearInterval(d);
|
|
965
|
+
}, [m]), { attachment: a, sync: m };
|
|
966
|
+
}, st = ({
|
|
967
|
+
name: t,
|
|
968
|
+
label: l,
|
|
969
|
+
help: a,
|
|
970
|
+
valueManual: f,
|
|
971
|
+
onChangeManual: c,
|
|
972
|
+
forceReadOnly: o = !1,
|
|
973
|
+
forceHidden: m = !1,
|
|
974
|
+
helpText: d,
|
|
975
|
+
helpTitle: p,
|
|
976
|
+
helpWidth: i
|
|
1332
977
|
}) => {
|
|
1333
|
-
const
|
|
1334
|
-
let
|
|
978
|
+
const v = !!c, { isReadOnly: x, isHidden: S } = G(), { isView: C } = Y(), y = o || C || !!x(t), R = m || !!S(t), [D, _] = P(!1);
|
|
979
|
+
let g = null;
|
|
1335
980
|
try {
|
|
1336
|
-
|
|
981
|
+
g = U().control;
|
|
1337
982
|
} catch {
|
|
1338
983
|
}
|
|
1339
|
-
const
|
|
1340
|
-
value:
|
|
1341
|
-
onChange: (
|
|
1342
|
-
}, { attachment:
|
|
1343
|
-
var
|
|
984
|
+
const r = g && !v ? W({ name: t, control: g }).field : {
|
|
985
|
+
value: f,
|
|
986
|
+
onChange: (w) => c == null ? void 0 : c(w)
|
|
987
|
+
}, { attachment: n, sync: s } = tt(t, f), u = () => {
|
|
988
|
+
var w;
|
|
1344
989
|
try {
|
|
1345
|
-
const
|
|
990
|
+
const N = window.top;
|
|
1346
991
|
return {
|
|
1347
|
-
bridge:
|
|
1348
|
-
toast: (
|
|
992
|
+
bridge: N.__REACT_ATTACHMENT_BRIDGE__,
|
|
993
|
+
toast: (w = N.FLUIGC) == null ? void 0 : w.toast
|
|
1349
994
|
};
|
|
1350
995
|
} catch {
|
|
1351
996
|
return { bridge: null, toast: null };
|
|
1352
997
|
}
|
|
1353
|
-
},
|
|
1354
|
-
if (
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1357
|
-
const
|
|
1358
|
-
if (!
|
|
1359
|
-
const { bridge:
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
}, 1e3),
|
|
998
|
+
}, k = j(() => {
|
|
999
|
+
if (y) return;
|
|
1000
|
+
const w = document.createElement("input");
|
|
1001
|
+
w.type = "file", w.onchange = (N) => {
|
|
1002
|
+
const A = N.target.files[0];
|
|
1003
|
+
if (!A) return;
|
|
1004
|
+
const { bridge: b, toast: E } = u();
|
|
1005
|
+
_(!0), b ? b.upload(A, t, (L) => {
|
|
1006
|
+
v ? c == null || c(L.name) : r.onChange(L.name), setTimeout(() => {
|
|
1007
|
+
_(!1), s();
|
|
1008
|
+
}, 1e3), E && E({
|
|
1364
1009
|
title: "Sucesso",
|
|
1365
1010
|
message: "Arquivo enviado",
|
|
1366
1011
|
type: "success"
|
|
1367
1012
|
});
|
|
1368
|
-
}) : (
|
|
1369
|
-
},
|
|
1370
|
-
}, [
|
|
1371
|
-
if (
|
|
1372
|
-
const
|
|
1373
|
-
if (!
|
|
1374
|
-
const { bridge:
|
|
1375
|
-
|
|
1013
|
+
}) : (v ? c == null || c(A.name) : r.onChange(A.name), _(!1));
|
|
1014
|
+
}, w.click();
|
|
1015
|
+
}, [t, r, s, c, y, v]), I = (w) => {
|
|
1016
|
+
if (w.stopPropagation(), y) return;
|
|
1017
|
+
const N = (n == null ? void 0 : n.name) || f || r.value;
|
|
1018
|
+
if (!N) return;
|
|
1019
|
+
const { bridge: A, toast: b } = u();
|
|
1020
|
+
A ? A.removeByFileName(N) ? (v ? c == null || c("") : r.onChange(""), s()) : b && b({
|
|
1376
1021
|
title: "Erro",
|
|
1377
1022
|
message: "Erro ao remover anexo",
|
|
1378
1023
|
type: "danger"
|
|
1379
|
-
}) : (
|
|
1380
|
-
},
|
|
1024
|
+
}) : (v ? c == null || c("") : r.onChange(""), s());
|
|
1025
|
+
}, B = !!n && !D, V = (n == null ? void 0 : n.name) || f || r.value, O = [
|
|
1381
1026
|
"fluig-attachment__box",
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1027
|
+
B ? "fluig-attachment__box--has-file" : "",
|
|
1028
|
+
D ? "fluig-attachment__box--uploading" : "",
|
|
1029
|
+
y && !B ? "readOnly" : "",
|
|
1030
|
+
y && B ? "fluig-attachment__box--readonly-view" : ""
|
|
1386
1031
|
].join(" ");
|
|
1387
|
-
return
|
|
1388
|
-
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
|
|
1391
|
-
{
|
|
1392
|
-
className: D,
|
|
1393
|
-
onClick: () => {
|
|
1394
|
-
if (f) {
|
|
1395
|
-
const $ = u(), _ = (p == null ? void 0 : p.physicalFileName) || (p == null ? void 0 : p.description) || (p == null ? void 0 : p.name) || w;
|
|
1396
|
-
$.bridge && _ && $.bridge.view(_);
|
|
1397
|
-
} else
|
|
1398
|
-
m();
|
|
1399
|
-
},
|
|
1400
|
-
children: [
|
|
1401
|
-
/* @__PURE__ */ k("span", { className: "fluig-attachment__content", children: [
|
|
1402
|
-
/* @__PURE__ */ r(
|
|
1403
|
-
"i",
|
|
1404
|
-
{
|
|
1405
|
-
className: `flaticon icon-sm ${V ? "flaticon-loading" : f ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
|
|
1406
|
-
}
|
|
1407
|
-
),
|
|
1408
|
-
/* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: V ? " Enviando..." : f ? w : h ? "Nenhum arquivo" : n || "Anexar" })
|
|
1409
|
-
] }),
|
|
1410
|
-
f && !h && /* @__PURE__ */ r(
|
|
1411
|
-
"button",
|
|
1412
|
-
{
|
|
1413
|
-
type: "button",
|
|
1414
|
-
className: "fluig-attachment__btn-remove btn btn-link text-danger",
|
|
1415
|
-
onClick: d,
|
|
1416
|
-
children: /* @__PURE__ */ r("i", { className: "flaticon flaticon-trash icon-sm" })
|
|
1417
|
-
}
|
|
1418
|
-
)
|
|
1419
|
-
]
|
|
1420
|
-
}
|
|
1421
|
-
),
|
|
1422
|
-
!o && S && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: A.value || "" })
|
|
1423
|
-
] });
|
|
1424
|
-
}, It = z(St);
|
|
1425
|
-
function Ft({
|
|
1426
|
-
title: e,
|
|
1427
|
-
isOpen: t,
|
|
1428
|
-
onOpen: n,
|
|
1429
|
-
onClose: s,
|
|
1430
|
-
content: i,
|
|
1431
|
-
footer: c,
|
|
1432
|
-
width: l
|
|
1433
|
-
}) {
|
|
1434
|
-
const o = C(
|
|
1435
|
-
(b) => {
|
|
1436
|
-
b.key === "Escape" && s();
|
|
1437
|
-
},
|
|
1438
|
-
[s]
|
|
1439
|
-
);
|
|
1440
|
-
return E(() => (t && (document.addEventListener("keydown", o), n == null || n(), document.body.style.overflow = "hidden"), () => {
|
|
1441
|
-
document.removeEventListener("keydown", o), document.body.style.overflow = "auto";
|
|
1442
|
-
}), [t, o, n]), t ? /* @__PURE__ */ r(
|
|
1443
|
-
"div",
|
|
1444
|
-
{
|
|
1445
|
-
className: "modal-overlay",
|
|
1446
|
-
onClick: s,
|
|
1447
|
-
"aria-modal": "true",
|
|
1448
|
-
role: "dialog",
|
|
1449
|
-
children: /* @__PURE__ */ k(
|
|
1032
|
+
return R ? null : /* @__PURE__ */ h("div", { className: "form-group fluig-attachment", children: [
|
|
1033
|
+
l && /* @__PURE__ */ e("label", { className: "fluig-attachment__label", children: l }),
|
|
1034
|
+
/* @__PURE__ */ h("div", { className: d ? "dfe-flex-input-wrapper" : "", children: [
|
|
1035
|
+
/* @__PURE__ */ h(
|
|
1450
1036
|
"div",
|
|
1451
1037
|
{
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
onClick: (
|
|
1038
|
+
className: O,
|
|
1039
|
+
style: d ? { flex: 1 } : void 0,
|
|
1040
|
+
onClick: () => {
|
|
1041
|
+
if (B) {
|
|
1042
|
+
const w = u(), N = (n == null ? void 0 : n.physicalFileName) || (n == null ? void 0 : n.description) || (n == null ? void 0 : n.name) || V;
|
|
1043
|
+
w.bridge && N && w.bridge.view(N);
|
|
1044
|
+
} else
|
|
1045
|
+
k();
|
|
1046
|
+
},
|
|
1455
1047
|
children: [
|
|
1456
|
-
/* @__PURE__ */
|
|
1457
|
-
/* @__PURE__ */
|
|
1458
|
-
|
|
1459
|
-
"div",
|
|
1048
|
+
/* @__PURE__ */ h("span", { className: "fluig-attachment__content", children: [
|
|
1049
|
+
/* @__PURE__ */ e(
|
|
1050
|
+
"i",
|
|
1460
1051
|
{
|
|
1461
|
-
className: "
|
|
1462
|
-
onClick: s,
|
|
1463
|
-
role: "button",
|
|
1464
|
-
"aria-label": "Fechar modal",
|
|
1465
|
-
children: /* @__PURE__ */ r(
|
|
1466
|
-
"i",
|
|
1467
|
-
{
|
|
1468
|
-
className: "flaticon flaticon-close icon-md",
|
|
1469
|
-
"aria-hidden": "true"
|
|
1470
|
-
}
|
|
1471
|
-
)
|
|
1052
|
+
className: `flaticon icon-sm ${D ? "flaticon-loading" : B ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
|
|
1472
1053
|
}
|
|
1473
|
-
)
|
|
1054
|
+
),
|
|
1055
|
+
/* @__PURE__ */ e("span", { className: "fluig-attachment__filename", children: D ? " Enviando..." : B ? V : y ? "Nenhum arquivo" : a || "Anexar" })
|
|
1474
1056
|
] }),
|
|
1475
|
-
/* @__PURE__ */
|
|
1476
|
-
|
|
1057
|
+
B && !y && /* @__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
|
+
)
|
|
1477
1066
|
]
|
|
1478
1067
|
}
|
|
1479
|
-
)
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
}
|
|
1068
|
+
),
|
|
1069
|
+
d && /* @__PURE__ */ e(Z, { text: d, title: p, width: i })
|
|
1070
|
+
] }),
|
|
1071
|
+
!v && g && /* @__PURE__ */ e("input", { type: "hidden", name: t, value: r.value || "" })
|
|
1072
|
+
] });
|
|
1073
|
+
}, vt = q(st);
|
|
1483
1074
|
export {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1075
|
+
vt as Attachment,
|
|
1076
|
+
at as Checkbox,
|
|
1077
|
+
mt as DatePicker,
|
|
1078
|
+
Z as Help,
|
|
1079
|
+
ot 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
|
|
1494
1086
|
};
|