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