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