@archbase/template 4.0.2 → 4.0.3
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 +460 -460
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, Fragment as qe, jsxs as c } from "react/jsx-runtime";
|
|
2
2
|
import { Button as Oe, Paper as _e, Box as pe, Flex as Ce, Group as oe, ActionIcon as vt, Title as Bt, Text as Re, ScrollArea as Ze, LoadingOverlay as yt, useMantineColorScheme as st, Modal as bt, px as Ot, Grid as Ee, Pagination as Nt, Stack as wt, Tabs as at, Badge as Kt } from "@mantine/core";
|
|
3
3
|
import { useForceUpdate as dt, useUncontrolled as Qt, useHotkeys as Xt } from "@mantine/hooks";
|
|
4
|
-
import { IconArrowLeft as Vt, IconBug as Ke, IconDeviceFloppy as Ct, IconX as ze, IconCheck as et, IconPlus as Ft, IconEdit as At, IconTrash as
|
|
4
|
+
import { IconArrowLeft as Vt, IconBug as Ke, IconDeviceFloppy as Ct, IconX as ze, IconCheck as et, IconPlus as Ft, IconEdit as At, IconTrash as nt, IconEye as Rt } from "@tabler/icons-react";
|
|
5
5
|
import { useArchbaseAppContext as Me, useValidationErrors as Pt, ValidationErrorsProvider as Et, getI18nextInstance as g, processErrorMessage as xe, useArchbaseTheme as ut, emit as Yt, useArchbaseTranslation as Zt } from "@archbase/core";
|
|
6
|
-
import tt, { useMemo as Je, useState as U, useCallback as Z, forwardRef as zt, useRef as Se, useImperativeHandle as Gt, useEffect as
|
|
7
|
-
import { useArchbaseV1V2Compatibility as We, useArchbaseDataSourceListener as it, DataSourceEventNames as Ie, ArchbaseDataSource as
|
|
8
|
-
import { ArchbaseAlert as Qe, ArchbaseDialog as St, ArchbaseDataGrid as Lt, GridToolBarActions as
|
|
6
|
+
import tt, { useMemo as Je, useState as U, useCallback as Z, forwardRef as zt, useRef as Se, useImperativeHandle as Gt, useEffect as rt, Fragment as er, Profiler as tr, createContext as rr, useContext as $t } from "react";
|
|
7
|
+
import { useArchbaseV1V2Compatibility as We, useArchbaseDataSourceListener as it, DataSourceEventNames as Ie, ArchbaseDataSource as nr } from "@archbase/data";
|
|
8
|
+
import { ArchbaseAlert as Qe, ArchbaseDialog as St, ArchbaseDataGrid as Lt, GridToolBarActions as ir, ArchbaseDebugInspector as lr, ArchbaseMasonryProvider as or, ArchbaseMasonryResponsive as ar, ArchbaseMasonry as cr, ArchbaseActionButtons as sr } from "@archbase/components";
|
|
9
9
|
import { ArchbaseSpaceFixed as ht, ArchbaseSpaceTop as It, ArchbaseSpaceFill as ft, ArchbaseForm as jt, ArchbaseSpaceBottom as mt } from "@archbase/layout";
|
|
10
|
-
import { ArchbaseQueryBuilder as Dt, buildFrom as
|
|
10
|
+
import { ArchbaseQueryBuilder as Dt, buildFrom as dr, ArchbaseGlobalFilter as ur } from "@archbase/advanced";
|
|
11
11
|
import ct from "@rehooks/component-size";
|
|
12
|
-
import { uniqueId as
|
|
13
|
-
const
|
|
12
|
+
import { uniqueId as hr } from "lodash";
|
|
13
|
+
const fr = {
|
|
14
14
|
isAvailable: !1,
|
|
15
15
|
hasPermission: () => !0,
|
|
16
16
|
// Default: sempre permite
|
|
@@ -21,45 +21,45 @@ const mn = {
|
|
|
21
21
|
canEdit: !0,
|
|
22
22
|
canDelete: !0,
|
|
23
23
|
canView: !0
|
|
24
|
-
}, Ue = (t) => Je(() =>
|
|
25
|
-
function
|
|
24
|
+
}, Ue = (t) => Je(() => fr, []), Nr = () => !1;
|
|
25
|
+
function Vr(t) {
|
|
26
26
|
const {
|
|
27
|
-
onSelect:
|
|
27
|
+
onSelect: r,
|
|
28
28
|
onSelectMultiple: o,
|
|
29
29
|
initialValue: f = null,
|
|
30
|
-
initialValues:
|
|
30
|
+
initialValues: n = [],
|
|
31
31
|
selectionMode: i = "single",
|
|
32
32
|
autoClose: h = !0,
|
|
33
33
|
onOpen: p,
|
|
34
34
|
onClose: a
|
|
35
|
-
} = t || {}, [v, $] = U(!1), [l, s] = U(f), [H, I] = U(
|
|
35
|
+
} = t || {}, [v, $] = U(!1), [l, s] = U(f), [H, I] = U(n), C = Z(() => {
|
|
36
36
|
$(!0), p?.();
|
|
37
|
-
}, [p]),
|
|
37
|
+
}, [p]), b = Z(() => {
|
|
38
38
|
$(!1), a?.();
|
|
39
39
|
}, [a]), m = Z(() => {
|
|
40
40
|
s(null), I([]);
|
|
41
|
-
}, []),
|
|
41
|
+
}, []), V = Z(
|
|
42
42
|
(u) => {
|
|
43
|
-
s(u), I([u]),
|
|
43
|
+
s(u), I([u]), r?.(u), h && ($(!1), a?.());
|
|
44
44
|
},
|
|
45
|
-
[
|
|
46
|
-
),
|
|
45
|
+
[r, h, a]
|
|
46
|
+
), w = Z(
|
|
47
47
|
(u) => {
|
|
48
48
|
I(u), s(u.length > 0 ? u[0] : null), o?.(u), h && ($(!1), a?.());
|
|
49
49
|
},
|
|
50
50
|
[o, h, a]
|
|
51
|
-
),
|
|
51
|
+
), P = Z(() => {
|
|
52
52
|
$(!1), a?.();
|
|
53
|
-
}, [a]),
|
|
53
|
+
}, [a]), F = Je(
|
|
54
54
|
() => ({
|
|
55
55
|
opened: v,
|
|
56
|
-
onClose:
|
|
57
|
-
onSelect:
|
|
58
|
-
onSelectMultiple:
|
|
56
|
+
onClose: P,
|
|
57
|
+
onSelect: V,
|
|
58
|
+
onSelectMultiple: w,
|
|
59
59
|
selectionMode: i,
|
|
60
60
|
initialSelectedItems: i === "multiple" ? H : l ? [l] : void 0
|
|
61
61
|
}),
|
|
62
|
-
[v,
|
|
62
|
+
[v, P, V, w, i, l, H]
|
|
63
63
|
);
|
|
64
64
|
return {
|
|
65
65
|
// Estado
|
|
@@ -68,60 +68,60 @@ function Pn(t) {
|
|
|
68
68
|
selectedItems: H,
|
|
69
69
|
// Ações
|
|
70
70
|
open: C,
|
|
71
|
-
close:
|
|
71
|
+
close: b,
|
|
72
72
|
clear: m,
|
|
73
73
|
setSelectedItem: s,
|
|
74
74
|
setSelectedItems: I,
|
|
75
75
|
// Handlers
|
|
76
|
-
handleSelect:
|
|
77
|
-
handleSelectMultiple:
|
|
78
|
-
handleClose:
|
|
76
|
+
handleSelect: V,
|
|
77
|
+
handleSelectMultiple: w,
|
|
78
|
+
handleClose: P,
|
|
79
79
|
// Props para template
|
|
80
|
-
lookupProps:
|
|
80
|
+
lookupProps: F
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
const K = ({
|
|
84
84
|
actionName: t,
|
|
85
|
-
actionDescription:
|
|
85
|
+
actionDescription: r,
|
|
86
86
|
children: o,
|
|
87
87
|
fallback: f = null,
|
|
88
|
-
autoRegister:
|
|
88
|
+
autoRegister: n = !0,
|
|
89
89
|
onClick: i,
|
|
90
90
|
...h
|
|
91
91
|
}) => {
|
|
92
92
|
const p = Ue();
|
|
93
93
|
return tt.useEffect(() => {
|
|
94
|
-
|
|
95
|
-
}, [t,
|
|
96
|
-
},
|
|
94
|
+
n && t && r && p.isAvailable && p.registerAction();
|
|
95
|
+
}, [t, r, n, p.isAvailable, p.registerAction]), !t || !p.isAvailable ? /* @__PURE__ */ e(Oe, { onClick: i, ...h, children: o }) : p.hasPermission() ? /* @__PURE__ */ e(Oe, { onClick: i, ...h, children: o }) : /* @__PURE__ */ e(qe, { children: f });
|
|
96
|
+
}, Pr = ({
|
|
97
97
|
actionName: t,
|
|
98
|
-
actionDescription:
|
|
98
|
+
actionDescription: r,
|
|
99
99
|
children: o,
|
|
100
100
|
fallback: f = null,
|
|
101
|
-
onClick:
|
|
101
|
+
onClick: n,
|
|
102
102
|
...i
|
|
103
103
|
}) => {
|
|
104
104
|
const [h, p] = tt.useState(null), [a, v] = tt.useState(!1);
|
|
105
105
|
return tt.useEffect(() => {
|
|
106
106
|
if (!t) {
|
|
107
|
-
p(/* @__PURE__ */ e(Oe, { onClick:
|
|
107
|
+
p(/* @__PURE__ */ e(Oe, { onClick: n, ...i, children: o }));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
v(!1), p(/* @__PURE__ */ e(Oe, { onClick:
|
|
111
|
-
}, [t,
|
|
110
|
+
v(!1), p(/* @__PURE__ */ e(Oe, { onClick: n, ...i, children: o }));
|
|
111
|
+
}, [t, r, o, f, i]), /* @__PURE__ */ e(qe, { children: h });
|
|
112
112
|
}, He = ({
|
|
113
113
|
children: t
|
|
114
|
-
}) => /* @__PURE__ */ e(qe, { children: t }),
|
|
114
|
+
}) => /* @__PURE__ */ e(qe, { children: t }), zr = (t) => Je(() => ({
|
|
115
115
|
shouldWrap: !1,
|
|
116
116
|
isSecurityAvailable: !1,
|
|
117
117
|
hasResourceName: !!t
|
|
118
118
|
}), [t]);
|
|
119
|
-
function
|
|
119
|
+
function Gr({
|
|
120
120
|
innerRef: t,
|
|
121
|
-
title:
|
|
121
|
+
title: r,
|
|
122
122
|
subtitle: o,
|
|
123
123
|
isError: f = !1,
|
|
124
|
-
isCanceling:
|
|
124
|
+
isCanceling: n = !1,
|
|
125
125
|
isSaving: i = !1,
|
|
126
126
|
isLoading: h = !1,
|
|
127
127
|
error: p = "",
|
|
@@ -134,12 +134,12 @@ function $n({
|
|
|
134
134
|
children: H,
|
|
135
135
|
radius: I,
|
|
136
136
|
variant: C,
|
|
137
|
-
buttonsPosition:
|
|
137
|
+
buttonsPosition: b = "footer",
|
|
138
138
|
saveLabel: m,
|
|
139
|
-
cancelLabel:
|
|
140
|
-
onBack:
|
|
141
|
-
footerAlign:
|
|
142
|
-
footerContent:
|
|
139
|
+
cancelLabel: V,
|
|
140
|
+
onBack: w,
|
|
141
|
+
footerAlign: P = "left",
|
|
142
|
+
footerContent: F,
|
|
143
143
|
dataSource: u,
|
|
144
144
|
onSave: X,
|
|
145
145
|
onCancel: ee,
|
|
@@ -149,21 +149,21 @@ function $n({
|
|
|
149
149
|
onAfterCancel: _,
|
|
150
150
|
onError: R,
|
|
151
151
|
routePath: T,
|
|
152
|
-
onBeforeClose:
|
|
152
|
+
onBeforeClose: le,
|
|
153
153
|
useNavigationListener: E,
|
|
154
154
|
// Props de segurança (opcionais)
|
|
155
155
|
resourceName: te,
|
|
156
156
|
resourceDescription: ue,
|
|
157
|
-
requiredPermissions:
|
|
157
|
+
requiredPermissions: re,
|
|
158
158
|
fallbackComponent: q,
|
|
159
159
|
securityOptions: j,
|
|
160
160
|
...J
|
|
161
161
|
}) {
|
|
162
|
-
const W = Me(), [Y, ce] = U(f), [be,
|
|
162
|
+
const W = Me(), [Y, ce] = U(f), [be, ne] = U(p), d = dt();
|
|
163
163
|
Ue({
|
|
164
164
|
autoRegisterActions: j?.autoRegisterActions ?? !0
|
|
165
165
|
});
|
|
166
|
-
const
|
|
166
|
+
const z = We(
|
|
167
167
|
"ArchbaseFormTemplate",
|
|
168
168
|
u,
|
|
169
169
|
void 0,
|
|
@@ -172,33 +172,33 @@ function $n({
|
|
|
172
172
|
it({
|
|
173
173
|
dataSource: u,
|
|
174
174
|
listener: (O) => {
|
|
175
|
-
O.type === Ie.onError && (ce(!0),
|
|
175
|
+
O.type === Ie.onError && (ce(!0), ne(O.error)), (O.type === Ie.afterEdit || O.type === Ie.afterInsert) && (z.isDataSourceV2 || d());
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
const M = Pt(), we = Z((O, D) => ({
|
|
179
179
|
closeAllowed: ($e) => {
|
|
180
180
|
}
|
|
181
|
-
}), []), he = E || we, { closeAllowed:
|
|
182
|
-
|
|
181
|
+
}), []), he = E || we, { closeAllowed: k } = he(T || "", () => {
|
|
182
|
+
le && le() === !1 || k();
|
|
183
183
|
}), fe = async (O) => {
|
|
184
184
|
try {
|
|
185
185
|
X ? X(O) : (ae && await ae(O), u.isBrowsing() || u.save().then(() => {
|
|
186
|
-
M?.clearAll(), Q && Q(O), E &&
|
|
186
|
+
M?.clearAll(), Q && Q(O), E && k();
|
|
187
187
|
}).catch((D) => {
|
|
188
|
-
R && R(xe(D)), ce(!0),
|
|
188
|
+
R && R(xe(D)), ce(!0), ne(xe(D));
|
|
189
189
|
}));
|
|
190
190
|
} catch (D) {
|
|
191
|
-
R && R(xe(D)), ce(!0),
|
|
191
|
+
R && R(xe(D)), ce(!0), ne(xe(D));
|
|
192
192
|
}
|
|
193
193
|
}, Fe = () => {
|
|
194
194
|
try {
|
|
195
|
-
ee ? ee.length > 0 ? ee(
|
|
195
|
+
ee ? ee.length > 0 ? ee(k) : ee() : (L && L(), u.isBrowsing() || u.cancel(), M?.clearAll(), _ && _(), E && k());
|
|
196
196
|
} catch (O) {
|
|
197
|
-
R && R(xe(O)), ce(!0),
|
|
197
|
+
R && R(xe(O)), ce(!0), ne(xe(O));
|
|
198
198
|
}
|
|
199
199
|
}, Ae = () => {
|
|
200
|
-
a && a(), ce(!1),
|
|
201
|
-
}, Pe = u && !u.isBrowsing(), se =
|
|
200
|
+
a && a(), ce(!1), ne("");
|
|
201
|
+
}, Pe = u && !u.isBrowsing(), se = b === "header" || b === "both", G = b === "footer" || b === "both", de = () => /* @__PURE__ */ e(oe, { gap: "sm", children: Pe ? /* @__PURE__ */ c(qe, { children: [
|
|
202
202
|
/* @__PURE__ */ e(
|
|
203
203
|
K,
|
|
204
204
|
{
|
|
@@ -207,8 +207,8 @@ function $n({
|
|
|
207
207
|
leftSection: /* @__PURE__ */ e(ze, { size: 16 }),
|
|
208
208
|
onClick: Fe,
|
|
209
209
|
variant: "default",
|
|
210
|
-
loading:
|
|
211
|
-
children:
|
|
210
|
+
loading: n,
|
|
211
|
+
children: V || g().t("Cancel")
|
|
212
212
|
}
|
|
213
213
|
),
|
|
214
214
|
/* @__PURE__ */ e(
|
|
@@ -241,12 +241,12 @@ function $n({
|
|
|
241
241
|
flexShrink: 0,
|
|
242
242
|
padding: "calc(0.625rem / 2)",
|
|
243
243
|
display: "flex",
|
|
244
|
-
justifyContent:
|
|
244
|
+
justifyContent: P === "center" ? "center" : "space-between",
|
|
245
245
|
alignItems: "center",
|
|
246
246
|
gap: "1rem"
|
|
247
247
|
},
|
|
248
248
|
children: [
|
|
249
|
-
|
|
249
|
+
P === "right" && F && /* @__PURE__ */ e(pe, { style: { flex: 1 }, children: F }),
|
|
250
250
|
Pe ? /* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
251
251
|
/* @__PURE__ */ e(
|
|
252
252
|
K,
|
|
@@ -271,7 +271,7 @@ function $n({
|
|
|
271
271
|
disabled: u && u.isBrowsing(),
|
|
272
272
|
variant: C ?? W.variant,
|
|
273
273
|
color: "red",
|
|
274
|
-
children:
|
|
274
|
+
children: V || `${g().t("Cancel")}`
|
|
275
275
|
}
|
|
276
276
|
)
|
|
277
277
|
] }) : /* @__PURE__ */ e(oe, { gap: "md", children: /* @__PURE__ */ e(
|
|
@@ -285,7 +285,7 @@ function $n({
|
|
|
285
285
|
children: `${g().t("Close")}`
|
|
286
286
|
}
|
|
287
287
|
) }),
|
|
288
|
-
(
|
|
288
|
+
(P === "left" || P === "center") && F && /* @__PURE__ */ e(pe, { style: { flex: P === "left" ? 1 : 0, textAlign: "right" }, children: F })
|
|
289
289
|
]
|
|
290
290
|
}
|
|
291
291
|
);
|
|
@@ -294,7 +294,7 @@ function $n({
|
|
|
294
294
|
{
|
|
295
295
|
resourceName: te,
|
|
296
296
|
resourceDescription: ue,
|
|
297
|
-
requiredPermissions:
|
|
297
|
+
requiredPermissions: re,
|
|
298
298
|
fallbackComponent: q,
|
|
299
299
|
onSecurityReady: j?.onSecurityReady,
|
|
300
300
|
onAccessDenied: j?.onAccessDenied,
|
|
@@ -322,19 +322,19 @@ function $n({
|
|
|
322
322
|
},
|
|
323
323
|
children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
|
|
324
324
|
/* @__PURE__ */ c(oe, { gap: "md", children: [
|
|
325
|
-
|
|
325
|
+
w && /* @__PURE__ */ e(
|
|
326
326
|
vt,
|
|
327
327
|
{
|
|
328
328
|
variant: "subtle",
|
|
329
329
|
color: "gray",
|
|
330
330
|
size: "lg",
|
|
331
|
-
onClick:
|
|
331
|
+
onClick: w,
|
|
332
332
|
style: { border: "1px solid var(--mantine-color-gray-3)" },
|
|
333
333
|
children: /* @__PURE__ */ e(Vt, { size: 18 })
|
|
334
334
|
}
|
|
335
335
|
),
|
|
336
|
-
(
|
|
337
|
-
|
|
336
|
+
(r || o) && /* @__PURE__ */ c(pe, { children: [
|
|
337
|
+
r && /* @__PURE__ */ e(Bt, { order: 4, fw: 600, children: r }),
|
|
338
338
|
o && /* @__PURE__ */ e(Re, { size: "sm", c: "dimmed", children: o })
|
|
339
339
|
] })
|
|
340
340
|
] }),
|
|
@@ -365,7 +365,7 @@ function $n({
|
|
|
365
365
|
padding: se ? "24px" : "calc(0.625rem / 2)"
|
|
366
366
|
},
|
|
367
367
|
children: [
|
|
368
|
-
/* @__PURE__ */ e(yt, { visible: h ||
|
|
368
|
+
/* @__PURE__ */ e(yt, { visible: h || n || i, opacity: 0.3 }),
|
|
369
369
|
H
|
|
370
370
|
]
|
|
371
371
|
}
|
|
@@ -377,12 +377,12 @@ function $n({
|
|
|
377
377
|
}
|
|
378
378
|
);
|
|
379
379
|
}
|
|
380
|
-
function
|
|
380
|
+
function $r({
|
|
381
381
|
title: t,
|
|
382
|
-
withOverlay:
|
|
382
|
+
withOverlay: r = !0,
|
|
383
383
|
overlayProps: o,
|
|
384
384
|
children: f,
|
|
385
|
-
withCloseButton:
|
|
385
|
+
withCloseButton: n = !0,
|
|
386
386
|
closeButtonProps: i,
|
|
387
387
|
opened: h,
|
|
388
388
|
fullScreen: p,
|
|
@@ -394,12 +394,12 @@ function Ln({
|
|
|
394
394
|
height: H,
|
|
395
395
|
userActions: I,
|
|
396
396
|
onAfterSave: C,
|
|
397
|
-
onClickOk:
|
|
397
|
+
onClickOk: b,
|
|
398
398
|
onClickCancel: m,
|
|
399
|
-
onBeforeOk:
|
|
400
|
-
onCustomSave:
|
|
401
|
-
isError:
|
|
402
|
-
error:
|
|
399
|
+
onBeforeOk: V,
|
|
400
|
+
onCustomSave: w,
|
|
401
|
+
isError: P,
|
|
402
|
+
error: F = "",
|
|
403
403
|
clearError: u = () => {
|
|
404
404
|
},
|
|
405
405
|
onError: X,
|
|
@@ -411,9 +411,9 @@ function Ln({
|
|
|
411
411
|
requiredPermissions: _,
|
|
412
412
|
fallbackComponent: R,
|
|
413
413
|
securityOptions: T,
|
|
414
|
-
...
|
|
414
|
+
...le
|
|
415
415
|
}) {
|
|
416
|
-
const E = Me(), te = ut(), { colorScheme: ue } = st(), [
|
|
416
|
+
const E = Me(), te = ut(), { colorScheme: ue } = st(), [re, q] = U(P), [j, J] = U(F), [W, Y] = U(!1), ce = dt();
|
|
417
417
|
Ue({
|
|
418
418
|
resourceDescription: L || t?.toString(),
|
|
419
419
|
autoRegisterActions: T?.autoRegisterActions ?? !0
|
|
@@ -426,16 +426,16 @@ function Ln({
|
|
|
426
426
|
);
|
|
427
427
|
it({
|
|
428
428
|
dataSource: s,
|
|
429
|
-
listener: (
|
|
430
|
-
|
|
429
|
+
listener: (k) => {
|
|
430
|
+
k.type === Ie.onError && (q(!0), J(k.error)), (k.type === Ie.afterEdit || k.type === Ie.afterInsert) && (be.isDataSourceV2 || ce());
|
|
431
431
|
}
|
|
432
432
|
});
|
|
433
|
-
const
|
|
433
|
+
const ne = async () => {
|
|
434
434
|
if (s && !s.isBrowsing())
|
|
435
435
|
try {
|
|
436
436
|
Y(!0), await s.save(), C && C(s.getCurrentRecord());
|
|
437
|
-
} catch (
|
|
438
|
-
return X && X(xe(
|
|
437
|
+
} catch (k) {
|
|
438
|
+
return X && X(xe(k)), q(!0), J(xe(k)), Y(!1), !1;
|
|
439
439
|
}
|
|
440
440
|
return Y(!1), !0;
|
|
441
441
|
}, d = () => {
|
|
@@ -444,20 +444,20 @@ function Ln({
|
|
|
444
444
|
s.cancel();
|
|
445
445
|
} catch {
|
|
446
446
|
}
|
|
447
|
-
},
|
|
448
|
-
if (
|
|
449
|
-
s &&
|
|
450
|
-
|
|
447
|
+
}, z = async () => {
|
|
448
|
+
if (w)
|
|
449
|
+
s && w(s.getCurrentRecord(), () => {
|
|
450
|
+
b && b();
|
|
451
451
|
});
|
|
452
|
-
else if (
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
await
|
|
452
|
+
else if (V) {
|
|
453
|
+
const k = V(s.getCurrentRecord());
|
|
454
|
+
k instanceof Promise ? k.then(async () => {
|
|
455
|
+
await ne() && b && b();
|
|
456
456
|
}).catch((fe) => {
|
|
457
457
|
X && X(xe(fe)), q(!0), J(xe(fe));
|
|
458
|
-
});
|
|
458
|
+
}) : (k === !0 || k === void 0) && await ne() && b && b();
|
|
459
459
|
} else
|
|
460
|
-
await
|
|
460
|
+
await ne() && b && b();
|
|
461
461
|
}, M = () => {
|
|
462
462
|
d(), m && m();
|
|
463
463
|
}, we = () => {
|
|
@@ -478,12 +478,12 @@ function Ln({
|
|
|
478
478
|
bt,
|
|
479
479
|
{
|
|
480
480
|
title: t,
|
|
481
|
-
withOverlay:
|
|
481
|
+
withOverlay: r,
|
|
482
482
|
overlayProps: o || {
|
|
483
483
|
color: ue === "dark" ? te.colors.dark[7] : te.colors.gray[6],
|
|
484
484
|
opacity: 0.25
|
|
485
485
|
},
|
|
486
|
-
withCloseButton:
|
|
486
|
+
withCloseButton: n,
|
|
487
487
|
closeButtonProps: i,
|
|
488
488
|
onClose: we,
|
|
489
489
|
opened: h,
|
|
@@ -491,11 +491,11 @@ function Ln({
|
|
|
491
491
|
centered: a,
|
|
492
492
|
closeOnEscape: $,
|
|
493
493
|
size: l,
|
|
494
|
-
...
|
|
494
|
+
...le,
|
|
495
495
|
children: /* @__PURE__ */ c(Et, { children: [
|
|
496
496
|
/* @__PURE__ */ e(yt, { styles: ae, visible: W, opacity: 0.8 }),
|
|
497
497
|
/* @__PURE__ */ c(ht, { height: H, children: [
|
|
498
|
-
|
|
498
|
+
re ? /* @__PURE__ */ e(It, { size: "100px", children: /* @__PURE__ */ e(
|
|
499
499
|
Qe,
|
|
500
500
|
{
|
|
501
501
|
autoClose: ee,
|
|
@@ -519,7 +519,7 @@ function Ln({
|
|
|
519
519
|
actionName: "save",
|
|
520
520
|
actionDescription: `Salvar ${L || t || "registro"}`,
|
|
521
521
|
leftSection: /* @__PURE__ */ e(et, {}),
|
|
522
|
-
onClick:
|
|
522
|
+
onClick: z,
|
|
523
523
|
disabled: s && s.isBrowsing(),
|
|
524
524
|
variant: v ?? E.variant,
|
|
525
525
|
color: "green",
|
|
@@ -558,12 +558,12 @@ function Ln({
|
|
|
558
558
|
}
|
|
559
559
|
);
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function Lr({
|
|
562
562
|
title: t,
|
|
563
|
-
withOverlay:
|
|
563
|
+
withOverlay: r = !0,
|
|
564
564
|
overlayProps: o,
|
|
565
565
|
children: f,
|
|
566
|
-
withCloseButton:
|
|
566
|
+
withCloseButton: n = !0,
|
|
567
567
|
closeButtonProps: i,
|
|
568
568
|
opened: h,
|
|
569
569
|
fullScreen: p,
|
|
@@ -575,13 +575,13 @@ function jn({
|
|
|
575
575
|
onlyOkButton: H = !1,
|
|
576
576
|
onClose: I,
|
|
577
577
|
onClickOk: C,
|
|
578
|
-
onClickCancel:
|
|
578
|
+
onClickCancel: b,
|
|
579
579
|
userActions: m,
|
|
580
580
|
// Props de segurança (opcionais)
|
|
581
|
-
resourceName:
|
|
582
|
-
resourceDescription:
|
|
583
|
-
requiredPermissions:
|
|
584
|
-
fallbackComponent:
|
|
581
|
+
resourceName: V,
|
|
582
|
+
resourceDescription: w,
|
|
583
|
+
requiredPermissions: P,
|
|
584
|
+
fallbackComponent: F,
|
|
585
585
|
securityOptions: u
|
|
586
586
|
}) {
|
|
587
587
|
const X = Me(), ee = ut(), { colorScheme: ae } = st();
|
|
@@ -591,29 +591,29 @@ function jn({
|
|
|
591
591
|
const Q = () => {
|
|
592
592
|
C && C(), I();
|
|
593
593
|
}, L = () => {
|
|
594
|
-
|
|
594
|
+
b && b(), I();
|
|
595
595
|
}, _ = () => {
|
|
596
596
|
St.showWarning(g().t("Click on Ok or Cancel to close"));
|
|
597
597
|
};
|
|
598
598
|
return /* @__PURE__ */ e(
|
|
599
599
|
He,
|
|
600
600
|
{
|
|
601
|
-
resourceName:
|
|
602
|
-
resourceDescription:
|
|
603
|
-
requiredPermissions:
|
|
604
|
-
fallbackComponent:
|
|
601
|
+
resourceName: V,
|
|
602
|
+
resourceDescription: w,
|
|
603
|
+
requiredPermissions: P,
|
|
604
|
+
fallbackComponent: F,
|
|
605
605
|
onSecurityReady: u?.onSecurityReady,
|
|
606
606
|
onAccessDenied: u?.onAccessDenied,
|
|
607
607
|
children: /* @__PURE__ */ e(
|
|
608
608
|
bt,
|
|
609
609
|
{
|
|
610
610
|
title: t,
|
|
611
|
-
withOverlay:
|
|
611
|
+
withOverlay: r,
|
|
612
612
|
overlayProps: o || {
|
|
613
613
|
color: ae === "dark" ? ee.colors.dark[7] : ee.colors.gray[6],
|
|
614
614
|
opacity: 0.25
|
|
615
615
|
},
|
|
616
|
-
withCloseButton:
|
|
616
|
+
withCloseButton: n,
|
|
617
617
|
closeButtonProps: i,
|
|
618
618
|
onClose: _,
|
|
619
619
|
opened: h,
|
|
@@ -630,7 +630,7 @@ function jn({
|
|
|
630
630
|
K,
|
|
631
631
|
{
|
|
632
632
|
actionName: "save",
|
|
633
|
-
actionDescription: `Salvar ${
|
|
633
|
+
actionDescription: `Salvar ${w || "registro"}`,
|
|
634
634
|
leftSection: /* @__PURE__ */ e(et, {}),
|
|
635
635
|
onClick: Q,
|
|
636
636
|
variant: v ?? X.variant,
|
|
@@ -647,7 +647,7 @@ function jn({
|
|
|
647
647
|
onClick: L,
|
|
648
648
|
variant: v ?? X.variant,
|
|
649
649
|
color: "red",
|
|
650
|
-
children:
|
|
650
|
+
children: b ? `${g().t("Cancel")}` : `${g().t("Close")}`
|
|
651
651
|
}
|
|
652
652
|
)
|
|
653
653
|
] })
|
|
@@ -658,22 +658,22 @@ function jn({
|
|
|
658
658
|
}
|
|
659
659
|
);
|
|
660
660
|
}
|
|
661
|
-
const
|
|
662
|
-
if (!t || !
|
|
663
|
-
let f = -1,
|
|
664
|
-
return o && o.getFilters().length > 0 && (f = 0,
|
|
661
|
+
const mr = (t, r, o) => {
|
|
662
|
+
if (!t || !r || !r.existsValue(`${t.viewName}_${t.componentName}`)) {
|
|
663
|
+
let f = -1, n;
|
|
664
|
+
return o && o.getFilters().length > 0 && (f = 0, n = JSON.parse(o.getFirstFilter()?.filter)), {
|
|
665
665
|
activeFilterIndex: f,
|
|
666
666
|
expandedFilter: !1,
|
|
667
|
-
currentFilter:
|
|
667
|
+
currentFilter: n
|
|
668
668
|
};
|
|
669
669
|
}
|
|
670
|
-
return
|
|
670
|
+
return r.getValue(`${t.viewName}_${t.componentName}`);
|
|
671
671
|
};
|
|
672
|
-
function
|
|
672
|
+
function gr(t, r) {
|
|
673
673
|
const {
|
|
674
674
|
title: o,
|
|
675
675
|
printTitle: f,
|
|
676
|
-
dataSource:
|
|
676
|
+
dataSource: n,
|
|
677
677
|
filterOptions: i,
|
|
678
678
|
pageSize: h = 15,
|
|
679
679
|
pageIndex: p = 0,
|
|
@@ -685,12 +685,12 @@ function pn(t, n) {
|
|
|
685
685
|
customRenderRowActions: H,
|
|
686
686
|
innerRef: I,
|
|
687
687
|
isLoading: C = !1,
|
|
688
|
-
isLoadingFilter:
|
|
688
|
+
isLoadingFilter: b = !1,
|
|
689
689
|
isError: m = !1,
|
|
690
|
-
enableTopToolbar:
|
|
691
|
-
enableTopToolbarActions:
|
|
692
|
-
error:
|
|
693
|
-
clearError:
|
|
690
|
+
enableTopToolbar: V = !0,
|
|
691
|
+
enableTopToolbarActions: w = !0,
|
|
692
|
+
error: P = "",
|
|
693
|
+
clearError: F = () => {
|
|
694
694
|
},
|
|
695
695
|
filterType: u,
|
|
696
696
|
width: X = "100%",
|
|
@@ -701,11 +701,11 @@ function pn(t, n) {
|
|
|
701
701
|
filterPersistenceDelegator: _,
|
|
702
702
|
variant: R,
|
|
703
703
|
store: T,
|
|
704
|
-
cellPadding:
|
|
704
|
+
cellPadding: le,
|
|
705
705
|
bottomToolbarMinHeight: E,
|
|
706
706
|
enableRowSelection: te = !0,
|
|
707
707
|
enableRowNumbers: ue = !0,
|
|
708
|
-
enableRowActions:
|
|
708
|
+
enableRowActions: re = !0,
|
|
709
709
|
positionActionsColumn: q = "first",
|
|
710
710
|
actionsColumnWidth: j,
|
|
711
711
|
tableHeadCellPadding: J,
|
|
@@ -713,14 +713,14 @@ function pn(t, n) {
|
|
|
713
713
|
renderTopToolbar: Y,
|
|
714
714
|
toolbarAlignment: ce = "right",
|
|
715
715
|
toolbarLeftContent: be,
|
|
716
|
-
onSelectedRowsChanged:
|
|
716
|
+
onSelectedRowsChanged: ne,
|
|
717
717
|
onCellDoubleClick: d,
|
|
718
|
-
onFilterModelChange:
|
|
718
|
+
onFilterModelChange: z,
|
|
719
719
|
paginationLabels: M,
|
|
720
720
|
// Props de segurança (opcionais)
|
|
721
721
|
resourceName: we,
|
|
722
722
|
resourceDescription: he,
|
|
723
|
-
requiredPermissions:
|
|
723
|
+
requiredPermissions: k,
|
|
724
724
|
fallbackComponent: fe,
|
|
725
725
|
securityOptions: Fe,
|
|
726
726
|
// Props para controle de bordas internas
|
|
@@ -738,11 +738,11 @@ function pn(t, n) {
|
|
|
738
738
|
});
|
|
739
739
|
const Le = We(
|
|
740
740
|
"ArchbaseGridTemplate",
|
|
741
|
-
|
|
741
|
+
n,
|
|
742
742
|
void 0,
|
|
743
743
|
void 0
|
|
744
744
|
);
|
|
745
|
-
Gt(
|
|
745
|
+
Gt(r, () => ({
|
|
746
746
|
refreshData: () => {
|
|
747
747
|
D.current && D.current.refreshData();
|
|
748
748
|
},
|
|
@@ -759,15 +759,15 @@ function pn(t, n) {
|
|
|
759
759
|
getDataGridRef: () => D,
|
|
760
760
|
getFilterModel: () => D.current ? D.current.getFilterModel() : { items: [], quickFilterValues: [] }
|
|
761
761
|
}), [D]);
|
|
762
|
-
const [x,
|
|
762
|
+
const [x, B] = U({
|
|
763
763
|
activeFilterIndex: -1,
|
|
764
764
|
currentFilter: void 0,
|
|
765
765
|
expandedFilter: !1
|
|
766
766
|
});
|
|
767
|
-
|
|
768
|
-
const S =
|
|
769
|
-
|
|
770
|
-
}, [
|
|
767
|
+
rt(() => {
|
|
768
|
+
const S = mr(i, T, _);
|
|
769
|
+
B(S);
|
|
770
|
+
}, [b]);
|
|
771
771
|
const ke = (S) => {
|
|
772
772
|
if (H)
|
|
773
773
|
return H(S);
|
|
@@ -790,28 +790,28 @@ function pn(t, n) {
|
|
|
790
790
|
}, [I]);
|
|
791
791
|
const lt = (S, Te) => {
|
|
792
792
|
const ve = { ...x, currentFilter: S, activeFilterIndex: Te };
|
|
793
|
-
|
|
794
|
-
},
|
|
793
|
+
B(ve), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, ve);
|
|
794
|
+
}, ie = (S) => {
|
|
795
795
|
const Te = { ...x, expandedFilter: S };
|
|
796
|
-
|
|
796
|
+
B(Te), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, Te);
|
|
797
797
|
}, y = (S, Te) => {
|
|
798
798
|
const ve = { ...x, currentFilter: S, activeFilterIndex: Te };
|
|
799
|
-
|
|
799
|
+
B(ve), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, ve);
|
|
800
800
|
}, ye = () => {
|
|
801
801
|
if (x.currentFilter)
|
|
802
802
|
if (ae)
|
|
803
803
|
ae();
|
|
804
804
|
else if (x.currentFilter.filter.filterType === "quick") {
|
|
805
|
-
const S =
|
|
805
|
+
const S = n.getOptions();
|
|
806
806
|
x.currentFilter.filter.quickFilterText && x.currentFilter.filter.quickFilterText !== "" ? (S.filter = JSON.stringify({
|
|
807
807
|
search: x.currentFilter.filter.quickFilterText,
|
|
808
808
|
fields: x.currentFilter.filter.quickFilterFieldsText
|
|
809
|
-
}), S.sort = x.currentFilter.sort.quickFilterSort ? x.currentFilter.sort.quickFilterSort.split(",") : []) : (S.filter = void 0, S.sort = void 0),
|
|
809
|
+
}), S.sort = x.currentFilter.sort.quickFilterSort ? x.currentFilter.sort.quickFilterSort.split(",") : []) : (S.filter = void 0, S.sort = void 0), n.refreshData(S), Le.isDataSourceV2 || Le.v1State.forceUpdate();
|
|
810
810
|
} else {
|
|
811
|
-
const S =
|
|
811
|
+
const S = dr(x.currentFilter);
|
|
812
812
|
if (S && S.expressionNode) {
|
|
813
|
-
const Te = Yt(S.expressionNode), ve =
|
|
814
|
-
ve.filter = Te, ve.sort = S?.sortStrings,
|
|
813
|
+
const Te = Yt(S.expressionNode), ve = n.getOptions();
|
|
814
|
+
ve.filter = Te, ve.sort = S?.sortStrings, n.refreshData(ve), Le.isDataSourceV2 || Le.v1State.forceUpdate();
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
};
|
|
@@ -839,7 +839,7 @@ function pn(t, n) {
|
|
|
839
839
|
onSelectedFilter: y,
|
|
840
840
|
onFilterChanged: lt,
|
|
841
841
|
onSearchByFilter: ye,
|
|
842
|
-
onToggleExpandedFilter:
|
|
842
|
+
onToggleExpandedFilter: ie,
|
|
843
843
|
onExport: pt,
|
|
844
844
|
onPrint: xt,
|
|
845
845
|
showExportButton: !0,
|
|
@@ -854,7 +854,7 @@ function pn(t, n) {
|
|
|
854
854
|
{
|
|
855
855
|
resourceName: we,
|
|
856
856
|
resourceDescription: he,
|
|
857
|
-
requiredPermissions:
|
|
857
|
+
requiredPermissions: k,
|
|
858
858
|
fallbackComponent: fe,
|
|
859
859
|
onSecurityReady: Fe?.onSecurityReady,
|
|
860
860
|
onAccessDenied: Fe?.onAccessDenied,
|
|
@@ -869,8 +869,8 @@ function pn(t, n) {
|
|
|
869
869
|
title: g().t("archbase:WARNING"),
|
|
870
870
|
titleColor: "rgb(250, 82, 82)",
|
|
871
871
|
variant: R ?? me.variant,
|
|
872
|
-
onClose: () =>
|
|
873
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
872
|
+
onClose: () => F && F(),
|
|
873
|
+
children: /* @__PURE__ */ e("span", { children: P })
|
|
874
874
|
}
|
|
875
875
|
) : null,
|
|
876
876
|
/* @__PURE__ */ c(
|
|
@@ -882,13 +882,13 @@ function pn(t, n) {
|
|
|
882
882
|
width: X,
|
|
883
883
|
height: ee,
|
|
884
884
|
withBorder: !1,
|
|
885
|
-
dataSource:
|
|
885
|
+
dataSource: n,
|
|
886
886
|
enableColumnResizing: !0,
|
|
887
887
|
enableRowNumbers: ue,
|
|
888
888
|
enableRowSelection: te,
|
|
889
|
-
enableRowActions:
|
|
890
|
-
enableTopToolbar:
|
|
891
|
-
enableTopToolbarActions:
|
|
889
|
+
enableRowActions: re,
|
|
890
|
+
enableTopToolbar: V,
|
|
891
|
+
enableTopToolbarActions: w,
|
|
892
892
|
manualPagination: !0,
|
|
893
893
|
manualSorting: !0,
|
|
894
894
|
isLoading: De,
|
|
@@ -899,17 +899,17 @@ function pn(t, n) {
|
|
|
899
899
|
renderToolbarInternalActions: u == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
|
|
900
900
|
allowExportData: !0,
|
|
901
901
|
allowPrintData: !0,
|
|
902
|
-
onSelectedRowsChanged:
|
|
902
|
+
onSelectedRowsChanged: ne,
|
|
903
903
|
onCellDoubleClick: d,
|
|
904
|
-
onFilterModelChange:
|
|
905
|
-
renderRowActions:
|
|
904
|
+
onFilterModelChange: z,
|
|
905
|
+
renderRowActions: re ? ke : void 0,
|
|
906
906
|
positionActionsColumn: q,
|
|
907
907
|
actionsColumnWidth: j,
|
|
908
908
|
toolbarAlignment: ce,
|
|
909
909
|
toolbarLeftContent: ge,
|
|
910
910
|
renderToolbarActions: u === "advanced" || u === "none" ? Ye : void 0,
|
|
911
911
|
paginationLabels: M,
|
|
912
|
-
cellPadding:
|
|
912
|
+
cellPadding: le,
|
|
913
913
|
bottomToolbarMinHeight: E,
|
|
914
914
|
tableHeadCellPadding: J,
|
|
915
915
|
getRowId: Q,
|
|
@@ -926,7 +926,7 @@ function pn(t, n) {
|
|
|
926
926
|
hideFooter: Ge,
|
|
927
927
|
children: [
|
|
928
928
|
a,
|
|
929
|
-
l?.visible ? /* @__PURE__ */ e(
|
|
929
|
+
l?.visible ? /* @__PURE__ */ e(ir, { children: /* @__PURE__ */ c(qe, { children: [
|
|
930
930
|
/* @__PURE__ */ e("h3", { className: "only-print", children: f || o }),
|
|
931
931
|
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ c(Ce, { gap: "8px", rowGap: "8px", children: [
|
|
932
932
|
l.customUserActions && l.customUserActionsPosition === "left" ? l.customUserActions : null,
|
|
@@ -949,7 +949,7 @@ function pn(t, n) {
|
|
|
949
949
|
actionDescription: `Editar ${he || "registro"}`,
|
|
950
950
|
color: "blue",
|
|
951
951
|
leftSection: /* @__PURE__ */ e(At, {}),
|
|
952
|
-
disabled: !
|
|
952
|
+
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
953
953
|
variant: R ?? me.variant,
|
|
954
954
|
onClick: () => l && l.onEditExecute && l.onEditExecute(),
|
|
955
955
|
children: l.labelEdit || g().t("archbase:Edit")
|
|
@@ -961,8 +961,8 @@ function pn(t, n) {
|
|
|
961
961
|
actionName: "delete",
|
|
962
962
|
actionDescription: `Remover ${he || "registro"}`,
|
|
963
963
|
color: "red",
|
|
964
|
-
leftSection: /* @__PURE__ */ e(
|
|
965
|
-
disabled: !l?.allowRemove || !
|
|
964
|
+
leftSection: /* @__PURE__ */ e(nt, {}),
|
|
965
|
+
disabled: !l?.allowRemove || !n.isBrowsing() || n.isEmpty(),
|
|
966
966
|
variant: R ?? me.variant,
|
|
967
967
|
onClick: () => l && l.onRemoveExecute && l.onRemoveExecute(),
|
|
968
968
|
children: l.labelRemove || g().t("archbase:Remove")
|
|
@@ -975,7 +975,7 @@ function pn(t, n) {
|
|
|
975
975
|
actionDescription: `Visualizar ${he || "registro"}`,
|
|
976
976
|
color: "gray.7",
|
|
977
977
|
leftSection: /* @__PURE__ */ e(Rt, {}),
|
|
978
|
-
disabled: !
|
|
978
|
+
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
979
979
|
variant: R ?? me.variant,
|
|
980
980
|
onClick: () => l && l.onViewExecute && l.onViewExecute(),
|
|
981
981
|
children: l.labelView || g().t("archbase:View")
|
|
@@ -991,19 +991,19 @@ function pn(t, n) {
|
|
|
991
991
|
}
|
|
992
992
|
);
|
|
993
993
|
}
|
|
994
|
-
const
|
|
995
|
-
function
|
|
994
|
+
const jr = zt(gr);
|
|
995
|
+
function pr(t, r, o, f) {
|
|
996
996
|
if (t && t.headerGridColumns) {
|
|
997
|
-
const
|
|
997
|
+
const n = 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" }, h = t.headerGridColumns.right ? t.headerGridColumns.right : { xs: "auto", sm: "auto", md: "auto", lg: "auto" };
|
|
998
998
|
return /* @__PURE__ */ c(Ee, { m: 0, gap: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
999
999
|
/* @__PURE__ */ e(
|
|
1000
1000
|
Ee.Col,
|
|
1001
1001
|
{
|
|
1002
1002
|
span: {
|
|
1003
|
-
xs:
|
|
1004
|
-
sm:
|
|
1005
|
-
md:
|
|
1006
|
-
lg:
|
|
1003
|
+
xs: n.xs,
|
|
1004
|
+
sm: n.sm,
|
|
1005
|
+
md: n.md,
|
|
1006
|
+
lg: n.lg
|
|
1007
1007
|
},
|
|
1008
1008
|
style: {
|
|
1009
1009
|
border: f ? "1px dashed" : "",
|
|
@@ -1011,7 +1011,7 @@ function xn(t, n, o, f) {
|
|
|
1011
1011
|
justifyContent: "flex-start",
|
|
1012
1012
|
alignItems: "center"
|
|
1013
1013
|
},
|
|
1014
|
-
children:
|
|
1014
|
+
children: r
|
|
1015
1015
|
}
|
|
1016
1016
|
),
|
|
1017
1017
|
/* @__PURE__ */ e(
|
|
@@ -1051,26 +1051,26 @@ function xn(t, n, o, f) {
|
|
|
1051
1051
|
)
|
|
1052
1052
|
] });
|
|
1053
1053
|
} else {
|
|
1054
|
-
const
|
|
1054
|
+
const n = t && t.headerFlexGrow ? t.headerFlexGrow : "even", i = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end", h = t && t.headerFlexLeftJustifyContent ? t.headerFlexLeftJustifyContent : "flex-start";
|
|
1055
1055
|
return /* @__PURE__ */ c(Ce, { justify: "space-between", children: [
|
|
1056
1056
|
/* @__PURE__ */ e(
|
|
1057
1057
|
Ce,
|
|
1058
1058
|
{
|
|
1059
|
-
w:
|
|
1060
|
-
maw:
|
|
1059
|
+
w: n === "left" || n === "even" ? "100%" : void 0,
|
|
1060
|
+
maw: n === "left" || n === "even" ? void 0 : "100%",
|
|
1061
1061
|
align: "center",
|
|
1062
1062
|
justify: h,
|
|
1063
1063
|
style: {
|
|
1064
1064
|
border: f ? "1px dashed" : ""
|
|
1065
1065
|
},
|
|
1066
|
-
children:
|
|
1066
|
+
children: r
|
|
1067
1067
|
}
|
|
1068
1068
|
),
|
|
1069
1069
|
/* @__PURE__ */ e(
|
|
1070
1070
|
Ce,
|
|
1071
1071
|
{
|
|
1072
|
-
w:
|
|
1073
|
-
maw:
|
|
1072
|
+
w: n === "right" || n === "even" ? "100%" : void 0,
|
|
1073
|
+
maw: n === "right" || n === "even" ? void 0 : "100%",
|
|
1074
1074
|
align: "center",
|
|
1075
1075
|
justify: i,
|
|
1076
1076
|
style: {
|
|
@@ -1082,18 +1082,18 @@ function xn(t, n, o, f) {
|
|
|
1082
1082
|
] });
|
|
1083
1083
|
}
|
|
1084
1084
|
}
|
|
1085
|
-
function
|
|
1085
|
+
function xr(t, r, o, f) {
|
|
1086
1086
|
if (t && t.footerGridColumns) {
|
|
1087
|
-
const
|
|
1087
|
+
const n = 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" }, h = t.footerGridColumns.right ? t.footerGridColumns.right : { xs: "content", sm: "content", md: "content", lg: "content" };
|
|
1088
1088
|
return /* @__PURE__ */ c(Ee, { m: 0, gap: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
1089
1089
|
/* @__PURE__ */ e(
|
|
1090
1090
|
Ee.Col,
|
|
1091
1091
|
{
|
|
1092
1092
|
span: {
|
|
1093
|
-
xs:
|
|
1094
|
-
sm:
|
|
1095
|
-
md:
|
|
1096
|
-
lg:
|
|
1093
|
+
xs: n.xs,
|
|
1094
|
+
sm: n.sm,
|
|
1095
|
+
md: n.md,
|
|
1096
|
+
lg: n.lg
|
|
1097
1097
|
},
|
|
1098
1098
|
style: {
|
|
1099
1099
|
border: f ? "1px dashed" : "",
|
|
@@ -1101,7 +1101,7 @@ function vn(t, n, o, f) {
|
|
|
1101
1101
|
justifyContent: "flex-start",
|
|
1102
1102
|
alignItems: "center"
|
|
1103
1103
|
},
|
|
1104
|
-
children:
|
|
1104
|
+
children: r
|
|
1105
1105
|
}
|
|
1106
1106
|
),
|
|
1107
1107
|
/* @__PURE__ */ e(
|
|
@@ -1141,28 +1141,28 @@ function vn(t, n, o, f) {
|
|
|
1141
1141
|
)
|
|
1142
1142
|
] });
|
|
1143
1143
|
} else {
|
|
1144
|
-
const
|
|
1144
|
+
const n = t && t.footerFlexGrow ? t.footerFlexGrow : "even", i = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end", h = t && t.footerFlexLeftJustifyContent ? t.footerFlexLeftJustifyContent : "flex-start";
|
|
1145
1145
|
return /* @__PURE__ */ c(Ce, { justify: "space-between", children: [
|
|
1146
1146
|
/* @__PURE__ */ e(
|
|
1147
1147
|
Ce,
|
|
1148
1148
|
{
|
|
1149
|
-
w:
|
|
1150
|
-
maw:
|
|
1149
|
+
w: n === "left" || n === "even" ? "100%" : void 0,
|
|
1150
|
+
maw: n === "left" || n === "even" ? void 0 : "100%",
|
|
1151
1151
|
align: "center",
|
|
1152
1152
|
justify: h,
|
|
1153
1153
|
style: {
|
|
1154
1154
|
border: f ? "1px dashed" : "",
|
|
1155
1155
|
height: "auto",
|
|
1156
|
-
padding:
|
|
1156
|
+
padding: r && "calc(0.625rem / 2)"
|
|
1157
1157
|
},
|
|
1158
|
-
children:
|
|
1158
|
+
children: r
|
|
1159
1159
|
}
|
|
1160
1160
|
),
|
|
1161
1161
|
/* @__PURE__ */ e(
|
|
1162
1162
|
Ce,
|
|
1163
1163
|
{
|
|
1164
|
-
w:
|
|
1165
|
-
maw:
|
|
1164
|
+
w: n === "right" || n === "even" ? "100%" : void 0,
|
|
1165
|
+
maw: n === "right" || n === "even" ? void 0 : "100%",
|
|
1166
1166
|
align: "center",
|
|
1167
1167
|
justify: i,
|
|
1168
1168
|
style: {
|
|
@@ -1178,10 +1178,10 @@ function vn(t, n, o, f) {
|
|
|
1178
1178
|
}
|
|
1179
1179
|
function Mt({
|
|
1180
1180
|
title: t,
|
|
1181
|
-
innerRef:
|
|
1181
|
+
innerRef: r,
|
|
1182
1182
|
isError: o = !1,
|
|
1183
1183
|
error: f = "",
|
|
1184
|
-
clearError:
|
|
1184
|
+
clearError: n,
|
|
1185
1185
|
width: i = "100%",
|
|
1186
1186
|
height: h = "100%",
|
|
1187
1187
|
withBorder: p = !0,
|
|
@@ -1193,12 +1193,12 @@ function Mt({
|
|
|
1193
1193
|
headerMiddle: H,
|
|
1194
1194
|
headerRight: I,
|
|
1195
1195
|
footerLeft: C,
|
|
1196
|
-
footerMiddle:
|
|
1196
|
+
footerMiddle: b,
|
|
1197
1197
|
footerRight: m,
|
|
1198
|
-
variant:
|
|
1199
|
-
options:
|
|
1200
|
-
style:
|
|
1201
|
-
debugOptions:
|
|
1198
|
+
variant: V,
|
|
1199
|
+
options: w = {},
|
|
1200
|
+
style: P,
|
|
1201
|
+
debugOptions: F = {
|
|
1202
1202
|
debugLayoutHotKey: "ctrl+shift+S",
|
|
1203
1203
|
debugObjectInspectorHotKey: "ctrl+shift+D",
|
|
1204
1204
|
objectsToInspect: []
|
|
@@ -1215,16 +1215,16 @@ function Mt({
|
|
|
1215
1215
|
defaultValue: l,
|
|
1216
1216
|
finalValue: !1
|
|
1217
1217
|
});
|
|
1218
|
-
Xt([[
|
|
1218
|
+
Xt([[F && F.debugLayoutHotKey, () => _(!L)]]);
|
|
1219
1219
|
const R = Me(), { t: T } = Zt();
|
|
1220
1220
|
Ue({
|
|
1221
1221
|
autoRegisterActions: Q?.autoRegisterActions ?? !0
|
|
1222
1222
|
});
|
|
1223
|
-
const
|
|
1224
|
-
height: j.height -
|
|
1225
|
-
width: j.width -
|
|
1226
|
-
}), [j.height, j.width,
|
|
1227
|
-
|
|
1223
|
+
const le = Se(null), E = r || le, te = Se(null), ue = Se(null), re = ct(te), q = ct(ue), j = ct(E), J = Je(() => ({
|
|
1224
|
+
height: j.height - re.height - q.height - Number(Ot("0.625rem")),
|
|
1225
|
+
width: j.width - re.width - q.width
|
|
1226
|
+
}), [j.height, j.width, re.height, re.width, q.height, q.width]), W = Se(l);
|
|
1227
|
+
rt(() => {
|
|
1228
1228
|
l !== W.current && (_(l), W.current = l);
|
|
1229
1229
|
}, [l, _]);
|
|
1230
1230
|
const Y = /* @__PURE__ */ c(qe, { children: [
|
|
@@ -1234,9 +1234,9 @@ function Mt({
|
|
|
1234
1234
|
ref: E,
|
|
1235
1235
|
withBorder: p,
|
|
1236
1236
|
radius: v,
|
|
1237
|
-
style: { width: i, height: h, padding: 4, ...
|
|
1237
|
+
style: { width: i, height: h, padding: 4, ...P },
|
|
1238
1238
|
children: /* @__PURE__ */ c(ht, { height: "100%", children: [
|
|
1239
|
-
/* @__PURE__ */ e(It, { size:
|
|
1239
|
+
/* @__PURE__ */ e(It, { size: re.height, children: /* @__PURE__ */ e("div", { ref: te, children: pr(w, s, I, L) }) }),
|
|
1240
1240
|
/* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
|
|
1241
1241
|
Ze,
|
|
1242
1242
|
{
|
|
@@ -1245,7 +1245,7 @@ function Mt({
|
|
|
1245
1245
|
border: L ? "1px dashed" : "",
|
|
1246
1246
|
padding: "calc(0.625rem / 2)"
|
|
1247
1247
|
},
|
|
1248
|
-
children: a ? /* @__PURE__ */ c(
|
|
1248
|
+
children: a ? /* @__PURE__ */ c(er, { children: [
|
|
1249
1249
|
o && /* @__PURE__ */ e(
|
|
1250
1250
|
Qe,
|
|
1251
1251
|
{
|
|
@@ -1255,8 +1255,8 @@ function Mt({
|
|
|
1255
1255
|
icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
|
|
1256
1256
|
title: `${T("WARNING")}`,
|
|
1257
1257
|
titleColor: "rgb(250, 82, 82)",
|
|
1258
|
-
variant:
|
|
1259
|
-
onClose: () =>
|
|
1258
|
+
variant: V ?? R.variant,
|
|
1259
|
+
onClose: () => n && n(),
|
|
1260
1260
|
children: /* @__PURE__ */ e("span", { children: f })
|
|
1261
1261
|
}
|
|
1262
1262
|
),
|
|
@@ -1264,15 +1264,15 @@ function Mt({
|
|
|
1264
1264
|
] }) : L && /* @__PURE__ */ e(Ce, { h: J.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(Re, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
|
|
1265
1265
|
}
|
|
1266
1266
|
) }),
|
|
1267
|
-
/* @__PURE__ */ e(mt, { size: q.height, children: /* @__PURE__ */ e("div", { ref: ue, children:
|
|
1267
|
+
/* @__PURE__ */ e(mt, { size: q.height, children: /* @__PURE__ */ e("div", { ref: ue, children: xr(w, C, m, L) }) })
|
|
1268
1268
|
] })
|
|
1269
1269
|
}
|
|
1270
1270
|
),
|
|
1271
1271
|
/* @__PURE__ */ e(
|
|
1272
|
-
|
|
1272
|
+
lr,
|
|
1273
1273
|
{
|
|
1274
|
-
debugObjectInspectorHotKey:
|
|
1275
|
-
objectsToInspect:
|
|
1274
|
+
debugObjectInspectorHotKey: F && F.debugObjectInspectorHotKey,
|
|
1275
|
+
objectsToInspect: F && F.objectsToInspect
|
|
1276
1276
|
}
|
|
1277
1277
|
)
|
|
1278
1278
|
] });
|
|
@@ -1289,17 +1289,17 @@ function Mt({
|
|
|
1289
1289
|
}
|
|
1290
1290
|
);
|
|
1291
1291
|
}
|
|
1292
|
-
function
|
|
1293
|
-
console.log(`Render de "${t}" na fase "${
|
|
1292
|
+
function vr(t, r, o, f, n, i) {
|
|
1293
|
+
console.log(`Render de "${t}" na fase "${r}": ${o}ms`);
|
|
1294
1294
|
}
|
|
1295
|
-
function
|
|
1295
|
+
function Mr({
|
|
1296
1296
|
title: t,
|
|
1297
|
-
dataSource:
|
|
1297
|
+
dataSource: r,
|
|
1298
1298
|
// dataSourceEdition,
|
|
1299
1299
|
filterOptions: o,
|
|
1300
1300
|
globalFilterFieldNames: f,
|
|
1301
1301
|
//pageSize,
|
|
1302
|
-
filterFields:
|
|
1302
|
+
filterFields: n,
|
|
1303
1303
|
innerRef: i,
|
|
1304
1304
|
//isLoading = false,
|
|
1305
1305
|
debug: h = !1,
|
|
@@ -1313,12 +1313,12 @@ function Un({
|
|
|
1313
1313
|
withBorder: H = !0,
|
|
1314
1314
|
filterPersistenceDelegator: I,
|
|
1315
1315
|
withPagination: C = !0,
|
|
1316
|
-
radius:
|
|
1316
|
+
radius: b,
|
|
1317
1317
|
userActions: m,
|
|
1318
|
-
columnsCountBreakPoints:
|
|
1319
|
-
columnsCount:
|
|
1320
|
-
gutter:
|
|
1321
|
-
component:
|
|
1318
|
+
columnsCountBreakPoints: V,
|
|
1319
|
+
columnsCount: w,
|
|
1320
|
+
gutter: P,
|
|
1321
|
+
component: F,
|
|
1322
1322
|
activeIndex: u,
|
|
1323
1323
|
activeBackgroundColor: X,
|
|
1324
1324
|
activeColor: ee,
|
|
@@ -1327,85 +1327,85 @@ function Un({
|
|
|
1327
1327
|
style: L,
|
|
1328
1328
|
spaceOptions: _,
|
|
1329
1329
|
variant: R,
|
|
1330
|
-
id: T =
|
|
1331
|
-
debugOptions:
|
|
1330
|
+
id: T = hr("masonry"),
|
|
1331
|
+
debugOptions: le,
|
|
1332
1332
|
// Props de segurança (opcionais)
|
|
1333
1333
|
resourceName: E,
|
|
1334
1334
|
resourceDescription: te,
|
|
1335
1335
|
requiredPermissions: ue,
|
|
1336
|
-
fallbackComponent:
|
|
1336
|
+
fallbackComponent: re,
|
|
1337
1337
|
securityOptions: q
|
|
1338
1338
|
}) {
|
|
1339
|
-
const j = Me(), [J] = U(T), W = i || Se(null), Y = Se(null), [ce, be] = U(
|
|
1340
|
-
u || (
|
|
1339
|
+
const j = Me(), [J] = U(T), W = i || Se(null), Y = Se(null), [ce, be] = U(r.getCurrentPage()), [ne, d] = U(
|
|
1340
|
+
u || (r && r.getTotalRecords() > 0 ? 0 : -1)
|
|
1341
1341
|
);
|
|
1342
1342
|
ct(W);
|
|
1343
|
-
const [
|
|
1343
|
+
const [z, M] = U({
|
|
1344
1344
|
activeFilterIndex: -1,
|
|
1345
1345
|
expandedFilter: !1
|
|
1346
1346
|
}), [we, he] = U(0), {
|
|
1347
|
-
isDataSourceV2:
|
|
1347
|
+
isDataSourceV2: k,
|
|
1348
1348
|
v1State: { forceUpdate: fe }
|
|
1349
1349
|
} = We(
|
|
1350
1350
|
"ArchbaseMasonryTemplate",
|
|
1351
|
-
|
|
1351
|
+
r
|
|
1352
1352
|
);
|
|
1353
1353
|
it({
|
|
1354
|
-
dataSource:
|
|
1354
|
+
dataSource: r,
|
|
1355
1355
|
listener: (x) => {
|
|
1356
|
-
(x.type === Ie.afterRemove || x.type === Ie.refreshData) && (he((
|
|
1356
|
+
(x.type === Ie.afterRemove || x.type === Ie.refreshData) && (he((B) => B + 1), k || fe());
|
|
1357
1357
|
}
|
|
1358
1358
|
});
|
|
1359
1359
|
const Fe = Je(() => {
|
|
1360
|
-
if (
|
|
1361
|
-
const x =
|
|
1362
|
-
let
|
|
1363
|
-
return
|
|
1360
|
+
if (F) {
|
|
1361
|
+
const x = F.type;
|
|
1362
|
+
let B = {};
|
|
1363
|
+
return F.props && (B = F.props), r.browseRecords().map((ke, me) => {
|
|
1364
1364
|
const Be = `${J}_${me}`, De = `${J}_${me}`;
|
|
1365
1365
|
let ge = ke.active === void 0 ? !1 : ke.active;
|
|
1366
|
-
return
|
|
1366
|
+
return ne >= 0 && (ge = !1, ne === me && (ge = !0)), /* @__PURE__ */ e(
|
|
1367
1367
|
x,
|
|
1368
1368
|
{
|
|
1369
1369
|
id: De,
|
|
1370
1370
|
active: ge,
|
|
1371
1371
|
index: me,
|
|
1372
|
-
dataSource:
|
|
1372
|
+
dataSource: r,
|
|
1373
1373
|
recordData: ke,
|
|
1374
1374
|
disabled: ke.disabled,
|
|
1375
|
-
...
|
|
1375
|
+
...B
|
|
1376
1376
|
},
|
|
1377
1377
|
Be
|
|
1378
1378
|
);
|
|
1379
1379
|
});
|
|
1380
1380
|
}
|
|
1381
1381
|
return [];
|
|
1382
|
-
}, [
|
|
1383
|
-
M({ ...
|
|
1382
|
+
}, [ne, F, J, r, we]), Ae = (x, B) => {
|
|
1383
|
+
M({ ...z, currentFilter: x, activeFilterIndex: B });
|
|
1384
1384
|
}, Pe = (x) => {
|
|
1385
|
-
M({ ...
|
|
1386
|
-
}, se = (x,
|
|
1387
|
-
M({ ...
|
|
1385
|
+
M({ ...z, expandedFilter: x });
|
|
1386
|
+
}, se = (x, B) => {
|
|
1387
|
+
M({ ...z, currentFilter: x, activeFilterIndex: B });
|
|
1388
1388
|
}, G = () => {
|
|
1389
|
-
}, de = (x,
|
|
1390
|
-
d(x),
|
|
1389
|
+
}, de = (x, B) => {
|
|
1390
|
+
d(x), r && r.gotoRecordByData(B);
|
|
1391
1391
|
}, Ge = (x) => {
|
|
1392
|
-
if (
|
|
1393
|
-
const
|
|
1394
|
-
|
|
1392
|
+
if (r) {
|
|
1393
|
+
const B = r.getOptions();
|
|
1394
|
+
B.filter = x, B.currentPage = ce, r.refreshData(B), k || fe();
|
|
1395
1395
|
}
|
|
1396
1396
|
}, O = (x) => {
|
|
1397
|
-
if (
|
|
1398
|
-
const
|
|
1399
|
-
|
|
1397
|
+
if (r) {
|
|
1398
|
+
const B = r.getOptions();
|
|
1399
|
+
B.currentPage = x, r.refreshData(B), k || fe();
|
|
1400
1400
|
}
|
|
1401
1401
|
}, D = () => p === "normal" && f ? /* @__PURE__ */ e(
|
|
1402
|
-
|
|
1402
|
+
ur,
|
|
1403
1403
|
{
|
|
1404
1404
|
searchableFields: f,
|
|
1405
1405
|
onFilter: Ge,
|
|
1406
1406
|
minFilterValueLength: 1
|
|
1407
1407
|
}
|
|
1408
|
-
) : p === "advanced" ? /* @__PURE__ */ e(
|
|
1408
|
+
) : p === "advanced" ? /* @__PURE__ */ e(tr, { id: `profile_${o.componentName}`, onRender: vr, children: /* @__PURE__ */ e(
|
|
1409
1409
|
Dt,
|
|
1410
1410
|
{
|
|
1411
1411
|
id: o.componentName,
|
|
@@ -1413,17 +1413,17 @@ function Un({
|
|
|
1413
1413
|
apiVersion: o.apiVersion,
|
|
1414
1414
|
ref: Y,
|
|
1415
1415
|
variant: R || j.variant,
|
|
1416
|
-
expandedFilter:
|
|
1416
|
+
expandedFilter: z.expandedFilter,
|
|
1417
1417
|
persistenceDelegator: I,
|
|
1418
|
-
currentFilter:
|
|
1419
|
-
activeFilterIndex:
|
|
1418
|
+
currentFilter: z.currentFilter,
|
|
1419
|
+
activeFilterIndex: z.activeFilterIndex,
|
|
1420
1420
|
onSelectedFilter: se,
|
|
1421
1421
|
onFilterChanged: Ae,
|
|
1422
1422
|
onSearchByFilter: G,
|
|
1423
1423
|
onToggleExpandedFilter: Pe,
|
|
1424
1424
|
width: "660px",
|
|
1425
1425
|
height: "170px",
|
|
1426
|
-
children:
|
|
1426
|
+
children: n
|
|
1427
1427
|
}
|
|
1428
1428
|
) }) : /* @__PURE__ */ e(qe, {}), Le = { ...{
|
|
1429
1429
|
headerFlexGrow: "left",
|
|
@@ -1435,7 +1435,7 @@ function Un({
|
|
|
1435
1435
|
resourceName: E,
|
|
1436
1436
|
resourceDescription: te,
|
|
1437
1437
|
requiredPermissions: ue,
|
|
1438
|
-
fallbackComponent:
|
|
1438
|
+
fallbackComponent: re,
|
|
1439
1439
|
onSecurityReady: q?.onSecurityReady,
|
|
1440
1440
|
onAccessDenied: q?.onAccessDenied,
|
|
1441
1441
|
children: /* @__PURE__ */ e(
|
|
@@ -1444,14 +1444,14 @@ function Un({
|
|
|
1444
1444
|
innerRef: W,
|
|
1445
1445
|
width: l,
|
|
1446
1446
|
height: s,
|
|
1447
|
-
radius:
|
|
1447
|
+
radius: b,
|
|
1448
1448
|
withBorder: H,
|
|
1449
1449
|
isError: a,
|
|
1450
1450
|
error: v,
|
|
1451
1451
|
clearError: $,
|
|
1452
1452
|
title: t,
|
|
1453
1453
|
defaultDebug: h,
|
|
1454
|
-
debugOptions:
|
|
1454
|
+
debugOptions: le,
|
|
1455
1455
|
style: L,
|
|
1456
1456
|
options: Le,
|
|
1457
1457
|
headerLeft: m?.visible !== !1 ? /* @__PURE__ */ c(Ce, { gap: "8px", rowGap: "8px", children: [
|
|
@@ -1475,7 +1475,7 @@ function Un({
|
|
|
1475
1475
|
actionDescription: `Editar ${te || "registro"}`,
|
|
1476
1476
|
color: "blue",
|
|
1477
1477
|
leftSection: /* @__PURE__ */ e(At, {}),
|
|
1478
|
-
disabled: !
|
|
1478
|
+
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
1479
1479
|
variant: R ?? j.variant,
|
|
1480
1480
|
onClick: () => m.onEditExecute(),
|
|
1481
1481
|
children: m.labelEdit || g().t("archbase:Edit")
|
|
@@ -1487,8 +1487,8 @@ function Un({
|
|
|
1487
1487
|
actionName: "delete",
|
|
1488
1488
|
actionDescription: `Remover ${te || "registro"}`,
|
|
1489
1489
|
color: "red",
|
|
1490
|
-
leftSection: /* @__PURE__ */ e(
|
|
1491
|
-
disabled: !
|
|
1490
|
+
leftSection: /* @__PURE__ */ e(nt, {}),
|
|
1491
|
+
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
1492
1492
|
variant: R ?? j.variant,
|
|
1493
1493
|
onClick: () => m.onRemoveExecute(),
|
|
1494
1494
|
children: m.labelRemove || g().t("archbase:Remove")
|
|
@@ -1501,7 +1501,7 @@ function Un({
|
|
|
1501
1501
|
actionDescription: `Visualizar ${te || "registro"}`,
|
|
1502
1502
|
color: "gray.7",
|
|
1503
1503
|
leftSection: /* @__PURE__ */ e(Rt, {}),
|
|
1504
|
-
disabled: !
|
|
1504
|
+
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
1505
1505
|
variant: R ?? j.variant,
|
|
1506
1506
|
onClick: () => m.onViewExecute(),
|
|
1507
1507
|
children: m.labelView || g().t("archbase:View")
|
|
@@ -1510,12 +1510,12 @@ function Un({
|
|
|
1510
1510
|
m?.customUserActions && m?.customUserActionsPosition === "right" ? m.customUserActions : null
|
|
1511
1511
|
] }) : void 0,
|
|
1512
1512
|
headerRight: D(),
|
|
1513
|
-
footerRight: C ? /* @__PURE__ */ e(Nt, { total:
|
|
1513
|
+
footerRight: C ? /* @__PURE__ */ e(Nt, { total: r.getTotalPages(), onChange: O }) : void 0,
|
|
1514
1514
|
children: /* @__PURE__ */ e(
|
|
1515
|
-
|
|
1515
|
+
or,
|
|
1516
1516
|
{
|
|
1517
1517
|
value: {
|
|
1518
|
-
dataSource:
|
|
1518
|
+
dataSource: r,
|
|
1519
1519
|
ownerId: T,
|
|
1520
1520
|
handleSelectItem: de,
|
|
1521
1521
|
activeBackgroundColor: X,
|
|
@@ -1523,7 +1523,7 @@ function Un({
|
|
|
1523
1523
|
onItemEnter: ae,
|
|
1524
1524
|
onItemLeave: Q
|
|
1525
1525
|
},
|
|
1526
|
-
children: /* @__PURE__ */ e(
|
|
1526
|
+
children: /* @__PURE__ */ e(ar, { columnsCountBreakPoints: V, children: /* @__PURE__ */ e(cr, { gutter: P, columnsCount: w, children: Fe }) })
|
|
1527
1527
|
}
|
|
1528
1528
|
)
|
|
1529
1529
|
}
|
|
@@ -1531,7 +1531,7 @@ function Un({
|
|
|
1531
1531
|
}
|
|
1532
1532
|
);
|
|
1533
1533
|
}
|
|
1534
|
-
const
|
|
1534
|
+
const Cr = {
|
|
1535
1535
|
visible: !0,
|
|
1536
1536
|
allowAdd: !0,
|
|
1537
1537
|
allowEdit: !0,
|
|
@@ -1539,14 +1539,14 @@ const yn = {
|
|
|
1539
1539
|
allowRemove: !0,
|
|
1540
1540
|
positionCustomUserActions: "after"
|
|
1541
1541
|
};
|
|
1542
|
-
function
|
|
1542
|
+
function Ur({
|
|
1543
1543
|
title: t,
|
|
1544
|
-
dataSource:
|
|
1544
|
+
dataSource: r,
|
|
1545
1545
|
// dataSourceEdition,
|
|
1546
1546
|
filterOptions: o,
|
|
1547
1547
|
//pageSize,
|
|
1548
1548
|
filterFields: f,
|
|
1549
|
-
innerRef:
|
|
1549
|
+
innerRef: n,
|
|
1550
1550
|
//isLoading = false,
|
|
1551
1551
|
isError: i = !1,
|
|
1552
1552
|
error: h = "",
|
|
@@ -1560,12 +1560,12 @@ function Hn({
|
|
|
1560
1560
|
children: H,
|
|
1561
1561
|
radius: I,
|
|
1562
1562
|
userActions: C,
|
|
1563
|
-
debug:
|
|
1563
|
+
debug: b = !1,
|
|
1564
1564
|
variant: m,
|
|
1565
|
-
actionsButtonsOptions:
|
|
1566
|
-
spaceOptions:
|
|
1567
|
-
style:
|
|
1568
|
-
debugOptions:
|
|
1565
|
+
actionsButtonsOptions: V,
|
|
1566
|
+
spaceOptions: w,
|
|
1567
|
+
style: P,
|
|
1568
|
+
debugOptions: F,
|
|
1569
1569
|
// Props de segurança (opcionais)
|
|
1570
1570
|
resourceName: u,
|
|
1571
1571
|
resourceDescription: X,
|
|
@@ -1575,7 +1575,7 @@ function Hn({
|
|
|
1575
1575
|
}) {
|
|
1576
1576
|
const L = Me(), _ = Ue({
|
|
1577
1577
|
autoRegisterActions: Q?.autoRegisterActions ?? !0
|
|
1578
|
-
}), R =
|
|
1578
|
+
}), R = n || Se(null), T = Se(null), [le, E] = U({
|
|
1579
1579
|
activeFilterIndex: -1,
|
|
1580
1580
|
expandedFilter: !1
|
|
1581
1581
|
}), {
|
|
@@ -1583,10 +1583,10 @@ function Hn({
|
|
|
1583
1583
|
v1State: { forceUpdate: ue }
|
|
1584
1584
|
} = We(
|
|
1585
1585
|
"ArchbasePanelTemplate",
|
|
1586
|
-
|
|
1587
|
-
),
|
|
1588
|
-
const d = { ...
|
|
1589
|
-
return d.allowAdd && d.onAddExecute &&
|
|
1586
|
+
r
|
|
1587
|
+
), re = Je(() => {
|
|
1588
|
+
const d = { ...Cr, ...C }, z = (we) => _.isAvailable ? (_.registerAction(), _.hasPermission()) : !0, M = [];
|
|
1589
|
+
return d.allowAdd && d.onAddExecute && z() && M.push({
|
|
1590
1590
|
id: "1",
|
|
1591
1591
|
icon: /* @__PURE__ */ e(Ft, {}),
|
|
1592
1592
|
color: "green",
|
|
@@ -1596,7 +1596,7 @@ function Hn({
|
|
|
1596
1596
|
},
|
|
1597
1597
|
enabled: !0,
|
|
1598
1598
|
hint: "Clique para criar."
|
|
1599
|
-
}), d.allowEdit && d.onEditExecute &&
|
|
1599
|
+
}), d.allowEdit && d.onEditExecute && z() && M.push({
|
|
1600
1600
|
id: "2",
|
|
1601
1601
|
icon: /* @__PURE__ */ e(At, {}),
|
|
1602
1602
|
color: "blue",
|
|
@@ -1604,19 +1604,19 @@ function Hn({
|
|
|
1604
1604
|
executeAction: () => {
|
|
1605
1605
|
d && d.onEditExecute && d.onEditExecute();
|
|
1606
1606
|
},
|
|
1607
|
-
enabled: !
|
|
1607
|
+
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1608
1608
|
hint: "Clique para editar."
|
|
1609
|
-
}), d.allowRemove && d.onRemoveExecute &&
|
|
1609
|
+
}), d.allowRemove && d.onRemoveExecute && z() && M.push({
|
|
1610
1610
|
id: "3",
|
|
1611
|
-
icon: /* @__PURE__ */ e(
|
|
1611
|
+
icon: /* @__PURE__ */ e(nt, {}),
|
|
1612
1612
|
color: "red",
|
|
1613
1613
|
label: d.labelRemove ? d.labelRemove : g().t("archbase:Remove"),
|
|
1614
1614
|
executeAction: () => {
|
|
1615
1615
|
d && d.onRemoveExecute && d.onRemoveExecute();
|
|
1616
1616
|
},
|
|
1617
|
-
enabled: !
|
|
1617
|
+
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1618
1618
|
hint: "Clique para remover."
|
|
1619
|
-
}), d.allowView && d.onView &&
|
|
1619
|
+
}), d.allowView && d.onView && z() && M.push({
|
|
1620
1620
|
id: "4",
|
|
1621
1621
|
icon: /* @__PURE__ */ e(Rt, {}),
|
|
1622
1622
|
color: "green",
|
|
@@ -1624,15 +1624,15 @@ function Hn({
|
|
|
1624
1624
|
executeAction: () => {
|
|
1625
1625
|
d && d.onView && d.onView();
|
|
1626
1626
|
},
|
|
1627
|
-
enabled: !
|
|
1627
|
+
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1628
1628
|
hint: "Clique para visualizar."
|
|
1629
1629
|
}), d.customUserActions && d.positionCustomUserActions === "before" ? [...d.customUserActions, ...M] : d.customUserActions && d.positionCustomUserActions === "after" ? [...M, ...d.customUserActions] : M;
|
|
1630
|
-
}, [C,
|
|
1631
|
-
E({ ...
|
|
1630
|
+
}, [C, r, _]), q = (d, z) => {
|
|
1631
|
+
E({ ...le, currentFilter: d, activeFilterIndex: z });
|
|
1632
1632
|
}, j = (d) => {
|
|
1633
|
-
E({ ...
|
|
1634
|
-
}, J = (d,
|
|
1635
|
-
E({ ...
|
|
1633
|
+
E({ ...le, expandedFilter: d });
|
|
1634
|
+
}, J = (d, z) => {
|
|
1635
|
+
E({ ...le, currentFilter: d, activeFilterIndex: z });
|
|
1636
1636
|
}, W = () => {
|
|
1637
1637
|
}, Y = {
|
|
1638
1638
|
menuButtonColor: "blue.5",
|
|
@@ -1641,7 +1641,7 @@ function Hn({
|
|
|
1641
1641
|
headerFlexGrow: "left",
|
|
1642
1642
|
footerFlexGrow: "right"
|
|
1643
1643
|
// footerGridColumns: {},
|
|
1644
|
-
}, be = { ...Y, ...
|
|
1644
|
+
}, be = { ...Y, ...V }, ne = { ...ce, ...w };
|
|
1645
1645
|
return /* @__PURE__ */ e(
|
|
1646
1646
|
He,
|
|
1647
1647
|
{
|
|
@@ -1663,11 +1663,11 @@ function Hn({
|
|
|
1663
1663
|
error: h,
|
|
1664
1664
|
clearError: p,
|
|
1665
1665
|
title: t,
|
|
1666
|
-
defaultDebug:
|
|
1667
|
-
debugOptions:
|
|
1668
|
-
style:
|
|
1669
|
-
options:
|
|
1670
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1666
|
+
defaultDebug: b,
|
|
1667
|
+
debugOptions: F,
|
|
1668
|
+
style: P,
|
|
1669
|
+
options: ne,
|
|
1670
|
+
headerLeft: /* @__PURE__ */ e(sr, { actions: re, options: be }),
|
|
1671
1671
|
headerRight: /* @__PURE__ */ e(
|
|
1672
1672
|
Dt,
|
|
1673
1673
|
{
|
|
@@ -1676,10 +1676,10 @@ function Hn({
|
|
|
1676
1676
|
apiVersion: o.apiVersion,
|
|
1677
1677
|
ref: T,
|
|
1678
1678
|
variant: m || L.variant,
|
|
1679
|
-
expandedFilter:
|
|
1679
|
+
expandedFilter: le.expandedFilter,
|
|
1680
1680
|
persistenceDelegator: l,
|
|
1681
|
-
currentFilter:
|
|
1682
|
-
activeFilterIndex:
|
|
1681
|
+
currentFilter: le.currentFilter,
|
|
1682
|
+
activeFilterIndex: le.activeFilterIndex,
|
|
1683
1683
|
onSelectedFilter: J,
|
|
1684
1684
|
onFilterChanged: q,
|
|
1685
1685
|
onSearchByFilter: W,
|
|
@@ -1696,16 +1696,16 @@ function Hn({
|
|
|
1696
1696
|
}
|
|
1697
1697
|
);
|
|
1698
1698
|
}
|
|
1699
|
-
function
|
|
1699
|
+
function Hr() {
|
|
1700
1700
|
return /* @__PURE__ */ e("div", { children: "SEARCH TEMPLATE" });
|
|
1701
1701
|
}
|
|
1702
|
-
function
|
|
1702
|
+
function _r({
|
|
1703
1703
|
// Header
|
|
1704
1704
|
title: t,
|
|
1705
|
-
subtitle:
|
|
1705
|
+
subtitle: r,
|
|
1706
1706
|
onBack: o,
|
|
1707
1707
|
headerActions: f,
|
|
1708
|
-
showDeleteButton:
|
|
1708
|
+
showDeleteButton: n = !1,
|
|
1709
1709
|
onDelete: i,
|
|
1710
1710
|
saveLabel: h,
|
|
1711
1711
|
cancelLabel: p,
|
|
@@ -1719,13 +1719,13 @@ function qn({
|
|
|
1719
1719
|
formSubtitle: H,
|
|
1720
1720
|
statusBadge: I,
|
|
1721
1721
|
tabs: C,
|
|
1722
|
-
defaultTab:
|
|
1722
|
+
defaultTab: b,
|
|
1723
1723
|
tabsVariant: m = "outline",
|
|
1724
|
-
children:
|
|
1724
|
+
children: V,
|
|
1725
1725
|
// Layout
|
|
1726
|
-
width:
|
|
1727
|
-
height:
|
|
1728
|
-
withBorder:
|
|
1726
|
+
width: w = "100%",
|
|
1727
|
+
height: P = "100%",
|
|
1728
|
+
withBorder: F = !0,
|
|
1729
1729
|
radius: u,
|
|
1730
1730
|
style: X,
|
|
1731
1731
|
// States
|
|
@@ -1737,13 +1737,13 @@ function qn({
|
|
|
1737
1737
|
error: R = "",
|
|
1738
1738
|
clearError: T = () => {
|
|
1739
1739
|
},
|
|
1740
|
-
autoCloseAlertError:
|
|
1740
|
+
autoCloseAlertError: le = 15e3,
|
|
1741
1741
|
// DataSource
|
|
1742
1742
|
dataSource: E,
|
|
1743
1743
|
variant: te,
|
|
1744
1744
|
// Callbacks
|
|
1745
1745
|
onSave: ue,
|
|
1746
|
-
onCancel:
|
|
1746
|
+
onCancel: re,
|
|
1747
1747
|
onBeforeSave: q,
|
|
1748
1748
|
onAfterSave: j,
|
|
1749
1749
|
onBeforeCancel: J,
|
|
@@ -1752,16 +1752,16 @@ function qn({
|
|
|
1752
1752
|
// Navigation
|
|
1753
1753
|
routePath: ce,
|
|
1754
1754
|
onBeforeClose: be,
|
|
1755
|
-
useNavigationListener:
|
|
1755
|
+
useNavigationListener: ne,
|
|
1756
1756
|
// Security
|
|
1757
1757
|
resourceName: d,
|
|
1758
|
-
resourceDescription:
|
|
1758
|
+
resourceDescription: z,
|
|
1759
1759
|
requiredPermissions: M,
|
|
1760
1760
|
fallbackComponent: we,
|
|
1761
1761
|
securityOptions: he,
|
|
1762
|
-
...
|
|
1762
|
+
...k
|
|
1763
1763
|
}) {
|
|
1764
|
-
const fe = Me(), [Fe, Ae] = U(_), [Pe, se] = U(R), [G, de] = U(
|
|
1764
|
+
const fe = Me(), [Fe, Ae] = U(_), [Pe, se] = U(R), [G, de] = U(b || (C?.[0]?.value ?? null)), Ge = dt();
|
|
1765
1765
|
Ue({
|
|
1766
1766
|
autoRegisterActions: he?.autoRegisterActions ?? !0
|
|
1767
1767
|
});
|
|
@@ -1780,9 +1780,9 @@ function qn({
|
|
|
1780
1780
|
const D = Pt(), $e = Z((y, ye) => ({
|
|
1781
1781
|
closeAllowed: (Ne) => {
|
|
1782
1782
|
}
|
|
1783
|
-
}), []), Le =
|
|
1783
|
+
}), []), Le = ne || $e, { closeAllowed: x } = Le(ce || "", () => {
|
|
1784
1784
|
be && be() === !1 || x();
|
|
1785
|
-
}),
|
|
1785
|
+
}), B = async (y) => {
|
|
1786
1786
|
try {
|
|
1787
1787
|
ue ? ue(y) : (q && await q(y), E.isBrowsing() || E.save().then(() => {
|
|
1788
1788
|
D?.clearAll(), j && j(y), x();
|
|
@@ -1794,13 +1794,13 @@ function qn({
|
|
|
1794
1794
|
}
|
|
1795
1795
|
}, ke = () => {
|
|
1796
1796
|
try {
|
|
1797
|
-
|
|
1797
|
+
re ? re(x) : (J && J(), E.isBrowsing() || E.cancel(), D?.clearAll(), W && W(), x());
|
|
1798
1798
|
} catch (y) {
|
|
1799
1799
|
Y && Y(xe(y)), Ae(!0), se(xe(y));
|
|
1800
1800
|
}
|
|
1801
1801
|
}, me = () => {
|
|
1802
1802
|
T && T(), Ae(!1), se("");
|
|
1803
|
-
}, Be = l ? 12 : 12 - $, De = E && !E.isBrowsing(), ge = a === "header" || a === "both", lt = a === "footer" || a === "both",
|
|
1803
|
+
}, Be = l ? 12 : 12 - $, De = E && !E.isBrowsing(), ge = a === "header" || a === "both", lt = a === "footer" || a === "both", ie = () => /* @__PURE__ */ e(oe, { gap: "sm", children: De ? /* @__PURE__ */ c(qe, { children: [
|
|
1804
1804
|
/* @__PURE__ */ e(
|
|
1805
1805
|
K,
|
|
1806
1806
|
{
|
|
@@ -1817,9 +1817,9 @@ function qn({
|
|
|
1817
1817
|
K,
|
|
1818
1818
|
{
|
|
1819
1819
|
actionName: "save",
|
|
1820
|
-
actionDescription: `Salvar ${
|
|
1820
|
+
actionDescription: `Salvar ${z || "registro"}`,
|
|
1821
1821
|
leftSection: /* @__PURE__ */ e(Ct, { size: 16 }),
|
|
1822
|
-
onClick: () =>
|
|
1822
|
+
onClick: () => B(E.getCurrentRecord()),
|
|
1823
1823
|
variant: te ?? fe.variant,
|
|
1824
1824
|
color: "blue",
|
|
1825
1825
|
loading: L,
|
|
@@ -1841,7 +1841,7 @@ function qn({
|
|
|
1841
1841
|
He,
|
|
1842
1842
|
{
|
|
1843
1843
|
resourceName: d,
|
|
1844
|
-
resourceDescription:
|
|
1844
|
+
resourceDescription: z,
|
|
1845
1845
|
requiredPermissions: M,
|
|
1846
1846
|
fallbackComponent: we,
|
|
1847
1847
|
onSecurityReady: he?.onSecurityReady,
|
|
@@ -1850,11 +1850,11 @@ function qn({
|
|
|
1850
1850
|
_e,
|
|
1851
1851
|
{
|
|
1852
1852
|
ref: ee,
|
|
1853
|
-
withBorder:
|
|
1853
|
+
withBorder: F,
|
|
1854
1854
|
radius: u,
|
|
1855
1855
|
style: {
|
|
1856
|
-
width:
|
|
1857
|
-
height:
|
|
1856
|
+
width: w,
|
|
1857
|
+
height: P,
|
|
1858
1858
|
display: "flex",
|
|
1859
1859
|
flexDirection: "column",
|
|
1860
1860
|
...X
|
|
@@ -1883,7 +1883,7 @@ function qn({
|
|
|
1883
1883
|
),
|
|
1884
1884
|
/* @__PURE__ */ c(pe, { children: [
|
|
1885
1885
|
/* @__PURE__ */ e(Bt, { order: 4, fw: 600, children: t }),
|
|
1886
|
-
|
|
1886
|
+
r && /* @__PURE__ */ e(Re, { size: "sm", c: "dimmed", children: r })
|
|
1887
1887
|
] })
|
|
1888
1888
|
] }),
|
|
1889
1889
|
/* @__PURE__ */ c(oe, { gap: "sm", children: [
|
|
@@ -1900,7 +1900,7 @@ function qn({
|
|
|
1900
1900
|
},
|
|
1901
1901
|
y.id
|
|
1902
1902
|
)),
|
|
1903
|
-
|
|
1903
|
+
n && i && /* @__PURE__ */ e(
|
|
1904
1904
|
vt,
|
|
1905
1905
|
{
|
|
1906
1906
|
variant: "subtle",
|
|
@@ -1908,10 +1908,10 @@ function qn({
|
|
|
1908
1908
|
size: "lg",
|
|
1909
1909
|
onClick: i,
|
|
1910
1910
|
style: { border: "1px solid var(--mantine-color-gray-3)" },
|
|
1911
|
-
children: /* @__PURE__ */ e(
|
|
1911
|
+
children: /* @__PURE__ */ e(nt, { size: 18 })
|
|
1912
1912
|
}
|
|
1913
1913
|
),
|
|
1914
|
-
ge &&
|
|
1914
|
+
ge && ie()
|
|
1915
1915
|
] })
|
|
1916
1916
|
] })
|
|
1917
1917
|
}
|
|
@@ -1919,7 +1919,7 @@ function qn({
|
|
|
1919
1919
|
Fe && /* @__PURE__ */ e(pe, { style: { flexShrink: 0, padding: "0 24px" }, children: /* @__PURE__ */ e(
|
|
1920
1920
|
Qe,
|
|
1921
1921
|
{
|
|
1922
|
-
autoClose:
|
|
1922
|
+
autoClose: le,
|
|
1923
1923
|
withCloseButton: !0,
|
|
1924
1924
|
withBorder: !0,
|
|
1925
1925
|
icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
|
|
@@ -1991,7 +1991,7 @@ function qn({
|
|
|
1991
1991
|
))
|
|
1992
1992
|
]
|
|
1993
1993
|
}
|
|
1994
|
-
) : /* @__PURE__ */ e(Ze, { style: { flex: 1, padding: "20px" }, children:
|
|
1994
|
+
) : /* @__PURE__ */ e(Ze, { style: { flex: 1, padding: "20px" }, children: V }) })
|
|
1995
1995
|
]
|
|
1996
1996
|
}
|
|
1997
1997
|
) })
|
|
@@ -2007,7 +2007,7 @@ function qn({
|
|
|
2007
2007
|
display: "flex",
|
|
2008
2008
|
justifyContent: "flex-end"
|
|
2009
2009
|
},
|
|
2010
|
-
children:
|
|
2010
|
+
children: ie()
|
|
2011
2011
|
}
|
|
2012
2012
|
)
|
|
2013
2013
|
]
|
|
@@ -2016,20 +2016,20 @@ function qn({
|
|
|
2016
2016
|
}
|
|
2017
2017
|
);
|
|
2018
2018
|
}
|
|
2019
|
-
function
|
|
2019
|
+
function qr({ title: t, description: r, headerAction: o, children: f }) {
|
|
2020
2020
|
return /* @__PURE__ */ c(_e, { withBorder: !0, radius: "md", p: "md", children: [
|
|
2021
|
-
/* @__PURE__ */ c(Ce, { justify: "space-between", align: "flex-start", mb:
|
|
2021
|
+
/* @__PURE__ */ c(Ce, { justify: "space-between", align: "flex-start", mb: r || o ? "sm" : 0, children: [
|
|
2022
2022
|
/* @__PURE__ */ c(pe, { children: [
|
|
2023
2023
|
/* @__PURE__ */ e(Re, { fw: 600, size: "sm", children: t }),
|
|
2024
|
-
|
|
2024
|
+
r && /* @__PURE__ */ e(Re, { size: "xs", c: "dimmed", mt: 2, children: r })
|
|
2025
2025
|
] }),
|
|
2026
2026
|
o
|
|
2027
2027
|
] }),
|
|
2028
2028
|
f
|
|
2029
2029
|
] });
|
|
2030
2030
|
}
|
|
2031
|
-
function
|
|
2032
|
-
const i = t.find((a) => a.isCover) || t[0], h = t.filter((a) => a.id !== i?.id), p = t.length <
|
|
2031
|
+
function Jr({ images: t, onAddImage: r, onRemoveImage: o, onSetCover: f, maxImages: n = 6 }) {
|
|
2032
|
+
const i = t.find((a) => a.isCover) || t[0], h = t.filter((a) => a.id !== i?.id), p = t.length < n;
|
|
2033
2033
|
return /* @__PURE__ */ c(wt, { gap: "sm", children: [
|
|
2034
2034
|
i && /* @__PURE__ */ c(pe, { style: { position: "relative" }, children: [
|
|
2035
2035
|
/* @__PURE__ */ e(
|
|
@@ -2078,10 +2078,10 @@ function Wn({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
|
|
|
2078
2078
|
)
|
|
2079
2079
|
}
|
|
2080
2080
|
) }, a.id)),
|
|
2081
|
-
p &&
|
|
2081
|
+
p && r && /* @__PURE__ */ e(Ee.Col, { span: 4, children: /* @__PURE__ */ e(
|
|
2082
2082
|
pe,
|
|
2083
2083
|
{
|
|
2084
|
-
onClick:
|
|
2084
|
+
onClick: r,
|
|
2085
2085
|
style: {
|
|
2086
2086
|
width: "100%",
|
|
2087
2087
|
height: 80,
|
|
@@ -2099,12 +2099,12 @@ function Wn({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
|
|
|
2099
2099
|
] })
|
|
2100
2100
|
] });
|
|
2101
2101
|
}
|
|
2102
|
-
function
|
|
2102
|
+
function yr(t, r) {
|
|
2103
2103
|
const {
|
|
2104
2104
|
// Props obrigatórias
|
|
2105
2105
|
opened: o,
|
|
2106
2106
|
title: f,
|
|
2107
|
-
children:
|
|
2107
|
+
children: n,
|
|
2108
2108
|
onClose: i,
|
|
2109
2109
|
idField: h,
|
|
2110
2110
|
displayField: p,
|
|
@@ -2118,13 +2118,13 @@ function bn(t, n) {
|
|
|
2118
2118
|
onAfterConfirm: I,
|
|
2119
2119
|
// DataSource
|
|
2120
2120
|
dataSource: C,
|
|
2121
|
-
loadData:
|
|
2121
|
+
loadData: b,
|
|
2122
2122
|
loadDataPaged: m,
|
|
2123
|
-
searchFields:
|
|
2124
|
-
pageSize:
|
|
2123
|
+
searchFields: V = "",
|
|
2124
|
+
pageSize: w = 100,
|
|
2125
2125
|
// Aparência
|
|
2126
|
-
displaySubField:
|
|
2127
|
-
renderSelectedItem:
|
|
2126
|
+
displaySubField: P,
|
|
2127
|
+
renderSelectedItem: F,
|
|
2128
2128
|
renderSelectedItems: u,
|
|
2129
2129
|
icon: X,
|
|
2130
2130
|
modalSize: ee = "70%",
|
|
@@ -2135,12 +2135,12 @@ function bn(t, n) {
|
|
|
2135
2135
|
showSelectionIndicator: R = !0,
|
|
2136
2136
|
// Múltipla seleção
|
|
2137
2137
|
maxSelections: T,
|
|
2138
|
-
showSelectionCount:
|
|
2138
|
+
showSelectionCount: le = !0,
|
|
2139
2139
|
allowClearAll: E = !0,
|
|
2140
2140
|
// Estado
|
|
2141
2141
|
isLoading: te,
|
|
2142
2142
|
isError: ue = !1,
|
|
2143
|
-
error:
|
|
2143
|
+
error: re = "",
|
|
2144
2144
|
clearError: q,
|
|
2145
2145
|
autoCloseAlertError: j = 15e3,
|
|
2146
2146
|
onError: J,
|
|
@@ -2150,33 +2150,33 @@ function bn(t, n) {
|
|
|
2150
2150
|
variant: ce,
|
|
2151
2151
|
// Segurança
|
|
2152
2152
|
resourceName: be,
|
|
2153
|
-
resourceDescription:
|
|
2153
|
+
resourceDescription: ne,
|
|
2154
2154
|
requiredPermissions: d,
|
|
2155
|
-
fallbackComponent:
|
|
2155
|
+
fallbackComponent: z,
|
|
2156
2156
|
securityOptions: M
|
|
2157
|
-
} = t, we = Me(), he = ut(), { colorScheme:
|
|
2157
|
+
} = t, we = Me(), he = ut(), { colorScheme: k } = st(), fe = k === "dark", Fe = dt(), Ae = fe ? "dark.5" : _, [Pe, se] = U(!1), [G, de] = U(l || []), [Ge, O] = U(!1), [D, $e] = U(""), [Le, x] = U(0), [B, ke] = U(""), me = Se(null), Be = Se([]), De = !!m && !C, ge = !!C, ie = Z(() => ge && C ? C : (me.current || (me.current = new nr("dsLookup", {
|
|
2158
2158
|
records: [],
|
|
2159
2159
|
grandTotalRecords: 0,
|
|
2160
2160
|
currentPage: 0,
|
|
2161
2161
|
totalPages: 0,
|
|
2162
|
-
pageSize:
|
|
2163
|
-
})), me.current), [ge, C,
|
|
2162
|
+
pageSize: w
|
|
2163
|
+
})), me.current), [ge, C, w])();
|
|
2164
2164
|
Ue({
|
|
2165
2165
|
autoRegisterActions: M?.autoRegisterActions ?? !0
|
|
2166
2166
|
});
|
|
2167
2167
|
const y = We(
|
|
2168
2168
|
"ArchbaseLookupDataTemplate",
|
|
2169
|
-
|
|
2169
|
+
ie,
|
|
2170
2170
|
void 0,
|
|
2171
2171
|
void 0
|
|
2172
2172
|
);
|
|
2173
2173
|
it({
|
|
2174
|
-
dataSource:
|
|
2175
|
-
listener: (
|
|
2176
|
-
if (
|
|
2174
|
+
dataSource: ie,
|
|
2175
|
+
listener: (A) => {
|
|
2176
|
+
if (A.type === Ie.onError && (O(!0), $e(A.error || "")), A.type === Ie.afterScroll) {
|
|
2177
2177
|
if (a === "single") {
|
|
2178
|
-
const
|
|
2179
|
-
|
|
2178
|
+
const N = ie.getCurrentRecord();
|
|
2179
|
+
N && de([N]);
|
|
2180
2180
|
}
|
|
2181
2181
|
y.isDataSourceV2 || Fe();
|
|
2182
2182
|
}
|
|
@@ -2192,18 +2192,18 @@ function bn(t, n) {
|
|
|
2192
2192
|
itemsSelected: g().t("archbase:items selected"),
|
|
2193
2193
|
...Y
|
|
2194
2194
|
}, Ne = Z(
|
|
2195
|
-
async (
|
|
2195
|
+
async (A, N) => {
|
|
2196
2196
|
if (!(ge || !m)) {
|
|
2197
2197
|
se(!0);
|
|
2198
2198
|
try {
|
|
2199
|
-
const Ve = await m(
|
|
2200
|
-
|
|
2199
|
+
const Ve = await m(A, w, N, V);
|
|
2200
|
+
ie.open({
|
|
2201
2201
|
records: Ve.content,
|
|
2202
2202
|
grandTotalRecords: Ve.totalElements,
|
|
2203
|
-
currentPage:
|
|
2203
|
+
currentPage: A,
|
|
2204
2204
|
totalPages: Ve.totalPages,
|
|
2205
|
-
pageSize:
|
|
2206
|
-
}), x(
|
|
2205
|
+
pageSize: w
|
|
2206
|
+
}), x(A);
|
|
2207
2207
|
} catch (Ve) {
|
|
2208
2208
|
O(!0), $e(xe(Ve)), J?.(Ve);
|
|
2209
2209
|
} finally {
|
|
@@ -2211,52 +2211,52 @@ function bn(t, n) {
|
|
|
2211
2211
|
}
|
|
2212
2212
|
}
|
|
2213
2213
|
},
|
|
2214
|
-
[ge, m,
|
|
2214
|
+
[ge, m, V, w, ie, J]
|
|
2215
2215
|
), je = Z(
|
|
2216
|
-
async (
|
|
2216
|
+
async (A) => {
|
|
2217
2217
|
if (De)
|
|
2218
|
-
return Ne(0,
|
|
2219
|
-
if (!(ge || !
|
|
2218
|
+
return Ne(0, A);
|
|
2219
|
+
if (!(ge || !b)) {
|
|
2220
2220
|
se(!0);
|
|
2221
2221
|
try {
|
|
2222
|
-
const
|
|
2223
|
-
Be.current =
|
|
2224
|
-
records:
|
|
2225
|
-
grandTotalRecords:
|
|
2222
|
+
const N = await b(A, V);
|
|
2223
|
+
Be.current = N, ie.open({
|
|
2224
|
+
records: N,
|
|
2225
|
+
grandTotalRecords: N.length,
|
|
2226
2226
|
currentPage: 0,
|
|
2227
|
-
totalPages: Math.ceil(
|
|
2228
|
-
pageSize:
|
|
2227
|
+
totalPages: Math.ceil(N.length / w),
|
|
2228
|
+
pageSize: w
|
|
2229
2229
|
});
|
|
2230
|
-
} catch (
|
|
2231
|
-
O(!0), $e(xe(
|
|
2230
|
+
} catch (N) {
|
|
2231
|
+
O(!0), $e(xe(N)), J?.(N);
|
|
2232
2232
|
} finally {
|
|
2233
2233
|
se(!1);
|
|
2234
2234
|
}
|
|
2235
2235
|
}
|
|
2236
2236
|
},
|
|
2237
|
-
[ge, De,
|
|
2237
|
+
[ge, De, b, Ne, V, w, ie, J]
|
|
2238
2238
|
), gt = Z(
|
|
2239
|
-
(
|
|
2240
|
-
const
|
|
2241
|
-
if (ke(
|
|
2242
|
-
Ne(0,
|
|
2239
|
+
(A) => {
|
|
2240
|
+
const N = A?.quickFilterValues?.[0] || "";
|
|
2241
|
+
if (ke(N), De) {
|
|
2242
|
+
Ne(0, N);
|
|
2243
2243
|
return;
|
|
2244
2244
|
}
|
|
2245
|
-
|
|
2245
|
+
b && !ge && je(N);
|
|
2246
2246
|
},
|
|
2247
|
-
[
|
|
2247
|
+
[b, De, ge, je, Ne]
|
|
2248
2248
|
);
|
|
2249
|
-
|
|
2249
|
+
rt(() => {
|
|
2250
2250
|
if (ge)
|
|
2251
2251
|
return;
|
|
2252
|
-
const
|
|
2253
|
-
const Ve =
|
|
2252
|
+
const A = (N) => {
|
|
2253
|
+
const Ve = N?.currentPage ?? 0, kt = N?.pageSize ?? w;
|
|
2254
2254
|
if (De) {
|
|
2255
|
-
Ne(Ve,
|
|
2255
|
+
Ne(Ve, B);
|
|
2256
2256
|
return;
|
|
2257
2257
|
}
|
|
2258
2258
|
const ot = Be.current;
|
|
2259
|
-
ot.length !== 0 &&
|
|
2259
|
+
ot.length !== 0 && ie.open({
|
|
2260
2260
|
records: ot,
|
|
2261
2261
|
grandTotalRecords: ot.length,
|
|
2262
2262
|
currentPage: Ve,
|
|
@@ -2264,27 +2264,27 @@ function bn(t, n) {
|
|
|
2264
2264
|
pageSize: kt
|
|
2265
2265
|
});
|
|
2266
2266
|
};
|
|
2267
|
-
return
|
|
2268
|
-
|
|
2267
|
+
return ie.emitter.on("refreshData", A), () => {
|
|
2268
|
+
ie.emitter.off("refreshData", A);
|
|
2269
2269
|
};
|
|
2270
|
-
}, [ge, De,
|
|
2270
|
+
}, [ge, De, ie, w, B, Ne]), rt(() => {
|
|
2271
2271
|
o && (l?.length ? de(l) : de([]), je());
|
|
2272
|
-
}, [o]),
|
|
2272
|
+
}, [o]), rt(() => {
|
|
2273
2273
|
l && de(l);
|
|
2274
2274
|
}, [l]);
|
|
2275
2275
|
const Xe = Z(
|
|
2276
|
-
(
|
|
2277
|
-
a === "single" ? de(
|
|
2276
|
+
(A) => {
|
|
2277
|
+
a === "single" ? de(A.slice(0, 1)) : T && A.length > T ? de(A.slice(0, T)) : de(A);
|
|
2278
2278
|
},
|
|
2279
2279
|
[a, T]
|
|
2280
2280
|
), pt = Z(
|
|
2281
|
-
(
|
|
2281
|
+
(A) => {
|
|
2282
2282
|
if (a === "single" && s) {
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2283
|
+
const N = ie.getCurrentRecord();
|
|
2284
|
+
N && (v?.(N), i());
|
|
2285
2285
|
}
|
|
2286
2286
|
},
|
|
2287
|
-
[a, s,
|
|
2287
|
+
[a, s, ie, v, i]
|
|
2288
2288
|
), xt = Z(() => {
|
|
2289
2289
|
de([]);
|
|
2290
2290
|
}, []), Ye = Z(async () => {
|
|
@@ -2297,43 +2297,43 @@ function bn(t, n) {
|
|
|
2297
2297
|
q?.(), O(!1), $e("");
|
|
2298
2298
|
};
|
|
2299
2299
|
Gt(
|
|
2300
|
-
|
|
2300
|
+
r,
|
|
2301
2301
|
() => ({
|
|
2302
2302
|
getSelectedItems: () => G,
|
|
2303
2303
|
getSelectedItem: () => G[0] || null,
|
|
2304
2304
|
clearSelection: () => de([]),
|
|
2305
|
-
selectItems: (
|
|
2306
|
-
selectItem: (
|
|
2307
|
-
deselectItem: (
|
|
2308
|
-
de((
|
|
2305
|
+
selectItems: (A) => Xe(A),
|
|
2306
|
+
selectItem: (A) => de([A]),
|
|
2307
|
+
deselectItem: (A) => {
|
|
2308
|
+
de((N) => N.filter((Ve) => Ve[h] !== A[h]));
|
|
2309
2309
|
},
|
|
2310
2310
|
refreshData: () => je(),
|
|
2311
|
-
getDataSource: () =>
|
|
2311
|
+
getDataSource: () => ie,
|
|
2312
2312
|
confirmSelection: async () => {
|
|
2313
2313
|
await Ye();
|
|
2314
2314
|
},
|
|
2315
2315
|
cancelSelection: S
|
|
2316
2316
|
}),
|
|
2317
|
-
[G, Xe, h, je,
|
|
2317
|
+
[G, Xe, h, je, ie, Ye, S]
|
|
2318
2318
|
);
|
|
2319
2319
|
const Ut = Z(
|
|
2320
|
-
(
|
|
2321
|
-
const
|
|
2322
|
-
return
|
|
2320
|
+
(A) => {
|
|
2321
|
+
const N = A[h];
|
|
2322
|
+
return N !== void 0 ? N : "";
|
|
2323
2323
|
},
|
|
2324
2324
|
[h]
|
|
2325
|
-
), Ht = te || Pe, _t =
|
|
2325
|
+
), Ht = te || Pe, _t = re || D, qt = ue || Ge, Jt = /* @__PURE__ */ c(oe, { gap: "sm", children: [
|
|
2326
2326
|
X,
|
|
2327
2327
|
/* @__PURE__ */ e(Re, { fw: 600, children: f })
|
|
2328
2328
|
] }), Wt = () => {
|
|
2329
2329
|
if (!R)
|
|
2330
2330
|
return null;
|
|
2331
|
-
if (a === "single" && G.length > 0 &&
|
|
2332
|
-
return
|
|
2331
|
+
if (a === "single" && G.length > 0 && F)
|
|
2332
|
+
return F(G[0]);
|
|
2333
2333
|
if (a === "multiple" && G.length > 0 && u)
|
|
2334
2334
|
return u(G);
|
|
2335
2335
|
if (a === "single" && G.length > 0) {
|
|
2336
|
-
const
|
|
2336
|
+
const A = G[0];
|
|
2337
2337
|
return /* @__PURE__ */ e(_e, { withBorder: !0, p: "sm", radius: "md", bg: Ae, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
|
|
2338
2338
|
/* @__PURE__ */ c(oe, { gap: "xs", children: [
|
|
2339
2339
|
/* @__PURE__ */ e(et, { size: 16, color: "green" }),
|
|
@@ -2341,8 +2341,8 @@ function bn(t, n) {
|
|
|
2341
2341
|
ye.selectedLabel,
|
|
2342
2342
|
":"
|
|
2343
2343
|
] }),
|
|
2344
|
-
/* @__PURE__ */ e(Re, { size: "sm", fw: 600, children: String(
|
|
2345
|
-
|
|
2344
|
+
/* @__PURE__ */ e(Re, { size: "sm", fw: 600, children: String(A[p]) }),
|
|
2345
|
+
P && /* @__PURE__ */ e(Re, { size: "sm", c: fe ? "gray.4" : "dimmed", children: String(A[P] || "") })
|
|
2346
2346
|
] }),
|
|
2347
2347
|
/* @__PURE__ */ e(Re, { size: "xs", c: fe ? "gray.4" : "dimmed", children: ye.doubleClickHint })
|
|
2348
2348
|
] }) });
|
|
@@ -2362,7 +2362,7 @@ function bn(t, n) {
|
|
|
2362
2362
|
size: "xs",
|
|
2363
2363
|
variant: "subtle",
|
|
2364
2364
|
color: "red",
|
|
2365
|
-
leftSection: /* @__PURE__ */ e(
|
|
2365
|
+
leftSection: /* @__PURE__ */ e(nt, { size: 14 }),
|
|
2366
2366
|
onClick: xt,
|
|
2367
2367
|
children: ye.clearButton
|
|
2368
2368
|
}
|
|
@@ -2373,9 +2373,9 @@ function bn(t, n) {
|
|
|
2373
2373
|
He,
|
|
2374
2374
|
{
|
|
2375
2375
|
resourceName: be,
|
|
2376
|
-
resourceDescription:
|
|
2376
|
+
resourceDescription: ne,
|
|
2377
2377
|
requiredPermissions: d,
|
|
2378
|
-
fallbackComponent:
|
|
2378
|
+
fallbackComponent: z,
|
|
2379
2379
|
onSecurityReady: M?.onSecurityReady,
|
|
2380
2380
|
onAccessDenied: M?.onAccessDenied,
|
|
2381
2381
|
children: /* @__PURE__ */ e(
|
|
@@ -2390,7 +2390,7 @@ function bn(t, n) {
|
|
|
2390
2390
|
closeOnClickOutside: !1,
|
|
2391
2391
|
withCloseButton: !1,
|
|
2392
2392
|
overlayProps: {
|
|
2393
|
-
color:
|
|
2393
|
+
color: k === "dark" ? he.colors.dark[7] : he.colors.gray[6],
|
|
2394
2394
|
opacity: 0.25
|
|
2395
2395
|
},
|
|
2396
2396
|
children: /* @__PURE__ */ c(ht, { height: ae, children: [
|
|
@@ -2413,7 +2413,7 @@ function bn(t, n) {
|
|
|
2413
2413
|
/* @__PURE__ */ e(
|
|
2414
2414
|
Lt,
|
|
2415
2415
|
{
|
|
2416
|
-
dataSource:
|
|
2416
|
+
dataSource: ie,
|
|
2417
2417
|
height: Q,
|
|
2418
2418
|
rowHeight: L,
|
|
2419
2419
|
withBorder: !0,
|
|
@@ -2429,7 +2429,7 @@ function bn(t, n) {
|
|
|
2429
2429
|
onCellDoubleClick: pt,
|
|
2430
2430
|
onSelectedRowsChanged: a === "multiple" ? Xe : void 0,
|
|
2431
2431
|
onFilterModelChange: gt,
|
|
2432
|
-
children:
|
|
2432
|
+
children: n
|
|
2433
2433
|
}
|
|
2434
2434
|
),
|
|
2435
2435
|
Wt()
|
|
@@ -2470,50 +2470,50 @@ function bn(t, n) {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
);
|
|
2472
2472
|
}
|
|
2473
|
-
const
|
|
2474
|
-
function
|
|
2475
|
-
const [
|
|
2473
|
+
const Wr = zt(yr), Tt = rr(void 0);
|
|
2474
|
+
function Or({ children: t }) {
|
|
2475
|
+
const [r, o] = U({}), f = Z((p, a) => {
|
|
2476
2476
|
o((v) => ({ ...v, [p]: a }));
|
|
2477
|
-
}, []),
|
|
2477
|
+
}, []), n = Z((p) => {
|
|
2478
2478
|
o((a) => {
|
|
2479
2479
|
const v = { ...a };
|
|
2480
2480
|
return delete v[p], v;
|
|
2481
2481
|
});
|
|
2482
2482
|
}, []), i = Z(() => {
|
|
2483
2483
|
o({});
|
|
2484
|
-
}, []), h = Z((p) =>
|
|
2485
|
-
return /* @__PURE__ */ e(Tt.Provider, { value: { errors:
|
|
2484
|
+
}, []), h = Z((p) => r[p], [r]);
|
|
2485
|
+
return /* @__PURE__ */ e(Tt.Provider, { value: { errors: r, setError: f, clearError: n, clearAll: i, getError: h }, children: t });
|
|
2486
2486
|
}
|
|
2487
|
-
function
|
|
2487
|
+
function Kr() {
|
|
2488
2488
|
return $t(Tt);
|
|
2489
2489
|
}
|
|
2490
|
-
function
|
|
2490
|
+
function Qr() {
|
|
2491
2491
|
const t = $t(Tt);
|
|
2492
2492
|
if (!t)
|
|
2493
2493
|
throw new Error("useRequiredValidationErrors must be used within ValidationErrorsProvider");
|
|
2494
2494
|
return t;
|
|
2495
2495
|
}
|
|
2496
2496
|
export {
|
|
2497
|
-
|
|
2497
|
+
Pr as ArchbaseAdvancedSmartButton,
|
|
2498
2498
|
He as ArchbaseConditionalSecurityWrapper,
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2499
|
+
$r as ArchbaseFormModalTemplate,
|
|
2500
|
+
Gr as ArchbaseFormTemplate,
|
|
2501
|
+
jr as ArchbaseGridTemplate,
|
|
2502
|
+
Wr as ArchbaseLookupDataTemplate,
|
|
2503
|
+
Mr as ArchbaseMasonryTemplate,
|
|
2504
|
+
Lr as ArchbaseModalTemplate,
|
|
2505
|
+
Ur as ArchbasePanelTemplate,
|
|
2506
|
+
Hr as ArchbaseSearchTemplate,
|
|
2507
2507
|
K as ArchbaseSmartActionButton,
|
|
2508
2508
|
Mt as ArchbaseSpaceTemplate,
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2509
|
+
_r as ArchbaseTwoColumnFormTemplate,
|
|
2510
|
+
Jr as FormImageGallery,
|
|
2511
|
+
qr as FormSectionCard,
|
|
2512
|
+
Or as ValidationErrorsProvider,
|
|
2513
|
+
Vr as useArchbaseLookup,
|
|
2514
|
+
zr as useConditionalSecurity,
|
|
2515
2515
|
Ue as useOptionalTemplateSecurity,
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2516
|
+
Qr as useRequiredValidationErrors,
|
|
2517
|
+
Nr as useTemplateSecurityAvailable,
|
|
2518
|
+
Kr as useValidationErrors
|
|
2519
2519
|
};
|