@archbase/template 3.0.12 → 3.0.14

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