@archbase/template 3.0.2 → 3.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +52 -0
- package/dist/index.js +615 -600
- package/dist/template/src/ArchbaseGridTemplate.d.ts +14 -0
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsx as e, Fragment as
|
|
2
|
-
import { Button as
|
|
3
|
-
import { useForceUpdate as
|
|
4
|
-
import { IconBug as
|
|
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 Ie, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import { Button as $e, Paper as We, Box as Se, ScrollArea as st, LoadingOverlay as at, Group as be, useMantineColorScheme as Ke, Modal as ct, Flex as ue, px as Et, Text as It, Grid as me, Pagination as dt } from "@mantine/core";
|
|
3
|
+
import { useForceUpdate as ut, useUncontrolled as Tt, useHotkeys as Vt } from "@mantine/hooks";
|
|
4
|
+
import { IconBug as Ue, IconDeviceFloppy as Dt, IconX as Be, IconCheck as ht, IconPlus as Qe, IconEdit as Xe, IconTrash as Ye, IconEye as Ze } from "@tabler/icons-react";
|
|
5
|
+
import { useArchbaseAppContext as Ae, useValidationErrors as Bt, ValidationErrorsProvider as ft, getI18nextInstance as m, processErrorMessage as de, useArchbaseTheme as Oe, emit as Pt, useArchbaseTranslation as St } from "@archbase/core";
|
|
6
|
+
import De, { useMemo as we, useState as te, forwardRef as Nt, useRef as ae, useImperativeHandle as Gt, useEffect as mt, Fragment as $t, Profiler as Ut, createContext as jt, useCallback as Ne, useContext as pt } from "react";
|
|
7
|
+
import { useArchbaseV1V2Compatibility as Pe, useArchbaseDataSourceListener as et, DataSourceEventNames as pe } from "@archbase/data";
|
|
8
|
+
import { ArchbaseAlert as je, ArchbaseDialog as gt, ArchbaseDataGrid as Lt, GridToolBarActions as Mt, ArchbaseDebugInspector as kt, ArchbaseMasonryProvider as zt, ArchbaseMasonryResponsive as qt, ArchbaseMasonry as _t, ArchbaseActionButtons as xt } from "@archbase/components";
|
|
9
|
+
import { ArchbaseSpaceFixed as tt, ArchbaseSpaceTop as vt, ArchbaseSpaceFill as rt, ArchbaseForm as bt, ArchbaseSpaceBottom as nt } from "@archbase/layout";
|
|
10
|
+
import { ArchbaseQueryBuilder as it, buildFrom as Ht, ArchbaseGlobalFilter as Jt } from "@archbase/advanced";
|
|
11
|
+
import Ge from "@rehooks/component-size";
|
|
12
|
+
import { uniqueId as Wt } from "lodash";
|
|
13
|
+
const Kt = {
|
|
14
14
|
isAvailable: !1,
|
|
15
15
|
hasPermission: () => !0,
|
|
16
16
|
// Default: sempre permite
|
|
@@ -21,7 +21,7 @@ const kt = {
|
|
|
21
21
|
canEdit: !0,
|
|
22
22
|
canDelete: !0,
|
|
23
23
|
canView: !0
|
|
24
|
-
}, ge = (t) =>
|
|
24
|
+
}, ge = (t) => we(() => Kt, []), mr = () => !1, ne = ({
|
|
25
25
|
actionName: t,
|
|
26
26
|
actionDescription: r,
|
|
27
27
|
children: a,
|
|
@@ -31,10 +31,10 @@ const kt = {
|
|
|
31
31
|
...u
|
|
32
32
|
}) => {
|
|
33
33
|
const f = ge();
|
|
34
|
-
return
|
|
34
|
+
return De.useEffect(() => {
|
|
35
35
|
n && t && r && f.isAvailable && f.registerAction();
|
|
36
|
-
}, [t, r, n, f.isAvailable, f.registerAction]), !t || !f.isAvailable ? /* @__PURE__ */ e(
|
|
37
|
-
},
|
|
36
|
+
}, [t, r, n, f.isAvailable, f.registerAction]), !t || !f.isAvailable ? /* @__PURE__ */ e($e, { onClick: o, ...u, children: a }) : f.hasPermission() ? /* @__PURE__ */ e($e, { onClick: o, ...u, children: a }) : /* @__PURE__ */ e(Ie, { children: d });
|
|
37
|
+
}, pr = ({
|
|
38
38
|
actionName: t,
|
|
39
39
|
actionDescription: r,
|
|
40
40
|
children: a,
|
|
@@ -42,22 +42,22 @@ const kt = {
|
|
|
42
42
|
onClick: n,
|
|
43
43
|
...o
|
|
44
44
|
}) => {
|
|
45
|
-
const [u, f] =
|
|
46
|
-
return
|
|
45
|
+
const [u, f] = De.useState(null), [I, v] = De.useState(!1);
|
|
46
|
+
return De.useEffect(() => {
|
|
47
47
|
if (!t) {
|
|
48
|
-
f(/* @__PURE__ */ e(
|
|
48
|
+
f(/* @__PURE__ */ e($e, { onClick: n, ...o, children: a }));
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
v(!1), f(/* @__PURE__ */ e(
|
|
52
|
-
}, [t, r, a, d, o]), /* @__PURE__ */ e(
|
|
53
|
-
},
|
|
51
|
+
v(!1), f(/* @__PURE__ */ e($e, { onClick: n, ...o, children: a }));
|
|
52
|
+
}, [t, r, a, d, o]), /* @__PURE__ */ e(Ie, { children: u });
|
|
53
|
+
}, ye = ({
|
|
54
54
|
children: t
|
|
55
|
-
}) => /* @__PURE__ */ e(
|
|
55
|
+
}) => /* @__PURE__ */ e(Ie, { children: t }), gr = (t) => we(() => ({
|
|
56
56
|
shouldWrap: !1,
|
|
57
57
|
isSecurityAvailable: !1,
|
|
58
58
|
hasResourceName: !!t
|
|
59
59
|
}), [t]);
|
|
60
|
-
function
|
|
60
|
+
function xr({
|
|
61
61
|
innerRef: t,
|
|
62
62
|
title: r,
|
|
63
63
|
isError: a = !1,
|
|
@@ -67,104 +67,104 @@ function dr({
|
|
|
67
67
|
clearError: u = () => {
|
|
68
68
|
},
|
|
69
69
|
autoCloseAlertError: f = 15e3,
|
|
70
|
-
width:
|
|
70
|
+
width: I = "100%",
|
|
71
71
|
height: v = "100%",
|
|
72
|
-
withBorder:
|
|
72
|
+
withBorder: ee = !0,
|
|
73
73
|
children: l,
|
|
74
74
|
radius: c,
|
|
75
|
-
variant:
|
|
75
|
+
variant: M,
|
|
76
76
|
footerAlign: A = "left",
|
|
77
|
-
footerContent:
|
|
77
|
+
footerContent: T,
|
|
78
78
|
dataSource: h,
|
|
79
79
|
onSave: B,
|
|
80
|
-
onCancel:
|
|
81
|
-
onBeforeSave:
|
|
82
|
-
onAfterSave:
|
|
80
|
+
onCancel: q,
|
|
81
|
+
onBeforeSave: P,
|
|
82
|
+
onAfterSave: X,
|
|
83
83
|
onBeforeCancel: b,
|
|
84
84
|
onAfterCancel: x,
|
|
85
85
|
onError: y,
|
|
86
86
|
// Props de segurança (opcionais)
|
|
87
|
-
resourceName:
|
|
88
|
-
resourceDescription:
|
|
89
|
-
requiredPermissions:
|
|
90
|
-
fallbackComponent:
|
|
87
|
+
resourceName: Y,
|
|
88
|
+
resourceDescription: _,
|
|
89
|
+
requiredPermissions: S,
|
|
90
|
+
fallbackComponent: V,
|
|
91
91
|
securityOptions: F,
|
|
92
|
-
...
|
|
92
|
+
...N
|
|
93
93
|
}) {
|
|
94
|
-
const w =
|
|
94
|
+
const w = Ae(), [G, R] = te(a), [re, H] = te(o), k = ut();
|
|
95
95
|
ge({
|
|
96
96
|
autoRegisterActions: F?.autoRegisterActions ?? !0
|
|
97
97
|
});
|
|
98
|
-
const
|
|
98
|
+
const D = Pe(
|
|
99
99
|
"ArchbaseFormTemplate",
|
|
100
100
|
h,
|
|
101
101
|
void 0,
|
|
102
102
|
void 0
|
|
103
103
|
);
|
|
104
|
-
|
|
104
|
+
et({
|
|
105
105
|
dataSource: h,
|
|
106
106
|
listener: (E) => {
|
|
107
|
-
E.type === pe.onError && (R(!0), H(E.error)), (E.type === pe.afterEdit || E.type === pe.afterInsert) && (
|
|
107
|
+
E.type === pe.onError && (R(!0), H(E.error)), (E.type === pe.afterEdit || E.type === pe.afterInsert) && (D.isDataSourceV2 || k());
|
|
108
108
|
}
|
|
109
109
|
});
|
|
110
|
-
const
|
|
110
|
+
const $ = Bt(), J = async (E) => {
|
|
111
111
|
try {
|
|
112
|
-
B ? B(E) : (
|
|
113
|
-
|
|
114
|
-
}).catch((
|
|
115
|
-
y && y(
|
|
112
|
+
B ? B(E) : (P && await P(E), h.isBrowsing() || h.save().then(() => {
|
|
113
|
+
$?.clearAll(), X && X(E);
|
|
114
|
+
}).catch((Z) => {
|
|
115
|
+
y && y(de(Z)), R(!0), H(de(Z));
|
|
116
116
|
}));
|
|
117
|
-
} catch (
|
|
118
|
-
y && y(
|
|
117
|
+
} catch (Z) {
|
|
118
|
+
y && y(de(Z)), R(!0), H(de(Z));
|
|
119
119
|
}
|
|
120
|
-
},
|
|
120
|
+
}, U = () => {
|
|
121
121
|
try {
|
|
122
|
-
|
|
122
|
+
q ? q() : (b && b(), h.isBrowsing() || h.cancel(), $?.clearAll(), x && x());
|
|
123
123
|
} catch (E) {
|
|
124
|
-
y && y(
|
|
124
|
+
y && y(de(E)), R(!0), H(de(E));
|
|
125
125
|
}
|
|
126
126
|
}, W = () => {
|
|
127
127
|
u && u(), R(!1), H("");
|
|
128
128
|
};
|
|
129
129
|
return /* @__PURE__ */ e(
|
|
130
|
-
|
|
130
|
+
ye,
|
|
131
131
|
{
|
|
132
|
-
resourceName:
|
|
133
|
-
resourceDescription:
|
|
134
|
-
requiredPermissions:
|
|
135
|
-
fallbackComponent:
|
|
132
|
+
resourceName: Y,
|
|
133
|
+
resourceDescription: _,
|
|
134
|
+
requiredPermissions: S,
|
|
135
|
+
fallbackComponent: V,
|
|
136
136
|
onSecurityReady: F?.onSecurityReady,
|
|
137
137
|
onAccessDenied: F?.onAccessDenied,
|
|
138
|
-
children: /* @__PURE__ */ e(
|
|
139
|
-
|
|
138
|
+
children: /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ C(
|
|
139
|
+
We,
|
|
140
140
|
{
|
|
141
141
|
ref: t,
|
|
142
|
-
withBorder:
|
|
142
|
+
withBorder: ee,
|
|
143
143
|
radius: c,
|
|
144
144
|
style: {
|
|
145
|
-
width:
|
|
145
|
+
width: I,
|
|
146
146
|
height: v,
|
|
147
147
|
display: "flex",
|
|
148
148
|
flexDirection: "column",
|
|
149
149
|
padding: 4
|
|
150
150
|
},
|
|
151
151
|
children: [
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
G && /* @__PURE__ */ e(Se, { style: { flexShrink: 0 }, children: /* @__PURE__ */ e(
|
|
153
|
+
je,
|
|
154
154
|
{
|
|
155
155
|
autoClose: f,
|
|
156
156
|
withCloseButton: !0,
|
|
157
157
|
withBorder: !0,
|
|
158
|
-
icon: /* @__PURE__ */ e(
|
|
158
|
+
icon: /* @__PURE__ */ e(Ue, { size: "1.4rem" }),
|
|
159
159
|
title: m().t("WARNING"),
|
|
160
160
|
titleColor: "rgb(250, 82, 82)",
|
|
161
|
-
variant:
|
|
161
|
+
variant: M ?? w.variant,
|
|
162
162
|
onClose: W,
|
|
163
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
163
|
+
children: /* @__PURE__ */ e("span", { children: re })
|
|
164
164
|
}
|
|
165
165
|
) }),
|
|
166
166
|
/* @__PURE__ */ C(
|
|
167
|
-
|
|
167
|
+
st,
|
|
168
168
|
{
|
|
169
169
|
style: {
|
|
170
170
|
flex: 1,
|
|
@@ -173,13 +173,13 @@ function dr({
|
|
|
173
173
|
padding: "calc(0.625rem / 2)"
|
|
174
174
|
},
|
|
175
175
|
children: [
|
|
176
|
-
/* @__PURE__ */ e(
|
|
176
|
+
/* @__PURE__ */ e(at, { visible: d || n, opacity: 0.3 }),
|
|
177
177
|
l
|
|
178
178
|
]
|
|
179
179
|
}
|
|
180
180
|
),
|
|
181
181
|
/* @__PURE__ */ C(
|
|
182
|
-
|
|
182
|
+
Se,
|
|
183
183
|
{
|
|
184
184
|
style: {
|
|
185
185
|
flexShrink: 0,
|
|
@@ -190,46 +190,46 @@ function dr({
|
|
|
190
190
|
gap: "1rem"
|
|
191
191
|
},
|
|
192
192
|
children: [
|
|
193
|
-
A === "right" &&
|
|
194
|
-
h && !h.isBrowsing() ? /* @__PURE__ */ C(
|
|
193
|
+
A === "right" && T && /* @__PURE__ */ e(Se, { style: { flex: 1 }, children: T }),
|
|
194
|
+
h && !h.isBrowsing() ? /* @__PURE__ */ C(be, { gap: "md", children: [
|
|
195
195
|
/* @__PURE__ */ e(
|
|
196
|
-
|
|
196
|
+
ne,
|
|
197
197
|
{
|
|
198
198
|
actionName: "save",
|
|
199
|
-
actionDescription: `Salvar ${
|
|
200
|
-
leftSection: /* @__PURE__ */ e(
|
|
201
|
-
onClick: () =>
|
|
199
|
+
actionDescription: `Salvar ${_ || "registro"}`,
|
|
200
|
+
leftSection: /* @__PURE__ */ e(Dt, {}),
|
|
201
|
+
onClick: () => J(h.getCurrentRecord()),
|
|
202
202
|
disabled: h && h.isBrowsing(),
|
|
203
|
-
variant:
|
|
203
|
+
variant: M ?? w.variant,
|
|
204
204
|
color: "green",
|
|
205
205
|
children: `${m().t("Ok")}`
|
|
206
206
|
}
|
|
207
207
|
),
|
|
208
208
|
/* @__PURE__ */ e(
|
|
209
|
-
|
|
209
|
+
ne,
|
|
210
210
|
{
|
|
211
211
|
actionName: "cancel",
|
|
212
212
|
actionDescription: "Cancelar operação",
|
|
213
|
-
leftSection: /* @__PURE__ */ e(
|
|
214
|
-
onClick:
|
|
213
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
214
|
+
onClick: U,
|
|
215
215
|
disabled: h && h.isBrowsing(),
|
|
216
|
-
variant:
|
|
216
|
+
variant: M ?? w.variant,
|
|
217
217
|
color: "red",
|
|
218
218
|
children: `${m().t("Cancel")}`
|
|
219
219
|
}
|
|
220
220
|
)
|
|
221
|
-
] }) : /* @__PURE__ */ e(
|
|
222
|
-
|
|
221
|
+
] }) : /* @__PURE__ */ e(be, { gap: "md", children: /* @__PURE__ */ e(
|
|
222
|
+
ne,
|
|
223
223
|
{
|
|
224
224
|
actionName: "close",
|
|
225
225
|
actionDescription: "Fechar formulário",
|
|
226
|
-
leftSection: /* @__PURE__ */ e(
|
|
227
|
-
onClick:
|
|
228
|
-
variant:
|
|
226
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
227
|
+
onClick: U,
|
|
228
|
+
variant: M ?? w.variant,
|
|
229
229
|
children: `${m().t("Close")}`
|
|
230
230
|
}
|
|
231
231
|
) }),
|
|
232
|
-
(A === "left" || A === "center") &&
|
|
232
|
+
(A === "left" || A === "center") && T && /* @__PURE__ */ e(Se, { style: { flex: A === "left" ? 1 : 0, textAlign: "right" }, children: T })
|
|
233
233
|
]
|
|
234
234
|
}
|
|
235
235
|
)
|
|
@@ -239,7 +239,7 @@ function dr({
|
|
|
239
239
|
}
|
|
240
240
|
);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
242
|
+
function vr({
|
|
243
243
|
title: t,
|
|
244
244
|
withOverlay: r = !0,
|
|
245
245
|
overlayProps: a,
|
|
@@ -248,56 +248,56 @@ function ur({
|
|
|
248
248
|
closeButtonProps: o,
|
|
249
249
|
opened: u,
|
|
250
250
|
fullScreen: f,
|
|
251
|
-
centered:
|
|
251
|
+
centered: I,
|
|
252
252
|
variant: v,
|
|
253
|
-
closeOnEscape:
|
|
253
|
+
closeOnEscape: ee = !0,
|
|
254
254
|
size: l,
|
|
255
255
|
dataSource: c,
|
|
256
|
-
height:
|
|
256
|
+
height: M,
|
|
257
257
|
userActions: A,
|
|
258
|
-
onAfterSave:
|
|
258
|
+
onAfterSave: T,
|
|
259
259
|
onClickOk: h,
|
|
260
260
|
onClickCancel: B,
|
|
261
|
-
onBeforeOk:
|
|
262
|
-
onCustomSave:
|
|
263
|
-
isError:
|
|
261
|
+
onBeforeOk: q,
|
|
262
|
+
onCustomSave: P,
|
|
263
|
+
isError: X,
|
|
264
264
|
error: b = "",
|
|
265
265
|
clearError: x = () => {
|
|
266
266
|
},
|
|
267
267
|
onError: y,
|
|
268
|
-
autoCloseAlertError:
|
|
269
|
-
loadingOverlayStyles:
|
|
268
|
+
autoCloseAlertError: Y = 15e3,
|
|
269
|
+
loadingOverlayStyles: _,
|
|
270
270
|
// Props de segurança (opcionais)
|
|
271
|
-
resourceName:
|
|
272
|
-
resourceDescription:
|
|
271
|
+
resourceName: S,
|
|
272
|
+
resourceDescription: V,
|
|
273
273
|
requiredPermissions: F,
|
|
274
|
-
fallbackComponent:
|
|
274
|
+
fallbackComponent: N,
|
|
275
275
|
securityOptions: w,
|
|
276
|
-
|
|
276
|
+
...G
|
|
277
277
|
}) {
|
|
278
|
-
const R =
|
|
278
|
+
const R = Ae(), re = Oe(), { colorScheme: H } = Ke(), [k, D] = te(X), [$, J] = te(b), [U, W] = te(!1), E = ut();
|
|
279
279
|
ge({
|
|
280
|
-
resourceDescription:
|
|
280
|
+
resourceDescription: V || t?.toString(),
|
|
281
281
|
autoRegisterActions: w?.autoRegisterActions ?? !0
|
|
282
282
|
});
|
|
283
|
-
const
|
|
283
|
+
const Z = Pe(
|
|
284
284
|
"ArchbaseFormModalTemplate",
|
|
285
285
|
c,
|
|
286
286
|
void 0,
|
|
287
287
|
void 0
|
|
288
288
|
);
|
|
289
|
-
|
|
289
|
+
et({
|
|
290
290
|
dataSource: c,
|
|
291
|
-
listener: (
|
|
292
|
-
|
|
291
|
+
listener: (K) => {
|
|
292
|
+
K.type === pe.onError && (D(!0), J(K.error)), (K.type === pe.afterEdit || K.type === pe.afterInsert) && (Z.isDataSourceV2 || E());
|
|
293
293
|
}
|
|
294
294
|
});
|
|
295
|
-
const
|
|
295
|
+
const fe = async () => {
|
|
296
296
|
if (c && !c.isBrowsing())
|
|
297
297
|
try {
|
|
298
|
-
W(!0), await c.save(),
|
|
299
|
-
} catch (
|
|
300
|
-
return y && y(
|
|
298
|
+
W(!0), await c.save(), T && T(c.getCurrentRecord());
|
|
299
|
+
} catch (K) {
|
|
300
|
+
return y && y(de(K)), D(!0), J(de(K)), W(!1), !1;
|
|
301
301
|
}
|
|
302
302
|
return W(!1), !0;
|
|
303
303
|
}, s = () => {
|
|
@@ -306,82 +306,82 @@ function ur({
|
|
|
306
306
|
c.cancel();
|
|
307
307
|
} catch {
|
|
308
308
|
}
|
|
309
|
-
},
|
|
310
|
-
if (
|
|
311
|
-
c &&
|
|
309
|
+
}, z = async () => {
|
|
310
|
+
if (P)
|
|
311
|
+
c && P(c.getCurrentRecord(), () => {
|
|
312
312
|
h && h();
|
|
313
313
|
});
|
|
314
|
-
else if (
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
await
|
|
318
|
-
}).catch((
|
|
319
|
-
y && y(
|
|
314
|
+
else if (q) {
|
|
315
|
+
const K = q(c.getCurrentRecord());
|
|
316
|
+
K instanceof Promise && K.then(async () => {
|
|
317
|
+
await fe() && h && h();
|
|
318
|
+
}).catch((Ce) => {
|
|
319
|
+
y && y(de(Ce)), D(!0), J(de(Ce));
|
|
320
320
|
});
|
|
321
321
|
} else
|
|
322
|
-
await
|
|
322
|
+
await fe() && h && h();
|
|
323
323
|
}, O = () => {
|
|
324
324
|
s(), B && B();
|
|
325
|
-
},
|
|
326
|
-
|
|
327
|
-
},
|
|
328
|
-
x && x(),
|
|
325
|
+
}, ie = () => {
|
|
326
|
+
gt.showWarning(m().t("archbase:Click on Ok or Cancel to close"));
|
|
327
|
+
}, oe = () => {
|
|
328
|
+
x && x(), D(!1), J("");
|
|
329
329
|
};
|
|
330
330
|
return /* @__PURE__ */ e(
|
|
331
|
-
|
|
331
|
+
ye,
|
|
332
332
|
{
|
|
333
|
-
resourceName:
|
|
334
|
-
resourceDescription:
|
|
333
|
+
resourceName: S,
|
|
334
|
+
resourceDescription: V,
|
|
335
335
|
requiredPermissions: F,
|
|
336
|
-
fallbackComponent:
|
|
336
|
+
fallbackComponent: N,
|
|
337
337
|
onSecurityReady: w?.onSecurityReady,
|
|
338
338
|
onAccessDenied: w?.onAccessDenied,
|
|
339
339
|
children: /* @__PURE__ */ e(
|
|
340
|
-
|
|
340
|
+
ct,
|
|
341
341
|
{
|
|
342
342
|
title: t,
|
|
343
343
|
withOverlay: r,
|
|
344
344
|
overlayProps: a || {
|
|
345
|
-
color: H === "dark" ?
|
|
345
|
+
color: H === "dark" ? re.colors.dark[7] : re.colors.gray[6],
|
|
346
346
|
opacity: 0.25
|
|
347
347
|
},
|
|
348
348
|
withCloseButton: n,
|
|
349
349
|
closeButtonProps: o,
|
|
350
|
-
onClose:
|
|
350
|
+
onClose: ie,
|
|
351
351
|
opened: u,
|
|
352
352
|
fullScreen: f,
|
|
353
|
-
centered:
|
|
354
|
-
closeOnEscape:
|
|
353
|
+
centered: I,
|
|
354
|
+
closeOnEscape: ee,
|
|
355
355
|
size: l,
|
|
356
|
-
|
|
357
|
-
children: /* @__PURE__ */ C(
|
|
358
|
-
/* @__PURE__ */ e(
|
|
359
|
-
/* @__PURE__ */ C(
|
|
360
|
-
|
|
361
|
-
|
|
356
|
+
...G,
|
|
357
|
+
children: /* @__PURE__ */ C(ft, { children: [
|
|
358
|
+
/* @__PURE__ */ e(at, { styles: _, visible: U, opacity: 0.8 }),
|
|
359
|
+
/* @__PURE__ */ C(tt, { height: M, children: [
|
|
360
|
+
k ? /* @__PURE__ */ e(vt, { size: "100px", children: /* @__PURE__ */ e(
|
|
361
|
+
je,
|
|
362
362
|
{
|
|
363
|
-
autoClose:
|
|
363
|
+
autoClose: Y,
|
|
364
364
|
withCloseButton: !0,
|
|
365
365
|
withBorder: !0,
|
|
366
|
-
icon: /* @__PURE__ */ e(
|
|
366
|
+
icon: /* @__PURE__ */ e(Ue, { size: "1.4rem" }),
|
|
367
367
|
title: m().t("WARNING"),
|
|
368
368
|
titleColor: "rgb(250, 82, 82)",
|
|
369
369
|
variant: v ?? R.variant,
|
|
370
|
-
onClose:
|
|
371
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
370
|
+
onClose: oe,
|
|
371
|
+
children: /* @__PURE__ */ e("span", { children: $ })
|
|
372
372
|
}
|
|
373
373
|
) }) : null,
|
|
374
|
-
/* @__PURE__ */ e(
|
|
375
|
-
/* @__PURE__ */ e(
|
|
376
|
-
/* @__PURE__ */ e(
|
|
377
|
-
c && !c.isBrowsing() ? /* @__PURE__ */ C(
|
|
374
|
+
/* @__PURE__ */ e(rt, { children: /* @__PURE__ */ e(bt, { children: d }) }),
|
|
375
|
+
/* @__PURE__ */ e(nt, { size: "40px", children: /* @__PURE__ */ C(ue, { justify: "space-between", align: "center", children: [
|
|
376
|
+
/* @__PURE__ */ e(be, { children: A }),
|
|
377
|
+
c && !c.isBrowsing() ? /* @__PURE__ */ C(be, { gap: "md", children: [
|
|
378
378
|
/* @__PURE__ */ e(
|
|
379
|
-
|
|
379
|
+
ne,
|
|
380
380
|
{
|
|
381
381
|
actionName: "save",
|
|
382
|
-
actionDescription: `Salvar ${
|
|
383
|
-
leftSection: /* @__PURE__ */ e(
|
|
384
|
-
onClick:
|
|
382
|
+
actionDescription: `Salvar ${V || t || "registro"}`,
|
|
383
|
+
leftSection: /* @__PURE__ */ e(ht, {}),
|
|
384
|
+
onClick: z,
|
|
385
385
|
disabled: c && c.isBrowsing(),
|
|
386
386
|
variant: v ?? R.variant,
|
|
387
387
|
color: "green",
|
|
@@ -389,11 +389,11 @@ function ur({
|
|
|
389
389
|
}
|
|
390
390
|
),
|
|
391
391
|
/* @__PURE__ */ e(
|
|
392
|
-
|
|
392
|
+
ne,
|
|
393
393
|
{
|
|
394
394
|
actionName: "cancel",
|
|
395
395
|
actionDescription: "Cancelar operação",
|
|
396
|
-
leftSection: /* @__PURE__ */ e(
|
|
396
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
397
397
|
onClick: O,
|
|
398
398
|
disabled: c && c.isBrowsing(),
|
|
399
399
|
variant: v ?? R.variant,
|
|
@@ -401,12 +401,12 @@ function ur({
|
|
|
401
401
|
children: `${m().t("Cancel")}`
|
|
402
402
|
}
|
|
403
403
|
)
|
|
404
|
-
] }) : /* @__PURE__ */ e(
|
|
405
|
-
|
|
404
|
+
] }) : /* @__PURE__ */ e(be, { gap: "md", children: /* @__PURE__ */ e(
|
|
405
|
+
ne,
|
|
406
406
|
{
|
|
407
407
|
actionName: "close",
|
|
408
408
|
actionDescription: "Fechar janela",
|
|
409
|
-
leftSection: /* @__PURE__ */ e(
|
|
409
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
410
410
|
onClick: O,
|
|
411
411
|
variant: v ?? R.variant,
|
|
412
412
|
children: `${m().t("Close")}`
|
|
@@ -420,7 +420,7 @@ function ur({
|
|
|
420
420
|
}
|
|
421
421
|
);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function br({
|
|
424
424
|
title: t,
|
|
425
425
|
withOverlay: r = !0,
|
|
426
426
|
overlayProps: a,
|
|
@@ -429,50 +429,50 @@ function hr({
|
|
|
429
429
|
closeButtonProps: o,
|
|
430
430
|
opened: u,
|
|
431
431
|
fullScreen: f,
|
|
432
|
-
centered:
|
|
432
|
+
centered: I,
|
|
433
433
|
variant: v,
|
|
434
|
-
closeOnEscape:
|
|
434
|
+
closeOnEscape: ee = !0,
|
|
435
435
|
size: l,
|
|
436
436
|
height: c,
|
|
437
|
-
onlyOkButton:
|
|
437
|
+
onlyOkButton: M = !1,
|
|
438
438
|
onClose: A,
|
|
439
|
-
onClickOk:
|
|
439
|
+
onClickOk: T,
|
|
440
440
|
onClickCancel: h,
|
|
441
441
|
userActions: B,
|
|
442
442
|
// Props de segurança (opcionais)
|
|
443
|
-
resourceName:
|
|
444
|
-
resourceDescription:
|
|
445
|
-
requiredPermissions:
|
|
443
|
+
resourceName: q,
|
|
444
|
+
resourceDescription: P,
|
|
445
|
+
requiredPermissions: X,
|
|
446
446
|
fallbackComponent: b,
|
|
447
447
|
securityOptions: x
|
|
448
448
|
}) {
|
|
449
|
-
const y =
|
|
449
|
+
const y = Ae(), Y = Oe(), { colorScheme: _ } = Ke();
|
|
450
450
|
ge({
|
|
451
451
|
autoRegisterActions: x?.autoRegisterActions ?? !0
|
|
452
452
|
});
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
},
|
|
453
|
+
const S = () => {
|
|
454
|
+
T && T(), A();
|
|
455
|
+
}, V = () => {
|
|
456
456
|
h && h(), A();
|
|
457
457
|
}, F = () => {
|
|
458
|
-
|
|
458
|
+
gt.showWarning(m().t("Click on Ok or Cancel to close"));
|
|
459
459
|
};
|
|
460
460
|
return /* @__PURE__ */ e(
|
|
461
|
-
|
|
461
|
+
ye,
|
|
462
462
|
{
|
|
463
|
-
resourceName:
|
|
464
|
-
resourceDescription:
|
|
465
|
-
requiredPermissions:
|
|
463
|
+
resourceName: q,
|
|
464
|
+
resourceDescription: P,
|
|
465
|
+
requiredPermissions: X,
|
|
466
466
|
fallbackComponent: b,
|
|
467
467
|
onSecurityReady: x?.onSecurityReady,
|
|
468
468
|
onAccessDenied: x?.onAccessDenied,
|
|
469
469
|
children: /* @__PURE__ */ e(
|
|
470
|
-
|
|
470
|
+
ct,
|
|
471
471
|
{
|
|
472
472
|
title: t,
|
|
473
473
|
withOverlay: r,
|
|
474
474
|
overlayProps: a || {
|
|
475
|
-
color:
|
|
475
|
+
color: _ === "dark" ? Y.colors.dark[7] : Y.colors.gray[6],
|
|
476
476
|
opacity: 0.25
|
|
477
477
|
},
|
|
478
478
|
withCloseButton: n,
|
|
@@ -480,33 +480,33 @@ function hr({
|
|
|
480
480
|
onClose: F,
|
|
481
481
|
opened: u,
|
|
482
482
|
fullScreen: f,
|
|
483
|
-
centered:
|
|
484
|
-
closeOnEscape:
|
|
483
|
+
centered: I,
|
|
484
|
+
closeOnEscape: ee,
|
|
485
485
|
size: l,
|
|
486
|
-
children: /* @__PURE__ */ C(
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
/* @__PURE__ */ e(
|
|
489
|
-
/* @__PURE__ */ e(
|
|
490
|
-
/* @__PURE__ */ C(
|
|
486
|
+
children: /* @__PURE__ */ C(tt, { height: c, children: [
|
|
487
|
+
/* @__PURE__ */ e(rt, { children: /* @__PURE__ */ e(bt, { children: d }) }),
|
|
488
|
+
/* @__PURE__ */ e(nt, { size: "40px", children: /* @__PURE__ */ C(ue, { justify: "space-between", align: "center", children: [
|
|
489
|
+
/* @__PURE__ */ e(be, { children: B }),
|
|
490
|
+
/* @__PURE__ */ C(be, { gap: "md", children: [
|
|
491
491
|
/* @__PURE__ */ e(
|
|
492
|
-
|
|
492
|
+
ne,
|
|
493
493
|
{
|
|
494
494
|
actionName: "save",
|
|
495
|
-
actionDescription: `Salvar ${
|
|
496
|
-
leftSection: /* @__PURE__ */ e(
|
|
497
|
-
onClick:
|
|
495
|
+
actionDescription: `Salvar ${P || "registro"}`,
|
|
496
|
+
leftSection: /* @__PURE__ */ e(ht, {}),
|
|
497
|
+
onClick: S,
|
|
498
498
|
variant: v ?? y.variant,
|
|
499
499
|
color: "green",
|
|
500
500
|
children: `${m().t("Ok")}`
|
|
501
501
|
}
|
|
502
502
|
),
|
|
503
|
-
|
|
504
|
-
|
|
503
|
+
M ? null : /* @__PURE__ */ e(
|
|
504
|
+
ne,
|
|
505
505
|
{
|
|
506
506
|
actionName: "cancel",
|
|
507
507
|
actionDescription: "Cancelar operação",
|
|
508
|
-
leftSection: /* @__PURE__ */ e(
|
|
509
|
-
onClick:
|
|
508
|
+
leftSection: /* @__PURE__ */ e(Be, {}),
|
|
509
|
+
onClick: V,
|
|
510
510
|
variant: v ?? y.variant,
|
|
511
511
|
color: "red",
|
|
512
512
|
children: h ? `${m().t("Cancel")}` : `${m().t("Close")}`
|
|
@@ -520,7 +520,7 @@ function hr({
|
|
|
520
520
|
}
|
|
521
521
|
);
|
|
522
522
|
}
|
|
523
|
-
const
|
|
523
|
+
const Qt = (t, r, a) => {
|
|
524
524
|
if (!t || !r || !r.existsValue(`${t.viewName}_${t.componentName}`)) {
|
|
525
525
|
let d = -1, n;
|
|
526
526
|
return a && a.getFilters().length > 0 && (d = 0, n = JSON.parse(a.getFirstFilter()?.filter)), {
|
|
@@ -531,7 +531,7 @@ const zt = (t, r, a) => {
|
|
|
531
531
|
}
|
|
532
532
|
return r.getValue(`${t.viewName}_${t.componentName}`);
|
|
533
533
|
};
|
|
534
|
-
function
|
|
534
|
+
function Xt(t, r) {
|
|
535
535
|
const {
|
|
536
536
|
title: a,
|
|
537
537
|
printTitle: d,
|
|
@@ -539,163 +539,171 @@ function qt(t, r) {
|
|
|
539
539
|
filterOptions: o,
|
|
540
540
|
pageSize: u = 15,
|
|
541
541
|
pageIndex: f = 0,
|
|
542
|
-
columns:
|
|
542
|
+
columns: I,
|
|
543
543
|
filterFields: v,
|
|
544
|
-
logoPrint:
|
|
544
|
+
logoPrint: ee,
|
|
545
545
|
userActions: l,
|
|
546
546
|
userRowActions: c,
|
|
547
|
-
customRenderRowActions:
|
|
547
|
+
customRenderRowActions: M,
|
|
548
548
|
innerRef: A,
|
|
549
|
-
isLoading:
|
|
549
|
+
isLoading: T = !1,
|
|
550
550
|
isLoadingFilter: h = !1,
|
|
551
551
|
isError: B = !1,
|
|
552
|
-
enableTopToolbar:
|
|
553
|
-
enableTopToolbarActions:
|
|
554
|
-
error:
|
|
552
|
+
enableTopToolbar: q = !0,
|
|
553
|
+
enableTopToolbarActions: P = !0,
|
|
554
|
+
error: X = "",
|
|
555
555
|
clearError: b = () => {
|
|
556
556
|
},
|
|
557
557
|
filterType: x,
|
|
558
558
|
width: y = "100%",
|
|
559
|
-
height:
|
|
560
|
-
onSearchByFilter:
|
|
561
|
-
getRowId:
|
|
562
|
-
withBorder:
|
|
559
|
+
height: Y = "100%",
|
|
560
|
+
onSearchByFilter: _,
|
|
561
|
+
getRowId: S,
|
|
562
|
+
withBorder: V = !0,
|
|
563
563
|
filterPersistenceDelegator: F,
|
|
564
|
-
variant:
|
|
564
|
+
variant: N,
|
|
565
565
|
store: w,
|
|
566
|
-
cellPadding:
|
|
566
|
+
cellPadding: G,
|
|
567
567
|
bottomToolbarMinHeight: R,
|
|
568
|
-
enableRowSelection:
|
|
568
|
+
enableRowSelection: re = !0,
|
|
569
569
|
enableRowNumbers: H = !0,
|
|
570
|
-
enableRowActions:
|
|
571
|
-
positionActionsColumn:
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
570
|
+
enableRowActions: k = !0,
|
|
571
|
+
positionActionsColumn: D = "first",
|
|
572
|
+
actionsColumnWidth: $,
|
|
573
|
+
tableHeadCellPadding: J,
|
|
574
|
+
renderDetailPanel: U,
|
|
575
|
+
renderTopToolbar: W,
|
|
576
|
+
toolbarAlignment: E = "right",
|
|
577
|
+
toolbarLeftContent: Z,
|
|
578
|
+
onSelectedRowsChanged: fe,
|
|
579
|
+
onCellDoubleClick: s,
|
|
580
|
+
onFilterModelChange: z,
|
|
581
|
+
paginationLabels: O,
|
|
581
582
|
// Props de segurança (opcionais)
|
|
582
|
-
resourceName:
|
|
583
|
-
resourceDescription:
|
|
584
|
-
requiredPermissions:
|
|
585
|
-
fallbackComponent:
|
|
586
|
-
securityOptions:
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
583
|
+
resourceName: ie,
|
|
584
|
+
resourceDescription: oe,
|
|
585
|
+
requiredPermissions: K,
|
|
586
|
+
fallbackComponent: Ce,
|
|
587
|
+
securityOptions: xe,
|
|
588
|
+
// Props para controle de bordas internas
|
|
589
|
+
withToolbarBorder: Te,
|
|
590
|
+
withPaginationBorder: Le,
|
|
591
|
+
toolbarPadding: Me,
|
|
592
|
+
paginationPadding: ke,
|
|
593
|
+
rowHeight: ze,
|
|
594
|
+
hideFooter: qe = !0
|
|
595
|
+
} = t, _e = ae(null), j = ae(null);
|
|
596
|
+
Oe();
|
|
597
|
+
const { colorScheme: lt } = Ke();
|
|
590
598
|
ge({
|
|
591
|
-
autoRegisterActions:
|
|
599
|
+
autoRegisterActions: xe?.autoRegisterActions ?? !0
|
|
592
600
|
});
|
|
593
|
-
const
|
|
601
|
+
const Fe = Pe(
|
|
594
602
|
"ArchbaseGridTemplate",
|
|
595
603
|
n,
|
|
596
604
|
void 0,
|
|
597
605
|
void 0
|
|
598
606
|
);
|
|
599
|
-
|
|
607
|
+
Gt(r, () => ({
|
|
600
608
|
refreshData: () => {
|
|
601
|
-
|
|
609
|
+
j.current && j.current.refreshData();
|
|
602
610
|
},
|
|
603
|
-
getSelectedRows: () =>
|
|
611
|
+
getSelectedRows: () => j.current ? j.current.getSelectedRows() : [],
|
|
604
612
|
clearSelection: () => {
|
|
605
|
-
|
|
613
|
+
j.current && j.current.clearSelection();
|
|
606
614
|
},
|
|
607
615
|
exportData: () => {
|
|
608
|
-
|
|
616
|
+
j.current && j.current.exportData();
|
|
609
617
|
},
|
|
610
618
|
printData: () => {
|
|
611
|
-
|
|
619
|
+
j.current && j.current.printData();
|
|
612
620
|
},
|
|
613
|
-
getDataGridRef: () =>
|
|
614
|
-
getFilterModel: () =>
|
|
615
|
-
}), [
|
|
616
|
-
const [
|
|
621
|
+
getDataGridRef: () => j,
|
|
622
|
+
getFilterModel: () => j.current ? j.current.getFilterModel() : { items: [], quickFilterValues: [] }
|
|
623
|
+
}), [j]);
|
|
624
|
+
const [L, Re] = te({
|
|
617
625
|
activeFilterIndex: -1,
|
|
618
626
|
currentFilter: void 0,
|
|
619
627
|
expandedFilter: !1
|
|
620
628
|
});
|
|
621
|
-
|
|
622
|
-
const
|
|
623
|
-
|
|
629
|
+
mt(() => {
|
|
630
|
+
const g = Qt(o, w, F);
|
|
631
|
+
Re(g);
|
|
624
632
|
}, [h]);
|
|
625
|
-
const
|
|
626
|
-
if (
|
|
627
|
-
return
|
|
633
|
+
const He = (g) => {
|
|
634
|
+
if (M)
|
|
635
|
+
return M(g);
|
|
628
636
|
if (!c || !c.actions)
|
|
629
637
|
return;
|
|
630
|
-
const
|
|
638
|
+
const ce = c.actions;
|
|
631
639
|
return /* @__PURE__ */ e(
|
|
632
|
-
|
|
640
|
+
ce,
|
|
633
641
|
{
|
|
634
|
-
onEditRow: c.onEditRow ? (
|
|
635
|
-
onRemoveRow: c.onRemoveRow ? (
|
|
636
|
-
onViewRow: c.onViewRow ? (
|
|
637
|
-
row:
|
|
638
|
-
variant:
|
|
642
|
+
onEditRow: c.onEditRow ? (Q) => c.onEditRow && c.onEditRow(Q) : void 0,
|
|
643
|
+
onRemoveRow: c.onRemoveRow ? (Q) => c.onRemoveRow && c.onRemoveRow(Q) : void 0,
|
|
644
|
+
onViewRow: c.onViewRow ? (Q) => c.onViewRow && c.onViewRow(Q) : void 0,
|
|
645
|
+
row: g,
|
|
646
|
+
variant: N ?? he.variant
|
|
639
647
|
}
|
|
640
648
|
);
|
|
641
|
-
},
|
|
642
|
-
|
|
643
|
-
A && A.current !==
|
|
649
|
+
}, he = Ae(), Ee = ae(null), i = we(() => Z, [Z]);
|
|
650
|
+
De.useEffect(() => {
|
|
651
|
+
A && A.current !== Ee.current && A.current && Ee.current && (A.current = Ee.current);
|
|
644
652
|
}, [A]);
|
|
645
|
-
const
|
|
646
|
-
const
|
|
647
|
-
|
|
648
|
-
},
|
|
649
|
-
const
|
|
650
|
-
|
|
651
|
-
},
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
},
|
|
655
|
-
if (
|
|
656
|
-
if (
|
|
657
|
-
|
|
658
|
-
else if (
|
|
659
|
-
const
|
|
660
|
-
|
|
661
|
-
search:
|
|
662
|
-
fields:
|
|
663
|
-
}),
|
|
653
|
+
const p = (g, ce) => {
|
|
654
|
+
const Q = { ...L, currentFilter: g, activeFilterIndex: ce };
|
|
655
|
+
Re(Q), w && o && w?.setValue(`${o.viewName}_${o.componentName}`, Q);
|
|
656
|
+
}, le = (g) => {
|
|
657
|
+
const ce = { ...L, expandedFilter: g };
|
|
658
|
+
Re(ce), w && o && w?.setValue(`${o.viewName}_${o.componentName}`, ce);
|
|
659
|
+
}, se = (g, ce) => {
|
|
660
|
+
const Q = { ...L, currentFilter: g, activeFilterIndex: ce };
|
|
661
|
+
Re(Q), w && o && w?.setValue(`${o.viewName}_${o.componentName}`, Q);
|
|
662
|
+
}, Je = () => {
|
|
663
|
+
if (L.currentFilter)
|
|
664
|
+
if (_)
|
|
665
|
+
_();
|
|
666
|
+
else if (L.currentFilter.filter.filterType === "quick") {
|
|
667
|
+
const g = n.getOptions();
|
|
668
|
+
L.currentFilter.filter.quickFilterText && L.currentFilter.filter.quickFilterText !== "" ? (g.filter = JSON.stringify({
|
|
669
|
+
search: L.currentFilter.filter.quickFilterText,
|
|
670
|
+
fields: L.currentFilter.filter.quickFilterFieldsText
|
|
671
|
+
}), g.sort = L.currentFilter.sort.quickFilterSort ? L.currentFilter.sort.quickFilterSort.split(",") : []) : (g.filter = void 0, g.sort = void 0), n.refreshData(g), Fe.isDataSourceV2 || Fe.v1State.forceUpdate();
|
|
664
672
|
} else {
|
|
665
|
-
const
|
|
666
|
-
if (
|
|
667
|
-
const
|
|
668
|
-
|
|
673
|
+
const g = Ht(L.currentFilter);
|
|
674
|
+
if (g && g.expressionNode) {
|
|
675
|
+
const ce = Pt(g.expressionNode), Q = n.getOptions();
|
|
676
|
+
Q.filter = ce, Q.sort = g?.sortStrings, n.refreshData(Q), Fe.isDataSourceV2 || Fe.v1State.forceUpdate();
|
|
669
677
|
}
|
|
670
678
|
}
|
|
671
679
|
};
|
|
672
|
-
let
|
|
673
|
-
const
|
|
674
|
-
|
|
675
|
-
},
|
|
676
|
-
|
|
677
|
-
},
|
|
678
|
-
|
|
679
|
-
},
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
|
|
680
|
+
let Ve, ve;
|
|
681
|
+
const At = (g) => {
|
|
682
|
+
Ve = g;
|
|
683
|
+
}, yt = (g) => {
|
|
684
|
+
ve = g;
|
|
685
|
+
}, Ct = () => {
|
|
686
|
+
ve && ve();
|
|
687
|
+
}, Ft = () => {
|
|
688
|
+
Ve && Ve();
|
|
689
|
+
}, Rt = () => x === "none" ? /* @__PURE__ */ e("div", {}) : x === "advanced" ? /* @__PURE__ */ e(
|
|
690
|
+
it,
|
|
683
691
|
{
|
|
684
692
|
id: o?.componentName,
|
|
685
693
|
viewName: o?.viewName,
|
|
686
694
|
apiVersion: o?.apiVersion,
|
|
687
|
-
ref:
|
|
688
|
-
variant:
|
|
689
|
-
expandedFilter:
|
|
695
|
+
ref: _e,
|
|
696
|
+
variant: N ?? he.variant,
|
|
697
|
+
expandedFilter: L.expandedFilter,
|
|
690
698
|
persistenceDelegator: F,
|
|
691
|
-
currentFilter:
|
|
692
|
-
activeFilterIndex:
|
|
693
|
-
onSelectedFilter:
|
|
694
|
-
onFilterChanged:
|
|
695
|
-
onSearchByFilter:
|
|
696
|
-
onToggleExpandedFilter:
|
|
697
|
-
onExport:
|
|
698
|
-
onPrint:
|
|
699
|
+
currentFilter: L.currentFilter,
|
|
700
|
+
activeFilterIndex: L.activeFilterIndex,
|
|
701
|
+
onSelectedFilter: se,
|
|
702
|
+
onFilterChanged: p,
|
|
703
|
+
onSearchByFilter: Je,
|
|
704
|
+
onToggleExpandedFilter: le,
|
|
705
|
+
onExport: Ct,
|
|
706
|
+
onPrint: Ft,
|
|
699
707
|
showExportButton: !0,
|
|
700
708
|
showPrintButton: !0,
|
|
701
709
|
width: "560px",
|
|
@@ -704,48 +712,48 @@ function qt(t, r) {
|
|
|
704
712
|
}
|
|
705
713
|
) : x === "normal" ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e("div", {});
|
|
706
714
|
return /* @__PURE__ */ e(
|
|
707
|
-
|
|
715
|
+
ye,
|
|
708
716
|
{
|
|
709
|
-
resourceName:
|
|
710
|
-
resourceDescription:
|
|
711
|
-
requiredPermissions:
|
|
712
|
-
fallbackComponent:
|
|
713
|
-
onSecurityReady:
|
|
714
|
-
onAccessDenied:
|
|
715
|
-
children: /* @__PURE__ */ C(
|
|
717
|
+
resourceName: ie,
|
|
718
|
+
resourceDescription: oe,
|
|
719
|
+
requiredPermissions: K,
|
|
720
|
+
fallbackComponent: Ce,
|
|
721
|
+
onSecurityReady: xe?.onSecurityReady,
|
|
722
|
+
onAccessDenied: xe?.onAccessDenied,
|
|
723
|
+
children: /* @__PURE__ */ C(We, { withBorder: V, ref: Ee, style: { height: "100%" }, children: [
|
|
716
724
|
B ? /* @__PURE__ */ e(
|
|
717
|
-
|
|
725
|
+
je,
|
|
718
726
|
{
|
|
719
727
|
autoClose: 2e4,
|
|
720
728
|
withCloseButton: !0,
|
|
721
729
|
withBorder: !0,
|
|
722
|
-
icon: /* @__PURE__ */ e(
|
|
730
|
+
icon: /* @__PURE__ */ e(Ue, { size: "1.4rem" }),
|
|
723
731
|
title: m().t("archbase:WARNING"),
|
|
724
732
|
titleColor: "rgb(250, 82, 82)",
|
|
725
|
-
variant:
|
|
733
|
+
variant: N ?? he.variant,
|
|
726
734
|
onClose: () => b && b(),
|
|
727
|
-
children: /* @__PURE__ */ e("span", { children:
|
|
735
|
+
children: /* @__PURE__ */ e("span", { children: X })
|
|
728
736
|
}
|
|
729
737
|
) : null,
|
|
730
738
|
/* @__PURE__ */ C(
|
|
731
|
-
|
|
739
|
+
Lt,
|
|
732
740
|
{
|
|
733
|
-
gridRef:
|
|
741
|
+
gridRef: j,
|
|
734
742
|
printTitle: d || a,
|
|
735
|
-
logoPrint:
|
|
743
|
+
logoPrint: ee,
|
|
736
744
|
width: y,
|
|
737
|
-
height:
|
|
738
|
-
withBorder:
|
|
745
|
+
height: Y,
|
|
746
|
+
withBorder: !1,
|
|
739
747
|
dataSource: n,
|
|
740
748
|
enableColumnResizing: !0,
|
|
741
749
|
enableRowNumbers: H,
|
|
742
|
-
enableRowSelection:
|
|
743
|
-
enableRowActions:
|
|
744
|
-
enableTopToolbar:
|
|
745
|
-
enableTopToolbarActions:
|
|
750
|
+
enableRowSelection: re,
|
|
751
|
+
enableRowActions: k,
|
|
752
|
+
enableTopToolbar: q,
|
|
753
|
+
enableTopToolbarActions: P,
|
|
746
754
|
manualPagination: !0,
|
|
747
755
|
manualSorting: !0,
|
|
748
|
-
isLoading:
|
|
756
|
+
isLoading: T,
|
|
749
757
|
pageSize: u,
|
|
750
758
|
pageIndex: f,
|
|
751
759
|
allowColumnFilters: x !== "none",
|
|
@@ -753,77 +761,84 @@ function qt(t, r) {
|
|
|
753
761
|
renderToolbarInternalActions: x == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
|
|
754
762
|
allowExportData: !0,
|
|
755
763
|
allowPrintData: !0,
|
|
756
|
-
onSelectedRowsChanged:
|
|
757
|
-
onCellDoubleClick:
|
|
758
|
-
onFilterModelChange:
|
|
759
|
-
renderRowActions:
|
|
760
|
-
positionActionsColumn:
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
764
|
+
onSelectedRowsChanged: fe,
|
|
765
|
+
onCellDoubleClick: s,
|
|
766
|
+
onFilterModelChange: z,
|
|
767
|
+
renderRowActions: k ? He : void 0,
|
|
768
|
+
positionActionsColumn: D,
|
|
769
|
+
actionsColumnWidth: $,
|
|
770
|
+
toolbarAlignment: E,
|
|
771
|
+
toolbarLeftContent: i,
|
|
772
|
+
renderToolbarActions: x === "advanced" || x === "none" ? Rt : void 0,
|
|
773
|
+
paginationLabels: O,
|
|
774
|
+
cellPadding: G,
|
|
766
775
|
bottomToolbarMinHeight: R,
|
|
767
|
-
tableHeadCellPadding:
|
|
768
|
-
getRowId:
|
|
769
|
-
renderDetailPanel:
|
|
770
|
-
renderTopToolbar:
|
|
771
|
-
onExport:
|
|
772
|
-
onPrint:
|
|
773
|
-
variant:
|
|
776
|
+
tableHeadCellPadding: J,
|
|
777
|
+
getRowId: S,
|
|
778
|
+
renderDetailPanel: U ? ({ row: g }) => U({ row: g }) : void 0,
|
|
779
|
+
renderTopToolbar: W,
|
|
780
|
+
onExport: yt,
|
|
781
|
+
onPrint: At,
|
|
782
|
+
variant: N,
|
|
783
|
+
withToolbarBorder: Te,
|
|
784
|
+
withPaginationBorder: Le,
|
|
785
|
+
toolbarPadding: Me,
|
|
786
|
+
paginationPadding: ke,
|
|
787
|
+
rowHeight: ze,
|
|
788
|
+
hideFooter: qe,
|
|
774
789
|
children: [
|
|
775
|
-
|
|
776
|
-
l?.visible ? /* @__PURE__ */ e(
|
|
790
|
+
I,
|
|
791
|
+
l?.visible ? /* @__PURE__ */ e(Mt, { children: /* @__PURE__ */ C(Ie, { children: [
|
|
777
792
|
/* @__PURE__ */ e("h3", { className: "only-print", children: d || a }),
|
|
778
|
-
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ C(
|
|
793
|
+
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ C(ue, { gap: "8px", rowGap: "8px", children: [
|
|
779
794
|
l.customUserActions && l.customUserActionsPosition === "left" ? l.customUserActions : null,
|
|
780
795
|
l.onAddExecute ? /* @__PURE__ */ e(
|
|
781
|
-
|
|
796
|
+
ne,
|
|
782
797
|
{
|
|
783
798
|
actionName: "add",
|
|
784
|
-
actionDescription: `Adicionar novo ${
|
|
799
|
+
actionDescription: `Adicionar novo ${oe || "registro"}`,
|
|
785
800
|
color: "green",
|
|
786
|
-
variant:
|
|
787
|
-
leftSection: /* @__PURE__ */ e(
|
|
801
|
+
variant: N ?? he.variant,
|
|
802
|
+
leftSection: /* @__PURE__ */ e(Qe, {}),
|
|
788
803
|
onClick: () => l && l.onAddExecute && l.onAddExecute(),
|
|
789
804
|
children: l.labelAdd || m().t("archbase:New")
|
|
790
805
|
}
|
|
791
806
|
) : null,
|
|
792
807
|
l.onEditExecute ? /* @__PURE__ */ e(
|
|
793
|
-
|
|
808
|
+
ne,
|
|
794
809
|
{
|
|
795
810
|
actionName: "edit",
|
|
796
|
-
actionDescription: `Editar ${
|
|
811
|
+
actionDescription: `Editar ${oe || "registro"}`,
|
|
797
812
|
color: "blue",
|
|
798
|
-
leftSection: /* @__PURE__ */ e(
|
|
813
|
+
leftSection: /* @__PURE__ */ e(Xe, {}),
|
|
799
814
|
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
800
|
-
variant:
|
|
815
|
+
variant: N ?? he.variant,
|
|
801
816
|
onClick: () => l && l.onEditExecute && l.onEditExecute(),
|
|
802
817
|
children: l.labelEdit || m().t("archbase:Edit")
|
|
803
818
|
}
|
|
804
819
|
) : null,
|
|
805
820
|
l.onRemoveExecute ? /* @__PURE__ */ e(
|
|
806
|
-
|
|
821
|
+
ne,
|
|
807
822
|
{
|
|
808
823
|
actionName: "delete",
|
|
809
|
-
actionDescription: `Remover ${
|
|
824
|
+
actionDescription: `Remover ${oe || "registro"}`,
|
|
810
825
|
color: "red",
|
|
811
|
-
leftSection: /* @__PURE__ */ e(
|
|
826
|
+
leftSection: /* @__PURE__ */ e(Ye, {}),
|
|
812
827
|
disabled: !l?.allowRemove || !n.isBrowsing() || n.isEmpty(),
|
|
813
|
-
variant:
|
|
828
|
+
variant: N ?? he.variant,
|
|
814
829
|
onClick: () => l && l.onRemoveExecute && l.onRemoveExecute(),
|
|
815
830
|
children: l.labelRemove || m().t("archbase:Remove")
|
|
816
831
|
}
|
|
817
832
|
) : null,
|
|
818
833
|
l.onViewExecute ? /* @__PURE__ */ e(
|
|
819
|
-
|
|
834
|
+
ne,
|
|
820
835
|
{
|
|
821
836
|
actionName: "view",
|
|
822
|
-
actionDescription: `Visualizar ${
|
|
837
|
+
actionDescription: `Visualizar ${oe || "registro"}`,
|
|
823
838
|
color: "gray.7",
|
|
824
|
-
leftSection: /* @__PURE__ */ e(
|
|
839
|
+
leftSection: /* @__PURE__ */ e(Ze, {}),
|
|
825
840
|
disabled: !n.isBrowsing() || n.isEmpty(),
|
|
826
|
-
variant:
|
|
841
|
+
variant: N ?? he.variant,
|
|
827
842
|
onClick: () => l && l.onViewExecute && l.onViewExecute(),
|
|
828
843
|
children: l.labelView || m().t("archbase:View")
|
|
829
844
|
}
|
|
@@ -838,8 +853,8 @@ function qt(t, r) {
|
|
|
838
853
|
}
|
|
839
854
|
);
|
|
840
855
|
}
|
|
841
|
-
const
|
|
842
|
-
function
|
|
856
|
+
const wr = Nt(Xt);
|
|
857
|
+
function Yt(t, r, a, d) {
|
|
843
858
|
if (t && t.headerGridColumns) {
|
|
844
859
|
const n = t.headerGridColumns.left ? t.headerGridColumns.left : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, o = t.headerGridColumns.middle ? t.headerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.headerGridColumns.right ? t.headerGridColumns.right : { xs: "auto", sm: "auto", md: "auto", lg: "auto" };
|
|
845
860
|
return /* @__PURE__ */ C(me, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
@@ -899,9 +914,9 @@ function _t(t, r, a, d) {
|
|
|
899
914
|
] });
|
|
900
915
|
} else {
|
|
901
916
|
const n = t && t.headerFlexGrow ? t.headerFlexGrow : "even", o = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end", u = t && t.headerFlexLeftJustifyContent ? t.headerFlexLeftJustifyContent : "flex-start";
|
|
902
|
-
return /* @__PURE__ */ C(
|
|
917
|
+
return /* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
903
918
|
/* @__PURE__ */ e(
|
|
904
|
-
|
|
919
|
+
ue,
|
|
905
920
|
{
|
|
906
921
|
w: n === "left" || n === "even" ? "100%" : void 0,
|
|
907
922
|
maw: n === "left" || n === "even" ? void 0 : "100%",
|
|
@@ -914,7 +929,7 @@ function _t(t, r, a, d) {
|
|
|
914
929
|
}
|
|
915
930
|
),
|
|
916
931
|
/* @__PURE__ */ e(
|
|
917
|
-
|
|
932
|
+
ue,
|
|
918
933
|
{
|
|
919
934
|
w: n === "right" || n === "even" ? "100%" : void 0,
|
|
920
935
|
maw: n === "right" || n === "even" ? void 0 : "100%",
|
|
@@ -929,7 +944,7 @@ function _t(t, r, a, d) {
|
|
|
929
944
|
] });
|
|
930
945
|
}
|
|
931
946
|
}
|
|
932
|
-
function
|
|
947
|
+
function Zt(t, r, a, d) {
|
|
933
948
|
if (t && t.footerGridColumns) {
|
|
934
949
|
const n = t.footerGridColumns.left ? t.footerGridColumns.left : { xs: "content", sm: "content", md: "content", lg: "content" }, o = t.footerGridColumns.middle ? t.footerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.footerGridColumns.right ? t.footerGridColumns.right : { xs: "content", sm: "content", md: "content", lg: "content" };
|
|
935
950
|
return /* @__PURE__ */ C(me, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
@@ -989,9 +1004,9 @@ function Jt(t, r, a, d) {
|
|
|
989
1004
|
] });
|
|
990
1005
|
} else {
|
|
991
1006
|
const n = t && t.footerFlexGrow ? t.footerFlexGrow : "even", o = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end", u = t && t.footerFlexLeftJustifyContent ? t.footerFlexLeftJustifyContent : "flex-start";
|
|
992
|
-
return /* @__PURE__ */ C(
|
|
1007
|
+
return /* @__PURE__ */ C(ue, { justify: "space-between", children: [
|
|
993
1008
|
/* @__PURE__ */ e(
|
|
994
|
-
|
|
1009
|
+
ue,
|
|
995
1010
|
{
|
|
996
1011
|
w: n === "left" || n === "even" ? "100%" : void 0,
|
|
997
1012
|
maw: n === "left" || n === "even" ? void 0 : "100%",
|
|
@@ -1006,7 +1021,7 @@ function Jt(t, r, a, d) {
|
|
|
1006
1021
|
}
|
|
1007
1022
|
),
|
|
1008
1023
|
/* @__PURE__ */ e(
|
|
1009
|
-
|
|
1024
|
+
ue,
|
|
1010
1025
|
{
|
|
1011
1026
|
w: n === "right" || n === "even" ? "100%" : void 0,
|
|
1012
1027
|
maw: n === "right" || n === "even" ? void 0 : "100%",
|
|
@@ -1023,7 +1038,7 @@ function Jt(t, r, a, d) {
|
|
|
1023
1038
|
] });
|
|
1024
1039
|
}
|
|
1025
1040
|
}
|
|
1026
|
-
function
|
|
1041
|
+
function wt({
|
|
1027
1042
|
title: t,
|
|
1028
1043
|
innerRef: r,
|
|
1029
1044
|
isError: a = !1,
|
|
@@ -1032,19 +1047,19 @@ function vt({
|
|
|
1032
1047
|
width: o = "100%",
|
|
1033
1048
|
height: u = "100%",
|
|
1034
1049
|
withBorder: f = !0,
|
|
1035
|
-
children:
|
|
1050
|
+
children: I,
|
|
1036
1051
|
radius: v,
|
|
1037
|
-
debug:
|
|
1052
|
+
debug: ee,
|
|
1038
1053
|
defaultDebug: l,
|
|
1039
1054
|
headerLeft: c,
|
|
1040
|
-
headerMiddle:
|
|
1055
|
+
headerMiddle: M,
|
|
1041
1056
|
headerRight: A,
|
|
1042
|
-
footerLeft:
|
|
1057
|
+
footerLeft: T,
|
|
1043
1058
|
footerMiddle: h,
|
|
1044
1059
|
footerRight: B,
|
|
1045
|
-
variant:
|
|
1046
|
-
options:
|
|
1047
|
-
style:
|
|
1060
|
+
variant: q,
|
|
1061
|
+
options: P = {},
|
|
1062
|
+
style: X,
|
|
1048
1063
|
debugOptions: b = {
|
|
1049
1064
|
debugLayoutHotKey: "ctrl+shift+S",
|
|
1050
1065
|
debugObjectInspectorHotKey: "ctrl+shift+D",
|
|
@@ -1053,70 +1068,70 @@ function vt({
|
|
|
1053
1068
|
// Props de segurança (opcionais)
|
|
1054
1069
|
resourceName: x,
|
|
1055
1070
|
resourceDescription: y,
|
|
1056
|
-
requiredPermissions:
|
|
1057
|
-
fallbackComponent:
|
|
1058
|
-
securityOptions:
|
|
1071
|
+
requiredPermissions: Y,
|
|
1072
|
+
fallbackComponent: _,
|
|
1073
|
+
securityOptions: S
|
|
1059
1074
|
}) {
|
|
1060
|
-
const [
|
|
1061
|
-
value:
|
|
1075
|
+
const [V, F] = Tt({
|
|
1076
|
+
value: ee,
|
|
1062
1077
|
defaultValue: l,
|
|
1063
1078
|
finalValue: !1
|
|
1064
1079
|
});
|
|
1065
|
-
|
|
1066
|
-
const
|
|
1080
|
+
Vt([[b && b.debugLayoutHotKey, () => F(!V)]]);
|
|
1081
|
+
const N = Ae(), { t: w } = St();
|
|
1067
1082
|
ge({
|
|
1068
|
-
autoRegisterActions:
|
|
1083
|
+
autoRegisterActions: S?.autoRegisterActions ?? !0
|
|
1069
1084
|
});
|
|
1070
|
-
const
|
|
1071
|
-
height:
|
|
1072
|
-
width:
|
|
1073
|
-
}), [
|
|
1074
|
-
|
|
1075
|
-
l !==
|
|
1085
|
+
const G = ae(null), R = r || G, re = ae(null), H = ae(null), k = Ge(re), D = Ge(H), $ = Ge(R), J = we(() => ({
|
|
1086
|
+
height: $.height - k.height - D.height - Number(Et("0.625rem")),
|
|
1087
|
+
width: $.width - k.width - D.width
|
|
1088
|
+
}), [$.height, $.width, k.height, k.width, D.height, D.width]), U = ae(l);
|
|
1089
|
+
mt(() => {
|
|
1090
|
+
l !== U.current && (F(l), U.current = l);
|
|
1076
1091
|
}, [l, F]);
|
|
1077
|
-
const W = /* @__PURE__ */ C(
|
|
1092
|
+
const W = /* @__PURE__ */ C(Ie, { children: [
|
|
1078
1093
|
/* @__PURE__ */ e(
|
|
1079
|
-
|
|
1094
|
+
We,
|
|
1080
1095
|
{
|
|
1081
1096
|
ref: R,
|
|
1082
1097
|
withBorder: f,
|
|
1083
1098
|
radius: v,
|
|
1084
|
-
style: { width: o, height: u, padding: 4, ...
|
|
1085
|
-
children: /* @__PURE__ */ C(
|
|
1086
|
-
/* @__PURE__ */ e(
|
|
1087
|
-
/* @__PURE__ */ e(
|
|
1088
|
-
|
|
1099
|
+
style: { width: o, height: u, padding: 4, ...X },
|
|
1100
|
+
children: /* @__PURE__ */ C(tt, { height: "100%", children: [
|
|
1101
|
+
/* @__PURE__ */ e(vt, { size: k.height, children: /* @__PURE__ */ e("div", { ref: re, children: Yt(P, c, A, V) }) }),
|
|
1102
|
+
/* @__PURE__ */ e(rt, { children: /* @__PURE__ */ e(
|
|
1103
|
+
st,
|
|
1089
1104
|
{
|
|
1090
|
-
h:
|
|
1105
|
+
h: J.height,
|
|
1091
1106
|
style: {
|
|
1092
|
-
border:
|
|
1107
|
+
border: V ? "1px dashed" : "",
|
|
1093
1108
|
padding: "calc(0.625rem / 2)"
|
|
1094
1109
|
},
|
|
1095
|
-
children:
|
|
1110
|
+
children: I ? /* @__PURE__ */ C($t, { children: [
|
|
1096
1111
|
a && /* @__PURE__ */ e(
|
|
1097
|
-
|
|
1112
|
+
je,
|
|
1098
1113
|
{
|
|
1099
1114
|
autoClose: 2e4,
|
|
1100
1115
|
withCloseButton: !0,
|
|
1101
1116
|
withBorder: !0,
|
|
1102
|
-
icon: /* @__PURE__ */ e(
|
|
1117
|
+
icon: /* @__PURE__ */ e(Ue, { size: "1.4rem" }),
|
|
1103
1118
|
title: `${w("WARNING")}`,
|
|
1104
1119
|
titleColor: "rgb(250, 82, 82)",
|
|
1105
|
-
variant:
|
|
1120
|
+
variant: q ?? N.variant,
|
|
1106
1121
|
onClose: () => n && n(),
|
|
1107
1122
|
children: /* @__PURE__ */ e("span", { children: d })
|
|
1108
1123
|
}
|
|
1109
1124
|
),
|
|
1110
|
-
|
|
1111
|
-
] }) :
|
|
1125
|
+
I
|
|
1126
|
+
] }) : V && /* @__PURE__ */ e(ue, { h: J.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(It, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
|
|
1112
1127
|
}
|
|
1113
1128
|
) }),
|
|
1114
|
-
/* @__PURE__ */ e(
|
|
1129
|
+
/* @__PURE__ */ e(nt, { size: D.height, children: /* @__PURE__ */ e("div", { ref: H, children: Zt(P, T, B, V) }) })
|
|
1115
1130
|
] })
|
|
1116
1131
|
}
|
|
1117
1132
|
),
|
|
1118
1133
|
/* @__PURE__ */ e(
|
|
1119
|
-
|
|
1134
|
+
kt,
|
|
1120
1135
|
{
|
|
1121
1136
|
debugObjectInspectorHotKey: b && b.debugObjectInspectorHotKey,
|
|
1122
1137
|
objectsToInspect: b && b.objectsToInspect
|
|
@@ -1124,19 +1139,19 @@ function vt({
|
|
|
1124
1139
|
)
|
|
1125
1140
|
] });
|
|
1126
1141
|
return /* @__PURE__ */ e(
|
|
1127
|
-
|
|
1142
|
+
ye,
|
|
1128
1143
|
{
|
|
1129
1144
|
resourceName: x,
|
|
1130
1145
|
resourceDescription: y,
|
|
1131
|
-
requiredPermissions:
|
|
1132
|
-
fallbackComponent:
|
|
1133
|
-
onSecurityReady:
|
|
1134
|
-
onAccessDenied:
|
|
1146
|
+
requiredPermissions: Y,
|
|
1147
|
+
fallbackComponent: _,
|
|
1148
|
+
onSecurityReady: S?.onSecurityReady,
|
|
1149
|
+
onAccessDenied: S?.onAccessDenied,
|
|
1135
1150
|
children: W
|
|
1136
1151
|
}
|
|
1137
1152
|
);
|
|
1138
1153
|
}
|
|
1139
|
-
const
|
|
1154
|
+
const Ot = {
|
|
1140
1155
|
visible: !0,
|
|
1141
1156
|
allowAdd: !0,
|
|
1142
1157
|
allowEdit: !0,
|
|
@@ -1144,10 +1159,10 @@ const Ht = {
|
|
|
1144
1159
|
allowRemove: !0,
|
|
1145
1160
|
positionCustomUserActions: "after"
|
|
1146
1161
|
};
|
|
1147
|
-
function
|
|
1162
|
+
function er(t, r, a, d, n, o) {
|
|
1148
1163
|
console.log(`Render de "${t}" na fase "${r}": ${a}ms`);
|
|
1149
1164
|
}
|
|
1150
|
-
function
|
|
1165
|
+
function Ar({
|
|
1151
1166
|
title: t,
|
|
1152
1167
|
dataSource: r,
|
|
1153
1168
|
// dataSourceEdition,
|
|
@@ -1159,66 +1174,66 @@ function mr({
|
|
|
1159
1174
|
//isLoading = false,
|
|
1160
1175
|
debug: u = !1,
|
|
1161
1176
|
filterType: f = "normal",
|
|
1162
|
-
isError:
|
|
1177
|
+
isError: I = !1,
|
|
1163
1178
|
error: v = "",
|
|
1164
|
-
clearError:
|
|
1179
|
+
clearError: ee = () => {
|
|
1165
1180
|
},
|
|
1166
1181
|
width: l = "100%",
|
|
1167
1182
|
height: c = "100%",
|
|
1168
|
-
withBorder:
|
|
1183
|
+
withBorder: M = !0,
|
|
1169
1184
|
filterPersistenceDelegator: A,
|
|
1170
|
-
withPagination:
|
|
1185
|
+
withPagination: T = !0,
|
|
1171
1186
|
radius: h,
|
|
1172
1187
|
userActions: B,
|
|
1173
|
-
columnsCountBreakPoints:
|
|
1174
|
-
columnsCount:
|
|
1175
|
-
gutter:
|
|
1188
|
+
columnsCountBreakPoints: q,
|
|
1189
|
+
columnsCount: P,
|
|
1190
|
+
gutter: X,
|
|
1176
1191
|
component: b,
|
|
1177
1192
|
activeIndex: x,
|
|
1178
1193
|
activeBackgroundColor: y,
|
|
1179
|
-
activeColor:
|
|
1180
|
-
onItemEnter:
|
|
1181
|
-
onItemLeave:
|
|
1182
|
-
style:
|
|
1194
|
+
activeColor: Y,
|
|
1195
|
+
onItemEnter: _,
|
|
1196
|
+
onItemLeave: S,
|
|
1197
|
+
style: V,
|
|
1183
1198
|
actionsButtonsOptions: F,
|
|
1184
|
-
spaceOptions:
|
|
1199
|
+
spaceOptions: N,
|
|
1185
1200
|
variant: w,
|
|
1186
|
-
id:
|
|
1201
|
+
id: G = Wt("masonry"),
|
|
1187
1202
|
debugOptions: R,
|
|
1188
1203
|
// Props de segurança (opcionais)
|
|
1189
|
-
resourceName:
|
|
1204
|
+
resourceName: re,
|
|
1190
1205
|
resourceDescription: H,
|
|
1191
|
-
requiredPermissions:
|
|
1192
|
-
fallbackComponent:
|
|
1193
|
-
securityOptions:
|
|
1206
|
+
requiredPermissions: k,
|
|
1207
|
+
fallbackComponent: D,
|
|
1208
|
+
securityOptions: $
|
|
1194
1209
|
}) {
|
|
1195
|
-
const
|
|
1196
|
-
autoRegisterActions:
|
|
1197
|
-
}), [W] =
|
|
1210
|
+
const J = Ae(), U = ge({
|
|
1211
|
+
autoRegisterActions: $?.autoRegisterActions ?? !0
|
|
1212
|
+
}), [W] = te(G), E = o || ae(null), Z = ae(null), [fe, s] = te(r.getCurrentPage()), [z, O] = te(
|
|
1198
1213
|
x || (r && r.getTotalRecords() > 0 ? 0 : -1)
|
|
1199
1214
|
);
|
|
1200
|
-
|
|
1201
|
-
const [
|
|
1215
|
+
Ge(E);
|
|
1216
|
+
const [ie, oe] = te({
|
|
1202
1217
|
activeFilterIndex: -1,
|
|
1203
1218
|
expandedFilter: !1
|
|
1204
|
-
}), [
|
|
1205
|
-
isDataSourceV2:
|
|
1206
|
-
v1State: { forceUpdate:
|
|
1207
|
-
} =
|
|
1219
|
+
}), [K, Ce] = te(0), {
|
|
1220
|
+
isDataSourceV2: xe,
|
|
1221
|
+
v1State: { forceUpdate: Te }
|
|
1222
|
+
} = Pe(
|
|
1208
1223
|
"ArchbaseMasonryTemplate",
|
|
1209
1224
|
r
|
|
1210
1225
|
);
|
|
1211
|
-
|
|
1226
|
+
et({
|
|
1212
1227
|
dataSource: r,
|
|
1213
1228
|
listener: (i) => {
|
|
1214
|
-
(i.type === pe.afterRemove || i.type === pe.refreshData) && (
|
|
1229
|
+
(i.type === pe.afterRemove || i.type === pe.refreshData) && (Ce((p) => p + 1), xe || Te());
|
|
1215
1230
|
}
|
|
1216
1231
|
});
|
|
1217
|
-
const
|
|
1218
|
-
const i = { ...
|
|
1219
|
-
return i.allowAdd && i.onAddExecute && le() &&
|
|
1232
|
+
const Le = we(() => {
|
|
1233
|
+
const i = { ...Ot, ...B }, p = [], le = (se) => U.isAvailable ? (U.registerAction(), U.hasPermission()) : !0;
|
|
1234
|
+
return i.allowAdd && i.onAddExecute && le() && p.push({
|
|
1220
1235
|
id: "actAdd",
|
|
1221
|
-
icon: /* @__PURE__ */ e(
|
|
1236
|
+
icon: /* @__PURE__ */ e(Qe, {}),
|
|
1222
1237
|
color: "green",
|
|
1223
1238
|
label: i.labelAdd ? i.labelAdd : m().t("archbase:New"),
|
|
1224
1239
|
executeAction: () => {
|
|
@@ -1226,9 +1241,9 @@ function mr({
|
|
|
1226
1241
|
},
|
|
1227
1242
|
enabled: !0,
|
|
1228
1243
|
hint: `${m().t("archbase:Clique para criar um novo registro")}`
|
|
1229
|
-
}), i.allowEdit && i.onEditExecute && le() &&
|
|
1244
|
+
}), i.allowEdit && i.onEditExecute && le() && p.push({
|
|
1230
1245
|
id: "actEdit",
|
|
1231
|
-
icon: /* @__PURE__ */ e(
|
|
1246
|
+
icon: /* @__PURE__ */ e(Xe, {}),
|
|
1232
1247
|
color: "blue",
|
|
1233
1248
|
label: i.labelEdit ? i.labelEdit : m().t("archbase:Edit"),
|
|
1234
1249
|
executeAction: () => {
|
|
@@ -1236,9 +1251,9 @@ function mr({
|
|
|
1236
1251
|
},
|
|
1237
1252
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1238
1253
|
hint: `${m().t("archbase:Clique para editar o registro")}`
|
|
1239
|
-
}), i.allowRemove && i.onRemoveExecute && le() &&
|
|
1254
|
+
}), i.allowRemove && i.onRemoveExecute && le() && p.push({
|
|
1240
1255
|
id: "actRemove",
|
|
1241
|
-
icon: /* @__PURE__ */ e(
|
|
1256
|
+
icon: /* @__PURE__ */ e(Ye, {}),
|
|
1242
1257
|
color: "red",
|
|
1243
1258
|
label: i.labelRemove ? i.labelRemove : m().t("archbase:Remove"),
|
|
1244
1259
|
executeAction: () => {
|
|
@@ -1246,133 +1261,133 @@ function mr({
|
|
|
1246
1261
|
},
|
|
1247
1262
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1248
1263
|
hint: `${m().t("archbase:Clique para remover o registro")}`
|
|
1249
|
-
}), i.allowView && i.onViewExecute && le() &&
|
|
1264
|
+
}), i.allowView && i.onViewExecute && le() && p.push({
|
|
1250
1265
|
id: "actView",
|
|
1251
|
-
icon: /* @__PURE__ */ e(
|
|
1266
|
+
icon: /* @__PURE__ */ e(Ze, {}),
|
|
1252
1267
|
label: i.labelView ? i.labelView : m().t("archbase:View"),
|
|
1253
1268
|
executeAction: () => {
|
|
1254
1269
|
i && i.onViewExecute && i.onViewExecute();
|
|
1255
1270
|
},
|
|
1256
1271
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1257
1272
|
hint: `${m().t("archbase:Clique para visualizar o registro")}`
|
|
1258
|
-
}), i.customUserActions && i.positionCustomUserActions === "before" ? [...i.customUserActions, ...
|
|
1259
|
-
}, [B, r,
|
|
1273
|
+
}), i.customUserActions && i.positionCustomUserActions === "before" ? [...i.customUserActions, ...p] : i.customUserActions && i.positionCustomUserActions === "after" ? [...p, ...i.customUserActions] : p;
|
|
1274
|
+
}, [B, r, U]), Me = we(() => {
|
|
1260
1275
|
if (b) {
|
|
1261
1276
|
const i = b.type;
|
|
1262
|
-
let
|
|
1263
|
-
return b.props && (
|
|
1264
|
-
const
|
|
1265
|
-
let
|
|
1266
|
-
return
|
|
1277
|
+
let p = {};
|
|
1278
|
+
return b.props && (p = b.props), r.browseRecords().map((le, se) => {
|
|
1279
|
+
const Je = `${W}_${se}`, Ve = `${W}_${se}`;
|
|
1280
|
+
let ve = le.active === void 0 ? !1 : le.active;
|
|
1281
|
+
return z >= 0 && (ve = !1, z === se && (ve = !0)), /* @__PURE__ */ e(
|
|
1267
1282
|
i,
|
|
1268
1283
|
{
|
|
1269
|
-
id:
|
|
1270
|
-
active:
|
|
1284
|
+
id: Ve,
|
|
1285
|
+
active: ve,
|
|
1271
1286
|
index: se,
|
|
1272
1287
|
dataSource: r,
|
|
1273
1288
|
recordData: le,
|
|
1274
1289
|
disabled: le.disabled,
|
|
1275
|
-
...
|
|
1290
|
+
...p
|
|
1276
1291
|
},
|
|
1277
|
-
|
|
1292
|
+
Je
|
|
1278
1293
|
);
|
|
1279
1294
|
});
|
|
1280
1295
|
}
|
|
1281
1296
|
return [];
|
|
1282
|
-
}, [
|
|
1283
|
-
|
|
1284
|
-
},
|
|
1285
|
-
|
|
1286
|
-
},
|
|
1287
|
-
|
|
1288
|
-
},
|
|
1289
|
-
},
|
|
1290
|
-
O(i), r && r.gotoRecordByData(
|
|
1291
|
-
},
|
|
1297
|
+
}, [z, b, W, r, K]), ke = (i, p) => {
|
|
1298
|
+
oe({ ...ie, currentFilter: i, activeFilterIndex: p });
|
|
1299
|
+
}, ze = (i) => {
|
|
1300
|
+
oe({ ...ie, expandedFilter: i });
|
|
1301
|
+
}, qe = (i, p) => {
|
|
1302
|
+
oe({ ...ie, currentFilter: i, activeFilterIndex: p });
|
|
1303
|
+
}, _e = () => {
|
|
1304
|
+
}, j = (i, p) => {
|
|
1305
|
+
O(i), r && r.gotoRecordByData(p);
|
|
1306
|
+
}, lt = (i) => {
|
|
1292
1307
|
if (r) {
|
|
1293
|
-
const
|
|
1294
|
-
|
|
1308
|
+
const p = r.getOptions();
|
|
1309
|
+
p.filter = i, p.currentPage = fe, r.refreshData(p), xe || Te();
|
|
1295
1310
|
}
|
|
1296
|
-
},
|
|
1311
|
+
}, Fe = (i) => {
|
|
1297
1312
|
if (r) {
|
|
1298
|
-
const
|
|
1299
|
-
|
|
1313
|
+
const p = r.getOptions();
|
|
1314
|
+
p.currentPage = i, r.refreshData(p), xe || Te();
|
|
1300
1315
|
}
|
|
1301
|
-
},
|
|
1302
|
-
|
|
1316
|
+
}, L = () => f === "normal" && d ? /* @__PURE__ */ e(
|
|
1317
|
+
Jt,
|
|
1303
1318
|
{
|
|
1304
1319
|
searchableFields: d,
|
|
1305
|
-
onFilter:
|
|
1320
|
+
onFilter: lt,
|
|
1306
1321
|
minFilterValueLength: 1
|
|
1307
1322
|
}
|
|
1308
|
-
) : f === "advanced" ? /* @__PURE__ */ e(
|
|
1309
|
-
|
|
1323
|
+
) : f === "advanced" ? /* @__PURE__ */ e(Ut, { id: `profile_${a.componentName}`, onRender: er, children: /* @__PURE__ */ e(
|
|
1324
|
+
it,
|
|
1310
1325
|
{
|
|
1311
1326
|
id: a.componentName,
|
|
1312
1327
|
viewName: a.viewName,
|
|
1313
1328
|
apiVersion: a.apiVersion,
|
|
1314
|
-
ref:
|
|
1315
|
-
variant: w ||
|
|
1316
|
-
expandedFilter:
|
|
1329
|
+
ref: Z,
|
|
1330
|
+
variant: w || J.variant,
|
|
1331
|
+
expandedFilter: ie.expandedFilter,
|
|
1317
1332
|
persistenceDelegator: A,
|
|
1318
|
-
currentFilter:
|
|
1319
|
-
activeFilterIndex:
|
|
1320
|
-
onSelectedFilter:
|
|
1321
|
-
onFilterChanged:
|
|
1322
|
-
onSearchByFilter:
|
|
1323
|
-
onToggleExpandedFilter:
|
|
1333
|
+
currentFilter: ie.currentFilter,
|
|
1334
|
+
activeFilterIndex: ie.activeFilterIndex,
|
|
1335
|
+
onSelectedFilter: qe,
|
|
1336
|
+
onFilterChanged: ke,
|
|
1337
|
+
onSearchByFilter: _e,
|
|
1338
|
+
onToggleExpandedFilter: ze,
|
|
1324
1339
|
width: "660px",
|
|
1325
1340
|
height: "170px",
|
|
1326
1341
|
children: n
|
|
1327
1342
|
}
|
|
1328
|
-
) }) : /* @__PURE__ */ e(
|
|
1343
|
+
) }) : /* @__PURE__ */ e(Ie, {}), Re = {
|
|
1329
1344
|
menuButtonColor: "blue.5",
|
|
1330
1345
|
menuPosition: "left"
|
|
1331
|
-
},
|
|
1346
|
+
}, He = {
|
|
1332
1347
|
headerFlexGrow: "left",
|
|
1333
1348
|
footerGridColumns: {}
|
|
1334
|
-
},
|
|
1349
|
+
}, he = { ...Re, ...F }, Ee = { ...He, ...N };
|
|
1335
1350
|
return /* @__PURE__ */ e(
|
|
1336
|
-
|
|
1351
|
+
ye,
|
|
1337
1352
|
{
|
|
1338
|
-
resourceName:
|
|
1353
|
+
resourceName: re,
|
|
1339
1354
|
resourceDescription: H,
|
|
1340
|
-
requiredPermissions:
|
|
1341
|
-
fallbackComponent:
|
|
1342
|
-
onSecurityReady:
|
|
1343
|
-
onAccessDenied:
|
|
1355
|
+
requiredPermissions: k,
|
|
1356
|
+
fallbackComponent: D,
|
|
1357
|
+
onSecurityReady: $?.onSecurityReady,
|
|
1358
|
+
onAccessDenied: $?.onAccessDenied,
|
|
1344
1359
|
children: /* @__PURE__ */ e(
|
|
1345
|
-
|
|
1360
|
+
wt,
|
|
1346
1361
|
{
|
|
1347
1362
|
innerRef: E,
|
|
1348
1363
|
width: l,
|
|
1349
1364
|
height: c,
|
|
1350
1365
|
radius: h,
|
|
1351
|
-
withBorder:
|
|
1352
|
-
isError:
|
|
1366
|
+
withBorder: M,
|
|
1367
|
+
isError: I,
|
|
1353
1368
|
error: v,
|
|
1354
|
-
clearError:
|
|
1369
|
+
clearError: ee,
|
|
1355
1370
|
title: t,
|
|
1356
1371
|
defaultDebug: u,
|
|
1357
1372
|
debugOptions: R,
|
|
1358
|
-
style:
|
|
1359
|
-
options:
|
|
1360
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1361
|
-
headerRight:
|
|
1362
|
-
footerRight:
|
|
1373
|
+
style: V,
|
|
1374
|
+
options: Ee,
|
|
1375
|
+
headerLeft: /* @__PURE__ */ e(xt, { actions: Le, options: he }),
|
|
1376
|
+
headerRight: L(),
|
|
1377
|
+
footerRight: T ? /* @__PURE__ */ e(dt, { total: r.getTotalPages(), onChange: Fe }) : void 0,
|
|
1363
1378
|
children: /* @__PURE__ */ e(
|
|
1364
|
-
|
|
1379
|
+
zt,
|
|
1365
1380
|
{
|
|
1366
1381
|
value: {
|
|
1367
1382
|
dataSource: r,
|
|
1368
|
-
ownerId:
|
|
1369
|
-
handleSelectItem:
|
|
1383
|
+
ownerId: G,
|
|
1384
|
+
handleSelectItem: j,
|
|
1370
1385
|
activeBackgroundColor: y,
|
|
1371
|
-
activeColor:
|
|
1372
|
-
onItemEnter:
|
|
1373
|
-
onItemLeave:
|
|
1386
|
+
activeColor: Y,
|
|
1387
|
+
onItemEnter: _,
|
|
1388
|
+
onItemLeave: S
|
|
1374
1389
|
},
|
|
1375
|
-
children: /* @__PURE__ */ e(
|
|
1390
|
+
children: /* @__PURE__ */ e(qt, { columnsCountBreakPoints: q, children: /* @__PURE__ */ e(_t, { gutter: X, columnsCount: P, children: Me }) })
|
|
1376
1391
|
}
|
|
1377
1392
|
)
|
|
1378
1393
|
}
|
|
@@ -1380,7 +1395,7 @@ function mr({
|
|
|
1380
1395
|
}
|
|
1381
1396
|
);
|
|
1382
1397
|
}
|
|
1383
|
-
const
|
|
1398
|
+
const tr = {
|
|
1384
1399
|
visible: !0,
|
|
1385
1400
|
allowAdd: !0,
|
|
1386
1401
|
allowEdit: !0,
|
|
@@ -1388,7 +1403,7 @@ const Kt = {
|
|
|
1388
1403
|
allowRemove: !0,
|
|
1389
1404
|
positionCustomUserActions: "after"
|
|
1390
1405
|
};
|
|
1391
|
-
function
|
|
1406
|
+
function yr({
|
|
1392
1407
|
title: t,
|
|
1393
1408
|
dataSource: r,
|
|
1394
1409
|
// dataSourceEdition,
|
|
@@ -1401,43 +1416,43 @@ function pr({
|
|
|
1401
1416
|
error: u = "",
|
|
1402
1417
|
clearError: f = () => {
|
|
1403
1418
|
},
|
|
1404
|
-
width:
|
|
1419
|
+
width: I = "100%",
|
|
1405
1420
|
height: v = "100%",
|
|
1406
|
-
withBorder:
|
|
1421
|
+
withBorder: ee = !0,
|
|
1407
1422
|
filterPersistenceDelegator: l,
|
|
1408
1423
|
withPagination: c = !0,
|
|
1409
|
-
children:
|
|
1424
|
+
children: M,
|
|
1410
1425
|
radius: A,
|
|
1411
|
-
userActions:
|
|
1426
|
+
userActions: T,
|
|
1412
1427
|
debug: h = !1,
|
|
1413
1428
|
variant: B,
|
|
1414
|
-
actionsButtonsOptions:
|
|
1415
|
-
spaceOptions:
|
|
1416
|
-
style:
|
|
1429
|
+
actionsButtonsOptions: q,
|
|
1430
|
+
spaceOptions: P,
|
|
1431
|
+
style: X,
|
|
1417
1432
|
debugOptions: b,
|
|
1418
1433
|
// Props de segurança (opcionais)
|
|
1419
1434
|
resourceName: x,
|
|
1420
1435
|
resourceDescription: y,
|
|
1421
|
-
requiredPermissions:
|
|
1422
|
-
fallbackComponent:
|
|
1423
|
-
securityOptions:
|
|
1436
|
+
requiredPermissions: Y,
|
|
1437
|
+
fallbackComponent: _,
|
|
1438
|
+
securityOptions: S
|
|
1424
1439
|
}) {
|
|
1425
|
-
const
|
|
1426
|
-
autoRegisterActions:
|
|
1427
|
-
}),
|
|
1440
|
+
const V = Ae(), F = ge({
|
|
1441
|
+
autoRegisterActions: S?.autoRegisterActions ?? !0
|
|
1442
|
+
}), N = n || ae(null), w = ae(null), [G, R] = te({
|
|
1428
1443
|
activeFilterIndex: -1,
|
|
1429
1444
|
expandedFilter: !1
|
|
1430
1445
|
}), {
|
|
1431
|
-
isDataSourceV2:
|
|
1446
|
+
isDataSourceV2: re,
|
|
1432
1447
|
v1State: { forceUpdate: H }
|
|
1433
|
-
} =
|
|
1448
|
+
} = Pe(
|
|
1434
1449
|
"ArchbasePanelTemplate",
|
|
1435
1450
|
r
|
|
1436
|
-
),
|
|
1437
|
-
const s = { ...
|
|
1438
|
-
return s.allowAdd && s.onAddExecute &&
|
|
1451
|
+
), k = we(() => {
|
|
1452
|
+
const s = { ...tr, ...T }, z = (ie) => F.isAvailable ? (F.registerAction(), F.hasPermission()) : !0, O = [];
|
|
1453
|
+
return s.allowAdd && s.onAddExecute && z() && O.push({
|
|
1439
1454
|
id: "1",
|
|
1440
|
-
icon: /* @__PURE__ */ e(
|
|
1455
|
+
icon: /* @__PURE__ */ e(Qe, {}),
|
|
1441
1456
|
color: "green",
|
|
1442
1457
|
label: s.labelAdd ? s.labelAdd : m().t("archbase:New"),
|
|
1443
1458
|
executeAction: () => {
|
|
@@ -1445,9 +1460,9 @@ function pr({
|
|
|
1445
1460
|
},
|
|
1446
1461
|
enabled: !0,
|
|
1447
1462
|
hint: "Clique para criar."
|
|
1448
|
-
}), s.allowEdit && s.onEditExecute &&
|
|
1463
|
+
}), s.allowEdit && s.onEditExecute && z() && O.push({
|
|
1449
1464
|
id: "2",
|
|
1450
|
-
icon: /* @__PURE__ */ e(
|
|
1465
|
+
icon: /* @__PURE__ */ e(Xe, {}),
|
|
1451
1466
|
color: "blue",
|
|
1452
1467
|
label: s.labelEdit ? s.labelEdit : m().t("archbase:Edit"),
|
|
1453
1468
|
executeAction: () => {
|
|
@@ -1455,9 +1470,9 @@ function pr({
|
|
|
1455
1470
|
},
|
|
1456
1471
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1457
1472
|
hint: "Clique para editar."
|
|
1458
|
-
}), s.allowRemove && s.onRemoveExecute &&
|
|
1473
|
+
}), s.allowRemove && s.onRemoveExecute && z() && O.push({
|
|
1459
1474
|
id: "3",
|
|
1460
|
-
icon: /* @__PURE__ */ e(
|
|
1475
|
+
icon: /* @__PURE__ */ e(Ye, {}),
|
|
1461
1476
|
color: "red",
|
|
1462
1477
|
label: s.labelRemove ? s.labelRemove : m().t("archbase:Remove"),
|
|
1463
1478
|
executeAction: () => {
|
|
@@ -1465,9 +1480,9 @@ function pr({
|
|
|
1465
1480
|
},
|
|
1466
1481
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1467
1482
|
hint: "Clique para remover."
|
|
1468
|
-
}), s.allowView && s.onView &&
|
|
1483
|
+
}), s.allowView && s.onView && z() && O.push({
|
|
1469
1484
|
id: "4",
|
|
1470
|
-
icon: /* @__PURE__ */ e(
|
|
1485
|
+
icon: /* @__PURE__ */ e(Ze, {}),
|
|
1471
1486
|
color: "green",
|
|
1472
1487
|
label: s.labelView ? s.labelView : m().t("archbase:View"),
|
|
1473
1488
|
executeAction: () => {
|
|
@@ -1476,13 +1491,13 @@ function pr({
|
|
|
1476
1491
|
enabled: !r.isEmpty() && r.isBrowsing(),
|
|
1477
1492
|
hint: "Clique para visualizar."
|
|
1478
1493
|
}), s.customUserActions && s.positionCustomUserActions === "before" ? [...s.customUserActions, ...O] : s.customUserActions && s.positionCustomUserActions === "after" ? [...O, ...s.customUserActions] : O;
|
|
1479
|
-
}, [
|
|
1480
|
-
R({
|
|
1481
|
-
},
|
|
1482
|
-
R({
|
|
1483
|
-
},
|
|
1484
|
-
R({
|
|
1485
|
-
},
|
|
1494
|
+
}, [T, r, F]), D = (s, z) => {
|
|
1495
|
+
R({ ...G, currentFilter: s, activeFilterIndex: z });
|
|
1496
|
+
}, $ = (s) => {
|
|
1497
|
+
R({ ...G, expandedFilter: s });
|
|
1498
|
+
}, J = (s, z) => {
|
|
1499
|
+
R({ ...G, currentFilter: s, activeFilterIndex: z });
|
|
1500
|
+
}, U = () => {
|
|
1486
1501
|
}, W = {
|
|
1487
1502
|
menuButtonColor: "blue.5",
|
|
1488
1503
|
menuPosition: "left"
|
|
@@ -1490,103 +1505,103 @@ function pr({
|
|
|
1490
1505
|
headerFlexGrow: "left",
|
|
1491
1506
|
footerFlexGrow: "right"
|
|
1492
1507
|
// footerGridColumns: {},
|
|
1493
|
-
},
|
|
1508
|
+
}, Z = { ...W, ...q }, fe = { ...E, ...P };
|
|
1494
1509
|
return /* @__PURE__ */ e(
|
|
1495
|
-
|
|
1510
|
+
ye,
|
|
1496
1511
|
{
|
|
1497
1512
|
resourceName: x,
|
|
1498
1513
|
resourceDescription: y,
|
|
1499
|
-
requiredPermissions:
|
|
1500
|
-
fallbackComponent:
|
|
1501
|
-
onSecurityReady:
|
|
1502
|
-
onAccessDenied:
|
|
1514
|
+
requiredPermissions: Y,
|
|
1515
|
+
fallbackComponent: _,
|
|
1516
|
+
onSecurityReady: S?.onSecurityReady,
|
|
1517
|
+
onAccessDenied: S?.onAccessDenied,
|
|
1503
1518
|
children: /* @__PURE__ */ e(
|
|
1504
|
-
|
|
1519
|
+
wt,
|
|
1505
1520
|
{
|
|
1506
|
-
innerRef:
|
|
1507
|
-
width:
|
|
1521
|
+
innerRef: N,
|
|
1522
|
+
width: I,
|
|
1508
1523
|
height: v,
|
|
1509
1524
|
radius: A,
|
|
1510
|
-
withBorder:
|
|
1525
|
+
withBorder: ee,
|
|
1511
1526
|
isError: o,
|
|
1512
1527
|
error: u,
|
|
1513
1528
|
clearError: f,
|
|
1514
1529
|
title: t,
|
|
1515
1530
|
defaultDebug: h,
|
|
1516
1531
|
debugOptions: b,
|
|
1517
|
-
style:
|
|
1518
|
-
options:
|
|
1519
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1532
|
+
style: X,
|
|
1533
|
+
options: fe,
|
|
1534
|
+
headerLeft: /* @__PURE__ */ e(xt, { actions: k, options: Z }),
|
|
1520
1535
|
headerRight: /* @__PURE__ */ e(
|
|
1521
|
-
|
|
1536
|
+
it,
|
|
1522
1537
|
{
|
|
1523
1538
|
id: a.componentName,
|
|
1524
1539
|
viewName: a.viewName,
|
|
1525
1540
|
apiVersion: a.apiVersion,
|
|
1526
1541
|
ref: w,
|
|
1527
|
-
variant: B ||
|
|
1528
|
-
expandedFilter:
|
|
1542
|
+
variant: B || V.variant,
|
|
1543
|
+
expandedFilter: G.expandedFilter,
|
|
1529
1544
|
persistenceDelegator: l,
|
|
1530
|
-
currentFilter:
|
|
1531
|
-
activeFilterIndex:
|
|
1532
|
-
onSelectedFilter:
|
|
1533
|
-
onFilterChanged:
|
|
1534
|
-
onSearchByFilter:
|
|
1535
|
-
onToggleExpandedFilter:
|
|
1545
|
+
currentFilter: G.currentFilter,
|
|
1546
|
+
activeFilterIndex: G.activeFilterIndex,
|
|
1547
|
+
onSelectedFilter: J,
|
|
1548
|
+
onFilterChanged: D,
|
|
1549
|
+
onSearchByFilter: U,
|
|
1550
|
+
onToggleExpandedFilter: $,
|
|
1536
1551
|
width: "660px",
|
|
1537
1552
|
height: "170px",
|
|
1538
1553
|
children: d
|
|
1539
1554
|
}
|
|
1540
1555
|
),
|
|
1541
|
-
footerRight: c && /* @__PURE__ */ e(
|
|
1542
|
-
children:
|
|
1556
|
+
footerRight: c && /* @__PURE__ */ e(dt, { total: 10 }),
|
|
1557
|
+
children: M
|
|
1543
1558
|
}
|
|
1544
1559
|
)
|
|
1545
1560
|
}
|
|
1546
1561
|
);
|
|
1547
1562
|
}
|
|
1548
|
-
function
|
|
1563
|
+
function Cr() {
|
|
1549
1564
|
return /* @__PURE__ */ e("div", { children: "SEARCH TEMPLATE" });
|
|
1550
1565
|
}
|
|
1551
|
-
const
|
|
1552
|
-
function
|
|
1553
|
-
const [r, a] =
|
|
1554
|
-
a((v) => ({ ...v, [f]:
|
|
1566
|
+
const ot = jt(void 0);
|
|
1567
|
+
function Fr({ children: t }) {
|
|
1568
|
+
const [r, a] = te({}), d = Ne((f, I) => {
|
|
1569
|
+
a((v) => ({ ...v, [f]: I }));
|
|
1555
1570
|
}, []), n = Ne((f) => {
|
|
1556
|
-
a((
|
|
1557
|
-
const v = { ...
|
|
1571
|
+
a((I) => {
|
|
1572
|
+
const v = { ...I };
|
|
1558
1573
|
return delete v[f], v;
|
|
1559
1574
|
});
|
|
1560
1575
|
}, []), o = Ne(() => {
|
|
1561
1576
|
a({});
|
|
1562
1577
|
}, []), u = Ne((f) => r[f], [r]);
|
|
1563
|
-
return /* @__PURE__ */ e(
|
|
1578
|
+
return /* @__PURE__ */ e(ot.Provider, { value: { errors: r, setError: d, clearError: n, clearAll: o, getError: u }, children: t });
|
|
1564
1579
|
}
|
|
1565
|
-
function
|
|
1566
|
-
return
|
|
1580
|
+
function Rr() {
|
|
1581
|
+
return pt(ot);
|
|
1567
1582
|
}
|
|
1568
|
-
function
|
|
1569
|
-
const t =
|
|
1583
|
+
function Er() {
|
|
1584
|
+
const t = pt(ot);
|
|
1570
1585
|
if (!t)
|
|
1571
1586
|
throw new Error("useRequiredValidationErrors must be used within ValidationErrorsProvider");
|
|
1572
1587
|
return t;
|
|
1573
1588
|
}
|
|
1574
1589
|
export {
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1590
|
+
pr as ArchbaseAdvancedSmartButton,
|
|
1591
|
+
ye as ArchbaseConditionalSecurityWrapper,
|
|
1592
|
+
vr as ArchbaseFormModalTemplate,
|
|
1593
|
+
xr as ArchbaseFormTemplate,
|
|
1594
|
+
wr as ArchbaseGridTemplate,
|
|
1595
|
+
Ar as ArchbaseMasonryTemplate,
|
|
1596
|
+
br as ArchbaseModalTemplate,
|
|
1597
|
+
yr as ArchbasePanelTemplate,
|
|
1598
|
+
Cr as ArchbaseSearchTemplate,
|
|
1599
|
+
ne as ArchbaseSmartActionButton,
|
|
1600
|
+
wt as ArchbaseSpaceTemplate,
|
|
1601
|
+
Fr as ValidationErrorsProvider,
|
|
1602
|
+
gr as useConditionalSecurity,
|
|
1588
1603
|
ge as useOptionalTemplateSecurity,
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1604
|
+
Er as useRequiredValidationErrors,
|
|
1605
|
+
mr as useTemplateSecurityAvailable,
|
|
1606
|
+
Rr as useValidationErrors
|
|
1592
1607
|
};
|