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