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