@archbase/template 3.0.7 → 3.0.9
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/archbase-template-3.0.9.tgz +0 -0
- package/dist/index.js +716 -718
- package/package.json +8 -8
- package/dist/archbase-template-3.0.7.tgz +0 -0
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as e, Fragment as $e, jsxs as C } from "react/jsx-runtime";
|
|
2
|
-
import { Button as
|
|
3
|
-
import { useForceUpdate as ht, useUncontrolled as
|
|
4
|
-
import { IconBug as
|
|
5
|
-
import { useArchbaseAppContext as
|
|
6
|
-
import
|
|
7
|
-
import { useArchbaseV1V2Compatibility as Le, useArchbaseDataSourceListener as
|
|
8
|
-
import { ArchbaseAlert as
|
|
9
|
-
import { ArchbaseSpaceFixed as
|
|
10
|
-
import { ArchbaseQueryBuilder as
|
|
11
|
-
import
|
|
12
|
-
import { uniqueId as
|
|
13
|
-
const
|
|
2
|
+
import { Button as Je, Paper as We, Box as Qe, ScrollArea as vt, LoadingOverlay as wt, Group as ce, useMantineColorScheme as Ze, Modal as ut, Flex as Ce, px as Bt, Text as ke, Grid as Ie, Pagination as At, Stack as Vt } from "@mantine/core";
|
|
3
|
+
import { useForceUpdate as ht, useUncontrolled as Pt, useHotkeys as Nt } from "@mantine/hooks";
|
|
4
|
+
import { IconBug as Oe, IconDeviceFloppy as kt, IconX as Ge, IconCheck as He, IconPlus as ft, IconEdit as mt, IconTrash as et, IconEye as gt } from "@tabler/icons-react";
|
|
5
|
+
import { useArchbaseAppContext as Te, useValidationErrors as Gt, ValidationErrorsProvider as yt, getI18nextInstance as g, processErrorMessage as xe, useArchbaseTheme as tt, emit as $t, useArchbaseTranslation as Lt } from "@archbase/core";
|
|
6
|
+
import _e, { useMemo as De, useState as q, useCallback as K, forwardRef as Ft, useRef as pe, useImperativeHandle as Rt, useEffect as Ye, Fragment as zt, Profiler as Ut, createContext as Mt, useContext as Et } from "react";
|
|
7
|
+
import { useArchbaseV1V2Compatibility as Le, useArchbaseDataSourceListener as nt, DataSourceEventNames as ye, ArchbaseDataSource as jt } from "@archbase/data";
|
|
8
|
+
import { ArchbaseAlert as Ke, ArchbaseDialog as pt, ArchbaseDataGrid as St, GridToolBarActions as qt, ArchbaseDebugInspector as Ht, ArchbaseMasonryProvider as _t, ArchbaseMasonryResponsive as Jt, ArchbaseMasonry as Wt, ArchbaseActionButtons as It } from "@archbase/components";
|
|
9
|
+
import { ArchbaseSpaceFixed as rt, ArchbaseSpaceTop as bt, ArchbaseSpaceFill as it, ArchbaseForm as Dt, ArchbaseSpaceBottom as ot } from "@archbase/layout";
|
|
10
|
+
import { ArchbaseQueryBuilder as xt, buildFrom as Ot, ArchbaseGlobalFilter as Kt } from "@archbase/advanced";
|
|
11
|
+
import Xe from "@rehooks/component-size";
|
|
12
|
+
import { uniqueId as Qt } from "lodash";
|
|
13
|
+
const Xt = {
|
|
14
14
|
isAvailable: !1,
|
|
15
15
|
hasPermission: () => !0,
|
|
16
16
|
// Default: sempre permite
|
|
@@ -21,36 +21,36 @@ const Yt = {
|
|
|
21
21
|
canEdit: !0,
|
|
22
22
|
canDelete: !0,
|
|
23
23
|
canView: !0
|
|
24
|
-
},
|
|
25
|
-
function
|
|
24
|
+
}, Ee = (t) => De(() => Xt, []), Cn = () => !1;
|
|
25
|
+
function vn(t) {
|
|
26
26
|
const {
|
|
27
27
|
onSelect: n,
|
|
28
|
-
onSelectMultiple:
|
|
28
|
+
onSelectMultiple: s,
|
|
29
29
|
initialValue: f = null,
|
|
30
30
|
initialValues: r = [],
|
|
31
31
|
selectionMode: i = "single",
|
|
32
32
|
autoClose: u = !0,
|
|
33
33
|
onOpen: b,
|
|
34
34
|
onClose: h
|
|
35
|
-
} = t || {}, [x,
|
|
36
|
-
|
|
35
|
+
} = t || {}, [x, k] = q(!1), [o, a] = q(f), [E, v] = q(r), F = K(() => {
|
|
36
|
+
k(!0), b?.();
|
|
37
37
|
}, [b]), m = K(() => {
|
|
38
|
-
|
|
39
|
-
}, [h]),
|
|
40
|
-
|
|
38
|
+
k(!1), h?.();
|
|
39
|
+
}, [h]), V = K(() => {
|
|
40
|
+
a(null), v([]);
|
|
41
41
|
}, []), R = K(
|
|
42
|
-
(
|
|
43
|
-
|
|
42
|
+
(p) => {
|
|
43
|
+
a(p), v([p]), n?.(p), u && (k(!1), h?.());
|
|
44
44
|
},
|
|
45
45
|
[n, u, h]
|
|
46
46
|
), S = K(
|
|
47
|
-
(
|
|
48
|
-
v(
|
|
47
|
+
(p) => {
|
|
48
|
+
v(p), a(p.length > 0 ? p[0] : null), s?.(p), u && (k(!1), h?.());
|
|
49
49
|
},
|
|
50
|
-
[
|
|
50
|
+
[s, u, h]
|
|
51
51
|
), z = K(() => {
|
|
52
|
-
|
|
53
|
-
}, [h]),
|
|
52
|
+
k(!1), h?.();
|
|
53
|
+
}, [h]), w = De(
|
|
54
54
|
() => ({
|
|
55
55
|
opened: x,
|
|
56
56
|
onClose: z,
|
|
@@ -69,57 +69,57 @@ function wn(t) {
|
|
|
69
69
|
// Ações
|
|
70
70
|
open: F,
|
|
71
71
|
close: m,
|
|
72
|
-
clear:
|
|
73
|
-
setSelectedItem:
|
|
72
|
+
clear: V,
|
|
73
|
+
setSelectedItem: a,
|
|
74
74
|
setSelectedItems: v,
|
|
75
75
|
// Handlers
|
|
76
76
|
handleSelect: R,
|
|
77
77
|
handleSelectMultiple: S,
|
|
78
78
|
handleClose: z,
|
|
79
79
|
// Props para template
|
|
80
|
-
lookupProps:
|
|
80
|
+
lookupProps: w
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
const he = ({
|
|
84
84
|
actionName: t,
|
|
85
85
|
actionDescription: n,
|
|
86
|
-
children:
|
|
86
|
+
children: s,
|
|
87
87
|
fallback: f = null,
|
|
88
88
|
autoRegister: r = !0,
|
|
89
89
|
onClick: i,
|
|
90
90
|
...u
|
|
91
91
|
}) => {
|
|
92
|
-
const b =
|
|
93
|
-
return
|
|
92
|
+
const b = Ee();
|
|
93
|
+
return _e.useEffect(() => {
|
|
94
94
|
r && t && n && b.isAvailable && b.registerAction();
|
|
95
|
-
}, [t, n, r, b.isAvailable, b.registerAction]), !t || !b.isAvailable ? /* @__PURE__ */ e(
|
|
96
|
-
},
|
|
95
|
+
}, [t, n, r, b.isAvailable, b.registerAction]), !t || !b.isAvailable ? /* @__PURE__ */ e(Je, { onClick: i, ...u, children: s }) : b.hasPermission() ? /* @__PURE__ */ e(Je, { onClick: i, ...u, children: s }) : /* @__PURE__ */ e($e, { children: f });
|
|
96
|
+
}, wn = ({
|
|
97
97
|
actionName: t,
|
|
98
98
|
actionDescription: n,
|
|
99
|
-
children:
|
|
99
|
+
children: s,
|
|
100
100
|
fallback: f = null,
|
|
101
101
|
onClick: r,
|
|
102
102
|
...i
|
|
103
103
|
}) => {
|
|
104
|
-
const [u, b] =
|
|
105
|
-
return
|
|
104
|
+
const [u, b] = _e.useState(null), [h, x] = _e.useState(!1);
|
|
105
|
+
return _e.useEffect(() => {
|
|
106
106
|
if (!t) {
|
|
107
|
-
b(/* @__PURE__ */ e(
|
|
107
|
+
b(/* @__PURE__ */ e(Je, { onClick: r, ...i, children: s }));
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
x(!1), b(/* @__PURE__ */ e(
|
|
111
|
-
}, [t, n,
|
|
112
|
-
},
|
|
110
|
+
x(!1), b(/* @__PURE__ */ e(Je, { onClick: r, ...i, children: s }));
|
|
111
|
+
}, [t, n, s, f, i]), /* @__PURE__ */ e($e, { children: u });
|
|
112
|
+
}, Be = ({
|
|
113
113
|
children: t
|
|
114
|
-
}) => /* @__PURE__ */ e($e, { children: t }),
|
|
114
|
+
}) => /* @__PURE__ */ e($e, { children: t }), An = (t) => De(() => ({
|
|
115
115
|
shouldWrap: !1,
|
|
116
116
|
isSecurityAvailable: !1,
|
|
117
117
|
hasResourceName: !!t
|
|
118
118
|
}), [t]);
|
|
119
|
-
function
|
|
119
|
+
function yn({
|
|
120
120
|
innerRef: t,
|
|
121
121
|
title: n,
|
|
122
|
-
isError:
|
|
122
|
+
isError: s = !1,
|
|
123
123
|
isCanceling: f = !1,
|
|
124
124
|
isSaving: r = !1,
|
|
125
125
|
error: i = "",
|
|
@@ -128,30 +128,30 @@ function Fn({
|
|
|
128
128
|
autoCloseAlertError: b = 15e3,
|
|
129
129
|
width: h = "100%",
|
|
130
130
|
height: x = "100%",
|
|
131
|
-
withBorder:
|
|
131
|
+
withBorder: k = !0,
|
|
132
132
|
children: o,
|
|
133
|
-
radius:
|
|
133
|
+
radius: a,
|
|
134
134
|
variant: E,
|
|
135
135
|
footerAlign: v = "left",
|
|
136
136
|
footerContent: F,
|
|
137
137
|
dataSource: m,
|
|
138
|
-
onSave:
|
|
138
|
+
onSave: V,
|
|
139
139
|
onCancel: R,
|
|
140
140
|
onBeforeSave: S,
|
|
141
141
|
onAfterSave: z,
|
|
142
|
-
onBeforeCancel:
|
|
143
|
-
onAfterCancel:
|
|
142
|
+
onBeforeCancel: w,
|
|
143
|
+
onAfterCancel: p,
|
|
144
144
|
onError: I,
|
|
145
145
|
// Props de segurança (opcionais)
|
|
146
|
-
resourceName:
|
|
147
|
-
resourceDescription:
|
|
146
|
+
resourceName: re,
|
|
147
|
+
resourceDescription: Z,
|
|
148
148
|
requiredPermissions: H,
|
|
149
149
|
fallbackComponent: G,
|
|
150
150
|
securityOptions: P,
|
|
151
151
|
...$
|
|
152
152
|
}) {
|
|
153
|
-
const D =
|
|
154
|
-
|
|
153
|
+
const D = Te(), [_, N] = q(s), [de, ee] = q(i), Q = ht();
|
|
154
|
+
Ee({
|
|
155
155
|
autoRegisterActions: P?.autoRegisterActions ?? !0
|
|
156
156
|
});
|
|
157
157
|
const U = Le(
|
|
@@ -160,46 +160,46 @@ function Fn({
|
|
|
160
160
|
void 0,
|
|
161
161
|
void 0
|
|
162
162
|
);
|
|
163
|
-
|
|
163
|
+
nt({
|
|
164
164
|
dataSource: m,
|
|
165
165
|
listener: (L) => {
|
|
166
|
-
L.type ===
|
|
166
|
+
L.type === ye.onError && (N(!0), ee(L.error)), (L.type === ye.afterEdit || L.type === ye.afterInsert) && (U.isDataSourceV2 || Q());
|
|
167
167
|
}
|
|
168
168
|
});
|
|
169
|
-
const M =
|
|
169
|
+
const M = Gt(), X = async (L) => {
|
|
170
170
|
try {
|
|
171
|
-
|
|
171
|
+
V ? V(L) : (S && await S(L), m.isBrowsing() || m.save().then(() => {
|
|
172
172
|
M?.clearAll(), z && z(L);
|
|
173
|
-
}).catch((
|
|
174
|
-
I && I(
|
|
173
|
+
}).catch((ie) => {
|
|
174
|
+
I && I(xe(ie)), N(!0), ee(xe(ie));
|
|
175
175
|
}));
|
|
176
|
-
} catch (
|
|
177
|
-
I && I(
|
|
176
|
+
} catch (ie) {
|
|
177
|
+
I && I(xe(ie)), N(!0), ee(xe(ie));
|
|
178
178
|
}
|
|
179
179
|
}, J = () => {
|
|
180
180
|
try {
|
|
181
|
-
R ? R() : (
|
|
181
|
+
R ? R() : (w && w(), m.isBrowsing() || m.cancel(), M?.clearAll(), p && p());
|
|
182
182
|
} catch (L) {
|
|
183
|
-
I && I(
|
|
183
|
+
I && I(xe(L)), N(!0), ee(xe(L));
|
|
184
184
|
}
|
|
185
185
|
}, W = () => {
|
|
186
|
-
u && u(),
|
|
186
|
+
u && u(), N(!1), ee("");
|
|
187
187
|
};
|
|
188
188
|
return /* @__PURE__ */ e(
|
|
189
|
-
|
|
189
|
+
Be,
|
|
190
190
|
{
|
|
191
|
-
resourceName:
|
|
192
|
-
resourceDescription:
|
|
191
|
+
resourceName: re,
|
|
192
|
+
resourceDescription: Z,
|
|
193
193
|
requiredPermissions: H,
|
|
194
194
|
fallbackComponent: G,
|
|
195
195
|
onSecurityReady: P?.onSecurityReady,
|
|
196
196
|
onAccessDenied: P?.onAccessDenied,
|
|
197
|
-
children: /* @__PURE__ */ e(
|
|
198
|
-
|
|
197
|
+
children: /* @__PURE__ */ e(yt, { children: /* @__PURE__ */ C(
|
|
198
|
+
We,
|
|
199
199
|
{
|
|
200
200
|
ref: t,
|
|
201
|
-
withBorder:
|
|
202
|
-
radius:
|
|
201
|
+
withBorder: k,
|
|
202
|
+
radius: a,
|
|
203
203
|
style: {
|
|
204
204
|
width: h,
|
|
205
205
|
height: x,
|
|
@@ -208,14 +208,14 @@ function Fn({
|
|
|
208
208
|
padding: 4
|
|
209
209
|
},
|
|
210
210
|
children: [
|
|
211
|
-
_ && /* @__PURE__ */ e(
|
|
212
|
-
|
|
211
|
+
_ && /* @__PURE__ */ e(Qe, { style: { flexShrink: 0 }, children: /* @__PURE__ */ e(
|
|
212
|
+
Ke,
|
|
213
213
|
{
|
|
214
214
|
autoClose: b,
|
|
215
215
|
withCloseButton: !0,
|
|
216
216
|
withBorder: !0,
|
|
217
|
-
icon: /* @__PURE__ */ e(
|
|
218
|
-
title:
|
|
217
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
218
|
+
title: g().t("WARNING"),
|
|
219
219
|
titleColor: "rgb(250, 82, 82)",
|
|
220
220
|
variant: E ?? D.variant,
|
|
221
221
|
onClose: W,
|
|
@@ -232,13 +232,13 @@ function Fn({
|
|
|
232
232
|
padding: "calc(0.625rem / 2)"
|
|
233
233
|
},
|
|
234
234
|
children: [
|
|
235
|
-
/* @__PURE__ */ e(
|
|
235
|
+
/* @__PURE__ */ e(wt, { visible: f || r, opacity: 0.3 }),
|
|
236
236
|
o
|
|
237
237
|
]
|
|
238
238
|
}
|
|
239
239
|
),
|
|
240
240
|
/* @__PURE__ */ C(
|
|
241
|
-
|
|
241
|
+
Qe,
|
|
242
242
|
{
|
|
243
243
|
style: {
|
|
244
244
|
flexShrink: 0,
|
|
@@ -249,19 +249,19 @@ function Fn({
|
|
|
249
249
|
gap: "1rem"
|
|
250
250
|
},
|
|
251
251
|
children: [
|
|
252
|
-
v === "right" && F && /* @__PURE__ */ e(
|
|
252
|
+
v === "right" && F && /* @__PURE__ */ e(Qe, { style: { flex: 1 }, children: F }),
|
|
253
253
|
m && !m.isBrowsing() ? /* @__PURE__ */ C(ce, { gap: "md", children: [
|
|
254
254
|
/* @__PURE__ */ e(
|
|
255
255
|
he,
|
|
256
256
|
{
|
|
257
257
|
actionName: "save",
|
|
258
|
-
actionDescription: `Salvar ${
|
|
259
|
-
leftSection: /* @__PURE__ */ e(
|
|
260
|
-
onClick: () =>
|
|
258
|
+
actionDescription: `Salvar ${Z || "registro"}`,
|
|
259
|
+
leftSection: /* @__PURE__ */ e(kt, {}),
|
|
260
|
+
onClick: () => X(m.getCurrentRecord()),
|
|
261
261
|
disabled: m && m.isBrowsing(),
|
|
262
262
|
variant: E ?? D.variant,
|
|
263
263
|
color: "green",
|
|
264
|
-
children: `${
|
|
264
|
+
children: `${g().t("Ok")}`
|
|
265
265
|
}
|
|
266
266
|
),
|
|
267
267
|
/* @__PURE__ */ e(
|
|
@@ -274,7 +274,7 @@ function Fn({
|
|
|
274
274
|
disabled: m && m.isBrowsing(),
|
|
275
275
|
variant: E ?? D.variant,
|
|
276
276
|
color: "red",
|
|
277
|
-
children: `${
|
|
277
|
+
children: `${g().t("Cancel")}`
|
|
278
278
|
}
|
|
279
279
|
)
|
|
280
280
|
] }) : /* @__PURE__ */ e(ce, { gap: "md", children: /* @__PURE__ */ e(
|
|
@@ -285,10 +285,10 @@ function Fn({
|
|
|
285
285
|
leftSection: /* @__PURE__ */ e(Ge, {}),
|
|
286
286
|
onClick: J,
|
|
287
287
|
variant: E ?? D.variant,
|
|
288
|
-
children: `${
|
|
288
|
+
children: `${g().t("Close")}`
|
|
289
289
|
}
|
|
290
290
|
) }),
|
|
291
|
-
(v === "left" || v === "center") && F && /* @__PURE__ */ e(
|
|
291
|
+
(v === "left" || v === "center") && F && /* @__PURE__ */ e(Qe, { style: { flex: v === "left" ? 1 : 0, textAlign: "right" }, children: F })
|
|
292
292
|
]
|
|
293
293
|
}
|
|
294
294
|
)
|
|
@@ -298,10 +298,10 @@ function Fn({
|
|
|
298
298
|
}
|
|
299
299
|
);
|
|
300
300
|
}
|
|
301
|
-
function
|
|
301
|
+
function Fn({
|
|
302
302
|
title: t,
|
|
303
303
|
withOverlay: n = !0,
|
|
304
|
-
overlayProps:
|
|
304
|
+
overlayProps: s,
|
|
305
305
|
children: f,
|
|
306
306
|
withCloseButton: r = !0,
|
|
307
307
|
closeButtonProps: i,
|
|
@@ -309,23 +309,23 @@ function Rn({
|
|
|
309
309
|
fullScreen: b,
|
|
310
310
|
centered: h,
|
|
311
311
|
variant: x,
|
|
312
|
-
closeOnEscape:
|
|
312
|
+
closeOnEscape: k = !0,
|
|
313
313
|
size: o,
|
|
314
|
-
dataSource:
|
|
314
|
+
dataSource: a,
|
|
315
315
|
height: E,
|
|
316
316
|
userActions: v,
|
|
317
317
|
onAfterSave: F,
|
|
318
318
|
onClickOk: m,
|
|
319
|
-
onClickCancel:
|
|
319
|
+
onClickCancel: V,
|
|
320
320
|
onBeforeOk: R,
|
|
321
321
|
onCustomSave: S,
|
|
322
322
|
isError: z,
|
|
323
|
-
error:
|
|
324
|
-
clearError:
|
|
323
|
+
error: w = "",
|
|
324
|
+
clearError: p = () => {
|
|
325
325
|
},
|
|
326
326
|
onError: I,
|
|
327
|
-
autoCloseAlertError:
|
|
328
|
-
loadingOverlayStyles:
|
|
327
|
+
autoCloseAlertError: re = 15e3,
|
|
328
|
+
loadingOverlayStyles: Z,
|
|
329
329
|
// Props de segurança (opcionais)
|
|
330
330
|
resourceName: H,
|
|
331
331
|
resourceDescription: G,
|
|
@@ -334,60 +334,60 @@ function Rn({
|
|
|
334
334
|
securityOptions: D,
|
|
335
335
|
..._
|
|
336
336
|
}) {
|
|
337
|
-
const
|
|
338
|
-
|
|
337
|
+
const N = Te(), de = tt(), { colorScheme: ee } = Ze(), [Q, U] = q(z), [M, X] = q(w), [J, W] = q(!1), L = ht();
|
|
338
|
+
Ee({
|
|
339
339
|
resourceDescription: G || t?.toString(),
|
|
340
340
|
autoRegisterActions: D?.autoRegisterActions ?? !0
|
|
341
341
|
});
|
|
342
|
-
const
|
|
342
|
+
const ie = Le(
|
|
343
343
|
"ArchbaseFormModalTemplate",
|
|
344
|
-
|
|
344
|
+
a,
|
|
345
345
|
void 0,
|
|
346
346
|
void 0
|
|
347
347
|
);
|
|
348
|
-
|
|
349
|
-
dataSource:
|
|
348
|
+
nt({
|
|
349
|
+
dataSource: a,
|
|
350
350
|
listener: (te) => {
|
|
351
|
-
te.type ===
|
|
351
|
+
te.type === ye.onError && (U(!0), X(te.error)), (te.type === ye.afterEdit || te.type === ye.afterInsert) && (ie.isDataSourceV2 || L());
|
|
352
352
|
}
|
|
353
353
|
});
|
|
354
|
-
const
|
|
355
|
-
if (
|
|
354
|
+
const ve = async () => {
|
|
355
|
+
if (a && !a.isBrowsing())
|
|
356
356
|
try {
|
|
357
|
-
W(!0), await
|
|
357
|
+
W(!0), await a.save(), F && F(a.getCurrentRecord());
|
|
358
358
|
} catch (te) {
|
|
359
|
-
return I && I(
|
|
359
|
+
return I && I(xe(te)), U(!0), X(xe(te)), W(!1), !1;
|
|
360
360
|
}
|
|
361
361
|
return W(!1), !0;
|
|
362
|
-
},
|
|
363
|
-
if (
|
|
362
|
+
}, c = () => {
|
|
363
|
+
if (a && !a.isBrowsing())
|
|
364
364
|
try {
|
|
365
|
-
|
|
365
|
+
a.cancel();
|
|
366
366
|
} catch {
|
|
367
367
|
}
|
|
368
368
|
}, j = async () => {
|
|
369
369
|
if (S)
|
|
370
|
-
|
|
370
|
+
a && S(a.getCurrentRecord(), () => {
|
|
371
371
|
m && m();
|
|
372
372
|
});
|
|
373
373
|
else if (R) {
|
|
374
|
-
const te = R(
|
|
374
|
+
const te = R(a.getCurrentRecord());
|
|
375
375
|
te instanceof Promise && te.then(async () => {
|
|
376
|
-
await
|
|
377
|
-
}).catch((
|
|
378
|
-
I && I(
|
|
376
|
+
await ve() && m && m();
|
|
377
|
+
}).catch((Se) => {
|
|
378
|
+
I && I(xe(Se)), U(!0), X(xe(Se));
|
|
379
379
|
});
|
|
380
380
|
} else
|
|
381
|
-
await
|
|
382
|
-
},
|
|
383
|
-
|
|
381
|
+
await ve() && m && m();
|
|
382
|
+
}, Y = () => {
|
|
383
|
+
c(), V && V();
|
|
384
384
|
}, ue = () => {
|
|
385
|
-
|
|
385
|
+
pt.showWarning(g().t("archbase:Click on Ok or Cancel to close"));
|
|
386
386
|
}, fe = () => {
|
|
387
|
-
|
|
387
|
+
p && p(), U(!1), X("");
|
|
388
388
|
};
|
|
389
389
|
return /* @__PURE__ */ e(
|
|
390
|
-
|
|
390
|
+
Be,
|
|
391
391
|
{
|
|
392
392
|
resourceName: H,
|
|
393
393
|
resourceDescription: G,
|
|
@@ -400,7 +400,7 @@ function Rn({
|
|
|
400
400
|
{
|
|
401
401
|
title: t,
|
|
402
402
|
withOverlay: n,
|
|
403
|
-
overlayProps:
|
|
403
|
+
overlayProps: s || {
|
|
404
404
|
color: ee === "dark" ? de.colors.dark[7] : de.colors.gray[6],
|
|
405
405
|
opacity: 0.25
|
|
406
406
|
},
|
|
@@ -410,41 +410,41 @@ function Rn({
|
|
|
410
410
|
opened: u,
|
|
411
411
|
fullScreen: b,
|
|
412
412
|
centered: h,
|
|
413
|
-
closeOnEscape:
|
|
413
|
+
closeOnEscape: k,
|
|
414
414
|
size: o,
|
|
415
415
|
..._,
|
|
416
|
-
children: /* @__PURE__ */ C(
|
|
417
|
-
/* @__PURE__ */ e(
|
|
418
|
-
/* @__PURE__ */ C(
|
|
419
|
-
|
|
420
|
-
|
|
416
|
+
children: /* @__PURE__ */ C(yt, { children: [
|
|
417
|
+
/* @__PURE__ */ e(wt, { styles: Z, visible: J, opacity: 0.8 }),
|
|
418
|
+
/* @__PURE__ */ C(rt, { height: E, children: [
|
|
419
|
+
Q ? /* @__PURE__ */ e(bt, { size: "100px", children: /* @__PURE__ */ e(
|
|
420
|
+
Ke,
|
|
421
421
|
{
|
|
422
|
-
autoClose:
|
|
422
|
+
autoClose: re,
|
|
423
423
|
withCloseButton: !0,
|
|
424
424
|
withBorder: !0,
|
|
425
|
-
icon: /* @__PURE__ */ e(
|
|
426
|
-
title:
|
|
425
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
426
|
+
title: g().t("WARNING"),
|
|
427
427
|
titleColor: "rgb(250, 82, 82)",
|
|
428
|
-
variant: x ??
|
|
428
|
+
variant: x ?? N.variant,
|
|
429
429
|
onClose: fe,
|
|
430
430
|
children: /* @__PURE__ */ e("span", { children: M })
|
|
431
431
|
}
|
|
432
432
|
) }) : null,
|
|
433
|
-
/* @__PURE__ */ e(
|
|
434
|
-
/* @__PURE__ */ e(
|
|
433
|
+
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(Dt, { children: f }) }),
|
|
434
|
+
/* @__PURE__ */ e(ot, { size: "40px", children: /* @__PURE__ */ C(Ce, { justify: "space-between", align: "center", children: [
|
|
435
435
|
/* @__PURE__ */ e(ce, { children: v }),
|
|
436
|
-
|
|
436
|
+
a && !a.isBrowsing() ? /* @__PURE__ */ C(ce, { gap: "md", children: [
|
|
437
437
|
/* @__PURE__ */ e(
|
|
438
438
|
he,
|
|
439
439
|
{
|
|
440
440
|
actionName: "save",
|
|
441
441
|
actionDescription: `Salvar ${G || t || "registro"}`,
|
|
442
|
-
leftSection: /* @__PURE__ */ e(
|
|
442
|
+
leftSection: /* @__PURE__ */ e(He, {}),
|
|
443
443
|
onClick: j,
|
|
444
|
-
disabled:
|
|
445
|
-
variant: x ??
|
|
444
|
+
disabled: a && a.isBrowsing(),
|
|
445
|
+
variant: x ?? N.variant,
|
|
446
446
|
color: "green",
|
|
447
|
-
children: `${
|
|
447
|
+
children: `${g().t("Ok")}`
|
|
448
448
|
}
|
|
449
449
|
),
|
|
450
450
|
/* @__PURE__ */ e(
|
|
@@ -453,11 +453,11 @@ function Rn({
|
|
|
453
453
|
actionName: "cancel",
|
|
454
454
|
actionDescription: "Cancelar operação",
|
|
455
455
|
leftSection: /* @__PURE__ */ e(Ge, {}),
|
|
456
|
-
onClick:
|
|
457
|
-
disabled:
|
|
458
|
-
variant: x ??
|
|
456
|
+
onClick: Y,
|
|
457
|
+
disabled: a && a.isBrowsing(),
|
|
458
|
+
variant: x ?? N.variant,
|
|
459
459
|
color: "red",
|
|
460
|
-
children: `${
|
|
460
|
+
children: `${g().t("Cancel")}`
|
|
461
461
|
}
|
|
462
462
|
)
|
|
463
463
|
] }) : /* @__PURE__ */ e(ce, { gap: "md", children: /* @__PURE__ */ e(
|
|
@@ -466,9 +466,9 @@ function Rn({
|
|
|
466
466
|
actionName: "close",
|
|
467
467
|
actionDescription: "Fechar janela",
|
|
468
468
|
leftSection: /* @__PURE__ */ e(Ge, {}),
|
|
469
|
-
onClick:
|
|
470
|
-
variant: x ??
|
|
471
|
-
children: `${
|
|
469
|
+
onClick: Y,
|
|
470
|
+
variant: x ?? N.variant,
|
|
471
|
+
children: `${g().t("Close")}`
|
|
472
472
|
}
|
|
473
473
|
) })
|
|
474
474
|
] }) })
|
|
@@ -479,10 +479,10 @@ function Rn({
|
|
|
479
479
|
}
|
|
480
480
|
);
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function Rn({
|
|
483
483
|
title: t,
|
|
484
484
|
withOverlay: n = !0,
|
|
485
|
-
overlayProps:
|
|
485
|
+
overlayProps: s,
|
|
486
486
|
children: f,
|
|
487
487
|
withCloseButton: r = !0,
|
|
488
488
|
closeButtonProps: i,
|
|
@@ -490,48 +490,48 @@ function En({
|
|
|
490
490
|
fullScreen: b,
|
|
491
491
|
centered: h,
|
|
492
492
|
variant: x,
|
|
493
|
-
closeOnEscape:
|
|
493
|
+
closeOnEscape: k = !0,
|
|
494
494
|
size: o,
|
|
495
|
-
height:
|
|
495
|
+
height: a,
|
|
496
496
|
onlyOkButton: E = !1,
|
|
497
497
|
onClose: v,
|
|
498
498
|
onClickOk: F,
|
|
499
499
|
onClickCancel: m,
|
|
500
|
-
userActions:
|
|
500
|
+
userActions: V,
|
|
501
501
|
// Props de segurança (opcionais)
|
|
502
502
|
resourceName: R,
|
|
503
503
|
resourceDescription: S,
|
|
504
504
|
requiredPermissions: z,
|
|
505
|
-
fallbackComponent:
|
|
506
|
-
securityOptions:
|
|
505
|
+
fallbackComponent: w,
|
|
506
|
+
securityOptions: p
|
|
507
507
|
}) {
|
|
508
|
-
const I =
|
|
509
|
-
|
|
510
|
-
autoRegisterActions:
|
|
508
|
+
const I = Te(), re = tt(), { colorScheme: Z } = Ze();
|
|
509
|
+
Ee({
|
|
510
|
+
autoRegisterActions: p?.autoRegisterActions ?? !0
|
|
511
511
|
});
|
|
512
512
|
const H = () => {
|
|
513
513
|
F && F(), v();
|
|
514
514
|
}, G = () => {
|
|
515
515
|
m && m(), v();
|
|
516
516
|
}, P = () => {
|
|
517
|
-
|
|
517
|
+
pt.showWarning(g().t("Click on Ok or Cancel to close"));
|
|
518
518
|
};
|
|
519
519
|
return /* @__PURE__ */ e(
|
|
520
|
-
|
|
520
|
+
Be,
|
|
521
521
|
{
|
|
522
522
|
resourceName: R,
|
|
523
523
|
resourceDescription: S,
|
|
524
524
|
requiredPermissions: z,
|
|
525
|
-
fallbackComponent:
|
|
526
|
-
onSecurityReady:
|
|
527
|
-
onAccessDenied:
|
|
525
|
+
fallbackComponent: w,
|
|
526
|
+
onSecurityReady: p?.onSecurityReady,
|
|
527
|
+
onAccessDenied: p?.onAccessDenied,
|
|
528
528
|
children: /* @__PURE__ */ e(
|
|
529
529
|
ut,
|
|
530
530
|
{
|
|
531
531
|
title: t,
|
|
532
532
|
withOverlay: n,
|
|
533
|
-
overlayProps:
|
|
534
|
-
color:
|
|
533
|
+
overlayProps: s || {
|
|
534
|
+
color: Z === "dark" ? re.colors.dark[7] : re.colors.gray[6],
|
|
535
535
|
opacity: 0.25
|
|
536
536
|
},
|
|
537
537
|
withCloseButton: r,
|
|
@@ -540,23 +540,23 @@ function En({
|
|
|
540
540
|
opened: u,
|
|
541
541
|
fullScreen: b,
|
|
542
542
|
centered: h,
|
|
543
|
-
closeOnEscape:
|
|
543
|
+
closeOnEscape: k,
|
|
544
544
|
size: o,
|
|
545
|
-
children: /* @__PURE__ */ C(
|
|
546
|
-
/* @__PURE__ */ e(
|
|
547
|
-
/* @__PURE__ */ e(
|
|
548
|
-
/* @__PURE__ */ e(ce, { children:
|
|
545
|
+
children: /* @__PURE__ */ C(rt, { height: a, children: [
|
|
546
|
+
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(Dt, { children: f }) }),
|
|
547
|
+
/* @__PURE__ */ e(ot, { size: "40px", children: /* @__PURE__ */ C(Ce, { justify: "space-between", align: "center", children: [
|
|
548
|
+
/* @__PURE__ */ e(ce, { children: V }),
|
|
549
549
|
/* @__PURE__ */ C(ce, { gap: "md", children: [
|
|
550
550
|
/* @__PURE__ */ e(
|
|
551
551
|
he,
|
|
552
552
|
{
|
|
553
553
|
actionName: "save",
|
|
554
554
|
actionDescription: `Salvar ${S || "registro"}`,
|
|
555
|
-
leftSection: /* @__PURE__ */ e(
|
|
555
|
+
leftSection: /* @__PURE__ */ e(He, {}),
|
|
556
556
|
onClick: H,
|
|
557
557
|
variant: x ?? I.variant,
|
|
558
558
|
color: "green",
|
|
559
|
-
children: `${
|
|
559
|
+
children: `${g().t("Ok")}`
|
|
560
560
|
}
|
|
561
561
|
),
|
|
562
562
|
E ? null : /* @__PURE__ */ e(
|
|
@@ -568,7 +568,7 @@ function En({
|
|
|
568
568
|
onClick: G,
|
|
569
569
|
variant: x ?? I.variant,
|
|
570
570
|
color: "red",
|
|
571
|
-
children: m ? `${
|
|
571
|
+
children: m ? `${g().t("Cancel")}` : `${g().t("Close")}`
|
|
572
572
|
}
|
|
573
573
|
)
|
|
574
574
|
] })
|
|
@@ -579,10 +579,10 @@ function En({
|
|
|
579
579
|
}
|
|
580
580
|
);
|
|
581
581
|
}
|
|
582
|
-
const
|
|
582
|
+
const Yt = (t, n, s) => {
|
|
583
583
|
if (!t || !n || !n.existsValue(`${t.viewName}_${t.componentName}`)) {
|
|
584
584
|
let f = -1, r;
|
|
585
|
-
return
|
|
585
|
+
return s && s.getFilters().length > 0 && (f = 0, r = JSON.parse(s.getFirstFilter()?.filter)), {
|
|
586
586
|
activeFilterIndex: f,
|
|
587
587
|
expandedFilter: !1,
|
|
588
588
|
currentFilter: r
|
|
@@ -590,9 +590,9 @@ const Zt = (t, n, a) => {
|
|
|
590
590
|
}
|
|
591
591
|
return n.getValue(`${t.viewName}_${t.componentName}`);
|
|
592
592
|
};
|
|
593
|
-
function
|
|
593
|
+
function Zt(t, n) {
|
|
594
594
|
const {
|
|
595
|
-
title:
|
|
595
|
+
title: s,
|
|
596
596
|
printTitle: f,
|
|
597
597
|
dataSource: r,
|
|
598
598
|
filterOptions: i,
|
|
@@ -600,62 +600,62 @@ function en(t, n) {
|
|
|
600
600
|
pageIndex: b = 0,
|
|
601
601
|
columns: h,
|
|
602
602
|
filterFields: x,
|
|
603
|
-
logoPrint:
|
|
603
|
+
logoPrint: k,
|
|
604
604
|
userActions: o,
|
|
605
|
-
userRowActions:
|
|
605
|
+
userRowActions: a,
|
|
606
606
|
customRenderRowActions: E,
|
|
607
607
|
innerRef: v,
|
|
608
608
|
isLoading: F = !1,
|
|
609
609
|
isLoadingFilter: m = !1,
|
|
610
|
-
isError:
|
|
610
|
+
isError: V = !1,
|
|
611
611
|
enableTopToolbar: R = !0,
|
|
612
612
|
enableTopToolbarActions: S = !0,
|
|
613
613
|
error: z = "",
|
|
614
|
-
clearError:
|
|
614
|
+
clearError: w = () => {
|
|
615
615
|
},
|
|
616
|
-
filterType:
|
|
616
|
+
filterType: p,
|
|
617
617
|
width: I = "100%",
|
|
618
|
-
height:
|
|
619
|
-
onSearchByFilter:
|
|
618
|
+
height: re = "100%",
|
|
619
|
+
onSearchByFilter: Z,
|
|
620
620
|
getRowId: H,
|
|
621
621
|
withBorder: G = !0,
|
|
622
622
|
filterPersistenceDelegator: P,
|
|
623
623
|
variant: $,
|
|
624
624
|
store: D,
|
|
625
625
|
cellPadding: _,
|
|
626
|
-
bottomToolbarMinHeight:
|
|
626
|
+
bottomToolbarMinHeight: N,
|
|
627
627
|
enableRowSelection: de = !0,
|
|
628
628
|
enableRowNumbers: ee = !0,
|
|
629
|
-
enableRowActions:
|
|
629
|
+
enableRowActions: Q = !0,
|
|
630
630
|
positionActionsColumn: U = "first",
|
|
631
631
|
actionsColumnWidth: M,
|
|
632
|
-
tableHeadCellPadding:
|
|
632
|
+
tableHeadCellPadding: X,
|
|
633
633
|
renderDetailPanel: J,
|
|
634
634
|
renderTopToolbar: W,
|
|
635
635
|
toolbarAlignment: L = "right",
|
|
636
|
-
toolbarLeftContent:
|
|
637
|
-
onSelectedRowsChanged:
|
|
638
|
-
onCellDoubleClick:
|
|
636
|
+
toolbarLeftContent: ie,
|
|
637
|
+
onSelectedRowsChanged: ve,
|
|
638
|
+
onCellDoubleClick: c,
|
|
639
639
|
onFilterModelChange: j,
|
|
640
|
-
paginationLabels:
|
|
640
|
+
paginationLabels: Y,
|
|
641
641
|
// Props de segurança (opcionais)
|
|
642
642
|
resourceName: ue,
|
|
643
643
|
resourceDescription: fe,
|
|
644
644
|
requiredPermissions: te,
|
|
645
|
-
fallbackComponent:
|
|
646
|
-
securityOptions:
|
|
645
|
+
fallbackComponent: Se,
|
|
646
|
+
securityOptions: we,
|
|
647
647
|
// Props para controle de bordas internas
|
|
648
|
-
withToolbarBorder:
|
|
649
|
-
withPaginationBorder:
|
|
648
|
+
withToolbarBorder: T,
|
|
649
|
+
withPaginationBorder: oe,
|
|
650
650
|
toolbarPadding: ze,
|
|
651
|
-
paginationPadding:
|
|
651
|
+
paginationPadding: Ve,
|
|
652
652
|
rowHeight: Ue,
|
|
653
|
-
hideFooter:
|
|
654
|
-
} = t,
|
|
655
|
-
|
|
656
|
-
const { colorScheme:
|
|
657
|
-
|
|
658
|
-
autoRegisterActions:
|
|
653
|
+
hideFooter: Pe = !0
|
|
654
|
+
} = t, Ne = pe(null), B = pe(null);
|
|
655
|
+
tt();
|
|
656
|
+
const { colorScheme: lt } = Ze();
|
|
657
|
+
Ee({
|
|
658
|
+
autoRegisterActions: we?.autoRegisterActions ?? !0
|
|
659
659
|
});
|
|
660
660
|
const ne = Le(
|
|
661
661
|
"ArchbaseGridTemplate",
|
|
@@ -663,192 +663,192 @@ function en(t, n) {
|
|
|
663
663
|
void 0,
|
|
664
664
|
void 0
|
|
665
665
|
);
|
|
666
|
-
|
|
666
|
+
Rt(n, () => ({
|
|
667
667
|
refreshData: () => {
|
|
668
|
-
|
|
668
|
+
B.current && B.current.refreshData();
|
|
669
669
|
},
|
|
670
|
-
getSelectedRows: () =>
|
|
670
|
+
getSelectedRows: () => B.current ? B.current.getSelectedRows() : [],
|
|
671
671
|
clearSelection: () => {
|
|
672
|
-
|
|
672
|
+
B.current && B.current.clearSelection();
|
|
673
673
|
},
|
|
674
674
|
exportData: () => {
|
|
675
|
-
|
|
675
|
+
B.current && B.current.exportData();
|
|
676
676
|
},
|
|
677
677
|
printData: () => {
|
|
678
|
-
|
|
678
|
+
B.current && B.current.printData();
|
|
679
679
|
},
|
|
680
|
-
getDataGridRef: () =>
|
|
681
|
-
getFilterModel: () =>
|
|
682
|
-
}), [
|
|
680
|
+
getDataGridRef: () => B,
|
|
681
|
+
getFilterModel: () => B.current ? B.current.getFilterModel() : { items: [], quickFilterValues: [] }
|
|
682
|
+
}), [B]);
|
|
683
683
|
const [O, me] = q({
|
|
684
684
|
activeFilterIndex: -1,
|
|
685
685
|
currentFilter: void 0,
|
|
686
686
|
expandedFilter: !1
|
|
687
687
|
});
|
|
688
|
-
|
|
689
|
-
const
|
|
690
|
-
me(
|
|
688
|
+
Ye(() => {
|
|
689
|
+
const d = Yt(i, D, P);
|
|
690
|
+
me(d);
|
|
691
691
|
}, [m]);
|
|
692
|
-
const
|
|
692
|
+
const Fe = (d) => {
|
|
693
693
|
if (E)
|
|
694
|
-
return E(
|
|
695
|
-
if (!
|
|
694
|
+
return E(d);
|
|
695
|
+
if (!a || !a.actions)
|
|
696
696
|
return;
|
|
697
|
-
const
|
|
697
|
+
const ge = a.actions;
|
|
698
698
|
return /* @__PURE__ */ e(
|
|
699
|
-
|
|
699
|
+
ge,
|
|
700
700
|
{
|
|
701
|
-
onEditRow:
|
|
702
|
-
onRemoveRow:
|
|
703
|
-
onViewRow:
|
|
704
|
-
row:
|
|
705
|
-
variant: $ ??
|
|
701
|
+
onEditRow: a.onEditRow ? (ae) => a.onEditRow && a.onEditRow(ae) : void 0,
|
|
702
|
+
onRemoveRow: a.onRemoveRow ? (ae) => a.onRemoveRow && a.onRemoveRow(ae) : void 0,
|
|
703
|
+
onViewRow: a.onViewRow ? (ae) => a.onViewRow && a.onViewRow(ae) : void 0,
|
|
704
|
+
row: d,
|
|
705
|
+
variant: $ ?? be.variant
|
|
706
706
|
}
|
|
707
707
|
);
|
|
708
|
-
},
|
|
709
|
-
|
|
710
|
-
v && v.current !==
|
|
708
|
+
}, be = Te(), Ae = pe(null), l = V ? !1 : F, A = De(() => ie, [ie]);
|
|
709
|
+
_e.useEffect(() => {
|
|
710
|
+
v && v.current !== Ae.current && v.current && Ae.current && (v.current = Ae.current);
|
|
711
711
|
}, [v]);
|
|
712
|
-
const
|
|
713
|
-
const
|
|
714
|
-
me(
|
|
715
|
-
}, se = (
|
|
716
|
-
const
|
|
717
|
-
me(
|
|
718
|
-
},
|
|
719
|
-
const
|
|
720
|
-
me(
|
|
721
|
-
},
|
|
712
|
+
const le = (d, ge) => {
|
|
713
|
+
const ae = { ...O, currentFilter: d, activeFilterIndex: ge };
|
|
714
|
+
me(ae), D && i && D?.setValue(`${i.viewName}_${i.componentName}`, ae);
|
|
715
|
+
}, se = (d) => {
|
|
716
|
+
const ge = { ...O, expandedFilter: d };
|
|
717
|
+
me(ge), D && i && D?.setValue(`${i.viewName}_${i.componentName}`, ge);
|
|
718
|
+
}, Me = (d, ge) => {
|
|
719
|
+
const ae = { ...O, currentFilter: d, activeFilterIndex: ge };
|
|
720
|
+
me(ae), D && i && D?.setValue(`${i.viewName}_${i.componentName}`, ae);
|
|
721
|
+
}, je = () => {
|
|
722
722
|
if (O.currentFilter)
|
|
723
|
-
if (
|
|
724
|
-
|
|
723
|
+
if (Z)
|
|
724
|
+
Z();
|
|
725
725
|
else if (O.currentFilter.filter.filterType === "quick") {
|
|
726
|
-
const
|
|
727
|
-
O.currentFilter.filter.quickFilterText && O.currentFilter.filter.quickFilterText !== "" ? (
|
|
726
|
+
const d = r.getOptions();
|
|
727
|
+
O.currentFilter.filter.quickFilterText && O.currentFilter.filter.quickFilterText !== "" ? (d.filter = JSON.stringify({
|
|
728
728
|
search: O.currentFilter.filter.quickFilterText,
|
|
729
729
|
fields: O.currentFilter.filter.quickFilterFieldsText
|
|
730
|
-
}),
|
|
730
|
+
}), d.sort = O.currentFilter.sort.quickFilterSort ? O.currentFilter.sort.quickFilterSort.split(",") : []) : (d.filter = void 0, d.sort = void 0), r.refreshData(d), ne.isDataSourceV2 || ne.v1State.forceUpdate();
|
|
731
731
|
} else {
|
|
732
|
-
const
|
|
733
|
-
if (
|
|
734
|
-
const
|
|
735
|
-
|
|
732
|
+
const d = Ot(O.currentFilter);
|
|
733
|
+
if (d && d.expressionNode) {
|
|
734
|
+
const ge = $t(d.expressionNode), ae = r.getOptions();
|
|
735
|
+
ae.filter = ge, ae.sort = d?.sortStrings, r.refreshData(ae), ne.isDataSourceV2 || ne.v1State.forceUpdate();
|
|
736
736
|
}
|
|
737
737
|
}
|
|
738
738
|
};
|
|
739
|
-
let
|
|
740
|
-
const
|
|
741
|
-
|
|
742
|
-
},
|
|
743
|
-
|
|
744
|
-
},
|
|
745
|
-
|
|
746
|
-
},
|
|
747
|
-
|
|
748
|
-
},
|
|
749
|
-
|
|
739
|
+
let Re, qe;
|
|
740
|
+
const st = (d) => {
|
|
741
|
+
Re = d;
|
|
742
|
+
}, at = (d) => {
|
|
743
|
+
qe = d;
|
|
744
|
+
}, ct = () => {
|
|
745
|
+
qe && qe();
|
|
746
|
+
}, dt = () => {
|
|
747
|
+
Re && Re();
|
|
748
|
+
}, y = () => p === "none" ? /* @__PURE__ */ e("div", {}) : p === "advanced" ? /* @__PURE__ */ e(
|
|
749
|
+
xt,
|
|
750
750
|
{
|
|
751
751
|
id: i?.componentName,
|
|
752
752
|
viewName: i?.viewName,
|
|
753
753
|
apiVersion: i?.apiVersion,
|
|
754
|
-
ref:
|
|
755
|
-
variant: $ ??
|
|
754
|
+
ref: Ne,
|
|
755
|
+
variant: $ ?? be.variant,
|
|
756
756
|
expandedFilter: O.expandedFilter,
|
|
757
757
|
persistenceDelegator: P,
|
|
758
758
|
currentFilter: O.currentFilter,
|
|
759
759
|
activeFilterIndex: O.activeFilterIndex,
|
|
760
|
-
onSelectedFilter:
|
|
761
|
-
onFilterChanged:
|
|
762
|
-
onSearchByFilter:
|
|
760
|
+
onSelectedFilter: Me,
|
|
761
|
+
onFilterChanged: le,
|
|
762
|
+
onSearchByFilter: je,
|
|
763
763
|
onToggleExpandedFilter: se,
|
|
764
|
-
onExport:
|
|
765
|
-
onPrint:
|
|
764
|
+
onExport: ct,
|
|
765
|
+
onPrint: dt,
|
|
766
766
|
showExportButton: !0,
|
|
767
767
|
showPrintButton: !0,
|
|
768
768
|
width: "560px",
|
|
769
769
|
height: "170px",
|
|
770
770
|
children: x
|
|
771
771
|
}
|
|
772
|
-
) :
|
|
772
|
+
) : p === "normal" ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e("div", {});
|
|
773
773
|
return /* @__PURE__ */ e(
|
|
774
|
-
|
|
774
|
+
Be,
|
|
775
775
|
{
|
|
776
776
|
resourceName: ue,
|
|
777
777
|
resourceDescription: fe,
|
|
778
778
|
requiredPermissions: te,
|
|
779
|
-
fallbackComponent:
|
|
780
|
-
onSecurityReady:
|
|
781
|
-
onAccessDenied:
|
|
782
|
-
children: /* @__PURE__ */ C(
|
|
783
|
-
|
|
784
|
-
|
|
779
|
+
fallbackComponent: Se,
|
|
780
|
+
onSecurityReady: we?.onSecurityReady,
|
|
781
|
+
onAccessDenied: we?.onAccessDenied,
|
|
782
|
+
children: /* @__PURE__ */ C(We, { withBorder: G, ref: Ae, style: { height: "100%" }, children: [
|
|
783
|
+
V ? /* @__PURE__ */ e(
|
|
784
|
+
Ke,
|
|
785
785
|
{
|
|
786
786
|
autoClose: 2e4,
|
|
787
787
|
withCloseButton: !0,
|
|
788
788
|
withBorder: !0,
|
|
789
|
-
icon: /* @__PURE__ */ e(
|
|
790
|
-
title:
|
|
789
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
790
|
+
title: g().t("archbase:WARNING"),
|
|
791
791
|
titleColor: "rgb(250, 82, 82)",
|
|
792
|
-
variant: $ ??
|
|
793
|
-
onClose: () =>
|
|
792
|
+
variant: $ ?? be.variant,
|
|
793
|
+
onClose: () => w && w(),
|
|
794
794
|
children: /* @__PURE__ */ e("span", { children: z })
|
|
795
795
|
}
|
|
796
796
|
) : null,
|
|
797
797
|
/* @__PURE__ */ C(
|
|
798
|
-
|
|
798
|
+
St,
|
|
799
799
|
{
|
|
800
|
-
gridRef:
|
|
801
|
-
printTitle: f ||
|
|
802
|
-
logoPrint:
|
|
800
|
+
gridRef: B,
|
|
801
|
+
printTitle: f || s,
|
|
802
|
+
logoPrint: k,
|
|
803
803
|
width: I,
|
|
804
|
-
height:
|
|
804
|
+
height: re,
|
|
805
805
|
withBorder: !1,
|
|
806
806
|
dataSource: r,
|
|
807
807
|
enableColumnResizing: !0,
|
|
808
808
|
enableRowNumbers: ee,
|
|
809
809
|
enableRowSelection: de,
|
|
810
|
-
enableRowActions:
|
|
810
|
+
enableRowActions: Q,
|
|
811
811
|
enableTopToolbar: R,
|
|
812
812
|
enableTopToolbarActions: S,
|
|
813
813
|
manualPagination: !0,
|
|
814
814
|
manualSorting: !0,
|
|
815
|
-
isLoading:
|
|
815
|
+
isLoading: l,
|
|
816
816
|
pageSize: u,
|
|
817
817
|
pageIndex: b,
|
|
818
|
-
allowColumnFilters:
|
|
819
|
-
enableGlobalFilter:
|
|
820
|
-
renderToolbarInternalActions:
|
|
818
|
+
allowColumnFilters: p !== "none",
|
|
819
|
+
enableGlobalFilter: p !== "none",
|
|
820
|
+
renderToolbarInternalActions: p == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
|
|
821
821
|
allowExportData: !0,
|
|
822
822
|
allowPrintData: !0,
|
|
823
|
-
onSelectedRowsChanged:
|
|
824
|
-
onCellDoubleClick:
|
|
823
|
+
onSelectedRowsChanged: ve,
|
|
824
|
+
onCellDoubleClick: c,
|
|
825
825
|
onFilterModelChange: j,
|
|
826
|
-
renderRowActions:
|
|
826
|
+
renderRowActions: Q ? Fe : void 0,
|
|
827
827
|
positionActionsColumn: U,
|
|
828
828
|
actionsColumnWidth: M,
|
|
829
829
|
toolbarAlignment: L,
|
|
830
|
-
toolbarLeftContent:
|
|
831
|
-
renderToolbarActions:
|
|
832
|
-
paginationLabels:
|
|
830
|
+
toolbarLeftContent: A,
|
|
831
|
+
renderToolbarActions: p === "advanced" || p === "none" ? y : void 0,
|
|
832
|
+
paginationLabels: Y,
|
|
833
833
|
cellPadding: _,
|
|
834
|
-
bottomToolbarMinHeight:
|
|
835
|
-
tableHeadCellPadding:
|
|
834
|
+
bottomToolbarMinHeight: N,
|
|
835
|
+
tableHeadCellPadding: X,
|
|
836
836
|
getRowId: H,
|
|
837
|
-
renderDetailPanel: J ? ({ row:
|
|
837
|
+
renderDetailPanel: J ? ({ row: d }) => J({ row: d }) : void 0,
|
|
838
838
|
renderTopToolbar: W,
|
|
839
|
-
onExport:
|
|
840
|
-
onPrint:
|
|
839
|
+
onExport: at,
|
|
840
|
+
onPrint: st,
|
|
841
841
|
variant: $,
|
|
842
|
-
withToolbarBorder:
|
|
843
|
-
withPaginationBorder:
|
|
842
|
+
withToolbarBorder: T,
|
|
843
|
+
withPaginationBorder: oe,
|
|
844
844
|
toolbarPadding: ze,
|
|
845
|
-
paginationPadding:
|
|
845
|
+
paginationPadding: Ve,
|
|
846
846
|
rowHeight: Ue,
|
|
847
|
-
hideFooter:
|
|
847
|
+
hideFooter: Pe,
|
|
848
848
|
children: [
|
|
849
849
|
h,
|
|
850
|
-
o?.visible ? /* @__PURE__ */ e(
|
|
851
|
-
/* @__PURE__ */ e("h3", { className: "only-print", children: f ||
|
|
850
|
+
o?.visible ? /* @__PURE__ */ e(qt, { children: /* @__PURE__ */ C($e, { children: [
|
|
851
|
+
/* @__PURE__ */ e("h3", { className: "only-print", children: f || s }),
|
|
852
852
|
/* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ C(Ce, { gap: "8px", rowGap: "8px", children: [
|
|
853
853
|
o.customUserActions && o.customUserActionsPosition === "left" ? o.customUserActions : null,
|
|
854
854
|
o.onAddExecute ? /* @__PURE__ */ e(
|
|
@@ -857,10 +857,10 @@ function en(t, n) {
|
|
|
857
857
|
actionName: "add",
|
|
858
858
|
actionDescription: `Adicionar novo ${fe || "registro"}`,
|
|
859
859
|
color: "green",
|
|
860
|
-
variant: $ ??
|
|
860
|
+
variant: $ ?? be.variant,
|
|
861
861
|
leftSection: /* @__PURE__ */ e(ft, {}),
|
|
862
862
|
onClick: () => o && o.onAddExecute && o.onAddExecute(),
|
|
863
|
-
children: o.labelAdd ||
|
|
863
|
+
children: o.labelAdd || g().t("archbase:New")
|
|
864
864
|
}
|
|
865
865
|
) : null,
|
|
866
866
|
o.onEditExecute ? /* @__PURE__ */ e(
|
|
@@ -871,9 +871,9 @@ function en(t, n) {
|
|
|
871
871
|
color: "blue",
|
|
872
872
|
leftSection: /* @__PURE__ */ e(mt, {}),
|
|
873
873
|
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
874
|
-
variant: $ ??
|
|
874
|
+
variant: $ ?? be.variant,
|
|
875
875
|
onClick: () => o && o.onEditExecute && o.onEditExecute(),
|
|
876
|
-
children: o.labelEdit ||
|
|
876
|
+
children: o.labelEdit || g().t("archbase:Edit")
|
|
877
877
|
}
|
|
878
878
|
) : null,
|
|
879
879
|
o.onRemoveExecute ? /* @__PURE__ */ e(
|
|
@@ -882,11 +882,11 @@ function en(t, n) {
|
|
|
882
882
|
actionName: "delete",
|
|
883
883
|
actionDescription: `Remover ${fe || "registro"}`,
|
|
884
884
|
color: "red",
|
|
885
|
-
leftSection: /* @__PURE__ */ e(
|
|
885
|
+
leftSection: /* @__PURE__ */ e(et, {}),
|
|
886
886
|
disabled: !o?.allowRemove || !r.isBrowsing() || r.isEmpty(),
|
|
887
|
-
variant: $ ??
|
|
887
|
+
variant: $ ?? be.variant,
|
|
888
888
|
onClick: () => o && o.onRemoveExecute && o.onRemoveExecute(),
|
|
889
|
-
children: o.labelRemove ||
|
|
889
|
+
children: o.labelRemove || g().t("archbase:Remove")
|
|
890
890
|
}
|
|
891
891
|
) : null,
|
|
892
892
|
o.onViewExecute ? /* @__PURE__ */ e(
|
|
@@ -895,11 +895,11 @@ function en(t, n) {
|
|
|
895
895
|
actionName: "view",
|
|
896
896
|
actionDescription: `Visualizar ${fe || "registro"}`,
|
|
897
897
|
color: "gray.7",
|
|
898
|
-
leftSection: /* @__PURE__ */ e(
|
|
898
|
+
leftSection: /* @__PURE__ */ e(gt, {}),
|
|
899
899
|
disabled: !r.isBrowsing() || r.isEmpty(),
|
|
900
|
-
variant: $ ??
|
|
900
|
+
variant: $ ?? be.variant,
|
|
901
901
|
onClick: () => o && o.onViewExecute && o.onViewExecute(),
|
|
902
|
-
children: o.labelView ||
|
|
902
|
+
children: o.labelView || g().t("archbase:View")
|
|
903
903
|
}
|
|
904
904
|
) : null,
|
|
905
905
|
o.customUserActions && o.customUserActionsPosition === "right" ? o.customUserActions : null
|
|
@@ -912,13 +912,13 @@ function en(t, n) {
|
|
|
912
912
|
}
|
|
913
913
|
);
|
|
914
914
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
915
|
+
const En = Ft(Zt);
|
|
916
|
+
function en(t, n, s, f) {
|
|
917
917
|
if (t && t.headerGridColumns) {
|
|
918
918
|
const r = t.headerGridColumns.left ? t.headerGridColumns.left : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, i = t.headerGridColumns.middle ? t.headerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.headerGridColumns.right ? t.headerGridColumns.right : { xs: "auto", sm: "auto", md: "auto", lg: "auto" };
|
|
919
|
-
return /* @__PURE__ */ C(
|
|
919
|
+
return /* @__PURE__ */ C(Ie, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
920
920
|
/* @__PURE__ */ e(
|
|
921
|
-
|
|
921
|
+
Ie.Col,
|
|
922
922
|
{
|
|
923
923
|
span: {
|
|
924
924
|
xs: r.xs,
|
|
@@ -936,7 +936,7 @@ function tn(t, n, a, f) {
|
|
|
936
936
|
}
|
|
937
937
|
),
|
|
938
938
|
/* @__PURE__ */ e(
|
|
939
|
-
|
|
939
|
+
Ie.Col,
|
|
940
940
|
{
|
|
941
941
|
span: {
|
|
942
942
|
xs: i.xs,
|
|
@@ -953,7 +953,7 @@ function tn(t, n, a, f) {
|
|
|
953
953
|
}
|
|
954
954
|
),
|
|
955
955
|
/* @__PURE__ */ e(
|
|
956
|
-
|
|
956
|
+
Ie.Col,
|
|
957
957
|
{
|
|
958
958
|
span: {
|
|
959
959
|
xs: u.xs,
|
|
@@ -967,7 +967,7 @@ function tn(t, n, a, f) {
|
|
|
967
967
|
justifyContent: "flex-end",
|
|
968
968
|
alignItems: "center"
|
|
969
969
|
},
|
|
970
|
-
children:
|
|
970
|
+
children: s
|
|
971
971
|
}
|
|
972
972
|
)
|
|
973
973
|
] });
|
|
@@ -997,18 +997,18 @@ function tn(t, n, a, f) {
|
|
|
997
997
|
style: {
|
|
998
998
|
border: f ? "1px dashed" : ""
|
|
999
999
|
},
|
|
1000
|
-
children:
|
|
1000
|
+
children: s
|
|
1001
1001
|
}
|
|
1002
1002
|
)
|
|
1003
1003
|
] });
|
|
1004
1004
|
}
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function tn(t, n, s, f) {
|
|
1007
1007
|
if (t && t.footerGridColumns) {
|
|
1008
1008
|
const r = t.footerGridColumns.left ? t.footerGridColumns.left : { xs: "content", sm: "content", md: "content", lg: "content" }, i = t.footerGridColumns.middle ? t.footerGridColumns.middle : { xs: "auto", sm: "auto", md: "auto", lg: "auto" }, u = t.footerGridColumns.right ? t.footerGridColumns.right : { xs: "content", sm: "content", md: "content", lg: "content" };
|
|
1009
|
-
return /* @__PURE__ */ C(
|
|
1009
|
+
return /* @__PURE__ */ C(Ie, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
|
|
1010
1010
|
/* @__PURE__ */ e(
|
|
1011
|
-
|
|
1011
|
+
Ie.Col,
|
|
1012
1012
|
{
|
|
1013
1013
|
span: {
|
|
1014
1014
|
xs: r.xs,
|
|
@@ -1026,7 +1026,7 @@ function nn(t, n, a, f) {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
),
|
|
1028
1028
|
/* @__PURE__ */ e(
|
|
1029
|
-
|
|
1029
|
+
Ie.Col,
|
|
1030
1030
|
{
|
|
1031
1031
|
span: {
|
|
1032
1032
|
xs: i.xs,
|
|
@@ -1043,7 +1043,7 @@ function nn(t, n, a, f) {
|
|
|
1043
1043
|
}
|
|
1044
1044
|
),
|
|
1045
1045
|
/* @__PURE__ */ e(
|
|
1046
|
-
|
|
1046
|
+
Ie.Col,
|
|
1047
1047
|
{
|
|
1048
1048
|
span: {
|
|
1049
1049
|
xs: u.xs,
|
|
@@ -1057,7 +1057,7 @@ function nn(t, n, a, f) {
|
|
|
1057
1057
|
justifyContent: "flex-end",
|
|
1058
1058
|
alignItems: "center"
|
|
1059
1059
|
},
|
|
1060
|
-
children:
|
|
1060
|
+
children: s
|
|
1061
1061
|
}
|
|
1062
1062
|
)
|
|
1063
1063
|
] });
|
|
@@ -1089,18 +1089,18 @@ function nn(t, n, a, f) {
|
|
|
1089
1089
|
style: {
|
|
1090
1090
|
border: f ? "1px dashed" : "",
|
|
1091
1091
|
height: "auto",
|
|
1092
|
-
padding:
|
|
1092
|
+
padding: s && "calc(0.625rem / 2)"
|
|
1093
1093
|
},
|
|
1094
|
-
children:
|
|
1094
|
+
children: s
|
|
1095
1095
|
}
|
|
1096
1096
|
)
|
|
1097
1097
|
] });
|
|
1098
1098
|
}
|
|
1099
1099
|
}
|
|
1100
|
-
function
|
|
1100
|
+
function Tt({
|
|
1101
1101
|
title: t,
|
|
1102
1102
|
innerRef: n,
|
|
1103
|
-
isError:
|
|
1103
|
+
isError: s = !1,
|
|
1104
1104
|
error: f = "",
|
|
1105
1105
|
clearError: r,
|
|
1106
1106
|
width: i = "100%",
|
|
@@ -1108,72 +1108,72 @@ function Dt({
|
|
|
1108
1108
|
withBorder: b = !0,
|
|
1109
1109
|
children: h,
|
|
1110
1110
|
radius: x,
|
|
1111
|
-
debug:
|
|
1111
|
+
debug: k,
|
|
1112
1112
|
defaultDebug: o,
|
|
1113
|
-
headerLeft:
|
|
1113
|
+
headerLeft: a,
|
|
1114
1114
|
headerMiddle: E,
|
|
1115
1115
|
headerRight: v,
|
|
1116
1116
|
footerLeft: F,
|
|
1117
1117
|
footerMiddle: m,
|
|
1118
|
-
footerRight:
|
|
1118
|
+
footerRight: V,
|
|
1119
1119
|
variant: R,
|
|
1120
1120
|
options: S = {},
|
|
1121
1121
|
style: z,
|
|
1122
|
-
debugOptions:
|
|
1122
|
+
debugOptions: w = {
|
|
1123
1123
|
debugLayoutHotKey: "ctrl+shift+S",
|
|
1124
1124
|
debugObjectInspectorHotKey: "ctrl+shift+D",
|
|
1125
1125
|
objectsToInspect: []
|
|
1126
1126
|
},
|
|
1127
1127
|
// Props de segurança (opcionais)
|
|
1128
|
-
resourceName:
|
|
1128
|
+
resourceName: p,
|
|
1129
1129
|
resourceDescription: I,
|
|
1130
|
-
requiredPermissions:
|
|
1131
|
-
fallbackComponent:
|
|
1130
|
+
requiredPermissions: re,
|
|
1131
|
+
fallbackComponent: Z,
|
|
1132
1132
|
securityOptions: H
|
|
1133
1133
|
}) {
|
|
1134
|
-
const [G, P] =
|
|
1135
|
-
value:
|
|
1134
|
+
const [G, P] = Pt({
|
|
1135
|
+
value: k,
|
|
1136
1136
|
defaultValue: o,
|
|
1137
1137
|
finalValue: !1
|
|
1138
1138
|
});
|
|
1139
|
-
|
|
1140
|
-
const $ =
|
|
1141
|
-
|
|
1139
|
+
Nt([[w && w.debugLayoutHotKey, () => P(!G)]]);
|
|
1140
|
+
const $ = Te(), { t: D } = Lt();
|
|
1141
|
+
Ee({
|
|
1142
1142
|
autoRegisterActions: H?.autoRegisterActions ?? !0
|
|
1143
1143
|
});
|
|
1144
|
-
const _ = pe(null),
|
|
1145
|
-
height: M.height -
|
|
1146
|
-
width: M.width -
|
|
1147
|
-
}), [M.height, M.width,
|
|
1148
|
-
|
|
1144
|
+
const _ = pe(null), N = n || _, de = pe(null), ee = pe(null), Q = Xe(de), U = Xe(ee), M = Xe(N), X = De(() => ({
|
|
1145
|
+
height: M.height - Q.height - U.height - Number(Bt("0.625rem")),
|
|
1146
|
+
width: M.width - Q.width - U.width
|
|
1147
|
+
}), [M.height, M.width, Q.height, Q.width, U.height, U.width]), J = pe(o);
|
|
1148
|
+
Ye(() => {
|
|
1149
1149
|
o !== J.current && (P(o), J.current = o);
|
|
1150
1150
|
}, [o, P]);
|
|
1151
1151
|
const W = /* @__PURE__ */ C($e, { children: [
|
|
1152
1152
|
/* @__PURE__ */ e(
|
|
1153
|
-
|
|
1153
|
+
We,
|
|
1154
1154
|
{
|
|
1155
|
-
ref:
|
|
1155
|
+
ref: N,
|
|
1156
1156
|
withBorder: b,
|
|
1157
1157
|
radius: x,
|
|
1158
1158
|
style: { width: i, height: u, padding: 4, ...z },
|
|
1159
|
-
children: /* @__PURE__ */ C(
|
|
1160
|
-
/* @__PURE__ */ e(bt, { size:
|
|
1161
|
-
/* @__PURE__ */ e(
|
|
1159
|
+
children: /* @__PURE__ */ C(rt, { height: "100%", children: [
|
|
1160
|
+
/* @__PURE__ */ e(bt, { size: Q.height, children: /* @__PURE__ */ e("div", { ref: de, children: en(S, a, v, G) }) }),
|
|
1161
|
+
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(
|
|
1162
1162
|
vt,
|
|
1163
1163
|
{
|
|
1164
|
-
h:
|
|
1164
|
+
h: X.height,
|
|
1165
1165
|
style: {
|
|
1166
1166
|
border: G ? "1px dashed" : "",
|
|
1167
1167
|
padding: "calc(0.625rem / 2)"
|
|
1168
1168
|
},
|
|
1169
|
-
children: h ? /* @__PURE__ */ C(
|
|
1170
|
-
|
|
1171
|
-
|
|
1169
|
+
children: h ? /* @__PURE__ */ C(zt, { children: [
|
|
1170
|
+
s && /* @__PURE__ */ e(
|
|
1171
|
+
Ke,
|
|
1172
1172
|
{
|
|
1173
1173
|
autoClose: 2e4,
|
|
1174
1174
|
withCloseButton: !0,
|
|
1175
1175
|
withBorder: !0,
|
|
1176
|
-
icon: /* @__PURE__ */ e(
|
|
1176
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
1177
1177
|
title: `${D("WARNING")}`,
|
|
1178
1178
|
titleColor: "rgb(250, 82, 82)",
|
|
1179
1179
|
variant: R ?? $.variant,
|
|
@@ -1182,35 +1182,35 @@ function Dt({
|
|
|
1182
1182
|
}
|
|
1183
1183
|
),
|
|
1184
1184
|
h
|
|
1185
|
-
] }) : G && /* @__PURE__ */ e(Ce, { h:
|
|
1185
|
+
] }) : G && /* @__PURE__ */ e(Ce, { h: X.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(ke, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
|
|
1186
1186
|
}
|
|
1187
1187
|
) }),
|
|
1188
|
-
/* @__PURE__ */ e(
|
|
1188
|
+
/* @__PURE__ */ e(ot, { size: U.height, children: /* @__PURE__ */ e("div", { ref: ee, children: tn(S, F, V, G) }) })
|
|
1189
1189
|
] })
|
|
1190
1190
|
}
|
|
1191
1191
|
),
|
|
1192
1192
|
/* @__PURE__ */ e(
|
|
1193
|
-
|
|
1193
|
+
Ht,
|
|
1194
1194
|
{
|
|
1195
|
-
debugObjectInspectorHotKey:
|
|
1196
|
-
objectsToInspect:
|
|
1195
|
+
debugObjectInspectorHotKey: w && w.debugObjectInspectorHotKey,
|
|
1196
|
+
objectsToInspect: w && w.objectsToInspect
|
|
1197
1197
|
}
|
|
1198
1198
|
)
|
|
1199
1199
|
] });
|
|
1200
1200
|
return /* @__PURE__ */ e(
|
|
1201
|
-
|
|
1201
|
+
Be,
|
|
1202
1202
|
{
|
|
1203
|
-
resourceName:
|
|
1203
|
+
resourceName: p,
|
|
1204
1204
|
resourceDescription: I,
|
|
1205
|
-
requiredPermissions:
|
|
1206
|
-
fallbackComponent:
|
|
1205
|
+
requiredPermissions: re,
|
|
1206
|
+
fallbackComponent: Z,
|
|
1207
1207
|
onSecurityReady: H?.onSecurityReady,
|
|
1208
1208
|
onAccessDenied: H?.onAccessDenied,
|
|
1209
1209
|
children: W
|
|
1210
1210
|
}
|
|
1211
1211
|
);
|
|
1212
1212
|
}
|
|
1213
|
-
const
|
|
1213
|
+
const nn = {
|
|
1214
1214
|
visible: !0,
|
|
1215
1215
|
allowAdd: !0,
|
|
1216
1216
|
allowEdit: !0,
|
|
@@ -1218,14 +1218,14 @@ const rn = {
|
|
|
1218
1218
|
allowRemove: !0,
|
|
1219
1219
|
positionCustomUserActions: "after"
|
|
1220
1220
|
};
|
|
1221
|
-
function
|
|
1222
|
-
console.log(`Render de "${t}" na fase "${n}": ${
|
|
1221
|
+
function rn(t, n, s, f, r, i) {
|
|
1222
|
+
console.log(`Render de "${t}" na fase "${n}": ${s}ms`);
|
|
1223
1223
|
}
|
|
1224
|
-
function
|
|
1224
|
+
function Sn({
|
|
1225
1225
|
title: t,
|
|
1226
1226
|
dataSource: n,
|
|
1227
1227
|
// dataSourceEdition,
|
|
1228
|
-
filterOptions:
|
|
1228
|
+
filterOptions: s,
|
|
1229
1229
|
globalFilterFieldNames: f,
|
|
1230
1230
|
//pageSize,
|
|
1231
1231
|
filterFields: r,
|
|
@@ -1235,165 +1235,165 @@ function In({
|
|
|
1235
1235
|
filterType: b = "normal",
|
|
1236
1236
|
isError: h = !1,
|
|
1237
1237
|
error: x = "",
|
|
1238
|
-
clearError:
|
|
1238
|
+
clearError: k = () => {
|
|
1239
1239
|
},
|
|
1240
1240
|
width: o = "100%",
|
|
1241
|
-
height:
|
|
1241
|
+
height: a = "100%",
|
|
1242
1242
|
withBorder: E = !0,
|
|
1243
1243
|
filterPersistenceDelegator: v,
|
|
1244
1244
|
withPagination: F = !0,
|
|
1245
1245
|
radius: m,
|
|
1246
|
-
userActions:
|
|
1246
|
+
userActions: V,
|
|
1247
1247
|
columnsCountBreakPoints: R,
|
|
1248
1248
|
columnsCount: S,
|
|
1249
1249
|
gutter: z,
|
|
1250
|
-
component:
|
|
1251
|
-
activeIndex:
|
|
1250
|
+
component: w,
|
|
1251
|
+
activeIndex: p,
|
|
1252
1252
|
activeBackgroundColor: I,
|
|
1253
|
-
activeColor:
|
|
1254
|
-
onItemEnter:
|
|
1253
|
+
activeColor: re,
|
|
1254
|
+
onItemEnter: Z,
|
|
1255
1255
|
onItemLeave: H,
|
|
1256
1256
|
style: G,
|
|
1257
1257
|
actionsButtonsOptions: P,
|
|
1258
1258
|
spaceOptions: $,
|
|
1259
1259
|
variant: D,
|
|
1260
|
-
id: _ =
|
|
1261
|
-
debugOptions:
|
|
1260
|
+
id: _ = Qt("masonry"),
|
|
1261
|
+
debugOptions: N,
|
|
1262
1262
|
// Props de segurança (opcionais)
|
|
1263
1263
|
resourceName: de,
|
|
1264
1264
|
resourceDescription: ee,
|
|
1265
|
-
requiredPermissions:
|
|
1265
|
+
requiredPermissions: Q,
|
|
1266
1266
|
fallbackComponent: U,
|
|
1267
1267
|
securityOptions: M
|
|
1268
1268
|
}) {
|
|
1269
|
-
const
|
|
1269
|
+
const X = Te(), J = Ee({
|
|
1270
1270
|
autoRegisterActions: M?.autoRegisterActions ?? !0
|
|
1271
|
-
}), [W] = q(_), L = i || pe(null),
|
|
1272
|
-
|
|
1271
|
+
}), [W] = q(_), L = i || pe(null), ie = pe(null), [ve, c] = q(n.getCurrentPage()), [j, Y] = q(
|
|
1272
|
+
p || (n && n.getTotalRecords() > 0 ? 0 : -1)
|
|
1273
1273
|
);
|
|
1274
|
-
|
|
1274
|
+
Xe(L);
|
|
1275
1275
|
const [ue, fe] = q({
|
|
1276
1276
|
activeFilterIndex: -1,
|
|
1277
1277
|
expandedFilter: !1
|
|
1278
|
-
}), [te,
|
|
1279
|
-
isDataSourceV2:
|
|
1280
|
-
v1State: { forceUpdate:
|
|
1278
|
+
}), [te, Se] = q(0), {
|
|
1279
|
+
isDataSourceV2: we,
|
|
1280
|
+
v1State: { forceUpdate: T }
|
|
1281
1281
|
} = Le(
|
|
1282
1282
|
"ArchbaseMasonryTemplate",
|
|
1283
1283
|
n
|
|
1284
1284
|
);
|
|
1285
|
-
|
|
1285
|
+
nt({
|
|
1286
1286
|
dataSource: n,
|
|
1287
1287
|
listener: (l) => {
|
|
1288
|
-
(l.type ===
|
|
1288
|
+
(l.type === ye.afterRemove || l.type === ye.refreshData) && (Se((A) => A + 1), we || T());
|
|
1289
1289
|
}
|
|
1290
1290
|
});
|
|
1291
|
-
const
|
|
1292
|
-
const l = { ...
|
|
1293
|
-
return l.allowAdd && l.onAddExecute &&
|
|
1291
|
+
const oe = De(() => {
|
|
1292
|
+
const l = { ...nn, ...V }, A = [], le = (se) => J.isAvailable ? (J.registerAction(), J.hasPermission()) : !0;
|
|
1293
|
+
return l.allowAdd && l.onAddExecute && le() && A.push({
|
|
1294
1294
|
id: "actAdd",
|
|
1295
1295
|
icon: /* @__PURE__ */ e(ft, {}),
|
|
1296
1296
|
color: "green",
|
|
1297
|
-
label: l.labelAdd ? l.labelAdd :
|
|
1297
|
+
label: l.labelAdd ? l.labelAdd : g().t("archbase:New"),
|
|
1298
1298
|
executeAction: () => {
|
|
1299
1299
|
l && l.onAddExecute && l.onAddExecute();
|
|
1300
1300
|
},
|
|
1301
1301
|
enabled: !0,
|
|
1302
|
-
hint: `${
|
|
1303
|
-
}), l.allowEdit && l.onEditExecute &&
|
|
1302
|
+
hint: `${g().t("archbase:Clique para criar um novo registro")}`
|
|
1303
|
+
}), l.allowEdit && l.onEditExecute && le() && A.push({
|
|
1304
1304
|
id: "actEdit",
|
|
1305
1305
|
icon: /* @__PURE__ */ e(mt, {}),
|
|
1306
1306
|
color: "blue",
|
|
1307
|
-
label: l.labelEdit ? l.labelEdit :
|
|
1307
|
+
label: l.labelEdit ? l.labelEdit : g().t("archbase:Edit"),
|
|
1308
1308
|
executeAction: () => {
|
|
1309
1309
|
l && l.onEditExecute && l.onEditExecute();
|
|
1310
1310
|
},
|
|
1311
1311
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1312
|
-
hint: `${
|
|
1313
|
-
}), l.allowRemove && l.onRemoveExecute &&
|
|
1312
|
+
hint: `${g().t("archbase:Clique para editar o registro")}`
|
|
1313
|
+
}), l.allowRemove && l.onRemoveExecute && le() && A.push({
|
|
1314
1314
|
id: "actRemove",
|
|
1315
|
-
icon: /* @__PURE__ */ e(
|
|
1315
|
+
icon: /* @__PURE__ */ e(et, {}),
|
|
1316
1316
|
color: "red",
|
|
1317
|
-
label: l.labelRemove ? l.labelRemove :
|
|
1317
|
+
label: l.labelRemove ? l.labelRemove : g().t("archbase:Remove"),
|
|
1318
1318
|
executeAction: () => {
|
|
1319
1319
|
l && l.onRemoveExecute && l.onRemoveExecute();
|
|
1320
1320
|
},
|
|
1321
1321
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1322
|
-
hint: `${
|
|
1323
|
-
}), l.allowView && l.onViewExecute &&
|
|
1322
|
+
hint: `${g().t("archbase:Clique para remover o registro")}`
|
|
1323
|
+
}), l.allowView && l.onViewExecute && le() && A.push({
|
|
1324
1324
|
id: "actView",
|
|
1325
|
-
icon: /* @__PURE__ */ e(
|
|
1326
|
-
label: l.labelView ? l.labelView :
|
|
1325
|
+
icon: /* @__PURE__ */ e(gt, {}),
|
|
1326
|
+
label: l.labelView ? l.labelView : g().t("archbase:View"),
|
|
1327
1327
|
executeAction: () => {
|
|
1328
1328
|
l && l.onViewExecute && l.onViewExecute();
|
|
1329
1329
|
},
|
|
1330
1330
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1331
|
-
hint: `${
|
|
1332
|
-
}), l.customUserActions && l.positionCustomUserActions === "before" ? [...l.customUserActions, ...
|
|
1333
|
-
}, [
|
|
1334
|
-
if (
|
|
1335
|
-
const l =
|
|
1336
|
-
let
|
|
1337
|
-
return
|
|
1338
|
-
const Me = `${W}_${
|
|
1339
|
-
let
|
|
1340
|
-
return j >= 0 && (
|
|
1331
|
+
hint: `${g().t("archbase:Clique para visualizar o registro")}`
|
|
1332
|
+
}), l.customUserActions && l.positionCustomUserActions === "before" ? [...l.customUserActions, ...A] : l.customUserActions && l.positionCustomUserActions === "after" ? [...A, ...l.customUserActions] : A;
|
|
1333
|
+
}, [V, n, J]), ze = De(() => {
|
|
1334
|
+
if (w) {
|
|
1335
|
+
const l = w.type;
|
|
1336
|
+
let A = {};
|
|
1337
|
+
return w.props && (A = w.props), n.browseRecords().map((le, se) => {
|
|
1338
|
+
const Me = `${W}_${se}`, je = `${W}_${se}`;
|
|
1339
|
+
let Re = le.active === void 0 ? !1 : le.active;
|
|
1340
|
+
return j >= 0 && (Re = !1, j === se && (Re = !0)), /* @__PURE__ */ e(
|
|
1341
1341
|
l,
|
|
1342
1342
|
{
|
|
1343
|
-
id:
|
|
1344
|
-
active:
|
|
1345
|
-
index:
|
|
1343
|
+
id: je,
|
|
1344
|
+
active: Re,
|
|
1345
|
+
index: se,
|
|
1346
1346
|
dataSource: n,
|
|
1347
|
-
recordData:
|
|
1348
|
-
disabled:
|
|
1349
|
-
...
|
|
1347
|
+
recordData: le,
|
|
1348
|
+
disabled: le.disabled,
|
|
1349
|
+
...A
|
|
1350
1350
|
},
|
|
1351
1351
|
Me
|
|
1352
1352
|
);
|
|
1353
1353
|
});
|
|
1354
1354
|
}
|
|
1355
1355
|
return [];
|
|
1356
|
-
}, [j,
|
|
1357
|
-
fe({ ...ue, currentFilter: l, activeFilterIndex:
|
|
1356
|
+
}, [j, w, W, n, te]), Ve = (l, A) => {
|
|
1357
|
+
fe({ ...ue, currentFilter: l, activeFilterIndex: A });
|
|
1358
1358
|
}, Ue = (l) => {
|
|
1359
1359
|
fe({ ...ue, expandedFilter: l });
|
|
1360
|
-
},
|
|
1361
|
-
fe({ ...ue, currentFilter: l, activeFilterIndex:
|
|
1362
|
-
},
|
|
1363
|
-
},
|
|
1364
|
-
|
|
1365
|
-
},
|
|
1360
|
+
}, Pe = (l, A) => {
|
|
1361
|
+
fe({ ...ue, currentFilter: l, activeFilterIndex: A });
|
|
1362
|
+
}, Ne = () => {
|
|
1363
|
+
}, B = (l, A) => {
|
|
1364
|
+
Y(l), n && n.gotoRecordByData(A);
|
|
1365
|
+
}, lt = (l) => {
|
|
1366
1366
|
if (n) {
|
|
1367
|
-
const
|
|
1368
|
-
|
|
1367
|
+
const A = n.getOptions();
|
|
1368
|
+
A.filter = l, A.currentPage = ve, n.refreshData(A), we || T();
|
|
1369
1369
|
}
|
|
1370
1370
|
}, ne = (l) => {
|
|
1371
1371
|
if (n) {
|
|
1372
|
-
const
|
|
1373
|
-
|
|
1372
|
+
const A = n.getOptions();
|
|
1373
|
+
A.currentPage = l, n.refreshData(A), we || T();
|
|
1374
1374
|
}
|
|
1375
1375
|
}, O = () => b === "normal" && f ? /* @__PURE__ */ e(
|
|
1376
|
-
|
|
1376
|
+
Kt,
|
|
1377
1377
|
{
|
|
1378
1378
|
searchableFields: f,
|
|
1379
|
-
onFilter:
|
|
1379
|
+
onFilter: lt,
|
|
1380
1380
|
minFilterValueLength: 1
|
|
1381
1381
|
}
|
|
1382
|
-
) : b === "advanced" ? /* @__PURE__ */ e(
|
|
1383
|
-
|
|
1382
|
+
) : b === "advanced" ? /* @__PURE__ */ e(Ut, { id: `profile_${s.componentName}`, onRender: rn, children: /* @__PURE__ */ e(
|
|
1383
|
+
xt,
|
|
1384
1384
|
{
|
|
1385
|
-
id:
|
|
1386
|
-
viewName:
|
|
1387
|
-
apiVersion:
|
|
1388
|
-
ref:
|
|
1389
|
-
variant: D ||
|
|
1385
|
+
id: s.componentName,
|
|
1386
|
+
viewName: s.viewName,
|
|
1387
|
+
apiVersion: s.apiVersion,
|
|
1388
|
+
ref: ie,
|
|
1389
|
+
variant: D || X.variant,
|
|
1390
1390
|
expandedFilter: ue.expandedFilter,
|
|
1391
1391
|
persistenceDelegator: v,
|
|
1392
1392
|
currentFilter: ue.currentFilter,
|
|
1393
1393
|
activeFilterIndex: ue.activeFilterIndex,
|
|
1394
|
-
onSelectedFilter:
|
|
1395
|
-
onFilterChanged:
|
|
1396
|
-
onSearchByFilter:
|
|
1394
|
+
onSelectedFilter: Pe,
|
|
1395
|
+
onFilterChanged: Ve,
|
|
1396
|
+
onSearchByFilter: Ne,
|
|
1397
1397
|
onToggleExpandedFilter: Ue,
|
|
1398
1398
|
width: "660px",
|
|
1399
1399
|
height: "170px",
|
|
@@ -1402,51 +1402,51 @@ function In({
|
|
|
1402
1402
|
) }) : /* @__PURE__ */ e($e, {}), me = {
|
|
1403
1403
|
menuButtonColor: "blue.5",
|
|
1404
1404
|
menuPosition: "left"
|
|
1405
|
-
},
|
|
1405
|
+
}, Fe = {
|
|
1406
1406
|
headerFlexGrow: "left",
|
|
1407
1407
|
footerGridColumns: {}
|
|
1408
|
-
},
|
|
1408
|
+
}, be = { ...me, ...P }, Ae = { ...Fe, ...$ };
|
|
1409
1409
|
return /* @__PURE__ */ e(
|
|
1410
|
-
|
|
1410
|
+
Be,
|
|
1411
1411
|
{
|
|
1412
1412
|
resourceName: de,
|
|
1413
1413
|
resourceDescription: ee,
|
|
1414
|
-
requiredPermissions:
|
|
1414
|
+
requiredPermissions: Q,
|
|
1415
1415
|
fallbackComponent: U,
|
|
1416
1416
|
onSecurityReady: M?.onSecurityReady,
|
|
1417
1417
|
onAccessDenied: M?.onAccessDenied,
|
|
1418
1418
|
children: /* @__PURE__ */ e(
|
|
1419
|
-
|
|
1419
|
+
Tt,
|
|
1420
1420
|
{
|
|
1421
1421
|
innerRef: L,
|
|
1422
1422
|
width: o,
|
|
1423
|
-
height:
|
|
1423
|
+
height: a,
|
|
1424
1424
|
radius: m,
|
|
1425
1425
|
withBorder: E,
|
|
1426
1426
|
isError: h,
|
|
1427
1427
|
error: x,
|
|
1428
|
-
clearError:
|
|
1428
|
+
clearError: k,
|
|
1429
1429
|
title: t,
|
|
1430
1430
|
defaultDebug: u,
|
|
1431
|
-
debugOptions:
|
|
1431
|
+
debugOptions: N,
|
|
1432
1432
|
style: G,
|
|
1433
|
-
options:
|
|
1434
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1433
|
+
options: Ae,
|
|
1434
|
+
headerLeft: /* @__PURE__ */ e(It, { actions: oe, options: be }),
|
|
1435
1435
|
headerRight: O(),
|
|
1436
|
-
footerRight: F ? /* @__PURE__ */ e(
|
|
1436
|
+
footerRight: F ? /* @__PURE__ */ e(At, { total: n.getTotalPages(), onChange: ne }) : void 0,
|
|
1437
1437
|
children: /* @__PURE__ */ e(
|
|
1438
|
-
|
|
1438
|
+
_t,
|
|
1439
1439
|
{
|
|
1440
1440
|
value: {
|
|
1441
1441
|
dataSource: n,
|
|
1442
1442
|
ownerId: _,
|
|
1443
|
-
handleSelectItem:
|
|
1443
|
+
handleSelectItem: B,
|
|
1444
1444
|
activeBackgroundColor: I,
|
|
1445
|
-
activeColor:
|
|
1446
|
-
onItemEnter:
|
|
1445
|
+
activeColor: re,
|
|
1446
|
+
onItemEnter: Z,
|
|
1447
1447
|
onItemLeave: H
|
|
1448
1448
|
},
|
|
1449
|
-
children: /* @__PURE__ */ e(
|
|
1449
|
+
children: /* @__PURE__ */ e(Jt, { columnsCountBreakPoints: R, children: /* @__PURE__ */ e(Wt, { gutter: z, columnsCount: S, children: ze }) })
|
|
1450
1450
|
}
|
|
1451
1451
|
)
|
|
1452
1452
|
}
|
|
@@ -1454,7 +1454,7 @@ function In({
|
|
|
1454
1454
|
}
|
|
1455
1455
|
);
|
|
1456
1456
|
}
|
|
1457
|
-
const
|
|
1457
|
+
const on = {
|
|
1458
1458
|
visible: !0,
|
|
1459
1459
|
allowAdd: !0,
|
|
1460
1460
|
allowEdit: !0,
|
|
@@ -1462,11 +1462,11 @@ const ln = {
|
|
|
1462
1462
|
allowRemove: !0,
|
|
1463
1463
|
positionCustomUserActions: "after"
|
|
1464
1464
|
};
|
|
1465
|
-
function
|
|
1465
|
+
function In({
|
|
1466
1466
|
title: t,
|
|
1467
1467
|
dataSource: n,
|
|
1468
1468
|
// dataSourceEdition,
|
|
1469
|
-
filterOptions:
|
|
1469
|
+
filterOptions: s,
|
|
1470
1470
|
//pageSize,
|
|
1471
1471
|
filterFields: f,
|
|
1472
1472
|
innerRef: r,
|
|
@@ -1477,28 +1477,28 @@ function Dn({
|
|
|
1477
1477
|
},
|
|
1478
1478
|
width: h = "100%",
|
|
1479
1479
|
height: x = "100%",
|
|
1480
|
-
withBorder:
|
|
1480
|
+
withBorder: k = !0,
|
|
1481
1481
|
filterPersistenceDelegator: o,
|
|
1482
|
-
withPagination:
|
|
1482
|
+
withPagination: a = !0,
|
|
1483
1483
|
children: E,
|
|
1484
1484
|
radius: v,
|
|
1485
1485
|
userActions: F,
|
|
1486
1486
|
debug: m = !1,
|
|
1487
|
-
variant:
|
|
1487
|
+
variant: V,
|
|
1488
1488
|
actionsButtonsOptions: R,
|
|
1489
1489
|
spaceOptions: S,
|
|
1490
1490
|
style: z,
|
|
1491
|
-
debugOptions:
|
|
1491
|
+
debugOptions: w,
|
|
1492
1492
|
// Props de segurança (opcionais)
|
|
1493
|
-
resourceName:
|
|
1493
|
+
resourceName: p,
|
|
1494
1494
|
resourceDescription: I,
|
|
1495
|
-
requiredPermissions:
|
|
1496
|
-
fallbackComponent:
|
|
1495
|
+
requiredPermissions: re,
|
|
1496
|
+
fallbackComponent: Z,
|
|
1497
1497
|
securityOptions: H
|
|
1498
1498
|
}) {
|
|
1499
|
-
const G =
|
|
1499
|
+
const G = Te(), P = Ee({
|
|
1500
1500
|
autoRegisterActions: H?.autoRegisterActions ?? !0
|
|
1501
|
-
}), $ = r || pe(null), D = pe(null), [_,
|
|
1501
|
+
}), $ = r || pe(null), D = pe(null), [_, N] = q({
|
|
1502
1502
|
activeFilterIndex: -1,
|
|
1503
1503
|
expandedFilter: !1
|
|
1504
1504
|
}), {
|
|
@@ -1507,55 +1507,55 @@ function Dn({
|
|
|
1507
1507
|
} = Le(
|
|
1508
1508
|
"ArchbasePanelTemplate",
|
|
1509
1509
|
n
|
|
1510
|
-
),
|
|
1511
|
-
const
|
|
1512
|
-
return
|
|
1510
|
+
), Q = De(() => {
|
|
1511
|
+
const c = { ...on, ...F }, j = (ue) => P.isAvailable ? (P.registerAction(), P.hasPermission()) : !0, Y = [];
|
|
1512
|
+
return c.allowAdd && c.onAddExecute && j() && Y.push({
|
|
1513
1513
|
id: "1",
|
|
1514
1514
|
icon: /* @__PURE__ */ e(ft, {}),
|
|
1515
1515
|
color: "green",
|
|
1516
|
-
label:
|
|
1516
|
+
label: c.labelAdd ? c.labelAdd : g().t("archbase:New"),
|
|
1517
1517
|
executeAction: () => {
|
|
1518
|
-
|
|
1518
|
+
c && c.onAddExecute && c.onAddExecute();
|
|
1519
1519
|
},
|
|
1520
1520
|
enabled: !0,
|
|
1521
1521
|
hint: "Clique para criar."
|
|
1522
|
-
}),
|
|
1522
|
+
}), c.allowEdit && c.onEditExecute && j() && Y.push({
|
|
1523
1523
|
id: "2",
|
|
1524
1524
|
icon: /* @__PURE__ */ e(mt, {}),
|
|
1525
1525
|
color: "blue",
|
|
1526
|
-
label:
|
|
1526
|
+
label: c.labelEdit ? c.labelEdit : g().t("archbase:Edit"),
|
|
1527
1527
|
executeAction: () => {
|
|
1528
|
-
|
|
1528
|
+
c && c.onEditExecute && c.onEditExecute();
|
|
1529
1529
|
},
|
|
1530
1530
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1531
1531
|
hint: "Clique para editar."
|
|
1532
|
-
}),
|
|
1532
|
+
}), c.allowRemove && c.onRemoveExecute && j() && Y.push({
|
|
1533
1533
|
id: "3",
|
|
1534
|
-
icon: /* @__PURE__ */ e(
|
|
1534
|
+
icon: /* @__PURE__ */ e(et, {}),
|
|
1535
1535
|
color: "red",
|
|
1536
|
-
label:
|
|
1536
|
+
label: c.labelRemove ? c.labelRemove : g().t("archbase:Remove"),
|
|
1537
1537
|
executeAction: () => {
|
|
1538
|
-
|
|
1538
|
+
c && c.onRemoveExecute && c.onRemoveExecute();
|
|
1539
1539
|
},
|
|
1540
1540
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1541
1541
|
hint: "Clique para remover."
|
|
1542
|
-
}),
|
|
1542
|
+
}), c.allowView && c.onView && j() && Y.push({
|
|
1543
1543
|
id: "4",
|
|
1544
|
-
icon: /* @__PURE__ */ e(
|
|
1544
|
+
icon: /* @__PURE__ */ e(gt, {}),
|
|
1545
1545
|
color: "green",
|
|
1546
|
-
label:
|
|
1546
|
+
label: c.labelView ? c.labelView : g().t("archbase:View"),
|
|
1547
1547
|
executeAction: () => {
|
|
1548
|
-
|
|
1548
|
+
c && c.onView && c.onView();
|
|
1549
1549
|
},
|
|
1550
1550
|
enabled: !n.isEmpty() && n.isBrowsing(),
|
|
1551
1551
|
hint: "Clique para visualizar."
|
|
1552
|
-
}),
|
|
1553
|
-
}, [F, n, P]), U = (
|
|
1554
|
-
|
|
1555
|
-
}, M = (
|
|
1556
|
-
|
|
1557
|
-
},
|
|
1558
|
-
|
|
1552
|
+
}), c.customUserActions && c.positionCustomUserActions === "before" ? [...c.customUserActions, ...Y] : c.customUserActions && c.positionCustomUserActions === "after" ? [...Y, ...c.customUserActions] : Y;
|
|
1553
|
+
}, [F, n, P]), U = (c, j) => {
|
|
1554
|
+
N({ ..._, currentFilter: c, activeFilterIndex: j });
|
|
1555
|
+
}, M = (c) => {
|
|
1556
|
+
N({ ..._, expandedFilter: c });
|
|
1557
|
+
}, X = (c, j) => {
|
|
1558
|
+
N({ ..._, currentFilter: c, activeFilterIndex: j });
|
|
1559
1559
|
}, J = () => {
|
|
1560
1560
|
}, W = {
|
|
1561
1561
|
menuButtonColor: "blue.5",
|
|
@@ -1564,46 +1564,46 @@ function Dn({
|
|
|
1564
1564
|
headerFlexGrow: "left",
|
|
1565
1565
|
footerFlexGrow: "right"
|
|
1566
1566
|
// footerGridColumns: {},
|
|
1567
|
-
},
|
|
1567
|
+
}, ie = { ...W, ...R }, ve = { ...L, ...S };
|
|
1568
1568
|
return /* @__PURE__ */ e(
|
|
1569
|
-
|
|
1569
|
+
Be,
|
|
1570
1570
|
{
|
|
1571
|
-
resourceName:
|
|
1571
|
+
resourceName: p,
|
|
1572
1572
|
resourceDescription: I,
|
|
1573
|
-
requiredPermissions:
|
|
1574
|
-
fallbackComponent:
|
|
1573
|
+
requiredPermissions: re,
|
|
1574
|
+
fallbackComponent: Z,
|
|
1575
1575
|
onSecurityReady: H?.onSecurityReady,
|
|
1576
1576
|
onAccessDenied: H?.onAccessDenied,
|
|
1577
1577
|
children: /* @__PURE__ */ e(
|
|
1578
|
-
|
|
1578
|
+
Tt,
|
|
1579
1579
|
{
|
|
1580
1580
|
innerRef: $,
|
|
1581
1581
|
width: h,
|
|
1582
1582
|
height: x,
|
|
1583
1583
|
radius: v,
|
|
1584
|
-
withBorder:
|
|
1584
|
+
withBorder: k,
|
|
1585
1585
|
isError: i,
|
|
1586
1586
|
error: u,
|
|
1587
1587
|
clearError: b,
|
|
1588
1588
|
title: t,
|
|
1589
1589
|
defaultDebug: m,
|
|
1590
|
-
debugOptions:
|
|
1590
|
+
debugOptions: w,
|
|
1591
1591
|
style: z,
|
|
1592
|
-
options:
|
|
1593
|
-
headerLeft: /* @__PURE__ */ e(
|
|
1592
|
+
options: ve,
|
|
1593
|
+
headerLeft: /* @__PURE__ */ e(It, { actions: Q, options: ie }),
|
|
1594
1594
|
headerRight: /* @__PURE__ */ e(
|
|
1595
|
-
|
|
1595
|
+
xt,
|
|
1596
1596
|
{
|
|
1597
|
-
id:
|
|
1598
|
-
viewName:
|
|
1599
|
-
apiVersion:
|
|
1597
|
+
id: s.componentName,
|
|
1598
|
+
viewName: s.viewName,
|
|
1599
|
+
apiVersion: s.apiVersion,
|
|
1600
1600
|
ref: D,
|
|
1601
|
-
variant:
|
|
1601
|
+
variant: V || G.variant,
|
|
1602
1602
|
expandedFilter: _.expandedFilter,
|
|
1603
1603
|
persistenceDelegator: o,
|
|
1604
1604
|
currentFilter: _.currentFilter,
|
|
1605
1605
|
activeFilterIndex: _.activeFilterIndex,
|
|
1606
|
-
onSelectedFilter:
|
|
1606
|
+
onSelectedFilter: X,
|
|
1607
1607
|
onFilterChanged: U,
|
|
1608
1608
|
onSearchByFilter: J,
|
|
1609
1609
|
onToggleExpandedFilter: M,
|
|
@@ -1612,20 +1612,20 @@ function Dn({
|
|
|
1612
1612
|
children: f
|
|
1613
1613
|
}
|
|
1614
1614
|
),
|
|
1615
|
-
footerRight:
|
|
1615
|
+
footerRight: a && /* @__PURE__ */ e(At, { total: 10 }),
|
|
1616
1616
|
children: E
|
|
1617
1617
|
}
|
|
1618
1618
|
)
|
|
1619
1619
|
}
|
|
1620
1620
|
);
|
|
1621
1621
|
}
|
|
1622
|
-
function
|
|
1622
|
+
function Dn() {
|
|
1623
1623
|
return /* @__PURE__ */ e("div", { children: "SEARCH TEMPLATE" });
|
|
1624
1624
|
}
|
|
1625
|
-
function
|
|
1625
|
+
function ln(t, n) {
|
|
1626
1626
|
const {
|
|
1627
1627
|
// Props obrigatórias
|
|
1628
|
-
opened:
|
|
1628
|
+
opened: s,
|
|
1629
1629
|
title: f,
|
|
1630
1630
|
children: r,
|
|
1631
1631
|
onClose: i,
|
|
@@ -1634,24 +1634,24 @@ function sn(t, n) {
|
|
|
1634
1634
|
// Seleção
|
|
1635
1635
|
selectionMode: h = "single",
|
|
1636
1636
|
onSelect: x,
|
|
1637
|
-
onSelectMultiple:
|
|
1637
|
+
onSelectMultiple: k,
|
|
1638
1638
|
initialSelectedItems: o,
|
|
1639
|
-
selectOnDoubleClick:
|
|
1639
|
+
selectOnDoubleClick: a = !0,
|
|
1640
1640
|
onBeforeConfirm: E,
|
|
1641
1641
|
onAfterConfirm: v,
|
|
1642
1642
|
// DataSource
|
|
1643
1643
|
dataSource: F,
|
|
1644
1644
|
loadData: m,
|
|
1645
|
-
searchFields:
|
|
1645
|
+
searchFields: V = "",
|
|
1646
1646
|
pageSize: R = 100,
|
|
1647
1647
|
// Aparência
|
|
1648
1648
|
displaySubField: S,
|
|
1649
1649
|
renderSelectedItem: z,
|
|
1650
|
-
renderSelectedItems:
|
|
1651
|
-
icon:
|
|
1650
|
+
renderSelectedItems: w,
|
|
1651
|
+
icon: p,
|
|
1652
1652
|
modalSize: I = "70%",
|
|
1653
|
-
modalHeight:
|
|
1654
|
-
gridHeight:
|
|
1653
|
+
modalHeight: re = "600px",
|
|
1654
|
+
gridHeight: Z = 400,
|
|
1655
1655
|
rowHeight: H,
|
|
1656
1656
|
selectionIndicatorColor: G = "blue.0",
|
|
1657
1657
|
showSelectionIndicator: P = !0,
|
|
@@ -1660,30 +1660,30 @@ function sn(t, n) {
|
|
|
1660
1660
|
showSelectionCount: D = !0,
|
|
1661
1661
|
allowClearAll: _ = !0,
|
|
1662
1662
|
// Estado
|
|
1663
|
-
isLoading:
|
|
1663
|
+
isLoading: N,
|
|
1664
1664
|
isError: de = !1,
|
|
1665
1665
|
error: ee = "",
|
|
1666
|
-
clearError:
|
|
1666
|
+
clearError: Q,
|
|
1667
1667
|
autoCloseAlertError: U = 15e3,
|
|
1668
1668
|
onError: M,
|
|
1669
1669
|
// Customização
|
|
1670
|
-
userActions:
|
|
1670
|
+
userActions: X,
|
|
1671
1671
|
labels: J,
|
|
1672
1672
|
variant: W,
|
|
1673
1673
|
// Segurança
|
|
1674
1674
|
resourceName: L,
|
|
1675
|
-
resourceDescription:
|
|
1676
|
-
requiredPermissions:
|
|
1677
|
-
fallbackComponent:
|
|
1675
|
+
resourceDescription: ie,
|
|
1676
|
+
requiredPermissions: ve,
|
|
1677
|
+
fallbackComponent: c,
|
|
1678
1678
|
securityOptions: j
|
|
1679
|
-
} = t,
|
|
1679
|
+
} = t, Y = Te(), ue = tt(), { colorScheme: fe } = Ze(), te = ht(), [Se, we] = q(!1), [T, oe] = q(o || []), [ze, Ve] = q(!1), [Ue, Pe] = q(""), Ne = pe(null), B = !!F, ne = K(() => B && F ? F : (Ne.current || (Ne.current = new jt("dsLookup", {
|
|
1680
1680
|
records: [],
|
|
1681
1681
|
grandTotalRecords: 0,
|
|
1682
1682
|
currentPage: 0,
|
|
1683
1683
|
totalPages: 0,
|
|
1684
1684
|
pageSize: R
|
|
1685
|
-
})),
|
|
1686
|
-
|
|
1685
|
+
})), Ne.current), [B, F, R])();
|
|
1686
|
+
Ee({
|
|
1687
1687
|
autoRegisterActions: j?.autoRegisterActions ?? !0
|
|
1688
1688
|
});
|
|
1689
1689
|
const O = Le(
|
|
@@ -1692,171 +1692,171 @@ function sn(t, n) {
|
|
|
1692
1692
|
void 0,
|
|
1693
1693
|
void 0
|
|
1694
1694
|
);
|
|
1695
|
-
|
|
1695
|
+
nt({
|
|
1696
1696
|
dataSource: ne,
|
|
1697
|
-
listener: (
|
|
1698
|
-
if (
|
|
1697
|
+
listener: (y) => {
|
|
1698
|
+
if (y.type === ye.onError && (Ve(!0), Pe(y.error || "")), y.type === ye.afterScroll) {
|
|
1699
1699
|
if (h === "single") {
|
|
1700
|
-
const
|
|
1701
|
-
|
|
1700
|
+
const d = ne.getCurrentRecord();
|
|
1701
|
+
d && oe([d]);
|
|
1702
1702
|
}
|
|
1703
1703
|
O.isDataSourceV2 || te();
|
|
1704
1704
|
}
|
|
1705
1705
|
}
|
|
1706
1706
|
});
|
|
1707
1707
|
const me = {
|
|
1708
|
-
okButton:
|
|
1709
|
-
cancelButton:
|
|
1710
|
-
clearButton:
|
|
1711
|
-
selectedLabel:
|
|
1712
|
-
doubleClickHint:
|
|
1713
|
-
noItemSelected:
|
|
1714
|
-
itemsSelected:
|
|
1708
|
+
okButton: g().t("archbase:Ok"),
|
|
1709
|
+
cancelButton: g().t("archbase:Cancel"),
|
|
1710
|
+
clearButton: g().t("archbase:Clear"),
|
|
1711
|
+
selectedLabel: g().t("archbase:Selected"),
|
|
1712
|
+
doubleClickHint: g().t("archbase:Double click to select"),
|
|
1713
|
+
noItemSelected: g().t("archbase:No item selected"),
|
|
1714
|
+
itemsSelected: g().t("archbase:items selected"),
|
|
1715
1715
|
...J
|
|
1716
|
-
},
|
|
1717
|
-
async (
|
|
1718
|
-
if (!(
|
|
1719
|
-
|
|
1716
|
+
}, Fe = K(
|
|
1717
|
+
async (y) => {
|
|
1718
|
+
if (!(B || !m)) {
|
|
1719
|
+
we(!0);
|
|
1720
1720
|
try {
|
|
1721
|
-
const
|
|
1721
|
+
const d = await m(y, V);
|
|
1722
1722
|
ne.open({
|
|
1723
|
-
records:
|
|
1724
|
-
grandTotalRecords:
|
|
1723
|
+
records: d,
|
|
1724
|
+
grandTotalRecords: d.length,
|
|
1725
1725
|
currentPage: 0,
|
|
1726
|
-
totalPages: Math.ceil(
|
|
1726
|
+
totalPages: Math.ceil(d.length / R),
|
|
1727
1727
|
pageSize: R
|
|
1728
1728
|
});
|
|
1729
|
-
} catch (
|
|
1730
|
-
|
|
1729
|
+
} catch (d) {
|
|
1730
|
+
Ve(!0), Pe(xe(d)), M?.(d);
|
|
1731
1731
|
} finally {
|
|
1732
|
-
|
|
1732
|
+
we(!1);
|
|
1733
1733
|
}
|
|
1734
1734
|
}
|
|
1735
1735
|
},
|
|
1736
|
-
[
|
|
1737
|
-
),
|
|
1738
|
-
(
|
|
1739
|
-
const
|
|
1740
|
-
m && !
|
|
1736
|
+
[B, m, V, R, ne, M]
|
|
1737
|
+
), be = K(
|
|
1738
|
+
(y) => {
|
|
1739
|
+
const d = y?.quickFilterValues?.[0] || "";
|
|
1740
|
+
m && !B && Fe(d);
|
|
1741
1741
|
},
|
|
1742
|
-
[m,
|
|
1742
|
+
[m, B, Fe]
|
|
1743
1743
|
);
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
}, [
|
|
1747
|
-
o &&
|
|
1744
|
+
Ye(() => {
|
|
1745
|
+
s && (o?.length ? oe(o) : oe([]), Fe());
|
|
1746
|
+
}, [s]), Ye(() => {
|
|
1747
|
+
o && oe(o);
|
|
1748
1748
|
}, [o]);
|
|
1749
|
-
const
|
|
1750
|
-
(
|
|
1751
|
-
h === "single" ?
|
|
1749
|
+
const Ae = K(
|
|
1750
|
+
(y) => {
|
|
1751
|
+
h === "single" ? oe(y.slice(0, 1)) : $ && y.length > $ ? oe(y.slice(0, $)) : oe(y);
|
|
1752
1752
|
},
|
|
1753
1753
|
[h, $]
|
|
1754
1754
|
), l = K(
|
|
1755
|
-
(
|
|
1756
|
-
if (h === "single" &&
|
|
1757
|
-
const
|
|
1758
|
-
|
|
1755
|
+
(y) => {
|
|
1756
|
+
if (h === "single" && a) {
|
|
1757
|
+
const d = ne.getCurrentRecord();
|
|
1758
|
+
d && (x?.(d), i());
|
|
1759
1759
|
}
|
|
1760
1760
|
},
|
|
1761
|
-
[h,
|
|
1762
|
-
),
|
|
1763
|
-
|
|
1764
|
-
}, []),
|
|
1765
|
-
E && !await E(
|
|
1766
|
-
}, [
|
|
1761
|
+
[h, a, ne, x, i]
|
|
1762
|
+
), A = K(() => {
|
|
1763
|
+
oe([]);
|
|
1764
|
+
}, []), le = K(async () => {
|
|
1765
|
+
E && !await E(T) || (h === "single" ? T.length > 0 && x?.(T[0]) : k?.(T), v?.(T), i());
|
|
1766
|
+
}, [T, h, x, k, E, v, i]), se = K(() => {
|
|
1767
1767
|
i();
|
|
1768
1768
|
}, [i]), Me = () => {
|
|
1769
|
-
|
|
1770
|
-
},
|
|
1771
|
-
|
|
1769
|
+
pt.showWarning(g().t("archbase:Click on Ok or Cancel to close"));
|
|
1770
|
+
}, je = () => {
|
|
1771
|
+
Q?.(), Ve(!1), Pe("");
|
|
1772
1772
|
};
|
|
1773
|
-
|
|
1773
|
+
Rt(
|
|
1774
1774
|
n,
|
|
1775
1775
|
() => ({
|
|
1776
|
-
getSelectedItems: () =>
|
|
1777
|
-
getSelectedItem: () =>
|
|
1778
|
-
clearSelection: () =>
|
|
1779
|
-
selectItems: (
|
|
1780
|
-
selectItem: (
|
|
1781
|
-
deselectItem: (
|
|
1782
|
-
|
|
1776
|
+
getSelectedItems: () => T,
|
|
1777
|
+
getSelectedItem: () => T[0] || null,
|
|
1778
|
+
clearSelection: () => oe([]),
|
|
1779
|
+
selectItems: (y) => Ae(y),
|
|
1780
|
+
selectItem: (y) => oe([y]),
|
|
1781
|
+
deselectItem: (y) => {
|
|
1782
|
+
oe((d) => d.filter((ge) => ge[u] !== y[u]));
|
|
1783
1783
|
},
|
|
1784
|
-
refreshData: () =>
|
|
1784
|
+
refreshData: () => Fe(),
|
|
1785
1785
|
getDataSource: () => ne,
|
|
1786
1786
|
confirmSelection: async () => {
|
|
1787
|
-
await
|
|
1787
|
+
await le();
|
|
1788
1788
|
},
|
|
1789
|
-
cancelSelection:
|
|
1789
|
+
cancelSelection: se
|
|
1790
1790
|
}),
|
|
1791
|
-
[
|
|
1791
|
+
[T, Ae, u, Fe, ne, le, se]
|
|
1792
1792
|
);
|
|
1793
|
-
const
|
|
1794
|
-
(
|
|
1795
|
-
const
|
|
1796
|
-
return
|
|
1793
|
+
const Re = K(
|
|
1794
|
+
(y) => {
|
|
1795
|
+
const d = y[u];
|
|
1796
|
+
return d !== void 0 ? d : "";
|
|
1797
1797
|
},
|
|
1798
1798
|
[u]
|
|
1799
|
-
),
|
|
1800
|
-
|
|
1799
|
+
), qe = N || Se, st = ee || Ue, at = de || ze, ct = /* @__PURE__ */ C(ce, { gap: "sm", children: [
|
|
1800
|
+
p,
|
|
1801
1801
|
/* @__PURE__ */ e(ke, { fw: 600, children: f })
|
|
1802
|
-
] }),
|
|
1802
|
+
] }), dt = () => {
|
|
1803
1803
|
if (!P)
|
|
1804
1804
|
return null;
|
|
1805
|
-
if (h === "single" &&
|
|
1806
|
-
return z(
|
|
1807
|
-
if (h === "multiple" &&
|
|
1808
|
-
return
|
|
1809
|
-
if (h === "single" &&
|
|
1810
|
-
const
|
|
1811
|
-
return /* @__PURE__ */ e(
|
|
1805
|
+
if (h === "single" && T.length > 0 && z)
|
|
1806
|
+
return z(T[0]);
|
|
1807
|
+
if (h === "multiple" && T.length > 0 && w)
|
|
1808
|
+
return w(T);
|
|
1809
|
+
if (h === "single" && T.length > 0) {
|
|
1810
|
+
const y = T[0];
|
|
1811
|
+
return /* @__PURE__ */ e(We, { withBorder: !0, p: "sm", radius: "md", bg: G, children: /* @__PURE__ */ C(ce, { justify: "space-between", children: [
|
|
1812
1812
|
/* @__PURE__ */ C(ce, { gap: "xs", children: [
|
|
1813
|
-
/* @__PURE__ */ e(
|
|
1813
|
+
/* @__PURE__ */ e(He, { size: 16, color: "green" }),
|
|
1814
1814
|
/* @__PURE__ */ C(ke, { size: "sm", fw: 500, children: [
|
|
1815
1815
|
me.selectedLabel,
|
|
1816
1816
|
":"
|
|
1817
1817
|
] }),
|
|
1818
|
-
/* @__PURE__ */ e(ke, { size: "sm", fw: 600, children: String(
|
|
1819
|
-
S && /* @__PURE__ */ e(ke, { size: "sm", c: "dimmed", children: String(
|
|
1818
|
+
/* @__PURE__ */ e(ke, { size: "sm", fw: 600, children: String(y[b]) }),
|
|
1819
|
+
S && /* @__PURE__ */ e(ke, { size: "sm", c: "dimmed", children: String(y[S] || "") })
|
|
1820
1820
|
] }),
|
|
1821
1821
|
/* @__PURE__ */ e(ke, { size: "xs", c: "dimmed", children: me.doubleClickHint })
|
|
1822
1822
|
] }) });
|
|
1823
1823
|
}
|
|
1824
|
-
return h === "multiple" &&
|
|
1824
|
+
return h === "multiple" && T.length > 0 ? /* @__PURE__ */ e(We, { withBorder: !0, p: "sm", radius: "md", bg: G, children: /* @__PURE__ */ C(ce, { justify: "space-between", children: [
|
|
1825
1825
|
/* @__PURE__ */ C(ce, { gap: "xs", children: [
|
|
1826
|
-
/* @__PURE__ */ e(
|
|
1826
|
+
/* @__PURE__ */ e(He, { size: 16, color: "green" }),
|
|
1827
1827
|
/* @__PURE__ */ C(ke, { size: "sm", fw: 500, children: [
|
|
1828
|
-
|
|
1828
|
+
T.length,
|
|
1829
1829
|
" ",
|
|
1830
1830
|
me.itemsSelected
|
|
1831
1831
|
] })
|
|
1832
1832
|
] }),
|
|
1833
1833
|
_ && /* @__PURE__ */ e(
|
|
1834
|
-
|
|
1834
|
+
Je,
|
|
1835
1835
|
{
|
|
1836
1836
|
size: "xs",
|
|
1837
1837
|
variant: "subtle",
|
|
1838
1838
|
color: "red",
|
|
1839
|
-
leftSection: /* @__PURE__ */ e(
|
|
1840
|
-
onClick:
|
|
1839
|
+
leftSection: /* @__PURE__ */ e(et, { size: 14 }),
|
|
1840
|
+
onClick: A,
|
|
1841
1841
|
children: me.clearButton
|
|
1842
1842
|
}
|
|
1843
1843
|
)
|
|
1844
1844
|
] }) }) : null;
|
|
1845
1845
|
};
|
|
1846
1846
|
return /* @__PURE__ */ e(
|
|
1847
|
-
|
|
1847
|
+
Be,
|
|
1848
1848
|
{
|
|
1849
1849
|
resourceName: L,
|
|
1850
|
-
resourceDescription:
|
|
1851
|
-
requiredPermissions:
|
|
1852
|
-
fallbackComponent:
|
|
1850
|
+
resourceDescription: ie,
|
|
1851
|
+
requiredPermissions: ve,
|
|
1852
|
+
fallbackComponent: c,
|
|
1853
1853
|
onSecurityReady: j?.onSecurityReady,
|
|
1854
1854
|
onAccessDenied: j?.onAccessDenied,
|
|
1855
|
-
children: /* @__PURE__ */
|
|
1855
|
+
children: /* @__PURE__ */ e(
|
|
1856
1856
|
ut,
|
|
1857
1857
|
{
|
|
1858
|
-
title:
|
|
1859
|
-
opened:
|
|
1858
|
+
title: ct,
|
|
1859
|
+
opened: s,
|
|
1860
1860
|
onClose: Me,
|
|
1861
1861
|
size: I,
|
|
1862
1862
|
centered: !0,
|
|
@@ -1867,126 +1867,124 @@ function sn(t, n) {
|
|
|
1867
1867
|
color: fe === "dark" ? ue.colors.dark[7] : ue.colors.gray[6],
|
|
1868
1868
|
opacity: 0.25
|
|
1869
1869
|
},
|
|
1870
|
-
children: [
|
|
1871
|
-
/* @__PURE__ */ e(
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1870
|
+
children: /* @__PURE__ */ C(rt, { height: re, children: [
|
|
1871
|
+
at && /* @__PURE__ */ e(bt, { size: "100px", children: /* @__PURE__ */ e(
|
|
1872
|
+
Ke,
|
|
1873
|
+
{
|
|
1874
|
+
autoClose: U,
|
|
1875
|
+
withCloseButton: !0,
|
|
1876
|
+
withBorder: !0,
|
|
1877
|
+
icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
|
|
1878
|
+
title: g().t("archbase:WARNING"),
|
|
1879
|
+
titleColor: "rgb(250, 82, 82)",
|
|
1880
|
+
variant: W ?? Y.variant,
|
|
1881
|
+
onClose: je,
|
|
1882
|
+
children: /* @__PURE__ */ e("span", { children: st })
|
|
1883
|
+
}
|
|
1884
|
+
) }),
|
|
1885
|
+
/* @__PURE__ */ e(it, { children: /* @__PURE__ */ C(Vt, { gap: "md", h: "100%", children: [
|
|
1886
|
+
X && /* @__PURE__ */ e(ce, { justify: "flex-end", children: X }),
|
|
1887
|
+
/* @__PURE__ */ e(
|
|
1888
|
+
St,
|
|
1875
1889
|
{
|
|
1876
|
-
|
|
1877
|
-
|
|
1890
|
+
dataSource: ne,
|
|
1891
|
+
height: Z,
|
|
1892
|
+
rowHeight: H,
|
|
1878
1893
|
withBorder: !0,
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1894
|
+
striped: !0,
|
|
1895
|
+
highlightOnHover: !0,
|
|
1896
|
+
isLoading: qe,
|
|
1897
|
+
enableRowSelection: h === "multiple",
|
|
1898
|
+
enableRowNumbers: !0,
|
|
1899
|
+
enableColumnFilterModes: !0,
|
|
1900
|
+
enableTopToolbar: !0,
|
|
1901
|
+
enableGlobalFilter: !0,
|
|
1902
|
+
getRowId: Re,
|
|
1903
|
+
onCellDoubleClick: l,
|
|
1904
|
+
onSelectedRowsChanged: h === "multiple" ? Ae : void 0,
|
|
1905
|
+
onFilterModelChange: be,
|
|
1906
|
+
children: r
|
|
1885
1907
|
}
|
|
1886
|
-
)
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1908
|
+
),
|
|
1909
|
+
dt()
|
|
1910
|
+
] }) }),
|
|
1911
|
+
/* @__PURE__ */ e(ot, { size: "50px", children: /* @__PURE__ */ C(Ce, { justify: "space-between", align: "center", children: [
|
|
1912
|
+
/* @__PURE__ */ e(ce, {}),
|
|
1913
|
+
/* @__PURE__ */ C(ce, { gap: "md", children: [
|
|
1914
|
+
/* @__PURE__ */ e(
|
|
1915
|
+
he,
|
|
1891
1916
|
{
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
enableColumnFilterModes: !0,
|
|
1901
|
-
enableTopToolbar: !0,
|
|
1902
|
-
enableGlobalFilter: !0,
|
|
1903
|
-
getRowId: Fe,
|
|
1904
|
-
onCellDoubleClick: l,
|
|
1905
|
-
onSelectedRowsChanged: h === "multiple" ? we : void 0,
|
|
1906
|
-
onFilterModelChange: ge,
|
|
1907
|
-
children: r
|
|
1917
|
+
actionName: "confirm",
|
|
1918
|
+
actionDescription: "Confirmar seleção",
|
|
1919
|
+
leftSection: /* @__PURE__ */ e(He, {}),
|
|
1920
|
+
onClick: le,
|
|
1921
|
+
disabled: T.length === 0,
|
|
1922
|
+
variant: W ?? Y.variant,
|
|
1923
|
+
color: "green",
|
|
1924
|
+
children: me.okButton
|
|
1908
1925
|
}
|
|
1909
1926
|
),
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
children: me.okButton
|
|
1926
|
-
}
|
|
1927
|
-
),
|
|
1928
|
-
/* @__PURE__ */ e(
|
|
1929
|
-
he,
|
|
1930
|
-
{
|
|
1931
|
-
actionName: "cancel",
|
|
1932
|
-
actionDescription: "Cancelar seleção",
|
|
1933
|
-
leftSection: /* @__PURE__ */ e(Ge, {}),
|
|
1934
|
-
onClick: ae,
|
|
1935
|
-
variant: W ?? Z.variant,
|
|
1936
|
-
color: "red",
|
|
1937
|
-
children: me.cancelButton
|
|
1938
|
-
}
|
|
1939
|
-
)
|
|
1940
|
-
] })
|
|
1941
|
-
] }) })
|
|
1942
|
-
] })
|
|
1943
|
-
]
|
|
1927
|
+
/* @__PURE__ */ e(
|
|
1928
|
+
he,
|
|
1929
|
+
{
|
|
1930
|
+
actionName: "cancel",
|
|
1931
|
+
actionDescription: "Cancelar seleção",
|
|
1932
|
+
leftSection: /* @__PURE__ */ e(Ge, {}),
|
|
1933
|
+
onClick: se,
|
|
1934
|
+
variant: W ?? Y.variant,
|
|
1935
|
+
color: "red",
|
|
1936
|
+
children: me.cancelButton
|
|
1937
|
+
}
|
|
1938
|
+
)
|
|
1939
|
+
] })
|
|
1940
|
+
] }) })
|
|
1941
|
+
] })
|
|
1944
1942
|
}
|
|
1945
1943
|
)
|
|
1946
1944
|
}
|
|
1947
1945
|
);
|
|
1948
1946
|
}
|
|
1949
|
-
const
|
|
1950
|
-
function
|
|
1951
|
-
const [n,
|
|
1952
|
-
|
|
1947
|
+
const Tn = Ft(ln), Ct = Mt(void 0);
|
|
1948
|
+
function Bn({ children: t }) {
|
|
1949
|
+
const [n, s] = q({}), f = K((b, h) => {
|
|
1950
|
+
s((x) => ({ ...x, [b]: h }));
|
|
1953
1951
|
}, []), r = K((b) => {
|
|
1954
|
-
|
|
1952
|
+
s((h) => {
|
|
1955
1953
|
const x = { ...h };
|
|
1956
1954
|
return delete x[b], x;
|
|
1957
1955
|
});
|
|
1958
1956
|
}, []), i = K(() => {
|
|
1959
|
-
|
|
1957
|
+
s({});
|
|
1960
1958
|
}, []), u = K((b) => n[b], [n]);
|
|
1961
|
-
return /* @__PURE__ */ e(
|
|
1959
|
+
return /* @__PURE__ */ e(Ct.Provider, { value: { errors: n, setError: f, clearError: r, clearAll: i, getError: u }, children: t });
|
|
1962
1960
|
}
|
|
1963
|
-
function
|
|
1964
|
-
return
|
|
1961
|
+
function Vn() {
|
|
1962
|
+
return Et(Ct);
|
|
1965
1963
|
}
|
|
1966
|
-
function
|
|
1967
|
-
const t =
|
|
1964
|
+
function Pn() {
|
|
1965
|
+
const t = Et(Ct);
|
|
1968
1966
|
if (!t)
|
|
1969
1967
|
throw new Error("useRequiredValidationErrors must be used within ValidationErrorsProvider");
|
|
1970
1968
|
return t;
|
|
1971
1969
|
}
|
|
1972
1970
|
export {
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1971
|
+
wn as ArchbaseAdvancedSmartButton,
|
|
1972
|
+
Be as ArchbaseConditionalSecurityWrapper,
|
|
1973
|
+
Fn as ArchbaseFormModalTemplate,
|
|
1974
|
+
yn as ArchbaseFormTemplate,
|
|
1975
|
+
En as ArchbaseGridTemplate,
|
|
1976
|
+
Tn as ArchbaseLookupDataTemplate,
|
|
1977
|
+
Sn as ArchbaseMasonryTemplate,
|
|
1978
|
+
Rn as ArchbaseModalTemplate,
|
|
1979
|
+
In as ArchbasePanelTemplate,
|
|
1980
|
+
Dn as ArchbaseSearchTemplate,
|
|
1983
1981
|
he as ArchbaseSmartActionButton,
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1982
|
+
Tt as ArchbaseSpaceTemplate,
|
|
1983
|
+
Bn as ValidationErrorsProvider,
|
|
1984
|
+
vn as useArchbaseLookup,
|
|
1985
|
+
An as useConditionalSecurity,
|
|
1986
|
+
Ee as useOptionalTemplateSecurity,
|
|
1987
|
+
Pn as useRequiredValidationErrors,
|
|
1988
|
+
Cn as useTemplateSecurityAvailable,
|
|
1989
|
+
Vn as useValidationErrors
|
|
1992
1990
|
};
|