@archbase/template 3.0.22 → 3.0.25
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/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { Button as We, Paper as
|
|
3
|
-
import { useForceUpdate as
|
|
4
|
-
import { IconBug as
|
|
5
|
-
import { useArchbaseAppContext as
|
|
6
|
-
import
|
|
7
|
-
import { useArchbaseV1V2Compatibility as
|
|
8
|
-
import { ArchbaseAlert as
|
|
9
|
-
import { ArchbaseSpaceFixed as
|
|
10
|
-
import { ArchbaseQueryBuilder as
|
|
11
|
-
import
|
|
12
|
-
import { uniqueId as
|
|
13
|
-
const
|
|
1
|
+
import { jsx as e, Fragment as Me, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { Button as We, Paper as Le, Box as he, Flex as pe, Group as oe, ActionIcon as pt, Title as Tt, Text as ye, ScrollArea as Xe, LoadingOverlay as vt, useMantineColorScheme as lt, Modal as Ct, px as Mt, Grid as be, Pagination as kt, Stack as yt, Tabs as rt, Badge as Ut } from "@mantine/core";
|
|
3
|
+
import { useForceUpdate as ot, useUncontrolled as Ht, useHotkeys as _t } from "@mantine/hooks";
|
|
4
|
+
import { IconArrowLeft as Bt, IconBug as Oe, IconDeviceFloppy as xt, IconX as Be, IconCheck as Ye, IconPlus as bt, IconEdit as wt, IconTrash as tt, IconEye as Ft } from "@tabler/icons-react";
|
|
5
|
+
import { useArchbaseAppContext as ze, useValidationErrors as Nt, ValidationErrorsProvider as At, getI18nextInstance as x, processErrorMessage as fe, useArchbaseTheme as at, emit as qt, useArchbaseTranslation as Jt } from "@archbase/core";
|
|
6
|
+
import Ze, { useMemo as He, useState as Q, useCallback as ie, forwardRef as Vt, useRef as Ae, useImperativeHandle as zt, useEffect as et, Fragment as Wt, Profiler as Ot, createContext as Kt, useContext as Pt } from "react";
|
|
7
|
+
import { useArchbaseV1V2Compatibility as _e, useArchbaseDataSourceListener as nt, DataSourceEventNames as Re, ArchbaseDataSource as Qt } from "@archbase/data";
|
|
8
|
+
import { ArchbaseAlert as Ke, ArchbaseDialog as Rt, ArchbaseDataGrid as Gt, GridToolBarActions as Xt, ArchbaseDebugInspector as Yt, ArchbaseMasonryProvider as Zt, ArchbaseMasonryResponsive as en, ArchbaseMasonry as tn, ArchbaseActionButtons as nn } from "@archbase/components";
|
|
9
|
+
import { ArchbaseSpaceFixed as ct, ArchbaseSpaceTop as Et, ArchbaseSpaceFill as st, ArchbaseForm as $t, ArchbaseSpaceBottom as dt } from "@archbase/layout";
|
|
10
|
+
import { ArchbaseQueryBuilder as St, buildFrom as rn, ArchbaseGlobalFilter as ln } from "@archbase/advanced";
|
|
11
|
+
import it from "@rehooks/component-size";
|
|
12
|
+
import { uniqueId as on } from "lodash";
|
|
13
|
+
const an = {
|
|
14
14
|
isAvailable: !1,
|
|
15
15
|
hasPermission: () => !0,
|
|
16
16
|
// Default: sempre permite
|
|
@@ -21,454 +21,533 @@ const tn = {
|
|
|
21
21
|
canEdit: !0,
|
|
22
22
|
canDelete: !0,
|
|
23
23
|
canView: !0
|
|
24
|
-
},
|
|
25
|
-
function
|
|
24
|
+
}, Pe = (t) => He(() => an, []), Sn = () => !1;
|
|
25
|
+
function In(t) {
|
|
26
26
|
const {
|
|
27
27
|
onSelect: n,
|
|
28
|
-
onSelectMultiple:
|
|
28
|
+
onSelectMultiple: o,
|
|
29
29
|
initialValue: f = null,
|
|
30
30
|
initialValues: r = [],
|
|
31
31
|
selectionMode: i = "single",
|
|
32
|
-
autoClose:
|
|
33
|
-
onOpen:
|
|
34
|
-
onClose:
|
|
35
|
-
} = t || {}, [
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, [
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
(
|
|
43
|
-
|
|
32
|
+
autoClose: u = !0,
|
|
33
|
+
onOpen: v,
|
|
34
|
+
onClose: a
|
|
35
|
+
} = t || {}, [C, P] = Q(!1), [l, s] = Q(f), [L, I] = Q(r), w = ie(() => {
|
|
36
|
+
P(!0), v?.();
|
|
37
|
+
}, [v]), R = ie(() => {
|
|
38
|
+
P(!1), a?.();
|
|
39
|
+
}, [a]), m = ie(() => {
|
|
40
|
+
s(null), I([]);
|
|
41
|
+
}, []), D = ie(
|
|
42
|
+
(h) => {
|
|
43
|
+
s(h), I([h]), n?.(h), u && (P(!1), a?.());
|
|
44
44
|
},
|
|
45
|
-
[n,
|
|
46
|
-
),
|
|
47
|
-
(
|
|
48
|
-
|
|
45
|
+
[n, u, a]
|
|
46
|
+
), N = ie(
|
|
47
|
+
(h) => {
|
|
48
|
+
I(h), s(h.length > 0 ? h[0] : null), o?.(h), u && (P(!1), a?.());
|
|
49
49
|
},
|
|
50
|
-
[
|
|
51
|
-
),
|
|
52
|
-
|
|
53
|
-
}, [
|
|
50
|
+
[o, u, a]
|
|
51
|
+
), V = ie(() => {
|
|
52
|
+
P(!1), a?.();
|
|
53
|
+
}, [a]), F = He(
|
|
54
54
|
() => ({
|
|
55
|
-
opened:
|
|
56
|
-
onClose:
|
|
57
|
-
onSelect:
|
|
58
|
-
onSelectMultiple:
|
|
55
|
+
opened: C,
|
|
56
|
+
onClose: V,
|
|
57
|
+
onSelect: D,
|
|
58
|
+
onSelectMultiple: N,
|
|
59
59
|
selectionMode: i,
|
|
60
|
-
initialSelectedItems: i === "multiple" ?
|
|
60
|
+
initialSelectedItems: i === "multiple" ? L : l ? [l] : void 0
|
|
61
61
|
}),
|
|
62
|
-
[
|
|
62
|
+
[C, V, D, N, i, l, L]
|
|
63
63
|
);
|
|
64
64
|
return {
|
|
65
65
|
// Estado
|
|
66
|
-
opened:
|
|
67
|
-
selectedItem:
|
|
68
|
-
selectedItems:
|
|
66
|
+
opened: C,
|
|
67
|
+
selectedItem: l,
|
|
68
|
+
selectedItems: L,
|
|
69
69
|
// Ações
|
|
70
|
-
open:
|
|
71
|
-
close:
|
|
72
|
-
clear:
|
|
73
|
-
setSelectedItem:
|
|
74
|
-
setSelectedItems:
|
|
70
|
+
open: w,
|
|
71
|
+
close: R,
|
|
72
|
+
clear: m,
|
|
73
|
+
setSelectedItem: s,
|
|
74
|
+
setSelectedItems: I,
|
|
75
75
|
// Handlers
|
|
76
|
-
handleSelect:
|
|
77
|
-
handleSelectMultiple:
|
|
78
|
-
handleClose:
|
|
76
|
+
handleSelect: D,
|
|
77
|
+
handleSelectMultiple: N,
|
|
78
|
+
handleClose: V,
|
|
79
79
|
// Props para template
|
|
80
|
-
lookupProps:
|
|
80
|
+
lookupProps: F
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const J = ({
|
|
84
84
|
actionName: t,
|
|
85
85
|
actionDescription: n,
|
|
86
|
-
children:
|
|
86
|
+
children: o,
|
|
87
87
|
fallback: f = null,
|
|
88
88
|
autoRegister: r = !0,
|
|
89
89
|
onClick: i,
|
|
90
|
-
...
|
|
90
|
+
...u
|
|
91
91
|
}) => {
|
|
92
|
-
const
|
|
93
|
-
return
|
|
94
|
-
r && t && n &&
|
|
95
|
-
}, [t, n, r,
|
|
96
|
-
},
|
|
92
|
+
const v = Pe();
|
|
93
|
+
return Ze.useEffect(() => {
|
|
94
|
+
r && t && n && v.isAvailable && v.registerAction();
|
|
95
|
+
}, [t, n, r, v.isAvailable, v.registerAction]), !t || !v.isAvailable ? /* @__PURE__ */ e(We, { onClick: i, ...u, children: o }) : v.hasPermission() ? /* @__PURE__ */ e(We, { onClick: i, ...u, children: o }) : /* @__PURE__ */ e(Me, { children: f });
|
|
96
|
+
}, Dn = ({
|
|
97
97
|
actionName: t,
|
|
98
98
|
actionDescription: n,
|
|
99
|
-
children:
|
|
99
|
+
children: o,
|
|
100
100
|
fallback: f = null,
|
|
101
101
|
onClick: r,
|
|
102
102
|
...i
|
|
103
103
|
}) => {
|
|
104
|
-
const [
|
|
105
|
-
return
|
|
104
|
+
const [u, v] = Ze.useState(null), [a, C] = Ze.useState(!1);
|
|
105
|
+
return Ze.useEffect(() => {
|
|
106
106
|
if (!t) {
|
|
107
|
-
|
|
107
|
+
v(/* @__PURE__ */ e(We, { onClick: r, ...i, children: o }));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
|
|
111
|
-
}, [t, n,
|
|
112
|
-
},
|
|
110
|
+
C(!1), v(/* @__PURE__ */ e(We, { onClick: r, ...i, children: o }));
|
|
111
|
+
}, [t, n, o, f, i]), /* @__PURE__ */ e(Me, { children: u });
|
|
112
|
+
}, Ge = ({
|
|
113
113
|
children: t
|
|
114
|
-
}) => /* @__PURE__ */ e(
|
|
114
|
+
}) => /* @__PURE__ */ e(Me, { children: t }), Tn = (t) => He(() => ({
|
|
115
115
|
shouldWrap: !1,
|
|
116
116
|
isSecurityAvailable: !1,
|
|
117
117
|
hasResourceName: !!t
|
|
118
118
|
}), [t]);
|
|
119
|
-
function
|
|
119
|
+
function kn({
|
|
120
120
|
innerRef: t,
|
|
121
121
|
title: n,
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
subtitle: o,
|
|
123
|
+
isError: f = !1,
|
|
124
|
+
isCanceling: r = !1,
|
|
125
|
+
isSaving: i = !1,
|
|
126
|
+
isLoading: u = !1,
|
|
127
|
+
error: v = "",
|
|
128
|
+
clearError: a = () => {
|
|
127
129
|
},
|
|
128
|
-
autoCloseAlertError:
|
|
129
|
-
width:
|
|
130
|
-
height:
|
|
131
|
-
withBorder:
|
|
132
|
-
children:
|
|
133
|
-
radius:
|
|
134
|
-
variant:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
130
|
+
autoCloseAlertError: C = 15e3,
|
|
131
|
+
width: P = "100%",
|
|
132
|
+
height: l = "100%",
|
|
133
|
+
withBorder: s = !0,
|
|
134
|
+
children: L,
|
|
135
|
+
radius: I,
|
|
136
|
+
variant: w,
|
|
137
|
+
buttonsPosition: R = "footer",
|
|
138
|
+
saveLabel: m,
|
|
139
|
+
cancelLabel: D,
|
|
140
|
+
onBack: N,
|
|
141
|
+
footerAlign: V = "left",
|
|
142
|
+
footerContent: F,
|
|
143
|
+
dataSource: h,
|
|
144
|
+
onSave: X,
|
|
145
|
+
onCancel: Z,
|
|
146
|
+
onBeforeSave: ae,
|
|
147
|
+
onAfterSave: W,
|
|
148
|
+
onBeforeCancel: G,
|
|
149
|
+
onAfterCancel: M,
|
|
150
|
+
onError: y,
|
|
151
|
+
routePath: U,
|
|
152
|
+
onBeforeClose: ee,
|
|
153
|
+
useNavigationListener: E,
|
|
145
154
|
// Props de segurança (opcionais)
|
|
146
|
-
resourceName:
|
|
147
|
-
resourceDescription:
|
|
148
|
-
requiredPermissions:
|
|
149
|
-
fallbackComponent:
|
|
150
|
-
securityOptions:
|
|
151
|
-
...
|
|
155
|
+
resourceName: te,
|
|
156
|
+
resourceDescription: se,
|
|
157
|
+
requiredPermissions: ne,
|
|
158
|
+
fallbackComponent: H,
|
|
159
|
+
securityOptions: z,
|
|
160
|
+
...Y
|
|
152
161
|
}) {
|
|
153
|
-
const
|
|
154
|
-
|
|
155
|
-
autoRegisterActions:
|
|
162
|
+
const O = ze(), [_, ue] = Q(f), [Ce, le] = Q(v), d = ot();
|
|
163
|
+
Pe({
|
|
164
|
+
autoRegisterActions: z?.autoRegisterActions ?? !0
|
|
156
165
|
});
|
|
157
|
-
const
|
|
166
|
+
const k = _e(
|
|
158
167
|
"ArchbaseFormTemplate",
|
|
159
|
-
|
|
168
|
+
h,
|
|
160
169
|
void 0,
|
|
161
170
|
void 0
|
|
162
171
|
);
|
|
163
172
|
nt({
|
|
164
|
-
dataSource:
|
|
165
|
-
listener: (
|
|
166
|
-
|
|
173
|
+
dataSource: h,
|
|
174
|
+
listener: (re) => {
|
|
175
|
+
re.type === Re.onError && (ue(!0), le(re.error)), (re.type === Re.afterEdit || re.type === Re.afterInsert) && (k.isDataSourceV2 || d());
|
|
167
176
|
}
|
|
168
177
|
});
|
|
169
|
-
const $ =
|
|
178
|
+
const $ = Nt(), we = ie((re, S) => ({
|
|
179
|
+
closeAllowed: ($e) => {
|
|
180
|
+
}
|
|
181
|
+
}), []), de = E || we, { closeAllowed: B } = de(U || "", () => {
|
|
182
|
+
ee && ee() === !1 || B();
|
|
183
|
+
}), me = async (re) => {
|
|
170
184
|
try {
|
|
171
|
-
|
|
172
|
-
$?.clearAll(),
|
|
173
|
-
}).catch((
|
|
174
|
-
|
|
185
|
+
X ? X(re) : (ae && await ae(re), h.isBrowsing() || h.save().then(() => {
|
|
186
|
+
$?.clearAll(), W && W(re), E && B();
|
|
187
|
+
}).catch((S) => {
|
|
188
|
+
y && y(fe(S)), ue(!0), le(fe(S));
|
|
175
189
|
}));
|
|
176
|
-
} catch (
|
|
177
|
-
|
|
190
|
+
} catch (S) {
|
|
191
|
+
y && y(fe(S)), ue(!0), le(fe(S));
|
|
178
192
|
}
|
|
179
|
-
},
|
|
193
|
+
}, xe = () => {
|
|
180
194
|
try {
|
|
181
|
-
|
|
182
|
-
} catch (
|
|
183
|
-
|
|
195
|
+
Z ? Z.length > 0 ? Z(B) : Z() : (G && G(), h.isBrowsing() || h.cancel(), $?.clearAll(), M && M(), E && B());
|
|
196
|
+
} catch (re) {
|
|
197
|
+
y && y(fe(re)), ue(!0), le(fe(re));
|
|
184
198
|
}
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
}
|
|
199
|
+
}, Fe = () => {
|
|
200
|
+
a && a(), ue(!1), le("");
|
|
201
|
+
}, Ie = h && !h.isBrowsing(), A = R === "header" || R === "both", ce = R === "footer" || R === "both", Ne = () => /* @__PURE__ */ e(oe, { gap: "sm", children: Ie ? /* @__PURE__ */ c(Me, { children: [
|
|
202
|
+
/* @__PURE__ */ e(
|
|
203
|
+
J,
|
|
204
|
+
{
|
|
205
|
+
actionName: "cancel",
|
|
206
|
+
actionDescription: "Cancelar operação",
|
|
207
|
+
leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
208
|
+
onClick: xe,
|
|
209
|
+
variant: "default",
|
|
210
|
+
loading: r,
|
|
211
|
+
children: D || x().t("Cancel")
|
|
212
|
+
}
|
|
213
|
+
),
|
|
214
|
+
/* @__PURE__ */ e(
|
|
215
|
+
J,
|
|
216
|
+
{
|
|
217
|
+
actionName: "save",
|
|
218
|
+
actionDescription: `Salvar ${se || "registro"}`,
|
|
219
|
+
leftSection: /* @__PURE__ */ e(xt, { size: 16 }),
|
|
220
|
+
onClick: () => me(h.getCurrentRecord()),
|
|
221
|
+
variant: w ?? O.variant,
|
|
222
|
+
color: "blue",
|
|
223
|
+
loading: i,
|
|
224
|
+
children: m || x().t("Ok")
|
|
225
|
+
}
|
|
226
|
+
)
|
|
227
|
+
] }) : /* @__PURE__ */ e(
|
|
228
|
+
J,
|
|
229
|
+
{
|
|
230
|
+
actionName: "close",
|
|
231
|
+
actionDescription: "Fechar formulário",
|
|
232
|
+
leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
233
|
+
onClick: xe,
|
|
234
|
+
variant: "default",
|
|
235
|
+
children: x().t("Close")
|
|
236
|
+
}
|
|
237
|
+
) }), De = () => /* @__PURE__ */ c(
|
|
238
|
+
he,
|
|
239
|
+
{
|
|
240
|
+
style: {
|
|
241
|
+
flexShrink: 0,
|
|
242
|
+
padding: "calc(0.625rem / 2)",
|
|
243
|
+
display: "flex",
|
|
244
|
+
justifyContent: V === "center" ? "center" : "space-between",
|
|
245
|
+
alignItems: "center",
|
|
246
|
+
gap: "1rem"
|
|
247
|
+
},
|
|
248
|
+
children: [
|
|
249
|
+
V === "right" && F && /* @__PURE__ */ e(he, { style: { flex: 1 }, children: F }),
|
|
250
|
+
Ie ? /* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
251
|
+
/* @__PURE__ */ e(
|
|
252
|
+
J,
|
|
253
|
+
{
|
|
254
|
+
actionName: "save",
|
|
255
|
+
actionDescription: `Salvar ${se || "registro"}`,
|
|
256
|
+
leftSection: /* @__PURE__ */ e(xt, {}),
|
|
257
|
+
onClick: () => me(h.getCurrentRecord()),
|
|
258
|
+
disabled: h && h.isBrowsing(),
|
|
259
|
+
variant: w ?? O.variant,
|
|
260
|
+
color: "green",
|
|
261
|
+
children: m || `${x().t("Ok")}`
|
|
262
|
+
}
|
|
263
|
+
),
|
|
264
|
+
/* @__PURE__ */ e(
|
|
265
|
+
J,
|
|
266
|
+
{
|
|
267
|
+
actionName: "cancel",
|
|
268
|
+
actionDescription: "Cancelar operação",
|
|
269
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
270
|
+
onClick: xe,
|
|
271
|
+
disabled: h && h.isBrowsing(),
|
|
272
|
+
variant: w ?? O.variant,
|
|
273
|
+
color: "red",
|
|
274
|
+
children: D || `${x().t("Cancel")}`
|
|
275
|
+
}
|
|
276
|
+
)
|
|
277
|
+
] }) : /* @__PURE__ */ e(oe, { gap: "md", children: /* @__PURE__ */ e(
|
|
278
|
+
J,
|
|
279
|
+
{
|
|
280
|
+
actionName: "close",
|
|
281
|
+
actionDescription: "Fechar formulário",
|
|
282
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
283
|
+
onClick: xe,
|
|
284
|
+
variant: w ?? O.variant,
|
|
285
|
+
children: `${x().t("Close")}`
|
|
286
|
+
}
|
|
287
|
+
) }),
|
|
288
|
+
(V === "left" || V === "center") && F && /* @__PURE__ */ e(he, { style: { flex: V === "left" ? 1 : 0, textAlign: "right" }, children: F })
|
|
289
|
+
]
|
|
290
|
+
}
|
|
291
|
+
);
|
|
188
292
|
return /* @__PURE__ */ e(
|
|
189
|
-
|
|
293
|
+
Ge,
|
|
190
294
|
{
|
|
191
|
-
resourceName:
|
|
192
|
-
resourceDescription:
|
|
193
|
-
requiredPermissions:
|
|
194
|
-
fallbackComponent:
|
|
195
|
-
onSecurityReady:
|
|
196
|
-
onAccessDenied:
|
|
197
|
-
children: /* @__PURE__ */ e(
|
|
198
|
-
|
|
295
|
+
resourceName: te,
|
|
296
|
+
resourceDescription: se,
|
|
297
|
+
requiredPermissions: ne,
|
|
298
|
+
fallbackComponent: H,
|
|
299
|
+
onSecurityReady: z?.onSecurityReady,
|
|
300
|
+
onAccessDenied: z?.onAccessDenied,
|
|
301
|
+
children: /* @__PURE__ */ e(At, { children: /* @__PURE__ */ c(
|
|
302
|
+
Le,
|
|
199
303
|
{
|
|
200
304
|
ref: t,
|
|
201
|
-
withBorder:
|
|
202
|
-
radius:
|
|
305
|
+
withBorder: s,
|
|
306
|
+
radius: I,
|
|
203
307
|
style: {
|
|
204
|
-
width:
|
|
205
|
-
height:
|
|
308
|
+
width: P,
|
|
309
|
+
height: l,
|
|
206
310
|
display: "flex",
|
|
207
311
|
flexDirection: "column",
|
|
208
|
-
padding: 4
|
|
312
|
+
padding: A ? 0 : 4
|
|
209
313
|
},
|
|
210
314
|
children: [
|
|
211
|
-
|
|
212
|
-
|
|
315
|
+
A && /* @__PURE__ */ e(
|
|
316
|
+
he,
|
|
317
|
+
{
|
|
318
|
+
style: {
|
|
319
|
+
flexShrink: 0,
|
|
320
|
+
padding: "16px 24px",
|
|
321
|
+
borderBottom: "1px solid var(--mantine-color-gray-2)"
|
|
322
|
+
},
|
|
323
|
+
children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
|
|
324
|
+
/* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
325
|
+
N && /* @__PURE__ */ e(
|
|
326
|
+
pt,
|
|
327
|
+
{
|
|
328
|
+
variant: "subtle",
|
|
329
|
+
color: "gray",
|
|
330
|
+
size: "lg",
|
|
331
|
+
onClick: N,
|
|
332
|
+
style: { border: "1px solid var(--mantine-color-gray-3)" },
|
|
333
|
+
children: /* @__PURE__ */ e(Bt, { size: 18 })
|
|
334
|
+
}
|
|
335
|
+
),
|
|
336
|
+
(n || o) && /* @__PURE__ */ c(he, { children: [
|
|
337
|
+
n && /* @__PURE__ */ e(Tt, { order: 4, fw: 600, children: n }),
|
|
338
|
+
o && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", children: o })
|
|
339
|
+
] })
|
|
340
|
+
] }),
|
|
341
|
+
Ne()
|
|
342
|
+
] })
|
|
343
|
+
}
|
|
344
|
+
),
|
|
345
|
+
_ && /* @__PURE__ */ e(he, { style: { flexShrink: 0, padding: A ? "16px 24px 0" : void 0 }, children: /* @__PURE__ */ e(
|
|
346
|
+
Ke,
|
|
213
347
|
{
|
|
214
|
-
autoClose:
|
|
348
|
+
autoClose: C,
|
|
215
349
|
withCloseButton: !0,
|
|
216
350
|
withBorder: !0,
|
|
217
|
-
icon: /* @__PURE__ */ e(
|
|
218
|
-
title:
|
|
351
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
352
|
+
title: x().t("WARNING"),
|
|
219
353
|
titleColor: "rgb(250, 82, 82)",
|
|
220
|
-
variant:
|
|
221
|
-
onClose:
|
|
222
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
354
|
+
variant: w ?? O.variant,
|
|
355
|
+
onClose: Fe,
|
|
356
|
+
children: /* @__PURE__ */ e("span", { children: Ce })
|
|
223
357
|
}
|
|
224
358
|
) }),
|
|
225
|
-
/* @__PURE__ */
|
|
226
|
-
|
|
359
|
+
/* @__PURE__ */ c(
|
|
360
|
+
Xe,
|
|
227
361
|
{
|
|
228
362
|
style: {
|
|
229
363
|
flex: 1,
|
|
230
364
|
minHeight: 0,
|
|
231
|
-
|
|
232
|
-
padding: "calc(0.625rem / 2)"
|
|
365
|
+
padding: A ? "24px" : "calc(0.625rem / 2)"
|
|
233
366
|
},
|
|
234
367
|
children: [
|
|
235
|
-
/* @__PURE__ */ e(
|
|
236
|
-
|
|
368
|
+
/* @__PURE__ */ e(vt, { visible: u || r || i, opacity: 0.3 }),
|
|
369
|
+
L
|
|
237
370
|
]
|
|
238
371
|
}
|
|
239
372
|
),
|
|
240
|
-
|
|
241
|
-
Xe,
|
|
242
|
-
{
|
|
243
|
-
style: {
|
|
244
|
-
flexShrink: 0,
|
|
245
|
-
padding: "calc(0.625rem / 2)",
|
|
246
|
-
display: "flex",
|
|
247
|
-
justifyContent: w === "center" ? "center" : "space-between",
|
|
248
|
-
alignItems: "center",
|
|
249
|
-
gap: "1rem"
|
|
250
|
-
},
|
|
251
|
-
children: [
|
|
252
|
-
w === "right" && E && /* @__PURE__ */ e(Xe, { style: { flex: 1 }, children: E }),
|
|
253
|
-
g && !g.isBrowsing() ? /* @__PURE__ */ x(se, { gap: "md", children: [
|
|
254
|
-
/* @__PURE__ */ e(
|
|
255
|
-
ee,
|
|
256
|
-
{
|
|
257
|
-
actionName: "save",
|
|
258
|
-
actionDescription: `Salvar ${te || "registro"}`,
|
|
259
|
-
leftSection: /* @__PURE__ */ e(zt, {}),
|
|
260
|
-
onClick: () => _(g.getCurrentRecord()),
|
|
261
|
-
disabled: g && g.isBrowsing(),
|
|
262
|
-
variant: S ?? T.variant,
|
|
263
|
-
color: "green",
|
|
264
|
-
children: `${C().t("Ok")}`
|
|
265
|
-
}
|
|
266
|
-
),
|
|
267
|
-
/* @__PURE__ */ e(
|
|
268
|
-
ee,
|
|
269
|
-
{
|
|
270
|
-
actionName: "cancel",
|
|
271
|
-
actionDescription: "Cancelar operação",
|
|
272
|
-
leftSection: /* @__PURE__ */ e(Pe, {}),
|
|
273
|
-
onClick: re,
|
|
274
|
-
disabled: g && g.isBrowsing(),
|
|
275
|
-
variant: S ?? T.variant,
|
|
276
|
-
color: "red",
|
|
277
|
-
children: `${C().t("Cancel")}`
|
|
278
|
-
}
|
|
279
|
-
)
|
|
280
|
-
] }) : /* @__PURE__ */ e(se, { gap: "md", children: /* @__PURE__ */ e(
|
|
281
|
-
ee,
|
|
282
|
-
{
|
|
283
|
-
actionName: "close",
|
|
284
|
-
actionDescription: "Fechar formulário",
|
|
285
|
-
leftSection: /* @__PURE__ */ e(Pe, {}),
|
|
286
|
-
onClick: re,
|
|
287
|
-
variant: S ?? T.variant,
|
|
288
|
-
children: `${C().t("Close")}`
|
|
289
|
-
}
|
|
290
|
-
) }),
|
|
291
|
-
(w === "left" || w === "center") && E && /* @__PURE__ */ e(Xe, { style: { flex: w === "left" ? 1 : 0, textAlign: "right" }, children: E })
|
|
292
|
-
]
|
|
293
|
-
}
|
|
294
|
-
)
|
|
373
|
+
ce && De()
|
|
295
374
|
]
|
|
296
375
|
}
|
|
297
376
|
) })
|
|
298
377
|
}
|
|
299
378
|
);
|
|
300
379
|
}
|
|
301
|
-
function
|
|
380
|
+
function Bn({
|
|
302
381
|
title: t,
|
|
303
382
|
withOverlay: n = !0,
|
|
304
|
-
overlayProps:
|
|
383
|
+
overlayProps: o,
|
|
305
384
|
children: f,
|
|
306
385
|
withCloseButton: r = !0,
|
|
307
386
|
closeButtonProps: i,
|
|
308
|
-
opened:
|
|
309
|
-
fullScreen:
|
|
310
|
-
centered:
|
|
311
|
-
variant:
|
|
312
|
-
closeOnEscape:
|
|
313
|
-
size:
|
|
314
|
-
dataSource:
|
|
315
|
-
height:
|
|
316
|
-
userActions:
|
|
317
|
-
onAfterSave:
|
|
318
|
-
onClickOk:
|
|
319
|
-
onClickCancel:
|
|
320
|
-
onBeforeOk:
|
|
321
|
-
onCustomSave:
|
|
322
|
-
isError:
|
|
323
|
-
error:
|
|
324
|
-
clearError:
|
|
387
|
+
opened: u,
|
|
388
|
+
fullScreen: v,
|
|
389
|
+
centered: a,
|
|
390
|
+
variant: C,
|
|
391
|
+
closeOnEscape: P = !0,
|
|
392
|
+
size: l,
|
|
393
|
+
dataSource: s,
|
|
394
|
+
height: L,
|
|
395
|
+
userActions: I,
|
|
396
|
+
onAfterSave: w,
|
|
397
|
+
onClickOk: R,
|
|
398
|
+
onClickCancel: m,
|
|
399
|
+
onBeforeOk: D,
|
|
400
|
+
onCustomSave: N,
|
|
401
|
+
isError: V,
|
|
402
|
+
error: F = "",
|
|
403
|
+
clearError: h = () => {
|
|
325
404
|
},
|
|
326
|
-
onError:
|
|
327
|
-
autoCloseAlertError:
|
|
328
|
-
loadingOverlayStyles:
|
|
405
|
+
onError: X,
|
|
406
|
+
autoCloseAlertError: Z = 15e3,
|
|
407
|
+
loadingOverlayStyles: ae,
|
|
329
408
|
// Props de segurança (opcionais)
|
|
330
|
-
resourceName:
|
|
331
|
-
resourceDescription:
|
|
332
|
-
requiredPermissions:
|
|
333
|
-
fallbackComponent:
|
|
334
|
-
securityOptions:
|
|
335
|
-
...
|
|
409
|
+
resourceName: W,
|
|
410
|
+
resourceDescription: G,
|
|
411
|
+
requiredPermissions: M,
|
|
412
|
+
fallbackComponent: y,
|
|
413
|
+
securityOptions: U,
|
|
414
|
+
...ee
|
|
336
415
|
}) {
|
|
337
|
-
const
|
|
338
|
-
|
|
339
|
-
resourceDescription:
|
|
340
|
-
autoRegisterActions:
|
|
416
|
+
const E = ze(), te = at(), { colorScheme: se } = lt(), [ne, H] = Q(V), [z, Y] = Q(F), [O, _] = Q(!1), ue = ot();
|
|
417
|
+
Pe({
|
|
418
|
+
resourceDescription: G || t?.toString(),
|
|
419
|
+
autoRegisterActions: U?.autoRegisterActions ?? !0
|
|
341
420
|
});
|
|
342
|
-
const
|
|
421
|
+
const Ce = _e(
|
|
343
422
|
"ArchbaseFormModalTemplate",
|
|
344
|
-
|
|
423
|
+
s,
|
|
345
424
|
void 0,
|
|
346
425
|
void 0
|
|
347
426
|
);
|
|
348
427
|
nt({
|
|
349
|
-
dataSource:
|
|
350
|
-
listener: (
|
|
351
|
-
|
|
428
|
+
dataSource: s,
|
|
429
|
+
listener: (B) => {
|
|
430
|
+
B.type === Re.onError && (H(!0), Y(B.error)), (B.type === Re.afterEdit || B.type === Re.afterInsert) && (Ce.isDataSourceV2 || ue());
|
|
352
431
|
}
|
|
353
432
|
});
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
433
|
+
const le = async () => {
|
|
434
|
+
if (s && !s.isBrowsing())
|
|
356
435
|
try {
|
|
357
|
-
|
|
358
|
-
} catch (
|
|
359
|
-
return
|
|
436
|
+
_(!0), await s.save(), w && w(s.getCurrentRecord());
|
|
437
|
+
} catch (B) {
|
|
438
|
+
return X && X(fe(B)), H(!0), Y(fe(B)), _(!1), !1;
|
|
360
439
|
}
|
|
361
|
-
return
|
|
362
|
-
},
|
|
363
|
-
if (
|
|
440
|
+
return _(!1), !0;
|
|
441
|
+
}, d = () => {
|
|
442
|
+
if (s && !s.isBrowsing())
|
|
364
443
|
try {
|
|
365
|
-
|
|
444
|
+
s.cancel();
|
|
366
445
|
} catch {
|
|
367
446
|
}
|
|
368
|
-
},
|
|
369
|
-
if (
|
|
370
|
-
|
|
371
|
-
|
|
447
|
+
}, k = async () => {
|
|
448
|
+
if (N)
|
|
449
|
+
s && N(s.getCurrentRecord(), () => {
|
|
450
|
+
R && R();
|
|
372
451
|
});
|
|
373
|
-
else if (
|
|
374
|
-
const
|
|
375
|
-
|
|
376
|
-
await
|
|
377
|
-
}).catch((
|
|
378
|
-
|
|
452
|
+
else if (D) {
|
|
453
|
+
const B = D(s.getCurrentRecord());
|
|
454
|
+
B instanceof Promise && B.then(async () => {
|
|
455
|
+
await le() && R && R();
|
|
456
|
+
}).catch((me) => {
|
|
457
|
+
X && X(fe(me)), H(!0), Y(fe(me));
|
|
379
458
|
});
|
|
380
459
|
} else
|
|
381
|
-
await
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
},
|
|
385
|
-
|
|
386
|
-
},
|
|
387
|
-
|
|
460
|
+
await le() && R && R();
|
|
461
|
+
}, $ = () => {
|
|
462
|
+
d(), m && m();
|
|
463
|
+
}, we = () => {
|
|
464
|
+
Rt.showWarning(x().t("archbase:Click on Ok or Cancel to close"));
|
|
465
|
+
}, de = () => {
|
|
466
|
+
h && h(), H(!1), Y("");
|
|
388
467
|
};
|
|
389
468
|
return /* @__PURE__ */ e(
|
|
390
|
-
|
|
469
|
+
Ge,
|
|
391
470
|
{
|
|
392
|
-
resourceName:
|
|
393
|
-
resourceDescription:
|
|
394
|
-
requiredPermissions:
|
|
395
|
-
fallbackComponent:
|
|
396
|
-
onSecurityReady:
|
|
397
|
-
onAccessDenied:
|
|
471
|
+
resourceName: W,
|
|
472
|
+
resourceDescription: G,
|
|
473
|
+
requiredPermissions: M,
|
|
474
|
+
fallbackComponent: y,
|
|
475
|
+
onSecurityReady: U?.onSecurityReady,
|
|
476
|
+
onAccessDenied: U?.onAccessDenied,
|
|
398
477
|
children: /* @__PURE__ */ e(
|
|
399
|
-
|
|
478
|
+
Ct,
|
|
400
479
|
{
|
|
401
480
|
title: t,
|
|
402
481
|
withOverlay: n,
|
|
403
|
-
overlayProps:
|
|
404
|
-
color:
|
|
482
|
+
overlayProps: o || {
|
|
483
|
+
color: se === "dark" ? te.colors.dark[7] : te.colors.gray[6],
|
|
405
484
|
opacity: 0.25
|
|
406
485
|
},
|
|
407
486
|
withCloseButton: r,
|
|
408
487
|
closeButtonProps: i,
|
|
409
|
-
onClose:
|
|
410
|
-
opened:
|
|
411
|
-
fullScreen:
|
|
412
|
-
centered:
|
|
413
|
-
closeOnEscape:
|
|
414
|
-
size:
|
|
415
|
-
...
|
|
416
|
-
children: /* @__PURE__ */
|
|
417
|
-
/* @__PURE__ */ e(
|
|
418
|
-
/* @__PURE__ */
|
|
419
|
-
|
|
420
|
-
|
|
488
|
+
onClose: we,
|
|
489
|
+
opened: u,
|
|
490
|
+
fullScreen: v,
|
|
491
|
+
centered: a,
|
|
492
|
+
closeOnEscape: P,
|
|
493
|
+
size: l,
|
|
494
|
+
...ee,
|
|
495
|
+
children: /* @__PURE__ */ c(At, { children: [
|
|
496
|
+
/* @__PURE__ */ e(vt, { styles: ae, visible: O, opacity: 0.8 }),
|
|
497
|
+
/* @__PURE__ */ c(ct, { height: L, children: [
|
|
498
|
+
ne ? /* @__PURE__ */ e(Et, { size: "100px", children: /* @__PURE__ */ e(
|
|
499
|
+
Ke,
|
|
421
500
|
{
|
|
422
|
-
autoClose:
|
|
501
|
+
autoClose: Z,
|
|
423
502
|
withCloseButton: !0,
|
|
424
503
|
withBorder: !0,
|
|
425
|
-
icon: /* @__PURE__ */ e(
|
|
426
|
-
title:
|
|
504
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
505
|
+
title: x().t("WARNING"),
|
|
427
506
|
titleColor: "rgb(250, 82, 82)",
|
|
428
|
-
variant:
|
|
429
|
-
onClose:
|
|
430
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
507
|
+
variant: C ?? E.variant,
|
|
508
|
+
onClose: de,
|
|
509
|
+
children: /* @__PURE__ */ e("span", { children: z })
|
|
431
510
|
}
|
|
432
511
|
) }) : null,
|
|
433
|
-
/* @__PURE__ */ e(
|
|
434
|
-
/* @__PURE__ */ e(
|
|
435
|
-
/* @__PURE__ */ e(
|
|
436
|
-
|
|
512
|
+
/* @__PURE__ */ e(st, { children: /* @__PURE__ */ e($t, { children: f }) }),
|
|
513
|
+
/* @__PURE__ */ e(dt, { size: "40px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
|
|
514
|
+
/* @__PURE__ */ e(oe, { children: I }),
|
|
515
|
+
s && !s.isBrowsing() ? /* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
437
516
|
/* @__PURE__ */ e(
|
|
438
|
-
|
|
517
|
+
J,
|
|
439
518
|
{
|
|
440
519
|
actionName: "save",
|
|
441
|
-
actionDescription: `Salvar ${
|
|
442
|
-
leftSection: /* @__PURE__ */ e(
|
|
443
|
-
onClick:
|
|
444
|
-
disabled:
|
|
445
|
-
variant:
|
|
520
|
+
actionDescription: `Salvar ${G || t || "registro"}`,
|
|
521
|
+
leftSection: /* @__PURE__ */ e(Ye, {}),
|
|
522
|
+
onClick: k,
|
|
523
|
+
disabled: s && s.isBrowsing(),
|
|
524
|
+
variant: C ?? E.variant,
|
|
446
525
|
color: "green",
|
|
447
|
-
children: `${
|
|
526
|
+
children: `${x().t("Ok")}`
|
|
448
527
|
}
|
|
449
528
|
),
|
|
450
529
|
/* @__PURE__ */ e(
|
|
451
|
-
|
|
530
|
+
J,
|
|
452
531
|
{
|
|
453
532
|
actionName: "cancel",
|
|
454
533
|
actionDescription: "Cancelar operação",
|
|
455
|
-
leftSection: /* @__PURE__ */ e(
|
|
456
|
-
onClick:
|
|
457
|
-
disabled:
|
|
458
|
-
variant:
|
|
534
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
535
|
+
onClick: $,
|
|
536
|
+
disabled: s && s.isBrowsing(),
|
|
537
|
+
variant: C ?? E.variant,
|
|
459
538
|
color: "red",
|
|
460
|
-
children: `${
|
|
539
|
+
children: `${x().t("Cancel")}`
|
|
461
540
|
}
|
|
462
541
|
)
|
|
463
|
-
] }) : /* @__PURE__ */ e(
|
|
464
|
-
|
|
542
|
+
] }) : /* @__PURE__ */ e(oe, { gap: "md", children: /* @__PURE__ */ e(
|
|
543
|
+
J,
|
|
465
544
|
{
|
|
466
545
|
actionName: "close",
|
|
467
546
|
actionDescription: "Fechar janela",
|
|
468
|
-
leftSection: /* @__PURE__ */ e(
|
|
469
|
-
onClick:
|
|
470
|
-
variant:
|
|
471
|
-
children: `${
|
|
547
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
548
|
+
onClick: $,
|
|
549
|
+
variant: C ?? E.variant,
|
|
550
|
+
children: `${x().t("Close")}`
|
|
472
551
|
}
|
|
473
552
|
) })
|
|
474
553
|
] }) })
|
|
@@ -479,96 +558,96 @@ function Sn({
|
|
|
479
558
|
}
|
|
480
559
|
);
|
|
481
560
|
}
|
|
482
|
-
function
|
|
561
|
+
function Nn({
|
|
483
562
|
title: t,
|
|
484
563
|
withOverlay: n = !0,
|
|
485
|
-
overlayProps:
|
|
564
|
+
overlayProps: o,
|
|
486
565
|
children: f,
|
|
487
566
|
withCloseButton: r = !0,
|
|
488
567
|
closeButtonProps: i,
|
|
489
|
-
opened:
|
|
490
|
-
fullScreen:
|
|
491
|
-
centered:
|
|
492
|
-
variant:
|
|
493
|
-
closeOnEscape:
|
|
494
|
-
size:
|
|
495
|
-
height:
|
|
496
|
-
onlyOkButton:
|
|
497
|
-
onClose:
|
|
498
|
-
onClickOk:
|
|
499
|
-
onClickCancel:
|
|
500
|
-
userActions:
|
|
568
|
+
opened: u,
|
|
569
|
+
fullScreen: v,
|
|
570
|
+
centered: a,
|
|
571
|
+
variant: C,
|
|
572
|
+
closeOnEscape: P = !0,
|
|
573
|
+
size: l,
|
|
574
|
+
height: s,
|
|
575
|
+
onlyOkButton: L = !1,
|
|
576
|
+
onClose: I,
|
|
577
|
+
onClickOk: w,
|
|
578
|
+
onClickCancel: R,
|
|
579
|
+
userActions: m,
|
|
501
580
|
// Props de segurança (opcionais)
|
|
502
|
-
resourceName:
|
|
503
|
-
resourceDescription:
|
|
504
|
-
requiredPermissions:
|
|
505
|
-
fallbackComponent:
|
|
506
|
-
securityOptions:
|
|
581
|
+
resourceName: D,
|
|
582
|
+
resourceDescription: N,
|
|
583
|
+
requiredPermissions: V,
|
|
584
|
+
fallbackComponent: F,
|
|
585
|
+
securityOptions: h
|
|
507
586
|
}) {
|
|
508
|
-
const
|
|
509
|
-
|
|
510
|
-
autoRegisterActions:
|
|
587
|
+
const X = ze(), Z = at(), { colorScheme: ae } = lt();
|
|
588
|
+
Pe({
|
|
589
|
+
autoRegisterActions: h?.autoRegisterActions ?? !0
|
|
511
590
|
});
|
|
512
|
-
const
|
|
513
|
-
|
|
591
|
+
const W = () => {
|
|
592
|
+
w && w(), I();
|
|
593
|
+
}, G = () => {
|
|
594
|
+
R && R(), I();
|
|
514
595
|
}, M = () => {
|
|
515
|
-
|
|
516
|
-
}, B = () => {
|
|
517
|
-
Ct.showWarning(C().t("Click on Ok or Cancel to close"));
|
|
596
|
+
Rt.showWarning(x().t("Click on Ok or Cancel to close"));
|
|
518
597
|
};
|
|
519
598
|
return /* @__PURE__ */ e(
|
|
520
|
-
|
|
599
|
+
Ge,
|
|
521
600
|
{
|
|
522
|
-
resourceName:
|
|
523
|
-
resourceDescription:
|
|
524
|
-
requiredPermissions:
|
|
525
|
-
fallbackComponent:
|
|
526
|
-
onSecurityReady:
|
|
527
|
-
onAccessDenied:
|
|
601
|
+
resourceName: D,
|
|
602
|
+
resourceDescription: N,
|
|
603
|
+
requiredPermissions: V,
|
|
604
|
+
fallbackComponent: F,
|
|
605
|
+
onSecurityReady: h?.onSecurityReady,
|
|
606
|
+
onAccessDenied: h?.onAccessDenied,
|
|
528
607
|
children: /* @__PURE__ */ e(
|
|
529
|
-
|
|
608
|
+
Ct,
|
|
530
609
|
{
|
|
531
610
|
title: t,
|
|
532
611
|
withOverlay: n,
|
|
533
|
-
overlayProps:
|
|
534
|
-
color:
|
|
612
|
+
overlayProps: o || {
|
|
613
|
+
color: ae === "dark" ? Z.colors.dark[7] : Z.colors.gray[6],
|
|
535
614
|
opacity: 0.25
|
|
536
615
|
},
|
|
537
616
|
withCloseButton: r,
|
|
538
617
|
closeButtonProps: i,
|
|
539
|
-
onClose:
|
|
540
|
-
opened:
|
|
541
|
-
fullScreen:
|
|
542
|
-
centered:
|
|
543
|
-
closeOnEscape:
|
|
544
|
-
size:
|
|
545
|
-
children: /* @__PURE__ */
|
|
546
|
-
/* @__PURE__ */ e(
|
|
547
|
-
/* @__PURE__ */ e(
|
|
548
|
-
/* @__PURE__ */ e(
|
|
549
|
-
/* @__PURE__ */
|
|
618
|
+
onClose: M,
|
|
619
|
+
opened: u,
|
|
620
|
+
fullScreen: v,
|
|
621
|
+
centered: a,
|
|
622
|
+
closeOnEscape: P,
|
|
623
|
+
size: l,
|
|
624
|
+
children: /* @__PURE__ */ c(ct, { height: s, children: [
|
|
625
|
+
/* @__PURE__ */ e(st, { children: /* @__PURE__ */ e($t, { children: f }) }),
|
|
626
|
+
/* @__PURE__ */ e(dt, { size: "40px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
|
|
627
|
+
/* @__PURE__ */ e(oe, { children: m }),
|
|
628
|
+
/* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
550
629
|
/* @__PURE__ */ e(
|
|
551
|
-
|
|
630
|
+
J,
|
|
552
631
|
{
|
|
553
632
|
actionName: "save",
|
|
554
|
-
actionDescription: `Salvar ${
|
|
555
|
-
leftSection: /* @__PURE__ */ e(
|
|
556
|
-
onClick:
|
|
557
|
-
variant:
|
|
633
|
+
actionDescription: `Salvar ${N || "registro"}`,
|
|
634
|
+
leftSection: /* @__PURE__ */ e(Ye, {}),
|
|
635
|
+
onClick: W,
|
|
636
|
+
variant: C ?? X.variant,
|
|
558
637
|
color: "green",
|
|
559
|
-
children: `${
|
|
638
|
+
children: `${x().t("Ok")}`
|
|
560
639
|
}
|
|
561
640
|
),
|
|
562
|
-
|
|
563
|
-
|
|
641
|
+
L ? null : /* @__PURE__ */ e(
|
|
642
|
+
J,
|
|
564
643
|
{
|
|
565
644
|
actionName: "cancel",
|
|
566
645
|
actionDescription: "Cancelar operação",
|
|
567
|
-
leftSection: /* @__PURE__ */ e(
|
|
568
|
-
onClick:
|
|
569
|
-
variant:
|
|
646
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
647
|
+
onClick: G,
|
|
648
|
+
variant: C ?? X.variant,
|
|
570
649
|
color: "red",
|
|
571
|
-
children:
|
|
650
|
+
children: R ? `${x().t("Cancel")}` : `${x().t("Close")}`
|
|
572
651
|
}
|
|
573
652
|
)
|
|
574
653
|
] })
|
|
@@ -579,10 +658,10 @@ function In({
|
|
|
579
658
|
}
|
|
580
659
|
);
|
|
581
660
|
}
|
|
582
|
-
const
|
|
661
|
+
const cn = (t, n, o) => {
|
|
583
662
|
if (!t || !n || !n.existsValue(`${t.viewName}_${t.componentName}`)) {
|
|
584
663
|
let f = -1, r;
|
|
585
|
-
return
|
|
664
|
+
return o && o.getFilters().length > 0 && (f = 0, r = JSON.parse(o.getFirstFilter()?.filter)), {
|
|
586
665
|
activeFilterIndex: f,
|
|
587
666
|
expandedFilter: !1,
|
|
588
667
|
currentFilter: r
|
|
@@ -590,319 +669,319 @@ const nn = (t, n, l) => {
|
|
|
590
669
|
}
|
|
591
670
|
return n.getValue(`${t.viewName}_${t.componentName}`);
|
|
592
671
|
};
|
|
593
|
-
function
|
|
672
|
+
function sn(t, n) {
|
|
594
673
|
const {
|
|
595
|
-
title:
|
|
674
|
+
title: o,
|
|
596
675
|
printTitle: f,
|
|
597
676
|
dataSource: r,
|
|
598
677
|
filterOptions: i,
|
|
599
|
-
pageSize:
|
|
600
|
-
pageIndex:
|
|
601
|
-
columns:
|
|
602
|
-
filterFields:
|
|
603
|
-
logoPrint:
|
|
604
|
-
userActions:
|
|
605
|
-
userRowActions:
|
|
606
|
-
customRenderRowActions:
|
|
607
|
-
innerRef:
|
|
608
|
-
isLoading:
|
|
609
|
-
isLoadingFilter:
|
|
610
|
-
isError:
|
|
611
|
-
enableTopToolbar:
|
|
612
|
-
enableTopToolbarActions:
|
|
613
|
-
error:
|
|
614
|
-
clearError:
|
|
678
|
+
pageSize: u = 15,
|
|
679
|
+
pageIndex: v = 0,
|
|
680
|
+
columns: a,
|
|
681
|
+
filterFields: C,
|
|
682
|
+
logoPrint: P,
|
|
683
|
+
userActions: l,
|
|
684
|
+
userRowActions: s,
|
|
685
|
+
customRenderRowActions: L,
|
|
686
|
+
innerRef: I,
|
|
687
|
+
isLoading: w = !1,
|
|
688
|
+
isLoadingFilter: R = !1,
|
|
689
|
+
isError: m = !1,
|
|
690
|
+
enableTopToolbar: D = !0,
|
|
691
|
+
enableTopToolbarActions: N = !0,
|
|
692
|
+
error: V = "",
|
|
693
|
+
clearError: F = () => {
|
|
615
694
|
},
|
|
616
|
-
filterType:
|
|
617
|
-
width:
|
|
618
|
-
height:
|
|
619
|
-
onSearchByFilter:
|
|
620
|
-
getRowId:
|
|
621
|
-
withBorder:
|
|
622
|
-
filterPersistenceDelegator:
|
|
623
|
-
variant:
|
|
624
|
-
store:
|
|
625
|
-
cellPadding:
|
|
626
|
-
bottomToolbarMinHeight:
|
|
627
|
-
enableRowSelection:
|
|
628
|
-
enableRowNumbers:
|
|
629
|
-
enableRowActions:
|
|
630
|
-
positionActionsColumn:
|
|
631
|
-
actionsColumnWidth:
|
|
632
|
-
tableHeadCellPadding:
|
|
633
|
-
renderDetailPanel:
|
|
634
|
-
renderTopToolbar:
|
|
635
|
-
toolbarAlignment:
|
|
636
|
-
toolbarLeftContent:
|
|
637
|
-
onSelectedRowsChanged:
|
|
638
|
-
onCellDoubleClick:
|
|
639
|
-
onFilterModelChange:
|
|
640
|
-
paginationLabels:
|
|
695
|
+
filterType: h,
|
|
696
|
+
width: X = "100%",
|
|
697
|
+
height: Z = "100%",
|
|
698
|
+
onSearchByFilter: ae,
|
|
699
|
+
getRowId: W,
|
|
700
|
+
withBorder: G = !0,
|
|
701
|
+
filterPersistenceDelegator: M,
|
|
702
|
+
variant: y,
|
|
703
|
+
store: U,
|
|
704
|
+
cellPadding: ee,
|
|
705
|
+
bottomToolbarMinHeight: E,
|
|
706
|
+
enableRowSelection: te = !0,
|
|
707
|
+
enableRowNumbers: se = !0,
|
|
708
|
+
enableRowActions: ne = !0,
|
|
709
|
+
positionActionsColumn: H = "first",
|
|
710
|
+
actionsColumnWidth: z,
|
|
711
|
+
tableHeadCellPadding: Y,
|
|
712
|
+
renderDetailPanel: O,
|
|
713
|
+
renderTopToolbar: _,
|
|
714
|
+
toolbarAlignment: ue = "right",
|
|
715
|
+
toolbarLeftContent: Ce,
|
|
716
|
+
onSelectedRowsChanged: le,
|
|
717
|
+
onCellDoubleClick: d,
|
|
718
|
+
onFilterModelChange: k,
|
|
719
|
+
paginationLabels: $,
|
|
641
720
|
// Props de segurança (opcionais)
|
|
642
|
-
resourceName:
|
|
643
|
-
resourceDescription:
|
|
644
|
-
requiredPermissions:
|
|
645
|
-
fallbackComponent:
|
|
646
|
-
securityOptions:
|
|
721
|
+
resourceName: we,
|
|
722
|
+
resourceDescription: de,
|
|
723
|
+
requiredPermissions: B,
|
|
724
|
+
fallbackComponent: me,
|
|
725
|
+
securityOptions: xe,
|
|
647
726
|
// Props para controle de bordas internas
|
|
648
|
-
withToolbarBorder:
|
|
649
|
-
withPaginationBorder:
|
|
650
|
-
toolbarPadding:
|
|
651
|
-
paginationPadding:
|
|
652
|
-
rowHeight:
|
|
653
|
-
hideFooter:
|
|
654
|
-
} = t,
|
|
655
|
-
|
|
656
|
-
const { colorScheme:
|
|
657
|
-
|
|
658
|
-
autoRegisterActions:
|
|
727
|
+
withToolbarBorder: Fe,
|
|
728
|
+
withPaginationBorder: Ie,
|
|
729
|
+
toolbarPadding: A,
|
|
730
|
+
paginationPadding: ce,
|
|
731
|
+
rowHeight: Ne,
|
|
732
|
+
hideFooter: De = !0
|
|
733
|
+
} = t, re = Ae(null), S = Ae(null);
|
|
734
|
+
at();
|
|
735
|
+
const { colorScheme: $e } = lt();
|
|
736
|
+
Pe({
|
|
737
|
+
autoRegisterActions: xe?.autoRegisterActions ?? !0
|
|
659
738
|
});
|
|
660
|
-
const
|
|
739
|
+
const Te = _e(
|
|
661
740
|
"ArchbaseGridTemplate",
|
|
662
741
|
r,
|
|
663
742
|
void 0,
|
|
664
743
|
void 0
|
|
665
744
|
);
|
|
666
|
-
|
|
745
|
+
zt(n, () => ({
|
|
667
746
|
refreshData: () => {
|
|
668
|
-
|
|
747
|
+
S.current && S.current.refreshData();
|
|
669
748
|
},
|
|
670
|
-
getSelectedRows: () =>
|
|
749
|
+
getSelectedRows: () => S.current ? S.current.getSelectedRows() : [],
|
|
671
750
|
clearSelection: () => {
|
|
672
|
-
|
|
751
|
+
S.current && S.current.clearSelection();
|
|
673
752
|
},
|
|
674
753
|
exportData: () => {
|
|
675
|
-
|
|
754
|
+
S.current && S.current.exportData();
|
|
676
755
|
},
|
|
677
756
|
printData: () => {
|
|
678
|
-
|
|
757
|
+
S.current && S.current.printData();
|
|
679
758
|
},
|
|
680
|
-
getDataGridRef: () =>
|
|
681
|
-
getFilterModel: () =>
|
|
682
|
-
}), [
|
|
683
|
-
const [
|
|
759
|
+
getDataGridRef: () => S,
|
|
760
|
+
getFilterModel: () => S.current ? S.current.getFilterModel() : { items: [], quickFilterValues: [] }
|
|
761
|
+
}), [S]);
|
|
762
|
+
const [g, j] = Q({
|
|
684
763
|
activeFilterIndex: -1,
|
|
685
764
|
currentFilter: void 0,
|
|
686
765
|
expandedFilter: !1
|
|
687
766
|
});
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
|
|
691
|
-
}, [
|
|
692
|
-
const
|
|
693
|
-
if (
|
|
694
|
-
return
|
|
695
|
-
if (!
|
|
767
|
+
et(() => {
|
|
768
|
+
const T = cn(i, U, M);
|
|
769
|
+
j(T);
|
|
770
|
+
}, [R]);
|
|
771
|
+
const q = (T) => {
|
|
772
|
+
if (L)
|
|
773
|
+
return L(T);
|
|
774
|
+
if (!s || !s.actions)
|
|
696
775
|
return;
|
|
697
|
-
const
|
|
776
|
+
const Se = s.actions;
|
|
698
777
|
return /* @__PURE__ */ e(
|
|
699
|
-
|
|
778
|
+
Se,
|
|
700
779
|
{
|
|
701
|
-
onEditRow:
|
|
702
|
-
onRemoveRow:
|
|
703
|
-
onViewRow:
|
|
704
|
-
row:
|
|
705
|
-
variant:
|
|
780
|
+
onEditRow: s.onEditRow ? (p) => s.onEditRow && s.onEditRow(p) : void 0,
|
|
781
|
+
onRemoveRow: s.onRemoveRow ? (p) => s.onRemoveRow && s.onRemoveRow(p) : void 0,
|
|
782
|
+
onViewRow: s.onViewRow ? (p) => s.onViewRow && s.onViewRow(p) : void 0,
|
|
783
|
+
row: T,
|
|
784
|
+
variant: y ?? ge.variant
|
|
706
785
|
}
|
|
707
786
|
);
|
|
708
|
-
},
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
}, [
|
|
712
|
-
const Ue = (
|
|
713
|
-
const
|
|
714
|
-
|
|
715
|
-
},
|
|
716
|
-
const
|
|
717
|
-
|
|
718
|
-
},
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
},
|
|
722
|
-
if (
|
|
723
|
-
if (
|
|
724
|
-
|
|
725
|
-
else if (
|
|
726
|
-
const
|
|
727
|
-
|
|
728
|
-
search:
|
|
729
|
-
fields:
|
|
730
|
-
}),
|
|
787
|
+
}, ge = ze(), ve = Ae(null), ke = m ? !1 : w, Ve = He(() => Ce, [Ce]);
|
|
788
|
+
Ze.useEffect(() => {
|
|
789
|
+
I && I.current !== ve.current && I.current && ve.current && (I.current = ve.current);
|
|
790
|
+
}, [I]);
|
|
791
|
+
const Ue = (T, Se) => {
|
|
792
|
+
const p = { ...g, currentFilter: T, activeFilterIndex: Se };
|
|
793
|
+
j(p), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, p);
|
|
794
|
+
}, qe = (T) => {
|
|
795
|
+
const Se = { ...g, expandedFilter: T };
|
|
796
|
+
j(Se), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, Se);
|
|
797
|
+
}, b = (T, Se) => {
|
|
798
|
+
const p = { ...g, currentFilter: T, activeFilterIndex: Se };
|
|
799
|
+
j(p), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, p);
|
|
800
|
+
}, Ee = () => {
|
|
801
|
+
if (g.currentFilter)
|
|
802
|
+
if (ae)
|
|
803
|
+
ae();
|
|
804
|
+
else if (g.currentFilter.filter.filterType === "quick") {
|
|
805
|
+
const T = r.getOptions();
|
|
806
|
+
g.currentFilter.filter.quickFilterText && g.currentFilter.filter.quickFilterText !== "" ? (T.filter = JSON.stringify({
|
|
807
|
+
search: g.currentFilter.filter.quickFilterText,
|
|
808
|
+
fields: g.currentFilter.filter.quickFilterFieldsText
|
|
809
|
+
}), T.sort = g.currentFilter.sort.quickFilterSort ? g.currentFilter.sort.quickFilterSort.split(",") : []) : (T.filter = void 0, T.sort = void 0), r.refreshData(T), Te.isDataSourceV2 || Te.v1State.forceUpdate();
|
|
731
810
|
} else {
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
const
|
|
735
|
-
|
|
811
|
+
const T = rn(g.currentFilter);
|
|
812
|
+
if (T && T.expressionNode) {
|
|
813
|
+
const Se = qt(T.expressionNode), p = r.getOptions();
|
|
814
|
+
p.filter = Se, p.sort = T?.sortStrings, r.refreshData(p), Te.isDataSourceV2 || Te.v1State.forceUpdate();
|
|
736
815
|
}
|
|
737
816
|
}
|
|
738
817
|
};
|
|
739
|
-
let
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
},
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
|
|
748
|
-
},
|
|
749
|
-
|
|
818
|
+
let je, Qe;
|
|
819
|
+
const ht = (T) => {
|
|
820
|
+
je = T;
|
|
821
|
+
}, ut = (T) => {
|
|
822
|
+
Qe = T;
|
|
823
|
+
}, ft = () => {
|
|
824
|
+
Qe && Qe();
|
|
825
|
+
}, mt = () => {
|
|
826
|
+
je && je();
|
|
827
|
+
}, gt = () => h === "none" ? /* @__PURE__ */ e("div", {}) : h === "advanced" ? /* @__PURE__ */ e(
|
|
828
|
+
St,
|
|
750
829
|
{
|
|
751
830
|
id: i?.componentName,
|
|
752
831
|
viewName: i?.viewName,
|
|
753
832
|
apiVersion: i?.apiVersion,
|
|
754
|
-
ref:
|
|
755
|
-
variant:
|
|
756
|
-
expandedFilter:
|
|
757
|
-
persistenceDelegator:
|
|
758
|
-
currentFilter:
|
|
759
|
-
activeFilterIndex:
|
|
760
|
-
onSelectedFilter:
|
|
833
|
+
ref: re,
|
|
834
|
+
variant: y ?? ge.variant,
|
|
835
|
+
expandedFilter: g.expandedFilter,
|
|
836
|
+
persistenceDelegator: M,
|
|
837
|
+
currentFilter: g.currentFilter,
|
|
838
|
+
activeFilterIndex: g.activeFilterIndex,
|
|
839
|
+
onSelectedFilter: b,
|
|
761
840
|
onFilterChanged: Ue,
|
|
762
|
-
onSearchByFilter:
|
|
763
|
-
onToggleExpandedFilter:
|
|
764
|
-
onExport:
|
|
765
|
-
onPrint:
|
|
841
|
+
onSearchByFilter: Ee,
|
|
842
|
+
onToggleExpandedFilter: qe,
|
|
843
|
+
onExport: ft,
|
|
844
|
+
onPrint: mt,
|
|
766
845
|
showExportButton: !0,
|
|
767
846
|
showPrintButton: !0,
|
|
768
847
|
width: "560px",
|
|
769
848
|
height: "170px",
|
|
770
|
-
children:
|
|
849
|
+
children: C
|
|
771
850
|
}
|
|
772
|
-
) :
|
|
851
|
+
) : h === "normal" ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e("div", {});
|
|
773
852
|
return /* @__PURE__ */ e(
|
|
774
|
-
|
|
853
|
+
Ge,
|
|
775
854
|
{
|
|
776
|
-
resourceName:
|
|
777
|
-
resourceDescription:
|
|
778
|
-
requiredPermissions:
|
|
779
|
-
fallbackComponent:
|
|
780
|
-
onSecurityReady:
|
|
781
|
-
onAccessDenied:
|
|
782
|
-
children: /* @__PURE__ */
|
|
783
|
-
|
|
784
|
-
|
|
855
|
+
resourceName: we,
|
|
856
|
+
resourceDescription: de,
|
|
857
|
+
requiredPermissions: B,
|
|
858
|
+
fallbackComponent: me,
|
|
859
|
+
onSecurityReady: xe?.onSecurityReady,
|
|
860
|
+
onAccessDenied: xe?.onAccessDenied,
|
|
861
|
+
children: /* @__PURE__ */ c(Le, { withBorder: G, ref: ve, style: { height: "100%" }, children: [
|
|
862
|
+
m ? /* @__PURE__ */ e(
|
|
863
|
+
Ke,
|
|
785
864
|
{
|
|
786
865
|
autoClose: 2e4,
|
|
787
866
|
withCloseButton: !0,
|
|
788
867
|
withBorder: !0,
|
|
789
|
-
icon: /* @__PURE__ */ e(
|
|
790
|
-
title:
|
|
868
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
869
|
+
title: x().t("archbase:WARNING"),
|
|
791
870
|
titleColor: "rgb(250, 82, 82)",
|
|
792
|
-
variant:
|
|
793
|
-
onClose: () =>
|
|
794
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
871
|
+
variant: y ?? ge.variant,
|
|
872
|
+
onClose: () => F && F(),
|
|
873
|
+
children: /* @__PURE__ */ e("span", { children: V })
|
|
795
874
|
}
|
|
796
875
|
) : null,
|
|
797
|
-
/* @__PURE__ */
|
|
798
|
-
|
|
876
|
+
/* @__PURE__ */ c(
|
|
877
|
+
Gt,
|
|
799
878
|
{
|
|
800
|
-
gridRef:
|
|
801
|
-
printTitle: f ||
|
|
802
|
-
logoPrint:
|
|
803
|
-
width:
|
|
804
|
-
height:
|
|
879
|
+
gridRef: S,
|
|
880
|
+
printTitle: f || o,
|
|
881
|
+
logoPrint: P,
|
|
882
|
+
width: X,
|
|
883
|
+
height: Z,
|
|
805
884
|
withBorder: !1,
|
|
806
885
|
dataSource: r,
|
|
807
886
|
enableColumnResizing: !0,
|
|
808
|
-
enableRowNumbers:
|
|
809
|
-
enableRowSelection:
|
|
810
|
-
enableRowActions:
|
|
811
|
-
enableTopToolbar:
|
|
812
|
-
enableTopToolbarActions:
|
|
887
|
+
enableRowNumbers: se,
|
|
888
|
+
enableRowSelection: te,
|
|
889
|
+
enableRowActions: ne,
|
|
890
|
+
enableTopToolbar: D,
|
|
891
|
+
enableTopToolbarActions: N,
|
|
813
892
|
manualPagination: !0,
|
|
814
893
|
manualSorting: !0,
|
|
815
|
-
isLoading:
|
|
816
|
-
pageSize:
|
|
817
|
-
pageIndex:
|
|
818
|
-
allowColumnFilters:
|
|
819
|
-
enableGlobalFilter:
|
|
820
|
-
renderToolbarInternalActions:
|
|
894
|
+
isLoading: ke,
|
|
895
|
+
pageSize: u,
|
|
896
|
+
pageIndex: v,
|
|
897
|
+
allowColumnFilters: h !== "none",
|
|
898
|
+
enableGlobalFilter: h !== "none",
|
|
899
|
+
renderToolbarInternalActions: h == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
|
|
821
900
|
allowExportData: !0,
|
|
822
901
|
allowPrintData: !0,
|
|
823
|
-
onSelectedRowsChanged:
|
|
824
|
-
onCellDoubleClick:
|
|
825
|
-
onFilterModelChange:
|
|
826
|
-
renderRowActions:
|
|
827
|
-
positionActionsColumn:
|
|
828
|
-
actionsColumnWidth:
|
|
829
|
-
toolbarAlignment:
|
|
830
|
-
toolbarLeftContent:
|
|
831
|
-
renderToolbarActions:
|
|
832
|
-
paginationLabels:
|
|
833
|
-
cellPadding:
|
|
834
|
-
bottomToolbarMinHeight:
|
|
835
|
-
tableHeadCellPadding:
|
|
836
|
-
getRowId:
|
|
837
|
-
renderDetailPanel:
|
|
838
|
-
renderTopToolbar:
|
|
839
|
-
onExport:
|
|
840
|
-
onPrint:
|
|
841
|
-
variant:
|
|
842
|
-
withToolbarBorder:
|
|
843
|
-
withPaginationBorder:
|
|
844
|
-
toolbarPadding:
|
|
845
|
-
paginationPadding:
|
|
846
|
-
rowHeight:
|
|
847
|
-
hideFooter:
|
|
902
|
+
onSelectedRowsChanged: le,
|
|
903
|
+
onCellDoubleClick: d,
|
|
904
|
+
onFilterModelChange: k,
|
|
905
|
+
renderRowActions: ne ? q : void 0,
|
|
906
|
+
positionActionsColumn: H,
|
|
907
|
+
actionsColumnWidth: z,
|
|
908
|
+
toolbarAlignment: ue,
|
|
909
|
+
toolbarLeftContent: Ve,
|
|
910
|
+
renderToolbarActions: h === "advanced" || h === "none" ? gt : void 0,
|
|
911
|
+
paginationLabels: $,
|
|
912
|
+
cellPadding: ee,
|
|
913
|
+
bottomToolbarMinHeight: E,
|
|
914
|
+
tableHeadCellPadding: Y,
|
|
915
|
+
getRowId: W,
|
|
916
|
+
renderDetailPanel: O ? ({ row: T }) => O({ row: T }) : void 0,
|
|
917
|
+
renderTopToolbar: _,
|
|
918
|
+
onExport: ut,
|
|
919
|
+
onPrint: ht,
|
|
920
|
+
variant: y,
|
|
921
|
+
withToolbarBorder: Fe,
|
|
922
|
+
withPaginationBorder: Ie,
|
|
923
|
+
toolbarPadding: A,
|
|
924
|
+
paginationPadding: ce,
|
|
925
|
+
rowHeight: Ne,
|
|
926
|
+
hideFooter: De,
|
|
848
927
|
children: [
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
/* @__PURE__ */ e("h3", { className: "only-print", children: f ||
|
|
852
|
-
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
928
|
+
a,
|
|
929
|
+
l?.visible ? /* @__PURE__ */ e(Xt, { children: /* @__PURE__ */ c(Me, { children: [
|
|
930
|
+
/* @__PURE__ */ e("h3", { className: "only-print", children: f || o }),
|
|
931
|
+
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ c(pe, { gap: "8px", rowGap: "8px", children: [
|
|
932
|
+
l.customUserActions && l.customUserActionsPosition === "left" ? l.customUserActions : null,
|
|
933
|
+
l.onAddExecute ? /* @__PURE__ */ e(
|
|
934
|
+
J,
|
|
856
935
|
{
|
|
857
936
|
actionName: "add",
|
|
858
|
-
actionDescription: `Adicionar novo ${
|
|
937
|
+
actionDescription: `Adicionar novo ${de || "registro"}`,
|
|
859
938
|
color: "green",
|
|
860
|
-
variant:
|
|
861
|
-
leftSection: /* @__PURE__ */ e(
|
|
862
|
-
onClick: () =>
|
|
863
|
-
children:
|
|
939
|
+
variant: y ?? ge.variant,
|
|
940
|
+
leftSection: /* @__PURE__ */ e(bt, {}),
|
|
941
|
+
onClick: () => l && l.onAddExecute && l.onAddExecute(),
|
|
942
|
+
children: l.labelAdd || x().t("archbase:New")
|
|
864
943
|
}
|
|
865
944
|
) : null,
|
|
866
|
-
|
|
867
|
-
|
|
945
|
+
l.onEditExecute ? /* @__PURE__ */ e(
|
|
946
|
+
J,
|
|
868
947
|
{
|
|
869
948
|
actionName: "edit",
|
|
870
|
-
actionDescription: `Editar ${
|
|
949
|
+
actionDescription: `Editar ${de || "registro"}`,
|
|
871
950
|
color: "blue",
|
|
872
|
-
leftSection: /* @__PURE__ */ e(
|
|
951
|
+
leftSection: /* @__PURE__ */ e(wt, {}),
|
|
873
952
|
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
874
|
-
variant:
|
|
875
|
-
onClick: () =>
|
|
876
|
-
children:
|
|
953
|
+
variant: y ?? ge.variant,
|
|
954
|
+
onClick: () => l && l.onEditExecute && l.onEditExecute(),
|
|
955
|
+
children: l.labelEdit || x().t("archbase:Edit")
|
|
877
956
|
}
|
|
878
957
|
) : null,
|
|
879
|
-
|
|
880
|
-
|
|
958
|
+
l.onRemoveExecute ? /* @__PURE__ */ e(
|
|
959
|
+
J,
|
|
881
960
|
{
|
|
882
961
|
actionName: "delete",
|
|
883
|
-
actionDescription: `Remover ${
|
|
962
|
+
actionDescription: `Remover ${de || "registro"}`,
|
|
884
963
|
color: "red",
|
|
885
|
-
leftSection: /* @__PURE__ */ e(
|
|
886
|
-
disabled: !
|
|
887
|
-
variant:
|
|
888
|
-
onClick: () =>
|
|
889
|
-
children:
|
|
964
|
+
leftSection: /* @__PURE__ */ e(tt, {}),
|
|
965
|
+
disabled: !l?.allowRemove || !r.isBrowsing() || r.isEmpty(),
|
|
966
|
+
variant: y ?? ge.variant,
|
|
967
|
+
onClick: () => l && l.onRemoveExecute && l.onRemoveExecute(),
|
|
968
|
+
children: l.labelRemove || x().t("archbase:Remove")
|
|
890
969
|
}
|
|
891
970
|
) : null,
|
|
892
|
-
|
|
893
|
-
|
|
971
|
+
l.onViewExecute ? /* @__PURE__ */ e(
|
|
972
|
+
J,
|
|
894
973
|
{
|
|
895
974
|
actionName: "view",
|
|
896
|
-
actionDescription: `Visualizar ${
|
|
975
|
+
actionDescription: `Visualizar ${de || "registro"}`,
|
|
897
976
|
color: "gray.7",
|
|
898
|
-
leftSection: /* @__PURE__ */ e(
|
|
977
|
+
leftSection: /* @__PURE__ */ e(Ft, {}),
|
|
899
978
|
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
900
|
-
variant:
|
|
901
|
-
onClick: () =>
|
|
902
|
-
children:
|
|
979
|
+
variant: y ?? ge.variant,
|
|
980
|
+
onClick: () => l && l.onViewExecute && l.onViewExecute(),
|
|
981
|
+
children: l.labelView || x().t("archbase:View")
|
|
903
982
|
}
|
|
904
983
|
) : null,
|
|
905
|
-
|
|
984
|
+
l.customUserActions && l.customUserActionsPosition === "right" ? l.customUserActions : null
|
|
906
985
|
] }) })
|
|
907
986
|
] }) }) : null
|
|
908
987
|
]
|
|
@@ -912,13 +991,13 @@ function rn(t, n) {
|
|
|
912
991
|
}
|
|
913
992
|
);
|
|
914
993
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
994
|
+
const Vn = Vt(sn);
|
|
995
|
+
function dn(t, n, o, f) {
|
|
917
996
|
if (t && t.headerGridColumns) {
|
|
918
|
-
const r = t.headerGridColumns.left ? t.headerGridColumns.left : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, i = t.headerGridColumns.middle ? t.headerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" },
|
|
919
|
-
return /* @__PURE__ */
|
|
997
|
+
const r = t.headerGridColumns.left ? t.headerGridColumns.left : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, i = t.headerGridColumns.middle ? t.headerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.headerGridColumns.right ? t.headerGridColumns.right : { xs: "auto", sm: "auto", md: "auto", lg: "auto" };
|
|
998
|
+
return /* @__PURE__ */ c(be, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
920
999
|
/* @__PURE__ */ e(
|
|
921
|
-
|
|
1000
|
+
be.Col,
|
|
922
1001
|
{
|
|
923
1002
|
span: {
|
|
924
1003
|
xs: r.xs,
|
|
@@ -936,7 +1015,7 @@ function on(t, n, l, f) {
|
|
|
936
1015
|
}
|
|
937
1016
|
),
|
|
938
1017
|
/* @__PURE__ */ e(
|
|
939
|
-
|
|
1018
|
+
be.Col,
|
|
940
1019
|
{
|
|
941
1020
|
span: {
|
|
942
1021
|
xs: i.xs,
|
|
@@ -953,13 +1032,13 @@ function on(t, n, l, f) {
|
|
|
953
1032
|
}
|
|
954
1033
|
),
|
|
955
1034
|
/* @__PURE__ */ e(
|
|
956
|
-
|
|
1035
|
+
be.Col,
|
|
957
1036
|
{
|
|
958
1037
|
span: {
|
|
959
|
-
xs:
|
|
960
|
-
sm:
|
|
961
|
-
md:
|
|
962
|
-
lg:
|
|
1038
|
+
xs: u.xs,
|
|
1039
|
+
sm: u.sm,
|
|
1040
|
+
md: u.md,
|
|
1041
|
+
lg: u.lg
|
|
963
1042
|
},
|
|
964
1043
|
style: {
|
|
965
1044
|
border: f ? "1px dashed" : "",
|
|
@@ -967,20 +1046,20 @@ function on(t, n, l, f) {
|
|
|
967
1046
|
justifyContent: "flex-end",
|
|
968
1047
|
alignItems: "center"
|
|
969
1048
|
},
|
|
970
|
-
children:
|
|
1049
|
+
children: o
|
|
971
1050
|
}
|
|
972
1051
|
)
|
|
973
1052
|
] });
|
|
974
1053
|
} else {
|
|
975
|
-
const r = t && t.headerFlexGrow ? t.headerFlexGrow : "even", i = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end",
|
|
976
|
-
return /* @__PURE__ */
|
|
1054
|
+
const r = t && t.headerFlexGrow ? t.headerFlexGrow : "even", i = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end", u = t && t.headerFlexLeftJustifyContent ? t.headerFlexLeftJustifyContent : "flex-start";
|
|
1055
|
+
return /* @__PURE__ */ c(pe, { justify: "space-between", children: [
|
|
977
1056
|
/* @__PURE__ */ e(
|
|
978
|
-
|
|
1057
|
+
pe,
|
|
979
1058
|
{
|
|
980
1059
|
w: r === "left" || r === "even" ? "100%" : void 0,
|
|
981
1060
|
maw: r === "left" || r === "even" ? void 0 : "100%",
|
|
982
1061
|
align: "center",
|
|
983
|
-
justify:
|
|
1062
|
+
justify: u,
|
|
984
1063
|
style: {
|
|
985
1064
|
border: f ? "1px dashed" : ""
|
|
986
1065
|
},
|
|
@@ -988,7 +1067,7 @@ function on(t, n, l, f) {
|
|
|
988
1067
|
}
|
|
989
1068
|
),
|
|
990
1069
|
/* @__PURE__ */ e(
|
|
991
|
-
|
|
1070
|
+
pe,
|
|
992
1071
|
{
|
|
993
1072
|
w: r === "right" || r === "even" ? "100%" : void 0,
|
|
994
1073
|
maw: r === "right" || r === "even" ? void 0 : "100%",
|
|
@@ -997,18 +1076,18 @@ function on(t, n, l, f) {
|
|
|
997
1076
|
style: {
|
|
998
1077
|
border: f ? "1px dashed" : ""
|
|
999
1078
|
},
|
|
1000
|
-
children:
|
|
1079
|
+
children: o
|
|
1001
1080
|
}
|
|
1002
1081
|
)
|
|
1003
1082
|
] });
|
|
1004
1083
|
}
|
|
1005
1084
|
}
|
|
1006
|
-
function
|
|
1085
|
+
function hn(t, n, o, f) {
|
|
1007
1086
|
if (t && t.footerGridColumns) {
|
|
1008
|
-
const r = t.footerGridColumns.left ? t.footerGridColumns.left : { xs: "content", sm: "content", md: "content", lg: "content" }, i = t.footerGridColumns.middle ? t.footerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" },
|
|
1009
|
-
return /* @__PURE__ */
|
|
1087
|
+
const r = t.footerGridColumns.left ? t.footerGridColumns.left : { xs: "content", sm: "content", md: "content", lg: "content" }, i = t.footerGridColumns.middle ? t.footerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.footerGridColumns.right ? t.footerGridColumns.right : { xs: "content", sm: "content", md: "content", lg: "content" };
|
|
1088
|
+
return /* @__PURE__ */ c(be, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
1010
1089
|
/* @__PURE__ */ e(
|
|
1011
|
-
|
|
1090
|
+
be.Col,
|
|
1012
1091
|
{
|
|
1013
1092
|
span: {
|
|
1014
1093
|
xs: r.xs,
|
|
@@ -1026,7 +1105,7 @@ function ln(t, n, l, f) {
|
|
|
1026
1105
|
}
|
|
1027
1106
|
),
|
|
1028
1107
|
/* @__PURE__ */ e(
|
|
1029
|
-
|
|
1108
|
+
be.Col,
|
|
1030
1109
|
{
|
|
1031
1110
|
span: {
|
|
1032
1111
|
xs: i.xs,
|
|
@@ -1043,13 +1122,13 @@ function ln(t, n, l, f) {
|
|
|
1043
1122
|
}
|
|
1044
1123
|
),
|
|
1045
1124
|
/* @__PURE__ */ e(
|
|
1046
|
-
|
|
1125
|
+
be.Col,
|
|
1047
1126
|
{
|
|
1048
1127
|
span: {
|
|
1049
|
-
xs:
|
|
1050
|
-
sm:
|
|
1051
|
-
md:
|
|
1052
|
-
lg:
|
|
1128
|
+
xs: u.xs,
|
|
1129
|
+
sm: u.sm,
|
|
1130
|
+
md: u.md,
|
|
1131
|
+
lg: u.lg
|
|
1053
1132
|
},
|
|
1054
1133
|
style: {
|
|
1055
1134
|
border: f ? "1px dashed" : "",
|
|
@@ -1057,20 +1136,20 @@ function ln(t, n, l, f) {
|
|
|
1057
1136
|
justifyContent: "flex-end",
|
|
1058
1137
|
alignItems: "center"
|
|
1059
1138
|
},
|
|
1060
|
-
children:
|
|
1139
|
+
children: o
|
|
1061
1140
|
}
|
|
1062
1141
|
)
|
|
1063
1142
|
] });
|
|
1064
1143
|
} else {
|
|
1065
|
-
const r = t && t.footerFlexGrow ? t.footerFlexGrow : "even", i = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end",
|
|
1066
|
-
return /* @__PURE__ */
|
|
1144
|
+
const r = t && t.footerFlexGrow ? t.footerFlexGrow : "even", i = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end", u = t && t.footerFlexLeftJustifyContent ? t.footerFlexLeftJustifyContent : "flex-start";
|
|
1145
|
+
return /* @__PURE__ */ c(pe, { justify: "space-between", children: [
|
|
1067
1146
|
/* @__PURE__ */ e(
|
|
1068
|
-
|
|
1147
|
+
pe,
|
|
1069
1148
|
{
|
|
1070
1149
|
w: r === "left" || r === "even" ? "100%" : void 0,
|
|
1071
1150
|
maw: r === "left" || r === "even" ? void 0 : "100%",
|
|
1072
1151
|
align: "center",
|
|
1073
|
-
justify:
|
|
1152
|
+
justify: u,
|
|
1074
1153
|
style: {
|
|
1075
1154
|
border: f ? "1px dashed" : "",
|
|
1076
1155
|
height: "auto",
|
|
@@ -1080,7 +1159,7 @@ function ln(t, n, l, f) {
|
|
|
1080
1159
|
}
|
|
1081
1160
|
),
|
|
1082
1161
|
/* @__PURE__ */ e(
|
|
1083
|
-
|
|
1162
|
+
pe,
|
|
1084
1163
|
{
|
|
1085
1164
|
w: r === "right" || r === "even" ? "100%" : void 0,
|
|
1086
1165
|
maw: r === "right" || r === "even" ? void 0 : "100%",
|
|
@@ -1089,362 +1168,362 @@ function ln(t, n, l, f) {
|
|
|
1089
1168
|
style: {
|
|
1090
1169
|
border: f ? "1px dashed" : "",
|
|
1091
1170
|
height: "auto",
|
|
1092
|
-
padding:
|
|
1171
|
+
padding: o && "calc(0.625rem / 2)"
|
|
1093
1172
|
},
|
|
1094
|
-
children:
|
|
1173
|
+
children: o
|
|
1095
1174
|
}
|
|
1096
1175
|
)
|
|
1097
1176
|
] });
|
|
1098
1177
|
}
|
|
1099
1178
|
}
|
|
1100
|
-
function
|
|
1179
|
+
function jt({
|
|
1101
1180
|
title: t,
|
|
1102
1181
|
innerRef: n,
|
|
1103
|
-
isError:
|
|
1182
|
+
isError: o = !1,
|
|
1104
1183
|
error: f = "",
|
|
1105
1184
|
clearError: r,
|
|
1106
1185
|
width: i = "100%",
|
|
1107
|
-
height:
|
|
1108
|
-
withBorder:
|
|
1109
|
-
children:
|
|
1110
|
-
radius:
|
|
1111
|
-
debug:
|
|
1112
|
-
defaultDebug:
|
|
1113
|
-
headerLeft:
|
|
1114
|
-
headerMiddle:
|
|
1115
|
-
headerRight:
|
|
1116
|
-
footerLeft:
|
|
1117
|
-
footerMiddle:
|
|
1118
|
-
footerRight:
|
|
1119
|
-
variant:
|
|
1120
|
-
options:
|
|
1121
|
-
style:
|
|
1122
|
-
debugOptions:
|
|
1186
|
+
height: u = "100%",
|
|
1187
|
+
withBorder: v = !0,
|
|
1188
|
+
children: a,
|
|
1189
|
+
radius: C,
|
|
1190
|
+
debug: P,
|
|
1191
|
+
defaultDebug: l,
|
|
1192
|
+
headerLeft: s,
|
|
1193
|
+
headerMiddle: L,
|
|
1194
|
+
headerRight: I,
|
|
1195
|
+
footerLeft: w,
|
|
1196
|
+
footerMiddle: R,
|
|
1197
|
+
footerRight: m,
|
|
1198
|
+
variant: D,
|
|
1199
|
+
options: N = {},
|
|
1200
|
+
style: V,
|
|
1201
|
+
debugOptions: F = {
|
|
1123
1202
|
debugLayoutHotKey: "ctrl+shift+S",
|
|
1124
1203
|
debugObjectInspectorHotKey: "ctrl+shift+D",
|
|
1125
1204
|
objectsToInspect: []
|
|
1126
1205
|
},
|
|
1127
1206
|
// Props de segurança (opcionais)
|
|
1128
|
-
resourceName:
|
|
1129
|
-
resourceDescription:
|
|
1130
|
-
requiredPermissions:
|
|
1131
|
-
fallbackComponent:
|
|
1132
|
-
securityOptions:
|
|
1207
|
+
resourceName: h,
|
|
1208
|
+
resourceDescription: X,
|
|
1209
|
+
requiredPermissions: Z,
|
|
1210
|
+
fallbackComponent: ae,
|
|
1211
|
+
securityOptions: W
|
|
1133
1212
|
}) {
|
|
1134
|
-
const [
|
|
1135
|
-
value:
|
|
1136
|
-
defaultValue:
|
|
1213
|
+
const [G, M] = Ht({
|
|
1214
|
+
value: P,
|
|
1215
|
+
defaultValue: l,
|
|
1137
1216
|
finalValue: !1
|
|
1138
1217
|
});
|
|
1139
|
-
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
autoRegisterActions:
|
|
1218
|
+
_t([[F && F.debugLayoutHotKey, () => M(!G)]]);
|
|
1219
|
+
const y = ze(), { t: U } = Jt();
|
|
1220
|
+
Pe({
|
|
1221
|
+
autoRegisterActions: W?.autoRegisterActions ?? !0
|
|
1143
1222
|
});
|
|
1144
|
-
const
|
|
1145
|
-
height:
|
|
1146
|
-
width:
|
|
1147
|
-
}), [
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
}, [
|
|
1151
|
-
const
|
|
1223
|
+
const ee = Ae(null), E = n || ee, te = Ae(null), se = Ae(null), ne = it(te), H = it(se), z = it(E), Y = He(() => ({
|
|
1224
|
+
height: z.height - ne.height - H.height - Number(Mt("0.625rem")),
|
|
1225
|
+
width: z.width - ne.width - H.width
|
|
1226
|
+
}), [z.height, z.width, ne.height, ne.width, H.height, H.width]), O = Ae(l);
|
|
1227
|
+
et(() => {
|
|
1228
|
+
l !== O.current && (M(l), O.current = l);
|
|
1229
|
+
}, [l, M]);
|
|
1230
|
+
const _ = /* @__PURE__ */ c(Me, { children: [
|
|
1152
1231
|
/* @__PURE__ */ e(
|
|
1153
|
-
|
|
1232
|
+
Le,
|
|
1154
1233
|
{
|
|
1155
|
-
ref:
|
|
1156
|
-
withBorder:
|
|
1157
|
-
radius:
|
|
1158
|
-
style: { width: i, height:
|
|
1159
|
-
children: /* @__PURE__ */
|
|
1160
|
-
/* @__PURE__ */ e(
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1162
|
-
|
|
1234
|
+
ref: E,
|
|
1235
|
+
withBorder: v,
|
|
1236
|
+
radius: C,
|
|
1237
|
+
style: { width: i, height: u, padding: 4, ...V },
|
|
1238
|
+
children: /* @__PURE__ */ c(ct, { height: "100%", children: [
|
|
1239
|
+
/* @__PURE__ */ e(Et, { size: ne.height, children: /* @__PURE__ */ e("div", { ref: te, children: dn(N, s, I, G) }) }),
|
|
1240
|
+
/* @__PURE__ */ e(st, { children: /* @__PURE__ */ e(
|
|
1241
|
+
Xe,
|
|
1163
1242
|
{
|
|
1164
|
-
h:
|
|
1243
|
+
h: Y.height,
|
|
1165
1244
|
style: {
|
|
1166
|
-
border:
|
|
1245
|
+
border: G ? "1px dashed" : "",
|
|
1167
1246
|
padding: "calc(0.625rem / 2)"
|
|
1168
1247
|
},
|
|
1169
|
-
children:
|
|
1170
|
-
|
|
1171
|
-
|
|
1248
|
+
children: a ? /* @__PURE__ */ c(Wt, { children: [
|
|
1249
|
+
o && /* @__PURE__ */ e(
|
|
1250
|
+
Ke,
|
|
1172
1251
|
{
|
|
1173
1252
|
autoClose: 2e4,
|
|
1174
1253
|
withCloseButton: !0,
|
|
1175
1254
|
withBorder: !0,
|
|
1176
|
-
icon: /* @__PURE__ */ e(
|
|
1177
|
-
title: `${
|
|
1255
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
1256
|
+
title: `${U("WARNING")}`,
|
|
1178
1257
|
titleColor: "rgb(250, 82, 82)",
|
|
1179
|
-
variant:
|
|
1258
|
+
variant: D ?? y.variant,
|
|
1180
1259
|
onClose: () => r && r(),
|
|
1181
1260
|
children: /* @__PURE__ */ e("span", { children: f })
|
|
1182
1261
|
}
|
|
1183
1262
|
),
|
|
1184
|
-
|
|
1185
|
-
] }) :
|
|
1263
|
+
a
|
|
1264
|
+
] }) : G && /* @__PURE__ */ e(pe, { h: Y.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(ye, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
|
|
1186
1265
|
}
|
|
1187
1266
|
) }),
|
|
1188
|
-
/* @__PURE__ */ e(
|
|
1267
|
+
/* @__PURE__ */ e(dt, { size: H.height, children: /* @__PURE__ */ e("div", { ref: se, children: hn(N, w, m, G) }) })
|
|
1189
1268
|
] })
|
|
1190
1269
|
}
|
|
1191
1270
|
),
|
|
1192
1271
|
/* @__PURE__ */ e(
|
|
1193
|
-
|
|
1272
|
+
Yt,
|
|
1194
1273
|
{
|
|
1195
|
-
debugObjectInspectorHotKey:
|
|
1196
|
-
objectsToInspect:
|
|
1274
|
+
debugObjectInspectorHotKey: F && F.debugObjectInspectorHotKey,
|
|
1275
|
+
objectsToInspect: F && F.objectsToInspect
|
|
1197
1276
|
}
|
|
1198
1277
|
)
|
|
1199
1278
|
] });
|
|
1200
1279
|
return /* @__PURE__ */ e(
|
|
1201
|
-
|
|
1280
|
+
Ge,
|
|
1202
1281
|
{
|
|
1203
|
-
resourceName:
|
|
1204
|
-
resourceDescription:
|
|
1205
|
-
requiredPermissions:
|
|
1206
|
-
fallbackComponent:
|
|
1207
|
-
onSecurityReady:
|
|
1208
|
-
onAccessDenied:
|
|
1209
|
-
children:
|
|
1282
|
+
resourceName: h,
|
|
1283
|
+
resourceDescription: X,
|
|
1284
|
+
requiredPermissions: Z,
|
|
1285
|
+
fallbackComponent: ae,
|
|
1286
|
+
onSecurityReady: W?.onSecurityReady,
|
|
1287
|
+
onAccessDenied: W?.onAccessDenied,
|
|
1288
|
+
children: _
|
|
1210
1289
|
}
|
|
1211
1290
|
);
|
|
1212
1291
|
}
|
|
1213
|
-
function
|
|
1214
|
-
console.log(`Render de "${t}" na fase "${n}": ${
|
|
1292
|
+
function un(t, n, o, f, r, i) {
|
|
1293
|
+
console.log(`Render de "${t}" na fase "${n}": ${o}ms`);
|
|
1215
1294
|
}
|
|
1216
|
-
function
|
|
1295
|
+
function zn({
|
|
1217
1296
|
title: t,
|
|
1218
1297
|
dataSource: n,
|
|
1219
1298
|
// dataSourceEdition,
|
|
1220
|
-
filterOptions:
|
|
1299
|
+
filterOptions: o,
|
|
1221
1300
|
globalFilterFieldNames: f,
|
|
1222
1301
|
//pageSize,
|
|
1223
1302
|
filterFields: r,
|
|
1224
1303
|
innerRef: i,
|
|
1225
1304
|
//isLoading = false,
|
|
1226
|
-
debug:
|
|
1227
|
-
filterType:
|
|
1228
|
-
isError:
|
|
1229
|
-
error:
|
|
1230
|
-
clearError:
|
|
1305
|
+
debug: u = !1,
|
|
1306
|
+
filterType: v = "normal",
|
|
1307
|
+
isError: a = !1,
|
|
1308
|
+
error: C = "",
|
|
1309
|
+
clearError: P = () => {
|
|
1231
1310
|
},
|
|
1232
|
-
width:
|
|
1233
|
-
height:
|
|
1234
|
-
withBorder:
|
|
1235
|
-
filterPersistenceDelegator:
|
|
1236
|
-
withPagination:
|
|
1237
|
-
radius:
|
|
1238
|
-
userActions:
|
|
1239
|
-
columnsCountBreakPoints:
|
|
1240
|
-
columnsCount:
|
|
1241
|
-
gutter:
|
|
1242
|
-
component:
|
|
1243
|
-
activeIndex:
|
|
1244
|
-
activeBackgroundColor:
|
|
1245
|
-
activeColor:
|
|
1246
|
-
onItemEnter:
|
|
1247
|
-
onItemLeave:
|
|
1248
|
-
style:
|
|
1249
|
-
spaceOptions:
|
|
1250
|
-
variant:
|
|
1251
|
-
id:
|
|
1252
|
-
debugOptions:
|
|
1311
|
+
width: l = "100%",
|
|
1312
|
+
height: s = "100%",
|
|
1313
|
+
withBorder: L = !0,
|
|
1314
|
+
filterPersistenceDelegator: I,
|
|
1315
|
+
withPagination: w = !0,
|
|
1316
|
+
radius: R,
|
|
1317
|
+
userActions: m,
|
|
1318
|
+
columnsCountBreakPoints: D,
|
|
1319
|
+
columnsCount: N,
|
|
1320
|
+
gutter: V,
|
|
1321
|
+
component: F,
|
|
1322
|
+
activeIndex: h,
|
|
1323
|
+
activeBackgroundColor: X,
|
|
1324
|
+
activeColor: Z,
|
|
1325
|
+
onItemEnter: ae,
|
|
1326
|
+
onItemLeave: W,
|
|
1327
|
+
style: G,
|
|
1328
|
+
spaceOptions: M,
|
|
1329
|
+
variant: y,
|
|
1330
|
+
id: U = on("masonry"),
|
|
1331
|
+
debugOptions: ee,
|
|
1253
1332
|
// Props de segurança (opcionais)
|
|
1254
|
-
resourceName:
|
|
1255
|
-
resourceDescription:
|
|
1256
|
-
requiredPermissions:
|
|
1257
|
-
fallbackComponent:
|
|
1258
|
-
securityOptions:
|
|
1333
|
+
resourceName: E,
|
|
1334
|
+
resourceDescription: te,
|
|
1335
|
+
requiredPermissions: se,
|
|
1336
|
+
fallbackComponent: ne,
|
|
1337
|
+
securityOptions: H
|
|
1259
1338
|
}) {
|
|
1260
|
-
const
|
|
1261
|
-
|
|
1339
|
+
const z = ze(), [Y] = Q(U), O = i || Ae(null), _ = Ae(null), [ue, Ce] = Q(n.getCurrentPage()), [le, d] = Q(
|
|
1340
|
+
h || (n && n.getTotalRecords() > 0 ? 0 : -1)
|
|
1262
1341
|
);
|
|
1263
|
-
|
|
1264
|
-
const [
|
|
1342
|
+
it(O);
|
|
1343
|
+
const [k, $] = Q({
|
|
1265
1344
|
activeFilterIndex: -1,
|
|
1266
1345
|
expandedFilter: !1
|
|
1267
|
-
}), [
|
|
1268
|
-
isDataSourceV2:
|
|
1269
|
-
v1State: { forceUpdate:
|
|
1270
|
-
} =
|
|
1346
|
+
}), [we, de] = Q(0), {
|
|
1347
|
+
isDataSourceV2: B,
|
|
1348
|
+
v1State: { forceUpdate: me }
|
|
1349
|
+
} = _e(
|
|
1271
1350
|
"ArchbaseMasonryTemplate",
|
|
1272
1351
|
n
|
|
1273
1352
|
);
|
|
1274
1353
|
nt({
|
|
1275
1354
|
dataSource: n,
|
|
1276
|
-
listener: (
|
|
1277
|
-
(
|
|
1355
|
+
listener: (g) => {
|
|
1356
|
+
(g.type === Re.afterRemove || g.type === Re.refreshData) && (de((j) => j + 1), B || me());
|
|
1278
1357
|
}
|
|
1279
1358
|
});
|
|
1280
|
-
const
|
|
1281
|
-
if (
|
|
1282
|
-
const
|
|
1283
|
-
let
|
|
1284
|
-
return
|
|
1285
|
-
const
|
|
1286
|
-
let
|
|
1287
|
-
return
|
|
1288
|
-
|
|
1359
|
+
const xe = He(() => {
|
|
1360
|
+
if (F) {
|
|
1361
|
+
const g = F.type;
|
|
1362
|
+
let j = {};
|
|
1363
|
+
return F.props && (j = F.props), n.browseRecords().map((q, ge) => {
|
|
1364
|
+
const ve = `${Y}_${ge}`, ke = `${Y}_${ge}`;
|
|
1365
|
+
let Ve = q.active === void 0 ? !1 : q.active;
|
|
1366
|
+
return le >= 0 && (Ve = !1, le === ge && (Ve = !0)), /* @__PURE__ */ e(
|
|
1367
|
+
g,
|
|
1289
1368
|
{
|
|
1290
|
-
id:
|
|
1291
|
-
active:
|
|
1292
|
-
index:
|
|
1369
|
+
id: ke,
|
|
1370
|
+
active: Ve,
|
|
1371
|
+
index: ge,
|
|
1293
1372
|
dataSource: n,
|
|
1294
|
-
recordData:
|
|
1295
|
-
disabled:
|
|
1296
|
-
...
|
|
1373
|
+
recordData: q,
|
|
1374
|
+
disabled: q.disabled,
|
|
1375
|
+
...j
|
|
1297
1376
|
},
|
|
1298
|
-
|
|
1377
|
+
ve
|
|
1299
1378
|
);
|
|
1300
1379
|
});
|
|
1301
1380
|
}
|
|
1302
1381
|
return [];
|
|
1303
|
-
}, [
|
|
1304
|
-
|
|
1305
|
-
},
|
|
1306
|
-
|
|
1307
|
-
},
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
},
|
|
1311
|
-
|
|
1312
|
-
},
|
|
1382
|
+
}, [le, F, Y, n, we]), Fe = (g, j) => {
|
|
1383
|
+
$({ ...k, currentFilter: g, activeFilterIndex: j });
|
|
1384
|
+
}, Ie = (g) => {
|
|
1385
|
+
$({ ...k, expandedFilter: g });
|
|
1386
|
+
}, A = (g, j) => {
|
|
1387
|
+
$({ ...k, currentFilter: g, activeFilterIndex: j });
|
|
1388
|
+
}, ce = () => {
|
|
1389
|
+
}, Ne = (g, j) => {
|
|
1390
|
+
d(g), n && n.gotoRecordByData(j);
|
|
1391
|
+
}, De = (g) => {
|
|
1313
1392
|
if (n) {
|
|
1314
|
-
const
|
|
1315
|
-
|
|
1393
|
+
const j = n.getOptions();
|
|
1394
|
+
j.filter = g, j.currentPage = ue, n.refreshData(j), B || me();
|
|
1316
1395
|
}
|
|
1317
|
-
},
|
|
1396
|
+
}, re = (g) => {
|
|
1318
1397
|
if (n) {
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1398
|
+
const j = n.getOptions();
|
|
1399
|
+
j.currentPage = g, n.refreshData(j), B || me();
|
|
1321
1400
|
}
|
|
1322
|
-
},
|
|
1323
|
-
|
|
1401
|
+
}, S = () => v === "normal" && f ? /* @__PURE__ */ e(
|
|
1402
|
+
ln,
|
|
1324
1403
|
{
|
|
1325
1404
|
searchableFields: f,
|
|
1326
|
-
onFilter:
|
|
1405
|
+
onFilter: De,
|
|
1327
1406
|
minFilterValueLength: 1
|
|
1328
1407
|
}
|
|
1329
|
-
) :
|
|
1330
|
-
|
|
1408
|
+
) : v === "advanced" ? /* @__PURE__ */ e(Ot, { id: `profile_${o.componentName}`, onRender: un, children: /* @__PURE__ */ e(
|
|
1409
|
+
St,
|
|
1331
1410
|
{
|
|
1332
|
-
id:
|
|
1333
|
-
viewName:
|
|
1334
|
-
apiVersion:
|
|
1335
|
-
ref:
|
|
1336
|
-
variant:
|
|
1337
|
-
expandedFilter:
|
|
1338
|
-
persistenceDelegator:
|
|
1339
|
-
currentFilter:
|
|
1340
|
-
activeFilterIndex:
|
|
1341
|
-
onSelectedFilter:
|
|
1342
|
-
onFilterChanged:
|
|
1343
|
-
onSearchByFilter:
|
|
1344
|
-
onToggleExpandedFilter:
|
|
1411
|
+
id: o.componentName,
|
|
1412
|
+
viewName: o.viewName,
|
|
1413
|
+
apiVersion: o.apiVersion,
|
|
1414
|
+
ref: _,
|
|
1415
|
+
variant: y || z.variant,
|
|
1416
|
+
expandedFilter: k.expandedFilter,
|
|
1417
|
+
persistenceDelegator: I,
|
|
1418
|
+
currentFilter: k.currentFilter,
|
|
1419
|
+
activeFilterIndex: k.activeFilterIndex,
|
|
1420
|
+
onSelectedFilter: A,
|
|
1421
|
+
onFilterChanged: Fe,
|
|
1422
|
+
onSearchByFilter: ce,
|
|
1423
|
+
onToggleExpandedFilter: Ie,
|
|
1345
1424
|
width: "660px",
|
|
1346
1425
|
height: "170px",
|
|
1347
1426
|
children: r
|
|
1348
1427
|
}
|
|
1349
|
-
) }) : /* @__PURE__ */ e(
|
|
1428
|
+
) }) : /* @__PURE__ */ e(Me, {}), Te = { ...{
|
|
1350
1429
|
headerFlexGrow: "left",
|
|
1351
1430
|
footerGridColumns: {}
|
|
1352
|
-
}, ...
|
|
1431
|
+
}, ...M };
|
|
1353
1432
|
return /* @__PURE__ */ e(
|
|
1354
|
-
|
|
1433
|
+
Ge,
|
|
1355
1434
|
{
|
|
1356
|
-
resourceName:
|
|
1357
|
-
resourceDescription:
|
|
1358
|
-
requiredPermissions:
|
|
1359
|
-
fallbackComponent:
|
|
1360
|
-
onSecurityReady:
|
|
1361
|
-
onAccessDenied:
|
|
1435
|
+
resourceName: E,
|
|
1436
|
+
resourceDescription: te,
|
|
1437
|
+
requiredPermissions: se,
|
|
1438
|
+
fallbackComponent: ne,
|
|
1439
|
+
onSecurityReady: H?.onSecurityReady,
|
|
1440
|
+
onAccessDenied: H?.onAccessDenied,
|
|
1362
1441
|
children: /* @__PURE__ */ e(
|
|
1363
|
-
|
|
1442
|
+
jt,
|
|
1364
1443
|
{
|
|
1365
|
-
innerRef:
|
|
1366
|
-
width:
|
|
1367
|
-
height:
|
|
1368
|
-
radius:
|
|
1369
|
-
withBorder:
|
|
1370
|
-
isError:
|
|
1371
|
-
error:
|
|
1372
|
-
clearError:
|
|
1444
|
+
innerRef: O,
|
|
1445
|
+
width: l,
|
|
1446
|
+
height: s,
|
|
1447
|
+
radius: R,
|
|
1448
|
+
withBorder: L,
|
|
1449
|
+
isError: a,
|
|
1450
|
+
error: C,
|
|
1451
|
+
clearError: P,
|
|
1373
1452
|
title: t,
|
|
1374
|
-
defaultDebug:
|
|
1375
|
-
debugOptions:
|
|
1376
|
-
style:
|
|
1377
|
-
options:
|
|
1378
|
-
headerLeft:
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1453
|
+
defaultDebug: u,
|
|
1454
|
+
debugOptions: ee,
|
|
1455
|
+
style: G,
|
|
1456
|
+
options: Te,
|
|
1457
|
+
headerLeft: m?.visible !== !1 ? /* @__PURE__ */ c(pe, { gap: "8px", rowGap: "8px", children: [
|
|
1458
|
+
m?.customUserActions && m?.customUserActionsPosition === "left" ? m.customUserActions : null,
|
|
1459
|
+
m?.allowAdd !== !1 && m?.onAddExecute ? /* @__PURE__ */ e(
|
|
1460
|
+
J,
|
|
1382
1461
|
{
|
|
1383
1462
|
actionName: "add",
|
|
1384
|
-
actionDescription: `Adicionar novo ${
|
|
1463
|
+
actionDescription: `Adicionar novo ${te || "registro"}`,
|
|
1385
1464
|
color: "green",
|
|
1386
|
-
variant:
|
|
1387
|
-
leftSection: /* @__PURE__ */ e(
|
|
1388
|
-
onClick: () =>
|
|
1389
|
-
children:
|
|
1465
|
+
variant: y ?? z.variant,
|
|
1466
|
+
leftSection: /* @__PURE__ */ e(bt, {}),
|
|
1467
|
+
onClick: () => m.onAddExecute(),
|
|
1468
|
+
children: m.labelAdd || x().t("archbase:New")
|
|
1390
1469
|
}
|
|
1391
1470
|
) : null,
|
|
1392
|
-
|
|
1393
|
-
|
|
1471
|
+
m?.allowEdit !== !1 && m?.onEditExecute ? /* @__PURE__ */ e(
|
|
1472
|
+
J,
|
|
1394
1473
|
{
|
|
1395
1474
|
actionName: "edit",
|
|
1396
|
-
actionDescription: `Editar ${
|
|
1475
|
+
actionDescription: `Editar ${te || "registro"}`,
|
|
1397
1476
|
color: "blue",
|
|
1398
|
-
leftSection: /* @__PURE__ */ e(
|
|
1477
|
+
leftSection: /* @__PURE__ */ e(wt, {}),
|
|
1399
1478
|
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
1400
|
-
variant:
|
|
1401
|
-
onClick: () =>
|
|
1402
|
-
children:
|
|
1479
|
+
variant: y ?? z.variant,
|
|
1480
|
+
onClick: () => m.onEditExecute(),
|
|
1481
|
+
children: m.labelEdit || x().t("archbase:Edit")
|
|
1403
1482
|
}
|
|
1404
1483
|
) : null,
|
|
1405
|
-
|
|
1406
|
-
|
|
1484
|
+
m?.allowRemove !== !1 && m?.onRemoveExecute ? /* @__PURE__ */ e(
|
|
1485
|
+
J,
|
|
1407
1486
|
{
|
|
1408
1487
|
actionName: "delete",
|
|
1409
|
-
actionDescription: `Remover ${
|
|
1488
|
+
actionDescription: `Remover ${te || "registro"}`,
|
|
1410
1489
|
color: "red",
|
|
1411
|
-
leftSection: /* @__PURE__ */ e(
|
|
1490
|
+
leftSection: /* @__PURE__ */ e(tt, {}),
|
|
1412
1491
|
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
1413
|
-
variant:
|
|
1414
|
-
onClick: () =>
|
|
1415
|
-
children:
|
|
1492
|
+
variant: y ?? z.variant,
|
|
1493
|
+
onClick: () => m.onRemoveExecute(),
|
|
1494
|
+
children: m.labelRemove || x().t("archbase:Remove")
|
|
1416
1495
|
}
|
|
1417
1496
|
) : null,
|
|
1418
|
-
|
|
1419
|
-
|
|
1497
|
+
m?.allowView !== !1 && m?.onViewExecute ? /* @__PURE__ */ e(
|
|
1498
|
+
J,
|
|
1420
1499
|
{
|
|
1421
1500
|
actionName: "view",
|
|
1422
|
-
actionDescription: `Visualizar ${
|
|
1501
|
+
actionDescription: `Visualizar ${te || "registro"}`,
|
|
1423
1502
|
color: "gray.7",
|
|
1424
|
-
leftSection: /* @__PURE__ */ e(
|
|
1503
|
+
leftSection: /* @__PURE__ */ e(Ft, {}),
|
|
1425
1504
|
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
1426
|
-
variant:
|
|
1427
|
-
onClick: () =>
|
|
1428
|
-
children:
|
|
1505
|
+
variant: y ?? z.variant,
|
|
1506
|
+
onClick: () => m.onViewExecute(),
|
|
1507
|
+
children: m.labelView || x().t("archbase:View")
|
|
1429
1508
|
}
|
|
1430
1509
|
) : null,
|
|
1431
|
-
|
|
1510
|
+
m?.customUserActions && m?.customUserActionsPosition === "right" ? m.customUserActions : null
|
|
1432
1511
|
] }) : void 0,
|
|
1433
|
-
headerRight:
|
|
1434
|
-
footerRight:
|
|
1512
|
+
headerRight: S(),
|
|
1513
|
+
footerRight: w ? /* @__PURE__ */ e(kt, { total: n.getTotalPages(), onChange: re }) : void 0,
|
|
1435
1514
|
children: /* @__PURE__ */ e(
|
|
1436
|
-
|
|
1515
|
+
Zt,
|
|
1437
1516
|
{
|
|
1438
1517
|
value: {
|
|
1439
1518
|
dataSource: n,
|
|
1440
|
-
ownerId:
|
|
1441
|
-
handleSelectItem:
|
|
1442
|
-
activeBackgroundColor:
|
|
1443
|
-
activeColor:
|
|
1444
|
-
onItemEnter:
|
|
1445
|
-
onItemLeave:
|
|
1519
|
+
ownerId: U,
|
|
1520
|
+
handleSelectItem: Ne,
|
|
1521
|
+
activeBackgroundColor: X,
|
|
1522
|
+
activeColor: Z,
|
|
1523
|
+
onItemEnter: ae,
|
|
1524
|
+
onItemLeave: W
|
|
1446
1525
|
},
|
|
1447
|
-
children: /* @__PURE__ */ e(
|
|
1526
|
+
children: /* @__PURE__ */ e(en, { columnsCountBreakPoints: D, children: /* @__PURE__ */ e(tn, { gutter: V, columnsCount: N, children: xe }) })
|
|
1448
1527
|
}
|
|
1449
1528
|
)
|
|
1450
1529
|
}
|
|
@@ -1452,7 +1531,7 @@ function Tn({
|
|
|
1452
1531
|
}
|
|
1453
1532
|
);
|
|
1454
1533
|
}
|
|
1455
|
-
const
|
|
1534
|
+
const fn = {
|
|
1456
1535
|
visible: !0,
|
|
1457
1536
|
allowAdd: !0,
|
|
1458
1537
|
allowEdit: !0,
|
|
@@ -1460,499 +1539,899 @@ const sn = {
|
|
|
1460
1539
|
allowRemove: !0,
|
|
1461
1540
|
positionCustomUserActions: "after"
|
|
1462
1541
|
};
|
|
1463
|
-
function
|
|
1542
|
+
function Pn({
|
|
1464
1543
|
title: t,
|
|
1465
1544
|
dataSource: n,
|
|
1466
1545
|
// dataSourceEdition,
|
|
1467
|
-
filterOptions:
|
|
1546
|
+
filterOptions: o,
|
|
1468
1547
|
//pageSize,
|
|
1469
1548
|
filterFields: f,
|
|
1470
1549
|
innerRef: r,
|
|
1471
1550
|
//isLoading = false,
|
|
1472
1551
|
isError: i = !1,
|
|
1473
|
-
error:
|
|
1474
|
-
clearError:
|
|
1552
|
+
error: u = "",
|
|
1553
|
+
clearError: v = () => {
|
|
1475
1554
|
},
|
|
1476
|
-
width:
|
|
1477
|
-
height:
|
|
1478
|
-
withBorder:
|
|
1479
|
-
filterPersistenceDelegator:
|
|
1480
|
-
withPagination:
|
|
1481
|
-
children:
|
|
1482
|
-
radius:
|
|
1483
|
-
userActions:
|
|
1484
|
-
debug:
|
|
1485
|
-
variant:
|
|
1486
|
-
actionsButtonsOptions:
|
|
1487
|
-
spaceOptions:
|
|
1488
|
-
style:
|
|
1489
|
-
debugOptions:
|
|
1555
|
+
width: a = "100%",
|
|
1556
|
+
height: C = "100%",
|
|
1557
|
+
withBorder: P = !0,
|
|
1558
|
+
filterPersistenceDelegator: l,
|
|
1559
|
+
withPagination: s = !0,
|
|
1560
|
+
children: L,
|
|
1561
|
+
radius: I,
|
|
1562
|
+
userActions: w,
|
|
1563
|
+
debug: R = !1,
|
|
1564
|
+
variant: m,
|
|
1565
|
+
actionsButtonsOptions: D,
|
|
1566
|
+
spaceOptions: N,
|
|
1567
|
+
style: V,
|
|
1568
|
+
debugOptions: F,
|
|
1490
1569
|
// Props de segurança (opcionais)
|
|
1491
|
-
resourceName:
|
|
1492
|
-
resourceDescription:
|
|
1493
|
-
requiredPermissions:
|
|
1494
|
-
fallbackComponent:
|
|
1495
|
-
securityOptions:
|
|
1570
|
+
resourceName: h,
|
|
1571
|
+
resourceDescription: X,
|
|
1572
|
+
requiredPermissions: Z,
|
|
1573
|
+
fallbackComponent: ae,
|
|
1574
|
+
securityOptions: W
|
|
1496
1575
|
}) {
|
|
1497
|
-
const
|
|
1498
|
-
autoRegisterActions:
|
|
1499
|
-
}),
|
|
1576
|
+
const G = ze(), M = Pe({
|
|
1577
|
+
autoRegisterActions: W?.autoRegisterActions ?? !0
|
|
1578
|
+
}), y = r || Ae(null), U = Ae(null), [ee, E] = Q({
|
|
1500
1579
|
activeFilterIndex: -1,
|
|
1501
1580
|
expandedFilter: !1
|
|
1502
1581
|
}), {
|
|
1503
|
-
isDataSourceV2:
|
|
1504
|
-
v1State: { forceUpdate:
|
|
1505
|
-
} =
|
|
1582
|
+
isDataSourceV2: te,
|
|
1583
|
+
v1State: { forceUpdate: se }
|
|
1584
|
+
} = _e(
|
|
1506
1585
|
"ArchbasePanelTemplate",
|
|
1507
1586
|
n
|
|
1508
|
-
),
|
|
1509
|
-
const
|
|
1510
|
-
return
|
|
1587
|
+
), ne = He(() => {
|
|
1588
|
+
const d = { ...fn, ...w }, k = (we) => M.isAvailable ? (M.registerAction(), M.hasPermission()) : !0, $ = [];
|
|
1589
|
+
return d.allowAdd && d.onAddExecute && k() && $.push({
|
|
1511
1590
|
id: "1",
|
|
1512
|
-
icon: /* @__PURE__ */ e(
|
|
1591
|
+
icon: /* @__PURE__ */ e(bt, {}),
|
|
1513
1592
|
color: "green",
|
|
1514
|
-
label:
|
|
1593
|
+
label: d.labelAdd ? d.labelAdd : x().t("archbase:New"),
|
|
1515
1594
|
executeAction: () => {
|
|
1516
|
-
|
|
1595
|
+
d && d.onAddExecute && d.onAddExecute();
|
|
1517
1596
|
},
|
|
1518
1597
|
enabled: !0,
|
|
1519
1598
|
hint: "Clique para criar."
|
|
1520
|
-
}),
|
|
1599
|
+
}), d.allowEdit && d.onEditExecute && k() && $.push({
|
|
1521
1600
|
id: "2",
|
|
1522
|
-
icon: /* @__PURE__ */ e(
|
|
1601
|
+
icon: /* @__PURE__ */ e(wt, {}),
|
|
1523
1602
|
color: "blue",
|
|
1524
|
-
label:
|
|
1603
|
+
label: d.labelEdit ? d.labelEdit : x().t("archbase:Edit"),
|
|
1525
1604
|
executeAction: () => {
|
|
1526
|
-
|
|
1605
|
+
d && d.onEditExecute && d.onEditExecute();
|
|
1527
1606
|
},
|
|
1528
1607
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1529
1608
|
hint: "Clique para editar."
|
|
1530
|
-
}),
|
|
1609
|
+
}), d.allowRemove && d.onRemoveExecute && k() && $.push({
|
|
1531
1610
|
id: "3",
|
|
1532
|
-
icon: /* @__PURE__ */ e(
|
|
1611
|
+
icon: /* @__PURE__ */ e(tt, {}),
|
|
1533
1612
|
color: "red",
|
|
1534
|
-
label:
|
|
1613
|
+
label: d.labelRemove ? d.labelRemove : x().t("archbase:Remove"),
|
|
1535
1614
|
executeAction: () => {
|
|
1536
|
-
|
|
1615
|
+
d && d.onRemoveExecute && d.onRemoveExecute();
|
|
1537
1616
|
},
|
|
1538
1617
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1539
1618
|
hint: "Clique para remover."
|
|
1540
|
-
}),
|
|
1619
|
+
}), d.allowView && d.onView && k() && $.push({
|
|
1541
1620
|
id: "4",
|
|
1542
|
-
icon: /* @__PURE__ */ e(
|
|
1621
|
+
icon: /* @__PURE__ */ e(Ft, {}),
|
|
1543
1622
|
color: "green",
|
|
1544
|
-
label:
|
|
1623
|
+
label: d.labelView ? d.labelView : x().t("archbase:View"),
|
|
1545
1624
|
executeAction: () => {
|
|
1546
|
-
|
|
1625
|
+
d && d.onView && d.onView();
|
|
1547
1626
|
},
|
|
1548
1627
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1549
1628
|
hint: "Clique para visualizar."
|
|
1550
|
-
}),
|
|
1551
|
-
}, [
|
|
1552
|
-
|
|
1553
|
-
},
|
|
1554
|
-
|
|
1555
|
-
},
|
|
1556
|
-
|
|
1557
|
-
},
|
|
1558
|
-
},
|
|
1629
|
+
}), d.customUserActions && d.positionCustomUserActions === "before" ? [...d.customUserActions, ...$] : d.customUserActions && d.positionCustomUserActions === "after" ? [...$, ...d.customUserActions] : $;
|
|
1630
|
+
}, [w, n, M]), H = (d, k) => {
|
|
1631
|
+
E({ ...ee, currentFilter: d, activeFilterIndex: k });
|
|
1632
|
+
}, z = (d) => {
|
|
1633
|
+
E({ ...ee, expandedFilter: d });
|
|
1634
|
+
}, Y = (d, k) => {
|
|
1635
|
+
E({ ...ee, currentFilter: d, activeFilterIndex: k });
|
|
1636
|
+
}, O = () => {
|
|
1637
|
+
}, _ = {
|
|
1559
1638
|
menuButtonColor: "blue.5",
|
|
1560
1639
|
menuPosition: "left"
|
|
1561
|
-
},
|
|
1640
|
+
}, ue = {
|
|
1562
1641
|
headerFlexGrow: "left",
|
|
1563
1642
|
footerFlexGrow: "right"
|
|
1564
1643
|
// footerGridColumns: {},
|
|
1565
|
-
},
|
|
1644
|
+
}, Ce = { ..._, ...D }, le = { ...ue, ...N };
|
|
1566
1645
|
return /* @__PURE__ */ e(
|
|
1567
|
-
|
|
1646
|
+
Ge,
|
|
1568
1647
|
{
|
|
1569
|
-
resourceName:
|
|
1570
|
-
resourceDescription:
|
|
1571
|
-
requiredPermissions:
|
|
1572
|
-
fallbackComponent:
|
|
1573
|
-
onSecurityReady:
|
|
1574
|
-
onAccessDenied:
|
|
1648
|
+
resourceName: h,
|
|
1649
|
+
resourceDescription: X,
|
|
1650
|
+
requiredPermissions: Z,
|
|
1651
|
+
fallbackComponent: ae,
|
|
1652
|
+
onSecurityReady: W?.onSecurityReady,
|
|
1653
|
+
onAccessDenied: W?.onAccessDenied,
|
|
1575
1654
|
children: /* @__PURE__ */ e(
|
|
1576
|
-
|
|
1655
|
+
jt,
|
|
1577
1656
|
{
|
|
1578
|
-
innerRef:
|
|
1579
|
-
width:
|
|
1580
|
-
height:
|
|
1581
|
-
radius:
|
|
1582
|
-
withBorder:
|
|
1657
|
+
innerRef: y,
|
|
1658
|
+
width: a,
|
|
1659
|
+
height: C,
|
|
1660
|
+
radius: I,
|
|
1661
|
+
withBorder: P,
|
|
1583
1662
|
isError: i,
|
|
1584
|
-
error:
|
|
1585
|
-
clearError:
|
|
1663
|
+
error: u,
|
|
1664
|
+
clearError: v,
|
|
1586
1665
|
title: t,
|
|
1587
|
-
defaultDebug:
|
|
1588
|
-
debugOptions:
|
|
1589
|
-
style:
|
|
1590
|
-
options:
|
|
1591
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1666
|
+
defaultDebug: R,
|
|
1667
|
+
debugOptions: F,
|
|
1668
|
+
style: V,
|
|
1669
|
+
options: le,
|
|
1670
|
+
headerLeft: /* @__PURE__ */ e(nn, { actions: ne, options: Ce }),
|
|
1592
1671
|
headerRight: /* @__PURE__ */ e(
|
|
1593
|
-
|
|
1672
|
+
St,
|
|
1594
1673
|
{
|
|
1595
|
-
id:
|
|
1596
|
-
viewName:
|
|
1597
|
-
apiVersion:
|
|
1598
|
-
ref:
|
|
1599
|
-
variant:
|
|
1600
|
-
expandedFilter:
|
|
1601
|
-
persistenceDelegator:
|
|
1602
|
-
currentFilter:
|
|
1603
|
-
activeFilterIndex:
|
|
1604
|
-
onSelectedFilter:
|
|
1605
|
-
onFilterChanged:
|
|
1606
|
-
onSearchByFilter:
|
|
1607
|
-
onToggleExpandedFilter:
|
|
1674
|
+
id: o.componentName,
|
|
1675
|
+
viewName: o.viewName,
|
|
1676
|
+
apiVersion: o.apiVersion,
|
|
1677
|
+
ref: U,
|
|
1678
|
+
variant: m || G.variant,
|
|
1679
|
+
expandedFilter: ee.expandedFilter,
|
|
1680
|
+
persistenceDelegator: l,
|
|
1681
|
+
currentFilter: ee.currentFilter,
|
|
1682
|
+
activeFilterIndex: ee.activeFilterIndex,
|
|
1683
|
+
onSelectedFilter: Y,
|
|
1684
|
+
onFilterChanged: H,
|
|
1685
|
+
onSearchByFilter: O,
|
|
1686
|
+
onToggleExpandedFilter: z,
|
|
1608
1687
|
width: "660px",
|
|
1609
1688
|
height: "170px",
|
|
1610
1689
|
children: f
|
|
1611
1690
|
}
|
|
1612
1691
|
),
|
|
1613
|
-
footerRight:
|
|
1614
|
-
children:
|
|
1692
|
+
footerRight: s && /* @__PURE__ */ e(kt, { total: 10 }),
|
|
1693
|
+
children: L
|
|
1615
1694
|
}
|
|
1616
1695
|
)
|
|
1617
1696
|
}
|
|
1618
1697
|
);
|
|
1619
1698
|
}
|
|
1620
|
-
function
|
|
1699
|
+
function Gn() {
|
|
1621
1700
|
return /* @__PURE__ */ e("div", { children: "SEARCH TEMPLATE" });
|
|
1622
1701
|
}
|
|
1623
|
-
function
|
|
1702
|
+
function $n({
|
|
1703
|
+
// Header
|
|
1704
|
+
title: t,
|
|
1705
|
+
subtitle: n,
|
|
1706
|
+
onBack: o,
|
|
1707
|
+
headerActions: f,
|
|
1708
|
+
showDeleteButton: r = !1,
|
|
1709
|
+
onDelete: i,
|
|
1710
|
+
saveLabel: u,
|
|
1711
|
+
cancelLabel: v,
|
|
1712
|
+
buttonsPosition: a = "header",
|
|
1713
|
+
// Left Column
|
|
1714
|
+
leftColumnContent: C,
|
|
1715
|
+
leftColumnSpan: P = 6,
|
|
1716
|
+
hideLeftColumn: l = !1,
|
|
1717
|
+
// Right Column - Form
|
|
1718
|
+
formTitle: s,
|
|
1719
|
+
formSubtitle: L,
|
|
1720
|
+
statusBadge: I,
|
|
1721
|
+
tabs: w,
|
|
1722
|
+
defaultTab: R,
|
|
1723
|
+
tabsVariant: m = "default",
|
|
1724
|
+
children: D,
|
|
1725
|
+
// Layout
|
|
1726
|
+
width: N = "100%",
|
|
1727
|
+
height: V = "100%",
|
|
1728
|
+
withBorder: F = !0,
|
|
1729
|
+
radius: h,
|
|
1730
|
+
style: X,
|
|
1731
|
+
// States
|
|
1732
|
+
innerRef: Z,
|
|
1733
|
+
isLoading: ae = !1,
|
|
1734
|
+
isCanceling: W = !1,
|
|
1735
|
+
isSaving: G = !1,
|
|
1736
|
+
isError: M = !1,
|
|
1737
|
+
error: y = "",
|
|
1738
|
+
clearError: U = () => {
|
|
1739
|
+
},
|
|
1740
|
+
autoCloseAlertError: ee = 15e3,
|
|
1741
|
+
// DataSource
|
|
1742
|
+
dataSource: E,
|
|
1743
|
+
variant: te,
|
|
1744
|
+
// Callbacks
|
|
1745
|
+
onSave: se,
|
|
1746
|
+
onCancel: ne,
|
|
1747
|
+
onBeforeSave: H,
|
|
1748
|
+
onAfterSave: z,
|
|
1749
|
+
onBeforeCancel: Y,
|
|
1750
|
+
onAfterCancel: O,
|
|
1751
|
+
onError: _,
|
|
1752
|
+
// Navigation
|
|
1753
|
+
routePath: ue,
|
|
1754
|
+
onBeforeClose: Ce,
|
|
1755
|
+
useNavigationListener: le,
|
|
1756
|
+
// Security
|
|
1757
|
+
resourceName: d,
|
|
1758
|
+
resourceDescription: k,
|
|
1759
|
+
requiredPermissions: $,
|
|
1760
|
+
fallbackComponent: we,
|
|
1761
|
+
securityOptions: de,
|
|
1762
|
+
...B
|
|
1763
|
+
}) {
|
|
1764
|
+
const me = ze(), [xe, Fe] = Q(M), [Ie, A] = Q(y), [ce, Ne] = Q(R || (w?.[0]?.value ?? null)), De = ot();
|
|
1765
|
+
Pe({
|
|
1766
|
+
autoRegisterActions: de?.autoRegisterActions ?? !0
|
|
1767
|
+
});
|
|
1768
|
+
const re = _e(
|
|
1769
|
+
"ArchbaseTwoColumnFormTemplate",
|
|
1770
|
+
E,
|
|
1771
|
+
void 0,
|
|
1772
|
+
void 0
|
|
1773
|
+
);
|
|
1774
|
+
nt({
|
|
1775
|
+
dataSource: E,
|
|
1776
|
+
listener: (b) => {
|
|
1777
|
+
b.type === Re.onError && (Fe(!0), A(b.error)), (b.type === Re.afterEdit || b.type === Re.afterInsert) && (re.isDataSourceV2 || De());
|
|
1778
|
+
}
|
|
1779
|
+
});
|
|
1780
|
+
const S = Nt(), $e = ie((b, Ee) => ({
|
|
1781
|
+
closeAllowed: (je) => {
|
|
1782
|
+
}
|
|
1783
|
+
}), []), Te = le || $e, { closeAllowed: g } = Te(ue || "", () => {
|
|
1784
|
+
Ce && Ce() === !1 || g();
|
|
1785
|
+
}), j = async (b) => {
|
|
1786
|
+
try {
|
|
1787
|
+
se ? se(b) : (H && await H(b), E.isBrowsing() || E.save().then(() => {
|
|
1788
|
+
S?.clearAll(), z && z(b), g();
|
|
1789
|
+
}).catch((Ee) => {
|
|
1790
|
+
_ && _(fe(Ee)), Fe(!0), A(fe(Ee));
|
|
1791
|
+
}));
|
|
1792
|
+
} catch (Ee) {
|
|
1793
|
+
_ && _(fe(Ee)), Fe(!0), A(fe(Ee));
|
|
1794
|
+
}
|
|
1795
|
+
}, q = () => {
|
|
1796
|
+
try {
|
|
1797
|
+
ne ? ne(g) : (Y && Y(), E.isBrowsing() || E.cancel(), S?.clearAll(), O && O(), g());
|
|
1798
|
+
} catch (b) {
|
|
1799
|
+
_ && _(fe(b)), Fe(!0), A(fe(b));
|
|
1800
|
+
}
|
|
1801
|
+
}, ge = () => {
|
|
1802
|
+
U && U(), Fe(!1), A("");
|
|
1803
|
+
}, ve = l ? 12 : 12 - P, ke = E && !E.isBrowsing(), Ve = a === "header" || a === "both", Ue = a === "footer" || a === "both", qe = () => /* @__PURE__ */ e(oe, { gap: "sm", children: ke ? /* @__PURE__ */ c(Me, { children: [
|
|
1804
|
+
/* @__PURE__ */ e(
|
|
1805
|
+
J,
|
|
1806
|
+
{
|
|
1807
|
+
actionName: "cancel",
|
|
1808
|
+
actionDescription: "Cancelar operação",
|
|
1809
|
+
leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
1810
|
+
onClick: q,
|
|
1811
|
+
variant: "default",
|
|
1812
|
+
loading: W,
|
|
1813
|
+
children: v || x().t("Cancel")
|
|
1814
|
+
}
|
|
1815
|
+
),
|
|
1816
|
+
/* @__PURE__ */ e(
|
|
1817
|
+
J,
|
|
1818
|
+
{
|
|
1819
|
+
actionName: "save",
|
|
1820
|
+
actionDescription: `Salvar ${k || "registro"}`,
|
|
1821
|
+
leftSection: /* @__PURE__ */ e(xt, { size: 16 }),
|
|
1822
|
+
onClick: () => j(E.getCurrentRecord()),
|
|
1823
|
+
variant: te ?? me.variant,
|
|
1824
|
+
color: "blue",
|
|
1825
|
+
loading: G,
|
|
1826
|
+
children: u || x().t("Ok")
|
|
1827
|
+
}
|
|
1828
|
+
)
|
|
1829
|
+
] }) : /* @__PURE__ */ e(
|
|
1830
|
+
J,
|
|
1831
|
+
{
|
|
1832
|
+
actionName: "close",
|
|
1833
|
+
actionDescription: "Fechar formulário",
|
|
1834
|
+
leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
|
|
1835
|
+
onClick: q,
|
|
1836
|
+
variant: "default",
|
|
1837
|
+
children: x().t("Close")
|
|
1838
|
+
}
|
|
1839
|
+
) });
|
|
1840
|
+
return /* @__PURE__ */ e(
|
|
1841
|
+
Ge,
|
|
1842
|
+
{
|
|
1843
|
+
resourceName: d,
|
|
1844
|
+
resourceDescription: k,
|
|
1845
|
+
requiredPermissions: $,
|
|
1846
|
+
fallbackComponent: we,
|
|
1847
|
+
onSecurityReady: de?.onSecurityReady,
|
|
1848
|
+
onAccessDenied: de?.onAccessDenied,
|
|
1849
|
+
children: /* @__PURE__ */ e(At, { children: /* @__PURE__ */ c(
|
|
1850
|
+
Le,
|
|
1851
|
+
{
|
|
1852
|
+
ref: Z,
|
|
1853
|
+
withBorder: F,
|
|
1854
|
+
radius: h,
|
|
1855
|
+
style: {
|
|
1856
|
+
width: N,
|
|
1857
|
+
height: V,
|
|
1858
|
+
display: "flex",
|
|
1859
|
+
flexDirection: "column",
|
|
1860
|
+
...X
|
|
1861
|
+
},
|
|
1862
|
+
children: [
|
|
1863
|
+
/* @__PURE__ */ e(
|
|
1864
|
+
he,
|
|
1865
|
+
{
|
|
1866
|
+
style: {
|
|
1867
|
+
flexShrink: 0,
|
|
1868
|
+
padding: "16px 24px",
|
|
1869
|
+
borderBottom: "1px solid var(--mantine-color-gray-2)"
|
|
1870
|
+
},
|
|
1871
|
+
children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
|
|
1872
|
+
/* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
1873
|
+
o && /* @__PURE__ */ e(
|
|
1874
|
+
pt,
|
|
1875
|
+
{
|
|
1876
|
+
variant: "subtle",
|
|
1877
|
+
color: "gray",
|
|
1878
|
+
size: "lg",
|
|
1879
|
+
onClick: o,
|
|
1880
|
+
style: { border: "1px solid var(--mantine-color-gray-3)" },
|
|
1881
|
+
children: /* @__PURE__ */ e(Bt, { size: 18 })
|
|
1882
|
+
}
|
|
1883
|
+
),
|
|
1884
|
+
/* @__PURE__ */ c(he, { children: [
|
|
1885
|
+
/* @__PURE__ */ e(Tt, { order: 4, fw: 600, children: t }),
|
|
1886
|
+
n && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", children: n })
|
|
1887
|
+
] })
|
|
1888
|
+
] }),
|
|
1889
|
+
/* @__PURE__ */ c(oe, { gap: "sm", children: [
|
|
1890
|
+
f?.map((b) => /* @__PURE__ */ e(
|
|
1891
|
+
We,
|
|
1892
|
+
{
|
|
1893
|
+
variant: b.variant || "subtle",
|
|
1894
|
+
color: b.color,
|
|
1895
|
+
leftSection: b.icon,
|
|
1896
|
+
onClick: b.onClick,
|
|
1897
|
+
disabled: b.disabled,
|
|
1898
|
+
loading: b.loading,
|
|
1899
|
+
children: b.label
|
|
1900
|
+
},
|
|
1901
|
+
b.id
|
|
1902
|
+
)),
|
|
1903
|
+
r && i && /* @__PURE__ */ e(
|
|
1904
|
+
pt,
|
|
1905
|
+
{
|
|
1906
|
+
variant: "subtle",
|
|
1907
|
+
color: "red",
|
|
1908
|
+
size: "lg",
|
|
1909
|
+
onClick: i,
|
|
1910
|
+
style: { border: "1px solid var(--mantine-color-gray-3)" },
|
|
1911
|
+
children: /* @__PURE__ */ e(tt, { size: 18 })
|
|
1912
|
+
}
|
|
1913
|
+
),
|
|
1914
|
+
Ve && qe()
|
|
1915
|
+
] })
|
|
1916
|
+
] })
|
|
1917
|
+
}
|
|
1918
|
+
),
|
|
1919
|
+
xe && /* @__PURE__ */ e(he, { style: { flexShrink: 0, padding: "0 24px" }, children: /* @__PURE__ */ e(
|
|
1920
|
+
Ke,
|
|
1921
|
+
{
|
|
1922
|
+
autoClose: ee,
|
|
1923
|
+
withCloseButton: !0,
|
|
1924
|
+
withBorder: !0,
|
|
1925
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
1926
|
+
title: x().t("WARNING"),
|
|
1927
|
+
titleColor: "rgb(250, 82, 82)",
|
|
1928
|
+
variant: te ?? me.variant,
|
|
1929
|
+
onClose: ge,
|
|
1930
|
+
children: /* @__PURE__ */ e("span", { children: Ie })
|
|
1931
|
+
}
|
|
1932
|
+
) }),
|
|
1933
|
+
/* @__PURE__ */ c(he, { style: { flex: 1, minHeight: 0, padding: "24px" }, children: [
|
|
1934
|
+
/* @__PURE__ */ e(vt, { visible: ae || W || G, opacity: 0.3 }),
|
|
1935
|
+
/* @__PURE__ */ c(be, { gutter: "xl", style: { height: "100%" }, children: [
|
|
1936
|
+
!l && /* @__PURE__ */ e(be.Col, { span: { base: 12, md: P }, children: /* @__PURE__ */ e(Xe, { style: { height: "100%" }, children: /* @__PURE__ */ e(yt, { gap: "md", children: C }) }) }),
|
|
1937
|
+
/* @__PURE__ */ e(be.Col, { span: { base: 12, md: ve }, children: /* @__PURE__ */ c(
|
|
1938
|
+
Le,
|
|
1939
|
+
{
|
|
1940
|
+
withBorder: !0,
|
|
1941
|
+
radius: "md",
|
|
1942
|
+
style: {
|
|
1943
|
+
height: "100%",
|
|
1944
|
+
display: "flex",
|
|
1945
|
+
flexDirection: "column",
|
|
1946
|
+
backgroundColor: "var(--mantine-color-white)"
|
|
1947
|
+
},
|
|
1948
|
+
children: [
|
|
1949
|
+
(s || I) && /* @__PURE__ */ e(
|
|
1950
|
+
he,
|
|
1951
|
+
{
|
|
1952
|
+
style: {
|
|
1953
|
+
flexShrink: 0,
|
|
1954
|
+
padding: "16px 20px",
|
|
1955
|
+
borderBottom: w ? "1px solid var(--mantine-color-gray-2)" : "none"
|
|
1956
|
+
},
|
|
1957
|
+
children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "flex-start", children: [
|
|
1958
|
+
/* @__PURE__ */ c(he, { children: [
|
|
1959
|
+
s && /* @__PURE__ */ e(ye, { fw: 600, size: "lg", children: s }),
|
|
1960
|
+
L && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", mt: 4, children: L })
|
|
1961
|
+
] }),
|
|
1962
|
+
I
|
|
1963
|
+
] })
|
|
1964
|
+
}
|
|
1965
|
+
),
|
|
1966
|
+
/* @__PURE__ */ e(he, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: w && w.length > 0 ? /* @__PURE__ */ c(
|
|
1967
|
+
rt,
|
|
1968
|
+
{
|
|
1969
|
+
value: ce,
|
|
1970
|
+
onChange: Ne,
|
|
1971
|
+
variant: m,
|
|
1972
|
+
style: { flex: 1, display: "flex", flexDirection: "column" },
|
|
1973
|
+
children: [
|
|
1974
|
+
/* @__PURE__ */ e(rt.List, { style: { flexShrink: 0, padding: "0 20px" }, children: w.map((b) => /* @__PURE__ */ e(
|
|
1975
|
+
rt.Tab,
|
|
1976
|
+
{
|
|
1977
|
+
value: b.value,
|
|
1978
|
+
leftSection: b.icon,
|
|
1979
|
+
children: b.label
|
|
1980
|
+
},
|
|
1981
|
+
b.value
|
|
1982
|
+
)) }),
|
|
1983
|
+
w.map((b) => /* @__PURE__ */ e(
|
|
1984
|
+
rt.Panel,
|
|
1985
|
+
{
|
|
1986
|
+
value: b.value,
|
|
1987
|
+
style: { flex: 1, minHeight: 0 },
|
|
1988
|
+
children: /* @__PURE__ */ e(Xe, { style: { height: "100%", padding: "20px" }, children: b.content })
|
|
1989
|
+
},
|
|
1990
|
+
b.value
|
|
1991
|
+
))
|
|
1992
|
+
]
|
|
1993
|
+
}
|
|
1994
|
+
) : /* @__PURE__ */ e(Xe, { style: { flex: 1, padding: "20px" }, children: D }) })
|
|
1995
|
+
]
|
|
1996
|
+
}
|
|
1997
|
+
) })
|
|
1998
|
+
] })
|
|
1999
|
+
] }),
|
|
2000
|
+
Ue && /* @__PURE__ */ e(
|
|
2001
|
+
he,
|
|
2002
|
+
{
|
|
2003
|
+
style: {
|
|
2004
|
+
flexShrink: 0,
|
|
2005
|
+
padding: "16px 24px",
|
|
2006
|
+
borderTop: "1px solid var(--mantine-color-gray-2)",
|
|
2007
|
+
display: "flex",
|
|
2008
|
+
justifyContent: "flex-end"
|
|
2009
|
+
},
|
|
2010
|
+
children: qe()
|
|
2011
|
+
}
|
|
2012
|
+
)
|
|
2013
|
+
]
|
|
2014
|
+
}
|
|
2015
|
+
) })
|
|
2016
|
+
}
|
|
2017
|
+
);
|
|
2018
|
+
}
|
|
2019
|
+
function jn({ title: t, description: n, headerAction: o, children: f }) {
|
|
2020
|
+
return /* @__PURE__ */ c(Le, { withBorder: !0, radius: "md", p: "md", children: [
|
|
2021
|
+
/* @__PURE__ */ c(pe, { justify: "space-between", align: "flex-start", mb: n || o ? "sm" : 0, children: [
|
|
2022
|
+
/* @__PURE__ */ c(he, { children: [
|
|
2023
|
+
/* @__PURE__ */ e(ye, { fw: 600, size: "sm", children: t }),
|
|
2024
|
+
n && /* @__PURE__ */ e(ye, { size: "xs", c: "dimmed", mt: 2, children: n })
|
|
2025
|
+
] }),
|
|
2026
|
+
o
|
|
2027
|
+
] }),
|
|
2028
|
+
f
|
|
2029
|
+
] });
|
|
2030
|
+
}
|
|
2031
|
+
function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImages: r = 6 }) {
|
|
2032
|
+
const i = t.find((a) => a.isCover) || t[0], u = t.filter((a) => a.id !== i?.id), v = t.length < r;
|
|
2033
|
+
return /* @__PURE__ */ c(yt, { gap: "sm", children: [
|
|
2034
|
+
i && /* @__PURE__ */ c(he, { style: { position: "relative" }, children: [
|
|
2035
|
+
/* @__PURE__ */ e(
|
|
2036
|
+
"img",
|
|
2037
|
+
{
|
|
2038
|
+
src: i.url,
|
|
2039
|
+
alt: i.alt || "Cover",
|
|
2040
|
+
style: {
|
|
2041
|
+
width: "100%",
|
|
2042
|
+
height: 200,
|
|
2043
|
+
objectFit: "cover",
|
|
2044
|
+
borderRadius: "var(--mantine-radius-md)",
|
|
2045
|
+
border: "1px solid var(--mantine-color-gray-3)"
|
|
2046
|
+
}
|
|
2047
|
+
}
|
|
2048
|
+
),
|
|
2049
|
+
/* @__PURE__ */ e(
|
|
2050
|
+
Ut,
|
|
2051
|
+
{
|
|
2052
|
+
style: { position: "absolute", bottom: 8, left: 8 },
|
|
2053
|
+
variant: "filled",
|
|
2054
|
+
color: "dark",
|
|
2055
|
+
children: "Cover"
|
|
2056
|
+
}
|
|
2057
|
+
)
|
|
2058
|
+
] }),
|
|
2059
|
+
/* @__PURE__ */ c(be, { gutter: "sm", children: [
|
|
2060
|
+
u.map((a) => /* @__PURE__ */ e(be.Col, { span: 4, children: /* @__PURE__ */ e(
|
|
2061
|
+
he,
|
|
2062
|
+
{
|
|
2063
|
+
style: { position: "relative", cursor: f ? "pointer" : "default" },
|
|
2064
|
+
onClick: () => f?.(a.id),
|
|
2065
|
+
children: /* @__PURE__ */ e(
|
|
2066
|
+
"img",
|
|
2067
|
+
{
|
|
2068
|
+
src: a.url,
|
|
2069
|
+
alt: a.alt || "Thumbnail",
|
|
2070
|
+
style: {
|
|
2071
|
+
width: "100%",
|
|
2072
|
+
height: 80,
|
|
2073
|
+
objectFit: "cover",
|
|
2074
|
+
borderRadius: "var(--mantine-radius-sm)",
|
|
2075
|
+
border: "1px solid var(--mantine-color-gray-3)"
|
|
2076
|
+
}
|
|
2077
|
+
}
|
|
2078
|
+
)
|
|
2079
|
+
}
|
|
2080
|
+
) }, a.id)),
|
|
2081
|
+
v && n && /* @__PURE__ */ e(be.Col, { span: 4, children: /* @__PURE__ */ e(
|
|
2082
|
+
he,
|
|
2083
|
+
{
|
|
2084
|
+
onClick: n,
|
|
2085
|
+
style: {
|
|
2086
|
+
width: "100%",
|
|
2087
|
+
height: 80,
|
|
2088
|
+
border: "2px dashed var(--mantine-color-gray-4)",
|
|
2089
|
+
borderRadius: "var(--mantine-radius-sm)",
|
|
2090
|
+
display: "flex",
|
|
2091
|
+
alignItems: "center",
|
|
2092
|
+
justifyContent: "center",
|
|
2093
|
+
cursor: "pointer",
|
|
2094
|
+
backgroundColor: "var(--mantine-color-gray-0)"
|
|
2095
|
+
},
|
|
2096
|
+
children: /* @__PURE__ */ e(ye, { size: "xl", c: "dimmed", children: "+" })
|
|
2097
|
+
}
|
|
2098
|
+
) })
|
|
2099
|
+
] })
|
|
2100
|
+
] });
|
|
2101
|
+
}
|
|
2102
|
+
function mn(t, n) {
|
|
1624
2103
|
const {
|
|
1625
2104
|
// Props obrigatórias
|
|
1626
|
-
opened:
|
|
2105
|
+
opened: o,
|
|
1627
2106
|
title: f,
|
|
1628
2107
|
children: r,
|
|
1629
2108
|
onClose: i,
|
|
1630
|
-
idField:
|
|
1631
|
-
displayField:
|
|
2109
|
+
idField: u,
|
|
2110
|
+
displayField: v,
|
|
1632
2111
|
// Seleção
|
|
1633
|
-
selectionMode:
|
|
1634
|
-
onSelect:
|
|
1635
|
-
onSelectMultiple:
|
|
1636
|
-
initialSelectedItems:
|
|
1637
|
-
selectOnDoubleClick:
|
|
1638
|
-
onBeforeConfirm:
|
|
1639
|
-
onAfterConfirm:
|
|
2112
|
+
selectionMode: a = "single",
|
|
2113
|
+
onSelect: C,
|
|
2114
|
+
onSelectMultiple: P,
|
|
2115
|
+
initialSelectedItems: l,
|
|
2116
|
+
selectOnDoubleClick: s = !0,
|
|
2117
|
+
onBeforeConfirm: L,
|
|
2118
|
+
onAfterConfirm: I,
|
|
1640
2119
|
// DataSource
|
|
1641
|
-
dataSource:
|
|
1642
|
-
loadData:
|
|
1643
|
-
searchFields:
|
|
1644
|
-
pageSize:
|
|
2120
|
+
dataSource: w,
|
|
2121
|
+
loadData: R,
|
|
2122
|
+
searchFields: m = "",
|
|
2123
|
+
pageSize: D = 100,
|
|
1645
2124
|
// Aparência
|
|
1646
|
-
displaySubField:
|
|
1647
|
-
renderSelectedItem:
|
|
1648
|
-
renderSelectedItems:
|
|
1649
|
-
icon:
|
|
1650
|
-
modalSize:
|
|
1651
|
-
modalHeight:
|
|
1652
|
-
gridHeight:
|
|
1653
|
-
rowHeight:
|
|
1654
|
-
selectionIndicatorColor:
|
|
1655
|
-
showSelectionIndicator:
|
|
2125
|
+
displaySubField: N,
|
|
2126
|
+
renderSelectedItem: V,
|
|
2127
|
+
renderSelectedItems: F,
|
|
2128
|
+
icon: h,
|
|
2129
|
+
modalSize: X = "70%",
|
|
2130
|
+
modalHeight: Z = "600px",
|
|
2131
|
+
gridHeight: ae = 400,
|
|
2132
|
+
rowHeight: W,
|
|
2133
|
+
selectionIndicatorColor: G = "blue.0",
|
|
2134
|
+
showSelectionIndicator: M = !0,
|
|
1656
2135
|
// Múltipla seleção
|
|
1657
|
-
maxSelections:
|
|
1658
|
-
showSelectionCount:
|
|
1659
|
-
allowClearAll:
|
|
2136
|
+
maxSelections: y,
|
|
2137
|
+
showSelectionCount: U = !0,
|
|
2138
|
+
allowClearAll: ee = !0,
|
|
1660
2139
|
// Estado
|
|
1661
|
-
isLoading:
|
|
1662
|
-
isError:
|
|
1663
|
-
error:
|
|
1664
|
-
clearError:
|
|
1665
|
-
autoCloseAlertError:
|
|
1666
|
-
onError:
|
|
2140
|
+
isLoading: E,
|
|
2141
|
+
isError: te = !1,
|
|
2142
|
+
error: se = "",
|
|
2143
|
+
clearError: ne,
|
|
2144
|
+
autoCloseAlertError: H = 15e3,
|
|
2145
|
+
onError: z,
|
|
1667
2146
|
// Customização
|
|
1668
|
-
userActions:
|
|
1669
|
-
labels:
|
|
1670
|
-
variant:
|
|
2147
|
+
userActions: Y,
|
|
2148
|
+
labels: O,
|
|
2149
|
+
variant: _,
|
|
1671
2150
|
// Segurança
|
|
1672
|
-
resourceName:
|
|
1673
|
-
resourceDescription:
|
|
1674
|
-
requiredPermissions:
|
|
1675
|
-
fallbackComponent:
|
|
1676
|
-
securityOptions:
|
|
1677
|
-
} = t,
|
|
2151
|
+
resourceName: ue,
|
|
2152
|
+
resourceDescription: Ce,
|
|
2153
|
+
requiredPermissions: le,
|
|
2154
|
+
fallbackComponent: d,
|
|
2155
|
+
securityOptions: k
|
|
2156
|
+
} = t, $ = ze(), we = at(), { colorScheme: de } = lt(), B = de === "dark", me = ot(), xe = B ? "dark.5" : G, [Fe, Ie] = Q(!1), [A, ce] = Q(l || []), [Ne, De] = Q(!1), [re, S] = Q(""), $e = Ae(null), Te = Ae([]), g = !!w, q = ie(() => g && w ? w : ($e.current || ($e.current = new Qt("dsLookup", {
|
|
1678
2157
|
records: [],
|
|
1679
2158
|
grandTotalRecords: 0,
|
|
1680
2159
|
currentPage: 0,
|
|
1681
2160
|
totalPages: 0,
|
|
1682
|
-
pageSize:
|
|
1683
|
-
})),
|
|
1684
|
-
|
|
1685
|
-
autoRegisterActions:
|
|
2161
|
+
pageSize: D
|
|
2162
|
+
})), $e.current), [g, w, D])();
|
|
2163
|
+
Pe({
|
|
2164
|
+
autoRegisterActions: k?.autoRegisterActions ?? !0
|
|
1686
2165
|
});
|
|
1687
|
-
const
|
|
2166
|
+
const ge = _e(
|
|
1688
2167
|
"ArchbaseLookupDataTemplate",
|
|
1689
|
-
|
|
2168
|
+
q,
|
|
1690
2169
|
void 0,
|
|
1691
2170
|
void 0
|
|
1692
2171
|
);
|
|
1693
2172
|
nt({
|
|
1694
|
-
dataSource:
|
|
1695
|
-
listener: (
|
|
1696
|
-
if (
|
|
1697
|
-
if (
|
|
1698
|
-
const
|
|
1699
|
-
|
|
2173
|
+
dataSource: q,
|
|
2174
|
+
listener: (p) => {
|
|
2175
|
+
if (p.type === Re.onError && (De(!0), S(p.error || "")), p.type === Re.afterScroll) {
|
|
2176
|
+
if (a === "single") {
|
|
2177
|
+
const K = q.getCurrentRecord();
|
|
2178
|
+
K && ce([K]);
|
|
1700
2179
|
}
|
|
1701
|
-
|
|
2180
|
+
ge.isDataSourceV2 || me();
|
|
1702
2181
|
}
|
|
1703
2182
|
}
|
|
1704
2183
|
});
|
|
1705
|
-
const
|
|
1706
|
-
okButton:
|
|
1707
|
-
cancelButton:
|
|
1708
|
-
clearButton:
|
|
1709
|
-
selectedLabel:
|
|
1710
|
-
doubleClickHint:
|
|
1711
|
-
noItemSelected:
|
|
1712
|
-
itemsSelected:
|
|
1713
|
-
...
|
|
2184
|
+
const ve = {
|
|
2185
|
+
okButton: x().t("archbase:Ok"),
|
|
2186
|
+
cancelButton: x().t("archbase:Cancel"),
|
|
2187
|
+
clearButton: x().t("archbase:Clear"),
|
|
2188
|
+
selectedLabel: x().t("archbase:Selected"),
|
|
2189
|
+
doubleClickHint: x().t("archbase:Double click to select"),
|
|
2190
|
+
noItemSelected: x().t("archbase:No item selected"),
|
|
2191
|
+
itemsSelected: x().t("archbase:items selected"),
|
|
2192
|
+
...O
|
|
1714
2193
|
};
|
|
1715
|
-
|
|
1716
|
-
if (
|
|
2194
|
+
et(() => {
|
|
2195
|
+
if (g)
|
|
1717
2196
|
return;
|
|
1718
|
-
const
|
|
1719
|
-
const
|
|
1720
|
-
if (
|
|
2197
|
+
const p = (K) => {
|
|
2198
|
+
const Je = Te.current;
|
|
2199
|
+
if (Je.length === 0)
|
|
1721
2200
|
return;
|
|
1722
|
-
const
|
|
1723
|
-
|
|
1724
|
-
records:
|
|
1725
|
-
grandTotalRecords:
|
|
1726
|
-
currentPage:
|
|
1727
|
-
totalPages: Math.ceil(
|
|
1728
|
-
pageSize:
|
|
2201
|
+
const Lt = K?.currentPage ?? 0, Dt = K?.pageSize ?? D;
|
|
2202
|
+
q.open({
|
|
2203
|
+
records: Je,
|
|
2204
|
+
grandTotalRecords: Je.length,
|
|
2205
|
+
currentPage: Lt,
|
|
2206
|
+
totalPages: Math.ceil(Je.length / Dt),
|
|
2207
|
+
pageSize: Dt
|
|
1729
2208
|
});
|
|
1730
2209
|
};
|
|
1731
|
-
return
|
|
1732
|
-
|
|
2210
|
+
return q.emitter.on("refreshData", p), () => {
|
|
2211
|
+
q.emitter.off("refreshData", p);
|
|
1733
2212
|
};
|
|
1734
|
-
}, [
|
|
1735
|
-
const
|
|
1736
|
-
async (
|
|
1737
|
-
if (!(
|
|
1738
|
-
|
|
2213
|
+
}, [g, q, D]);
|
|
2214
|
+
const ke = ie(
|
|
2215
|
+
async (p) => {
|
|
2216
|
+
if (!(g || !R)) {
|
|
2217
|
+
Ie(!0);
|
|
1739
2218
|
try {
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
records:
|
|
1743
|
-
grandTotalRecords:
|
|
2219
|
+
const K = await R(p, m);
|
|
2220
|
+
Te.current = K, q.open({
|
|
2221
|
+
records: K,
|
|
2222
|
+
grandTotalRecords: K.length,
|
|
1744
2223
|
currentPage: 0,
|
|
1745
|
-
totalPages: Math.ceil(
|
|
1746
|
-
pageSize:
|
|
2224
|
+
totalPages: Math.ceil(K.length / D),
|
|
2225
|
+
pageSize: D
|
|
1747
2226
|
});
|
|
1748
|
-
} catch (
|
|
1749
|
-
|
|
2227
|
+
} catch (K) {
|
|
2228
|
+
De(!0), S(fe(K)), z?.(K);
|
|
1750
2229
|
} finally {
|
|
1751
|
-
|
|
2230
|
+
Ie(!1);
|
|
1752
2231
|
}
|
|
1753
2232
|
}
|
|
1754
2233
|
},
|
|
1755
|
-
[
|
|
1756
|
-
),
|
|
1757
|
-
(
|
|
1758
|
-
const
|
|
1759
|
-
|
|
2234
|
+
[g, R, m, D, q, z]
|
|
2235
|
+
), Ve = ie(
|
|
2236
|
+
(p) => {
|
|
2237
|
+
const K = p?.quickFilterValues?.[0] || "";
|
|
2238
|
+
R && !g && ke(K);
|
|
1760
2239
|
},
|
|
1761
|
-
[
|
|
2240
|
+
[R, g, ke]
|
|
1762
2241
|
);
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
}, [
|
|
1766
|
-
|
|
1767
|
-
}, [
|
|
1768
|
-
const Ue =
|
|
1769
|
-
(
|
|
1770
|
-
|
|
2242
|
+
et(() => {
|
|
2243
|
+
o && (l?.length ? ce(l) : ce([]), ke());
|
|
2244
|
+
}, [o]), et(() => {
|
|
2245
|
+
l && ce(l);
|
|
2246
|
+
}, [l]);
|
|
2247
|
+
const Ue = ie(
|
|
2248
|
+
(p) => {
|
|
2249
|
+
a === "single" ? ce(p.slice(0, 1)) : y && p.length > y ? ce(p.slice(0, y)) : ce(p);
|
|
1771
2250
|
},
|
|
1772
|
-
[
|
|
1773
|
-
),
|
|
1774
|
-
(
|
|
1775
|
-
if (
|
|
1776
|
-
const
|
|
1777
|
-
|
|
2251
|
+
[a, y]
|
|
2252
|
+
), qe = ie(
|
|
2253
|
+
(p) => {
|
|
2254
|
+
if (a === "single" && s) {
|
|
2255
|
+
const K = q.getCurrentRecord();
|
|
2256
|
+
K && (C?.(K), i());
|
|
1778
2257
|
}
|
|
1779
2258
|
},
|
|
1780
|
-
[
|
|
1781
|
-
),
|
|
1782
|
-
|
|
1783
|
-
}, []),
|
|
1784
|
-
|
|
1785
|
-
}, [
|
|
2259
|
+
[a, s, q, C, i]
|
|
2260
|
+
), b = ie(() => {
|
|
2261
|
+
ce([]);
|
|
2262
|
+
}, []), Ee = ie(async () => {
|
|
2263
|
+
L && !await L(A) || (a === "single" ? A.length > 0 && C?.(A[0]) : P?.(A), I?.(A), i());
|
|
2264
|
+
}, [A, a, C, P, L, I, i]), je = ie(() => {
|
|
1786
2265
|
i();
|
|
1787
|
-
}, [i]),
|
|
1788
|
-
|
|
1789
|
-
},
|
|
1790
|
-
|
|
2266
|
+
}, [i]), Qe = () => {
|
|
2267
|
+
Rt.showWarning(x().t("archbase:Click on Ok or Cancel to close"));
|
|
2268
|
+
}, ht = () => {
|
|
2269
|
+
ne?.(), De(!1), S("");
|
|
1791
2270
|
};
|
|
1792
|
-
|
|
2271
|
+
zt(
|
|
1793
2272
|
n,
|
|
1794
2273
|
() => ({
|
|
1795
|
-
getSelectedItems: () =>
|
|
1796
|
-
getSelectedItem: () =>
|
|
1797
|
-
clearSelection: () =>
|
|
1798
|
-
selectItems: (
|
|
1799
|
-
selectItem: (
|
|
1800
|
-
deselectItem: (
|
|
1801
|
-
|
|
2274
|
+
getSelectedItems: () => A,
|
|
2275
|
+
getSelectedItem: () => A[0] || null,
|
|
2276
|
+
clearSelection: () => ce([]),
|
|
2277
|
+
selectItems: (p) => Ue(p),
|
|
2278
|
+
selectItem: (p) => ce([p]),
|
|
2279
|
+
deselectItem: (p) => {
|
|
2280
|
+
ce((K) => K.filter((Je) => Je[u] !== p[u]));
|
|
1802
2281
|
},
|
|
1803
|
-
refreshData: () =>
|
|
1804
|
-
getDataSource: () =>
|
|
2282
|
+
refreshData: () => ke(),
|
|
2283
|
+
getDataSource: () => q,
|
|
1805
2284
|
confirmSelection: async () => {
|
|
1806
|
-
await
|
|
2285
|
+
await Ee();
|
|
1807
2286
|
},
|
|
1808
|
-
cancelSelection:
|
|
2287
|
+
cancelSelection: je
|
|
1809
2288
|
}),
|
|
1810
|
-
[
|
|
2289
|
+
[A, Ue, u, ke, q, Ee, je]
|
|
1811
2290
|
);
|
|
1812
|
-
const
|
|
1813
|
-
(
|
|
1814
|
-
const
|
|
1815
|
-
return
|
|
2291
|
+
const ut = ie(
|
|
2292
|
+
(p) => {
|
|
2293
|
+
const K = p[u];
|
|
2294
|
+
return K !== void 0 ? K : "";
|
|
1816
2295
|
},
|
|
1817
|
-
[
|
|
1818
|
-
),
|
|
1819
|
-
|
|
1820
|
-
/* @__PURE__ */ e(
|
|
1821
|
-
] }),
|
|
1822
|
-
if (!
|
|
2296
|
+
[u]
|
|
2297
|
+
), ft = E || Fe, mt = se || re, gt = te || Ne, T = /* @__PURE__ */ c(oe, { gap: "sm", children: [
|
|
2298
|
+
h,
|
|
2299
|
+
/* @__PURE__ */ e(ye, { fw: 600, children: f })
|
|
2300
|
+
] }), Se = () => {
|
|
2301
|
+
if (!M)
|
|
1823
2302
|
return null;
|
|
1824
|
-
if (
|
|
1825
|
-
return
|
|
1826
|
-
if (
|
|
1827
|
-
return
|
|
1828
|
-
if (
|
|
1829
|
-
const
|
|
1830
|
-
return /* @__PURE__ */ e(
|
|
1831
|
-
/* @__PURE__ */
|
|
1832
|
-
/* @__PURE__ */ e(
|
|
1833
|
-
/* @__PURE__ */
|
|
1834
|
-
|
|
2303
|
+
if (a === "single" && A.length > 0 && V)
|
|
2304
|
+
return V(A[0]);
|
|
2305
|
+
if (a === "multiple" && A.length > 0 && F)
|
|
2306
|
+
return F(A);
|
|
2307
|
+
if (a === "single" && A.length > 0) {
|
|
2308
|
+
const p = A[0];
|
|
2309
|
+
return /* @__PURE__ */ e(Le, { withBorder: !0, p: "sm", radius: "md", bg: xe, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
|
|
2310
|
+
/* @__PURE__ */ c(oe, { gap: "xs", children: [
|
|
2311
|
+
/* @__PURE__ */ e(Ye, { size: 16, color: "green" }),
|
|
2312
|
+
/* @__PURE__ */ c(ye, { size: "sm", fw: 500, children: [
|
|
2313
|
+
ve.selectedLabel,
|
|
1835
2314
|
":"
|
|
1836
2315
|
] }),
|
|
1837
|
-
/* @__PURE__ */ e(
|
|
1838
|
-
|
|
2316
|
+
/* @__PURE__ */ e(ye, { size: "sm", fw: 600, children: String(p[v]) }),
|
|
2317
|
+
N && /* @__PURE__ */ e(ye, { size: "sm", c: B ? "gray.4" : "dimmed", children: String(p[N] || "") })
|
|
1839
2318
|
] }),
|
|
1840
|
-
/* @__PURE__ */ e(
|
|
2319
|
+
/* @__PURE__ */ e(ye, { size: "xs", c: B ? "gray.4" : "dimmed", children: ve.doubleClickHint })
|
|
1841
2320
|
] }) });
|
|
1842
2321
|
}
|
|
1843
|
-
return
|
|
1844
|
-
/* @__PURE__ */
|
|
1845
|
-
/* @__PURE__ */ e(
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
|
|
2322
|
+
return a === "multiple" && A.length > 0 ? /* @__PURE__ */ e(Le, { withBorder: !0, p: "sm", radius: "md", bg: xe, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
|
|
2323
|
+
/* @__PURE__ */ c(oe, { gap: "xs", children: [
|
|
2324
|
+
/* @__PURE__ */ e(Ye, { size: 16, color: "green" }),
|
|
2325
|
+
/* @__PURE__ */ c(ye, { size: "sm", fw: 500, children: [
|
|
2326
|
+
A.length,
|
|
1848
2327
|
" ",
|
|
1849
|
-
|
|
2328
|
+
ve.itemsSelected
|
|
1850
2329
|
] })
|
|
1851
2330
|
] }),
|
|
1852
|
-
|
|
2331
|
+
ee && /* @__PURE__ */ e(
|
|
1853
2332
|
We,
|
|
1854
2333
|
{
|
|
1855
2334
|
size: "xs",
|
|
1856
2335
|
variant: "subtle",
|
|
1857
2336
|
color: "red",
|
|
1858
|
-
leftSection: /* @__PURE__ */ e(
|
|
1859
|
-
onClick:
|
|
1860
|
-
children:
|
|
2337
|
+
leftSection: /* @__PURE__ */ e(tt, { size: 14 }),
|
|
2338
|
+
onClick: b,
|
|
2339
|
+
children: ve.clearButton
|
|
1861
2340
|
}
|
|
1862
2341
|
)
|
|
1863
2342
|
] }) }) : null;
|
|
1864
2343
|
};
|
|
1865
2344
|
return /* @__PURE__ */ e(
|
|
1866
|
-
|
|
2345
|
+
Ge,
|
|
1867
2346
|
{
|
|
1868
|
-
resourceName:
|
|
1869
|
-
resourceDescription:
|
|
1870
|
-
requiredPermissions:
|
|
1871
|
-
fallbackComponent:
|
|
1872
|
-
onSecurityReady:
|
|
1873
|
-
onAccessDenied:
|
|
2347
|
+
resourceName: ue,
|
|
2348
|
+
resourceDescription: Ce,
|
|
2349
|
+
requiredPermissions: le,
|
|
2350
|
+
fallbackComponent: d,
|
|
2351
|
+
onSecurityReady: k?.onSecurityReady,
|
|
2352
|
+
onAccessDenied: k?.onAccessDenied,
|
|
1874
2353
|
children: /* @__PURE__ */ e(
|
|
1875
|
-
|
|
2354
|
+
Ct,
|
|
1876
2355
|
{
|
|
1877
|
-
title:
|
|
1878
|
-
opened:
|
|
1879
|
-
onClose:
|
|
1880
|
-
size:
|
|
2356
|
+
title: T,
|
|
2357
|
+
opened: o,
|
|
2358
|
+
onClose: Qe,
|
|
2359
|
+
size: X,
|
|
1881
2360
|
centered: !0,
|
|
1882
2361
|
closeOnEscape: !1,
|
|
1883
2362
|
closeOnClickOutside: !1,
|
|
1884
2363
|
withCloseButton: !1,
|
|
1885
2364
|
overlayProps: {
|
|
1886
|
-
color:
|
|
2365
|
+
color: de === "dark" ? we.colors.dark[7] : we.colors.gray[6],
|
|
1887
2366
|
opacity: 0.25
|
|
1888
2367
|
},
|
|
1889
|
-
children: /* @__PURE__ */
|
|
1890
|
-
|
|
1891
|
-
|
|
2368
|
+
children: /* @__PURE__ */ c(ct, { height: Z, children: [
|
|
2369
|
+
gt && /* @__PURE__ */ e(Et, { size: "100px", children: /* @__PURE__ */ e(
|
|
2370
|
+
Ke,
|
|
1892
2371
|
{
|
|
1893
|
-
autoClose:
|
|
2372
|
+
autoClose: H,
|
|
1894
2373
|
withCloseButton: !0,
|
|
1895
2374
|
withBorder: !0,
|
|
1896
|
-
icon: /* @__PURE__ */ e(
|
|
1897
|
-
title:
|
|
2375
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
2376
|
+
title: x().t("archbase:WARNING"),
|
|
1898
2377
|
titleColor: "rgb(250, 82, 82)",
|
|
1899
|
-
variant:
|
|
1900
|
-
onClose:
|
|
1901
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
2378
|
+
variant: _ ?? $.variant,
|
|
2379
|
+
onClose: ht,
|
|
2380
|
+
children: /* @__PURE__ */ e("span", { children: mt })
|
|
1902
2381
|
}
|
|
1903
2382
|
) }),
|
|
1904
|
-
/* @__PURE__ */ e(
|
|
1905
|
-
|
|
2383
|
+
/* @__PURE__ */ e(st, { children: /* @__PURE__ */ c(yt, { gap: "md", h: "100%", children: [
|
|
2384
|
+
Y && /* @__PURE__ */ e(oe, { justify: "flex-end", children: Y }),
|
|
1906
2385
|
/* @__PURE__ */ e(
|
|
1907
|
-
|
|
2386
|
+
Gt,
|
|
1908
2387
|
{
|
|
1909
|
-
dataSource:
|
|
1910
|
-
height:
|
|
1911
|
-
rowHeight:
|
|
2388
|
+
dataSource: q,
|
|
2389
|
+
height: ae,
|
|
2390
|
+
rowHeight: W,
|
|
1912
2391
|
withBorder: !0,
|
|
1913
2392
|
striped: !0,
|
|
1914
2393
|
highlightOnHover: !0,
|
|
1915
|
-
isLoading:
|
|
1916
|
-
enableRowSelection:
|
|
2394
|
+
isLoading: ft,
|
|
2395
|
+
enableRowSelection: a === "multiple",
|
|
1917
2396
|
enableRowNumbers: !0,
|
|
1918
2397
|
enableColumnFilterModes: !0,
|
|
1919
2398
|
enableTopToolbar: !0,
|
|
1920
2399
|
enableGlobalFilter: !0,
|
|
1921
|
-
getRowId:
|
|
1922
|
-
onCellDoubleClick:
|
|
1923
|
-
onSelectedRowsChanged:
|
|
1924
|
-
onFilterModelChange:
|
|
2400
|
+
getRowId: ut,
|
|
2401
|
+
onCellDoubleClick: qe,
|
|
2402
|
+
onSelectedRowsChanged: a === "multiple" ? Ue : void 0,
|
|
2403
|
+
onFilterModelChange: Ve,
|
|
1925
2404
|
children: r
|
|
1926
2405
|
}
|
|
1927
2406
|
),
|
|
1928
|
-
|
|
2407
|
+
Se()
|
|
1929
2408
|
] }) }),
|
|
1930
|
-
/* @__PURE__ */ e(
|
|
1931
|
-
/* @__PURE__ */ e(
|
|
1932
|
-
/* @__PURE__ */
|
|
2409
|
+
/* @__PURE__ */ e(dt, { size: "50px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
|
|
2410
|
+
/* @__PURE__ */ e(oe, {}),
|
|
2411
|
+
/* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
1933
2412
|
/* @__PURE__ */ e(
|
|
1934
|
-
|
|
2413
|
+
J,
|
|
1935
2414
|
{
|
|
1936
2415
|
actionName: "confirm",
|
|
1937
2416
|
actionDescription: "Confirmar seleção",
|
|
1938
|
-
leftSection: /* @__PURE__ */ e(
|
|
1939
|
-
onClick:
|
|
1940
|
-
disabled:
|
|
1941
|
-
variant:
|
|
2417
|
+
leftSection: /* @__PURE__ */ e(Ye, {}),
|
|
2418
|
+
onClick: Ee,
|
|
2419
|
+
disabled: A.length === 0,
|
|
2420
|
+
variant: _ ?? $.variant,
|
|
1942
2421
|
color: "green",
|
|
1943
|
-
children:
|
|
2422
|
+
children: ve.okButton
|
|
1944
2423
|
}
|
|
1945
2424
|
),
|
|
1946
2425
|
/* @__PURE__ */ e(
|
|
1947
|
-
|
|
2426
|
+
J,
|
|
1948
2427
|
{
|
|
1949
2428
|
actionName: "cancel",
|
|
1950
2429
|
actionDescription: "Cancelar seleção",
|
|
1951
|
-
leftSection: /* @__PURE__ */ e(
|
|
1952
|
-
onClick:
|
|
1953
|
-
variant:
|
|
2430
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
2431
|
+
onClick: je,
|
|
2432
|
+
variant: _ ?? $.variant,
|
|
1954
2433
|
color: "red",
|
|
1955
|
-
children:
|
|
2434
|
+
children: ve.cancelButton
|
|
1956
2435
|
}
|
|
1957
2436
|
)
|
|
1958
2437
|
] })
|
|
@@ -1963,47 +2442,50 @@ function cn(t, n) {
|
|
|
1963
2442
|
}
|
|
1964
2443
|
);
|
|
1965
2444
|
}
|
|
1966
|
-
const
|
|
1967
|
-
function
|
|
1968
|
-
const [n,
|
|
1969
|
-
|
|
1970
|
-
}, []), r =
|
|
1971
|
-
|
|
1972
|
-
const
|
|
1973
|
-
return delete v
|
|
2445
|
+
const Mn = Vt(mn), It = Kt(void 0);
|
|
2446
|
+
function Un({ children: t }) {
|
|
2447
|
+
const [n, o] = Q({}), f = ie((v, a) => {
|
|
2448
|
+
o((C) => ({ ...C, [v]: a }));
|
|
2449
|
+
}, []), r = ie((v) => {
|
|
2450
|
+
o((a) => {
|
|
2451
|
+
const C = { ...a };
|
|
2452
|
+
return delete C[v], C;
|
|
1974
2453
|
});
|
|
1975
|
-
}, []), i =
|
|
1976
|
-
|
|
1977
|
-
}, []),
|
|
1978
|
-
return /* @__PURE__ */ e(
|
|
2454
|
+
}, []), i = ie(() => {
|
|
2455
|
+
o({});
|
|
2456
|
+
}, []), u = ie((v) => n[v], [n]);
|
|
2457
|
+
return /* @__PURE__ */ e(It.Provider, { value: { errors: n, setError: f, clearError: r, clearAll: i, getError: u }, children: t });
|
|
1979
2458
|
}
|
|
1980
|
-
function
|
|
1981
|
-
return
|
|
2459
|
+
function Hn() {
|
|
2460
|
+
return Pt(It);
|
|
1982
2461
|
}
|
|
1983
|
-
function
|
|
1984
|
-
const t =
|
|
2462
|
+
function _n() {
|
|
2463
|
+
const t = Pt(It);
|
|
1985
2464
|
if (!t)
|
|
1986
2465
|
throw new Error("useRequiredValidationErrors must be used within ValidationErrorsProvider");
|
|
1987
2466
|
return t;
|
|
1988
2467
|
}
|
|
1989
2468
|
export {
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2469
|
+
Dn as ArchbaseAdvancedSmartButton,
|
|
2470
|
+
Ge as ArchbaseConditionalSecurityWrapper,
|
|
2471
|
+
Bn as ArchbaseFormModalTemplate,
|
|
2472
|
+
kn as ArchbaseFormTemplate,
|
|
2473
|
+
Vn as ArchbaseGridTemplate,
|
|
2474
|
+
Mn as ArchbaseLookupDataTemplate,
|
|
2475
|
+
zn as ArchbaseMasonryTemplate,
|
|
2476
|
+
Nn as ArchbaseModalTemplate,
|
|
2477
|
+
Pn as ArchbasePanelTemplate,
|
|
2478
|
+
Gn as ArchbaseSearchTemplate,
|
|
2479
|
+
J as ArchbaseSmartActionButton,
|
|
2480
|
+
jt as ArchbaseSpaceTemplate,
|
|
2481
|
+
$n as ArchbaseTwoColumnFormTemplate,
|
|
2482
|
+
Ln as FormImageGallery,
|
|
2483
|
+
jn as FormSectionCard,
|
|
2484
|
+
Un as ValidationErrorsProvider,
|
|
2485
|
+
In as useArchbaseLookup,
|
|
2486
|
+
Tn as useConditionalSecurity,
|
|
2487
|
+
Pe as useOptionalTemplateSecurity,
|
|
2488
|
+
_n as useRequiredValidationErrors,
|
|
2489
|
+
Sn as useTemplateSecurityAvailable,
|
|
2490
|
+
Hn as useValidationErrors
|
|
2009
2491
|
};
|