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