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