@tech-diefra/fluig-ui 1.2.8 → 1.2.10
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/127996989.jpg +0 -0
- package/dist/Attachment/index.d.ts +11 -0
- package/dist/Carousel/index.d.ts +13 -0
- package/dist/Modal/index.d.ts +12 -0
- package/dist/SideBar/index.d.ts +6 -1
- package/dist/SimpleTable/index.d.ts +8 -1
- package/dist/diefra-logo-green.png +0 -0
- package/dist/diefra-logo-white.png +0 -0
- package/dist/diefra-logo.png +0 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +774 -494
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,406 +1,406 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as F, useMemo as
|
|
3
|
-
import { useFormContext as
|
|
1
|
+
import { jsxs as m, jsx as t, Fragment as J } from "react/jsx-runtime";
|
|
2
|
+
import { memo as F, useMemo as I, useCallback as S, useState as _, useRef as z, useEffect as W, forwardRef as K } from "react";
|
|
3
|
+
import { useFormContext as A, useController as T, useFormState as ee } from "react-hook-form";
|
|
4
4
|
import { IMaskInput as te } from "react-imask";
|
|
5
|
-
import { useSection as
|
|
5
|
+
import { useSection as D, useFluigRuntime as j } from "@fluig-kit/ecm";
|
|
6
6
|
import ne, { registerLocale as ae } from "react-datepicker";
|
|
7
|
-
import { parse as re, isValid as
|
|
8
|
-
const
|
|
7
|
+
import { parse as re, isValid as se, format as ie } from "date-fns";
|
|
8
|
+
const oe = {
|
|
9
9
|
cpf: "000.000.000-00",
|
|
10
10
|
cnpj: "00.000.000/0000-00",
|
|
11
11
|
telefone: "(00) 00000-0000",
|
|
12
12
|
cep: "00000-000"
|
|
13
13
|
};
|
|
14
|
-
function
|
|
14
|
+
function le({
|
|
15
15
|
name: e,
|
|
16
16
|
label: r = "",
|
|
17
|
-
placeholder:
|
|
18
|
-
type:
|
|
19
|
-
mask:
|
|
20
|
-
className:
|
|
17
|
+
placeholder: n = "",
|
|
18
|
+
type: c = "text",
|
|
19
|
+
mask: o,
|
|
20
|
+
className: l = "",
|
|
21
21
|
forceReadOnly: s = !1,
|
|
22
|
-
forceHidden:
|
|
22
|
+
forceHidden: a = !1
|
|
23
23
|
}) {
|
|
24
|
-
const { isReadOnly:
|
|
25
|
-
() =>
|
|
26
|
-
[
|
|
27
|
-
),
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
return (Number(
|
|
24
|
+
const { isReadOnly: h, isHidden: f } = D(), u = s || !!h(e), v = a || !!f(e), { control: k } = A(), { isView: R } = j(), { field: y } = T({ name: e, control: k }), { errors: p } = ee({ name: e }), g = p == null ? void 0 : p[e], x = I(
|
|
25
|
+
() => o ? oe[o] ?? o : null,
|
|
26
|
+
[o]
|
|
27
|
+
), P = S((i) => {
|
|
28
|
+
if (!i) return "";
|
|
29
|
+
const d = i.replace(/\D/g, "");
|
|
30
|
+
return (Number(d) / 100).toLocaleString("pt-BR", {
|
|
31
31
|
style: "currency",
|
|
32
32
|
currency: "BRL"
|
|
33
33
|
});
|
|
34
|
-
}, []),
|
|
35
|
-
(
|
|
36
|
-
[
|
|
34
|
+
}, []), w = S(
|
|
35
|
+
(i) => c === "monetary" ? P(i) : i,
|
|
36
|
+
[c, P]
|
|
37
37
|
);
|
|
38
|
-
return
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
] }) : /* @__PURE__ */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
x ? /* @__PURE__ */
|
|
38
|
+
return R ? /* @__PURE__ */ m("div", { className: "form-group", children: [
|
|
39
|
+
/* @__PURE__ */ t("label", { children: r }),
|
|
40
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: y.value || "-" })
|
|
41
|
+
] }) : /* @__PURE__ */ m("div", { className: `form-group ${v ? "hidden" : ""}`, children: [
|
|
42
|
+
/* @__PURE__ */ t("label", { children: r }),
|
|
43
|
+
x ? /* @__PURE__ */ t(
|
|
44
44
|
te,
|
|
45
45
|
{
|
|
46
46
|
name: e,
|
|
47
47
|
mask: x,
|
|
48
|
-
value: String(
|
|
48
|
+
value: String(y.value ?? ""),
|
|
49
49
|
unmask: !1,
|
|
50
|
-
onAccept: (
|
|
51
|
-
placeholder:
|
|
52
|
-
readOnly:
|
|
53
|
-
className: `form-control ${
|
|
54
|
-
inputRef:
|
|
55
|
-
onBlur:
|
|
50
|
+
onAccept: (i) => y.onChange(w(i)),
|
|
51
|
+
placeholder: n,
|
|
52
|
+
readOnly: u,
|
|
53
|
+
className: `form-control ${g ? "border-red" : ""} ${l}`,
|
|
54
|
+
inputRef: y.ref,
|
|
55
|
+
onBlur: y.onBlur
|
|
56
56
|
}
|
|
57
|
-
) : /* @__PURE__ */
|
|
57
|
+
) : /* @__PURE__ */ t(
|
|
58
58
|
"input",
|
|
59
59
|
{
|
|
60
|
-
...
|
|
60
|
+
...y,
|
|
61
61
|
type: "text",
|
|
62
|
-
value:
|
|
63
|
-
onChange: (
|
|
64
|
-
placeholder:
|
|
65
|
-
readOnly:
|
|
66
|
-
className: `form-control ${
|
|
62
|
+
value: y.value ?? "",
|
|
63
|
+
onChange: (i) => y.onChange(w(i.target.value)),
|
|
64
|
+
placeholder: n,
|
|
65
|
+
readOnly: u,
|
|
66
|
+
className: `form-control ${g ? "border-red" : ""} ${l}`
|
|
67
67
|
}
|
|
68
68
|
),
|
|
69
|
-
|
|
69
|
+
g && /* @__PURE__ */ t("p", { className: "text-danger", children: String(g.message) })
|
|
70
70
|
] });
|
|
71
71
|
}
|
|
72
|
-
const
|
|
73
|
-
function
|
|
72
|
+
const st = F(le);
|
|
73
|
+
function ce({
|
|
74
74
|
name: e,
|
|
75
75
|
label: r = "",
|
|
76
|
-
options:
|
|
77
|
-
placeholder:
|
|
78
|
-
labelKey:
|
|
79
|
-
valueKey:
|
|
76
|
+
options: n = [],
|
|
77
|
+
placeholder: c = "",
|
|
78
|
+
labelKey: o = "label",
|
|
79
|
+
valueKey: l = "value",
|
|
80
80
|
enableSearch: s = !1,
|
|
81
|
-
searchPlaceholder:
|
|
82
|
-
loading:
|
|
83
|
-
onSearchChange:
|
|
84
|
-
debounceTime:
|
|
85
|
-
onSelect:
|
|
86
|
-
forceReadOnly:
|
|
87
|
-
forceHidden:
|
|
81
|
+
searchPlaceholder: a = "Buscar...",
|
|
82
|
+
loading: h = !1,
|
|
83
|
+
onSearchChange: f,
|
|
84
|
+
debounceTime: u = 300,
|
|
85
|
+
onSelect: v,
|
|
86
|
+
forceReadOnly: k = !1,
|
|
87
|
+
forceHidden: R = !1
|
|
88
88
|
}) {
|
|
89
|
-
const { isReadOnly:
|
|
90
|
-
field: { onChange:
|
|
91
|
-
fieldState: { error:
|
|
92
|
-
} =
|
|
89
|
+
const { isReadOnly: y, isHidden: p } = D(), g = k || !!y(e), x = R || !!p(e), { control: P, clearErrors: w } = A(), { isView: i } = j(), {
|
|
90
|
+
field: { onChange: d, value: b, ref: V },
|
|
91
|
+
fieldState: { error: N }
|
|
92
|
+
} = T({
|
|
93
93
|
name: e,
|
|
94
|
-
control:
|
|
95
|
-
}), [
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}, [
|
|
99
|
-
const
|
|
100
|
-
|
|
94
|
+
control: P
|
|
95
|
+
}), [$, M] = _(!1), [O, Q] = _(""), B = z(null), E = z(f);
|
|
96
|
+
W(() => {
|
|
97
|
+
E.current = f;
|
|
98
|
+
}, [f]), W(() => {
|
|
99
|
+
const C = (H) => {
|
|
100
|
+
B.current && !B.current.contains(H.target) && M(!1);
|
|
101
101
|
};
|
|
102
|
-
return document.addEventListener("mousedown",
|
|
103
|
-
}, []),
|
|
104
|
-
|
|
105
|
-
}, [
|
|
102
|
+
return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
|
|
103
|
+
}, []), W(() => {
|
|
104
|
+
$ || Q("");
|
|
105
|
+
}, [$]), W(() => {
|
|
106
106
|
if (!s) return;
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
return () => clearTimeout(
|
|
111
|
-
}, [
|
|
112
|
-
const
|
|
113
|
-
(
|
|
114
|
-
) :
|
|
115
|
-
if (
|
|
116
|
-
if (typeof
|
|
117
|
-
return String(
|
|
118
|
-
const
|
|
119
|
-
(
|
|
107
|
+
const C = setTimeout(() => {
|
|
108
|
+
E.current && E.current(O);
|
|
109
|
+
}, u);
|
|
110
|
+
return () => clearTimeout(C);
|
|
111
|
+
}, [O, s, u]);
|
|
112
|
+
const U = I(() => s && !f && O.trim() ? n.filter(
|
|
113
|
+
(C) => String((C == null ? void 0 : C[o]) ?? "").toLowerCase().includes(O.toLowerCase())
|
|
114
|
+
) : n ?? [], [n, s, f, O, o]), G = I(() => {
|
|
115
|
+
if (b == null) return "";
|
|
116
|
+
if (typeof b == "object")
|
|
117
|
+
return String(b[l] ?? "");
|
|
118
|
+
const C = (n || []).find(
|
|
119
|
+
(H) => String(H == null ? void 0 : H[l]) === String(b)
|
|
120
120
|
);
|
|
121
|
-
return String(
|
|
122
|
-
}, [
|
|
123
|
-
|
|
121
|
+
return String(C ? (C == null ? void 0 : C[o]) ?? "" : b);
|
|
122
|
+
}, [b, n, l, o]), Z = (C) => {
|
|
123
|
+
g || (d(C[l]), v && v(C), w(e), M(!1));
|
|
124
124
|
};
|
|
125
|
-
return /* @__PURE__ */
|
|
125
|
+
return /* @__PURE__ */ m(
|
|
126
126
|
"div",
|
|
127
127
|
{
|
|
128
128
|
className: `select-wrapper form-group ${x ? "hidden" : ""}`,
|
|
129
|
-
ref:
|
|
129
|
+
ref: B,
|
|
130
130
|
children: [
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
/* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ t("label", { className: "control-label", children: r }),
|
|
132
|
+
i ? /* @__PURE__ */ t("span", { className: "form-control", children: G || "-" }) : /* @__PURE__ */ m(J, { children: [
|
|
133
|
+
/* @__PURE__ */ m(
|
|
134
134
|
"div",
|
|
135
135
|
{
|
|
136
|
-
className: `select-control ${
|
|
137
|
-
onClick: () => !
|
|
138
|
-
ref:
|
|
136
|
+
className: `select-control ${N ? "border-red" : ""} ${g ? "readOnly" : ""}`,
|
|
137
|
+
onClick: () => !g && M((C) => !C),
|
|
138
|
+
ref: V,
|
|
139
139
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
141
|
-
/* @__PURE__ */
|
|
140
|
+
/* @__PURE__ */ t("span", { className: `select-display ${g ? "readOnly" : ""}`, children: G || c }),
|
|
141
|
+
/* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
142
142
|
]
|
|
143
143
|
}
|
|
144
144
|
),
|
|
145
|
-
|
|
146
|
-
s && /* @__PURE__ */
|
|
145
|
+
$ && !g && /* @__PURE__ */ m("div", { className: "select-dropdown", children: [
|
|
146
|
+
s && /* @__PURE__ */ t("div", { className: "select-search", children: /* @__PURE__ */ t(
|
|
147
147
|
"input",
|
|
148
148
|
{
|
|
149
149
|
type: "text",
|
|
150
150
|
className: "select-search-input",
|
|
151
|
-
value:
|
|
152
|
-
onChange: (
|
|
153
|
-
placeholder:
|
|
151
|
+
value: O,
|
|
152
|
+
onChange: (C) => Q(C.target.value),
|
|
153
|
+
placeholder: h ? "Carregando..." : a,
|
|
154
154
|
autoFocus: !0,
|
|
155
|
-
onClick: (
|
|
155
|
+
onClick: (C) => C.stopPropagation()
|
|
156
156
|
}
|
|
157
157
|
) }),
|
|
158
|
-
/* @__PURE__ */
|
|
158
|
+
/* @__PURE__ */ t("ul", { className: "select-options", children: h ? /* @__PURE__ */ t("li", { className: "select-option readOnly", children: "Carregando..." }) : U.length > 0 ? U.map((C) => /* @__PURE__ */ t(
|
|
159
159
|
"li",
|
|
160
160
|
{
|
|
161
|
-
onClick: () =>
|
|
161
|
+
onClick: () => Z(C),
|
|
162
162
|
className: "select-option handleHover",
|
|
163
|
-
children:
|
|
163
|
+
children: C[o]
|
|
164
164
|
},
|
|
165
|
-
|
|
166
|
-
)) : /* @__PURE__ */
|
|
165
|
+
C[l]
|
|
166
|
+
)) : /* @__PURE__ */ t("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
167
167
|
] })
|
|
168
168
|
] }),
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
|
|
169
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: e, value: b || "" }),
|
|
170
|
+
N && /* @__PURE__ */ t("p", { className: "text-danger", children: String(N.message) })
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
);
|
|
174
174
|
}
|
|
175
|
-
const
|
|
176
|
-
function
|
|
175
|
+
const it = F(ce);
|
|
176
|
+
function ot({
|
|
177
177
|
name: e,
|
|
178
178
|
options: r = [],
|
|
179
|
-
label:
|
|
180
|
-
valueKey:
|
|
181
|
-
labelKey:
|
|
182
|
-
forceReadOnly:
|
|
179
|
+
label: n = "",
|
|
180
|
+
valueKey: c = "value",
|
|
181
|
+
labelKey: o = "label",
|
|
182
|
+
forceReadOnly: l = !1,
|
|
183
183
|
forceHidden: s = !1
|
|
184
184
|
}) {
|
|
185
|
-
var
|
|
186
|
-
const
|
|
187
|
-
if (!
|
|
185
|
+
var b, V;
|
|
186
|
+
const a = A(), { isView: h, isReadOnly: f } = j(), { isReadOnly: u, isHidden: v } = D(), k = u ? u(e) : !1, R = v ? v(e) : !1, y = l || k, p = s || R, g = y || f || h;
|
|
187
|
+
if (!a || !e)
|
|
188
188
|
return console.error("Checkbox requer contexto de formulário e nome."), null;
|
|
189
|
-
const x = () => !r || !
|
|
190
|
-
const M =
|
|
191
|
-
return
|
|
192
|
-
}, {}),
|
|
193
|
-
|
|
194
|
-
const
|
|
195
|
-
(!
|
|
189
|
+
const x = () => !r || !a ? {} : r.reduce((N, $) => {
|
|
190
|
+
const M = $[c], O = a.getValues(M);
|
|
191
|
+
return N[M] = O === "on", N;
|
|
192
|
+
}, {}), P = a.watch(e), w = I(() => P && typeof P == "object" ? P : x(), [P, r, c]);
|
|
193
|
+
W(() => {
|
|
194
|
+
const N = a.getValues(e);
|
|
195
|
+
(!N || typeof N != "object") && a.setValue(e, w, {
|
|
196
196
|
shouldDirty: !1,
|
|
197
197
|
shouldValidate: !1
|
|
198
198
|
});
|
|
199
|
-
}, [
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
const M = { ...
|
|
203
|
-
|
|
199
|
+
}, [w, e, a]);
|
|
200
|
+
const i = (N, $) => {
|
|
201
|
+
if (g) return;
|
|
202
|
+
const M = { ...w, [N]: $ };
|
|
203
|
+
a.setValue(e, M, {
|
|
204
204
|
shouldDirty: !0,
|
|
205
205
|
shouldValidate: !0
|
|
206
|
-
}),
|
|
207
|
-
},
|
|
208
|
-
return /* @__PURE__ */
|
|
209
|
-
|
|
210
|
-
/* @__PURE__ */
|
|
206
|
+
}), a.setValue(N, $ ? "on" : "", { shouldValidate: !1 });
|
|
207
|
+
}, d = (V = (b = a.formState) == null ? void 0 : b.errors) == null ? void 0 : V[e];
|
|
208
|
+
return /* @__PURE__ */ m("div", { className: `form-group ${p ? "hidden" : ""}`, children: [
|
|
209
|
+
n && /* @__PURE__ */ t("label", { children: n }),
|
|
210
|
+
/* @__PURE__ */ t(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
|
-
className: `checkbox-group-custom ${
|
|
214
|
-
children: r.map((
|
|
215
|
-
const
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
/* @__PURE__ */
|
|
218
|
-
/* @__PURE__ */
|
|
213
|
+
className: `checkbox-group-custom ${g ? "readOnly" : ""}`,
|
|
214
|
+
children: r.map((N) => {
|
|
215
|
+
const $ = String(N[c]), M = w[$] === !0;
|
|
216
|
+
return /* @__PURE__ */ m("div", { children: [
|
|
217
|
+
/* @__PURE__ */ t("input", { type: "hidden", ...a.register($) }),
|
|
218
|
+
/* @__PURE__ */ m(
|
|
219
219
|
"label",
|
|
220
220
|
{
|
|
221
|
-
className: `custom-checkbox ${M ? "checked" : ""} ${
|
|
221
|
+
className: `custom-checkbox ${M ? "checked" : ""} ${g ? "readOnly" : ""}`,
|
|
222
222
|
children: [
|
|
223
|
-
/* @__PURE__ */
|
|
223
|
+
/* @__PURE__ */ t(
|
|
224
224
|
"input",
|
|
225
225
|
{
|
|
226
226
|
type: "checkbox",
|
|
227
227
|
checked: M,
|
|
228
|
-
disabled:
|
|
229
|
-
onChange: (
|
|
228
|
+
disabled: g,
|
|
229
|
+
onChange: (O) => i($, O.target.checked)
|
|
230
230
|
}
|
|
231
231
|
),
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
232
|
+
/* @__PURE__ */ t("span", { className: "checkmark" }),
|
|
233
|
+
/* @__PURE__ */ t("span", { children: N[o] })
|
|
234
234
|
]
|
|
235
235
|
}
|
|
236
236
|
)
|
|
237
|
-
] },
|
|
237
|
+
] }, $);
|
|
238
238
|
})
|
|
239
239
|
}
|
|
240
240
|
),
|
|
241
|
-
|
|
241
|
+
d && /* @__PURE__ */ t("p", { className: "text-danger", children: String(d.message) })
|
|
242
242
|
] });
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function de({
|
|
245
245
|
name: e,
|
|
246
246
|
label: r = "",
|
|
247
|
-
options:
|
|
248
|
-
valueKey:
|
|
249
|
-
labelKey:
|
|
250
|
-
iconKey:
|
|
247
|
+
options: n = [],
|
|
248
|
+
valueKey: c = "value",
|
|
249
|
+
labelKey: o = "label",
|
|
250
|
+
iconKey: l = "icon",
|
|
251
251
|
forceReadOnly: s = !1,
|
|
252
|
-
forceHidden:
|
|
252
|
+
forceHidden: a = !1
|
|
253
253
|
}) {
|
|
254
|
-
const { isReadOnly:
|
|
255
|
-
field:
|
|
256
|
-
fieldState: { error:
|
|
257
|
-
} =
|
|
254
|
+
const { isReadOnly: h, isHidden: f } = D(), u = s || !!h(e), v = a || !!f(e), { control: k } = A(), { isView: R, isReadOnly: y } = j(), {
|
|
255
|
+
field: p,
|
|
256
|
+
fieldState: { error: g }
|
|
257
|
+
} = T({
|
|
258
258
|
name: e,
|
|
259
|
-
control:
|
|
260
|
-
}), x =
|
|
261
|
-
(
|
|
262
|
-
x ||
|
|
259
|
+
control: k
|
|
260
|
+
}), x = u || y || R, P = p.value ?? "", w = S(
|
|
261
|
+
(i) => {
|
|
262
|
+
x || p.onChange(i);
|
|
263
263
|
},
|
|
264
|
-
[x,
|
|
264
|
+
[x, p]
|
|
265
265
|
);
|
|
266
|
-
return /* @__PURE__ */
|
|
267
|
-
r && /* @__PURE__ */
|
|
268
|
-
/* @__PURE__ */
|
|
266
|
+
return /* @__PURE__ */ m("div", { className: `form-group column ${v ? "hidden" : ""}`, children: [
|
|
267
|
+
r && /* @__PURE__ */ t("label", { className: "control-label", children: r }),
|
|
268
|
+
/* @__PURE__ */ t(
|
|
269
269
|
"div",
|
|
270
270
|
{
|
|
271
271
|
className: `btn-group ${x ? "view-mode" : ""}`,
|
|
272
272
|
"data-field-name": e,
|
|
273
|
-
children:
|
|
274
|
-
const
|
|
275
|
-
return /* @__PURE__ */
|
|
273
|
+
children: n.map((i) => {
|
|
274
|
+
const d = i[c], b = P === d, V = i.color ? { "--customColor": i.color } : void 0;
|
|
275
|
+
return /* @__PURE__ */ m(
|
|
276
276
|
"label",
|
|
277
277
|
{
|
|
278
|
-
htmlFor: `${e}_${
|
|
279
|
-
style:
|
|
280
|
-
className: `btn fs-ellipsis ${
|
|
278
|
+
htmlFor: `${e}_${d}`,
|
|
279
|
+
style: V,
|
|
280
|
+
className: `btn fs-ellipsis ${b ? "active" : ""}`,
|
|
281
281
|
children: [
|
|
282
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ t(
|
|
283
283
|
"input",
|
|
284
284
|
{
|
|
285
285
|
type: "radio",
|
|
286
|
-
id: `${e}_${
|
|
286
|
+
id: `${e}_${d}`,
|
|
287
287
|
name: e,
|
|
288
|
-
value:
|
|
289
|
-
checked:
|
|
288
|
+
value: d,
|
|
289
|
+
checked: b,
|
|
290
290
|
className: "hidden",
|
|
291
|
-
onChange: () =>
|
|
291
|
+
onChange: () => w(d),
|
|
292
292
|
disabled: x
|
|
293
293
|
}
|
|
294
294
|
),
|
|
295
|
-
|
|
295
|
+
i[l] && /* @__PURE__ */ t("i", { className: `${i[l]} icon-sm` }),
|
|
296
296
|
" ",
|
|
297
|
-
|
|
297
|
+
i[o]
|
|
298
298
|
]
|
|
299
299
|
},
|
|
300
|
-
|
|
300
|
+
d
|
|
301
301
|
);
|
|
302
302
|
})
|
|
303
303
|
}
|
|
304
304
|
),
|
|
305
|
-
|
|
305
|
+
g && /* @__PURE__ */ t("p", { className: "text-danger", children: String(g.message) })
|
|
306
306
|
] });
|
|
307
307
|
}
|
|
308
|
-
const
|
|
308
|
+
const lt = F(de), ue = ({
|
|
309
309
|
name: e,
|
|
310
310
|
label: r = "",
|
|
311
|
-
placeholder:
|
|
312
|
-
className:
|
|
313
|
-
rows:
|
|
314
|
-
maxLength:
|
|
311
|
+
placeholder: n = "",
|
|
312
|
+
className: c = "",
|
|
313
|
+
rows: o = 4,
|
|
314
|
+
maxLength: l,
|
|
315
315
|
forceReadOnly: s = !1,
|
|
316
|
-
forceHidden:
|
|
316
|
+
forceHidden: a = !1
|
|
317
317
|
}) => {
|
|
318
|
-
const { isReadOnly:
|
|
319
|
-
field:
|
|
320
|
-
fieldState: { error:
|
|
321
|
-
} =
|
|
318
|
+
const { isReadOnly: h, isHidden: f } = D(), u = s || !!h(e), v = a || !!f(e), { control: k } = A(), { isView: R } = j(), {
|
|
319
|
+
field: y,
|
|
320
|
+
fieldState: { error: p }
|
|
321
|
+
} = T({
|
|
322
322
|
name: e,
|
|
323
|
-
control:
|
|
323
|
+
control: k
|
|
324
324
|
});
|
|
325
|
-
return
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
328
|
-
] }) : /* @__PURE__ */
|
|
329
|
-
/* @__PURE__ */
|
|
330
|
-
/* @__PURE__ */
|
|
325
|
+
return R ? /* @__PURE__ */ m("div", { className: `form-group ${v ? "hidden" : ""}`, children: [
|
|
326
|
+
/* @__PURE__ */ t("label", { children: r }),
|
|
327
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: y.value || "-" })
|
|
328
|
+
] }) : /* @__PURE__ */ m("div", { className: `form-group ${v ? "hidden" : ""}`, children: [
|
|
329
|
+
/* @__PURE__ */ t("label", { children: r }),
|
|
330
|
+
/* @__PURE__ */ t(
|
|
331
331
|
"textarea",
|
|
332
332
|
{
|
|
333
|
-
...
|
|
334
|
-
rows:
|
|
335
|
-
maxLength:
|
|
336
|
-
value:
|
|
337
|
-
placeholder:
|
|
338
|
-
readOnly:
|
|
339
|
-
className: `form-control ${
|
|
333
|
+
...y,
|
|
334
|
+
rows: o,
|
|
335
|
+
maxLength: l,
|
|
336
|
+
value: y.value || "",
|
|
337
|
+
placeholder: n,
|
|
338
|
+
readOnly: u,
|
|
339
|
+
className: `form-control ${p ? "border-red" : ""} ${c}`
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
|
|
342
|
+
p && /* @__PURE__ */ t("p", { className: "text-danger", children: String(p.message) })
|
|
343
343
|
] });
|
|
344
|
-
},
|
|
345
|
-
function
|
|
344
|
+
}, ct = F(ue);
|
|
345
|
+
function X(e) {
|
|
346
346
|
return (r = {}) => {
|
|
347
|
-
const
|
|
348
|
-
return e.formats[
|
|
347
|
+
const n = r.width ? String(r.width) : e.defaultWidth;
|
|
348
|
+
return e.formats[n] || e.formats[e.defaultWidth];
|
|
349
349
|
};
|
|
350
350
|
}
|
|
351
351
|
function q(e) {
|
|
352
|
-
return (r,
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
if (
|
|
356
|
-
const s = e.defaultFormattingWidth || e.defaultWidth,
|
|
357
|
-
|
|
352
|
+
return (r, n) => {
|
|
353
|
+
const c = n != null && n.context ? String(n.context) : "standalone";
|
|
354
|
+
let o;
|
|
355
|
+
if (c === "formatting" && e.formattingValues) {
|
|
356
|
+
const s = e.defaultFormattingWidth || e.defaultWidth, a = n != null && n.width ? String(n.width) : s;
|
|
357
|
+
o = e.formattingValues[a] || e.formattingValues[s];
|
|
358
358
|
} else {
|
|
359
|
-
const s = e.defaultWidth,
|
|
360
|
-
|
|
359
|
+
const s = e.defaultWidth, a = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
360
|
+
o = e.values[a] || e.values[s];
|
|
361
361
|
}
|
|
362
|
-
const
|
|
363
|
-
return
|
|
362
|
+
const l = e.argumentCallback ? e.argumentCallback(r) : r;
|
|
363
|
+
return o[l];
|
|
364
364
|
};
|
|
365
365
|
}
|
|
366
|
-
function
|
|
367
|
-
return (r,
|
|
368
|
-
const
|
|
369
|
-
if (!
|
|
366
|
+
function L(e) {
|
|
367
|
+
return (r, n = {}) => {
|
|
368
|
+
const c = n.width, o = c && e.matchPatterns[c] || e.matchPatterns[e.defaultMatchWidth], l = r.match(o);
|
|
369
|
+
if (!l)
|
|
370
370
|
return null;
|
|
371
|
-
const s =
|
|
371
|
+
const s = l[0], a = c && e.parsePatterns[c] || e.parsePatterns[e.defaultParseWidth], h = Array.isArray(a) ? he(a, (v) => v.test(s)) : (
|
|
372
372
|
// [TODO] -- I challenge you to fix the type
|
|
373
|
-
me(
|
|
373
|
+
me(a, (v) => v.test(s))
|
|
374
374
|
);
|
|
375
|
-
let
|
|
376
|
-
|
|
375
|
+
let f;
|
|
376
|
+
f = e.valueCallback ? e.valueCallback(h) : h, f = n.valueCallback ? (
|
|
377
377
|
// [TODO] -- I challenge you to fix the type
|
|
378
|
-
|
|
379
|
-
) :
|
|
380
|
-
const
|
|
381
|
-
return { value:
|
|
378
|
+
n.valueCallback(f)
|
|
379
|
+
) : f;
|
|
380
|
+
const u = r.slice(s.length);
|
|
381
|
+
return { value: f, rest: u };
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
function me(e, r) {
|
|
385
|
-
for (const
|
|
386
|
-
if (Object.prototype.hasOwnProperty.call(e,
|
|
387
|
-
return
|
|
385
|
+
for (const n in e)
|
|
386
|
+
if (Object.prototype.hasOwnProperty.call(e, n) && r(e[n]))
|
|
387
|
+
return n;
|
|
388
388
|
}
|
|
389
389
|
function he(e, r) {
|
|
390
|
-
for (let
|
|
391
|
-
if (r(e[
|
|
392
|
-
return
|
|
390
|
+
for (let n = 0; n < e.length; n++)
|
|
391
|
+
if (r(e[n]))
|
|
392
|
+
return n;
|
|
393
393
|
}
|
|
394
394
|
function fe(e) {
|
|
395
|
-
return (r,
|
|
396
|
-
const
|
|
397
|
-
if (!l) return null;
|
|
398
|
-
const i = l[0], c = r.match(e.parsePattern);
|
|
395
|
+
return (r, n = {}) => {
|
|
396
|
+
const c = r.match(e.matchPattern);
|
|
399
397
|
if (!c) return null;
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
398
|
+
const o = c[0], l = r.match(e.parsePattern);
|
|
399
|
+
if (!l) return null;
|
|
400
|
+
let s = e.valueCallback ? e.valueCallback(l[0]) : l[0];
|
|
401
|
+
s = n.valueCallback ? n.valueCallback(s) : s;
|
|
402
|
+
const a = r.slice(o.length);
|
|
403
|
+
return { value: s, rest: a };
|
|
404
404
|
};
|
|
405
405
|
}
|
|
406
406
|
const ge = {
|
|
@@ -465,36 +465,36 @@ const ge = {
|
|
|
465
465
|
one: "quase 1 ano",
|
|
466
466
|
other: "quase {{count}} anos"
|
|
467
467
|
}
|
|
468
|
-
},
|
|
469
|
-
let
|
|
470
|
-
const
|
|
471
|
-
return typeof
|
|
468
|
+
}, ve = (e, r, n) => {
|
|
469
|
+
let c;
|
|
470
|
+
const o = ge[e];
|
|
471
|
+
return typeof o == "string" ? c = o : r === 1 ? c = o.one : c = o.other.replace("{{count}}", String(r)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "em " + c : "há " + c : c;
|
|
472
472
|
}, pe = {
|
|
473
473
|
full: "EEEE, d 'de' MMMM 'de' y",
|
|
474
474
|
long: "d 'de' MMMM 'de' y",
|
|
475
475
|
medium: "d MMM y",
|
|
476
476
|
short: "dd/MM/yyyy"
|
|
477
|
-
},
|
|
477
|
+
}, be = {
|
|
478
478
|
full: "HH:mm:ss zzzz",
|
|
479
479
|
long: "HH:mm:ss z",
|
|
480
480
|
medium: "HH:mm:ss",
|
|
481
481
|
short: "HH:mm"
|
|
482
|
-
},
|
|
482
|
+
}, ye = {
|
|
483
483
|
full: "{{date}} 'às' {{time}}",
|
|
484
484
|
long: "{{date}} 'às' {{time}}",
|
|
485
485
|
medium: "{{date}}, {{time}}",
|
|
486
486
|
short: "{{date}}, {{time}}"
|
|
487
487
|
}, we = {
|
|
488
|
-
date:
|
|
488
|
+
date: X({
|
|
489
489
|
formats: pe,
|
|
490
490
|
defaultWidth: "full"
|
|
491
491
|
}),
|
|
492
|
-
time:
|
|
493
|
-
formats:
|
|
492
|
+
time: X({
|
|
493
|
+
formats: be,
|
|
494
494
|
defaultWidth: "full"
|
|
495
495
|
}),
|
|
496
|
-
dateTime:
|
|
497
|
-
formats:
|
|
496
|
+
dateTime: X({
|
|
497
|
+
formats: ye,
|
|
498
498
|
defaultWidth: "full"
|
|
499
499
|
})
|
|
500
500
|
}, Ne = {
|
|
@@ -507,9 +507,9 @@ const ge = {
|
|
|
507
507
|
tomorrow: "'amanhã às' p",
|
|
508
508
|
nextWeek: "eeee 'às' p",
|
|
509
509
|
other: "P"
|
|
510
|
-
}, ke = (e, r,
|
|
511
|
-
const
|
|
512
|
-
return typeof
|
|
510
|
+
}, ke = (e, r, n, c) => {
|
|
511
|
+
const o = Ne[e];
|
|
512
|
+
return typeof o == "function" ? o(r) : o;
|
|
513
513
|
}, Ce = {
|
|
514
514
|
narrow: ["AC", "DC"],
|
|
515
515
|
abbreviated: ["AC", "DC"],
|
|
@@ -518,7 +518,7 @@ const ge = {
|
|
|
518
518
|
narrow: ["1", "2", "3", "4"],
|
|
519
519
|
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
520
520
|
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
521
|
-
},
|
|
521
|
+
}, Re = {
|
|
522
522
|
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
523
523
|
abbreviated: [
|
|
524
524
|
"jan",
|
|
@@ -548,7 +548,7 @@ const ge = {
|
|
|
548
548
|
"novembro",
|
|
549
549
|
"dezembro"
|
|
550
550
|
]
|
|
551
|
-
},
|
|
551
|
+
}, Pe = {
|
|
552
552
|
narrow: ["D", "S", "T", "Q", "Q", "S", "S"],
|
|
553
553
|
short: ["dom", "seg", "ter", "qua", "qui", "sex", "sab"],
|
|
554
554
|
abbreviated: [
|
|
@@ -569,7 +569,7 @@ const ge = {
|
|
|
569
569
|
"sexta-feira",
|
|
570
570
|
"sábado"
|
|
571
571
|
]
|
|
572
|
-
},
|
|
572
|
+
}, $e = {
|
|
573
573
|
narrow: {
|
|
574
574
|
am: "a",
|
|
575
575
|
pm: "p",
|
|
@@ -600,7 +600,7 @@ const ge = {
|
|
|
600
600
|
evening: "tarde",
|
|
601
601
|
night: "noite"
|
|
602
602
|
}
|
|
603
|
-
},
|
|
603
|
+
}, Se = {
|
|
604
604
|
narrow: {
|
|
605
605
|
am: "a",
|
|
606
606
|
pm: "p",
|
|
@@ -631,11 +631,11 @@ const ge = {
|
|
|
631
631
|
evening: "da tarde",
|
|
632
632
|
night: "da noite"
|
|
633
633
|
}
|
|
634
|
-
},
|
|
635
|
-
const
|
|
636
|
-
return (r == null ? void 0 : r.unit) === "week" ?
|
|
637
|
-
},
|
|
638
|
-
ordinalNumber:
|
|
634
|
+
}, Ve = (e, r) => {
|
|
635
|
+
const n = Number(e);
|
|
636
|
+
return (r == null ? void 0 : r.unit) === "week" ? n + "ª" : n + "º";
|
|
637
|
+
}, Me = {
|
|
638
|
+
ordinalNumber: Ve,
|
|
639
639
|
era: q({
|
|
640
640
|
values: Ce,
|
|
641
641
|
defaultWidth: "wide"
|
|
@@ -646,37 +646,37 @@ const ge = {
|
|
|
646
646
|
argumentCallback: (e) => e - 1
|
|
647
647
|
}),
|
|
648
648
|
month: q({
|
|
649
|
-
values:
|
|
649
|
+
values: Re,
|
|
650
650
|
defaultWidth: "wide"
|
|
651
651
|
}),
|
|
652
652
|
day: q({
|
|
653
|
-
values:
|
|
653
|
+
values: Pe,
|
|
654
654
|
defaultWidth: "wide"
|
|
655
655
|
}),
|
|
656
656
|
dayPeriod: q({
|
|
657
|
-
values:
|
|
657
|
+
values: $e,
|
|
658
658
|
defaultWidth: "wide",
|
|
659
|
-
formattingValues:
|
|
659
|
+
formattingValues: Se,
|
|
660
660
|
defaultFormattingWidth: "wide"
|
|
661
661
|
})
|
|
662
|
-
},
|
|
662
|
+
}, Oe = /^(\d+)[ºªo]?/i, We = /\d+/i, je = {
|
|
663
663
|
narrow: /^(ac|dc|a|d)/i,
|
|
664
664
|
abbreviated: /^(a\.?\s?c\.?|d\.?\s?c\.?)/i,
|
|
665
665
|
wide: /^(antes de cristo|depois de cristo)/i
|
|
666
|
-
},
|
|
666
|
+
}, Ae = {
|
|
667
667
|
any: [/^ac/i, /^dc/i],
|
|
668
668
|
wide: [/^antes de cristo/i, /^depois de cristo/i]
|
|
669
|
-
},
|
|
669
|
+
}, De = {
|
|
670
670
|
narrow: /^[1234]/i,
|
|
671
671
|
abbreviated: /^T[1234]/i,
|
|
672
672
|
wide: /^[1234](º)? trimestre/i
|
|
673
|
-
},
|
|
673
|
+
}, Ie = {
|
|
674
674
|
any: [/1/i, /2/i, /3/i, /4/i]
|
|
675
675
|
}, Fe = {
|
|
676
676
|
narrow: /^[jfmajsond]/i,
|
|
677
677
|
abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,
|
|
678
678
|
wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i
|
|
679
|
-
},
|
|
679
|
+
}, Te = {
|
|
680
680
|
narrow: [
|
|
681
681
|
/^j/i,
|
|
682
682
|
/^f/i,
|
|
@@ -710,11 +710,11 @@ const ge = {
|
|
|
710
710
|
short: /^(dom|[23456]ª?|s[aá]b)/i,
|
|
711
711
|
abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,
|
|
712
712
|
wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i
|
|
713
|
-
},
|
|
713
|
+
}, He = {
|
|
714
714
|
short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
715
715
|
narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],
|
|
716
716
|
any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i]
|
|
717
|
-
},
|
|
717
|
+
}, qe = {
|
|
718
718
|
narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,
|
|
719
719
|
any: /^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i
|
|
720
720
|
}, Le = {
|
|
@@ -730,363 +730,643 @@ const ge = {
|
|
|
730
730
|
}
|
|
731
731
|
}, ze = {
|
|
732
732
|
ordinalNumber: fe({
|
|
733
|
-
matchPattern:
|
|
733
|
+
matchPattern: Oe,
|
|
734
734
|
parsePattern: We,
|
|
735
735
|
valueCallback: (e) => parseInt(e, 10)
|
|
736
736
|
}),
|
|
737
|
-
era:
|
|
738
|
-
matchPatterns:
|
|
737
|
+
era: L({
|
|
738
|
+
matchPatterns: je,
|
|
739
739
|
defaultMatchWidth: "wide",
|
|
740
|
-
parsePatterns:
|
|
740
|
+
parsePatterns: Ae,
|
|
741
741
|
defaultParseWidth: "any"
|
|
742
742
|
}),
|
|
743
|
-
quarter:
|
|
744
|
-
matchPatterns:
|
|
743
|
+
quarter: L({
|
|
744
|
+
matchPatterns: De,
|
|
745
745
|
defaultMatchWidth: "wide",
|
|
746
|
-
parsePatterns:
|
|
746
|
+
parsePatterns: Ie,
|
|
747
747
|
defaultParseWidth: "any",
|
|
748
748
|
valueCallback: (e) => e + 1
|
|
749
749
|
}),
|
|
750
|
-
month:
|
|
750
|
+
month: L({
|
|
751
751
|
matchPatterns: Fe,
|
|
752
752
|
defaultMatchWidth: "wide",
|
|
753
|
-
parsePatterns:
|
|
753
|
+
parsePatterns: Te,
|
|
754
754
|
defaultParseWidth: "any"
|
|
755
755
|
}),
|
|
756
|
-
day:
|
|
756
|
+
day: L({
|
|
757
757
|
matchPatterns: _e,
|
|
758
758
|
defaultMatchWidth: "wide",
|
|
759
|
-
parsePatterns:
|
|
759
|
+
parsePatterns: He,
|
|
760
760
|
defaultParseWidth: "any"
|
|
761
761
|
}),
|
|
762
|
-
dayPeriod:
|
|
763
|
-
matchPatterns:
|
|
762
|
+
dayPeriod: L({
|
|
763
|
+
matchPatterns: qe,
|
|
764
764
|
defaultMatchWidth: "any",
|
|
765
765
|
parsePatterns: Le,
|
|
766
766
|
defaultParseWidth: "any"
|
|
767
767
|
})
|
|
768
|
-
},
|
|
768
|
+
}, Be = {
|
|
769
769
|
code: "pt-BR",
|
|
770
|
-
formatDistance:
|
|
770
|
+
formatDistance: ve,
|
|
771
771
|
formatLong: we,
|
|
772
772
|
formatRelative: ke,
|
|
773
|
-
localize:
|
|
773
|
+
localize: Me,
|
|
774
774
|
match: ze,
|
|
775
775
|
options: {
|
|
776
776
|
weekStartsOn: 0,
|
|
777
777
|
firstWeekContainsDate: 1
|
|
778
778
|
}
|
|
779
779
|
};
|
|
780
|
-
ae("pt-BR",
|
|
781
|
-
const
|
|
780
|
+
ae("pt-BR", Be);
|
|
781
|
+
const Y = "dd/MM/yyyy", Ee = (e) => {
|
|
782
782
|
if (!e) return null;
|
|
783
|
-
const r = re(e,
|
|
784
|
-
return
|
|
785
|
-
}, Xe = (e) => e ? ie(e,
|
|
786
|
-
({ shimRef: e, className: r, name:
|
|
783
|
+
const r = re(e, Y, /* @__PURE__ */ new Date());
|
|
784
|
+
return se(r) ? r : null;
|
|
785
|
+
}, Xe = (e) => e ? ie(e, Y) : "", Je = K(
|
|
786
|
+
({ shimRef: e, className: r, name: n, ...c }, o) => /* @__PURE__ */ t(
|
|
787
787
|
"input",
|
|
788
788
|
{
|
|
789
|
-
name:
|
|
790
|
-
...
|
|
789
|
+
name: n,
|
|
790
|
+
...c,
|
|
791
791
|
className: r,
|
|
792
|
-
ref: (
|
|
793
|
-
typeof
|
|
792
|
+
ref: (l) => {
|
|
793
|
+
typeof o == "function" ? o(l) : o && (o.current = l), e && e(l);
|
|
794
794
|
}
|
|
795
795
|
}
|
|
796
796
|
)
|
|
797
|
-
),
|
|
797
|
+
), Ye = ({
|
|
798
798
|
name: e,
|
|
799
799
|
label: r = "",
|
|
800
|
-
placeholder:
|
|
801
|
-
className:
|
|
802
|
-
forceReadOnly:
|
|
803
|
-
forceHidden:
|
|
800
|
+
placeholder: n = "dd/mm/aaaa",
|
|
801
|
+
className: c = "",
|
|
802
|
+
forceReadOnly: o = !1,
|
|
803
|
+
forceHidden: l = !1
|
|
804
804
|
}) => {
|
|
805
|
-
const { control: s } =
|
|
806
|
-
field: { onChange:
|
|
807
|
-
fieldState: { error:
|
|
808
|
-
} =
|
|
805
|
+
const { control: s } = A(), { isView: a } = j(), { isReadOnly: h, isHidden: f } = D(), u = o || !!h(e), v = l || !!f(e), {
|
|
806
|
+
field: { onChange: k, onBlur: R, value: y, ref: p },
|
|
807
|
+
fieldState: { error: g }
|
|
808
|
+
} = T({
|
|
809
809
|
name: e,
|
|
810
810
|
control: s
|
|
811
|
-
}), x =
|
|
812
|
-
(
|
|
813
|
-
|
|
811
|
+
}), x = I(() => Ee(y), [y]), P = S(
|
|
812
|
+
(i) => {
|
|
813
|
+
k(i ? Xe(i) : "");
|
|
814
814
|
},
|
|
815
|
-
[
|
|
816
|
-
),
|
|
817
|
-
(
|
|
818
|
-
var
|
|
819
|
-
if (
|
|
820
|
-
const
|
|
821
|
-
|
|
815
|
+
[k]
|
|
816
|
+
), w = S(
|
|
817
|
+
(i) => {
|
|
818
|
+
var d, b;
|
|
819
|
+
if (p(i), i && ((b = (d = s._fields) == null ? void 0 : d[e]) != null && b._f)) {
|
|
820
|
+
const V = s._fields[e];
|
|
821
|
+
V._f.ref = {
|
|
822
822
|
focus: () => {
|
|
823
|
-
var
|
|
824
|
-
return (
|
|
823
|
+
var N;
|
|
824
|
+
return (N = i.focus) == null ? void 0 : N.call(i);
|
|
825
825
|
},
|
|
826
826
|
select: () => {
|
|
827
|
-
var
|
|
828
|
-
return (
|
|
827
|
+
var N;
|
|
828
|
+
return (N = i.select) == null ? void 0 : N.call(i);
|
|
829
829
|
},
|
|
830
|
-
setCustomValidity: (
|
|
831
|
-
var
|
|
832
|
-
return (
|
|
830
|
+
setCustomValidity: (N) => {
|
|
831
|
+
var $;
|
|
832
|
+
return ($ = i.setCustomValidity) == null ? void 0 : $.call(i, N);
|
|
833
833
|
},
|
|
834
834
|
reportValidity: () => {
|
|
835
|
-
var
|
|
836
|
-
return (
|
|
835
|
+
var N;
|
|
836
|
+
return (N = i.reportValidity) == null ? void 0 : N.call(i);
|
|
837
837
|
}
|
|
838
838
|
};
|
|
839
839
|
}
|
|
840
840
|
},
|
|
841
|
-
[
|
|
841
|
+
[p, s, e]
|
|
842
842
|
);
|
|
843
|
-
return
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
] }) : /* @__PURE__ */
|
|
847
|
-
r && /* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
843
|
+
return v ? null : a ? /* @__PURE__ */ m("div", { className: "form-group", children: [
|
|
844
|
+
/* @__PURE__ */ t("label", { children: r }),
|
|
845
|
+
/* @__PURE__ */ t("span", { className: "form-control", children: y || "-" })
|
|
846
|
+
] }) : /* @__PURE__ */ m("div", { className: `form-group fluig-style-guide ${c}`, children: [
|
|
847
|
+
r && /* @__PURE__ */ t("label", { className: "control-label", htmlFor: e, children: r }),
|
|
848
|
+
/* @__PURE__ */ t("div", { className: `${g ? "border-red" : ""}`, children: /* @__PURE__ */ t(
|
|
849
849
|
ne,
|
|
850
850
|
{
|
|
851
851
|
id: e,
|
|
852
852
|
name: e,
|
|
853
853
|
selected: x,
|
|
854
|
-
onChange:
|
|
855
|
-
onBlur:
|
|
856
|
-
dateFormat:
|
|
857
|
-
placeholderText:
|
|
858
|
-
disabled:
|
|
859
|
-
readOnly:
|
|
854
|
+
onChange: P,
|
|
855
|
+
onBlur: R,
|
|
856
|
+
dateFormat: Y,
|
|
857
|
+
placeholderText: n,
|
|
858
|
+
disabled: u,
|
|
859
|
+
readOnly: u,
|
|
860
860
|
locale: "pt-BR",
|
|
861
|
-
className: `form-control ${
|
|
861
|
+
className: `form-control ${g ? "border-red" : ""}`,
|
|
862
862
|
wrapperClassName: "w-100",
|
|
863
863
|
showMonthDropdown: !0,
|
|
864
864
|
showYearDropdown: !0,
|
|
865
865
|
dropdownMode: "select",
|
|
866
|
-
isClearable: !
|
|
866
|
+
isClearable: !u && !!y,
|
|
867
867
|
autoComplete: "off",
|
|
868
|
-
customInput: /* @__PURE__ */
|
|
868
|
+
customInput: /* @__PURE__ */ t(Je, { name: e, shimRef: w })
|
|
869
869
|
}
|
|
870
870
|
) }),
|
|
871
|
-
|
|
871
|
+
g && /* @__PURE__ */ t("span", { className: "help-block text-danger", children: String(g.message) })
|
|
872
872
|
] });
|
|
873
|
-
},
|
|
874
|
-
function
|
|
873
|
+
}, dt = F(Ye);
|
|
874
|
+
function Qe({
|
|
875
875
|
mapping: e = {},
|
|
876
876
|
defaultLabel: r = "Não reconhecido",
|
|
877
|
-
className:
|
|
878
|
-
hidden:
|
|
879
|
-
label:
|
|
877
|
+
className: n = "",
|
|
878
|
+
hidden: c = !1,
|
|
879
|
+
label: o
|
|
880
880
|
}) {
|
|
881
|
-
const { activityId:
|
|
881
|
+
const { activityId: l } = j(), s = I(() => !e || l === null || l === void 0 ? null : e[l], [l, e]);
|
|
882
882
|
if (!s)
|
|
883
|
-
return /* @__PURE__ */
|
|
884
|
-
|
|
885
|
-
/* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ m("div", { className: `form-group ${c ? "hidden" : ""}`, children: [
|
|
884
|
+
o && /* @__PURE__ */ t("label", { children: o }),
|
|
885
|
+
/* @__PURE__ */ t("div", { className: `status-badge default ${n}`, children: r })
|
|
886
886
|
] });
|
|
887
|
-
const
|
|
887
|
+
const a = {
|
|
888
888
|
"--customColor": s.color
|
|
889
889
|
};
|
|
890
|
-
return /* @__PURE__ */
|
|
891
|
-
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
s.icon && /* @__PURE__ */
|
|
894
|
-
/* @__PURE__ */
|
|
890
|
+
return /* @__PURE__ */ m("div", { className: `form-group ${c ? "hidden" : ""}`, children: [
|
|
891
|
+
o && /* @__PURE__ */ t("label", { children: o }),
|
|
892
|
+
/* @__PURE__ */ m("div", { className: `status-badge ${n}`, style: a, children: [
|
|
893
|
+
s.icon && /* @__PURE__ */ t("i", { className: s.icon }),
|
|
894
|
+
/* @__PURE__ */ t("span", { children: s.label })
|
|
895
895
|
] })
|
|
896
896
|
] });
|
|
897
897
|
}
|
|
898
|
-
const
|
|
898
|
+
const ut = F(Qe);
|
|
899
899
|
function Ue({
|
|
900
900
|
name: e,
|
|
901
901
|
control: r,
|
|
902
|
-
defaultRowValue:
|
|
903
|
-
isView:
|
|
904
|
-
isReadOnly:
|
|
905
|
-
filters:
|
|
902
|
+
defaultRowValue: n,
|
|
903
|
+
isView: c,
|
|
904
|
+
isReadOnly: o,
|
|
905
|
+
filters: l = []
|
|
906
906
|
}) {
|
|
907
|
-
const { field: s } =
|
|
907
|
+
const { field: s } = T({ name: e, control: r }), [a, h] = _([]), [f, u] = _([]), v = () => Date.now() + Math.random(), k = (i) => {
|
|
908
908
|
try {
|
|
909
|
-
const
|
|
910
|
-
return Array.isArray(
|
|
911
|
-
...
|
|
912
|
-
_uid:
|
|
909
|
+
const d = JSON.parse(i);
|
|
910
|
+
return Array.isArray(d) ? d.map((b) => ({
|
|
911
|
+
...b,
|
|
912
|
+
_uid: b._uid || v()
|
|
913
913
|
})) : [];
|
|
914
|
-
} catch (
|
|
915
|
-
return console.error(`Erro ao ler dados da tabela "${e}":`,
|
|
914
|
+
} catch (d) {
|
|
915
|
+
return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
|
|
916
916
|
}
|
|
917
917
|
};
|
|
918
|
-
|
|
919
|
-
if (!(
|
|
920
|
-
const
|
|
921
|
-
if (s.value ===
|
|
922
|
-
const
|
|
923
|
-
|
|
918
|
+
W(() => {
|
|
919
|
+
if (!(a.length > 0 && !c) && s.value && typeof s.value == "string") {
|
|
920
|
+
const i = JSON.stringify(a);
|
|
921
|
+
if (s.value === i) return;
|
|
922
|
+
const d = k(s.value);
|
|
923
|
+
h(d);
|
|
924
924
|
}
|
|
925
|
-
}, [s.value,
|
|
926
|
-
if (
|
|
927
|
-
const
|
|
928
|
-
s.value !==
|
|
929
|
-
}, [
|
|
930
|
-
const
|
|
931
|
-
const
|
|
932
|
-
|
|
933
|
-
}, [
|
|
934
|
-
|
|
935
|
-
(
|
|
936
|
-
),
|
|
937
|
-
}, [
|
|
938
|
-
(
|
|
939
|
-
|
|
940
|
-
(
|
|
941
|
-
(
|
|
925
|
+
}, [s.value, c]), W(() => {
|
|
926
|
+
if (o) return;
|
|
927
|
+
const i = JSON.stringify(a);
|
|
928
|
+
s.value !== i && s.onChange(i);
|
|
929
|
+
}, [a, s, o]);
|
|
930
|
+
const R = S(() => {
|
|
931
|
+
const i = { _uid: v(), ...n };
|
|
932
|
+
h((d) => [...d, i]);
|
|
933
|
+
}, [n]), y = S(() => {
|
|
934
|
+
h(
|
|
935
|
+
(i) => i.filter((d) => !f.includes(d._uid))
|
|
936
|
+
), u([]);
|
|
937
|
+
}, [f]), p = S(
|
|
938
|
+
(i, d, b) => {
|
|
939
|
+
h(
|
|
940
|
+
(V) => V.map(
|
|
941
|
+
(N) => N._uid === i ? { ...N, [d]: b } : N
|
|
942
942
|
)
|
|
943
943
|
);
|
|
944
944
|
},
|
|
945
945
|
[]
|
|
946
|
-
),
|
|
947
|
-
|
|
948
|
-
(
|
|
946
|
+
), g = S((i) => {
|
|
947
|
+
u(
|
|
948
|
+
(d) => d.includes(i) ? d.filter((b) => b !== i) : [...d, i]
|
|
949
949
|
);
|
|
950
|
-
}, []), x =
|
|
951
|
-
(
|
|
952
|
-
|
|
950
|
+
}, []), x = S(
|
|
951
|
+
(i) => {
|
|
952
|
+
u(i ? a.map((d) => d._uid) : []);
|
|
953
953
|
},
|
|
954
|
-
[
|
|
955
|
-
),
|
|
956
|
-
(
|
|
957
|
-
if ("custom" in
|
|
958
|
-
return
|
|
959
|
-
const
|
|
960
|
-
switch (
|
|
954
|
+
[a]
|
|
955
|
+
), P = a.length > 0 && f.length === a.length, w = I(() => !l || l.length === 0 ? a : a.filter(
|
|
956
|
+
(i) => l.every((d) => {
|
|
957
|
+
if ("custom" in d)
|
|
958
|
+
return d.custom(i);
|
|
959
|
+
const b = i[d.field];
|
|
960
|
+
switch (d.operator) {
|
|
961
961
|
case "===":
|
|
962
|
-
return
|
|
962
|
+
return b === d.value;
|
|
963
963
|
case "!==":
|
|
964
|
-
return
|
|
964
|
+
return b !== d.value;
|
|
965
965
|
case ">":
|
|
966
|
-
return
|
|
966
|
+
return b > d.value;
|
|
967
967
|
case "<":
|
|
968
|
-
return
|
|
968
|
+
return b < d.value;
|
|
969
969
|
case ">=":
|
|
970
|
-
return
|
|
970
|
+
return b >= d.value;
|
|
971
971
|
case "<=":
|
|
972
|
-
return
|
|
972
|
+
return b <= d.value;
|
|
973
973
|
default:
|
|
974
974
|
return !0;
|
|
975
975
|
}
|
|
976
976
|
})
|
|
977
|
-
), [
|
|
977
|
+
), [a, l]);
|
|
978
978
|
return {
|
|
979
979
|
field: s,
|
|
980
|
-
tableRows:
|
|
981
|
-
visibleRows:
|
|
982
|
-
selectedRowIds:
|
|
983
|
-
isAllSelected:
|
|
980
|
+
tableRows: a,
|
|
981
|
+
visibleRows: w,
|
|
982
|
+
selectedRowIds: f,
|
|
983
|
+
isAllSelected: P,
|
|
984
984
|
handle: {
|
|
985
|
-
addRow:
|
|
986
|
-
removeRows:
|
|
987
|
-
updateCellValue:
|
|
988
|
-
toggleSelection:
|
|
985
|
+
addRow: R,
|
|
986
|
+
removeRows: y,
|
|
987
|
+
updateCellValue: p,
|
|
988
|
+
toggleSelection: g,
|
|
989
989
|
toggleSelectAll: x
|
|
990
990
|
}
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
|
-
const
|
|
993
|
+
const mt = ({
|
|
994
994
|
name: e,
|
|
995
995
|
title: r = "Tabela Dinâmica",
|
|
996
|
-
columns:
|
|
997
|
-
defaultRowValue:
|
|
998
|
-
forceReadOnly:
|
|
999
|
-
layout:
|
|
996
|
+
columns: n,
|
|
997
|
+
defaultRowValue: c = {},
|
|
998
|
+
forceReadOnly: o = !1,
|
|
999
|
+
layout: l = "fluid",
|
|
1000
1000
|
actions: s = !0,
|
|
1001
|
-
filters:
|
|
1001
|
+
filters: a = []
|
|
1002
1002
|
}) => {
|
|
1003
|
-
const { control:
|
|
1004
|
-
field: P,
|
|
1005
|
-
// tableRows,
|
|
1006
|
-
visibleRows: g,
|
|
1007
|
-
selectedRowIds: v,
|
|
1008
|
-
isAllSelected: b,
|
|
1009
|
-
handle: x
|
|
1010
|
-
} = Ue({
|
|
1003
|
+
const { control: h } = A(), { isView: f, isReadOnly: u } = j(), { isReadOnly: v } = D(), k = o || f || u || v && v(e), { field: R, visibleRows: y, selectedRowIds: p, isAllSelected: g, handle: x } = Ue({
|
|
1011
1004
|
name: e,
|
|
1012
|
-
control:
|
|
1013
|
-
defaultRowValue:
|
|
1014
|
-
isView:
|
|
1015
|
-
isReadOnly: !!
|
|
1016
|
-
filters:
|
|
1017
|
-
}),
|
|
1018
|
-
return /* @__PURE__ */
|
|
1019
|
-
/* @__PURE__ */
|
|
1020
|
-
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
!
|
|
1023
|
-
/* @__PURE__ */
|
|
1005
|
+
control: h,
|
|
1006
|
+
defaultRowValue: c,
|
|
1007
|
+
isView: f,
|
|
1008
|
+
isReadOnly: !!k,
|
|
1009
|
+
filters: a
|
|
1010
|
+
}), P = l === "fixed";
|
|
1011
|
+
return /* @__PURE__ */ m("div", { className: `table-wrapper ${P ? "table-fixed" : "table-fluid"}`, children: [
|
|
1012
|
+
/* @__PURE__ */ t("input", { type: "hidden", ...R }),
|
|
1013
|
+
/* @__PURE__ */ m("div", { className: "header-handle", children: [
|
|
1014
|
+
/* @__PURE__ */ t("h3", { children: r }),
|
|
1015
|
+
!k && s && /* @__PURE__ */ m("div", { className: "handle-actions", children: [
|
|
1016
|
+
/* @__PURE__ */ m(
|
|
1024
1017
|
"button",
|
|
1025
1018
|
{
|
|
1026
1019
|
type: "button",
|
|
1027
|
-
className: `btn ${
|
|
1028
|
-
disabled:
|
|
1020
|
+
className: `btn ${p.length > 0 ? "btn-danger" : ""}`,
|
|
1021
|
+
disabled: p.length === 0,
|
|
1029
1022
|
onClick: x.removeRows,
|
|
1030
1023
|
children: [
|
|
1031
1024
|
"Remover (",
|
|
1032
|
-
|
|
1025
|
+
p.length,
|
|
1033
1026
|
")"
|
|
1034
1027
|
]
|
|
1035
1028
|
}
|
|
1036
1029
|
),
|
|
1037
|
-
/* @__PURE__ */
|
|
1030
|
+
/* @__PURE__ */ t("button", { type: "button", className: "btn-add", onClick: x.addRow, children: "Adicionar" })
|
|
1038
1031
|
] })
|
|
1039
1032
|
] }),
|
|
1040
|
-
/* @__PURE__ */
|
|
1041
|
-
/* @__PURE__ */
|
|
1042
|
-
!
|
|
1033
|
+
/* @__PURE__ */ t("div", { className: "table-scroll", children: /* @__PURE__ */ m("table", { className: "table-custom", children: [
|
|
1034
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ m("tr", { children: [
|
|
1035
|
+
!k && /* @__PURE__ */ t("th", { style: { width: "50px" }, children: /* @__PURE__ */ t(
|
|
1043
1036
|
"input",
|
|
1044
1037
|
{
|
|
1045
1038
|
type: "checkbox",
|
|
1046
|
-
checked:
|
|
1047
|
-
onChange: (
|
|
1039
|
+
checked: g,
|
|
1040
|
+
onChange: (w) => x.toggleSelectAll(w.target.checked)
|
|
1048
1041
|
}
|
|
1049
1042
|
) }),
|
|
1050
|
-
|
|
1043
|
+
n.map((w) => /* @__PURE__ */ t(
|
|
1051
1044
|
"th",
|
|
1052
1045
|
{
|
|
1053
|
-
style:
|
|
1054
|
-
children:
|
|
1046
|
+
style: w.width ? { minWidth: P ? w.width : "100%" } : { width: "max-content" },
|
|
1047
|
+
children: w.label
|
|
1055
1048
|
},
|
|
1056
|
-
|
|
1049
|
+
w.key
|
|
1057
1050
|
))
|
|
1058
1051
|
] }) }),
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
!C && /* @__PURE__ */ a("td", { children: /* @__PURE__ */ a(
|
|
1052
|
+
/* @__PURE__ */ m("tbody", { children: [
|
|
1053
|
+
y.map((w, i) => /* @__PURE__ */ m("tr", { children: [
|
|
1054
|
+
!k && /* @__PURE__ */ t("td", { children: /* @__PURE__ */ t(
|
|
1063
1055
|
"input",
|
|
1064
1056
|
{
|
|
1065
1057
|
type: "checkbox",
|
|
1066
|
-
checked:
|
|
1067
|
-
onChange: () => x.toggleSelection(
|
|
1058
|
+
checked: p.includes(w._uid),
|
|
1059
|
+
onChange: () => x.toggleSelection(w._uid)
|
|
1068
1060
|
}
|
|
1069
1061
|
) }),
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
(
|
|
1074
|
-
!!
|
|
1075
|
-
!!
|
|
1076
|
-
) :
|
|
1077
|
-
|
|
1078
|
-
|
|
1062
|
+
n.map((d) => /* @__PURE__ */ t("td", { children: d.render ? d.render.length <= 1 ? d.render({
|
|
1063
|
+
row: w,
|
|
1064
|
+
index: i,
|
|
1065
|
+
updateRow: (b, V) => x.updateCellValue(w._uid, b, V),
|
|
1066
|
+
isLocked: !!k,
|
|
1067
|
+
isView: !!f
|
|
1068
|
+
}) : d.render(
|
|
1069
|
+
w,
|
|
1070
|
+
i,
|
|
1071
|
+
(b, V) => x.updateCellValue(w._uid, b, V),
|
|
1072
|
+
!!k,
|
|
1073
|
+
!!f
|
|
1074
|
+
) : w[d.key] }, `${w._uid}-${d.key}`))
|
|
1075
|
+
] }, w._uid)),
|
|
1076
|
+
y.length === 0 && /* @__PURE__ */ t("tr", { className: "empty-row", children: /* @__PURE__ */ t("td", { colSpan: 100, className: "text-center", children: k ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
1079
1077
|
] })
|
|
1080
1078
|
] }) })
|
|
1081
1079
|
] });
|
|
1082
|
-
}
|
|
1080
|
+
}, Ge = ({
|
|
1081
|
+
name: e,
|
|
1082
|
+
label: r,
|
|
1083
|
+
help: n,
|
|
1084
|
+
className: c = "",
|
|
1085
|
+
forceReadOnly: o = !1
|
|
1086
|
+
}) => {
|
|
1087
|
+
const { isReadOnly: l } = D(), { isView: s } = j(), { control: a } = A(), { field: h } = T({ name: e, control: a }), f = z(null), u = !!h.value, v = o || !!l(e) || s, k = S(() => {
|
|
1088
|
+
var g;
|
|
1089
|
+
if (v) return;
|
|
1090
|
+
const p = window;
|
|
1091
|
+
p.JSInterface && p.JSInterface.showCamera ? p.JSInterface.showCamera(e) : (g = f.current) == null || g.click();
|
|
1092
|
+
}, [e, v]), R = (p) => {
|
|
1093
|
+
const g = p.target.files;
|
|
1094
|
+
g && g.length > 0 && h.onChange(g[0].name);
|
|
1095
|
+
}, y = S(() => {
|
|
1096
|
+
u && (window.parent && window.parent.WKFViewAttachment ? console.log("Abrindo anexo do Fluig:", h.value) : alert("Visualizando: " + h.value));
|
|
1097
|
+
}, [h.value, u]);
|
|
1098
|
+
return s ? /* @__PURE__ */ m("div", { className: "form-group", children: [
|
|
1099
|
+
r && /* @__PURE__ */ t("label", { children: r }),
|
|
1100
|
+
/* @__PURE__ */ t("div", { className: "attachment-view", children: u ? /* @__PURE__ */ m(
|
|
1101
|
+
"button",
|
|
1102
|
+
{
|
|
1103
|
+
type: "button",
|
|
1104
|
+
onClick: y,
|
|
1105
|
+
className: "btn-link",
|
|
1106
|
+
style: {
|
|
1107
|
+
padding: 0,
|
|
1108
|
+
border: "none",
|
|
1109
|
+
background: "none",
|
|
1110
|
+
color: "var(--colorPrimary)",
|
|
1111
|
+
cursor: "pointer"
|
|
1112
|
+
},
|
|
1113
|
+
children: [
|
|
1114
|
+
/* @__PURE__ */ t("i", { className: "flaticon flaticon-view icon-sm" }),
|
|
1115
|
+
" ",
|
|
1116
|
+
h.value
|
|
1117
|
+
]
|
|
1118
|
+
}
|
|
1119
|
+
) : /* @__PURE__ */ m("span", { className: "text-muted", children: [
|
|
1120
|
+
/* @__PURE__ */ t("i", { className: "flaticon flaticon-no-pic icon-sm" }),
|
|
1121
|
+
" Sem anexo"
|
|
1122
|
+
] }) })
|
|
1123
|
+
] }) : /* @__PURE__ */ m("div", { className: `form-group ${c}`, children: [
|
|
1124
|
+
r && /* @__PURE__ */ t("label", { children: r }),
|
|
1125
|
+
/* @__PURE__ */ t(
|
|
1126
|
+
"input",
|
|
1127
|
+
{
|
|
1128
|
+
type: "file",
|
|
1129
|
+
ref: f,
|
|
1130
|
+
style: { display: "none" },
|
|
1131
|
+
onChange: R
|
|
1132
|
+
}
|
|
1133
|
+
),
|
|
1134
|
+
/* @__PURE__ */ t(
|
|
1135
|
+
"div",
|
|
1136
|
+
{
|
|
1137
|
+
className: `form-control attachment-input ${v ? "readonly" : ""} ${u ? "has-file" : ""}`,
|
|
1138
|
+
style: {
|
|
1139
|
+
display: "flex",
|
|
1140
|
+
alignItems: "center",
|
|
1141
|
+
justifyContent: "center",
|
|
1142
|
+
cursor: v ? "not-allowed" : "pointer",
|
|
1143
|
+
backgroundColor: v ? "#f9f9f9" : "#fff",
|
|
1144
|
+
border: "1px dashed #ccc",
|
|
1145
|
+
minHeight: "40px"
|
|
1146
|
+
},
|
|
1147
|
+
onClick: u ? y : k,
|
|
1148
|
+
title: n,
|
|
1149
|
+
children: /* @__PURE__ */ m(
|
|
1150
|
+
"div",
|
|
1151
|
+
{
|
|
1152
|
+
style: {
|
|
1153
|
+
color: u ? "var(--colorPrimary)" : "#ababab",
|
|
1154
|
+
display: "flex",
|
|
1155
|
+
alignItems: "center",
|
|
1156
|
+
gap: "8px"
|
|
1157
|
+
},
|
|
1158
|
+
children: [
|
|
1159
|
+
/* @__PURE__ */ t(
|
|
1160
|
+
"i",
|
|
1161
|
+
{
|
|
1162
|
+
className: `flaticon ${u ? "flaticon-view" : v ? "flaticon-no-pic" : "flaticon-add-test"} icon-sm`
|
|
1163
|
+
}
|
|
1164
|
+
),
|
|
1165
|
+
/* @__PURE__ */ t("span", { children: u ? "Ver Anexo" : v ? "Vazio" : "Anexar" })
|
|
1166
|
+
]
|
|
1167
|
+
}
|
|
1168
|
+
)
|
|
1169
|
+
}
|
|
1170
|
+
),
|
|
1171
|
+
/* @__PURE__ */ t("input", { type: "hidden", name: e, value: h.value || "" })
|
|
1172
|
+
] });
|
|
1173
|
+
}, ht = F(Ge);
|
|
1174
|
+
function ft({
|
|
1175
|
+
items: e,
|
|
1176
|
+
time: r = 0,
|
|
1177
|
+
showNavigation: n = !0,
|
|
1178
|
+
progressBar: c = !0
|
|
1179
|
+
}) {
|
|
1180
|
+
const [o, l] = _(0), [s, a] = _(0), h = z(null), f = z(null), u = S(() => {
|
|
1181
|
+
l((p) => (p + 1) % e.length), a(0);
|
|
1182
|
+
}, [e.length]), v = S(() => {
|
|
1183
|
+
l((p) => (p - 1 + e.length) % e.length), a(0);
|
|
1184
|
+
}, [e.length]);
|
|
1185
|
+
if (W(() => {
|
|
1186
|
+
if (r > 0 && e.length > 1) {
|
|
1187
|
+
const g = 100 / r * 100;
|
|
1188
|
+
h.current = setInterval(u, r), f.current = setInterval(() => {
|
|
1189
|
+
a((x) => x >= 100 ? 0 : x + g);
|
|
1190
|
+
}, 100);
|
|
1191
|
+
}
|
|
1192
|
+
return () => {
|
|
1193
|
+
h.current && clearInterval(h.current), f.current && clearInterval(f.current);
|
|
1194
|
+
};
|
|
1195
|
+
}, [r, u, e.length, o]), !e || e.length === 0) return null;
|
|
1196
|
+
const k = e[o], R = typeof k == "string" ? k : k.url, y = /\.(jpg|jpeg|png|gif|webp)$/i.test(R);
|
|
1197
|
+
return /* @__PURE__ */ m("div", { className: "carousel-root", children: [
|
|
1198
|
+
/* @__PURE__ */ m("div", { className: "carousel-viewport", children: [
|
|
1199
|
+
n && e.length > 1 && /* @__PURE__ */ m(J, { children: [
|
|
1200
|
+
/* @__PURE__ */ t("button", { className: "nav-btn prev", onClick: v, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-left" }) }),
|
|
1201
|
+
/* @__PURE__ */ t("button", { className: "nav-btn next", onClick: u, children: /* @__PURE__ */ t("i", { className: "flaticon flaticon-chevron-right" }) })
|
|
1202
|
+
] }),
|
|
1203
|
+
/* @__PURE__ */ t("div", { className: "carousel-media", children: y ? /* @__PURE__ */ t("img", { src: R, alt: "Slide", className: "carousel-image" }) : /* @__PURE__ */ m("div", { className: "carousel-file-fallback", children: [
|
|
1204
|
+
/* @__PURE__ */ t("i", { className: "flaticon flaticon-file icon-xl" }),
|
|
1205
|
+
/* @__PURE__ */ t(
|
|
1206
|
+
"a",
|
|
1207
|
+
{
|
|
1208
|
+
href: R,
|
|
1209
|
+
target: "_blank",
|
|
1210
|
+
rel: "noreferrer",
|
|
1211
|
+
className: "btn-open",
|
|
1212
|
+
children: "Abrir Arquivo"
|
|
1213
|
+
}
|
|
1214
|
+
)
|
|
1215
|
+
] }) }),
|
|
1216
|
+
e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-dots", children: e.map((p, g) => /* @__PURE__ */ t(
|
|
1217
|
+
"div",
|
|
1218
|
+
{
|
|
1219
|
+
className: `dot ${g === o ? "active" : ""}`,
|
|
1220
|
+
onClick: () => {
|
|
1221
|
+
l(g), a(0);
|
|
1222
|
+
}
|
|
1223
|
+
},
|
|
1224
|
+
g
|
|
1225
|
+
)) })
|
|
1226
|
+
] }),
|
|
1227
|
+
c && r > 0 && e.length > 1 && /* @__PURE__ */ t("div", { className: "carousel-progress-container", children: /* @__PURE__ */ t(
|
|
1228
|
+
"div",
|
|
1229
|
+
{
|
|
1230
|
+
className: "carousel-progress-bar",
|
|
1231
|
+
style: { width: `${s}%` }
|
|
1232
|
+
}
|
|
1233
|
+
) })
|
|
1234
|
+
] });
|
|
1235
|
+
}
|
|
1236
|
+
function gt({
|
|
1237
|
+
title: e,
|
|
1238
|
+
isOpen: r,
|
|
1239
|
+
onOpen: n,
|
|
1240
|
+
onClose: c,
|
|
1241
|
+
content: o,
|
|
1242
|
+
footer: l,
|
|
1243
|
+
width: s
|
|
1244
|
+
}) {
|
|
1245
|
+
const a = S(
|
|
1246
|
+
(h) => {
|
|
1247
|
+
h.key === "Escape" && c();
|
|
1248
|
+
},
|
|
1249
|
+
[c]
|
|
1250
|
+
);
|
|
1251
|
+
return W(() => (r && (document.addEventListener("keydown", a), n == null || n(), document.body.style.overflow = "hidden"), () => {
|
|
1252
|
+
document.removeEventListener("keydown", a), document.body.style.overflow = "auto";
|
|
1253
|
+
}), [r, a, n]), r ? /* @__PURE__ */ t(
|
|
1254
|
+
"div",
|
|
1255
|
+
{
|
|
1256
|
+
className: "modal-overlay",
|
|
1257
|
+
onClick: c,
|
|
1258
|
+
"aria-modal": "true",
|
|
1259
|
+
role: "dialog",
|
|
1260
|
+
children: /* @__PURE__ */ m(
|
|
1261
|
+
"div",
|
|
1262
|
+
{
|
|
1263
|
+
style: { maxWidth: s },
|
|
1264
|
+
className: "modal-container",
|
|
1265
|
+
onClick: (h) => h.stopPropagation(),
|
|
1266
|
+
children: [
|
|
1267
|
+
/* @__PURE__ */ m("div", { className: "modal-header", children: [
|
|
1268
|
+
/* @__PURE__ */ t("h3", { children: e }),
|
|
1269
|
+
/* @__PURE__ */ t(
|
|
1270
|
+
"div",
|
|
1271
|
+
{
|
|
1272
|
+
className: "btn-close-modal",
|
|
1273
|
+
onClick: c,
|
|
1274
|
+
role: "button",
|
|
1275
|
+
"aria-label": "Fechar modal",
|
|
1276
|
+
children: /* @__PURE__ */ t(
|
|
1277
|
+
"i",
|
|
1278
|
+
{
|
|
1279
|
+
className: "flaticon flaticon-close icon-md",
|
|
1280
|
+
"aria-hidden": "true"
|
|
1281
|
+
}
|
|
1282
|
+
)
|
|
1283
|
+
}
|
|
1284
|
+
)
|
|
1285
|
+
] }),
|
|
1286
|
+
/* @__PURE__ */ t("div", { className: "modal-content", children: o }),
|
|
1287
|
+
l && /* @__PURE__ */ t("div", { className: "modal-footer", children: l })
|
|
1288
|
+
]
|
|
1289
|
+
}
|
|
1290
|
+
)
|
|
1291
|
+
}
|
|
1292
|
+
) : null;
|
|
1293
|
+
}
|
|
1294
|
+
function vt({
|
|
1295
|
+
logo: e,
|
|
1296
|
+
childs: r,
|
|
1297
|
+
footer: n,
|
|
1298
|
+
contentExternal: c,
|
|
1299
|
+
bg: o,
|
|
1300
|
+
color: l,
|
|
1301
|
+
onSelect: s
|
|
1302
|
+
}) {
|
|
1303
|
+
return /* @__PURE__ */ m("div", { className: "main-container dfea", children: [
|
|
1304
|
+
/* @__PURE__ */ m("div", { className: "sidebar-wrapper", style: { backgroundColor: `${o}` }, children: [
|
|
1305
|
+
e && /* @__PURE__ */ t("div", { className: "sidebar-logo", children: /* @__PURE__ */ t("img", { src: e, alt: "", width: "auto", height: "28px" }) }),
|
|
1306
|
+
/* @__PURE__ */ t("ul", { className: "sidebar-childs-content", children: r == null ? void 0 : r.map(
|
|
1307
|
+
(a) => {
|
|
1308
|
+
var h, f;
|
|
1309
|
+
return a != null && a.options && ((h = a == null ? void 0 : a.options) == null ? void 0 : h.length) > 0 ? /* @__PURE__ */ t(J, { children: /* @__PURE__ */ m("ul", { className: "sidebar-child sidebar-options-content", children: [
|
|
1310
|
+
/* @__PURE__ */ m(
|
|
1311
|
+
"li",
|
|
1312
|
+
{
|
|
1313
|
+
className: "sidebar-child",
|
|
1314
|
+
onClick: () => {
|
|
1315
|
+
var u;
|
|
1316
|
+
(u = a.action) == null || u.call(a), s == null || s(a.id);
|
|
1317
|
+
},
|
|
1318
|
+
style: { color: `${l}` },
|
|
1319
|
+
children: [
|
|
1320
|
+
a.icon && /* @__PURE__ */ t("i", { className: a.icon }),
|
|
1321
|
+
a.label
|
|
1322
|
+
]
|
|
1323
|
+
}
|
|
1324
|
+
),
|
|
1325
|
+
(f = a.options) == null ? void 0 : f.map((u) => /* @__PURE__ */ t(
|
|
1326
|
+
"li",
|
|
1327
|
+
{
|
|
1328
|
+
className: "sidebar-option",
|
|
1329
|
+
onClick: () => {
|
|
1330
|
+
var v;
|
|
1331
|
+
(v = u.action) == null || v.call(u), s == null || s(u.id);
|
|
1332
|
+
},
|
|
1333
|
+
style: { color: `${l}` },
|
|
1334
|
+
children: u.label
|
|
1335
|
+
}
|
|
1336
|
+
))
|
|
1337
|
+
] }) }) : /* @__PURE__ */ m(
|
|
1338
|
+
"li",
|
|
1339
|
+
{
|
|
1340
|
+
className: "sidebar-child",
|
|
1341
|
+
onClick: () => {
|
|
1342
|
+
var u;
|
|
1343
|
+
(u = a.action) == null || u.call(a), s == null || s(a.id);
|
|
1344
|
+
},
|
|
1345
|
+
style: { color: `${l}` },
|
|
1346
|
+
children: [
|
|
1347
|
+
a.icon && /* @__PURE__ */ t("i", { className: a.icon }),
|
|
1348
|
+
a.label
|
|
1349
|
+
]
|
|
1350
|
+
}
|
|
1351
|
+
);
|
|
1352
|
+
}
|
|
1353
|
+
) }),
|
|
1354
|
+
n && /* @__PURE__ */ t("div", { className: "sidebar-footer", children: n })
|
|
1355
|
+
] }),
|
|
1356
|
+
/* @__PURE__ */ t("div", { className: "sidebar-content-external", children: c })
|
|
1357
|
+
] });
|
|
1358
|
+
}
|
|
1083
1359
|
export {
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1360
|
+
ht as Attachment,
|
|
1361
|
+
ft as Carousel,
|
|
1362
|
+
ot as Checkbox,
|
|
1363
|
+
dt as DatePicker,
|
|
1364
|
+
st as Input,
|
|
1365
|
+
gt as Modal,
|
|
1366
|
+
lt as RadioBtn,
|
|
1367
|
+
it as Select,
|
|
1368
|
+
vt as Sidebar,
|
|
1369
|
+
mt as SimpleTable,
|
|
1370
|
+
ut as StatusBadge,
|
|
1371
|
+
ct as TextArea
|
|
1092
1372
|
};
|