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