diefra_ecm_ui 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Attachment/index.d.ts +1 -1
- package/dist/components/SimpleTable/index.d.ts +15 -18
- package/dist/components/SimpleTable/useSimpleTable.d.ts +12 -13
- package/dist/components/index.d.ts +1 -1
- package/dist/diefra_ecm_ui.css +1 -1
- package/dist/index.cjs +8 -8
- package/dist/index.js +378 -406
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { memo as z, useMemo as B, useCallback as C, useState as
|
|
3
|
-
import { useFormContext as H, useController as X, useFormState as
|
|
1
|
+
import { jsxs as x, jsx as r, Fragment as de } from "react/jsx-runtime";
|
|
2
|
+
import { memo as z, useMemo as B, useCallback as C, useState as F, useRef as G, useEffect as E, forwardRef as se, createElement as Z } from "react";
|
|
3
|
+
import { useFormContext as H, useController as X, useFormState as ce } from "react-hook-form";
|
|
4
4
|
import { IMaskInput as le } from "react-imask";
|
|
5
|
-
import { useSection as
|
|
5
|
+
import { useSection as I, useFluigRuntime as L } from "@fluig-kit/ecm";
|
|
6
6
|
import { parse as ue, isValid as me, eachDayOfInterval as he, endOfWeek as fe, endOfMonth as pe, startOfWeek as ye, startOfMonth as ve, subMonths as ge, format as K, addMonths as be, isSameMonth as we, isSameDay as Ne, isToday as ke } from "date-fns";
|
|
7
7
|
const xe = {
|
|
8
8
|
cpf: "000.000.000-00",
|
|
@@ -10,66 +10,66 @@ const xe = {
|
|
|
10
10
|
telefone: "(00) 00000-0000",
|
|
11
11
|
cep: "00000-000"
|
|
12
12
|
};
|
|
13
|
-
function
|
|
13
|
+
function Se({
|
|
14
14
|
name: e,
|
|
15
15
|
label: t = "",
|
|
16
16
|
placeholder: n = "",
|
|
17
17
|
type: i = "text",
|
|
18
18
|
mask: s,
|
|
19
|
-
className:
|
|
19
|
+
className: c = "",
|
|
20
20
|
forceReadOnly: l = !1,
|
|
21
21
|
forceHidden: o = !1,
|
|
22
22
|
valueManual: v,
|
|
23
23
|
onChangeManual: a,
|
|
24
|
-
errorManual:
|
|
24
|
+
errorManual: w
|
|
25
25
|
}) {
|
|
26
|
-
var
|
|
27
|
-
const
|
|
28
|
-
let
|
|
26
|
+
var $, A;
|
|
27
|
+
const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W } = L();
|
|
28
|
+
let h = null;
|
|
29
29
|
try {
|
|
30
|
-
|
|
30
|
+
h = H();
|
|
31
31
|
} catch {
|
|
32
32
|
}
|
|
33
|
-
const
|
|
33
|
+
const y = !p && h ? X({ name: e, control: h.control }) : null, u = !p && h ? ce({ name: e }) : null, m = p ? v : y == null ? void 0 : y.field.value, d = p ? w : (A = ($ = u == null ? void 0 : u.errors) == null ? void 0 : $[e]) == null ? void 0 : A.message, f = B(
|
|
34
34
|
() => s ? xe[s] ?? s : null,
|
|
35
35
|
[s]
|
|
36
|
-
),
|
|
36
|
+
), g = C((b) => {
|
|
37
37
|
if (!b) return "";
|
|
38
|
-
const
|
|
39
|
-
return (Number(
|
|
38
|
+
const j = b.replace(/\D/g, "");
|
|
39
|
+
return (Number(j) / 100).toLocaleString("pt-BR", {
|
|
40
40
|
style: "currency",
|
|
41
41
|
currency: "BRL"
|
|
42
42
|
});
|
|
43
|
-
}, []),
|
|
44
|
-
(b) => i === "monetary" ?
|
|
45
|
-
[i,
|
|
46
|
-
),
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
},
|
|
50
|
-
|
|
43
|
+
}, []), S = C(
|
|
44
|
+
(b) => i === "monetary" ? g(b) : b,
|
|
45
|
+
[i, g]
|
|
46
|
+
), N = (b) => {
|
|
47
|
+
const j = S(b);
|
|
48
|
+
p ? a == null || a(j) : y == null || y.field.onChange(j);
|
|
49
|
+
}, O = () => {
|
|
50
|
+
p || y == null || y.field.onBlur();
|
|
51
51
|
};
|
|
52
52
|
if (W)
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ x("div", { className: "form-group", children: [
|
|
54
54
|
/* @__PURE__ */ r("label", { children: t }),
|
|
55
55
|
/* @__PURE__ */ r("span", { className: "form-control", children: m || "-" })
|
|
56
56
|
] });
|
|
57
|
-
const k = `form-control ${
|
|
58
|
-
return /* @__PURE__ */
|
|
57
|
+
const k = `form-control ${_ ? "readOnly" : ""} ${d ? "border-red" : ""} ${c}`;
|
|
58
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
|
|
59
59
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
60
|
-
|
|
60
|
+
f ? /* @__PURE__ */ r(
|
|
61
61
|
le,
|
|
62
62
|
{
|
|
63
63
|
name: e,
|
|
64
|
-
mask:
|
|
64
|
+
mask: f,
|
|
65
65
|
value: String(m ?? ""),
|
|
66
66
|
unmask: !1,
|
|
67
|
-
onAccept: (b) =>
|
|
67
|
+
onAccept: (b) => N(b),
|
|
68
68
|
placeholder: n,
|
|
69
|
-
readOnly:
|
|
69
|
+
readOnly: _,
|
|
70
70
|
className: k,
|
|
71
|
-
inputRef:
|
|
72
|
-
onBlur:
|
|
71
|
+
inputRef: p || y == null ? void 0 : y.field.ref,
|
|
72
|
+
onBlur: O
|
|
73
73
|
}
|
|
74
74
|
) : /* @__PURE__ */ r(
|
|
75
75
|
"input",
|
|
@@ -77,204 +77,204 @@ function Re({
|
|
|
77
77
|
type: "text",
|
|
78
78
|
name: e,
|
|
79
79
|
value: m ?? "",
|
|
80
|
-
onChange: (b) =>
|
|
81
|
-
onBlur:
|
|
80
|
+
onChange: (b) => N(b.target.value),
|
|
81
|
+
onBlur: O,
|
|
82
82
|
placeholder: n,
|
|
83
|
-
readOnly:
|
|
83
|
+
readOnly: _,
|
|
84
84
|
className: k
|
|
85
85
|
}
|
|
86
86
|
),
|
|
87
|
-
|
|
87
|
+
d && /* @__PURE__ */ r("p", { className: "text-danger", children: String(d) })
|
|
88
88
|
] });
|
|
89
89
|
}
|
|
90
|
-
const
|
|
91
|
-
function
|
|
90
|
+
const Vt = z(Se);
|
|
91
|
+
function Re({
|
|
92
92
|
name: e,
|
|
93
93
|
label: t = "",
|
|
94
94
|
options: n = [],
|
|
95
95
|
placeholder: i = "",
|
|
96
96
|
labelKey: s = "label",
|
|
97
|
-
valueKey:
|
|
97
|
+
valueKey: c = "value",
|
|
98
98
|
enableSearch: l = !1,
|
|
99
99
|
searchPlaceholder: o = "Buscar...",
|
|
100
100
|
loading: v = !1,
|
|
101
101
|
onSearchChange: a,
|
|
102
|
-
debounceTime:
|
|
103
|
-
onSelect:
|
|
104
|
-
forceReadOnly:
|
|
105
|
-
forceHidden:
|
|
106
|
-
valueManual:
|
|
107
|
-
onChangeManual:
|
|
102
|
+
debounceTime: w = 300,
|
|
103
|
+
onSelect: p,
|
|
104
|
+
forceReadOnly: V = !1,
|
|
105
|
+
forceHidden: D = !1,
|
|
106
|
+
valueManual: _,
|
|
107
|
+
onChangeManual: P,
|
|
108
108
|
errorManual: W
|
|
109
109
|
}) {
|
|
110
110
|
var ne;
|
|
111
|
-
const
|
|
112
|
-
let
|
|
113
|
-
},
|
|
111
|
+
const h = _ !== void 0 && !!P, { isReadOnly: y, isHidden: u } = I(), m = V || !!y(e), d = D || !!u(e), { isView: f } = L();
|
|
112
|
+
let g = "", S = () => {
|
|
113
|
+
}, N, O = null, k = () => {
|
|
114
114
|
};
|
|
115
|
-
if (
|
|
116
|
-
|
|
115
|
+
if (h)
|
|
116
|
+
g = _;
|
|
117
117
|
else
|
|
118
118
|
try {
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const R = H(), T = X({ name: e, control: R.control });
|
|
120
|
+
g = T.field.value, S = T.field.onChange, N = T.field.ref, O = (ne = T.fieldState) == null ? void 0 : ne.error, k = R.clearErrors;
|
|
121
121
|
} catch {
|
|
122
122
|
}
|
|
123
|
-
const [
|
|
123
|
+
const [$, A] = F(!1), [b, j] = F(""), q = G(null), U = G(a);
|
|
124
124
|
E(() => {
|
|
125
125
|
U.current = a;
|
|
126
126
|
}, [a]), E(() => {
|
|
127
|
-
const
|
|
128
|
-
q.current && !q.current.contains(
|
|
127
|
+
const R = (T) => {
|
|
128
|
+
q.current && !q.current.contains(T.target) && A(!1);
|
|
129
129
|
};
|
|
130
|
-
return document.addEventListener("mousedown",
|
|
130
|
+
return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
|
|
131
131
|
}, []), E(() => {
|
|
132
|
-
|
|
133
|
-
}, [
|
|
132
|
+
$ || j("");
|
|
133
|
+
}, [$]), E(() => {
|
|
134
134
|
if (!l) return;
|
|
135
|
-
const
|
|
136
|
-
var
|
|
137
|
-
(
|
|
138
|
-
},
|
|
139
|
-
return () => clearTimeout(
|
|
140
|
-
}, [b, l,
|
|
135
|
+
const R = setTimeout(() => {
|
|
136
|
+
var T;
|
|
137
|
+
(T = U.current) == null || T.call(U, b);
|
|
138
|
+
}, w);
|
|
139
|
+
return () => clearTimeout(R);
|
|
140
|
+
}, [b, l, w]);
|
|
141
141
|
const ee = B(() => l && !a && b.trim() ? n.filter(
|
|
142
|
-
(
|
|
142
|
+
(R) => String((R == null ? void 0 : R[s]) ?? "").toLowerCase().includes(b.toLowerCase())
|
|
143
143
|
) : n ?? [], [n, l, a, b, s]), te = B(() => {
|
|
144
|
-
if (
|
|
145
|
-
if (typeof
|
|
146
|
-
return String(
|
|
147
|
-
const
|
|
148
|
-
(
|
|
144
|
+
if (g == null) return "";
|
|
145
|
+
if (typeof g == "object")
|
|
146
|
+
return String(g[c] ?? "");
|
|
147
|
+
const R = (n || []).find(
|
|
148
|
+
(T) => String(T == null ? void 0 : T[c]) === String(g)
|
|
149
149
|
);
|
|
150
|
-
return String(
|
|
151
|
-
}, [
|
|
152
|
-
m || (
|
|
150
|
+
return String(R ? (R == null ? void 0 : R[s]) ?? "" : g);
|
|
151
|
+
}, [g, n, c, s]), oe = (R) => {
|
|
152
|
+
m || (h ? P == null || P(R[c]) : (S(R[c]), k == null || k(e)), p == null || p(R), A(!1));
|
|
153
153
|
};
|
|
154
|
-
return /* @__PURE__ */
|
|
154
|
+
return /* @__PURE__ */ x(
|
|
155
155
|
"div",
|
|
156
156
|
{
|
|
157
|
-
className: `select-wrapper form-group ${
|
|
157
|
+
className: `select-wrapper form-group ${d ? "hidden" : ""}`,
|
|
158
158
|
ref: q,
|
|
159
159
|
children: [
|
|
160
160
|
/* @__PURE__ */ r("label", { className: "control-label", children: t }),
|
|
161
|
-
|
|
162
|
-
/* @__PURE__ */
|
|
161
|
+
f ? /* @__PURE__ */ r("span", { className: "form-control", children: te || "-" }) : /* @__PURE__ */ x(de, { children: [
|
|
162
|
+
/* @__PURE__ */ x(
|
|
163
163
|
"div",
|
|
164
164
|
{
|
|
165
|
-
className: `select-control ${
|
|
166
|
-
onClick: () => !m &&
|
|
167
|
-
ref:
|
|
165
|
+
className: `select-control ${O ? "border-red" : ""} ${m ? "readOnly" : ""}`,
|
|
166
|
+
onClick: () => !m && A((R) => !R),
|
|
167
|
+
ref: N,
|
|
168
168
|
children: [
|
|
169
169
|
/* @__PURE__ */ r("span", { className: `select-display ${m ? "readOnly" : ""}`, children: te || i }),
|
|
170
170
|
/* @__PURE__ */ r("i", { className: "flaticon flaticon-chevron-down select-icon" })
|
|
171
171
|
]
|
|
172
172
|
}
|
|
173
173
|
),
|
|
174
|
-
|
|
174
|
+
$ && !m && /* @__PURE__ */ x("div", { className: "select-dropdown", children: [
|
|
175
175
|
l && /* @__PURE__ */ r("div", { className: "select-search", children: /* @__PURE__ */ r(
|
|
176
176
|
"input",
|
|
177
177
|
{
|
|
178
178
|
type: "text",
|
|
179
179
|
className: "select-search-input",
|
|
180
180
|
value: b,
|
|
181
|
-
onChange: (
|
|
181
|
+
onChange: (R) => j(R.target.value),
|
|
182
182
|
placeholder: v ? "Carregando..." : o,
|
|
183
183
|
autoFocus: !0,
|
|
184
|
-
onClick: (
|
|
184
|
+
onClick: (R) => R.stopPropagation()
|
|
185
185
|
}
|
|
186
186
|
) }),
|
|
187
|
-
/* @__PURE__ */ r("ul", { className: "select-options", children: v ? /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map((
|
|
187
|
+
/* @__PURE__ */ r("ul", { className: "select-options", children: v ? /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Carregando..." }) : ee.length > 0 ? ee.map((R) => /* @__PURE__ */ r(
|
|
188
188
|
"li",
|
|
189
189
|
{
|
|
190
|
-
onClick: () => oe(
|
|
190
|
+
onClick: () => oe(R),
|
|
191
191
|
className: "select-option handleHover",
|
|
192
|
-
children:
|
|
192
|
+
children: R[s]
|
|
193
193
|
},
|
|
194
|
-
|
|
194
|
+
R[c]
|
|
195
195
|
)) : /* @__PURE__ */ r("li", { className: "select-option readOnly", children: "Sem resultados" }) })
|
|
196
196
|
] })
|
|
197
197
|
] }),
|
|
198
|
-
!
|
|
199
|
-
(
|
|
198
|
+
!h && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: g || "" }),
|
|
199
|
+
(O || W) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((O == null ? void 0 : O.message) ?? W) })
|
|
200
200
|
]
|
|
201
201
|
}
|
|
202
202
|
);
|
|
203
203
|
}
|
|
204
|
-
const
|
|
204
|
+
const Dt = z(Re);
|
|
205
205
|
function Tt({
|
|
206
206
|
name: e,
|
|
207
207
|
options: t = [],
|
|
208
208
|
label: n = "",
|
|
209
209
|
valueKey: i = "value",
|
|
210
210
|
labelKey: s = "label",
|
|
211
|
-
forceReadOnly:
|
|
211
|
+
forceReadOnly: c = !1,
|
|
212
212
|
forceHidden: l = !1,
|
|
213
213
|
valueManual: o,
|
|
214
214
|
onChangeManual: v
|
|
215
215
|
}) {
|
|
216
|
-
var
|
|
216
|
+
var N, O;
|
|
217
217
|
let a = null;
|
|
218
218
|
try {
|
|
219
219
|
a = H();
|
|
220
220
|
} catch {
|
|
221
221
|
}
|
|
222
|
-
const
|
|
223
|
-
(k,
|
|
224
|
-
const
|
|
225
|
-
if (
|
|
226
|
-
k[
|
|
222
|
+
const w = o !== void 0 && !!v, { isView: p, isReadOnly: V } = L(), { isReadOnly: D, isHidden: _ } = I(), P = D ? D(e) : !1, W = _ ? _(e) : !1, h = c || P, y = l || W, u = h || V || p, m = () => t ? t.reduce(
|
|
223
|
+
(k, $) => {
|
|
224
|
+
const A = String($[i]);
|
|
225
|
+
if (w)
|
|
226
|
+
k[A] = !!(o != null && o[A]);
|
|
227
227
|
else if (a) {
|
|
228
|
-
const b = a.getValues(
|
|
229
|
-
k[
|
|
228
|
+
const b = a.getValues(A);
|
|
229
|
+
k[A] = b === "on";
|
|
230
230
|
} else
|
|
231
|
-
k[
|
|
231
|
+
k[A] = !1;
|
|
232
232
|
return k;
|
|
233
233
|
},
|
|
234
234
|
{}
|
|
235
|
-
) : {},
|
|
235
|
+
) : {}, d = !w && a ? a.watch(e) : void 0, f = B(() => w && o ? o : d && typeof d == "object" ? d : m(), [d, o, t]);
|
|
236
236
|
E(() => {
|
|
237
|
-
if (
|
|
237
|
+
if (w || !a) return;
|
|
238
238
|
const k = a.getValues(e);
|
|
239
|
-
(!k || typeof k != "object") && a.setValue(e,
|
|
239
|
+
(!k || typeof k != "object") && a.setValue(e, f, {
|
|
240
240
|
shouldDirty: !1,
|
|
241
241
|
shouldValidate: !1
|
|
242
242
|
});
|
|
243
|
-
}, [
|
|
244
|
-
const
|
|
243
|
+
}, [f, e, a, w]);
|
|
244
|
+
const g = (k, $) => {
|
|
245
245
|
if (u) return;
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
v && v(
|
|
246
|
+
const A = { ...f, [k]: $ };
|
|
247
|
+
if (w) {
|
|
248
|
+
v && v(A);
|
|
249
249
|
return;
|
|
250
250
|
}
|
|
251
|
-
a && (a.setValue(e,
|
|
251
|
+
a && (a.setValue(e, A, {
|
|
252
252
|
shouldDirty: !0,
|
|
253
253
|
shouldValidate: !0
|
|
254
|
-
}), a.setValue(k,
|
|
255
|
-
},
|
|
256
|
-
return /* @__PURE__ */
|
|
254
|
+
}), a.setValue(k, $ ? "on" : "", { shouldValidate: !1 }));
|
|
255
|
+
}, S = w ? null : (O = (N = a == null ? void 0 : a.formState) == null ? void 0 : N.errors) == null ? void 0 : O[e];
|
|
256
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${y ? "hidden" : ""}`, children: [
|
|
257
257
|
n && /* @__PURE__ */ r("label", { children: n }),
|
|
258
258
|
/* @__PURE__ */ r(
|
|
259
259
|
"div",
|
|
260
260
|
{
|
|
261
261
|
className: `checkbox-group-custom ${u ? "readOnly" : ""}`,
|
|
262
262
|
children: t.map((k) => {
|
|
263
|
-
const
|
|
264
|
-
return /* @__PURE__ */
|
|
265
|
-
!
|
|
266
|
-
/* @__PURE__ */
|
|
263
|
+
const $ = String(k[i]), A = f[$] === !0;
|
|
264
|
+
return /* @__PURE__ */ x("div", { children: [
|
|
265
|
+
!w && a && /* @__PURE__ */ r("input", { type: "hidden", ...a.register($) }),
|
|
266
|
+
/* @__PURE__ */ x(
|
|
267
267
|
"label",
|
|
268
268
|
{
|
|
269
|
-
className: `custom-checkbox ${
|
|
269
|
+
className: `custom-checkbox ${A ? "checked" : ""} ${u ? "readOnly" : ""}`,
|
|
270
270
|
children: [
|
|
271
271
|
/* @__PURE__ */ r(
|
|
272
272
|
"input",
|
|
273
273
|
{
|
|
274
274
|
type: "checkbox",
|
|
275
|
-
checked:
|
|
275
|
+
checked: A,
|
|
276
276
|
disabled: u,
|
|
277
|
-
onChange: (b) =>
|
|
277
|
+
onChange: (b) => g($, b.target.checked)
|
|
278
278
|
}
|
|
279
279
|
),
|
|
280
280
|
/* @__PURE__ */ r("span", { className: "checkmark" }),
|
|
@@ -282,11 +282,11 @@ function Tt({
|
|
|
282
282
|
]
|
|
283
283
|
}
|
|
284
284
|
)
|
|
285
|
-
] },
|
|
285
|
+
] }, $);
|
|
286
286
|
})
|
|
287
287
|
}
|
|
288
288
|
),
|
|
289
|
-
|
|
289
|
+
S && /* @__PURE__ */ r("p", { className: "text-danger", children: String(S.message) })
|
|
290
290
|
] });
|
|
291
291
|
}
|
|
292
292
|
function Pe({
|
|
@@ -295,68 +295,68 @@ function Pe({
|
|
|
295
295
|
options: n = [],
|
|
296
296
|
valueKey: i = "value",
|
|
297
297
|
labelKey: s = "label",
|
|
298
|
-
iconKey:
|
|
298
|
+
iconKey: c = "icon",
|
|
299
299
|
forceReadOnly: l = !1,
|
|
300
300
|
forceHidden: o = !1,
|
|
301
301
|
valueManual: v,
|
|
302
302
|
onChangeManual: a,
|
|
303
|
-
errorManual:
|
|
303
|
+
errorManual: w
|
|
304
304
|
}) {
|
|
305
|
-
var
|
|
306
|
-
const
|
|
307
|
-
let
|
|
308
|
-
if (!
|
|
305
|
+
var g;
|
|
306
|
+
const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W, isReadOnly: h } = L();
|
|
307
|
+
let y = null, u = null;
|
|
308
|
+
if (!p)
|
|
309
309
|
try {
|
|
310
|
-
const { control:
|
|
311
|
-
|
|
310
|
+
const { control: S } = H(), N = X({ name: e, control: S });
|
|
311
|
+
y = N.field, u = (g = N.fieldState) == null ? void 0 : g.error;
|
|
312
312
|
} catch {
|
|
313
313
|
}
|
|
314
|
-
const m =
|
|
315
|
-
(
|
|
316
|
-
m || (
|
|
314
|
+
const m = _ || h || W, d = p ? v : (y == null ? void 0 : y.value) ?? "", f = C(
|
|
315
|
+
(S) => {
|
|
316
|
+
m || (p ? a == null || a(S) : y == null || y.onChange(S));
|
|
317
317
|
},
|
|
318
|
-
[m,
|
|
318
|
+
[m, p, a, y]
|
|
319
319
|
);
|
|
320
|
-
return /* @__PURE__ */
|
|
320
|
+
return /* @__PURE__ */ x("div", { className: `form-group column ${P ? "hidden" : ""}`, children: [
|
|
321
321
|
t && /* @__PURE__ */ r("label", { className: "control-label", children: t }),
|
|
322
322
|
/* @__PURE__ */ r(
|
|
323
323
|
"div",
|
|
324
324
|
{
|
|
325
325
|
className: `btn-group ${m ? "view-mode" : ""}`,
|
|
326
326
|
"data-field-name": e,
|
|
327
|
-
children: n.map((
|
|
328
|
-
const
|
|
329
|
-
return /* @__PURE__ */
|
|
327
|
+
children: n.map((S) => {
|
|
328
|
+
const N = S[i], O = d === N, k = S.color ? { "--customColor": S.color } : void 0;
|
|
329
|
+
return /* @__PURE__ */ x(
|
|
330
330
|
"label",
|
|
331
331
|
{
|
|
332
|
-
htmlFor: `${e}_${
|
|
332
|
+
htmlFor: `${e}_${N}`,
|
|
333
333
|
style: k,
|
|
334
|
-
className: `btn fs-ellipsis ${
|
|
334
|
+
className: `btn fs-ellipsis ${O ? "active" : ""}`,
|
|
335
335
|
children: [
|
|
336
336
|
/* @__PURE__ */ r(
|
|
337
337
|
"input",
|
|
338
338
|
{
|
|
339
339
|
type: "radio",
|
|
340
|
-
id: `${e}_${
|
|
340
|
+
id: `${e}_${N}`,
|
|
341
341
|
name: e,
|
|
342
|
-
value:
|
|
343
|
-
checked:
|
|
342
|
+
value: N,
|
|
343
|
+
checked: O,
|
|
344
344
|
className: "hidden",
|
|
345
|
-
onChange: () =>
|
|
345
|
+
onChange: () => f(N),
|
|
346
346
|
disabled: m
|
|
347
347
|
}
|
|
348
348
|
),
|
|
349
|
-
|
|
349
|
+
S[c] && /* @__PURE__ */ r("i", { className: `${S[c]} icon-sm` }),
|
|
350
350
|
" ",
|
|
351
|
-
|
|
351
|
+
S[s]
|
|
352
352
|
]
|
|
353
353
|
},
|
|
354
|
-
|
|
354
|
+
N
|
|
355
355
|
);
|
|
356
356
|
})
|
|
357
357
|
}
|
|
358
358
|
),
|
|
359
|
-
(u ||
|
|
359
|
+
(u || w) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? w) })
|
|
360
360
|
] });
|
|
361
361
|
}
|
|
362
362
|
const jt = z(Pe), $e = ({
|
|
@@ -365,60 +365,60 @@ const jt = z(Pe), $e = ({
|
|
|
365
365
|
placeholder: n = "",
|
|
366
366
|
className: i = "",
|
|
367
367
|
rows: s = 4,
|
|
368
|
-
maxLength:
|
|
368
|
+
maxLength: c,
|
|
369
369
|
forceReadOnly: l = !1,
|
|
370
370
|
forceHidden: o = !1,
|
|
371
371
|
valueManual: v,
|
|
372
372
|
onChangeManual: a,
|
|
373
|
-
errorManual:
|
|
373
|
+
errorManual: w
|
|
374
374
|
}) => {
|
|
375
|
-
var
|
|
376
|
-
const
|
|
377
|
-
let
|
|
375
|
+
var f;
|
|
376
|
+
const p = v !== void 0 && !!a, { isReadOnly: V, isHidden: D } = I(), _ = l || !!V(e), P = o || !!D(e), { isView: W } = L(), h = G(null);
|
|
377
|
+
let y = {
|
|
378
378
|
value: v ?? "",
|
|
379
|
-
onChange: (
|
|
379
|
+
onChange: (g) => a == null ? void 0 : a(g)
|
|
380
380
|
}, u = null;
|
|
381
|
-
if (!
|
|
381
|
+
if (!p)
|
|
382
382
|
try {
|
|
383
|
-
const { control:
|
|
384
|
-
|
|
383
|
+
const { control: g } = H(), S = X({ name: e, control: g });
|
|
384
|
+
y = S.field, u = (f = S.fieldState) == null ? void 0 : f.error;
|
|
385
385
|
} catch {
|
|
386
386
|
}
|
|
387
387
|
const m = () => {
|
|
388
|
-
|
|
388
|
+
h.current && (h.current.style.height = "auto", h.current.style.height = `${h.current.scrollHeight}px`);
|
|
389
389
|
};
|
|
390
390
|
if (E(() => {
|
|
391
391
|
m();
|
|
392
|
-
}, [
|
|
393
|
-
return /* @__PURE__ */
|
|
392
|
+
}, [y.value]), W)
|
|
393
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
|
|
394
394
|
/* @__PURE__ */ r("label", { children: t }),
|
|
395
|
-
/* @__PURE__ */ r("span", { className: "form-control", children:
|
|
395
|
+
/* @__PURE__ */ r("span", { className: "form-control", children: y.value || "-" })
|
|
396
396
|
] });
|
|
397
|
-
const
|
|
398
|
-
return /* @__PURE__ */
|
|
397
|
+
const d = `form-control ${_ ? "readOnly" : ""} ${u || w ? "border-red" : ""} ${i}`;
|
|
398
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${P ? "hidden" : ""}`, children: [
|
|
399
399
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
400
400
|
/* @__PURE__ */ r(
|
|
401
401
|
"textarea",
|
|
402
402
|
{
|
|
403
|
-
ref:
|
|
403
|
+
ref: h,
|
|
404
404
|
rows: s,
|
|
405
|
-
maxLength:
|
|
406
|
-
value:
|
|
405
|
+
maxLength: c,
|
|
406
|
+
value: y.value || "",
|
|
407
407
|
placeholder: n,
|
|
408
|
-
readOnly:
|
|
409
|
-
className:
|
|
408
|
+
readOnly: _,
|
|
409
|
+
className: d,
|
|
410
410
|
style: {
|
|
411
411
|
resize: "none",
|
|
412
412
|
maxHeight: "400px",
|
|
413
413
|
overflowY: "auto"
|
|
414
414
|
},
|
|
415
|
-
onChange: (
|
|
416
|
-
|
|
415
|
+
onChange: (g) => {
|
|
416
|
+
p ? a == null || a(g.target.value) : y.onChange(g);
|
|
417
417
|
},
|
|
418
418
|
onInput: m
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
(u ||
|
|
421
|
+
(u || w) && /* @__PURE__ */ r("p", { className: "text-danger", children: String((u == null ? void 0 : u.message) ?? w) })
|
|
422
422
|
] });
|
|
423
423
|
}, Ct = z($e);
|
|
424
424
|
function J(e) {
|
|
@@ -438,26 +438,26 @@ function Q(e) {
|
|
|
438
438
|
const l = e.defaultWidth, o = n != null && n.width ? String(n.width) : e.defaultWidth;
|
|
439
439
|
s = e.values[o] || e.values[l];
|
|
440
440
|
}
|
|
441
|
-
const
|
|
442
|
-
return s[
|
|
441
|
+
const c = e.argumentCallback ? e.argumentCallback(t) : t;
|
|
442
|
+
return s[c];
|
|
443
443
|
};
|
|
444
444
|
}
|
|
445
445
|
function Y(e) {
|
|
446
446
|
return (t, n = {}) => {
|
|
447
|
-
const i = n.width, s = i && e.matchPatterns[i] || e.matchPatterns[e.defaultMatchWidth],
|
|
448
|
-
if (!
|
|
447
|
+
const i = n.width, s = i && e.matchPatterns[i] || e.matchPatterns[e.defaultMatchWidth], c = t.match(s);
|
|
448
|
+
if (!c)
|
|
449
449
|
return null;
|
|
450
|
-
const l =
|
|
450
|
+
const l = c[0], o = i && e.parsePatterns[i] || e.parsePatterns[e.defaultParseWidth], v = Array.isArray(o) ? Oe(o, (p) => p.test(l)) : (
|
|
451
451
|
// [TODO] -- I challenge you to fix the type
|
|
452
|
-
_e(o, (
|
|
452
|
+
_e(o, (p) => p.test(l))
|
|
453
453
|
);
|
|
454
454
|
let a;
|
|
455
455
|
a = e.valueCallback ? e.valueCallback(v) : v, a = n.valueCallback ? (
|
|
456
456
|
// [TODO] -- I challenge you to fix the type
|
|
457
457
|
n.valueCallback(a)
|
|
458
458
|
) : a;
|
|
459
|
-
const
|
|
460
|
-
return { value: a, rest:
|
|
459
|
+
const w = t.slice(l.length);
|
|
460
|
+
return { value: a, rest: w };
|
|
461
461
|
};
|
|
462
462
|
}
|
|
463
463
|
function _e(e, t) {
|
|
@@ -474,9 +474,9 @@ function Ae(e) {
|
|
|
474
474
|
return (t, n = {}) => {
|
|
475
475
|
const i = t.match(e.matchPattern);
|
|
476
476
|
if (!i) return null;
|
|
477
|
-
const s = i[0],
|
|
478
|
-
if (!
|
|
479
|
-
let l = e.valueCallback ? e.valueCallback(
|
|
477
|
+
const s = i[0], c = t.match(e.parsePattern);
|
|
478
|
+
if (!c) return null;
|
|
479
|
+
let l = e.valueCallback ? e.valueCallback(c[0]) : c[0];
|
|
480
480
|
l = n.valueCallback ? n.valueCallback(l) : l;
|
|
481
481
|
const o = t.slice(s.length);
|
|
482
482
|
return { value: l, rest: o };
|
|
@@ -544,11 +544,11 @@ const We = {
|
|
|
544
544
|
one: "quase 1 ano",
|
|
545
545
|
other: "quase {{count}} anos"
|
|
546
546
|
}
|
|
547
|
-
},
|
|
547
|
+
}, Ve = (e, t, n) => {
|
|
548
548
|
let i;
|
|
549
549
|
const s = We[e];
|
|
550
550
|
return typeof s == "string" ? i = s : t === 1 ? i = s.one : i = s.other.replace("{{count}}", String(t)), n != null && n.addSuffix ? n.comparison && n.comparison > 0 ? "em " + i : "há " + i : i;
|
|
551
|
-
},
|
|
551
|
+
}, De = {
|
|
552
552
|
full: "EEEE, d 'de' MMMM 'de' y",
|
|
553
553
|
long: "d 'de' MMMM 'de' y",
|
|
554
554
|
medium: "d MMM y",
|
|
@@ -565,7 +565,7 @@ const We = {
|
|
|
565
565
|
short: "{{date}}, {{time}}"
|
|
566
566
|
}, Ce = {
|
|
567
567
|
date: J({
|
|
568
|
-
formats:
|
|
568
|
+
formats: De,
|
|
569
569
|
defaultWidth: "full"
|
|
570
570
|
}),
|
|
571
571
|
time: J({
|
|
@@ -589,15 +589,15 @@ const We = {
|
|
|
589
589
|
}, He = (e, t, n, i) => {
|
|
590
590
|
const s = Ee[e];
|
|
591
591
|
return typeof s == "function" ? s(t) : s;
|
|
592
|
-
},
|
|
592
|
+
}, Le = {
|
|
593
593
|
narrow: ["AC", "DC"],
|
|
594
594
|
abbreviated: ["AC", "DC"],
|
|
595
595
|
wide: ["antes de cristo", "depois de cristo"]
|
|
596
|
-
},
|
|
596
|
+
}, Fe = {
|
|
597
597
|
narrow: ["1", "2", "3", "4"],
|
|
598
598
|
abbreviated: ["T1", "T2", "T3", "T4"],
|
|
599
599
|
wide: ["1º trimestre", "2º trimestre", "3º trimestre", "4º trimestre"]
|
|
600
|
-
},
|
|
600
|
+
}, Ie = {
|
|
601
601
|
narrow: ["j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"],
|
|
602
602
|
abbreviated: [
|
|
603
603
|
"jan",
|
|
@@ -716,16 +716,16 @@ const We = {
|
|
|
716
716
|
}, Ue = {
|
|
717
717
|
ordinalNumber: Xe,
|
|
718
718
|
era: Q({
|
|
719
|
-
values:
|
|
719
|
+
values: Le,
|
|
720
720
|
defaultWidth: "wide"
|
|
721
721
|
}),
|
|
722
722
|
quarter: Q({
|
|
723
|
-
values:
|
|
723
|
+
values: Fe,
|
|
724
724
|
defaultWidth: "wide",
|
|
725
725
|
argumentCallback: (e) => e - 1
|
|
726
726
|
}),
|
|
727
727
|
month: Q({
|
|
728
|
-
values:
|
|
728
|
+
values: Ie,
|
|
729
729
|
defaultWidth: "wide"
|
|
730
730
|
}),
|
|
731
731
|
day: Q({
|
|
@@ -846,7 +846,7 @@ const We = {
|
|
|
846
846
|
})
|
|
847
847
|
}, at = {
|
|
848
848
|
code: "pt-BR",
|
|
849
|
-
formatDistance:
|
|
849
|
+
formatDistance: Ve,
|
|
850
850
|
formatLong: Ce,
|
|
851
851
|
formatRelative: He,
|
|
852
852
|
localize: Ue,
|
|
@@ -876,7 +876,7 @@ const ot = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
|
876
876
|
* This source code is licensed under the ISC license.
|
|
877
877
|
* See the LICENSE file in the root directory of this source tree.
|
|
878
878
|
*/
|
|
879
|
-
const
|
|
879
|
+
const dt = (e) => e.replace(
|
|
880
880
|
/^([A-Z])|[\s-_]+(\w)/g,
|
|
881
881
|
(t, n, i) => i ? i.toUpperCase() : n.toLowerCase()
|
|
882
882
|
);
|
|
@@ -887,7 +887,7 @@ const ct = (e) => e.replace(
|
|
|
887
887
|
* See the LICENSE file in the root directory of this source tree.
|
|
888
888
|
*/
|
|
889
889
|
const re = (e) => {
|
|
890
|
-
const t =
|
|
890
|
+
const t = dt(e);
|
|
891
891
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
892
892
|
};
|
|
893
893
|
/**
|
|
@@ -896,7 +896,7 @@ const re = (e) => {
|
|
|
896
896
|
* This source code is licensed under the ISC license.
|
|
897
897
|
* See the LICENSE file in the root directory of this source tree.
|
|
898
898
|
*/
|
|
899
|
-
var
|
|
899
|
+
var ct = {
|
|
900
900
|
xmlns: "http://www.w3.org/2000/svg",
|
|
901
901
|
width: 24,
|
|
902
902
|
height: 24,
|
|
@@ -932,25 +932,25 @@ const ut = se(
|
|
|
932
932
|
strokeWidth: n = 2,
|
|
933
933
|
absoluteStrokeWidth: i,
|
|
934
934
|
className: s = "",
|
|
935
|
-
children:
|
|
935
|
+
children: c,
|
|
936
936
|
iconNode: l,
|
|
937
937
|
...o
|
|
938
938
|
}, v) => Z(
|
|
939
939
|
"svg",
|
|
940
940
|
{
|
|
941
941
|
ref: v,
|
|
942
|
-
...
|
|
942
|
+
...ct,
|
|
943
943
|
width: t,
|
|
944
944
|
height: t,
|
|
945
945
|
stroke: e,
|
|
946
946
|
strokeWidth: i ? Number(n) * 24 / Number(t) : n,
|
|
947
947
|
className: ie("lucide", s),
|
|
948
|
-
...!
|
|
948
|
+
...!c && !lt(o) && { "aria-hidden": "true" },
|
|
949
949
|
...o
|
|
950
950
|
},
|
|
951
951
|
[
|
|
952
|
-
...l.map(([a,
|
|
953
|
-
...Array.isArray(
|
|
952
|
+
...l.map(([a, w]) => Z(a, w)),
|
|
953
|
+
...Array.isArray(c) ? c : [c]
|
|
954
954
|
]
|
|
955
955
|
)
|
|
956
956
|
);
|
|
@@ -962,8 +962,8 @@ const ut = se(
|
|
|
962
962
|
*/
|
|
963
963
|
const M = (e, t) => {
|
|
964
964
|
const n = se(
|
|
965
|
-
({ className: i, ...s },
|
|
966
|
-
ref:
|
|
965
|
+
({ className: i, ...s }, c) => Z(ut, {
|
|
966
|
+
ref: c,
|
|
967
967
|
iconNode: t,
|
|
968
968
|
className: ie(
|
|
969
969
|
`lucide-${ot(re(e))}`,
|
|
@@ -1022,114 +1022,100 @@ const ae = "dd/MM/yyyy", bt = (e) => {
|
|
|
1022
1022
|
placeholder: n = "dd/mm/aaaa",
|
|
1023
1023
|
className: i = "",
|
|
1024
1024
|
forceReadOnly: s = !1,
|
|
1025
|
-
forceHidden:
|
|
1025
|
+
forceHidden: c = !1,
|
|
1026
1026
|
valueManual: l,
|
|
1027
1027
|
onChangeManual: o,
|
|
1028
1028
|
errorManual: v
|
|
1029
1029
|
}) => {
|
|
1030
1030
|
var k;
|
|
1031
|
-
const [a,
|
|
1032
|
-
let
|
|
1031
|
+
const [a, w] = F(!1), [p, V] = F(/* @__PURE__ */ new Date()), D = gt(() => w(!1)), _ = l !== void 0 && !!o;
|
|
1032
|
+
let P = null;
|
|
1033
1033
|
try {
|
|
1034
|
-
|
|
1034
|
+
P = H();
|
|
1035
1035
|
} catch {
|
|
1036
1036
|
}
|
|
1037
|
-
const { isView: W } =
|
|
1037
|
+
const { isView: W } = L(), { isReadOnly: h, isHidden: y } = I(), u = s || !!h(e), m = c || !!y(e), d = !_ && P ? X({ name: e, control: P.control }) : null, f = _ ? l : d == null ? void 0 : d.field.value, g = _ ? v : (k = d == null ? void 0 : d.fieldState.error) == null ? void 0 : k.message, S = B(() => bt(f), [f]), N = ($) => {
|
|
1038
1038
|
if (u) return;
|
|
1039
|
-
const
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1042
|
-
const
|
|
1043
|
-
start: ye(ve(
|
|
1044
|
-
end: fe(pe(
|
|
1039
|
+
const A = wt($);
|
|
1040
|
+
_ ? o == null || o(A) : d == null || d.field.onChange(A), w(!1);
|
|
1041
|
+
}, O = ($) => {
|
|
1042
|
+
const A = he({
|
|
1043
|
+
start: ye(ve($)),
|
|
1044
|
+
end: fe(pe($))
|
|
1045
1045
|
});
|
|
1046
|
-
return /* @__PURE__ */
|
|
1047
|
-
/* @__PURE__ */
|
|
1046
|
+
return /* @__PURE__ */ x("div", { className: "dfe-calendar-pane", children: [
|
|
1047
|
+
/* @__PURE__ */ x("div", { className: "dfe-calendar-header", children: [
|
|
1048
1048
|
/* @__PURE__ */ r(
|
|
1049
1049
|
"button",
|
|
1050
1050
|
{
|
|
1051
1051
|
type: "button",
|
|
1052
1052
|
onClick: (b) => {
|
|
1053
|
-
b.stopPropagation(),
|
|
1053
|
+
b.stopPropagation(), V(ge(p, 1));
|
|
1054
1054
|
},
|
|
1055
1055
|
className: "dfe-nav-btn",
|
|
1056
1056
|
children: /* @__PURE__ */ r(pt, { size: 16 })
|
|
1057
1057
|
}
|
|
1058
1058
|
),
|
|
1059
|
-
/* @__PURE__ */ r("span", { className: "dfe-month-label", children: K(
|
|
1059
|
+
/* @__PURE__ */ r("span", { className: "dfe-month-label", children: K($, "MMMM yyyy", { locale: at }) }),
|
|
1060
1060
|
/* @__PURE__ */ r(
|
|
1061
1061
|
"button",
|
|
1062
1062
|
{
|
|
1063
1063
|
type: "button",
|
|
1064
1064
|
onClick: (b) => {
|
|
1065
|
-
b.stopPropagation(),
|
|
1065
|
+
b.stopPropagation(), V(be(p, 1));
|
|
1066
1066
|
},
|
|
1067
1067
|
className: "dfe-nav-btn",
|
|
1068
1068
|
children: /* @__PURE__ */ r(vt, { size: 16 })
|
|
1069
1069
|
}
|
|
1070
1070
|
)
|
|
1071
1071
|
] }),
|
|
1072
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b,
|
|
1073
|
-
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children:
|
|
1074
|
-
const q = !we(b,
|
|
1072
|
+
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid-header", children: ["D", "S", "T", "Q", "Q", "S", "S"].map((b, j) => /* @__PURE__ */ r("span", { children: b }, j)) }),
|
|
1073
|
+
/* @__PURE__ */ r("div", { className: "dfe-calendar-grid", children: A.map((b, j) => {
|
|
1074
|
+
const q = !we(b, $), U = S && Ne(b, S);
|
|
1075
1075
|
return /* @__PURE__ */ r(
|
|
1076
1076
|
"div",
|
|
1077
1077
|
{
|
|
1078
|
-
onClick: () => !q &&
|
|
1078
|
+
onClick: () => !q && N(b),
|
|
1079
1079
|
className: `dfe-calendar-day
|
|
1080
1080
|
${U ? "selected" : ""}
|
|
1081
1081
|
${q ? "outside" : ""}
|
|
1082
1082
|
${ke(b) ? "today" : ""}`,
|
|
1083
1083
|
children: K(b, "d")
|
|
1084
1084
|
},
|
|
1085
|
-
|
|
1085
|
+
j
|
|
1086
1086
|
);
|
|
1087
1087
|
}) })
|
|
1088
1088
|
] });
|
|
1089
1089
|
};
|
|
1090
|
-
return m ? null : W ? /* @__PURE__ */
|
|
1090
|
+
return m ? null : W ? /* @__PURE__ */ x("div", { className: `form-group ${i}`, children: [
|
|
1091
1091
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1092
|
-
/* @__PURE__ */ r(
|
|
1093
|
-
|
|
1094
|
-
{
|
|
1095
|
-
className: "form-control readOnly",
|
|
1096
|
-
style: { display: "block", height: "auto" },
|
|
1097
|
-
children: h || "-"
|
|
1098
|
-
}
|
|
1099
|
-
)
|
|
1100
|
-
] }) : /* @__PURE__ */ N(
|
|
1092
|
+
/* @__PURE__ */ r("span", { className: "form-control readOnly", style: { display: "block", height: "auto" }, children: f || "-" })
|
|
1093
|
+
] }) : /* @__PURE__ */ x(
|
|
1101
1094
|
"div",
|
|
1102
1095
|
{
|
|
1103
|
-
ref:
|
|
1096
|
+
ref: D,
|
|
1104
1097
|
className: `form-group dfe-datepicker-container ${i}`,
|
|
1105
1098
|
style: { position: "relative" },
|
|
1106
1099
|
children: [
|
|
1107
1100
|
t && /* @__PURE__ */ r("label", { children: t }),
|
|
1108
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ x(
|
|
1109
1102
|
"div",
|
|
1110
1103
|
{
|
|
1111
|
-
className: `form-control dfe-datepicker-trigger ${
|
|
1112
|
-
onClick: () => !u &&
|
|
1104
|
+
className: `form-control dfe-datepicker-trigger ${g ? "border-red" : ""} ${u ? "disabled" : ""}`,
|
|
1105
|
+
onClick: () => !u && w(!a),
|
|
1113
1106
|
style: {
|
|
1114
1107
|
display: "flex",
|
|
1115
1108
|
alignItems: "center",
|
|
1116
1109
|
cursor: u ? "default" : "pointer"
|
|
1117
1110
|
},
|
|
1118
1111
|
children: [
|
|
1119
|
-
/* @__PURE__ */ r(
|
|
1120
|
-
|
|
1121
|
-
{
|
|
1122
|
-
size: 16,
|
|
1123
|
-
className: "dfe-calendar-icon",
|
|
1124
|
-
style: { marginRight: "8px", opacity: 0.5 }
|
|
1125
|
-
}
|
|
1126
|
-
),
|
|
1127
|
-
/* @__PURE__ */ r("span", { children: h || n })
|
|
1112
|
+
/* @__PURE__ */ r(ht, { size: 16, className: "dfe-calendar-icon", style: { marginRight: "8px", opacity: 0.5 } }),
|
|
1113
|
+
/* @__PURE__ */ r("span", { children: f || n })
|
|
1128
1114
|
]
|
|
1129
1115
|
}
|
|
1130
1116
|
),
|
|
1131
|
-
a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children:
|
|
1132
|
-
|
|
1117
|
+
a && !u && /* @__PURE__ */ r("div", { className: "dfe-popover-content", children: /* @__PURE__ */ r("div", { className: "dfe-calendars-wrapper", children: O(p) }) }),
|
|
1118
|
+
g && /* @__PURE__ */ r("p", { className: "text-danger", children: String(g) })
|
|
1133
1119
|
]
|
|
1134
1120
|
}
|
|
1135
1121
|
);
|
|
@@ -1141,18 +1127,18 @@ function kt({
|
|
|
1141
1127
|
hidden: i = !1,
|
|
1142
1128
|
label: s
|
|
1143
1129
|
}) {
|
|
1144
|
-
const { activityId:
|
|
1130
|
+
const { activityId: c } = L(), l = B(() => !e || c === null || c === void 0 ? null : e[c], [c, e]);
|
|
1145
1131
|
if (!l)
|
|
1146
|
-
return /* @__PURE__ */
|
|
1132
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
|
|
1147
1133
|
s && /* @__PURE__ */ r("label", { children: s }),
|
|
1148
1134
|
/* @__PURE__ */ r("div", { className: `status-badge default ${n}`, children: t })
|
|
1149
1135
|
] });
|
|
1150
1136
|
const o = {
|
|
1151
1137
|
"--customColor": l.color
|
|
1152
1138
|
};
|
|
1153
|
-
return /* @__PURE__ */
|
|
1139
|
+
return /* @__PURE__ */ x("div", { className: `form-group ${i ? "hidden" : ""}`, children: [
|
|
1154
1140
|
s && /* @__PURE__ */ r("label", { children: s }),
|
|
1155
|
-
/* @__PURE__ */
|
|
1141
|
+
/* @__PURE__ */ x("div", { className: `status-badge ${n}`, style: o, children: [
|
|
1156
1142
|
l.icon && /* @__PURE__ */ r("i", { className: l.icon }),
|
|
1157
1143
|
/* @__PURE__ */ r("span", { children: l.label })
|
|
1158
1144
|
] })
|
|
@@ -1165,316 +1151,302 @@ function xt({
|
|
|
1165
1151
|
defaultRowValue: n,
|
|
1166
1152
|
isView: i,
|
|
1167
1153
|
isReadOnly: s,
|
|
1168
|
-
filters:
|
|
1154
|
+
filters: c = []
|
|
1169
1155
|
}) {
|
|
1170
|
-
const { field: l } = X({ name: e, control: t }), [o, v] =
|
|
1156
|
+
const { field: l } = X({ name: e, control: t }), [o, v] = F([]), [a, w] = F([]), p = () => Date.now() + Math.random(), V = (m) => {
|
|
1171
1157
|
try {
|
|
1172
|
-
const
|
|
1173
|
-
return Array.isArray(
|
|
1174
|
-
...
|
|
1175
|
-
_uid:
|
|
1158
|
+
const d = JSON.parse(m);
|
|
1159
|
+
return Array.isArray(d) ? d.map((f) => ({
|
|
1160
|
+
...f,
|
|
1161
|
+
_uid: f._uid || p()
|
|
1176
1162
|
})) : [];
|
|
1177
|
-
} catch (
|
|
1178
|
-
return console.error(`Erro ao ler dados da tabela "${e}":`,
|
|
1163
|
+
} catch (d) {
|
|
1164
|
+
return console.error(`Erro ao ler dados da tabela "${e}":`, d), [];
|
|
1179
1165
|
}
|
|
1180
1166
|
};
|
|
1181
1167
|
E(() => {
|
|
1182
1168
|
if (!(o.length > 0 && !i) && l.value && typeof l.value == "string") {
|
|
1183
1169
|
const m = JSON.stringify(o);
|
|
1184
1170
|
if (l.value === m) return;
|
|
1185
|
-
const
|
|
1186
|
-
v(
|
|
1171
|
+
const d = V(l.value);
|
|
1172
|
+
v(d);
|
|
1187
1173
|
}
|
|
1188
1174
|
}, [l.value, i]), E(() => {
|
|
1189
1175
|
if (s) return;
|
|
1190
1176
|
const m = JSON.stringify(o);
|
|
1191
1177
|
l.value !== m && l.onChange(m);
|
|
1192
1178
|
}, [o, l, s]);
|
|
1193
|
-
const
|
|
1194
|
-
const m = { _uid:
|
|
1195
|
-
v((
|
|
1196
|
-
}, [n]),
|
|
1197
|
-
v(
|
|
1198
|
-
|
|
1199
|
-
),
|
|
1200
|
-
}, [
|
|
1201
|
-
(m
|
|
1202
|
-
|
|
1203
|
-
(y) => y.map(
|
|
1204
|
-
(x) => x._uid === m ? { ...x, [c]: h } : x
|
|
1205
|
-
)
|
|
1206
|
-
);
|
|
1207
|
-
},
|
|
1208
|
-
[]
|
|
1209
|
-
), W = C((m) => {
|
|
1210
|
-
p(
|
|
1211
|
-
(c) => c.includes(m) ? c.filter((h) => h !== m) : [...c, m]
|
|
1212
|
-
);
|
|
1213
|
-
}, []), w = C(
|
|
1179
|
+
const D = C(() => {
|
|
1180
|
+
const m = { _uid: p(), ...n };
|
|
1181
|
+
v((d) => [...d, m]);
|
|
1182
|
+
}, [n]), _ = C(() => {
|
|
1183
|
+
v((m) => m.filter((d) => !a.includes(d._uid))), w([]);
|
|
1184
|
+
}, [a]), P = C((m, d, f) => {
|
|
1185
|
+
v((g) => g.map((S) => S._uid === m ? { ...S, [d]: f } : S));
|
|
1186
|
+
}, []), W = C((m) => {
|
|
1187
|
+
w((d) => d.includes(m) ? d.filter((f) => f !== m) : [...d, m]);
|
|
1188
|
+
}, []), h = C(
|
|
1214
1189
|
(m) => {
|
|
1215
|
-
|
|
1190
|
+
w(m ? o.map((d) => d._uid) : []);
|
|
1216
1191
|
},
|
|
1217
1192
|
[o]
|
|
1218
|
-
),
|
|
1219
|
-
(m) =>
|
|
1220
|
-
if ("custom" in
|
|
1221
|
-
return
|
|
1222
|
-
const
|
|
1223
|
-
switch (
|
|
1193
|
+
), y = o.length > 0 && a.length === o.length, u = B(() => !c || c.length === 0 ? o : o.filter(
|
|
1194
|
+
(m) => c.every((d) => {
|
|
1195
|
+
if ("custom" in d)
|
|
1196
|
+
return d.custom(m);
|
|
1197
|
+
const f = m[d.field];
|
|
1198
|
+
switch (d.operator) {
|
|
1224
1199
|
case "===":
|
|
1225
|
-
return
|
|
1200
|
+
return f === d.value;
|
|
1226
1201
|
case "!==":
|
|
1227
|
-
return
|
|
1202
|
+
return f !== d.value;
|
|
1228
1203
|
case ">":
|
|
1229
|
-
return
|
|
1204
|
+
return f > d.value;
|
|
1230
1205
|
case "<":
|
|
1231
|
-
return
|
|
1206
|
+
return f < d.value;
|
|
1232
1207
|
case ">=":
|
|
1233
|
-
return
|
|
1208
|
+
return f >= d.value;
|
|
1234
1209
|
case "<=":
|
|
1235
|
-
return
|
|
1210
|
+
return f <= d.value;
|
|
1236
1211
|
default:
|
|
1237
1212
|
return !0;
|
|
1238
1213
|
}
|
|
1239
1214
|
})
|
|
1240
|
-
), [o,
|
|
1215
|
+
), [o, c]);
|
|
1241
1216
|
return {
|
|
1242
1217
|
field: l,
|
|
1243
1218
|
tableRows: o,
|
|
1244
1219
|
visibleRows: u,
|
|
1245
1220
|
selectedRowIds: a,
|
|
1246
|
-
isAllSelected:
|
|
1221
|
+
isAllSelected: y,
|
|
1247
1222
|
handle: {
|
|
1248
|
-
addRow:
|
|
1249
|
-
removeRows:
|
|
1250
|
-
updateCellValue:
|
|
1223
|
+
addRow: D,
|
|
1224
|
+
removeRows: _,
|
|
1225
|
+
updateCellValue: P,
|
|
1251
1226
|
toggleSelection: W,
|
|
1252
|
-
toggleSelectAll:
|
|
1227
|
+
toggleSelectAll: h
|
|
1253
1228
|
}
|
|
1254
1229
|
};
|
|
1255
1230
|
}
|
|
1256
|
-
const
|
|
1231
|
+
const Lt = ({
|
|
1257
1232
|
name: e,
|
|
1258
1233
|
title: t = "Tabela Dinâmica",
|
|
1259
1234
|
columns: n,
|
|
1260
1235
|
defaultRowValue: i = {},
|
|
1261
1236
|
forceReadOnly: s = !1,
|
|
1262
|
-
layout:
|
|
1237
|
+
layout: c = "fluid",
|
|
1263
1238
|
actions: l = !0,
|
|
1264
1239
|
filters: o = []
|
|
1265
1240
|
}) => {
|
|
1266
|
-
const { control: v } = H(), { isView: a, isReadOnly:
|
|
1241
|
+
const { control: v } = H(), { isView: a, isReadOnly: w } = L(), { isReadOnly: p } = I(), V = s || a || w || p && p(e), { field: D, visibleRows: _, selectedRowIds: P, isAllSelected: W, handle: h } = xt({
|
|
1267
1242
|
name: e,
|
|
1268
1243
|
control: v,
|
|
1269
1244
|
defaultRowValue: i,
|
|
1270
1245
|
isView: a,
|
|
1271
|
-
isReadOnly:
|
|
1246
|
+
isReadOnly: !!V,
|
|
1272
1247
|
filters: o
|
|
1273
|
-
}),
|
|
1274
|
-
return /* @__PURE__ */
|
|
1275
|
-
/* @__PURE__ */ r("input", { type: "hidden", ...
|
|
1276
|
-
/* @__PURE__ */
|
|
1248
|
+
}), y = c === "fixed";
|
|
1249
|
+
return /* @__PURE__ */ x("div", { className: `table-wrapper ${y ? "table-fixed" : "table-fluid"}`, children: [
|
|
1250
|
+
/* @__PURE__ */ r("input", { type: "hidden", ...D }),
|
|
1251
|
+
/* @__PURE__ */ x("div", { className: "header-handle", children: [
|
|
1277
1252
|
/* @__PURE__ */ r("h3", { children: t }),
|
|
1278
|
-
|
|
1279
|
-
/* @__PURE__ */
|
|
1253
|
+
!V && l && /* @__PURE__ */ x("div", { className: "handle-actions", children: [
|
|
1254
|
+
/* @__PURE__ */ x(
|
|
1280
1255
|
"button",
|
|
1281
1256
|
{
|
|
1282
1257
|
type: "button",
|
|
1283
|
-
className: `btn ${
|
|
1284
|
-
disabled:
|
|
1285
|
-
onClick:
|
|
1258
|
+
className: `btn ${P.length > 0 ? "btn-danger" : "btn-primary"}`,
|
|
1259
|
+
disabled: P.length === 0,
|
|
1260
|
+
onClick: h.removeRows,
|
|
1286
1261
|
children: [
|
|
1287
1262
|
"Remover (",
|
|
1288
|
-
|
|
1263
|
+
P.length,
|
|
1289
1264
|
")"
|
|
1290
1265
|
]
|
|
1291
1266
|
}
|
|
1292
1267
|
),
|
|
1293
|
-
/* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick:
|
|
1268
|
+
/* @__PURE__ */ r("button", { type: "button", className: "btn-add", onClick: h.addRow, children: "Adicionar" })
|
|
1294
1269
|
] })
|
|
1295
1270
|
] }),
|
|
1296
|
-
/* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */
|
|
1297
|
-
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */
|
|
1298
|
-
|
|
1271
|
+
/* @__PURE__ */ r("div", { className: "table-scroll", children: /* @__PURE__ */ x("table", { className: "table-custom", children: [
|
|
1272
|
+
/* @__PURE__ */ r("thead", { children: /* @__PURE__ */ x("tr", { children: [
|
|
1273
|
+
!V && /* @__PURE__ */ r("th", { style: { width: "50px" }, children: /* @__PURE__ */ r(
|
|
1299
1274
|
"input",
|
|
1300
1275
|
{
|
|
1301
1276
|
type: "checkbox",
|
|
1302
1277
|
checked: W,
|
|
1303
|
-
onChange: (u) =>
|
|
1278
|
+
onChange: (u) => h.toggleSelectAll(u.target.checked)
|
|
1304
1279
|
}
|
|
1305
1280
|
) }),
|
|
1306
1281
|
n.map((u) => /* @__PURE__ */ r(
|
|
1307
1282
|
"th",
|
|
1308
1283
|
{
|
|
1309
|
-
style: u.width ? { minWidth:
|
|
1284
|
+
style: u.width ? { minWidth: y ? u.width : "100%" } : { width: "max-content" },
|
|
1310
1285
|
children: u.label
|
|
1311
1286
|
},
|
|
1312
|
-
u.key
|
|
1287
|
+
String(u.key)
|
|
1313
1288
|
))
|
|
1314
1289
|
] }) }),
|
|
1315
|
-
/* @__PURE__ */
|
|
1316
|
-
|
|
1317
|
-
|
|
1290
|
+
/* @__PURE__ */ x("tbody", { children: [
|
|
1291
|
+
_.map((u, m) => /* @__PURE__ */ x("tr", { children: [
|
|
1292
|
+
!V && /* @__PURE__ */ r("td", { children: /* @__PURE__ */ r(
|
|
1318
1293
|
"input",
|
|
1319
1294
|
{
|
|
1320
1295
|
type: "checkbox",
|
|
1321
|
-
checked:
|
|
1322
|
-
onChange: () =>
|
|
1296
|
+
checked: P.includes(u._uid),
|
|
1297
|
+
onChange: () => h.toggleSelection(u._uid)
|
|
1323
1298
|
}
|
|
1324
1299
|
) }),
|
|
1325
|
-
n.map((
|
|
1300
|
+
n.map((d) => /* @__PURE__ */ r("td", { children: d.render ? d.render.length <= 1 ? d.render({
|
|
1326
1301
|
row: u,
|
|
1327
1302
|
index: m,
|
|
1328
|
-
updateRow: (
|
|
1329
|
-
isLocked:
|
|
1303
|
+
updateRow: (f, g) => h.updateCellValue(u._uid, String(f), g),
|
|
1304
|
+
isLocked: !!V,
|
|
1330
1305
|
isView: !!a
|
|
1331
|
-
}) :
|
|
1306
|
+
}) : d.render(
|
|
1332
1307
|
u,
|
|
1333
1308
|
m,
|
|
1334
|
-
(
|
|
1335
|
-
|
|
1309
|
+
(f, g) => h.updateCellValue(u._uid, f, g),
|
|
1310
|
+
!!V,
|
|
1336
1311
|
!!a
|
|
1337
|
-
) : u[
|
|
1312
|
+
) : u[d.key] }, `${u._uid}-${String(d.key)}`))
|
|
1338
1313
|
] }, u._uid)),
|
|
1339
|
-
|
|
1314
|
+
_.length === 0 && /* @__PURE__ */ r("tr", { className: "empty-row", children: /* @__PURE__ */ r("td", { colSpan: 100, className: "text-center", children: V ? "Nenhum registro encontrado." : "Nenhum registro." }) })
|
|
1340
1315
|
] })
|
|
1341
1316
|
] }) })
|
|
1342
1317
|
] });
|
|
1343
|
-
},
|
|
1344
|
-
const [n, i] =
|
|
1318
|
+
}, St = (e, t) => {
|
|
1319
|
+
const [n, i] = F(null);
|
|
1345
1320
|
let s = null;
|
|
1346
1321
|
try {
|
|
1347
1322
|
s = H().watch;
|
|
1348
1323
|
} catch {
|
|
1349
1324
|
}
|
|
1350
|
-
const
|
|
1325
|
+
const c = t !== void 0 ? t : s ? s(e) : void 0, l = C(() => {
|
|
1351
1326
|
try {
|
|
1352
1327
|
const v = window.top.__REACT_ATTACHMENT_BRIDGE__;
|
|
1353
1328
|
if (v) {
|
|
1354
|
-
const a = v.getAttachment(e,
|
|
1355
|
-
i(a || (
|
|
1329
|
+
const a = v.getAttachment(e, c);
|
|
1330
|
+
i(a || (c ? { name: c, documentId: 0 } : null));
|
|
1356
1331
|
} else
|
|
1357
|
-
i(
|
|
1332
|
+
i(c ? { name: c, documentId: 0 } : null);
|
|
1358
1333
|
} catch {
|
|
1359
|
-
i(
|
|
1334
|
+
i(c ? { name: c, documentId: 0 } : null);
|
|
1360
1335
|
}
|
|
1361
|
-
}, [e,
|
|
1336
|
+
}, [e, c, t]);
|
|
1362
1337
|
return E(() => {
|
|
1363
1338
|
l();
|
|
1364
1339
|
const o = setInterval(l, 2e3);
|
|
1365
1340
|
return () => clearInterval(o);
|
|
1366
1341
|
}, [l]), { attachment: n, sync: l };
|
|
1367
|
-
},
|
|
1342
|
+
}, Rt = ({
|
|
1368
1343
|
name: e,
|
|
1369
1344
|
label: t,
|
|
1370
1345
|
help: n,
|
|
1371
1346
|
valueManual: i,
|
|
1372
1347
|
onChangeManual: s,
|
|
1373
|
-
forceReadOnly:
|
|
1348
|
+
forceReadOnly: c = !1,
|
|
1374
1349
|
forceHidden: l = !1
|
|
1375
1350
|
}) => {
|
|
1376
|
-
const o = i !== void 0 && !!s, { isReadOnly: v, isHidden: a } =
|
|
1377
|
-
let
|
|
1351
|
+
const o = i !== void 0 && !!s, { isReadOnly: v, isHidden: a } = I(), { isView: w } = L(), p = c || w || !!v(e), V = l || !!a(e), [D, _] = F(!1);
|
|
1352
|
+
let P = null;
|
|
1378
1353
|
try {
|
|
1379
|
-
|
|
1354
|
+
P = H().control;
|
|
1380
1355
|
} catch {
|
|
1381
1356
|
}
|
|
1382
|
-
const W =
|
|
1357
|
+
const W = P && !o ? X({ name: e, control: P }).field : {
|
|
1383
1358
|
value: i,
|
|
1384
|
-
onChange: (
|
|
1385
|
-
}, { attachment:
|
|
1386
|
-
var
|
|
1359
|
+
onChange: (N) => s == null ? void 0 : s(N)
|
|
1360
|
+
}, { attachment: h, sync: y } = St(e, i), u = () => {
|
|
1361
|
+
var N;
|
|
1387
1362
|
try {
|
|
1388
|
-
const
|
|
1363
|
+
const O = window.top;
|
|
1389
1364
|
return {
|
|
1390
|
-
bridge:
|
|
1391
|
-
toast: (
|
|
1365
|
+
bridge: O.__REACT_ATTACHMENT_BRIDGE__,
|
|
1366
|
+
toast: (N = O.FLUIGC) == null ? void 0 : N.toast
|
|
1392
1367
|
};
|
|
1393
1368
|
} catch {
|
|
1394
1369
|
return { bridge: null, toast: null };
|
|
1395
1370
|
}
|
|
1396
1371
|
}, m = C(() => {
|
|
1397
|
-
if (p
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
if (!
|
|
1402
|
-
const { bridge:
|
|
1403
|
-
|
|
1404
|
-
o ? s == null || s(
|
|
1405
|
-
|
|
1406
|
-
}, 1e3),
|
|
1372
|
+
if (p) return;
|
|
1373
|
+
const N = document.createElement("input");
|
|
1374
|
+
N.type = "file", N.onchange = (O) => {
|
|
1375
|
+
const k = O.target.files[0];
|
|
1376
|
+
if (!k) return;
|
|
1377
|
+
const { bridge: $, toast: A } = u();
|
|
1378
|
+
_(!0), $ ? $.upload(k, e, (b) => {
|
|
1379
|
+
o ? s == null || s(b.name) : W.onChange(b.name), setTimeout(() => {
|
|
1380
|
+
_(!1), y();
|
|
1381
|
+
}, 1e3), A && A({
|
|
1407
1382
|
title: "Sucesso",
|
|
1408
1383
|
message: "Arquivo enviado",
|
|
1409
1384
|
type: "success"
|
|
1410
1385
|
});
|
|
1411
|
-
}) : (o ? s == null || s(
|
|
1412
|
-
},
|
|
1413
|
-
}, [e, W,
|
|
1414
|
-
if (
|
|
1415
|
-
const
|
|
1416
|
-
if (!
|
|
1417
|
-
const { bridge:
|
|
1418
|
-
|
|
1386
|
+
}) : (o ? s == null || s(k.name) : W.onChange(k.name), _(!1));
|
|
1387
|
+
}, N.click();
|
|
1388
|
+
}, [e, W, y, s, p, o]), d = (N) => {
|
|
1389
|
+
if (N.stopPropagation(), p) return;
|
|
1390
|
+
const O = (h == null ? void 0 : h.name) || i || W.value;
|
|
1391
|
+
if (!O) return;
|
|
1392
|
+
const { bridge: k, toast: $ } = u();
|
|
1393
|
+
k ? k.removeByFileName(O) ? (o ? s == null || s("") : W.onChange(""), y()) : $ && $({
|
|
1419
1394
|
title: "Erro",
|
|
1420
1395
|
message: "Erro ao remover anexo",
|
|
1421
1396
|
type: "danger"
|
|
1422
|
-
}) : (o ? s == null || s("") : W.onChange(""),
|
|
1423
|
-
},
|
|
1397
|
+
}) : (o ? s == null || s("") : W.onChange(""), y());
|
|
1398
|
+
}, f = !!h && !D, g = (h == null ? void 0 : h.name) || i || W.value, S = [
|
|
1424
1399
|
"fluig-attachment__box",
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
p ? "readOnly" : ""
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
/* @__PURE__ */ r("span", { className: "fluig-attachment__box readOnly", children: y || "-" })
|
|
1432
|
-
] }) : /* @__PURE__ */ N("div", { className: `form-group fluig-attachment ${g ? "hidden" : ""}`, children: [
|
|
1400
|
+
f ? "fluig-attachment__box--has-file" : "",
|
|
1401
|
+
D ? "fluig-attachment__box--uploading" : "",
|
|
1402
|
+
p && !f ? "readOnly" : "",
|
|
1403
|
+
p && f ? "fluig-attachment__box--readonly-view" : ""
|
|
1404
|
+
].join(" ");
|
|
1405
|
+
return V ? null : /* @__PURE__ */ x("div", { className: "form-group fluig-attachment", children: [
|
|
1433
1406
|
t && /* @__PURE__ */ r("label", { className: "fluig-attachment__label", children: t }),
|
|
1434
|
-
/* @__PURE__ */
|
|
1407
|
+
/* @__PURE__ */ x(
|
|
1435
1408
|
"div",
|
|
1436
1409
|
{
|
|
1437
|
-
className:
|
|
1438
|
-
style: D ? { pointerEvents: "none", opacity: 0.6, cursor: "not-allowed" } : {},
|
|
1410
|
+
className: S,
|
|
1439
1411
|
onClick: () => {
|
|
1440
|
-
if (
|
|
1441
|
-
const
|
|
1442
|
-
|
|
1412
|
+
if (f) {
|
|
1413
|
+
const N = u(), O = (h == null ? void 0 : h.physicalFileName) || (h == null ? void 0 : h.description) || (h == null ? void 0 : h.name) || g;
|
|
1414
|
+
N.bridge && O && N.bridge.view(O);
|
|
1443
1415
|
} else
|
|
1444
1416
|
m();
|
|
1445
1417
|
},
|
|
1446
1418
|
children: [
|
|
1447
|
-
/* @__PURE__ */
|
|
1419
|
+
/* @__PURE__ */ x("span", { className: "fluig-attachment__content", children: [
|
|
1448
1420
|
/* @__PURE__ */ r(
|
|
1449
1421
|
"i",
|
|
1450
1422
|
{
|
|
1451
|
-
className: `
|
|
1423
|
+
className: `flaticon icon-sm ${D ? "flaticon-loading" : f ? "flaticon-file" : "flaticon-paperclip"} fluig-attachment__icon`
|
|
1452
1424
|
}
|
|
1453
1425
|
),
|
|
1454
|
-
/* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children:
|
|
1426
|
+
/* @__PURE__ */ r("span", { className: "fluig-attachment__filename", children: D ? " Enviando..." : f ? g : p ? "Nenhum arquivo" : n || "Anexar" })
|
|
1455
1427
|
] }),
|
|
1456
|
-
|
|
1428
|
+
f && !p && /* @__PURE__ */ r(
|
|
1457
1429
|
"button",
|
|
1458
1430
|
{
|
|
1459
1431
|
type: "button",
|
|
1460
1432
|
className: "fluig-attachment__btn-remove btn btn-link text-danger",
|
|
1461
|
-
onClick:
|
|
1433
|
+
onClick: d,
|
|
1462
1434
|
children: /* @__PURE__ */ r("i", { className: "flaticon flaticon-trash icon-sm" })
|
|
1463
1435
|
}
|
|
1464
1436
|
)
|
|
1465
1437
|
]
|
|
1466
1438
|
}
|
|
1467
1439
|
),
|
|
1468
|
-
!o &&
|
|
1440
|
+
!o && P && /* @__PURE__ */ r("input", { type: "hidden", name: e, value: W.value || "" })
|
|
1469
1441
|
] });
|
|
1470
|
-
},
|
|
1471
|
-
function
|
|
1442
|
+
}, Ft = z(Rt);
|
|
1443
|
+
function It({
|
|
1472
1444
|
title: e,
|
|
1473
1445
|
isOpen: t,
|
|
1474
1446
|
onOpen: n,
|
|
1475
1447
|
onClose: i,
|
|
1476
1448
|
content: s,
|
|
1477
|
-
footer:
|
|
1449
|
+
footer: c,
|
|
1478
1450
|
width: l
|
|
1479
1451
|
}) {
|
|
1480
1452
|
const o = C(
|
|
@@ -1492,14 +1464,14 @@ function Ft({
|
|
|
1492
1464
|
onClick: i,
|
|
1493
1465
|
"aria-modal": "true",
|
|
1494
1466
|
role: "dialog",
|
|
1495
|
-
children: /* @__PURE__ */
|
|
1467
|
+
children: /* @__PURE__ */ x(
|
|
1496
1468
|
"div",
|
|
1497
1469
|
{
|
|
1498
1470
|
style: { maxWidth: l },
|
|
1499
1471
|
className: "modal-container",
|
|
1500
1472
|
onClick: (v) => v.stopPropagation(),
|
|
1501
1473
|
children: [
|
|
1502
|
-
/* @__PURE__ */
|
|
1474
|
+
/* @__PURE__ */ x("div", { className: "modal-header", children: [
|
|
1503
1475
|
/* @__PURE__ */ r("h3", { children: e }),
|
|
1504
1476
|
/* @__PURE__ */ r(
|
|
1505
1477
|
"div",
|
|
@@ -1519,7 +1491,7 @@ function Ft({
|
|
|
1519
1491
|
)
|
|
1520
1492
|
] }),
|
|
1521
1493
|
/* @__PURE__ */ r("div", { className: "modal-content", children: s }),
|
|
1522
|
-
|
|
1494
|
+
c && /* @__PURE__ */ r("div", { className: "modal-footer", children: c })
|
|
1523
1495
|
]
|
|
1524
1496
|
}
|
|
1525
1497
|
)
|
|
@@ -1527,14 +1499,14 @@ function Ft({
|
|
|
1527
1499
|
) : null;
|
|
1528
1500
|
}
|
|
1529
1501
|
export {
|
|
1530
|
-
|
|
1502
|
+
Ft as Attachment,
|
|
1531
1503
|
Tt as Checkbox,
|
|
1532
1504
|
Et as DatePicker,
|
|
1533
|
-
|
|
1534
|
-
|
|
1505
|
+
Vt as Input,
|
|
1506
|
+
It as Modal,
|
|
1535
1507
|
jt as RadioBtn,
|
|
1536
|
-
|
|
1537
|
-
|
|
1508
|
+
Dt as Select,
|
|
1509
|
+
Lt as SimpleTable,
|
|
1538
1510
|
Ht as StatusBadge,
|
|
1539
1511
|
Ct as TextArea
|
|
1540
1512
|
};
|