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