@archbase/template 3.0.25 → 4.0.1

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 Me, jsxs as c } from "react/jsx-runtime";
2
- import { Button as We, Paper as Le, Box as he, Flex as pe, Group as oe, ActionIcon as pt, Title as Tt, Text as ye, ScrollArea as Xe, LoadingOverlay as vt, useMantineColorScheme as lt, Modal as Ct, px as Mt, Grid as be, Pagination as kt, Stack as yt, Tabs as rt, Badge as Ut } from "@mantine/core";
3
- import { useForceUpdate as ot, useUncontrolled as Ht, useHotkeys as _t } from "@mantine/hooks";
4
- import { IconArrowLeft as Bt, IconBug as Oe, IconDeviceFloppy as xt, IconX as Be, IconCheck as Ye, IconPlus as bt, IconEdit as wt, IconTrash as tt, IconEye as Ft } from "@tabler/icons-react";
5
- import { useArchbaseAppContext as ze, useValidationErrors as Nt, ValidationErrorsProvider as At, getI18nextInstance as x, processErrorMessage as fe, useArchbaseTheme as at, emit as qt, useArchbaseTranslation as Jt } from "@archbase/core";
6
- import Ze, { useMemo as He, useState as Q, useCallback as ie, forwardRef as Vt, useRef as Ae, useImperativeHandle as zt, useEffect as et, Fragment as Wt, Profiler as Ot, createContext as Kt, useContext as Pt } from "react";
7
- import { useArchbaseV1V2Compatibility as _e, useArchbaseDataSourceListener as nt, DataSourceEventNames as Re, ArchbaseDataSource as Qt } from "@archbase/data";
8
- import { ArchbaseAlert as Ke, ArchbaseDialog as Rt, ArchbaseDataGrid as Gt, GridToolBarActions as Xt, ArchbaseDebugInspector as Yt, ArchbaseMasonryProvider as Zt, ArchbaseMasonryResponsive as en, ArchbaseMasonry as tn, ArchbaseActionButtons as nn } from "@archbase/components";
9
- import { ArchbaseSpaceFixed as ct, ArchbaseSpaceTop as Et, ArchbaseSpaceFill as st, ArchbaseForm as $t, ArchbaseSpaceBottom as dt } from "@archbase/layout";
10
- import { ArchbaseQueryBuilder as St, buildFrom as rn, ArchbaseGlobalFilter as ln } from "@archbase/advanced";
11
- import it from "@rehooks/component-size";
12
- import { uniqueId as on } from "lodash";
13
- const an = {
1
+ import { jsx as e, Fragment as qe, jsxs as c } from "react/jsx-runtime";
2
+ import { Button as Oe, Paper as _e, Box as pe, Flex as Ce, Group as oe, ActionIcon as vt, Title as Bt, Text as Re, ScrollArea as Ze, LoadingOverlay as yt, useMantineColorScheme as st, Modal as bt, px as Ot, Grid as Ee, Pagination as Nt, Stack as wt, Tabs as at, Badge as Kt } from "@mantine/core";
3
+ import { useForceUpdate as dt, useUncontrolled as Qt, useHotkeys as Xt } from "@mantine/hooks";
4
+ import { IconArrowLeft as Vt, IconBug as Ke, IconDeviceFloppy as Ct, IconX as ze, IconCheck as et, IconPlus as Ft, IconEdit as At, IconTrash as rt, IconEye as Rt } from "@tabler/icons-react";
5
+ import { useArchbaseAppContext as Me, useValidationErrors as Pt, ValidationErrorsProvider as Et, getI18nextInstance as g, processErrorMessage as xe, useArchbaseTheme as ut, emit as Yt, useArchbaseTranslation as Zt } from "@archbase/core";
6
+ import tt, { useMemo as Je, useState as U, useCallback as Z, forwardRef as zt, useRef as Se, useImperativeHandle as Gt, useEffect as nt, Fragment as en, Profiler as tn, createContext as nn, useContext as $t } from "react";
7
+ import { useArchbaseV1V2Compatibility as We, useArchbaseDataSourceListener as it, DataSourceEventNames as Ie, ArchbaseDataSource as rn } from "@archbase/data";
8
+ import { ArchbaseAlert as Qe, ArchbaseDialog as St, ArchbaseDataGrid as Lt, GridToolBarActions as ln, ArchbaseDebugInspector as on, ArchbaseMasonryProvider as an, ArchbaseMasonryResponsive as cn, ArchbaseMasonry as sn, ArchbaseActionButtons as dn } from "@archbase/components";
9
+ import { ArchbaseSpaceFixed as ht, ArchbaseSpaceTop as It, ArchbaseSpaceFill as ft, ArchbaseForm as jt, ArchbaseSpaceBottom as mt } from "@archbase/layout";
10
+ import { ArchbaseQueryBuilder as Dt, buildFrom as un, ArchbaseGlobalFilter as hn } from "@archbase/advanced";
11
+ import ct from "@rehooks/component-size";
12
+ import { uniqueId as fn } from "lodash";
13
+ const mn = {
14
14
  isAvailable: !1,
15
15
  hasPermission: () => !0,
16
16
  // Default: sempre permite
@@ -21,79 +21,79 @@ const an = {
21
21
  canEdit: !0,
22
22
  canDelete: !0,
23
23
  canView: !0
24
- }, Pe = (t) => He(() => an, []), Sn = () => !1;
25
- function In(t) {
24
+ }, Ue = (t) => Je(() => mn, []), Vn = () => !1;
25
+ function Pn(t) {
26
26
  const {
27
27
  onSelect: n,
28
28
  onSelectMultiple: o,
29
29
  initialValue: f = null,
30
30
  initialValues: r = [],
31
31
  selectionMode: i = "single",
32
- autoClose: u = !0,
33
- onOpen: v,
32
+ autoClose: h = !0,
33
+ onOpen: p,
34
34
  onClose: a
35
- } = t || {}, [C, P] = Q(!1), [l, s] = Q(f), [L, I] = Q(r), w = ie(() => {
36
- P(!0), v?.();
37
- }, [v]), R = ie(() => {
38
- P(!1), a?.();
39
- }, [a]), m = ie(() => {
35
+ } = t || {}, [v, $] = U(!1), [l, s] = U(f), [H, I] = U(r), C = Z(() => {
36
+ $(!0), p?.();
37
+ }, [p]), A = Z(() => {
38
+ $(!1), a?.();
39
+ }, [a]), m = Z(() => {
40
40
  s(null), I([]);
41
- }, []), D = ie(
42
- (h) => {
43
- s(h), I([h]), n?.(h), u && (P(!1), a?.());
41
+ }, []), N = Z(
42
+ (u) => {
43
+ s(u), I([u]), n?.(u), h && ($(!1), a?.());
44
44
  },
45
- [n, u, a]
46
- ), N = ie(
47
- (h) => {
48
- I(h), s(h.length > 0 ? h[0] : null), o?.(h), u && (P(!1), a?.());
45
+ [n, h, a]
46
+ ), b = Z(
47
+ (u) => {
48
+ I(u), s(u.length > 0 ? u[0] : null), o?.(u), h && ($(!1), a?.());
49
49
  },
50
- [o, u, a]
51
- ), V = ie(() => {
52
- P(!1), a?.();
53
- }, [a]), F = He(
50
+ [o, h, a]
51
+ ), V = Z(() => {
52
+ $(!1), a?.();
53
+ }, [a]), w = Je(
54
54
  () => ({
55
- opened: C,
55
+ opened: v,
56
56
  onClose: V,
57
- onSelect: D,
58
- onSelectMultiple: N,
57
+ onSelect: N,
58
+ onSelectMultiple: b,
59
59
  selectionMode: i,
60
- initialSelectedItems: i === "multiple" ? L : l ? [l] : void 0
60
+ initialSelectedItems: i === "multiple" ? H : l ? [l] : void 0
61
61
  }),
62
- [C, V, D, N, i, l, L]
62
+ [v, V, N, b, i, l, H]
63
63
  );
64
64
  return {
65
65
  // Estado
66
- opened: C,
66
+ opened: v,
67
67
  selectedItem: l,
68
- selectedItems: L,
68
+ selectedItems: H,
69
69
  // Ações
70
- open: w,
71
- close: R,
70
+ open: C,
71
+ close: A,
72
72
  clear: m,
73
73
  setSelectedItem: s,
74
74
  setSelectedItems: I,
75
75
  // Handlers
76
- handleSelect: D,
77
- handleSelectMultiple: N,
76
+ handleSelect: N,
77
+ handleSelectMultiple: b,
78
78
  handleClose: V,
79
79
  // Props para template
80
- lookupProps: F
80
+ lookupProps: w
81
81
  };
82
82
  }
83
- const J = ({
83
+ const K = ({
84
84
  actionName: t,
85
85
  actionDescription: n,
86
86
  children: o,
87
87
  fallback: f = null,
88
88
  autoRegister: r = !0,
89
89
  onClick: i,
90
- ...u
90
+ ...h
91
91
  }) => {
92
- const v = Pe();
93
- return Ze.useEffect(() => {
94
- r && t && n && v.isAvailable && v.registerAction();
95
- }, [t, n, r, v.isAvailable, v.registerAction]), !t || !v.isAvailable ? /* @__PURE__ */ e(We, { onClick: i, ...u, children: o }) : v.hasPermission() ? /* @__PURE__ */ e(We, { onClick: i, ...u, children: o }) : /* @__PURE__ */ e(Me, { children: f });
96
- }, Dn = ({
92
+ const p = Ue();
93
+ return tt.useEffect(() => {
94
+ r && t && n && p.isAvailable && p.registerAction();
95
+ }, [t, n, r, p.isAvailable, p.registerAction]), !t || !p.isAvailable ? /* @__PURE__ */ e(Oe, { onClick: i, ...h, children: o }) : p.hasPermission() ? /* @__PURE__ */ e(Oe, { onClick: i, ...h, children: o }) : /* @__PURE__ */ e(qe, { children: f });
96
+ }, zn = ({
97
97
  actionName: t,
98
98
  actionDescription: n,
99
99
  children: o,
@@ -101,141 +101,141 @@ const J = ({
101
101
  onClick: r,
102
102
  ...i
103
103
  }) => {
104
- const [u, v] = Ze.useState(null), [a, C] = Ze.useState(!1);
105
- return Ze.useEffect(() => {
104
+ const [h, p] = tt.useState(null), [a, v] = tt.useState(!1);
105
+ return tt.useEffect(() => {
106
106
  if (!t) {
107
- v(/* @__PURE__ */ e(We, { onClick: r, ...i, children: o }));
107
+ p(/* @__PURE__ */ e(Oe, { onClick: r, ...i, children: o }));
108
108
  return;
109
109
  }
110
- C(!1), v(/* @__PURE__ */ e(We, { onClick: r, ...i, children: o }));
111
- }, [t, n, o, f, i]), /* @__PURE__ */ e(Me, { children: u });
112
- }, Ge = ({
110
+ v(!1), p(/* @__PURE__ */ e(Oe, { onClick: r, ...i, children: o }));
111
+ }, [t, n, o, f, i]), /* @__PURE__ */ e(qe, { children: h });
112
+ }, He = ({
113
113
  children: t
114
- }) => /* @__PURE__ */ e(Me, { children: t }), Tn = (t) => He(() => ({
114
+ }) => /* @__PURE__ */ e(qe, { children: t }), Gn = (t) => Je(() => ({
115
115
  shouldWrap: !1,
116
116
  isSecurityAvailable: !1,
117
117
  hasResourceName: !!t
118
118
  }), [t]);
119
- function kn({
119
+ function $n({
120
120
  innerRef: t,
121
121
  title: n,
122
122
  subtitle: o,
123
123
  isError: f = !1,
124
124
  isCanceling: r = !1,
125
125
  isSaving: i = !1,
126
- isLoading: u = !1,
127
- error: v = "",
126
+ isLoading: h = !1,
127
+ error: p = "",
128
128
  clearError: a = () => {
129
129
  },
130
- autoCloseAlertError: C = 15e3,
131
- width: P = "100%",
130
+ autoCloseAlertError: v = 15e3,
131
+ width: $ = "100%",
132
132
  height: l = "100%",
133
133
  withBorder: s = !0,
134
- children: L,
134
+ children: H,
135
135
  radius: I,
136
- variant: w,
137
- buttonsPosition: R = "footer",
136
+ variant: C,
137
+ buttonsPosition: A = "footer",
138
138
  saveLabel: m,
139
- cancelLabel: D,
140
- onBack: N,
139
+ cancelLabel: N,
140
+ onBack: b,
141
141
  footerAlign: V = "left",
142
- footerContent: F,
143
- dataSource: h,
142
+ footerContent: w,
143
+ dataSource: u,
144
144
  onSave: X,
145
- onCancel: Z,
145
+ onCancel: ee,
146
146
  onBeforeSave: ae,
147
- onAfterSave: W,
148
- onBeforeCancel: G,
149
- onAfterCancel: M,
150
- onError: y,
151
- routePath: U,
152
- onBeforeClose: ee,
147
+ onAfterSave: Q,
148
+ onBeforeCancel: L,
149
+ onAfterCancel: _,
150
+ onError: R,
151
+ routePath: T,
152
+ onBeforeClose: ie,
153
153
  useNavigationListener: E,
154
154
  // Props de segurança (opcionais)
155
155
  resourceName: te,
156
- resourceDescription: se,
156
+ resourceDescription: ue,
157
157
  requiredPermissions: ne,
158
- fallbackComponent: H,
159
- securityOptions: z,
160
- ...Y
158
+ fallbackComponent: q,
159
+ securityOptions: j,
160
+ ...J
161
161
  }) {
162
- const O = ze(), [_, ue] = Q(f), [Ce, le] = Q(v), d = ot();
163
- Pe({
164
- autoRegisterActions: z?.autoRegisterActions ?? !0
162
+ const W = Me(), [Y, ce] = U(f), [be, le] = U(p), d = dt();
163
+ Ue({
164
+ autoRegisterActions: j?.autoRegisterActions ?? !0
165
165
  });
166
- const k = _e(
166
+ const P = We(
167
167
  "ArchbaseFormTemplate",
168
- h,
168
+ u,
169
169
  void 0,
170
170
  void 0
171
171
  );
172
- nt({
173
- dataSource: h,
174
- listener: (re) => {
175
- re.type === Re.onError && (ue(!0), le(re.error)), (re.type === Re.afterEdit || re.type === Re.afterInsert) && (k.isDataSourceV2 || d());
172
+ it({
173
+ dataSource: u,
174
+ listener: (O) => {
175
+ O.type === Ie.onError && (ce(!0), le(O.error)), (O.type === Ie.afterEdit || O.type === Ie.afterInsert) && (P.isDataSourceV2 || d());
176
176
  }
177
177
  });
178
- const $ = Nt(), we = ie((re, S) => ({
178
+ const M = Pt(), we = Z((O, D) => ({
179
179
  closeAllowed: ($e) => {
180
180
  }
181
- }), []), de = E || we, { closeAllowed: B } = de(U || "", () => {
182
- ee && ee() === !1 || B();
183
- }), me = async (re) => {
181
+ }), []), he = E || we, { closeAllowed: z } = he(T || "", () => {
182
+ ie && ie() === !1 || z();
183
+ }), fe = async (O) => {
184
184
  try {
185
- X ? X(re) : (ae && await ae(re), h.isBrowsing() || h.save().then(() => {
186
- $?.clearAll(), W && W(re), E && B();
187
- }).catch((S) => {
188
- y && y(fe(S)), ue(!0), le(fe(S));
185
+ X ? X(O) : (ae && await ae(O), u.isBrowsing() || u.save().then(() => {
186
+ M?.clearAll(), Q && Q(O), E && z();
187
+ }).catch((D) => {
188
+ R && R(xe(D)), ce(!0), le(xe(D));
189
189
  }));
190
- } catch (S) {
191
- y && y(fe(S)), ue(!0), le(fe(S));
190
+ } catch (D) {
191
+ R && R(xe(D)), ce(!0), le(xe(D));
192
192
  }
193
- }, xe = () => {
193
+ }, Fe = () => {
194
194
  try {
195
- Z ? Z.length > 0 ? Z(B) : Z() : (G && G(), h.isBrowsing() || h.cancel(), $?.clearAll(), M && M(), E && B());
196
- } catch (re) {
197
- y && y(fe(re)), ue(!0), le(fe(re));
195
+ ee ? ee.length > 0 ? ee(z) : ee() : (L && L(), u.isBrowsing() || u.cancel(), M?.clearAll(), _ && _(), E && z());
196
+ } catch (O) {
197
+ R && R(xe(O)), ce(!0), le(xe(O));
198
198
  }
199
- }, Fe = () => {
200
- a && a(), ue(!1), le("");
201
- }, Ie = h && !h.isBrowsing(), A = R === "header" || R === "both", ce = R === "footer" || R === "both", Ne = () => /* @__PURE__ */ e(oe, { gap: "sm", children: Ie ? /* @__PURE__ */ c(Me, { children: [
199
+ }, Ae = () => {
200
+ a && a(), ce(!1), le("");
201
+ }, Pe = u && !u.isBrowsing(), se = A === "header" || A === "both", G = A === "footer" || A === "both", de = () => /* @__PURE__ */ e(oe, { gap: "sm", children: Pe ? /* @__PURE__ */ c(qe, { children: [
202
202
  /* @__PURE__ */ e(
203
- J,
203
+ K,
204
204
  {
205
205
  actionName: "cancel",
206
206
  actionDescription: "Cancelar operação",
207
- leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
208
- onClick: xe,
207
+ leftSection: /* @__PURE__ */ e(ze, { size: 16 }),
208
+ onClick: Fe,
209
209
  variant: "default",
210
210
  loading: r,
211
- children: D || x().t("Cancel")
211
+ children: N || g().t("Cancel")
212
212
  }
213
213
  ),
214
214
  /* @__PURE__ */ e(
215
- J,
215
+ K,
216
216
  {
217
217
  actionName: "save",
218
- actionDescription: `Salvar ${se || "registro"}`,
219
- leftSection: /* @__PURE__ */ e(xt, { size: 16 }),
220
- onClick: () => me(h.getCurrentRecord()),
221
- variant: w ?? O.variant,
218
+ actionDescription: `Salvar ${ue || "registro"}`,
219
+ leftSection: /* @__PURE__ */ e(Ct, { size: 16 }),
220
+ onClick: () => fe(u.getCurrentRecord()),
221
+ variant: C ?? W.variant,
222
222
  color: "blue",
223
223
  loading: i,
224
- children: m || x().t("Ok")
224
+ children: m || g().t("Ok")
225
225
  }
226
226
  )
227
227
  ] }) : /* @__PURE__ */ e(
228
- J,
228
+ K,
229
229
  {
230
230
  actionName: "close",
231
231
  actionDescription: "Fechar formulário",
232
- leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
233
- onClick: xe,
232
+ leftSection: /* @__PURE__ */ e(ze, { size: 16 }),
233
+ onClick: Fe,
234
234
  variant: "default",
235
- children: x().t("Close")
235
+ children: g().t("Close")
236
236
  }
237
- ) }), De = () => /* @__PURE__ */ c(
238
- he,
237
+ ) }), Ge = () => /* @__PURE__ */ c(
238
+ pe,
239
239
  {
240
240
  style: {
241
241
  flexShrink: 0,
@@ -246,308 +246,308 @@ function kn({
246
246
  gap: "1rem"
247
247
  },
248
248
  children: [
249
- V === "right" && F && /* @__PURE__ */ e(he, { style: { flex: 1 }, children: F }),
250
- Ie ? /* @__PURE__ */ c(oe, { gap: "md", children: [
249
+ V === "right" && w && /* @__PURE__ */ e(pe, { style: { flex: 1 }, children: w }),
250
+ Pe ? /* @__PURE__ */ c(oe, { gap: "md", children: [
251
251
  /* @__PURE__ */ e(
252
- J,
252
+ K,
253
253
  {
254
254
  actionName: "save",
255
- actionDescription: `Salvar ${se || "registro"}`,
256
- leftSection: /* @__PURE__ */ e(xt, {}),
257
- onClick: () => me(h.getCurrentRecord()),
258
- disabled: h && h.isBrowsing(),
259
- variant: w ?? O.variant,
255
+ actionDescription: `Salvar ${ue || "registro"}`,
256
+ leftSection: /* @__PURE__ */ e(Ct, {}),
257
+ onClick: () => fe(u.getCurrentRecord()),
258
+ disabled: u && u.isBrowsing(),
259
+ variant: C ?? W.variant,
260
260
  color: "green",
261
- children: m || `${x().t("Ok")}`
261
+ children: m || `${g().t("Ok")}`
262
262
  }
263
263
  ),
264
264
  /* @__PURE__ */ e(
265
- J,
265
+ K,
266
266
  {
267
267
  actionName: "cancel",
268
268
  actionDescription: "Cancelar operação",
269
- leftSection: /* @__PURE__ */ e(Be, {}),
270
- onClick: xe,
271
- disabled: h && h.isBrowsing(),
272
- variant: w ?? O.variant,
269
+ leftSection: /* @__PURE__ */ e(ze, {}),
270
+ onClick: Fe,
271
+ disabled: u && u.isBrowsing(),
272
+ variant: C ?? W.variant,
273
273
  color: "red",
274
- children: D || `${x().t("Cancel")}`
274
+ children: N || `${g().t("Cancel")}`
275
275
  }
276
276
  )
277
277
  ] }) : /* @__PURE__ */ e(oe, { gap: "md", children: /* @__PURE__ */ e(
278
- J,
278
+ K,
279
279
  {
280
280
  actionName: "close",
281
281
  actionDescription: "Fechar formulário",
282
- leftSection: /* @__PURE__ */ e(Be, {}),
283
- onClick: xe,
284
- variant: w ?? O.variant,
285
- children: `${x().t("Close")}`
282
+ leftSection: /* @__PURE__ */ e(ze, {}),
283
+ onClick: Fe,
284
+ variant: C ?? W.variant,
285
+ children: `${g().t("Close")}`
286
286
  }
287
287
  ) }),
288
- (V === "left" || V === "center") && F && /* @__PURE__ */ e(he, { style: { flex: V === "left" ? 1 : 0, textAlign: "right" }, children: F })
288
+ (V === "left" || V === "center") && w && /* @__PURE__ */ e(pe, { style: { flex: V === "left" ? 1 : 0, textAlign: "right" }, children: w })
289
289
  ]
290
290
  }
291
291
  );
292
292
  return /* @__PURE__ */ e(
293
- Ge,
293
+ He,
294
294
  {
295
295
  resourceName: te,
296
- resourceDescription: se,
296
+ resourceDescription: ue,
297
297
  requiredPermissions: ne,
298
- fallbackComponent: H,
299
- onSecurityReady: z?.onSecurityReady,
300
- onAccessDenied: z?.onAccessDenied,
301
- children: /* @__PURE__ */ e(At, { children: /* @__PURE__ */ c(
302
- Le,
298
+ fallbackComponent: q,
299
+ onSecurityReady: j?.onSecurityReady,
300
+ onAccessDenied: j?.onAccessDenied,
301
+ children: /* @__PURE__ */ e(Et, { children: /* @__PURE__ */ c(
302
+ _e,
303
303
  {
304
304
  ref: t,
305
305
  withBorder: s,
306
306
  radius: I,
307
307
  style: {
308
- width: P,
308
+ width: $,
309
309
  height: l,
310
310
  display: "flex",
311
311
  flexDirection: "column",
312
- padding: A ? 0 : 4
312
+ padding: se ? 0 : 4
313
313
  },
314
314
  children: [
315
- A && /* @__PURE__ */ e(
316
- he,
315
+ se && /* @__PURE__ */ e(
316
+ pe,
317
317
  {
318
318
  style: {
319
319
  flexShrink: 0,
320
320
  padding: "16px 24px",
321
321
  borderBottom: "1px solid var(--mantine-color-gray-2)"
322
322
  },
323
- children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
323
+ children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
324
324
  /* @__PURE__ */ c(oe, { gap: "md", children: [
325
- N && /* @__PURE__ */ e(
326
- pt,
325
+ b && /* @__PURE__ */ e(
326
+ vt,
327
327
  {
328
328
  variant: "subtle",
329
329
  color: "gray",
330
330
  size: "lg",
331
- onClick: N,
331
+ onClick: b,
332
332
  style: { border: "1px solid var(--mantine-color-gray-3)" },
333
- children: /* @__PURE__ */ e(Bt, { size: 18 })
333
+ children: /* @__PURE__ */ e(Vt, { size: 18 })
334
334
  }
335
335
  ),
336
- (n || o) && /* @__PURE__ */ c(he, { children: [
337
- n && /* @__PURE__ */ e(Tt, { order: 4, fw: 600, children: n }),
338
- o && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", children: o })
336
+ (n || o) && /* @__PURE__ */ c(pe, { children: [
337
+ n && /* @__PURE__ */ e(Bt, { order: 4, fw: 600, children: n }),
338
+ o && /* @__PURE__ */ e(Re, { size: "sm", c: "dimmed", children: o })
339
339
  ] })
340
340
  ] }),
341
- Ne()
341
+ de()
342
342
  ] })
343
343
  }
344
344
  ),
345
- _ && /* @__PURE__ */ e(he, { style: { flexShrink: 0, padding: A ? "16px 24px 0" : void 0 }, children: /* @__PURE__ */ e(
346
- Ke,
345
+ Y && /* @__PURE__ */ e(pe, { style: { flexShrink: 0, padding: se ? "16px 24px 0" : void 0 }, children: /* @__PURE__ */ e(
346
+ Qe,
347
347
  {
348
- autoClose: C,
348
+ autoClose: v,
349
349
  withCloseButton: !0,
350
350
  withBorder: !0,
351
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
352
- title: x().t("WARNING"),
351
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
352
+ title: g().t("WARNING"),
353
353
  titleColor: "rgb(250, 82, 82)",
354
- variant: w ?? O.variant,
355
- onClose: Fe,
356
- children: /* @__PURE__ */ e("span", { children: Ce })
354
+ variant: C ?? W.variant,
355
+ onClose: Ae,
356
+ children: /* @__PURE__ */ e("span", { children: be })
357
357
  }
358
358
  ) }),
359
359
  /* @__PURE__ */ c(
360
- Xe,
360
+ Ze,
361
361
  {
362
362
  style: {
363
363
  flex: 1,
364
364
  minHeight: 0,
365
- padding: A ? "24px" : "calc(0.625rem / 2)"
365
+ padding: se ? "24px" : "calc(0.625rem / 2)"
366
366
  },
367
367
  children: [
368
- /* @__PURE__ */ e(vt, { visible: u || r || i, opacity: 0.3 }),
369
- L
368
+ /* @__PURE__ */ e(yt, { visible: h || r || i, opacity: 0.3 }),
369
+ H
370
370
  ]
371
371
  }
372
372
  ),
373
- ce && De()
373
+ G && Ge()
374
374
  ]
375
375
  }
376
376
  ) })
377
377
  }
378
378
  );
379
379
  }
380
- function Bn({
380
+ function Ln({
381
381
  title: t,
382
382
  withOverlay: n = !0,
383
383
  overlayProps: o,
384
384
  children: f,
385
385
  withCloseButton: r = !0,
386
386
  closeButtonProps: i,
387
- opened: u,
388
- fullScreen: v,
387
+ opened: h,
388
+ fullScreen: p,
389
389
  centered: a,
390
- variant: C,
391
- closeOnEscape: P = !0,
390
+ variant: v,
391
+ closeOnEscape: $ = !0,
392
392
  size: l,
393
393
  dataSource: s,
394
- height: L,
394
+ height: H,
395
395
  userActions: I,
396
- onAfterSave: w,
397
- onClickOk: R,
396
+ onAfterSave: C,
397
+ onClickOk: A,
398
398
  onClickCancel: m,
399
- onBeforeOk: D,
400
- onCustomSave: N,
399
+ onBeforeOk: N,
400
+ onCustomSave: b,
401
401
  isError: V,
402
- error: F = "",
403
- clearError: h = () => {
402
+ error: w = "",
403
+ clearError: u = () => {
404
404
  },
405
405
  onError: X,
406
- autoCloseAlertError: Z = 15e3,
406
+ autoCloseAlertError: ee = 15e3,
407
407
  loadingOverlayStyles: ae,
408
408
  // Props de segurança (opcionais)
409
- resourceName: W,
410
- resourceDescription: G,
411
- requiredPermissions: M,
412
- fallbackComponent: y,
413
- securityOptions: U,
414
- ...ee
409
+ resourceName: Q,
410
+ resourceDescription: L,
411
+ requiredPermissions: _,
412
+ fallbackComponent: R,
413
+ securityOptions: T,
414
+ ...ie
415
415
  }) {
416
- const E = ze(), te = at(), { colorScheme: se } = lt(), [ne, H] = Q(V), [z, Y] = Q(F), [O, _] = Q(!1), ue = ot();
417
- Pe({
418
- resourceDescription: G || t?.toString(),
419
- autoRegisterActions: U?.autoRegisterActions ?? !0
416
+ const E = Me(), te = ut(), { colorScheme: ue } = st(), [ne, q] = U(V), [j, J] = U(w), [W, Y] = U(!1), ce = dt();
417
+ Ue({
418
+ resourceDescription: L || t?.toString(),
419
+ autoRegisterActions: T?.autoRegisterActions ?? !0
420
420
  });
421
- const Ce = _e(
421
+ const be = We(
422
422
  "ArchbaseFormModalTemplate",
423
423
  s,
424
424
  void 0,
425
425
  void 0
426
426
  );
427
- nt({
427
+ it({
428
428
  dataSource: s,
429
- listener: (B) => {
430
- B.type === Re.onError && (H(!0), Y(B.error)), (B.type === Re.afterEdit || B.type === Re.afterInsert) && (Ce.isDataSourceV2 || ue());
429
+ listener: (z) => {
430
+ z.type === Ie.onError && (q(!0), J(z.error)), (z.type === Ie.afterEdit || z.type === Ie.afterInsert) && (be.isDataSourceV2 || ce());
431
431
  }
432
432
  });
433
433
  const le = async () => {
434
434
  if (s && !s.isBrowsing())
435
435
  try {
436
- _(!0), await s.save(), w && w(s.getCurrentRecord());
437
- } catch (B) {
438
- return X && X(fe(B)), H(!0), Y(fe(B)), _(!1), !1;
436
+ Y(!0), await s.save(), C && C(s.getCurrentRecord());
437
+ } catch (z) {
438
+ return X && X(xe(z)), q(!0), J(xe(z)), Y(!1), !1;
439
439
  }
440
- return _(!1), !0;
440
+ return Y(!1), !0;
441
441
  }, d = () => {
442
442
  if (s && !s.isBrowsing())
443
443
  try {
444
444
  s.cancel();
445
445
  } catch {
446
446
  }
447
- }, k = async () => {
448
- if (N)
449
- s && N(s.getCurrentRecord(), () => {
450
- R && R();
447
+ }, P = async () => {
448
+ if (b)
449
+ s && b(s.getCurrentRecord(), () => {
450
+ A && A();
451
451
  });
452
- else if (D) {
453
- const B = D(s.getCurrentRecord());
454
- B instanceof Promise && B.then(async () => {
455
- await le() && R && R();
456
- }).catch((me) => {
457
- X && X(fe(me)), H(!0), Y(fe(me));
452
+ else if (N) {
453
+ const z = N(s.getCurrentRecord());
454
+ z instanceof Promise && z.then(async () => {
455
+ await le() && A && A();
456
+ }).catch((fe) => {
457
+ X && X(xe(fe)), q(!0), J(xe(fe));
458
458
  });
459
459
  } else
460
- await le() && R && R();
461
- }, $ = () => {
460
+ await le() && A && A();
461
+ }, M = () => {
462
462
  d(), m && m();
463
463
  }, we = () => {
464
- Rt.showWarning(x().t("archbase:Click on Ok or Cancel to close"));
465
- }, de = () => {
466
- h && h(), H(!1), Y("");
464
+ St.showWarning(g().t("archbase:Click on Ok or Cancel to close"));
465
+ }, he = () => {
466
+ u && u(), q(!1), J("");
467
467
  };
468
468
  return /* @__PURE__ */ e(
469
- Ge,
469
+ He,
470
470
  {
471
- resourceName: W,
472
- resourceDescription: G,
473
- requiredPermissions: M,
474
- fallbackComponent: y,
475
- onSecurityReady: U?.onSecurityReady,
476
- onAccessDenied: U?.onAccessDenied,
471
+ resourceName: Q,
472
+ resourceDescription: L,
473
+ requiredPermissions: _,
474
+ fallbackComponent: R,
475
+ onSecurityReady: T?.onSecurityReady,
476
+ onAccessDenied: T?.onAccessDenied,
477
477
  children: /* @__PURE__ */ e(
478
- Ct,
478
+ bt,
479
479
  {
480
480
  title: t,
481
481
  withOverlay: n,
482
482
  overlayProps: o || {
483
- color: se === "dark" ? te.colors.dark[7] : te.colors.gray[6],
483
+ color: ue === "dark" ? te.colors.dark[7] : te.colors.gray[6],
484
484
  opacity: 0.25
485
485
  },
486
486
  withCloseButton: r,
487
487
  closeButtonProps: i,
488
488
  onClose: we,
489
- opened: u,
490
- fullScreen: v,
489
+ opened: h,
490
+ fullScreen: p,
491
491
  centered: a,
492
- closeOnEscape: P,
492
+ closeOnEscape: $,
493
493
  size: l,
494
- ...ee,
495
- children: /* @__PURE__ */ c(At, { children: [
496
- /* @__PURE__ */ e(vt, { styles: ae, visible: O, opacity: 0.8 }),
497
- /* @__PURE__ */ c(ct, { height: L, children: [
498
- ne ? /* @__PURE__ */ e(Et, { size: "100px", children: /* @__PURE__ */ e(
499
- Ke,
494
+ ...ie,
495
+ children: /* @__PURE__ */ c(Et, { children: [
496
+ /* @__PURE__ */ e(yt, { styles: ae, visible: W, opacity: 0.8 }),
497
+ /* @__PURE__ */ c(ht, { height: H, children: [
498
+ ne ? /* @__PURE__ */ e(It, { size: "100px", children: /* @__PURE__ */ e(
499
+ Qe,
500
500
  {
501
- autoClose: Z,
501
+ autoClose: ee,
502
502
  withCloseButton: !0,
503
503
  withBorder: !0,
504
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
505
- title: x().t("WARNING"),
504
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
505
+ title: g().t("WARNING"),
506
506
  titleColor: "rgb(250, 82, 82)",
507
- variant: C ?? E.variant,
508
- onClose: de,
509
- children: /* @__PURE__ */ e("span", { children: z })
507
+ variant: v ?? E.variant,
508
+ onClose: he,
509
+ children: /* @__PURE__ */ e("span", { children: j })
510
510
  }
511
511
  ) }) : null,
512
- /* @__PURE__ */ e(st, { children: /* @__PURE__ */ e($t, { children: f }) }),
513
- /* @__PURE__ */ e(dt, { size: "40px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
512
+ /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(jt, { children: f }) }),
513
+ /* @__PURE__ */ e(mt, { size: "40px", children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
514
514
  /* @__PURE__ */ e(oe, { children: I }),
515
515
  s && !s.isBrowsing() ? /* @__PURE__ */ c(oe, { gap: "md", children: [
516
516
  /* @__PURE__ */ e(
517
- J,
517
+ K,
518
518
  {
519
519
  actionName: "save",
520
- actionDescription: `Salvar ${G || t || "registro"}`,
521
- leftSection: /* @__PURE__ */ e(Ye, {}),
522
- onClick: k,
520
+ actionDescription: `Salvar ${L || t || "registro"}`,
521
+ leftSection: /* @__PURE__ */ e(et, {}),
522
+ onClick: P,
523
523
  disabled: s && s.isBrowsing(),
524
- variant: C ?? E.variant,
524
+ variant: v ?? E.variant,
525
525
  color: "green",
526
- children: `${x().t("Ok")}`
526
+ children: `${g().t("Ok")}`
527
527
  }
528
528
  ),
529
529
  /* @__PURE__ */ e(
530
- J,
530
+ K,
531
531
  {
532
532
  actionName: "cancel",
533
533
  actionDescription: "Cancelar operação",
534
- leftSection: /* @__PURE__ */ e(Be, {}),
535
- onClick: $,
534
+ leftSection: /* @__PURE__ */ e(ze, {}),
535
+ onClick: M,
536
536
  disabled: s && s.isBrowsing(),
537
- variant: C ?? E.variant,
537
+ variant: v ?? E.variant,
538
538
  color: "red",
539
- children: `${x().t("Cancel")}`
539
+ children: `${g().t("Cancel")}`
540
540
  }
541
541
  )
542
542
  ] }) : /* @__PURE__ */ e(oe, { gap: "md", children: /* @__PURE__ */ e(
543
- J,
543
+ K,
544
544
  {
545
545
  actionName: "close",
546
546
  actionDescription: "Fechar janela",
547
- leftSection: /* @__PURE__ */ e(Be, {}),
548
- onClick: $,
549
- variant: C ?? E.variant,
550
- children: `${x().t("Close")}`
547
+ leftSection: /* @__PURE__ */ e(ze, {}),
548
+ onClick: M,
549
+ variant: v ?? E.variant,
550
+ children: `${g().t("Close")}`
551
551
  }
552
552
  ) })
553
553
  ] }) })
@@ -558,96 +558,96 @@ function Bn({
558
558
  }
559
559
  );
560
560
  }
561
- function Nn({
561
+ function jn({
562
562
  title: t,
563
563
  withOverlay: n = !0,
564
564
  overlayProps: o,
565
565
  children: f,
566
566
  withCloseButton: r = !0,
567
567
  closeButtonProps: i,
568
- opened: u,
569
- fullScreen: v,
568
+ opened: h,
569
+ fullScreen: p,
570
570
  centered: a,
571
- variant: C,
572
- closeOnEscape: P = !0,
571
+ variant: v,
572
+ closeOnEscape: $ = !0,
573
573
  size: l,
574
574
  height: s,
575
- onlyOkButton: L = !1,
575
+ onlyOkButton: H = !1,
576
576
  onClose: I,
577
- onClickOk: w,
578
- onClickCancel: R,
577
+ onClickOk: C,
578
+ onClickCancel: A,
579
579
  userActions: m,
580
580
  // Props de segurança (opcionais)
581
- resourceName: D,
582
- resourceDescription: N,
581
+ resourceName: N,
582
+ resourceDescription: b,
583
583
  requiredPermissions: V,
584
- fallbackComponent: F,
585
- securityOptions: h
584
+ fallbackComponent: w,
585
+ securityOptions: u
586
586
  }) {
587
- const X = ze(), Z = at(), { colorScheme: ae } = lt();
588
- Pe({
589
- autoRegisterActions: h?.autoRegisterActions ?? !0
587
+ const X = Me(), ee = ut(), { colorScheme: ae } = st();
588
+ Ue({
589
+ autoRegisterActions: u?.autoRegisterActions ?? !0
590
590
  });
591
- const W = () => {
592
- w && w(), I();
593
- }, G = () => {
594
- R && R(), I();
595
- }, M = () => {
596
- Rt.showWarning(x().t("Click on Ok or Cancel to close"));
591
+ const Q = () => {
592
+ C && C(), I();
593
+ }, L = () => {
594
+ A && A(), I();
595
+ }, _ = () => {
596
+ St.showWarning(g().t("Click on Ok or Cancel to close"));
597
597
  };
598
598
  return /* @__PURE__ */ e(
599
- Ge,
599
+ He,
600
600
  {
601
- resourceName: D,
602
- resourceDescription: N,
601
+ resourceName: N,
602
+ resourceDescription: b,
603
603
  requiredPermissions: V,
604
- fallbackComponent: F,
605
- onSecurityReady: h?.onSecurityReady,
606
- onAccessDenied: h?.onAccessDenied,
604
+ fallbackComponent: w,
605
+ onSecurityReady: u?.onSecurityReady,
606
+ onAccessDenied: u?.onAccessDenied,
607
607
  children: /* @__PURE__ */ e(
608
- Ct,
608
+ bt,
609
609
  {
610
610
  title: t,
611
611
  withOverlay: n,
612
612
  overlayProps: o || {
613
- color: ae === "dark" ? Z.colors.dark[7] : Z.colors.gray[6],
613
+ color: ae === "dark" ? ee.colors.dark[7] : ee.colors.gray[6],
614
614
  opacity: 0.25
615
615
  },
616
616
  withCloseButton: r,
617
617
  closeButtonProps: i,
618
- onClose: M,
619
- opened: u,
620
- fullScreen: v,
618
+ onClose: _,
619
+ opened: h,
620
+ fullScreen: p,
621
621
  centered: a,
622
- closeOnEscape: P,
622
+ closeOnEscape: $,
623
623
  size: l,
624
- children: /* @__PURE__ */ c(ct, { height: s, children: [
625
- /* @__PURE__ */ e(st, { children: /* @__PURE__ */ e($t, { children: f }) }),
626
- /* @__PURE__ */ e(dt, { size: "40px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
624
+ children: /* @__PURE__ */ c(ht, { height: s, children: [
625
+ /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(jt, { children: f }) }),
626
+ /* @__PURE__ */ e(mt, { size: "40px", children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
627
627
  /* @__PURE__ */ e(oe, { children: m }),
628
628
  /* @__PURE__ */ c(oe, { gap: "md", children: [
629
629
  /* @__PURE__ */ e(
630
- J,
630
+ K,
631
631
  {
632
632
  actionName: "save",
633
- actionDescription: `Salvar ${N || "registro"}`,
634
- leftSection: /* @__PURE__ */ e(Ye, {}),
635
- onClick: W,
636
- variant: C ?? X.variant,
633
+ actionDescription: `Salvar ${b || "registro"}`,
634
+ leftSection: /* @__PURE__ */ e(et, {}),
635
+ onClick: Q,
636
+ variant: v ?? X.variant,
637
637
  color: "green",
638
- children: `${x().t("Ok")}`
638
+ children: `${g().t("Ok")}`
639
639
  }
640
640
  ),
641
- L ? null : /* @__PURE__ */ e(
642
- J,
641
+ H ? null : /* @__PURE__ */ e(
642
+ K,
643
643
  {
644
644
  actionName: "cancel",
645
645
  actionDescription: "Cancelar operação",
646
- leftSection: /* @__PURE__ */ e(Be, {}),
647
- onClick: G,
648
- variant: C ?? X.variant,
646
+ leftSection: /* @__PURE__ */ e(ze, {}),
647
+ onClick: L,
648
+ variant: v ?? X.variant,
649
649
  color: "red",
650
- children: R ? `${x().t("Cancel")}` : `${x().t("Close")}`
650
+ children: A ? `${g().t("Cancel")}` : `${g().t("Close")}`
651
651
  }
652
652
  )
653
653
  ] })
@@ -658,7 +658,7 @@ function Nn({
658
658
  }
659
659
  );
660
660
  }
661
- const cn = (t, n, o) => {
661
+ const gn = (t, n, o) => {
662
662
  if (!t || !n || !n.existsValue(`${t.viewName}_${t.componentName}`)) {
663
663
  let f = -1, r;
664
664
  return o && o.getFilters().length > 0 && (f = 0, r = JSON.parse(o.getFirstFilter()?.filter)), {
@@ -669,316 +669,316 @@ const cn = (t, n, o) => {
669
669
  }
670
670
  return n.getValue(`${t.viewName}_${t.componentName}`);
671
671
  };
672
- function sn(t, n) {
672
+ function pn(t, n) {
673
673
  const {
674
674
  title: o,
675
675
  printTitle: f,
676
676
  dataSource: r,
677
677
  filterOptions: i,
678
- pageSize: u = 15,
679
- pageIndex: v = 0,
678
+ pageSize: h = 15,
679
+ pageIndex: p = 0,
680
680
  columns: a,
681
- filterFields: C,
682
- logoPrint: P,
681
+ filterFields: v,
682
+ logoPrint: $,
683
683
  userActions: l,
684
684
  userRowActions: s,
685
- customRenderRowActions: L,
685
+ customRenderRowActions: H,
686
686
  innerRef: I,
687
- isLoading: w = !1,
688
- isLoadingFilter: R = !1,
687
+ isLoading: C = !1,
688
+ isLoadingFilter: A = !1,
689
689
  isError: m = !1,
690
- enableTopToolbar: D = !0,
691
- enableTopToolbarActions: N = !0,
690
+ enableTopToolbar: N = !0,
691
+ enableTopToolbarActions: b = !0,
692
692
  error: V = "",
693
- clearError: F = () => {
693
+ clearError: w = () => {
694
694
  },
695
- filterType: h,
695
+ filterType: u,
696
696
  width: X = "100%",
697
- height: Z = "100%",
697
+ height: ee = "100%",
698
698
  onSearchByFilter: ae,
699
- getRowId: W,
700
- withBorder: G = !0,
701
- filterPersistenceDelegator: M,
702
- variant: y,
703
- store: U,
704
- cellPadding: ee,
699
+ getRowId: Q,
700
+ withBorder: L = !0,
701
+ filterPersistenceDelegator: _,
702
+ variant: R,
703
+ store: T,
704
+ cellPadding: ie,
705
705
  bottomToolbarMinHeight: E,
706
706
  enableRowSelection: te = !0,
707
- enableRowNumbers: se = !0,
707
+ enableRowNumbers: ue = !0,
708
708
  enableRowActions: ne = !0,
709
- positionActionsColumn: H = "first",
710
- actionsColumnWidth: z,
711
- tableHeadCellPadding: Y,
712
- renderDetailPanel: O,
713
- renderTopToolbar: _,
714
- toolbarAlignment: ue = "right",
715
- toolbarLeftContent: Ce,
709
+ positionActionsColumn: q = "first",
710
+ actionsColumnWidth: j,
711
+ tableHeadCellPadding: J,
712
+ renderDetailPanel: W,
713
+ renderTopToolbar: Y,
714
+ toolbarAlignment: ce = "right",
715
+ toolbarLeftContent: be,
716
716
  onSelectedRowsChanged: le,
717
717
  onCellDoubleClick: d,
718
- onFilterModelChange: k,
719
- paginationLabels: $,
718
+ onFilterModelChange: P,
719
+ paginationLabels: M,
720
720
  // Props de segurança (opcionais)
721
721
  resourceName: we,
722
- resourceDescription: de,
723
- requiredPermissions: B,
724
- fallbackComponent: me,
725
- securityOptions: xe,
722
+ resourceDescription: he,
723
+ requiredPermissions: z,
724
+ fallbackComponent: fe,
725
+ securityOptions: Fe,
726
726
  // Props para controle de bordas internas
727
- withToolbarBorder: Fe,
728
- withPaginationBorder: Ie,
729
- toolbarPadding: A,
730
- paginationPadding: ce,
731
- rowHeight: Ne,
732
- hideFooter: De = !0
733
- } = t, re = Ae(null), S = Ae(null);
734
- at();
735
- const { colorScheme: $e } = lt();
736
- Pe({
737
- autoRegisterActions: xe?.autoRegisterActions ?? !0
727
+ withToolbarBorder: Ae,
728
+ withPaginationBorder: Pe,
729
+ toolbarPadding: se,
730
+ paginationPadding: G,
731
+ rowHeight: de,
732
+ hideFooter: Ge = !0
733
+ } = t, O = Se(null), D = Se(null);
734
+ ut();
735
+ const { colorScheme: $e } = st();
736
+ Ue({
737
+ autoRegisterActions: Fe?.autoRegisterActions ?? !0
738
738
  });
739
- const Te = _e(
739
+ const Le = We(
740
740
  "ArchbaseGridTemplate",
741
741
  r,
742
742
  void 0,
743
743
  void 0
744
744
  );
745
- zt(n, () => ({
745
+ Gt(n, () => ({
746
746
  refreshData: () => {
747
- S.current && S.current.refreshData();
747
+ D.current && D.current.refreshData();
748
748
  },
749
- getSelectedRows: () => S.current ? S.current.getSelectedRows() : [],
749
+ getSelectedRows: () => D.current ? D.current.getSelectedRows() : [],
750
750
  clearSelection: () => {
751
- S.current && S.current.clearSelection();
751
+ D.current && D.current.clearSelection();
752
752
  },
753
753
  exportData: () => {
754
- S.current && S.current.exportData();
754
+ D.current && D.current.exportData();
755
755
  },
756
756
  printData: () => {
757
- S.current && S.current.printData();
757
+ D.current && D.current.printData();
758
758
  },
759
- getDataGridRef: () => S,
760
- getFilterModel: () => S.current ? S.current.getFilterModel() : { items: [], quickFilterValues: [] }
761
- }), [S]);
762
- const [g, j] = Q({
759
+ getDataGridRef: () => D,
760
+ getFilterModel: () => D.current ? D.current.getFilterModel() : { items: [], quickFilterValues: [] }
761
+ }), [D]);
762
+ const [x, k] = U({
763
763
  activeFilterIndex: -1,
764
764
  currentFilter: void 0,
765
765
  expandedFilter: !1
766
766
  });
767
- et(() => {
768
- const T = cn(i, U, M);
769
- j(T);
770
- }, [R]);
771
- const q = (T) => {
772
- if (L)
773
- return L(T);
767
+ nt(() => {
768
+ const S = gn(i, T, _);
769
+ k(S);
770
+ }, [A]);
771
+ const ke = (S) => {
772
+ if (H)
773
+ return H(S);
774
774
  if (!s || !s.actions)
775
775
  return;
776
- const Se = s.actions;
776
+ const Te = s.actions;
777
777
  return /* @__PURE__ */ e(
778
- Se,
778
+ Te,
779
779
  {
780
- onEditRow: s.onEditRow ? (p) => s.onEditRow && s.onEditRow(p) : void 0,
781
- onRemoveRow: s.onRemoveRow ? (p) => s.onRemoveRow && s.onRemoveRow(p) : void 0,
782
- onViewRow: s.onViewRow ? (p) => s.onViewRow && s.onViewRow(p) : void 0,
783
- row: T,
784
- variant: y ?? ge.variant
780
+ onEditRow: s.onEditRow ? (ve) => s.onEditRow && s.onEditRow(ve) : void 0,
781
+ onRemoveRow: s.onRemoveRow ? (ve) => s.onRemoveRow && s.onRemoveRow(ve) : void 0,
782
+ onViewRow: s.onViewRow ? (ve) => s.onViewRow && s.onViewRow(ve) : void 0,
783
+ row: S,
784
+ variant: R ?? me.variant
785
785
  }
786
786
  );
787
- }, ge = ze(), ve = Ae(null), ke = m ? !1 : w, Ve = He(() => Ce, [Ce]);
788
- Ze.useEffect(() => {
789
- I && I.current !== ve.current && I.current && ve.current && (I.current = ve.current);
787
+ }, me = Me(), Be = Se(null), De = m ? !1 : C, ge = Je(() => be, [be]);
788
+ tt.useEffect(() => {
789
+ I && I.current !== Be.current && I.current && Be.current && (I.current = Be.current);
790
790
  }, [I]);
791
- const Ue = (T, Se) => {
792
- const p = { ...g, currentFilter: T, activeFilterIndex: Se };
793
- j(p), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, p);
794
- }, qe = (T) => {
795
- const Se = { ...g, expandedFilter: T };
796
- j(Se), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, Se);
797
- }, b = (T, Se) => {
798
- const p = { ...g, currentFilter: T, activeFilterIndex: Se };
799
- j(p), U && i && U?.setValue(`${i.viewName}_${i.componentName}`, p);
800
- }, Ee = () => {
801
- if (g.currentFilter)
791
+ const lt = (S, Te) => {
792
+ const ve = { ...x, currentFilter: S, activeFilterIndex: Te };
793
+ k(ve), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, ve);
794
+ }, re = (S) => {
795
+ const Te = { ...x, expandedFilter: S };
796
+ k(Te), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, Te);
797
+ }, y = (S, Te) => {
798
+ const ve = { ...x, currentFilter: S, activeFilterIndex: Te };
799
+ k(ve), T && i && T?.setValue(`${i.viewName}_${i.componentName}`, ve);
800
+ }, ye = () => {
801
+ if (x.currentFilter)
802
802
  if (ae)
803
803
  ae();
804
- else if (g.currentFilter.filter.filterType === "quick") {
805
- const T = r.getOptions();
806
- g.currentFilter.filter.quickFilterText && g.currentFilter.filter.quickFilterText !== "" ? (T.filter = JSON.stringify({
807
- search: g.currentFilter.filter.quickFilterText,
808
- fields: g.currentFilter.filter.quickFilterFieldsText
809
- }), T.sort = g.currentFilter.sort.quickFilterSort ? g.currentFilter.sort.quickFilterSort.split(",") : []) : (T.filter = void 0, T.sort = void 0), r.refreshData(T), Te.isDataSourceV2 || Te.v1State.forceUpdate();
804
+ else if (x.currentFilter.filter.filterType === "quick") {
805
+ const S = r.getOptions();
806
+ x.currentFilter.filter.quickFilterText && x.currentFilter.filter.quickFilterText !== "" ? (S.filter = JSON.stringify({
807
+ search: x.currentFilter.filter.quickFilterText,
808
+ fields: x.currentFilter.filter.quickFilterFieldsText
809
+ }), S.sort = x.currentFilter.sort.quickFilterSort ? x.currentFilter.sort.quickFilterSort.split(",") : []) : (S.filter = void 0, S.sort = void 0), r.refreshData(S), Le.isDataSourceV2 || Le.v1State.forceUpdate();
810
810
  } else {
811
- const T = rn(g.currentFilter);
812
- if (T && T.expressionNode) {
813
- const Se = qt(T.expressionNode), p = r.getOptions();
814
- p.filter = Se, p.sort = T?.sortStrings, r.refreshData(p), Te.isDataSourceV2 || Te.v1State.forceUpdate();
811
+ const S = un(x.currentFilter);
812
+ if (S && S.expressionNode) {
813
+ const Te = Yt(S.expressionNode), ve = r.getOptions();
814
+ ve.filter = Te, ve.sort = S?.sortStrings, r.refreshData(ve), Le.isDataSourceV2 || Le.v1State.forceUpdate();
815
815
  }
816
816
  }
817
817
  };
818
- let je, Qe;
819
- const ht = (T) => {
820
- je = T;
821
- }, ut = (T) => {
822
- Qe = T;
823
- }, ft = () => {
824
- Qe && Qe();
825
- }, mt = () => {
818
+ let Ne, je;
819
+ const gt = (S) => {
820
+ Ne = S;
821
+ }, Xe = (S) => {
822
+ je = S;
823
+ }, pt = () => {
826
824
  je && je();
827
- }, gt = () => h === "none" ? /* @__PURE__ */ e("div", {}) : h === "advanced" ? /* @__PURE__ */ e(
828
- St,
825
+ }, xt = () => {
826
+ Ne && Ne();
827
+ }, Ye = () => u === "none" ? /* @__PURE__ */ e("div", {}) : u === "advanced" ? /* @__PURE__ */ e(
828
+ Dt,
829
829
  {
830
830
  id: i?.componentName,
831
831
  viewName: i?.viewName,
832
832
  apiVersion: i?.apiVersion,
833
- ref: re,
834
- variant: y ?? ge.variant,
835
- expandedFilter: g.expandedFilter,
836
- persistenceDelegator: M,
837
- currentFilter: g.currentFilter,
838
- activeFilterIndex: g.activeFilterIndex,
839
- onSelectedFilter: b,
840
- onFilterChanged: Ue,
841
- onSearchByFilter: Ee,
842
- onToggleExpandedFilter: qe,
843
- onExport: ft,
844
- onPrint: mt,
833
+ ref: O,
834
+ variant: R ?? me.variant,
835
+ expandedFilter: x.expandedFilter,
836
+ persistenceDelegator: _,
837
+ currentFilter: x.currentFilter,
838
+ activeFilterIndex: x.activeFilterIndex,
839
+ onSelectedFilter: y,
840
+ onFilterChanged: lt,
841
+ onSearchByFilter: ye,
842
+ onToggleExpandedFilter: re,
843
+ onExport: pt,
844
+ onPrint: xt,
845
845
  showExportButton: !0,
846
846
  showPrintButton: !0,
847
847
  width: "560px",
848
848
  height: "170px",
849
- children: C
849
+ children: v
850
850
  }
851
- ) : h === "normal" ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e("div", {});
851
+ ) : u === "normal" ? /* @__PURE__ */ e("div", {}) : /* @__PURE__ */ e("div", {});
852
852
  return /* @__PURE__ */ e(
853
- Ge,
853
+ He,
854
854
  {
855
855
  resourceName: we,
856
- resourceDescription: de,
857
- requiredPermissions: B,
858
- fallbackComponent: me,
859
- onSecurityReady: xe?.onSecurityReady,
860
- onAccessDenied: xe?.onAccessDenied,
861
- children: /* @__PURE__ */ c(Le, { withBorder: G, ref: ve, style: { height: "100%" }, children: [
856
+ resourceDescription: he,
857
+ requiredPermissions: z,
858
+ fallbackComponent: fe,
859
+ onSecurityReady: Fe?.onSecurityReady,
860
+ onAccessDenied: Fe?.onAccessDenied,
861
+ children: /* @__PURE__ */ c(_e, { withBorder: L, ref: Be, style: { height: "100%" }, children: [
862
862
  m ? /* @__PURE__ */ e(
863
- Ke,
863
+ Qe,
864
864
  {
865
865
  autoClose: 2e4,
866
866
  withCloseButton: !0,
867
867
  withBorder: !0,
868
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
869
- title: x().t("archbase:WARNING"),
868
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
869
+ title: g().t("archbase:WARNING"),
870
870
  titleColor: "rgb(250, 82, 82)",
871
- variant: y ?? ge.variant,
872
- onClose: () => F && F(),
871
+ variant: R ?? me.variant,
872
+ onClose: () => w && w(),
873
873
  children: /* @__PURE__ */ e("span", { children: V })
874
874
  }
875
875
  ) : null,
876
876
  /* @__PURE__ */ c(
877
- Gt,
877
+ Lt,
878
878
  {
879
- gridRef: S,
879
+ gridRef: D,
880
880
  printTitle: f || o,
881
- logoPrint: P,
881
+ logoPrint: $,
882
882
  width: X,
883
- height: Z,
883
+ height: ee,
884
884
  withBorder: !1,
885
885
  dataSource: r,
886
886
  enableColumnResizing: !0,
887
- enableRowNumbers: se,
887
+ enableRowNumbers: ue,
888
888
  enableRowSelection: te,
889
889
  enableRowActions: ne,
890
- enableTopToolbar: D,
891
- enableTopToolbarActions: N,
890
+ enableTopToolbar: N,
891
+ enableTopToolbarActions: b,
892
892
  manualPagination: !0,
893
893
  manualSorting: !0,
894
- isLoading: ke,
895
- pageSize: u,
896
- pageIndex: v,
897
- allowColumnFilters: h !== "none",
898
- enableGlobalFilter: h !== "none",
899
- renderToolbarInternalActions: h == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
894
+ isLoading: De,
895
+ pageSize: h,
896
+ pageIndex: p,
897
+ allowColumnFilters: u !== "none",
898
+ enableGlobalFilter: u !== "none",
899
+ renderToolbarInternalActions: u == "none" ? () => /* @__PURE__ */ e("div", {}) : void 0,
900
900
  allowExportData: !0,
901
901
  allowPrintData: !0,
902
902
  onSelectedRowsChanged: le,
903
903
  onCellDoubleClick: d,
904
- onFilterModelChange: k,
905
- renderRowActions: ne ? q : void 0,
906
- positionActionsColumn: H,
907
- actionsColumnWidth: z,
908
- toolbarAlignment: ue,
909
- toolbarLeftContent: Ve,
910
- renderToolbarActions: h === "advanced" || h === "none" ? gt : void 0,
911
- paginationLabels: $,
912
- cellPadding: ee,
904
+ onFilterModelChange: P,
905
+ renderRowActions: ne ? ke : void 0,
906
+ positionActionsColumn: q,
907
+ actionsColumnWidth: j,
908
+ toolbarAlignment: ce,
909
+ toolbarLeftContent: ge,
910
+ renderToolbarActions: u === "advanced" || u === "none" ? Ye : void 0,
911
+ paginationLabels: M,
912
+ cellPadding: ie,
913
913
  bottomToolbarMinHeight: E,
914
- tableHeadCellPadding: Y,
915
- getRowId: W,
916
- renderDetailPanel: O ? ({ row: T }) => O({ row: T }) : void 0,
917
- renderTopToolbar: _,
918
- onExport: ut,
919
- onPrint: ht,
920
- variant: y,
921
- withToolbarBorder: Fe,
922
- withPaginationBorder: Ie,
923
- toolbarPadding: A,
924
- paginationPadding: ce,
925
- rowHeight: Ne,
926
- hideFooter: De,
914
+ tableHeadCellPadding: J,
915
+ getRowId: Q,
916
+ renderDetailPanel: W ? ({ row: S }) => W({ row: S }) : void 0,
917
+ renderTopToolbar: Y,
918
+ onExport: Xe,
919
+ onPrint: gt,
920
+ variant: R,
921
+ withToolbarBorder: Ae,
922
+ withPaginationBorder: Pe,
923
+ toolbarPadding: se,
924
+ paginationPadding: G,
925
+ rowHeight: de,
926
+ hideFooter: Ge,
927
927
  children: [
928
928
  a,
929
- l?.visible ? /* @__PURE__ */ e(Xt, { children: /* @__PURE__ */ c(Me, { children: [
929
+ l?.visible ? /* @__PURE__ */ e(ln, { children: /* @__PURE__ */ c(qe, { children: [
930
930
  /* @__PURE__ */ e("h3", { className: "only-print", children: f || o }),
931
- /* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ c(pe, { gap: "8px", rowGap: "8px", children: [
931
+ /* @__PURE__ */ e("div", { className: "no-print", children: /* @__PURE__ */ c(Ce, { gap: "8px", rowGap: "8px", children: [
932
932
  l.customUserActions && l.customUserActionsPosition === "left" ? l.customUserActions : null,
933
933
  l.onAddExecute ? /* @__PURE__ */ e(
934
- J,
934
+ K,
935
935
  {
936
936
  actionName: "add",
937
- actionDescription: `Adicionar novo ${de || "registro"}`,
937
+ actionDescription: `Adicionar novo ${he || "registro"}`,
938
938
  color: "green",
939
- variant: y ?? ge.variant,
940
- leftSection: /* @__PURE__ */ e(bt, {}),
939
+ variant: R ?? me.variant,
940
+ leftSection: /* @__PURE__ */ e(Ft, {}),
941
941
  onClick: () => l && l.onAddExecute && l.onAddExecute(),
942
- children: l.labelAdd || x().t("archbase:New")
942
+ children: l.labelAdd || g().t("archbase:New")
943
943
  }
944
944
  ) : null,
945
945
  l.onEditExecute ? /* @__PURE__ */ e(
946
- J,
946
+ K,
947
947
  {
948
948
  actionName: "edit",
949
- actionDescription: `Editar ${de || "registro"}`,
949
+ actionDescription: `Editar ${he || "registro"}`,
950
950
  color: "blue",
951
- leftSection: /* @__PURE__ */ e(wt, {}),
951
+ leftSection: /* @__PURE__ */ e(At, {}),
952
952
  disabled: !r.isBrowsing() || r.isEmpty(),
953
- variant: y ?? ge.variant,
953
+ variant: R ?? me.variant,
954
954
  onClick: () => l && l.onEditExecute && l.onEditExecute(),
955
- children: l.labelEdit || x().t("archbase:Edit")
955
+ children: l.labelEdit || g().t("archbase:Edit")
956
956
  }
957
957
  ) : null,
958
958
  l.onRemoveExecute ? /* @__PURE__ */ e(
959
- J,
959
+ K,
960
960
  {
961
961
  actionName: "delete",
962
- actionDescription: `Remover ${de || "registro"}`,
962
+ actionDescription: `Remover ${he || "registro"}`,
963
963
  color: "red",
964
- leftSection: /* @__PURE__ */ e(tt, {}),
964
+ leftSection: /* @__PURE__ */ e(rt, {}),
965
965
  disabled: !l?.allowRemove || !r.isBrowsing() || r.isEmpty(),
966
- variant: y ?? ge.variant,
966
+ variant: R ?? me.variant,
967
967
  onClick: () => l && l.onRemoveExecute && l.onRemoveExecute(),
968
- children: l.labelRemove || x().t("archbase:Remove")
968
+ children: l.labelRemove || g().t("archbase:Remove")
969
969
  }
970
970
  ) : null,
971
971
  l.onViewExecute ? /* @__PURE__ */ e(
972
- J,
972
+ K,
973
973
  {
974
974
  actionName: "view",
975
- actionDescription: `Visualizar ${de || "registro"}`,
975
+ actionDescription: `Visualizar ${he || "registro"}`,
976
976
  color: "gray.7",
977
- leftSection: /* @__PURE__ */ e(Ft, {}),
977
+ leftSection: /* @__PURE__ */ e(Rt, {}),
978
978
  disabled: !r.isBrowsing() || r.isEmpty(),
979
- variant: y ?? ge.variant,
979
+ variant: R ?? me.variant,
980
980
  onClick: () => l && l.onViewExecute && l.onViewExecute(),
981
- children: l.labelView || x().t("archbase:View")
981
+ children: l.labelView || g().t("archbase:View")
982
982
  }
983
983
  ) : null,
984
984
  l.customUserActions && l.customUserActionsPosition === "right" ? l.customUserActions : null
@@ -991,13 +991,13 @@ function sn(t, n) {
991
991
  }
992
992
  );
993
993
  }
994
- const Vn = Vt(sn);
995
- function dn(t, n, o, f) {
994
+ const Mn = zt(pn);
995
+ function xn(t, n, o, f) {
996
996
  if (t && t.headerGridColumns) {
997
- 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" };
998
- return /* @__PURE__ */ c(be, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
997
+ 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" }, h = t.headerGridColumns.right ? t.headerGridColumns.right : { xs: "auto", sm: "auto", md: "auto", lg: "auto" };
998
+ return /* @__PURE__ */ c(Ee, { m: 0, gap: "xs", justify: "center", align: "center", grow: !0, children: [
999
999
  /* @__PURE__ */ e(
1000
- be.Col,
1000
+ Ee.Col,
1001
1001
  {
1002
1002
  span: {
1003
1003
  xs: r.xs,
@@ -1015,7 +1015,7 @@ function dn(t, n, o, f) {
1015
1015
  }
1016
1016
  ),
1017
1017
  /* @__PURE__ */ e(
1018
- be.Col,
1018
+ Ee.Col,
1019
1019
  {
1020
1020
  span: {
1021
1021
  xs: i.xs,
@@ -1032,13 +1032,13 @@ function dn(t, n, o, f) {
1032
1032
  }
1033
1033
  ),
1034
1034
  /* @__PURE__ */ e(
1035
- be.Col,
1035
+ Ee.Col,
1036
1036
  {
1037
1037
  span: {
1038
- xs: u.xs,
1039
- sm: u.sm,
1040
- md: u.md,
1041
- lg: u.lg
1038
+ xs: h.xs,
1039
+ sm: h.sm,
1040
+ md: h.md,
1041
+ lg: h.lg
1042
1042
  },
1043
1043
  style: {
1044
1044
  border: f ? "1px dashed" : "",
@@ -1051,15 +1051,15 @@ function dn(t, n, o, f) {
1051
1051
  )
1052
1052
  ] });
1053
1053
  } else {
1054
- const r = t && t.headerFlexGrow ? t.headerFlexGrow : "even", i = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end", u = t && t.headerFlexLeftJustifyContent ? t.headerFlexLeftJustifyContent : "flex-start";
1055
- return /* @__PURE__ */ c(pe, { justify: "space-between", children: [
1054
+ const r = t && t.headerFlexGrow ? t.headerFlexGrow : "even", i = t && t.headerFlexRightJustifyContent ? t.headerFlexRightJustifyContent : "flex-end", h = t && t.headerFlexLeftJustifyContent ? t.headerFlexLeftJustifyContent : "flex-start";
1055
+ return /* @__PURE__ */ c(Ce, { justify: "space-between", children: [
1056
1056
  /* @__PURE__ */ e(
1057
- pe,
1057
+ Ce,
1058
1058
  {
1059
1059
  w: r === "left" || r === "even" ? "100%" : void 0,
1060
1060
  maw: r === "left" || r === "even" ? void 0 : "100%",
1061
1061
  align: "center",
1062
- justify: u,
1062
+ justify: h,
1063
1063
  style: {
1064
1064
  border: f ? "1px dashed" : ""
1065
1065
  },
@@ -1067,7 +1067,7 @@ function dn(t, n, o, f) {
1067
1067
  }
1068
1068
  ),
1069
1069
  /* @__PURE__ */ e(
1070
- pe,
1070
+ Ce,
1071
1071
  {
1072
1072
  w: r === "right" || r === "even" ? "100%" : void 0,
1073
1073
  maw: r === "right" || r === "even" ? void 0 : "100%",
@@ -1082,12 +1082,12 @@ function dn(t, n, o, f) {
1082
1082
  ] });
1083
1083
  }
1084
1084
  }
1085
- function hn(t, n, o, f) {
1085
+ function vn(t, n, o, f) {
1086
1086
  if (t && t.footerGridColumns) {
1087
- 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" };
1088
- return /* @__PURE__ */ c(be, { m: 0, gutter: "xs", justify: "center", align: "center", grow: !0, children: [
1087
+ 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" }, h = t.footerGridColumns.right ? t.footerGridColumns.right : { xs: "content", sm: "content", md: "content", lg: "content" };
1088
+ return /* @__PURE__ */ c(Ee, { m: 0, gap: "xs", justify: "center", align: "center", grow: !0, children: [
1089
1089
  /* @__PURE__ */ e(
1090
- be.Col,
1090
+ Ee.Col,
1091
1091
  {
1092
1092
  span: {
1093
1093
  xs: r.xs,
@@ -1105,7 +1105,7 @@ function hn(t, n, o, f) {
1105
1105
  }
1106
1106
  ),
1107
1107
  /* @__PURE__ */ e(
1108
- be.Col,
1108
+ Ee.Col,
1109
1109
  {
1110
1110
  span: {
1111
1111
  xs: i.xs,
@@ -1122,13 +1122,13 @@ function hn(t, n, o, f) {
1122
1122
  }
1123
1123
  ),
1124
1124
  /* @__PURE__ */ e(
1125
- be.Col,
1125
+ Ee.Col,
1126
1126
  {
1127
1127
  span: {
1128
- xs: u.xs,
1129
- sm: u.sm,
1130
- md: u.md,
1131
- lg: u.lg
1128
+ xs: h.xs,
1129
+ sm: h.sm,
1130
+ md: h.md,
1131
+ lg: h.lg
1132
1132
  },
1133
1133
  style: {
1134
1134
  border: f ? "1px dashed" : "",
@@ -1141,15 +1141,15 @@ function hn(t, n, o, f) {
1141
1141
  )
1142
1142
  ] });
1143
1143
  } else {
1144
- const r = t && t.footerFlexGrow ? t.footerFlexGrow : "even", i = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end", u = t && t.footerFlexLeftJustifyContent ? t.footerFlexLeftJustifyContent : "flex-start";
1145
- return /* @__PURE__ */ c(pe, { justify: "space-between", children: [
1144
+ const r = t && t.footerFlexGrow ? t.footerFlexGrow : "even", i = t && t.footerFlexRightJustifyContent ? t.footerFlexRightJustifyContent : "flex-end", h = t && t.footerFlexLeftJustifyContent ? t.footerFlexLeftJustifyContent : "flex-start";
1145
+ return /* @__PURE__ */ c(Ce, { justify: "space-between", children: [
1146
1146
  /* @__PURE__ */ e(
1147
- pe,
1147
+ Ce,
1148
1148
  {
1149
1149
  w: r === "left" || r === "even" ? "100%" : void 0,
1150
1150
  maw: r === "left" || r === "even" ? void 0 : "100%",
1151
1151
  align: "center",
1152
- justify: u,
1152
+ justify: h,
1153
1153
  style: {
1154
1154
  border: f ? "1px dashed" : "",
1155
1155
  height: "auto",
@@ -1159,7 +1159,7 @@ function hn(t, n, o, f) {
1159
1159
  }
1160
1160
  ),
1161
1161
  /* @__PURE__ */ e(
1162
- pe,
1162
+ Ce,
1163
1163
  {
1164
1164
  w: r === "right" || r === "even" ? "100%" : void 0,
1165
1165
  maw: r === "right" || r === "even" ? void 0 : "100%",
@@ -1176,123 +1176,123 @@ function hn(t, n, o, f) {
1176
1176
  ] });
1177
1177
  }
1178
1178
  }
1179
- function jt({
1179
+ function Mt({
1180
1180
  title: t,
1181
1181
  innerRef: n,
1182
1182
  isError: o = !1,
1183
1183
  error: f = "",
1184
1184
  clearError: r,
1185
1185
  width: i = "100%",
1186
- height: u = "100%",
1187
- withBorder: v = !0,
1186
+ height: h = "100%",
1187
+ withBorder: p = !0,
1188
1188
  children: a,
1189
- radius: C,
1190
- debug: P,
1189
+ radius: v,
1190
+ debug: $,
1191
1191
  defaultDebug: l,
1192
1192
  headerLeft: s,
1193
- headerMiddle: L,
1193
+ headerMiddle: H,
1194
1194
  headerRight: I,
1195
- footerLeft: w,
1196
- footerMiddle: R,
1195
+ footerLeft: C,
1196
+ footerMiddle: A,
1197
1197
  footerRight: m,
1198
- variant: D,
1199
- options: N = {},
1198
+ variant: N,
1199
+ options: b = {},
1200
1200
  style: V,
1201
- debugOptions: F = {
1201
+ debugOptions: w = {
1202
1202
  debugLayoutHotKey: "ctrl+shift+S",
1203
1203
  debugObjectInspectorHotKey: "ctrl+shift+D",
1204
1204
  objectsToInspect: []
1205
1205
  },
1206
1206
  // Props de segurança (opcionais)
1207
- resourceName: h,
1207
+ resourceName: u,
1208
1208
  resourceDescription: X,
1209
- requiredPermissions: Z,
1209
+ requiredPermissions: ee,
1210
1210
  fallbackComponent: ae,
1211
- securityOptions: W
1211
+ securityOptions: Q
1212
1212
  }) {
1213
- const [G, M] = Ht({
1214
- value: P,
1213
+ const [L, _] = Qt({
1214
+ value: $,
1215
1215
  defaultValue: l,
1216
1216
  finalValue: !1
1217
1217
  });
1218
- _t([[F && F.debugLayoutHotKey, () => M(!G)]]);
1219
- const y = ze(), { t: U } = Jt();
1220
- Pe({
1221
- autoRegisterActions: W?.autoRegisterActions ?? !0
1218
+ Xt([[w && w.debugLayoutHotKey, () => _(!L)]]);
1219
+ const R = Me(), { t: T } = Zt();
1220
+ Ue({
1221
+ autoRegisterActions: Q?.autoRegisterActions ?? !0
1222
1222
  });
1223
- const ee = Ae(null), E = n || ee, te = Ae(null), se = Ae(null), ne = it(te), H = it(se), z = it(E), Y = He(() => ({
1224
- height: z.height - ne.height - H.height - Number(Mt("0.625rem")),
1225
- width: z.width - ne.width - H.width
1226
- }), [z.height, z.width, ne.height, ne.width, H.height, H.width]), O = Ae(l);
1227
- et(() => {
1228
- l !== O.current && (M(l), O.current = l);
1229
- }, [l, M]);
1230
- const _ = /* @__PURE__ */ c(Me, { children: [
1223
+ const ie = Se(null), E = n || ie, te = Se(null), ue = Se(null), ne = ct(te), q = ct(ue), j = ct(E), J = Je(() => ({
1224
+ height: j.height - ne.height - q.height - Number(Ot("0.625rem")),
1225
+ width: j.width - ne.width - q.width
1226
+ }), [j.height, j.width, ne.height, ne.width, q.height, q.width]), W = Se(l);
1227
+ nt(() => {
1228
+ l !== W.current && (_(l), W.current = l);
1229
+ }, [l, _]);
1230
+ const Y = /* @__PURE__ */ c(qe, { children: [
1231
1231
  /* @__PURE__ */ e(
1232
- Le,
1232
+ _e,
1233
1233
  {
1234
1234
  ref: E,
1235
- withBorder: v,
1236
- radius: C,
1237
- style: { width: i, height: u, padding: 4, ...V },
1238
- children: /* @__PURE__ */ c(ct, { height: "100%", children: [
1239
- /* @__PURE__ */ e(Et, { size: ne.height, children: /* @__PURE__ */ e("div", { ref: te, children: dn(N, s, I, G) }) }),
1240
- /* @__PURE__ */ e(st, { children: /* @__PURE__ */ e(
1241
- Xe,
1235
+ withBorder: p,
1236
+ radius: v,
1237
+ style: { width: i, height: h, padding: 4, ...V },
1238
+ children: /* @__PURE__ */ c(ht, { height: "100%", children: [
1239
+ /* @__PURE__ */ e(It, { size: ne.height, children: /* @__PURE__ */ e("div", { ref: te, children: xn(b, s, I, L) }) }),
1240
+ /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ e(
1241
+ Ze,
1242
1242
  {
1243
- h: Y.height,
1243
+ h: J.height,
1244
1244
  style: {
1245
- border: G ? "1px dashed" : "",
1245
+ border: L ? "1px dashed" : "",
1246
1246
  padding: "calc(0.625rem / 2)"
1247
1247
  },
1248
- children: a ? /* @__PURE__ */ c(Wt, { children: [
1248
+ children: a ? /* @__PURE__ */ c(en, { children: [
1249
1249
  o && /* @__PURE__ */ e(
1250
- Ke,
1250
+ Qe,
1251
1251
  {
1252
1252
  autoClose: 2e4,
1253
1253
  withCloseButton: !0,
1254
1254
  withBorder: !0,
1255
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
1256
- title: `${U("WARNING")}`,
1255
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
1256
+ title: `${T("WARNING")}`,
1257
1257
  titleColor: "rgb(250, 82, 82)",
1258
- variant: D ?? y.variant,
1258
+ variant: N ?? R.variant,
1259
1259
  onClose: () => r && r(),
1260
1260
  children: /* @__PURE__ */ e("span", { children: f })
1261
1261
  }
1262
1262
  ),
1263
1263
  a
1264
- ] }) : G && /* @__PURE__ */ e(pe, { h: Y.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(ye, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
1264
+ ] }) : L && /* @__PURE__ */ e(Ce, { h: J.height + 80, justify: "center", align: "center", wrap: "wrap", children: /* @__PURE__ */ e(Re, { size: "lg", children: "INSIRA O CONTEÚDO DO PAINEL AQUI." }) })
1265
1265
  }
1266
1266
  ) }),
1267
- /* @__PURE__ */ e(dt, { size: H.height, children: /* @__PURE__ */ e("div", { ref: se, children: hn(N, w, m, G) }) })
1267
+ /* @__PURE__ */ e(mt, { size: q.height, children: /* @__PURE__ */ e("div", { ref: ue, children: vn(b, C, m, L) }) })
1268
1268
  ] })
1269
1269
  }
1270
1270
  ),
1271
1271
  /* @__PURE__ */ e(
1272
- Yt,
1272
+ on,
1273
1273
  {
1274
- debugObjectInspectorHotKey: F && F.debugObjectInspectorHotKey,
1275
- objectsToInspect: F && F.objectsToInspect
1274
+ debugObjectInspectorHotKey: w && w.debugObjectInspectorHotKey,
1275
+ objectsToInspect: w && w.objectsToInspect
1276
1276
  }
1277
1277
  )
1278
1278
  ] });
1279
1279
  return /* @__PURE__ */ e(
1280
- Ge,
1280
+ He,
1281
1281
  {
1282
- resourceName: h,
1282
+ resourceName: u,
1283
1283
  resourceDescription: X,
1284
- requiredPermissions: Z,
1284
+ requiredPermissions: ee,
1285
1285
  fallbackComponent: ae,
1286
- onSecurityReady: W?.onSecurityReady,
1287
- onAccessDenied: W?.onAccessDenied,
1288
- children: _
1286
+ onSecurityReady: Q?.onSecurityReady,
1287
+ onAccessDenied: Q?.onAccessDenied,
1288
+ children: Y
1289
1289
  }
1290
1290
  );
1291
1291
  }
1292
- function un(t, n, o, f, r, i) {
1292
+ function Cn(t, n, o, f, r, i) {
1293
1293
  console.log(`Render de "${t}" na fase "${n}": ${o}ms`);
1294
1294
  }
1295
- function zn({
1295
+ function Un({
1296
1296
  title: t,
1297
1297
  dataSource: n,
1298
1298
  // dataSourceEdition,
@@ -1302,228 +1302,228 @@ function zn({
1302
1302
  filterFields: r,
1303
1303
  innerRef: i,
1304
1304
  //isLoading = false,
1305
- debug: u = !1,
1306
- filterType: v = "normal",
1305
+ debug: h = !1,
1306
+ filterType: p = "normal",
1307
1307
  isError: a = !1,
1308
- error: C = "",
1309
- clearError: P = () => {
1308
+ error: v = "",
1309
+ clearError: $ = () => {
1310
1310
  },
1311
1311
  width: l = "100%",
1312
1312
  height: s = "100%",
1313
- withBorder: L = !0,
1313
+ withBorder: H = !0,
1314
1314
  filterPersistenceDelegator: I,
1315
- withPagination: w = !0,
1316
- radius: R,
1315
+ withPagination: C = !0,
1316
+ radius: A,
1317
1317
  userActions: m,
1318
- columnsCountBreakPoints: D,
1319
- columnsCount: N,
1318
+ columnsCountBreakPoints: N,
1319
+ columnsCount: b,
1320
1320
  gutter: V,
1321
- component: F,
1322
- activeIndex: h,
1321
+ component: w,
1322
+ activeIndex: u,
1323
1323
  activeBackgroundColor: X,
1324
- activeColor: Z,
1324
+ activeColor: ee,
1325
1325
  onItemEnter: ae,
1326
- onItemLeave: W,
1327
- style: G,
1328
- spaceOptions: M,
1329
- variant: y,
1330
- id: U = on("masonry"),
1331
- debugOptions: ee,
1326
+ onItemLeave: Q,
1327
+ style: L,
1328
+ spaceOptions: _,
1329
+ variant: R,
1330
+ id: T = fn("masonry"),
1331
+ debugOptions: ie,
1332
1332
  // Props de segurança (opcionais)
1333
1333
  resourceName: E,
1334
1334
  resourceDescription: te,
1335
- requiredPermissions: se,
1335
+ requiredPermissions: ue,
1336
1336
  fallbackComponent: ne,
1337
- securityOptions: H
1337
+ securityOptions: q
1338
1338
  }) {
1339
- const z = ze(), [Y] = Q(U), O = i || Ae(null), _ = Ae(null), [ue, Ce] = Q(n.getCurrentPage()), [le, d] = Q(
1340
- h || (n && n.getTotalRecords() > 0 ? 0 : -1)
1339
+ const j = Me(), [J] = U(T), W = i || Se(null), Y = Se(null), [ce, be] = U(n.getCurrentPage()), [le, d] = U(
1340
+ u || (n && n.getTotalRecords() > 0 ? 0 : -1)
1341
1341
  );
1342
- it(O);
1343
- const [k, $] = Q({
1342
+ ct(W);
1343
+ const [P, M] = U({
1344
1344
  activeFilterIndex: -1,
1345
1345
  expandedFilter: !1
1346
- }), [we, de] = Q(0), {
1347
- isDataSourceV2: B,
1348
- v1State: { forceUpdate: me }
1349
- } = _e(
1346
+ }), [we, he] = U(0), {
1347
+ isDataSourceV2: z,
1348
+ v1State: { forceUpdate: fe }
1349
+ } = We(
1350
1350
  "ArchbaseMasonryTemplate",
1351
1351
  n
1352
1352
  );
1353
- nt({
1353
+ it({
1354
1354
  dataSource: n,
1355
- listener: (g) => {
1356
- (g.type === Re.afterRemove || g.type === Re.refreshData) && (de((j) => j + 1), B || me());
1355
+ listener: (x) => {
1356
+ (x.type === Ie.afterRemove || x.type === Ie.refreshData) && (he((k) => k + 1), z || fe());
1357
1357
  }
1358
1358
  });
1359
- const xe = He(() => {
1360
- if (F) {
1361
- const g = F.type;
1362
- let j = {};
1363
- return F.props && (j = F.props), n.browseRecords().map((q, ge) => {
1364
- const ve = `${Y}_${ge}`, ke = `${Y}_${ge}`;
1365
- let Ve = q.active === void 0 ? !1 : q.active;
1366
- return le >= 0 && (Ve = !1, le === ge && (Ve = !0)), /* @__PURE__ */ e(
1367
- g,
1359
+ const Fe = Je(() => {
1360
+ if (w) {
1361
+ const x = w.type;
1362
+ let k = {};
1363
+ return w.props && (k = w.props), n.browseRecords().map((ke, me) => {
1364
+ const Be = `${J}_${me}`, De = `${J}_${me}`;
1365
+ let ge = ke.active === void 0 ? !1 : ke.active;
1366
+ return le >= 0 && (ge = !1, le === me && (ge = !0)), /* @__PURE__ */ e(
1367
+ x,
1368
1368
  {
1369
- id: ke,
1370
- active: Ve,
1371
- index: ge,
1369
+ id: De,
1370
+ active: ge,
1371
+ index: me,
1372
1372
  dataSource: n,
1373
- recordData: q,
1374
- disabled: q.disabled,
1375
- ...j
1373
+ recordData: ke,
1374
+ disabled: ke.disabled,
1375
+ ...k
1376
1376
  },
1377
- ve
1377
+ Be
1378
1378
  );
1379
1379
  });
1380
1380
  }
1381
1381
  return [];
1382
- }, [le, F, Y, n, we]), Fe = (g, j) => {
1383
- $({ ...k, currentFilter: g, activeFilterIndex: j });
1384
- }, Ie = (g) => {
1385
- $({ ...k, expandedFilter: g });
1386
- }, A = (g, j) => {
1387
- $({ ...k, currentFilter: g, activeFilterIndex: j });
1388
- }, ce = () => {
1389
- }, Ne = (g, j) => {
1390
- d(g), n && n.gotoRecordByData(j);
1391
- }, De = (g) => {
1382
+ }, [le, w, J, n, we]), Ae = (x, k) => {
1383
+ M({ ...P, currentFilter: x, activeFilterIndex: k });
1384
+ }, Pe = (x) => {
1385
+ M({ ...P, expandedFilter: x });
1386
+ }, se = (x, k) => {
1387
+ M({ ...P, currentFilter: x, activeFilterIndex: k });
1388
+ }, G = () => {
1389
+ }, de = (x, k) => {
1390
+ d(x), n && n.gotoRecordByData(k);
1391
+ }, Ge = (x) => {
1392
1392
  if (n) {
1393
- const j = n.getOptions();
1394
- j.filter = g, j.currentPage = ue, n.refreshData(j), B || me();
1393
+ const k = n.getOptions();
1394
+ k.filter = x, k.currentPage = ce, n.refreshData(k), z || fe();
1395
1395
  }
1396
- }, re = (g) => {
1396
+ }, O = (x) => {
1397
1397
  if (n) {
1398
- const j = n.getOptions();
1399
- j.currentPage = g, n.refreshData(j), B || me();
1398
+ const k = n.getOptions();
1399
+ k.currentPage = x, n.refreshData(k), z || fe();
1400
1400
  }
1401
- }, S = () => v === "normal" && f ? /* @__PURE__ */ e(
1402
- ln,
1401
+ }, D = () => p === "normal" && f ? /* @__PURE__ */ e(
1402
+ hn,
1403
1403
  {
1404
1404
  searchableFields: f,
1405
- onFilter: De,
1405
+ onFilter: Ge,
1406
1406
  minFilterValueLength: 1
1407
1407
  }
1408
- ) : v === "advanced" ? /* @__PURE__ */ e(Ot, { id: `profile_${o.componentName}`, onRender: un, children: /* @__PURE__ */ e(
1409
- St,
1408
+ ) : p === "advanced" ? /* @__PURE__ */ e(tn, { id: `profile_${o.componentName}`, onRender: Cn, children: /* @__PURE__ */ e(
1409
+ Dt,
1410
1410
  {
1411
1411
  id: o.componentName,
1412
1412
  viewName: o.viewName,
1413
1413
  apiVersion: o.apiVersion,
1414
- ref: _,
1415
- variant: y || z.variant,
1416
- expandedFilter: k.expandedFilter,
1414
+ ref: Y,
1415
+ variant: R || j.variant,
1416
+ expandedFilter: P.expandedFilter,
1417
1417
  persistenceDelegator: I,
1418
- currentFilter: k.currentFilter,
1419
- activeFilterIndex: k.activeFilterIndex,
1420
- onSelectedFilter: A,
1421
- onFilterChanged: Fe,
1422
- onSearchByFilter: ce,
1423
- onToggleExpandedFilter: Ie,
1418
+ currentFilter: P.currentFilter,
1419
+ activeFilterIndex: P.activeFilterIndex,
1420
+ onSelectedFilter: se,
1421
+ onFilterChanged: Ae,
1422
+ onSearchByFilter: G,
1423
+ onToggleExpandedFilter: Pe,
1424
1424
  width: "660px",
1425
1425
  height: "170px",
1426
1426
  children: r
1427
1427
  }
1428
- ) }) : /* @__PURE__ */ e(Me, {}), Te = { ...{
1428
+ ) }) : /* @__PURE__ */ e(qe, {}), Le = { ...{
1429
1429
  headerFlexGrow: "left",
1430
1430
  footerGridColumns: {}
1431
- }, ...M };
1431
+ }, ..._ };
1432
1432
  return /* @__PURE__ */ e(
1433
- Ge,
1433
+ He,
1434
1434
  {
1435
1435
  resourceName: E,
1436
1436
  resourceDescription: te,
1437
- requiredPermissions: se,
1437
+ requiredPermissions: ue,
1438
1438
  fallbackComponent: ne,
1439
- onSecurityReady: H?.onSecurityReady,
1440
- onAccessDenied: H?.onAccessDenied,
1439
+ onSecurityReady: q?.onSecurityReady,
1440
+ onAccessDenied: q?.onAccessDenied,
1441
1441
  children: /* @__PURE__ */ e(
1442
- jt,
1442
+ Mt,
1443
1443
  {
1444
- innerRef: O,
1444
+ innerRef: W,
1445
1445
  width: l,
1446
1446
  height: s,
1447
- radius: R,
1448
- withBorder: L,
1447
+ radius: A,
1448
+ withBorder: H,
1449
1449
  isError: a,
1450
- error: C,
1451
- clearError: P,
1450
+ error: v,
1451
+ clearError: $,
1452
1452
  title: t,
1453
- defaultDebug: u,
1454
- debugOptions: ee,
1455
- style: G,
1456
- options: Te,
1457
- headerLeft: m?.visible !== !1 ? /* @__PURE__ */ c(pe, { gap: "8px", rowGap: "8px", children: [
1453
+ defaultDebug: h,
1454
+ debugOptions: ie,
1455
+ style: L,
1456
+ options: Le,
1457
+ headerLeft: m?.visible !== !1 ? /* @__PURE__ */ c(Ce, { gap: "8px", rowGap: "8px", children: [
1458
1458
  m?.customUserActions && m?.customUserActionsPosition === "left" ? m.customUserActions : null,
1459
1459
  m?.allowAdd !== !1 && m?.onAddExecute ? /* @__PURE__ */ e(
1460
- J,
1460
+ K,
1461
1461
  {
1462
1462
  actionName: "add",
1463
1463
  actionDescription: `Adicionar novo ${te || "registro"}`,
1464
1464
  color: "green",
1465
- variant: y ?? z.variant,
1466
- leftSection: /* @__PURE__ */ e(bt, {}),
1465
+ variant: R ?? j.variant,
1466
+ leftSection: /* @__PURE__ */ e(Ft, {}),
1467
1467
  onClick: () => m.onAddExecute(),
1468
- children: m.labelAdd || x().t("archbase:New")
1468
+ children: m.labelAdd || g().t("archbase:New")
1469
1469
  }
1470
1470
  ) : null,
1471
1471
  m?.allowEdit !== !1 && m?.onEditExecute ? /* @__PURE__ */ e(
1472
- J,
1472
+ K,
1473
1473
  {
1474
1474
  actionName: "edit",
1475
1475
  actionDescription: `Editar ${te || "registro"}`,
1476
1476
  color: "blue",
1477
- leftSection: /* @__PURE__ */ e(wt, {}),
1477
+ leftSection: /* @__PURE__ */ e(At, {}),
1478
1478
  disabled: !n.isBrowsing() || n.isEmpty(),
1479
- variant: y ?? z.variant,
1479
+ variant: R ?? j.variant,
1480
1480
  onClick: () => m.onEditExecute(),
1481
- children: m.labelEdit || x().t("archbase:Edit")
1481
+ children: m.labelEdit || g().t("archbase:Edit")
1482
1482
  }
1483
1483
  ) : null,
1484
1484
  m?.allowRemove !== !1 && m?.onRemoveExecute ? /* @__PURE__ */ e(
1485
- J,
1485
+ K,
1486
1486
  {
1487
1487
  actionName: "delete",
1488
1488
  actionDescription: `Remover ${te || "registro"}`,
1489
1489
  color: "red",
1490
- leftSection: /* @__PURE__ */ e(tt, {}),
1490
+ leftSection: /* @__PURE__ */ e(rt, {}),
1491
1491
  disabled: !n.isBrowsing() || n.isEmpty(),
1492
- variant: y ?? z.variant,
1492
+ variant: R ?? j.variant,
1493
1493
  onClick: () => m.onRemoveExecute(),
1494
- children: m.labelRemove || x().t("archbase:Remove")
1494
+ children: m.labelRemove || g().t("archbase:Remove")
1495
1495
  }
1496
1496
  ) : null,
1497
1497
  m?.allowView !== !1 && m?.onViewExecute ? /* @__PURE__ */ e(
1498
- J,
1498
+ K,
1499
1499
  {
1500
1500
  actionName: "view",
1501
1501
  actionDescription: `Visualizar ${te || "registro"}`,
1502
1502
  color: "gray.7",
1503
- leftSection: /* @__PURE__ */ e(Ft, {}),
1503
+ leftSection: /* @__PURE__ */ e(Rt, {}),
1504
1504
  disabled: !n.isBrowsing() || n.isEmpty(),
1505
- variant: y ?? z.variant,
1505
+ variant: R ?? j.variant,
1506
1506
  onClick: () => m.onViewExecute(),
1507
- children: m.labelView || x().t("archbase:View")
1507
+ children: m.labelView || g().t("archbase:View")
1508
1508
  }
1509
1509
  ) : null,
1510
1510
  m?.customUserActions && m?.customUserActionsPosition === "right" ? m.customUserActions : null
1511
1511
  ] }) : void 0,
1512
- headerRight: S(),
1513
- footerRight: w ? /* @__PURE__ */ e(kt, { total: n.getTotalPages(), onChange: re }) : void 0,
1512
+ headerRight: D(),
1513
+ footerRight: C ? /* @__PURE__ */ e(Nt, { total: n.getTotalPages(), onChange: O }) : void 0,
1514
1514
  children: /* @__PURE__ */ e(
1515
- Zt,
1515
+ an,
1516
1516
  {
1517
1517
  value: {
1518
1518
  dataSource: n,
1519
- ownerId: U,
1520
- handleSelectItem: Ne,
1519
+ ownerId: T,
1520
+ handleSelectItem: de,
1521
1521
  activeBackgroundColor: X,
1522
- activeColor: Z,
1522
+ activeColor: ee,
1523
1523
  onItemEnter: ae,
1524
- onItemLeave: W
1524
+ onItemLeave: Q
1525
1525
  },
1526
- children: /* @__PURE__ */ e(en, { columnsCountBreakPoints: D, children: /* @__PURE__ */ e(tn, { gutter: V, columnsCount: N, children: xe }) })
1526
+ children: /* @__PURE__ */ e(cn, { columnsCountBreakPoints: N, children: /* @__PURE__ */ e(sn, { gutter: V, columnsCount: b, children: Fe }) })
1527
1527
  }
1528
1528
  )
1529
1529
  }
@@ -1531,7 +1531,7 @@ function zn({
1531
1531
  }
1532
1532
  );
1533
1533
  }
1534
- const fn = {
1534
+ const yn = {
1535
1535
  visible: !0,
1536
1536
  allowAdd: !0,
1537
1537
  allowEdit: !0,
@@ -1539,7 +1539,7 @@ const fn = {
1539
1539
  allowRemove: !0,
1540
1540
  positionCustomUserActions: "after"
1541
1541
  };
1542
- function Pn({
1542
+ function Hn({
1543
1543
  title: t,
1544
1544
  dataSource: n,
1545
1545
  // dataSourceEdition,
@@ -1549,157 +1549,157 @@ function Pn({
1549
1549
  innerRef: r,
1550
1550
  //isLoading = false,
1551
1551
  isError: i = !1,
1552
- error: u = "",
1553
- clearError: v = () => {
1552
+ error: h = "",
1553
+ clearError: p = () => {
1554
1554
  },
1555
1555
  width: a = "100%",
1556
- height: C = "100%",
1557
- withBorder: P = !0,
1556
+ height: v = "100%",
1557
+ withBorder: $ = !0,
1558
1558
  filterPersistenceDelegator: l,
1559
1559
  withPagination: s = !0,
1560
- children: L,
1560
+ children: H,
1561
1561
  radius: I,
1562
- userActions: w,
1563
- debug: R = !1,
1562
+ userActions: C,
1563
+ debug: A = !1,
1564
1564
  variant: m,
1565
- actionsButtonsOptions: D,
1566
- spaceOptions: N,
1565
+ actionsButtonsOptions: N,
1566
+ spaceOptions: b,
1567
1567
  style: V,
1568
- debugOptions: F,
1568
+ debugOptions: w,
1569
1569
  // Props de segurança (opcionais)
1570
- resourceName: h,
1570
+ resourceName: u,
1571
1571
  resourceDescription: X,
1572
- requiredPermissions: Z,
1572
+ requiredPermissions: ee,
1573
1573
  fallbackComponent: ae,
1574
- securityOptions: W
1574
+ securityOptions: Q
1575
1575
  }) {
1576
- const G = ze(), M = Pe({
1577
- autoRegisterActions: W?.autoRegisterActions ?? !0
1578
- }), y = r || Ae(null), U = Ae(null), [ee, E] = Q({
1576
+ const L = Me(), _ = Ue({
1577
+ autoRegisterActions: Q?.autoRegisterActions ?? !0
1578
+ }), R = r || Se(null), T = Se(null), [ie, E] = U({
1579
1579
  activeFilterIndex: -1,
1580
1580
  expandedFilter: !1
1581
1581
  }), {
1582
1582
  isDataSourceV2: te,
1583
- v1State: { forceUpdate: se }
1584
- } = _e(
1583
+ v1State: { forceUpdate: ue }
1584
+ } = We(
1585
1585
  "ArchbasePanelTemplate",
1586
1586
  n
1587
- ), ne = He(() => {
1588
- const d = { ...fn, ...w }, k = (we) => M.isAvailable ? (M.registerAction(), M.hasPermission()) : !0, $ = [];
1589
- return d.allowAdd && d.onAddExecute && k() && $.push({
1587
+ ), ne = Je(() => {
1588
+ const d = { ...yn, ...C }, P = (we) => _.isAvailable ? (_.registerAction(), _.hasPermission()) : !0, M = [];
1589
+ return d.allowAdd && d.onAddExecute && P() && M.push({
1590
1590
  id: "1",
1591
- icon: /* @__PURE__ */ e(bt, {}),
1591
+ icon: /* @__PURE__ */ e(Ft, {}),
1592
1592
  color: "green",
1593
- label: d.labelAdd ? d.labelAdd : x().t("archbase:New"),
1593
+ label: d.labelAdd ? d.labelAdd : g().t("archbase:New"),
1594
1594
  executeAction: () => {
1595
1595
  d && d.onAddExecute && d.onAddExecute();
1596
1596
  },
1597
1597
  enabled: !0,
1598
1598
  hint: "Clique para criar."
1599
- }), d.allowEdit && d.onEditExecute && k() && $.push({
1599
+ }), d.allowEdit && d.onEditExecute && P() && M.push({
1600
1600
  id: "2",
1601
- icon: /* @__PURE__ */ e(wt, {}),
1601
+ icon: /* @__PURE__ */ e(At, {}),
1602
1602
  color: "blue",
1603
- label: d.labelEdit ? d.labelEdit : x().t("archbase:Edit"),
1603
+ label: d.labelEdit ? d.labelEdit : g().t("archbase:Edit"),
1604
1604
  executeAction: () => {
1605
1605
  d && d.onEditExecute && d.onEditExecute();
1606
1606
  },
1607
1607
  enabled: !n.isEmpty() && n.isBrowsing(),
1608
1608
  hint: "Clique para editar."
1609
- }), d.allowRemove && d.onRemoveExecute && k() && $.push({
1609
+ }), d.allowRemove && d.onRemoveExecute && P() && M.push({
1610
1610
  id: "3",
1611
- icon: /* @__PURE__ */ e(tt, {}),
1611
+ icon: /* @__PURE__ */ e(rt, {}),
1612
1612
  color: "red",
1613
- label: d.labelRemove ? d.labelRemove : x().t("archbase:Remove"),
1613
+ label: d.labelRemove ? d.labelRemove : g().t("archbase:Remove"),
1614
1614
  executeAction: () => {
1615
1615
  d && d.onRemoveExecute && d.onRemoveExecute();
1616
1616
  },
1617
1617
  enabled: !n.isEmpty() && n.isBrowsing(),
1618
1618
  hint: "Clique para remover."
1619
- }), d.allowView && d.onView && k() && $.push({
1619
+ }), d.allowView && d.onView && P() && M.push({
1620
1620
  id: "4",
1621
- icon: /* @__PURE__ */ e(Ft, {}),
1621
+ icon: /* @__PURE__ */ e(Rt, {}),
1622
1622
  color: "green",
1623
- label: d.labelView ? d.labelView : x().t("archbase:View"),
1623
+ label: d.labelView ? d.labelView : g().t("archbase:View"),
1624
1624
  executeAction: () => {
1625
1625
  d && d.onView && d.onView();
1626
1626
  },
1627
1627
  enabled: !n.isEmpty() && n.isBrowsing(),
1628
1628
  hint: "Clique para visualizar."
1629
- }), d.customUserActions && d.positionCustomUserActions === "before" ? [...d.customUserActions, ...$] : d.customUserActions && d.positionCustomUserActions === "after" ? [...$, ...d.customUserActions] : $;
1630
- }, [w, n, M]), H = (d, k) => {
1631
- E({ ...ee, currentFilter: d, activeFilterIndex: k });
1632
- }, z = (d) => {
1633
- E({ ...ee, expandedFilter: d });
1634
- }, Y = (d, k) => {
1635
- E({ ...ee, currentFilter: d, activeFilterIndex: k });
1636
- }, O = () => {
1637
- }, _ = {
1629
+ }), d.customUserActions && d.positionCustomUserActions === "before" ? [...d.customUserActions, ...M] : d.customUserActions && d.positionCustomUserActions === "after" ? [...M, ...d.customUserActions] : M;
1630
+ }, [C, n, _]), q = (d, P) => {
1631
+ E({ ...ie, currentFilter: d, activeFilterIndex: P });
1632
+ }, j = (d) => {
1633
+ E({ ...ie, expandedFilter: d });
1634
+ }, J = (d, P) => {
1635
+ E({ ...ie, currentFilter: d, activeFilterIndex: P });
1636
+ }, W = () => {
1637
+ }, Y = {
1638
1638
  menuButtonColor: "blue.5",
1639
1639
  menuPosition: "left"
1640
- }, ue = {
1640
+ }, ce = {
1641
1641
  headerFlexGrow: "left",
1642
1642
  footerFlexGrow: "right"
1643
1643
  // footerGridColumns: {},
1644
- }, Ce = { ..._, ...D }, le = { ...ue, ...N };
1644
+ }, be = { ...Y, ...N }, le = { ...ce, ...b };
1645
1645
  return /* @__PURE__ */ e(
1646
- Ge,
1646
+ He,
1647
1647
  {
1648
- resourceName: h,
1648
+ resourceName: u,
1649
1649
  resourceDescription: X,
1650
- requiredPermissions: Z,
1650
+ requiredPermissions: ee,
1651
1651
  fallbackComponent: ae,
1652
- onSecurityReady: W?.onSecurityReady,
1653
- onAccessDenied: W?.onAccessDenied,
1652
+ onSecurityReady: Q?.onSecurityReady,
1653
+ onAccessDenied: Q?.onAccessDenied,
1654
1654
  children: /* @__PURE__ */ e(
1655
- jt,
1655
+ Mt,
1656
1656
  {
1657
- innerRef: y,
1657
+ innerRef: R,
1658
1658
  width: a,
1659
- height: C,
1659
+ height: v,
1660
1660
  radius: I,
1661
- withBorder: P,
1661
+ withBorder: $,
1662
1662
  isError: i,
1663
- error: u,
1664
- clearError: v,
1663
+ error: h,
1664
+ clearError: p,
1665
1665
  title: t,
1666
- defaultDebug: R,
1667
- debugOptions: F,
1666
+ defaultDebug: A,
1667
+ debugOptions: w,
1668
1668
  style: V,
1669
1669
  options: le,
1670
- headerLeft: /* @__PURE__ */ e(nn, { actions: ne, options: Ce }),
1670
+ headerLeft: /* @__PURE__ */ e(dn, { actions: ne, options: be }),
1671
1671
  headerRight: /* @__PURE__ */ e(
1672
- St,
1672
+ Dt,
1673
1673
  {
1674
1674
  id: o.componentName,
1675
1675
  viewName: o.viewName,
1676
1676
  apiVersion: o.apiVersion,
1677
- ref: U,
1678
- variant: m || G.variant,
1679
- expandedFilter: ee.expandedFilter,
1677
+ ref: T,
1678
+ variant: m || L.variant,
1679
+ expandedFilter: ie.expandedFilter,
1680
1680
  persistenceDelegator: l,
1681
- currentFilter: ee.currentFilter,
1682
- activeFilterIndex: ee.activeFilterIndex,
1683
- onSelectedFilter: Y,
1684
- onFilterChanged: H,
1685
- onSearchByFilter: O,
1686
- onToggleExpandedFilter: z,
1681
+ currentFilter: ie.currentFilter,
1682
+ activeFilterIndex: ie.activeFilterIndex,
1683
+ onSelectedFilter: J,
1684
+ onFilterChanged: q,
1685
+ onSearchByFilter: W,
1686
+ onToggleExpandedFilter: j,
1687
1687
  width: "660px",
1688
1688
  height: "170px",
1689
1689
  children: f
1690
1690
  }
1691
1691
  ),
1692
- footerRight: s && /* @__PURE__ */ e(kt, { total: 10 }),
1693
- children: L
1692
+ footerRight: s && /* @__PURE__ */ e(Nt, { total: 10 }),
1693
+ children: H
1694
1694
  }
1695
1695
  )
1696
1696
  }
1697
1697
  );
1698
1698
  }
1699
- function Gn() {
1699
+ function _n() {
1700
1700
  return /* @__PURE__ */ e("div", { children: "SEARCH TEMPLATE" });
1701
1701
  }
1702
- function $n({
1702
+ function qn({
1703
1703
  // Header
1704
1704
  title: t,
1705
1705
  subtitle: n,
@@ -1707,153 +1707,153 @@ function $n({
1707
1707
  headerActions: f,
1708
1708
  showDeleteButton: r = !1,
1709
1709
  onDelete: i,
1710
- saveLabel: u,
1711
- cancelLabel: v,
1710
+ saveLabel: h,
1711
+ cancelLabel: p,
1712
1712
  buttonsPosition: a = "header",
1713
1713
  // Left Column
1714
- leftColumnContent: C,
1715
- leftColumnSpan: P = 6,
1714
+ leftColumnContent: v,
1715
+ leftColumnSpan: $ = 6,
1716
1716
  hideLeftColumn: l = !1,
1717
1717
  // Right Column - Form
1718
1718
  formTitle: s,
1719
- formSubtitle: L,
1719
+ formSubtitle: H,
1720
1720
  statusBadge: I,
1721
- tabs: w,
1722
- defaultTab: R,
1723
- tabsVariant: m = "default",
1724
- children: D,
1721
+ tabs: C,
1722
+ defaultTab: A,
1723
+ tabsVariant: m = "outline",
1724
+ children: N,
1725
1725
  // Layout
1726
- width: N = "100%",
1726
+ width: b = "100%",
1727
1727
  height: V = "100%",
1728
- withBorder: F = !0,
1729
- radius: h,
1728
+ withBorder: w = !0,
1729
+ radius: u,
1730
1730
  style: X,
1731
1731
  // States
1732
- innerRef: Z,
1732
+ innerRef: ee,
1733
1733
  isLoading: ae = !1,
1734
- isCanceling: W = !1,
1735
- isSaving: G = !1,
1736
- isError: M = !1,
1737
- error: y = "",
1738
- clearError: U = () => {
1734
+ isCanceling: Q = !1,
1735
+ isSaving: L = !1,
1736
+ isError: _ = !1,
1737
+ error: R = "",
1738
+ clearError: T = () => {
1739
1739
  },
1740
- autoCloseAlertError: ee = 15e3,
1740
+ autoCloseAlertError: ie = 15e3,
1741
1741
  // DataSource
1742
1742
  dataSource: E,
1743
1743
  variant: te,
1744
1744
  // Callbacks
1745
- onSave: se,
1745
+ onSave: ue,
1746
1746
  onCancel: ne,
1747
- onBeforeSave: H,
1748
- onAfterSave: z,
1749
- onBeforeCancel: Y,
1750
- onAfterCancel: O,
1751
- onError: _,
1747
+ onBeforeSave: q,
1748
+ onAfterSave: j,
1749
+ onBeforeCancel: J,
1750
+ onAfterCancel: W,
1751
+ onError: Y,
1752
1752
  // Navigation
1753
- routePath: ue,
1754
- onBeforeClose: Ce,
1753
+ routePath: ce,
1754
+ onBeforeClose: be,
1755
1755
  useNavigationListener: le,
1756
1756
  // Security
1757
1757
  resourceName: d,
1758
- resourceDescription: k,
1759
- requiredPermissions: $,
1758
+ resourceDescription: P,
1759
+ requiredPermissions: M,
1760
1760
  fallbackComponent: we,
1761
- securityOptions: de,
1762
- ...B
1761
+ securityOptions: he,
1762
+ ...z
1763
1763
  }) {
1764
- const me = ze(), [xe, Fe] = Q(M), [Ie, A] = Q(y), [ce, Ne] = Q(R || (w?.[0]?.value ?? null)), De = ot();
1765
- Pe({
1766
- autoRegisterActions: de?.autoRegisterActions ?? !0
1764
+ const fe = Me(), [Fe, Ae] = U(_), [Pe, se] = U(R), [G, de] = U(A || (C?.[0]?.value ?? null)), Ge = dt();
1765
+ Ue({
1766
+ autoRegisterActions: he?.autoRegisterActions ?? !0
1767
1767
  });
1768
- const re = _e(
1768
+ const O = We(
1769
1769
  "ArchbaseTwoColumnFormTemplate",
1770
1770
  E,
1771
1771
  void 0,
1772
1772
  void 0
1773
1773
  );
1774
- nt({
1774
+ it({
1775
1775
  dataSource: E,
1776
- listener: (b) => {
1777
- b.type === Re.onError && (Fe(!0), A(b.error)), (b.type === Re.afterEdit || b.type === Re.afterInsert) && (re.isDataSourceV2 || De());
1776
+ listener: (y) => {
1777
+ y.type === Ie.onError && (Ae(!0), se(y.error)), (y.type === Ie.afterEdit || y.type === Ie.afterInsert) && (O.isDataSourceV2 || Ge());
1778
1778
  }
1779
1779
  });
1780
- const S = Nt(), $e = ie((b, Ee) => ({
1781
- closeAllowed: (je) => {
1780
+ const D = Pt(), $e = Z((y, ye) => ({
1781
+ closeAllowed: (Ne) => {
1782
1782
  }
1783
- }), []), Te = le || $e, { closeAllowed: g } = Te(ue || "", () => {
1784
- Ce && Ce() === !1 || g();
1785
- }), j = async (b) => {
1783
+ }), []), Le = le || $e, { closeAllowed: x } = Le(ce || "", () => {
1784
+ be && be() === !1 || x();
1785
+ }), k = async (y) => {
1786
1786
  try {
1787
- se ? se(b) : (H && await H(b), E.isBrowsing() || E.save().then(() => {
1788
- S?.clearAll(), z && z(b), g();
1789
- }).catch((Ee) => {
1790
- _ && _(fe(Ee)), Fe(!0), A(fe(Ee));
1787
+ ue ? ue(y) : (q && await q(y), E.isBrowsing() || E.save().then(() => {
1788
+ D?.clearAll(), j && j(y), x();
1789
+ }).catch((ye) => {
1790
+ Y && Y(xe(ye)), Ae(!0), se(xe(ye));
1791
1791
  }));
1792
- } catch (Ee) {
1793
- _ && _(fe(Ee)), Fe(!0), A(fe(Ee));
1792
+ } catch (ye) {
1793
+ Y && Y(xe(ye)), Ae(!0), se(xe(ye));
1794
1794
  }
1795
- }, q = () => {
1795
+ }, ke = () => {
1796
1796
  try {
1797
- ne ? ne(g) : (Y && Y(), E.isBrowsing() || E.cancel(), S?.clearAll(), O && O(), g());
1798
- } catch (b) {
1799
- _ && _(fe(b)), Fe(!0), A(fe(b));
1797
+ ne ? ne(x) : (J && J(), E.isBrowsing() || E.cancel(), D?.clearAll(), W && W(), x());
1798
+ } catch (y) {
1799
+ Y && Y(xe(y)), Ae(!0), se(xe(y));
1800
1800
  }
1801
- }, ge = () => {
1802
- U && U(), Fe(!1), A("");
1803
- }, ve = l ? 12 : 12 - P, ke = E && !E.isBrowsing(), Ve = a === "header" || a === "both", Ue = a === "footer" || a === "both", qe = () => /* @__PURE__ */ e(oe, { gap: "sm", children: ke ? /* @__PURE__ */ c(Me, { children: [
1801
+ }, me = () => {
1802
+ T && T(), Ae(!1), se("");
1803
+ }, Be = l ? 12 : 12 - $, De = E && !E.isBrowsing(), ge = a === "header" || a === "both", lt = a === "footer" || a === "both", re = () => /* @__PURE__ */ e(oe, { gap: "sm", children: De ? /* @__PURE__ */ c(qe, { children: [
1804
1804
  /* @__PURE__ */ e(
1805
- J,
1805
+ K,
1806
1806
  {
1807
1807
  actionName: "cancel",
1808
1808
  actionDescription: "Cancelar operação",
1809
- leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
1810
- onClick: q,
1809
+ leftSection: /* @__PURE__ */ e(ze, { size: 16 }),
1810
+ onClick: ke,
1811
1811
  variant: "default",
1812
- loading: W,
1813
- children: v || x().t("Cancel")
1812
+ loading: Q,
1813
+ children: p || g().t("Cancel")
1814
1814
  }
1815
1815
  ),
1816
1816
  /* @__PURE__ */ e(
1817
- J,
1817
+ K,
1818
1818
  {
1819
1819
  actionName: "save",
1820
- actionDescription: `Salvar ${k || "registro"}`,
1821
- leftSection: /* @__PURE__ */ e(xt, { size: 16 }),
1822
- onClick: () => j(E.getCurrentRecord()),
1823
- variant: te ?? me.variant,
1820
+ actionDescription: `Salvar ${P || "registro"}`,
1821
+ leftSection: /* @__PURE__ */ e(Ct, { size: 16 }),
1822
+ onClick: () => k(E.getCurrentRecord()),
1823
+ variant: te ?? fe.variant,
1824
1824
  color: "blue",
1825
- loading: G,
1826
- children: u || x().t("Ok")
1825
+ loading: L,
1826
+ children: h || g().t("Ok")
1827
1827
  }
1828
1828
  )
1829
1829
  ] }) : /* @__PURE__ */ e(
1830
- J,
1830
+ K,
1831
1831
  {
1832
1832
  actionName: "close",
1833
1833
  actionDescription: "Fechar formulário",
1834
- leftSection: /* @__PURE__ */ e(Be, { size: 16 }),
1835
- onClick: q,
1834
+ leftSection: /* @__PURE__ */ e(ze, { size: 16 }),
1835
+ onClick: ke,
1836
1836
  variant: "default",
1837
- children: x().t("Close")
1837
+ children: g().t("Close")
1838
1838
  }
1839
1839
  ) });
1840
1840
  return /* @__PURE__ */ e(
1841
- Ge,
1841
+ He,
1842
1842
  {
1843
1843
  resourceName: d,
1844
- resourceDescription: k,
1845
- requiredPermissions: $,
1844
+ resourceDescription: P,
1845
+ requiredPermissions: M,
1846
1846
  fallbackComponent: we,
1847
- onSecurityReady: de?.onSecurityReady,
1848
- onAccessDenied: de?.onAccessDenied,
1849
- children: /* @__PURE__ */ e(At, { children: /* @__PURE__ */ c(
1850
- Le,
1847
+ onSecurityReady: he?.onSecurityReady,
1848
+ onAccessDenied: he?.onAccessDenied,
1849
+ children: /* @__PURE__ */ e(Et, { children: /* @__PURE__ */ c(
1850
+ _e,
1851
1851
  {
1852
- ref: Z,
1853
- withBorder: F,
1854
- radius: h,
1852
+ ref: ee,
1853
+ withBorder: w,
1854
+ radius: u,
1855
1855
  style: {
1856
- width: N,
1856
+ width: b,
1857
1857
  height: V,
1858
1858
  display: "flex",
1859
1859
  flexDirection: "column",
@@ -1861,81 +1861,81 @@ function $n({
1861
1861
  },
1862
1862
  children: [
1863
1863
  /* @__PURE__ */ e(
1864
- he,
1864
+ pe,
1865
1865
  {
1866
1866
  style: {
1867
1867
  flexShrink: 0,
1868
1868
  padding: "16px 24px",
1869
1869
  borderBottom: "1px solid var(--mantine-color-gray-2)"
1870
1870
  },
1871
- children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
1871
+ children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
1872
1872
  /* @__PURE__ */ c(oe, { gap: "md", children: [
1873
1873
  o && /* @__PURE__ */ e(
1874
- pt,
1874
+ vt,
1875
1875
  {
1876
1876
  variant: "subtle",
1877
1877
  color: "gray",
1878
1878
  size: "lg",
1879
1879
  onClick: o,
1880
1880
  style: { border: "1px solid var(--mantine-color-gray-3)" },
1881
- children: /* @__PURE__ */ e(Bt, { size: 18 })
1881
+ children: /* @__PURE__ */ e(Vt, { size: 18 })
1882
1882
  }
1883
1883
  ),
1884
- /* @__PURE__ */ c(he, { children: [
1885
- /* @__PURE__ */ e(Tt, { order: 4, fw: 600, children: t }),
1886
- n && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", children: n })
1884
+ /* @__PURE__ */ c(pe, { children: [
1885
+ /* @__PURE__ */ e(Bt, { order: 4, fw: 600, children: t }),
1886
+ n && /* @__PURE__ */ e(Re, { size: "sm", c: "dimmed", children: n })
1887
1887
  ] })
1888
1888
  ] }),
1889
1889
  /* @__PURE__ */ c(oe, { gap: "sm", children: [
1890
- f?.map((b) => /* @__PURE__ */ e(
1891
- We,
1890
+ f?.map((y) => /* @__PURE__ */ e(
1891
+ Oe,
1892
1892
  {
1893
- variant: b.variant || "subtle",
1894
- color: b.color,
1895
- leftSection: b.icon,
1896
- onClick: b.onClick,
1897
- disabled: b.disabled,
1898
- loading: b.loading,
1899
- children: b.label
1893
+ variant: y.variant || "subtle",
1894
+ color: y.color,
1895
+ leftSection: y.icon,
1896
+ onClick: y.onClick,
1897
+ disabled: y.disabled,
1898
+ loading: y.loading,
1899
+ children: y.label
1900
1900
  },
1901
- b.id
1901
+ y.id
1902
1902
  )),
1903
1903
  r && i && /* @__PURE__ */ e(
1904
- pt,
1904
+ vt,
1905
1905
  {
1906
1906
  variant: "subtle",
1907
1907
  color: "red",
1908
1908
  size: "lg",
1909
1909
  onClick: i,
1910
1910
  style: { border: "1px solid var(--mantine-color-gray-3)" },
1911
- children: /* @__PURE__ */ e(tt, { size: 18 })
1911
+ children: /* @__PURE__ */ e(rt, { size: 18 })
1912
1912
  }
1913
1913
  ),
1914
- Ve && qe()
1914
+ ge && re()
1915
1915
  ] })
1916
1916
  ] })
1917
1917
  }
1918
1918
  ),
1919
- xe && /* @__PURE__ */ e(he, { style: { flexShrink: 0, padding: "0 24px" }, children: /* @__PURE__ */ e(
1920
- Ke,
1919
+ Fe && /* @__PURE__ */ e(pe, { style: { flexShrink: 0, padding: "0 24px" }, children: /* @__PURE__ */ e(
1920
+ Qe,
1921
1921
  {
1922
- autoClose: ee,
1922
+ autoClose: ie,
1923
1923
  withCloseButton: !0,
1924
1924
  withBorder: !0,
1925
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
1926
- title: x().t("WARNING"),
1925
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
1926
+ title: g().t("WARNING"),
1927
1927
  titleColor: "rgb(250, 82, 82)",
1928
- variant: te ?? me.variant,
1929
- onClose: ge,
1930
- children: /* @__PURE__ */ e("span", { children: Ie })
1928
+ variant: te ?? fe.variant,
1929
+ onClose: me,
1930
+ children: /* @__PURE__ */ e("span", { children: Pe })
1931
1931
  }
1932
1932
  ) }),
1933
- /* @__PURE__ */ c(he, { style: { flex: 1, minHeight: 0, padding: "24px" }, children: [
1934
- /* @__PURE__ */ e(vt, { visible: ae || W || G, opacity: 0.3 }),
1935
- /* @__PURE__ */ c(be, { gutter: "xl", style: { height: "100%" }, children: [
1936
- !l && /* @__PURE__ */ e(be.Col, { span: { base: 12, md: P }, children: /* @__PURE__ */ e(Xe, { style: { height: "100%" }, children: /* @__PURE__ */ e(yt, { gap: "md", children: C }) }) }),
1937
- /* @__PURE__ */ e(be.Col, { span: { base: 12, md: ve }, children: /* @__PURE__ */ c(
1938
- Le,
1933
+ /* @__PURE__ */ c(pe, { style: { flex: 1, minHeight: 0, padding: "24px" }, children: [
1934
+ /* @__PURE__ */ e(yt, { visible: ae || Q || L, opacity: 0.3 }),
1935
+ /* @__PURE__ */ c(Ee, { gap: "xl", style: { height: "100%" }, children: [
1936
+ !l && /* @__PURE__ */ e(Ee.Col, { span: { base: 12, md: $ }, children: /* @__PURE__ */ e(Ze, { style: { height: "100%" }, children: /* @__PURE__ */ e(wt, { gap: "md", children: v }) }) }),
1937
+ /* @__PURE__ */ e(Ee.Col, { span: { base: 12, md: Be }, children: /* @__PURE__ */ c(
1938
+ _e,
1939
1939
  {
1940
1940
  withBorder: !0,
1941
1941
  radius: "md",
@@ -1947,58 +1947,58 @@ function $n({
1947
1947
  },
1948
1948
  children: [
1949
1949
  (s || I) && /* @__PURE__ */ e(
1950
- he,
1950
+ pe,
1951
1951
  {
1952
1952
  style: {
1953
1953
  flexShrink: 0,
1954
1954
  padding: "16px 20px",
1955
- borderBottom: w ? "1px solid var(--mantine-color-gray-2)" : "none"
1955
+ borderBottom: C ? "1px solid var(--mantine-color-gray-2)" : "none"
1956
1956
  },
1957
- children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "flex-start", children: [
1958
- /* @__PURE__ */ c(he, { children: [
1959
- s && /* @__PURE__ */ e(ye, { fw: 600, size: "lg", children: s }),
1960
- L && /* @__PURE__ */ e(ye, { size: "sm", c: "dimmed", mt: 4, children: L })
1957
+ children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "flex-start", children: [
1958
+ /* @__PURE__ */ c(pe, { children: [
1959
+ s && /* @__PURE__ */ e(Re, { fw: 600, size: "lg", children: s }),
1960
+ H && /* @__PURE__ */ e(Re, { size: "sm", c: "dimmed", mt: 4, children: H })
1961
1961
  ] }),
1962
1962
  I
1963
1963
  ] })
1964
1964
  }
1965
1965
  ),
1966
- /* @__PURE__ */ e(he, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: w && w.length > 0 ? /* @__PURE__ */ c(
1967
- rt,
1966
+ /* @__PURE__ */ e(pe, { style: { flex: 1, minHeight: 0, display: "flex", flexDirection: "column" }, children: C && C.length > 0 ? /* @__PURE__ */ c(
1967
+ at,
1968
1968
  {
1969
- value: ce,
1970
- onChange: Ne,
1969
+ value: G,
1970
+ onChange: de,
1971
1971
  variant: m,
1972
1972
  style: { flex: 1, display: "flex", flexDirection: "column" },
1973
1973
  children: [
1974
- /* @__PURE__ */ e(rt.List, { style: { flexShrink: 0, padding: "0 20px" }, children: w.map((b) => /* @__PURE__ */ e(
1975
- rt.Tab,
1974
+ /* @__PURE__ */ e(at.List, { style: { flexShrink: 0, padding: "0 20px" }, children: C.map((y) => /* @__PURE__ */ e(
1975
+ at.Tab,
1976
1976
  {
1977
- value: b.value,
1978
- leftSection: b.icon,
1979
- children: b.label
1977
+ value: y.value,
1978
+ leftSection: y.icon,
1979
+ children: y.label
1980
1980
  },
1981
- b.value
1981
+ y.value
1982
1982
  )) }),
1983
- w.map((b) => /* @__PURE__ */ e(
1984
- rt.Panel,
1983
+ C.map((y) => /* @__PURE__ */ e(
1984
+ at.Panel,
1985
1985
  {
1986
- value: b.value,
1986
+ value: y.value,
1987
1987
  style: { flex: 1, minHeight: 0 },
1988
- children: /* @__PURE__ */ e(Xe, { style: { height: "100%", padding: "20px" }, children: b.content })
1988
+ children: /* @__PURE__ */ e(Ze, { style: { height: "100%", padding: "20px" }, children: y.content })
1989
1989
  },
1990
- b.value
1990
+ y.value
1991
1991
  ))
1992
1992
  ]
1993
1993
  }
1994
- ) : /* @__PURE__ */ e(Xe, { style: { flex: 1, padding: "20px" }, children: D }) })
1994
+ ) : /* @__PURE__ */ e(Ze, { style: { flex: 1, padding: "20px" }, children: N }) })
1995
1995
  ]
1996
1996
  }
1997
1997
  ) })
1998
1998
  ] })
1999
1999
  ] }),
2000
- Ue && /* @__PURE__ */ e(
2001
- he,
2000
+ lt && /* @__PURE__ */ e(
2001
+ pe,
2002
2002
  {
2003
2003
  style: {
2004
2004
  flexShrink: 0,
@@ -2007,7 +2007,7 @@ function $n({
2007
2007
  display: "flex",
2008
2008
  justifyContent: "flex-end"
2009
2009
  },
2010
- children: qe()
2010
+ children: re()
2011
2011
  }
2012
2012
  )
2013
2013
  ]
@@ -2016,22 +2016,22 @@ function $n({
2016
2016
  }
2017
2017
  );
2018
2018
  }
2019
- function jn({ title: t, description: n, headerAction: o, children: f }) {
2020
- return /* @__PURE__ */ c(Le, { withBorder: !0, radius: "md", p: "md", children: [
2021
- /* @__PURE__ */ c(pe, { justify: "space-between", align: "flex-start", mb: n || o ? "sm" : 0, children: [
2022
- /* @__PURE__ */ c(he, { children: [
2023
- /* @__PURE__ */ e(ye, { fw: 600, size: "sm", children: t }),
2024
- n && /* @__PURE__ */ e(ye, { size: "xs", c: "dimmed", mt: 2, children: n })
2019
+ function Jn({ title: t, description: n, headerAction: o, children: f }) {
2020
+ return /* @__PURE__ */ c(_e, { withBorder: !0, radius: "md", p: "md", children: [
2021
+ /* @__PURE__ */ c(Ce, { justify: "space-between", align: "flex-start", mb: n || o ? "sm" : 0, children: [
2022
+ /* @__PURE__ */ c(pe, { children: [
2023
+ /* @__PURE__ */ e(Re, { fw: 600, size: "sm", children: t }),
2024
+ n && /* @__PURE__ */ e(Re, { size: "xs", c: "dimmed", mt: 2, children: n })
2025
2025
  ] }),
2026
2026
  o
2027
2027
  ] }),
2028
2028
  f
2029
2029
  ] });
2030
2030
  }
2031
- function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImages: r = 6 }) {
2032
- const i = t.find((a) => a.isCover) || t[0], u = t.filter((a) => a.id !== i?.id), v = t.length < r;
2033
- return /* @__PURE__ */ c(yt, { gap: "sm", children: [
2034
- i && /* @__PURE__ */ c(he, { style: { position: "relative" }, children: [
2031
+ function Wn({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImages: r = 6 }) {
2032
+ const i = t.find((a) => a.isCover) || t[0], h = t.filter((a) => a.id !== i?.id), p = t.length < r;
2033
+ return /* @__PURE__ */ c(wt, { gap: "sm", children: [
2034
+ i && /* @__PURE__ */ c(pe, { style: { position: "relative" }, children: [
2035
2035
  /* @__PURE__ */ e(
2036
2036
  "img",
2037
2037
  {
@@ -2047,7 +2047,7 @@ function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
2047
2047
  }
2048
2048
  ),
2049
2049
  /* @__PURE__ */ e(
2050
- Ut,
2050
+ Kt,
2051
2051
  {
2052
2052
  style: { position: "absolute", bottom: 8, left: 8 },
2053
2053
  variant: "filled",
@@ -2056,9 +2056,9 @@ function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
2056
2056
  }
2057
2057
  )
2058
2058
  ] }),
2059
- /* @__PURE__ */ c(be, { gutter: "sm", children: [
2060
- u.map((a) => /* @__PURE__ */ e(be.Col, { span: 4, children: /* @__PURE__ */ e(
2061
- he,
2059
+ /* @__PURE__ */ c(Ee, { gap: "sm", children: [
2060
+ h.map((a) => /* @__PURE__ */ e(Ee.Col, { span: 4, children: /* @__PURE__ */ e(
2061
+ pe,
2062
2062
  {
2063
2063
  style: { position: "relative", cursor: f ? "pointer" : "default" },
2064
2064
  onClick: () => f?.(a.id),
@@ -2078,8 +2078,8 @@ function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
2078
2078
  )
2079
2079
  }
2080
2080
  ) }, a.id)),
2081
- v && n && /* @__PURE__ */ e(be.Col, { span: 4, children: /* @__PURE__ */ e(
2082
- he,
2081
+ p && n && /* @__PURE__ */ e(Ee.Col, { span: 4, children: /* @__PURE__ */ e(
2082
+ pe,
2083
2083
  {
2084
2084
  onClick: n,
2085
2085
  style: {
@@ -2093,345 +2093,373 @@ function Ln({ images: t, onAddImage: n, onRemoveImage: o, onSetCover: f, maxImag
2093
2093
  cursor: "pointer",
2094
2094
  backgroundColor: "var(--mantine-color-gray-0)"
2095
2095
  },
2096
- children: /* @__PURE__ */ e(ye, { size: "xl", c: "dimmed", children: "+" })
2096
+ children: /* @__PURE__ */ e(Re, { size: "xl", c: "dimmed", children: "+" })
2097
2097
  }
2098
2098
  ) })
2099
2099
  ] })
2100
2100
  ] });
2101
2101
  }
2102
- function mn(t, n) {
2102
+ function bn(t, n) {
2103
2103
  const {
2104
2104
  // Props obrigatórias
2105
2105
  opened: o,
2106
2106
  title: f,
2107
2107
  children: r,
2108
2108
  onClose: i,
2109
- idField: u,
2110
- displayField: v,
2109
+ idField: h,
2110
+ displayField: p,
2111
2111
  // Seleção
2112
2112
  selectionMode: a = "single",
2113
- onSelect: C,
2114
- onSelectMultiple: P,
2113
+ onSelect: v,
2114
+ onSelectMultiple: $,
2115
2115
  initialSelectedItems: l,
2116
2116
  selectOnDoubleClick: s = !0,
2117
- onBeforeConfirm: L,
2117
+ onBeforeConfirm: H,
2118
2118
  onAfterConfirm: I,
2119
2119
  // DataSource
2120
- dataSource: w,
2121
- loadData: R,
2122
- searchFields: m = "",
2123
- pageSize: D = 100,
2120
+ dataSource: C,
2121
+ loadData: A,
2122
+ loadDataPaged: m,
2123
+ searchFields: N = "",
2124
+ pageSize: b = 100,
2124
2125
  // Aparência
2125
- displaySubField: N,
2126
- renderSelectedItem: V,
2127
- renderSelectedItems: F,
2128
- icon: h,
2129
- modalSize: X = "70%",
2130
- modalHeight: Z = "600px",
2131
- gridHeight: ae = 400,
2132
- rowHeight: W,
2133
- selectionIndicatorColor: G = "blue.0",
2134
- showSelectionIndicator: M = !0,
2126
+ displaySubField: V,
2127
+ renderSelectedItem: w,
2128
+ renderSelectedItems: u,
2129
+ icon: X,
2130
+ modalSize: ee = "70%",
2131
+ modalHeight: ae = "600px",
2132
+ gridHeight: Q = 400,
2133
+ rowHeight: L,
2134
+ selectionIndicatorColor: _ = "blue.0",
2135
+ showSelectionIndicator: R = !0,
2135
2136
  // Múltipla seleção
2136
- maxSelections: y,
2137
- showSelectionCount: U = !0,
2138
- allowClearAll: ee = !0,
2137
+ maxSelections: T,
2138
+ showSelectionCount: ie = !0,
2139
+ allowClearAll: E = !0,
2139
2140
  // Estado
2140
- isLoading: E,
2141
- isError: te = !1,
2142
- error: se = "",
2143
- clearError: ne,
2144
- autoCloseAlertError: H = 15e3,
2145
- onError: z,
2141
+ isLoading: te,
2142
+ isError: ue = !1,
2143
+ error: ne = "",
2144
+ clearError: q,
2145
+ autoCloseAlertError: j = 15e3,
2146
+ onError: J,
2146
2147
  // Customização
2147
- userActions: Y,
2148
- labels: O,
2149
- variant: _,
2148
+ userActions: W,
2149
+ labels: Y,
2150
+ variant: ce,
2150
2151
  // Segurança
2151
- resourceName: ue,
2152
- resourceDescription: Ce,
2153
- requiredPermissions: le,
2154
- fallbackComponent: d,
2155
- securityOptions: k
2156
- } = t, $ = ze(), we = at(), { colorScheme: de } = lt(), B = de === "dark", me = ot(), xe = B ? "dark.5" : G, [Fe, Ie] = Q(!1), [A, ce] = Q(l || []), [Ne, De] = Q(!1), [re, S] = Q(""), $e = Ae(null), Te = Ae([]), g = !!w, q = ie(() => g && w ? w : ($e.current || ($e.current = new Qt("dsLookup", {
2152
+ resourceName: be,
2153
+ resourceDescription: le,
2154
+ requiredPermissions: d,
2155
+ fallbackComponent: P,
2156
+ securityOptions: M
2157
+ } = t, we = Me(), he = ut(), { colorScheme: z } = st(), fe = z === "dark", Fe = dt(), Ae = fe ? "dark.5" : _, [Pe, se] = U(!1), [G, de] = U(l || []), [Ge, O] = U(!1), [D, $e] = U(""), [Le, x] = U(0), [k, ke] = U(""), me = Se(null), Be = Se([]), De = !!m && !C, ge = !!C, re = Z(() => ge && C ? C : (me.current || (me.current = new rn("dsLookup", {
2157
2158
  records: [],
2158
2159
  grandTotalRecords: 0,
2159
2160
  currentPage: 0,
2160
2161
  totalPages: 0,
2161
- pageSize: D
2162
- })), $e.current), [g, w, D])();
2163
- Pe({
2164
- autoRegisterActions: k?.autoRegisterActions ?? !0
2162
+ pageSize: b
2163
+ })), me.current), [ge, C, b])();
2164
+ Ue({
2165
+ autoRegisterActions: M?.autoRegisterActions ?? !0
2165
2166
  });
2166
- const ge = _e(
2167
+ const y = We(
2167
2168
  "ArchbaseLookupDataTemplate",
2168
- q,
2169
+ re,
2169
2170
  void 0,
2170
2171
  void 0
2171
2172
  );
2172
- nt({
2173
- dataSource: q,
2174
- listener: (p) => {
2175
- if (p.type === Re.onError && (De(!0), S(p.error || "")), p.type === Re.afterScroll) {
2173
+ it({
2174
+ dataSource: re,
2175
+ listener: (F) => {
2176
+ if (F.type === Ie.onError && (O(!0), $e(F.error || "")), F.type === Ie.afterScroll) {
2176
2177
  if (a === "single") {
2177
- const K = q.getCurrentRecord();
2178
- K && ce([K]);
2178
+ const B = re.getCurrentRecord();
2179
+ B && de([B]);
2179
2180
  }
2180
- ge.isDataSourceV2 || me();
2181
+ y.isDataSourceV2 || Fe();
2181
2182
  }
2182
2183
  }
2183
2184
  });
2184
- const ve = {
2185
- okButton: x().t("archbase:Ok"),
2186
- cancelButton: x().t("archbase:Cancel"),
2187
- clearButton: x().t("archbase:Clear"),
2188
- selectedLabel: x().t("archbase:Selected"),
2189
- doubleClickHint: x().t("archbase:Double click to select"),
2190
- noItemSelected: x().t("archbase:No item selected"),
2191
- itemsSelected: x().t("archbase:items selected"),
2192
- ...O
2193
- };
2194
- et(() => {
2195
- if (g)
2196
- return;
2197
- const p = (K) => {
2198
- const Je = Te.current;
2199
- if (Je.length === 0)
2200
- return;
2201
- const Lt = K?.currentPage ?? 0, Dt = K?.pageSize ?? D;
2202
- q.open({
2203
- records: Je,
2204
- grandTotalRecords: Je.length,
2205
- currentPage: Lt,
2206
- totalPages: Math.ceil(Je.length / Dt),
2207
- pageSize: Dt
2208
- });
2209
- };
2210
- return q.emitter.on("refreshData", p), () => {
2211
- q.emitter.off("refreshData", p);
2212
- };
2213
- }, [g, q, D]);
2214
- const ke = ie(
2215
- async (p) => {
2216
- if (!(g || !R)) {
2217
- Ie(!0);
2185
+ const ye = {
2186
+ okButton: g().t("archbase:Ok"),
2187
+ cancelButton: g().t("archbase:Cancel"),
2188
+ clearButton: g().t("archbase:Clear"),
2189
+ selectedLabel: g().t("archbase:Selected"),
2190
+ doubleClickHint: g().t("archbase:Double click to select"),
2191
+ noItemSelected: g().t("archbase:No item selected"),
2192
+ itemsSelected: g().t("archbase:items selected"),
2193
+ ...Y
2194
+ }, Ne = Z(
2195
+ async (F, B) => {
2196
+ if (!(ge || !m)) {
2197
+ se(!0);
2198
+ try {
2199
+ const Ve = await m(F, b, B, N);
2200
+ re.open({
2201
+ records: Ve.content,
2202
+ grandTotalRecords: Ve.totalElements,
2203
+ currentPage: F,
2204
+ totalPages: Ve.totalPages,
2205
+ pageSize: b
2206
+ }), x(F);
2207
+ } catch (Ve) {
2208
+ O(!0), $e(xe(Ve)), J?.(Ve);
2209
+ } finally {
2210
+ se(!1);
2211
+ }
2212
+ }
2213
+ },
2214
+ [ge, m, N, b, re, J]
2215
+ ), je = Z(
2216
+ async (F) => {
2217
+ if (De)
2218
+ return Ne(0, F);
2219
+ if (!(ge || !A)) {
2220
+ se(!0);
2218
2221
  try {
2219
- const K = await R(p, m);
2220
- Te.current = K, q.open({
2221
- records: K,
2222
- grandTotalRecords: K.length,
2222
+ const B = await A(F, N);
2223
+ Be.current = B, re.open({
2224
+ records: B,
2225
+ grandTotalRecords: B.length,
2223
2226
  currentPage: 0,
2224
- totalPages: Math.ceil(K.length / D),
2225
- pageSize: D
2227
+ totalPages: Math.ceil(B.length / b),
2228
+ pageSize: b
2226
2229
  });
2227
- } catch (K) {
2228
- De(!0), S(fe(K)), z?.(K);
2230
+ } catch (B) {
2231
+ O(!0), $e(xe(B)), J?.(B);
2229
2232
  } finally {
2230
- Ie(!1);
2233
+ se(!1);
2231
2234
  }
2232
2235
  }
2233
2236
  },
2234
- [g, R, m, D, q, z]
2235
- ), Ve = ie(
2236
- (p) => {
2237
- const K = p?.quickFilterValues?.[0] || "";
2238
- R && !g && ke(K);
2237
+ [ge, De, A, Ne, N, b, re, J]
2238
+ ), gt = Z(
2239
+ (F) => {
2240
+ const B = F?.quickFilterValues?.[0] || "";
2241
+ if (ke(B), De) {
2242
+ Ne(0, B);
2243
+ return;
2244
+ }
2245
+ A && !ge && je(B);
2239
2246
  },
2240
- [R, g, ke]
2247
+ [A, De, ge, je, Ne]
2241
2248
  );
2242
- et(() => {
2243
- o && (l?.length ? ce(l) : ce([]), ke());
2244
- }, [o]), et(() => {
2245
- l && ce(l);
2249
+ nt(() => {
2250
+ if (ge)
2251
+ return;
2252
+ const F = (B) => {
2253
+ const Ve = B?.currentPage ?? 0, kt = B?.pageSize ?? b;
2254
+ if (De) {
2255
+ Ne(Ve, k);
2256
+ return;
2257
+ }
2258
+ const ot = Be.current;
2259
+ ot.length !== 0 && re.open({
2260
+ records: ot,
2261
+ grandTotalRecords: ot.length,
2262
+ currentPage: Ve,
2263
+ totalPages: Math.ceil(ot.length / kt),
2264
+ pageSize: kt
2265
+ });
2266
+ };
2267
+ return re.emitter.on("refreshData", F), () => {
2268
+ re.emitter.off("refreshData", F);
2269
+ };
2270
+ }, [ge, De, re, b, k, Ne]), nt(() => {
2271
+ o && (l?.length ? de(l) : de([]), je());
2272
+ }, [o]), nt(() => {
2273
+ l && de(l);
2246
2274
  }, [l]);
2247
- const Ue = ie(
2248
- (p) => {
2249
- a === "single" ? ce(p.slice(0, 1)) : y && p.length > y ? ce(p.slice(0, y)) : ce(p);
2275
+ const Xe = Z(
2276
+ (F) => {
2277
+ a === "single" ? de(F.slice(0, 1)) : T && F.length > T ? de(F.slice(0, T)) : de(F);
2250
2278
  },
2251
- [a, y]
2252
- ), qe = ie(
2253
- (p) => {
2279
+ [a, T]
2280
+ ), pt = Z(
2281
+ (F) => {
2254
2282
  if (a === "single" && s) {
2255
- const K = q.getCurrentRecord();
2256
- K && (C?.(K), i());
2283
+ const B = re.getCurrentRecord();
2284
+ B && (v?.(B), i());
2257
2285
  }
2258
2286
  },
2259
- [a, s, q, C, i]
2260
- ), b = ie(() => {
2261
- ce([]);
2262
- }, []), Ee = ie(async () => {
2263
- L && !await L(A) || (a === "single" ? A.length > 0 && C?.(A[0]) : P?.(A), I?.(A), i());
2264
- }, [A, a, C, P, L, I, i]), je = ie(() => {
2287
+ [a, s, re, v, i]
2288
+ ), xt = Z(() => {
2289
+ de([]);
2290
+ }, []), Ye = Z(async () => {
2291
+ H && !await H(G) || (a === "single" ? G.length > 0 && v?.(G[0]) : $?.(G), I?.(G), i());
2292
+ }, [G, a, v, $, H, I, i]), S = Z(() => {
2265
2293
  i();
2266
- }, [i]), Qe = () => {
2267
- Rt.showWarning(x().t("archbase:Click on Ok or Cancel to close"));
2268
- }, ht = () => {
2269
- ne?.(), De(!1), S("");
2294
+ }, [i]), Te = () => {
2295
+ St.showWarning(g().t("archbase:Click on Ok or Cancel to close"));
2296
+ }, ve = () => {
2297
+ q?.(), O(!1), $e("");
2270
2298
  };
2271
- zt(
2299
+ Gt(
2272
2300
  n,
2273
2301
  () => ({
2274
- getSelectedItems: () => A,
2275
- getSelectedItem: () => A[0] || null,
2276
- clearSelection: () => ce([]),
2277
- selectItems: (p) => Ue(p),
2278
- selectItem: (p) => ce([p]),
2279
- deselectItem: (p) => {
2280
- ce((K) => K.filter((Je) => Je[u] !== p[u]));
2302
+ getSelectedItems: () => G,
2303
+ getSelectedItem: () => G[0] || null,
2304
+ clearSelection: () => de([]),
2305
+ selectItems: (F) => Xe(F),
2306
+ selectItem: (F) => de([F]),
2307
+ deselectItem: (F) => {
2308
+ de((B) => B.filter((Ve) => Ve[h] !== F[h]));
2281
2309
  },
2282
- refreshData: () => ke(),
2283
- getDataSource: () => q,
2310
+ refreshData: () => je(),
2311
+ getDataSource: () => re,
2284
2312
  confirmSelection: async () => {
2285
- await Ee();
2313
+ await Ye();
2286
2314
  },
2287
- cancelSelection: je
2315
+ cancelSelection: S
2288
2316
  }),
2289
- [A, Ue, u, ke, q, Ee, je]
2317
+ [G, Xe, h, je, re, Ye, S]
2290
2318
  );
2291
- const ut = ie(
2292
- (p) => {
2293
- const K = p[u];
2294
- return K !== void 0 ? K : "";
2319
+ const Ut = Z(
2320
+ (F) => {
2321
+ const B = F[h];
2322
+ return B !== void 0 ? B : "";
2295
2323
  },
2296
- [u]
2297
- ), ft = E || Fe, mt = se || re, gt = te || Ne, T = /* @__PURE__ */ c(oe, { gap: "sm", children: [
2298
- h,
2299
- /* @__PURE__ */ e(ye, { fw: 600, children: f })
2300
- ] }), Se = () => {
2301
- if (!M)
2324
+ [h]
2325
+ ), Ht = te || Pe, _t = ne || D, qt = ue || Ge, Jt = /* @__PURE__ */ c(oe, { gap: "sm", children: [
2326
+ X,
2327
+ /* @__PURE__ */ e(Re, { fw: 600, children: f })
2328
+ ] }), Wt = () => {
2329
+ if (!R)
2302
2330
  return null;
2303
- if (a === "single" && A.length > 0 && V)
2304
- return V(A[0]);
2305
- if (a === "multiple" && A.length > 0 && F)
2306
- return F(A);
2307
- if (a === "single" && A.length > 0) {
2308
- const p = A[0];
2309
- return /* @__PURE__ */ e(Le, { withBorder: !0, p: "sm", radius: "md", bg: xe, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
2331
+ if (a === "single" && G.length > 0 && w)
2332
+ return w(G[0]);
2333
+ if (a === "multiple" && G.length > 0 && u)
2334
+ return u(G);
2335
+ if (a === "single" && G.length > 0) {
2336
+ const F = G[0];
2337
+ return /* @__PURE__ */ e(_e, { withBorder: !0, p: "sm", radius: "md", bg: Ae, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
2310
2338
  /* @__PURE__ */ c(oe, { gap: "xs", children: [
2311
- /* @__PURE__ */ e(Ye, { size: 16, color: "green" }),
2312
- /* @__PURE__ */ c(ye, { size: "sm", fw: 500, children: [
2313
- ve.selectedLabel,
2339
+ /* @__PURE__ */ e(et, { size: 16, color: "green" }),
2340
+ /* @__PURE__ */ c(Re, { size: "sm", fw: 500, children: [
2341
+ ye.selectedLabel,
2314
2342
  ":"
2315
2343
  ] }),
2316
- /* @__PURE__ */ e(ye, { size: "sm", fw: 600, children: String(p[v]) }),
2317
- N && /* @__PURE__ */ e(ye, { size: "sm", c: B ? "gray.4" : "dimmed", children: String(p[N] || "") })
2344
+ /* @__PURE__ */ e(Re, { size: "sm", fw: 600, children: String(F[p]) }),
2345
+ V && /* @__PURE__ */ e(Re, { size: "sm", c: fe ? "gray.4" : "dimmed", children: String(F[V] || "") })
2318
2346
  ] }),
2319
- /* @__PURE__ */ e(ye, { size: "xs", c: B ? "gray.4" : "dimmed", children: ve.doubleClickHint })
2347
+ /* @__PURE__ */ e(Re, { size: "xs", c: fe ? "gray.4" : "dimmed", children: ye.doubleClickHint })
2320
2348
  ] }) });
2321
2349
  }
2322
- return a === "multiple" && A.length > 0 ? /* @__PURE__ */ e(Le, { withBorder: !0, p: "sm", radius: "md", bg: xe, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
2350
+ return a === "multiple" && G.length > 0 ? /* @__PURE__ */ e(_e, { withBorder: !0, p: "sm", radius: "md", bg: Ae, children: /* @__PURE__ */ c(oe, { justify: "space-between", children: [
2323
2351
  /* @__PURE__ */ c(oe, { gap: "xs", children: [
2324
- /* @__PURE__ */ e(Ye, { size: 16, color: "green" }),
2325
- /* @__PURE__ */ c(ye, { size: "sm", fw: 500, children: [
2326
- A.length,
2352
+ /* @__PURE__ */ e(et, { size: 16, color: "green" }),
2353
+ /* @__PURE__ */ c(Re, { size: "sm", fw: 500, children: [
2354
+ G.length,
2327
2355
  " ",
2328
- ve.itemsSelected
2356
+ ye.itemsSelected
2329
2357
  ] })
2330
2358
  ] }),
2331
- ee && /* @__PURE__ */ e(
2332
- We,
2359
+ E && /* @__PURE__ */ e(
2360
+ Oe,
2333
2361
  {
2334
2362
  size: "xs",
2335
2363
  variant: "subtle",
2336
2364
  color: "red",
2337
- leftSection: /* @__PURE__ */ e(tt, { size: 14 }),
2338
- onClick: b,
2339
- children: ve.clearButton
2365
+ leftSection: /* @__PURE__ */ e(rt, { size: 14 }),
2366
+ onClick: xt,
2367
+ children: ye.clearButton
2340
2368
  }
2341
2369
  )
2342
2370
  ] }) }) : null;
2343
2371
  };
2344
2372
  return /* @__PURE__ */ e(
2345
- Ge,
2373
+ He,
2346
2374
  {
2347
- resourceName: ue,
2348
- resourceDescription: Ce,
2349
- requiredPermissions: le,
2350
- fallbackComponent: d,
2351
- onSecurityReady: k?.onSecurityReady,
2352
- onAccessDenied: k?.onAccessDenied,
2375
+ resourceName: be,
2376
+ resourceDescription: le,
2377
+ requiredPermissions: d,
2378
+ fallbackComponent: P,
2379
+ onSecurityReady: M?.onSecurityReady,
2380
+ onAccessDenied: M?.onAccessDenied,
2353
2381
  children: /* @__PURE__ */ e(
2354
- Ct,
2382
+ bt,
2355
2383
  {
2356
- title: T,
2384
+ title: Jt,
2357
2385
  opened: o,
2358
- onClose: Qe,
2359
- size: X,
2386
+ onClose: Te,
2387
+ size: ee,
2360
2388
  centered: !0,
2361
2389
  closeOnEscape: !1,
2362
2390
  closeOnClickOutside: !1,
2363
2391
  withCloseButton: !1,
2364
2392
  overlayProps: {
2365
- color: de === "dark" ? we.colors.dark[7] : we.colors.gray[6],
2393
+ color: z === "dark" ? he.colors.dark[7] : he.colors.gray[6],
2366
2394
  opacity: 0.25
2367
2395
  },
2368
- children: /* @__PURE__ */ c(ct, { height: Z, children: [
2369
- gt && /* @__PURE__ */ e(Et, { size: "100px", children: /* @__PURE__ */ e(
2370
- Ke,
2396
+ children: /* @__PURE__ */ c(ht, { height: ae, children: [
2397
+ qt && /* @__PURE__ */ e(It, { size: "100px", children: /* @__PURE__ */ e(
2398
+ Qe,
2371
2399
  {
2372
- autoClose: H,
2400
+ autoClose: j,
2373
2401
  withCloseButton: !0,
2374
2402
  withBorder: !0,
2375
- icon: /* @__PURE__ */ e(Oe, { size: "1.4rem" }),
2376
- title: x().t("archbase:WARNING"),
2403
+ icon: /* @__PURE__ */ e(Ke, { size: "1.4rem" }),
2404
+ title: g().t("archbase:WARNING"),
2377
2405
  titleColor: "rgb(250, 82, 82)",
2378
- variant: _ ?? $.variant,
2379
- onClose: ht,
2380
- children: /* @__PURE__ */ e("span", { children: mt })
2406
+ variant: ce ?? we.variant,
2407
+ onClose: ve,
2408
+ children: /* @__PURE__ */ e("span", { children: _t })
2381
2409
  }
2382
2410
  ) }),
2383
- /* @__PURE__ */ e(st, { children: /* @__PURE__ */ c(yt, { gap: "md", h: "100%", children: [
2384
- Y && /* @__PURE__ */ e(oe, { justify: "flex-end", children: Y }),
2411
+ /* @__PURE__ */ e(ft, { children: /* @__PURE__ */ c(wt, { gap: "md", h: "100%", children: [
2412
+ W && /* @__PURE__ */ e(oe, { justify: "flex-end", children: W }),
2385
2413
  /* @__PURE__ */ e(
2386
- Gt,
2414
+ Lt,
2387
2415
  {
2388
- dataSource: q,
2389
- height: ae,
2390
- rowHeight: W,
2416
+ dataSource: re,
2417
+ height: Q,
2418
+ rowHeight: L,
2391
2419
  withBorder: !0,
2392
2420
  striped: !0,
2393
2421
  highlightOnHover: !0,
2394
- isLoading: ft,
2422
+ isLoading: Ht,
2395
2423
  enableRowSelection: a === "multiple",
2396
2424
  enableRowNumbers: !0,
2397
2425
  enableColumnFilterModes: !0,
2398
2426
  enableTopToolbar: !0,
2399
2427
  enableGlobalFilter: !0,
2400
- getRowId: ut,
2401
- onCellDoubleClick: qe,
2402
- onSelectedRowsChanged: a === "multiple" ? Ue : void 0,
2403
- onFilterModelChange: Ve,
2428
+ getRowId: Ut,
2429
+ onCellDoubleClick: pt,
2430
+ onSelectedRowsChanged: a === "multiple" ? Xe : void 0,
2431
+ onFilterModelChange: gt,
2404
2432
  children: r
2405
2433
  }
2406
2434
  ),
2407
- Se()
2435
+ Wt()
2408
2436
  ] }) }),
2409
- /* @__PURE__ */ e(dt, { size: "50px", children: /* @__PURE__ */ c(pe, { justify: "space-between", align: "center", children: [
2437
+ /* @__PURE__ */ e(mt, { size: "50px", children: /* @__PURE__ */ c(Ce, { justify: "space-between", align: "center", children: [
2410
2438
  /* @__PURE__ */ e(oe, {}),
2411
2439
  /* @__PURE__ */ c(oe, { gap: "md", children: [
2412
2440
  /* @__PURE__ */ e(
2413
- J,
2441
+ K,
2414
2442
  {
2415
2443
  actionName: "confirm",
2416
2444
  actionDescription: "Confirmar seleção",
2417
- leftSection: /* @__PURE__ */ e(Ye, {}),
2418
- onClick: Ee,
2419
- disabled: A.length === 0,
2420
- variant: _ ?? $.variant,
2445
+ leftSection: /* @__PURE__ */ e(et, {}),
2446
+ onClick: Ye,
2447
+ disabled: G.length === 0,
2448
+ variant: ce ?? we.variant,
2421
2449
  color: "green",
2422
- children: ve.okButton
2450
+ children: ye.okButton
2423
2451
  }
2424
2452
  ),
2425
2453
  /* @__PURE__ */ e(
2426
- J,
2454
+ K,
2427
2455
  {
2428
2456
  actionName: "cancel",
2429
2457
  actionDescription: "Cancelar seleção",
2430
- leftSection: /* @__PURE__ */ e(Be, {}),
2431
- onClick: je,
2432
- variant: _ ?? $.variant,
2458
+ leftSection: /* @__PURE__ */ e(ze, {}),
2459
+ onClick: S,
2460
+ variant: ce ?? we.variant,
2433
2461
  color: "red",
2434
- children: ve.cancelButton
2462
+ children: ye.cancelButton
2435
2463
  }
2436
2464
  )
2437
2465
  ] })
@@ -2442,50 +2470,50 @@ function mn(t, n) {
2442
2470
  }
2443
2471
  );
2444
2472
  }
2445
- const Mn = Vt(mn), It = Kt(void 0);
2446
- function Un({ children: t }) {
2447
- const [n, o] = Q({}), f = ie((v, a) => {
2448
- o((C) => ({ ...C, [v]: a }));
2449
- }, []), r = ie((v) => {
2473
+ const On = zt(bn), Tt = nn(void 0);
2474
+ function Kn({ children: t }) {
2475
+ const [n, o] = U({}), f = Z((p, a) => {
2476
+ o((v) => ({ ...v, [p]: a }));
2477
+ }, []), r = Z((p) => {
2450
2478
  o((a) => {
2451
- const C = { ...a };
2452
- return delete C[v], C;
2479
+ const v = { ...a };
2480
+ return delete v[p], v;
2453
2481
  });
2454
- }, []), i = ie(() => {
2482
+ }, []), i = Z(() => {
2455
2483
  o({});
2456
- }, []), u = ie((v) => n[v], [n]);
2457
- return /* @__PURE__ */ e(It.Provider, { value: { errors: n, setError: f, clearError: r, clearAll: i, getError: u }, children: t });
2484
+ }, []), h = Z((p) => n[p], [n]);
2485
+ return /* @__PURE__ */ e(Tt.Provider, { value: { errors: n, setError: f, clearError: r, clearAll: i, getError: h }, children: t });
2458
2486
  }
2459
- function Hn() {
2460
- return Pt(It);
2487
+ function Qn() {
2488
+ return $t(Tt);
2461
2489
  }
2462
- function _n() {
2463
- const t = Pt(It);
2490
+ function Xn() {
2491
+ const t = $t(Tt);
2464
2492
  if (!t)
2465
2493
  throw new Error("useRequiredValidationErrors must be used within ValidationErrorsProvider");
2466
2494
  return t;
2467
2495
  }
2468
2496
  export {
2469
- Dn as ArchbaseAdvancedSmartButton,
2470
- Ge as ArchbaseConditionalSecurityWrapper,
2471
- Bn as ArchbaseFormModalTemplate,
2472
- kn as ArchbaseFormTemplate,
2473
- Vn as ArchbaseGridTemplate,
2474
- Mn as ArchbaseLookupDataTemplate,
2475
- zn as ArchbaseMasonryTemplate,
2476
- Nn as ArchbaseModalTemplate,
2477
- Pn as ArchbasePanelTemplate,
2478
- Gn as ArchbaseSearchTemplate,
2479
- J as ArchbaseSmartActionButton,
2480
- jt as ArchbaseSpaceTemplate,
2481
- $n as ArchbaseTwoColumnFormTemplate,
2482
- Ln as FormImageGallery,
2483
- jn as FormSectionCard,
2484
- Un as ValidationErrorsProvider,
2485
- In as useArchbaseLookup,
2486
- Tn as useConditionalSecurity,
2487
- Pe as useOptionalTemplateSecurity,
2488
- _n as useRequiredValidationErrors,
2489
- Sn as useTemplateSecurityAvailable,
2490
- Hn as useValidationErrors
2497
+ zn as ArchbaseAdvancedSmartButton,
2498
+ He as ArchbaseConditionalSecurityWrapper,
2499
+ Ln as ArchbaseFormModalTemplate,
2500
+ $n as ArchbaseFormTemplate,
2501
+ Mn as ArchbaseGridTemplate,
2502
+ On as ArchbaseLookupDataTemplate,
2503
+ Un as ArchbaseMasonryTemplate,
2504
+ jn as ArchbaseModalTemplate,
2505
+ Hn as ArchbasePanelTemplate,
2506
+ _n as ArchbaseSearchTemplate,
2507
+ K as ArchbaseSmartActionButton,
2508
+ Mt as ArchbaseSpaceTemplate,
2509
+ qn as ArchbaseTwoColumnFormTemplate,
2510
+ Wn as FormImageGallery,
2511
+ Jn as FormSectionCard,
2512
+ Kn as ValidationErrorsProvider,
2513
+ Pn as useArchbaseLookup,
2514
+ Gn as useConditionalSecurity,
2515
+ Ue as useOptionalTemplateSecurity,
2516
+ Xn as useRequiredValidationErrors,
2517
+ Vn as useTemplateSecurityAvailable,
2518
+ Qn as useValidationErrors
2491
2519
  };