@archbase/template 3.0.7 → 3.0.9

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