@archbase/template 3.0.10 → 3.0.11

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