@envisiongroup/porygon 1.0.0-rc.2 → 1.0.0-rc.3

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.
@@ -1,19 +1,19 @@
1
- import { jsx as v, jsxs as Ye } from "react/jsx-runtime";
2
- import * as xt from "react";
3
- import { useRef as B, useState as q, useCallback as R, useEffect as T, useMemo as F } from "react";
4
- import { useReactTable as wt, getSortedRowModel as yt, getFilteredRowModel as It, getCoreRowModel as zt } from "@tanstack/react-table";
5
- import { makeStyles as bt, tokens as K, mergeClasses as Et, Checkbox as $e, Card as Ct } from "@fluentui/react-components";
6
- import { useTableSelection as vt } from "./hooks/useTableSelection/useTableSelection.js";
7
- import { renderCellContent as Rt } from "./utils/index.js";
8
- import { useDefaultAddButton as Mt } from "./hooks/useDefaultAddButton/useDefaultAddButton.js";
9
- import { useDefaultUpdateButton as Nt } from "./hooks/useDefaultUpdateButton/useDefaultUpdateButton.js";
10
- import { useDefaultDeleteButton as Wt } from "./hooks/useDefaultDeleteButton/useDefaultDeleteButton.js";
1
+ import { jsx as C, jsxs as Ye } from "react/jsx-runtime";
2
+ import * as wt from "react";
3
+ import { useRef as B, useState as q, useCallback as v, useEffect as k, useMemo as F } from "react";
4
+ import { useReactTable as It, getSortedRowModel as xt, getFilteredRowModel as yt, getCoreRowModel as zt } from "@tanstack/react-table";
5
+ import { makeStyles as bt, tokens as K, mergeClasses as Et, Checkbox as $e, Card as _t } from "@fluentui/react-components";
6
+ import { useTableSelection as Ct } from "./hooks/useTableSelection/useTableSelection.js";
7
+ import { renderCellContent as vt } from "./utils/index.js";
8
+ import { useDefaultAddButton as Rt } from "./hooks/useDefaultAddButton/useDefaultAddButton.js";
9
+ import { useDefaultUpdateButton as Mt } from "./hooks/useDefaultUpdateButton/useDefaultUpdateButton.js";
10
+ import { useDefaultDeleteButton as Nt } from "./hooks/useDefaultDeleteButton/useDefaultDeleteButton.js";
11
11
  import { generateId as E } from "./utils/general.js";
12
- import { EFWTableCommandBar as kt } from "./components/EFWTableCommandBar/EFWTableCommandBar.js";
13
- import { EFWTableHeader as Tt } from "./components/EFWTableHeader/EFWTableHeader.js";
14
- import { EFWTableBody as _t } from "./components/EFWTableBody/EFWTableBody.js";
12
+ import { EFWTableCommandBar as Wt } from "./components/EFWTableCommandBar/EFWTableCommandBar.js";
13
+ import { EFWTableHeader as kt } from "./components/EFWTableHeader/EFWTableHeader.js";
14
+ import { EFWTableBody as Tt } from "./components/EFWTableBody/EFWTableBody.js";
15
15
  import { EFWTableEmpty as At } from "./components/EFWTableEmpty/EFWTableEmpty.js";
16
- const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80, J = 2500, O = 48, Qt = 48, Ft = bt({
16
+ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], w = 120, T = 80, J = 2500, O = 48, Qt = 48, Ft = bt({
17
17
  "efw-table": {},
18
18
  /* Transición suave para el box-shadow en las celdas y cabeceras fijas */
19
19
  "efw-table-scroll-container": {
@@ -67,7 +67,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
67
67
  height: ne = 700,
68
68
  itemSize: Ve = 32,
69
69
  // tableStyle = 'row',
70
- enableSelection: I = !0,
70
+ enableSelection: y = !0,
71
71
  enableCommandBar: V = !0,
72
72
  defaultSelectedItems: Ze = Bt,
73
73
  onSelectionChange: Qe,
@@ -75,37 +75,37 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
75
75
  resizableColumns: Q = !1,
76
76
  columnSizing: z = G,
77
77
  useVirtualization: Ue = !1,
78
- autoSizeColumns: M = !1,
78
+ autoSizeColumns: R = !1,
79
79
  tableRef: et,
80
80
  onItemsChange: se,
81
81
  onScroll: re,
82
82
  addButtonConfig: tt = G,
83
83
  updateButtonConfig: nt = G,
84
84
  deleteButtonConfig: st = G,
85
- alwaysButtons: ie = X,
85
+ alwaysButtons: ce = X,
86
86
  noSelectionButtons: rt = X,
87
- singleSelectionButtons: it = X,
88
- multiSelectionButtons: ce = X,
87
+ singleSelectionButtons: ct = X,
88
+ multiSelectionButtons: oe = X,
89
89
  beforeAddItems: L,
90
90
  beforeUpdateItems: D,
91
91
  beforeDeleteItems: H,
92
- columnRenderers: oe,
92
+ columnRenderers: ie,
93
93
  useDefaultRendererAsFallback: ae = !0
94
94
  }) => {
95
- const le = Ft(), ct = Et(Je, le["efw-table"]), N = B(!1), ue = te !== void 0, [ot, at] = q(() => (Ke || qe).map((t) => ({
95
+ const le = Ft(), ot = Et(Je, le["efw-table"]), M = B(!1), ue = te !== void 0, [it, at] = q(() => (Ke || qe).map((t) => ({
96
96
  ...t,
97
- id: t.id || E()
98
- }))), b = ue ? te || qe : ot, [S, j] = q(() => {
97
+ _rowId: t._rowId || E()
98
+ }))), b = ue ? te || qe : it, [S, j] = q(() => {
99
99
  const e = {};
100
100
  return f.forEach((t) => {
101
101
  const n = z[t.internalName];
102
102
  if (n?.width) {
103
- const s = n.minWidth ?? _, r = n.maxWidth ?? J;
103
+ const s = n.minWidth ?? T, r = n.maxWidth ?? J;
104
104
  e[t.internalName] = Math.min(Math.max(n.width ?? 0, s), r);
105
105
  }
106
106
  }), e;
107
- }), de = B(z), [C, fe] = q(0), {
108
- rowSelection: W,
107
+ }), de = B(z), [_, fe] = q(0), {
108
+ rowSelection: N,
109
109
  setRowSelection: he,
110
110
  // selectedIndexes,
111
111
  deselectAll: me,
@@ -114,32 +114,32 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
114
114
  // selectMultiple,
115
115
  getSelectedItems: ge,
116
116
  getSelectedRows: Se
117
- } = vt({
117
+ } = Ct({
118
118
  initialSelection: Ze,
119
119
  onSelectionChange: Qe,
120
- enableSelection: I
121
- }), xe = B(null), [P, ut] = q(null), dt = R((e) => {
122
- xe.current = e, ut(e);
120
+ enableSelection: y
121
+ }), we = B(null), [P, ut] = q(null), dt = v((e) => {
122
+ we.current = e, ut(e);
123
123
  }, []), p = B(b);
124
- T(() => {
124
+ k(() => {
125
125
  p.current = b;
126
126
  }, [b]);
127
- const U = B(/* @__PURE__ */ new Set()), we = F(() => {
127
+ const U = B(/* @__PURE__ */ new Set()), Ie = F(() => {
128
128
  const e = [], t = {};
129
129
  let n = 0;
130
- return I && (e.push("select"), t.select = n, n += O), f.forEach((s) => {
130
+ return y && (e.push("select"), t.select = n, n += O), f.forEach((s) => {
131
131
  const r = z[s.internalName] || {};
132
132
  if (!r.hidden && r.sticky) {
133
133
  e.push(s.internalName), t[s.internalName] = n;
134
- const i = S[s.internalName] || r.width || x;
135
- n += i;
134
+ const c = S[s.internalName] || r.width || w;
135
+ n += c;
136
136
  }
137
137
  }), { stickyColumns: e, stickyPositions: t };
138
- }, [f, I, z, S]), w = F(() => {
138
+ }, [f, y, z, S]), I = F(() => {
139
139
  const e = [];
140
- return I && e.push({
140
+ return y && e.push({
141
141
  id: "select",
142
- header: ({ table: t }) => /* @__PURE__ */ v(
142
+ header: ({ table: t }) => /* @__PURE__ */ C(
143
143
  $e,
144
144
  {
145
145
  shape: "circular",
@@ -148,7 +148,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
148
148
  "data-checkbox": "true"
149
149
  }
150
150
  ),
151
- cell: ({ row: t }) => /* @__PURE__ */ v(
151
+ cell: ({ row: t }) => /* @__PURE__ */ C(
152
152
  $e,
153
153
  {
154
154
  shape: "circular",
@@ -168,57 +168,57 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
168
168
  const n = z[t.internalName] || {};
169
169
  if (n.hidden)
170
170
  return;
171
- const s = t.typeAsString === "Note" ? x * 2 : x, r = n.width || s, i = n.minWidth || _, a = n.maxWidth || J;
171
+ const s = t.typeAsString === "Note" ? w * 2 : w, r = n.width || s, c = n.minWidth || T, a = n.maxWidth || J;
172
172
  e.push({
173
173
  id: t.internalName,
174
174
  accessorKey: t.internalName,
175
175
  header: t.title || t.internalName,
176
- cell: ({ row: c }) => Rt(
176
+ cell: ({ row: o }) => vt(
177
177
  t,
178
- c.original[t.internalName],
179
- c.original,
180
- c.index,
181
- oe,
178
+ o.original[t.internalName],
179
+ o.original,
180
+ o.index,
181
+ ie,
182
182
  ae
183
183
  ),
184
- size: Math.min(Math.max(r, i), a),
185
- minSize: i,
184
+ size: Math.min(Math.max(r, c), a),
185
+ minSize: c,
186
186
  maxSize: a,
187
187
  enableResizing: Q
188
188
  });
189
189
  }), e;
190
190
  }, [
191
191
  f,
192
- I,
192
+ y,
193
193
  Q,
194
194
  z,
195
- oe,
195
+ ie,
196
196
  ae
197
197
  ]);
198
- T(() => {
198
+ k(() => {
199
199
  const e = de.current;
200
200
  j((t) => {
201
201
  let n = !1;
202
- const s = { ...t }, r = new Set(f.map((i) => i.internalName));
203
- return Object.keys(s).forEach((i) => {
204
- r.has(i) || (delete s[i], n = !0);
205
- }), f.forEach((i) => {
206
- const a = i.internalName, c = z[a], o = e[a];
207
- if (c?.width !== void 0) {
208
- const u = c.minWidth ?? _, h = c.maxWidth ?? J, d = Math.min(Math.max(c.width, u), h);
202
+ const s = { ...t }, r = new Set(f.map((c) => c.internalName));
203
+ return Object.keys(s).forEach((c) => {
204
+ r.has(c) || (delete s[c], n = !0);
205
+ }), f.forEach((c) => {
206
+ const a = c.internalName, o = z[a], i = e[a];
207
+ if (o?.width !== void 0) {
208
+ const u = o.minWidth ?? T, h = o.maxWidth ?? J, d = Math.min(Math.max(o.width, u), h);
209
209
  s[a] !== d && (s[a] = d, n = !0);
210
- } else o?.width !== void 0 && s[a] !== void 0 && (delete s[a], n = !0);
210
+ } else i?.width !== void 0 && s[a] !== void 0 && (delete s[a], n = !0);
211
211
  }), n ? s : t;
212
212
  }), de.current = z;
213
213
  }, [z, f]);
214
- const Y = F(() => w.reduce((e, t) => {
215
- const s = f.find((i) => i.internalName === t.id)?.typeAsString === "Note" ? x * 2 : x, r = S[t.id] || (typeof t.size == "number" ? t.size : s);
214
+ const Y = F(() => I.reduce((e, t) => {
215
+ const s = f.find((c) => c.internalName === t.id)?.typeAsString === "Note" ? w * 2 : w, r = S[t.id] || (typeof t.size == "number" ? t.size : s);
216
216
  return e + r;
217
- }, 0), [w, S, f]), ye = wt({
217
+ }, 0), [I, S, f]), xe = It({
218
218
  data: b,
219
- columns: w,
219
+ columns: I,
220
220
  state: {
221
- rowSelection: W,
221
+ rowSelection: N,
222
222
  columnSizing: S
223
223
  },
224
224
  onRowSelectionChange: he,
@@ -226,40 +226,40 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
226
226
  j((t) => {
227
227
  const n = typeof e == "function" ? e(t) : e, s = {};
228
228
  return Object.keys(n).forEach((r) => {
229
- const i = w.find((a) => a.id === r);
230
- if (i) {
231
- const a = i.minSize || _, c = i.maxSize || J;
232
- N.current ? s[r] = Math.max(n[r], a) : s[r] = Math.min(Math.max(n[r], a), c);
229
+ const c = I.find((a) => a.id === r);
230
+ if (c) {
231
+ const a = c.minSize || T, o = c.maxSize || J;
232
+ M.current ? s[r] = Math.max(n[r], a) : s[r] = Math.min(Math.max(n[r], a), o);
233
233
  }
234
234
  }), { ...t, ...s };
235
235
  });
236
236
  },
237
237
  //getRowId: row => row.id as string,
238
238
  getCoreRowModel: zt(),
239
- getFilteredRowModel: It(),
240
- getSortedRowModel: yt(),
239
+ getFilteredRowModel: yt(),
240
+ getSortedRowModel: xt(),
241
241
  columnResizeMode: "onChange",
242
242
  enableRowSelection: !0,
243
- enableMultiRowSelection: I
243
+ enableMultiRowSelection: y
244
244
  });
245
- T(() => {
245
+ k(() => {
246
246
  const e = /* @__PURE__ */ new Set();
247
- Object.keys(W).forEach((t) => {
248
- if (W[t]) {
247
+ Object.keys(N).forEach((t) => {
248
+ if (N[t]) {
249
249
  const n = parseInt(t), s = p.current[n];
250
- s?.id && e.add(s.id);
250
+ s?._rowId && e.add(s._rowId);
251
251
  }
252
252
  }), U.current = e;
253
- }, [W]);
254
- const ft = R((e) => {
253
+ }, [N]);
254
+ const ft = v((e) => {
255
255
  re?.(e);
256
- }, [re]), Ie = (e) => {
256
+ }, [re]), ye = (e) => {
257
257
  const t = /* @__PURE__ */ new Set(), n = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set();
258
- return Object.keys(W).forEach((r) => {
259
- if (!W[r])
258
+ return Object.keys(N).forEach((r) => {
259
+ if (!N[r])
260
260
  return;
261
- const i = Number(r), a = e[i];
262
- a && (s.add(i), a.id && t.add(a.id), n.add(a));
261
+ const c = Number(r), a = e[c];
262
+ a && (s.add(c), a._rowId && t.add(a._rowId), n.add(a));
263
263
  }), {
264
264
  hasSelection: t.size > 0 || n.size > 0 || s.size > 0,
265
265
  selectedIds: t,
@@ -271,35 +271,35 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
271
271
  if (!t.hasSelection)
272
272
  return;
273
273
  const n = t.sourceLength !== e.length, s = {};
274
- e.forEach((r, i) => {
274
+ e.forEach((r, c) => {
275
275
  if (!r)
276
276
  return;
277
- const a = r.id ? t.selectedIds.has(r.id) : !1, c = t.selectedRefs.has(r), o = !r.id && !n && t.selectedIndexes.has(i);
278
- (a || c || o) && (s[i.toString()] = !0);
277
+ const a = r._rowId ? t.selectedIds.has(r._rowId) : !1, o = t.selectedRefs.has(r), i = !r._rowId && !n && t.selectedIndexes.has(c);
278
+ (a || o || i) && (s[c.toString()] = !0);
279
279
  }), he(s);
280
280
  }, g = (e) => {
281
281
  if (ue) {
282
282
  const t = b, n = typeof e == "function" ? e(t) : e;
283
283
  p.current = n;
284
- const s = Ie(t);
284
+ const s = ye(t);
285
285
  U.current = s.selectedIds, ze(n, s), se?.(n);
286
286
  return;
287
287
  }
288
288
  at((t) => {
289
289
  const n = typeof e == "function" ? e(t) : e;
290
290
  p.current = n;
291
- const s = Ie(t);
291
+ const s = ye(t);
292
292
  return U.current = s.selectedIds, ze(n, s), se?.(n), n;
293
293
  });
294
- }, be = R(() => f, [f]), Ee = async (e) => {
294
+ }, be = v(() => f, [f]), Ee = async (e) => {
295
295
  try {
296
296
  if (L) {
297
- const t = { id: E(), ...e }, n = await L([t], y);
297
+ const t = { _rowId: E(), ...e }, n = await L([t], x);
298
298
  if (n) {
299
299
  if (n.successful.length > 0) {
300
300
  const s = n.successful.map((r) => {
301
- const i = r.item;
302
- return i.id ? i : { ...i, id: E() };
301
+ const c = r.item;
302
+ return c._rowId ? c : { ...c, _rowId: E() };
303
303
  });
304
304
  g((r) => [...s, ...r]);
305
305
  }
@@ -310,7 +310,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
310
310
  failed: []
311
311
  };
312
312
  } else {
313
- const t = { id: E(), ...e };
313
+ const t = { _rowId: E(), ...e };
314
314
  return g((n) => [t, ...n]), {
315
315
  successful: [{ index: 0, item: t }],
316
316
  failed: []
@@ -322,7 +322,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
322
322
  failed: [{ index: -1, item: e, error: String(t) }]
323
323
  };
324
324
  }
325
- }, Ce = async (e) => {
325
+ }, _e = async (e) => {
326
326
  if (e.length === 0)
327
327
  return {
328
328
  successful: [],
@@ -331,14 +331,14 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
331
331
  try {
332
332
  if (L) {
333
333
  const t = e.map((s) => ({
334
- id: E(),
334
+ _rowId: E(),
335
335
  ...s
336
- })), n = await L(t, y);
336
+ })), n = await L(t, x);
337
337
  if (n) {
338
338
  if (n.successful.length > 0) {
339
339
  const s = n.successful.map((r) => {
340
- const i = r.item;
341
- return i.id ? i : { ...i, id: E() };
340
+ const c = r.item;
341
+ return c._rowId ? c : { ...c, _rowId: E() };
342
342
  });
343
343
  g((r) => [...s, ...r]);
344
344
  }
@@ -350,7 +350,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
350
350
  };
351
351
  } else {
352
352
  const t = e.map((n) => ({
353
- id: E(),
353
+ _rowId: E(),
354
354
  ...n
355
355
  }));
356
356
  return g((n) => [...t, ...n]), {
@@ -368,7 +368,7 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
368
368
  }))
369
369
  };
370
370
  }
371
- }, ve = async (e, t) => {
371
+ }, Ce = async (e, t) => {
372
372
  const n = p.current;
373
373
  if (e < 0 || e >= n.length)
374
374
  return {
@@ -377,18 +377,18 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
377
377
  };
378
378
  try {
379
379
  if (D) {
380
- const r = await D([{ index: e, item: t }], y);
380
+ const r = await D([{ index: e, item: t }], x);
381
381
  if (r)
382
- return r.successful.length && g((i) => {
383
- const a = [...i];
384
- return r.successful.forEach(({ index: c, item: o }) => a[c] = o), a;
382
+ return r.successful.length && g((c) => {
383
+ const a = [...c];
384
+ return r.successful.forEach(({ index: o, item: i }) => a[o] = i), a;
385
385
  }), r;
386
386
  }
387
387
  let s;
388
388
  return g((r) => {
389
389
  s = { ...r[e], ...t };
390
- const i = [...r];
391
- return i[e] = s, i;
390
+ const c = [...r];
391
+ return c[e] = s, c;
392
392
  }), { successful: [{ index: e, item: s }], failed: [] };
393
393
  } catch (s) {
394
394
  return {
@@ -396,44 +396,44 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
396
396
  failed: [{ index: e, item: t, error: String(s) }]
397
397
  };
398
398
  }
399
- }, Re = async (e) => {
399
+ }, ve = async (e) => {
400
400
  if (!e.length) return { successful: [], failed: [] };
401
- const t = p.current, n = (i) => i >= 0 && i < t.length, s = e.filter(({ index: i }) => !n(i)).map(({ index: i, item: a }) => ({ index: i, item: a, error: "Invalid index" })), r = e.filter(({ index: i }) => n(i));
401
+ const t = p.current, n = (c) => c >= 0 && c < t.length, s = e.filter(({ index: c }) => !n(c)).map(({ index: c, item: a }) => ({ index: c, item: a, error: "Invalid index" })), r = e.filter(({ index: c }) => n(c));
402
402
  try {
403
403
  if (D) {
404
- const c = await D(e, y);
405
- if (c) {
406
- const o = c.successful.filter(({ index: l }) => n(l));
407
- o.length && g((l) => {
408
- const k = [...l];
409
- return o.forEach(({ index: m, item: A }) => k[m] = A), k;
404
+ const o = await D(e, x);
405
+ if (o) {
406
+ const i = o.successful.filter(({ index: l }) => n(l));
407
+ i.length && g((l) => {
408
+ const W = [...l];
409
+ return i.forEach(({ index: m, item: A }) => W[m] = A), W;
410
410
  });
411
- const u = new Set(c.failed.map((l) => l.index)), h = [...c.failed];
411
+ const u = new Set(o.failed.map((l) => l.index)), h = [...o.failed];
412
412
  return s.forEach((l) => {
413
413
  u.has(l.index) || h.push(l);
414
- }), c.successful.filter(({ index: l }) => !n(l)).map(({ index: l, item: k }) => ({ index: l, item: k, error: "Invalid index" })).forEach((l) => {
414
+ }), o.successful.filter(({ index: l }) => !n(l)).map(({ index: l, item: W }) => ({ index: l, item: W, error: "Invalid index" })).forEach((l) => {
415
415
  u.has(l.index) || h.push(l);
416
- }), { successful: o, failed: h };
416
+ }), { successful: i, failed: h };
417
417
  }
418
418
  }
419
- const i = [], a = [...s];
420
- return g((c) => {
421
- const o = [...c];
419
+ const c = [], a = [...s];
420
+ return g((o) => {
421
+ const i = [...o];
422
422
  return r.forEach(({ index: u, item: h }) => {
423
- o[u] = { ...o[u], ...h }, i.push({ index: u, item: o[u] });
424
- }), o;
425
- }), { successful: i, failed: a };
426
- } catch (i) {
423
+ i[u] = { ...i[u], ...h }, c.push({ index: u, item: i[u] });
424
+ }), i;
425
+ }), { successful: c, failed: a };
426
+ } catch (c) {
427
427
  return {
428
428
  successful: [],
429
- failed: e.map(({ index: a, item: c }) => ({
429
+ failed: e.map(({ index: a, item: o }) => ({
430
430
  index: a,
431
- item: c,
432
- error: String(i)
431
+ item: o,
432
+ error: String(c)
433
433
  }))
434
434
  };
435
435
  }
436
- }, Me = async (e) => {
436
+ }, Re = async (e) => {
437
437
  const t = p.current;
438
438
  if (e < 0 || e >= t.length)
439
439
  return {
@@ -442,27 +442,27 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
442
442
  };
443
443
  try {
444
444
  if (H) {
445
- const s = b[e], r = await H([{ index: e, item: s }], y);
445
+ const s = b[e], r = await H([{ index: e, item: s }], x);
446
446
  if (r)
447
- return r.successful.length && g((i) => i.filter((a, c) => c !== e)), r;
447
+ return r.successful.length && g((c) => c.filter((a, o) => o !== e)), r;
448
448
  }
449
449
  let n;
450
- return g((s) => (n = s[e], s.filter((r, i) => i !== e))), { successful: [{ index: e, item: n }], failed: [] };
450
+ return g((s) => (n = s[e], s.filter((r, c) => c !== e))), { successful: [{ index: e, item: n }], failed: [] };
451
451
  } catch (n) {
452
452
  return {
453
453
  successful: [],
454
454
  failed: [{ index: e, error: String(n) }]
455
455
  };
456
456
  }
457
- }, Ne = async (e) => {
457
+ }, Me = async (e) => {
458
458
  if (!e.length) return { successful: [], failed: [] };
459
459
  const t = p.current, n = Array.from(new Set(e)), { validIndexes: s, invalidFailures: r } = n.reduce(
460
- (c, o) => (o >= 0 && o < t.length ? c.validIndexes.push(o) : c.invalidFailures.push({ index: o, error: "Invalid index" }), c),
460
+ (o, i) => (i >= 0 && i < t.length ? o.validIndexes.push(i) : o.invalidFailures.push({ index: i, error: "Invalid index" }), o),
461
461
  { validIndexes: [], invalidFailures: [] }
462
- ), i = n.map((c) => ({ index: c, item: b[c] })), a = new Set(s);
462
+ ), c = n.map((o) => ({ index: o, item: b[o] })), a = new Set(s);
463
463
  try {
464
464
  if (H) {
465
- const u = await H(i, y);
465
+ const u = await H(c, x);
466
466
  if (u) {
467
467
  const h = u.successful.filter(({ index: m }) => a.has(m));
468
468
  if (h.length) {
@@ -477,122 +477,122 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
477
477
  }), { successful: h, failed: l };
478
478
  }
479
479
  }
480
- const c = new Set(s), o = [];
480
+ const o = new Set(s), i = [];
481
481
  return g((u) => {
482
482
  const h = [];
483
483
  return u.forEach((d, l) => {
484
- c.has(l) ? o.push({ index: l, item: d }) : h.push(d);
484
+ o.has(l) ? i.push({ index: l, item: d }) : h.push(d);
485
485
  }), h;
486
- }), { successful: o, failed: r };
487
- } catch (c) {
486
+ }), { successful: i, failed: r };
487
+ } catch (o) {
488
488
  return {
489
489
  successful: [],
490
- failed: n.map((o) => ({ index: o, error: String(c) }))
490
+ failed: n.map((i) => ({ index: i, error: String(o) }))
491
491
  };
492
492
  }
493
- }, We = R((e) => p.current.find((t) => t.id === e), []), ke = (e) => p.current[e], Te = (e) => {
493
+ }, Ne = v((e) => p.current.find((t) => t._rowId === e), []), We = (e) => p.current[e], ke = (e) => {
494
494
  g(
495
- e.map((t) => ({ ...t, id: t.id ?? E() }))
495
+ e.map((t) => ({ ...t, _rowId: t._rowId ?? E() }))
496
496
  );
497
- }, _e = () => {
497
+ }, Te = () => {
498
498
  g([]);
499
- }, Ae = (e) => p.current.findIndex((t) => t.id === e), Be = (e) => p.current.some((t) => t.id === e), Fe = () => p.current.length, Oe = () => [...p.current], Le = R(() => ge(p.current), [ge]), De = R(() => Se(p.current), [Se]), y = F(() => ({
499
+ }, Ae = (e) => p.current.findIndex((t) => t._rowId === e), Be = (e) => p.current.some((t) => t._rowId === e), Fe = () => p.current.length, Oe = () => [...p.current], Le = v(() => ge(p.current), [ge]), De = v(() => Se(p.current), [Se]), x = F(() => ({
500
500
  getFields: be,
501
501
  addItem: Ee,
502
- addItems: Ce,
503
- updateItem: ve,
504
- updateItems: Re,
505
- deleteItem: Me,
506
- deleteItems: Ne,
507
- getItem: We,
508
- getItemByIndex: ke,
502
+ addItems: _e,
503
+ updateItem: Ce,
504
+ updateItems: ve,
505
+ deleteItem: Re,
506
+ deleteItems: Me,
507
+ getItem: Ne,
508
+ getItemByIndex: We,
509
509
  getItems: Oe,
510
510
  getItemsCount: Fe,
511
511
  itemExists: Be,
512
512
  getItemIndex: Ae,
513
- replaceAllItems: Te,
514
- clearItems: _e,
513
+ replaceAllItems: ke,
514
+ clearItems: Te,
515
515
  deselectAllRows: me,
516
516
  getSelectedItems: Le,
517
517
  getSelectedRows: De
518
518
  }), [
519
519
  Ee,
520
- Ce,
521
520
  _e,
521
+ Te,
522
+ Re,
522
523
  Me,
523
- Ne,
524
524
  me,
525
525
  f,
526
526
  be,
527
+ Ne,
527
528
  We,
528
- ke,
529
529
  Ae,
530
530
  Oe,
531
531
  Fe,
532
532
  Le,
533
533
  De,
534
534
  Be,
535
- Te,
536
- ve,
537
- Re
535
+ ke,
536
+ Ce,
537
+ ve
538
538
  ]);
539
- xt.useImperativeHandle(et, () => y, [y]);
540
- const ht = R((e, t) => {
541
- t?.target && t.target.closest('[data-checkbox="true"]') || (I && pe(e.index), Z && Z(e.original, e.index));
542
- }, [I, Z, pe]), He = F(() => w.map((e) => {
543
- const n = f.find((r) => r.internalName === e.id)?.typeAsString === "Note" ? x * 2 : x, s = S[e.id] || (typeof e.size == "number" ? e.size : n);
539
+ wt.useImperativeHandle(et, () => x, [x]);
540
+ const ht = v((e, t) => {
541
+ t?.target && t.target.closest('[data-checkbox="true"]') || (y && pe(e.index), Z && Z(e.original, e.index));
542
+ }, [y, Z, pe]), He = F(() => I.map((e) => {
543
+ const n = f.find((r) => r.internalName === e.id)?.typeAsString === "Note" ? w * 2 : w, s = S[e.id] || (typeof e.size == "number" ? e.size : n);
544
544
  return e.id === "select" ? `${O}px` : `${s}px`;
545
- }).join(" "), [w, S, f]);
546
- T(() => {
545
+ }).join(" "), [I, S, f]);
546
+ k(() => {
547
547
  if (!P) return;
548
548
  const e = new ResizeObserver((t) => {
549
549
  for (const n of t)
550
550
  fe(n.contentRect.width);
551
551
  });
552
552
  return e.observe(P), fe(P.clientWidth), () => e.disconnect();
553
- }, [P]), T(() => {
554
- if (!M || C <= 0 || N.current) return;
553
+ }, [P]), k(() => {
554
+ if (!R || _ <= 0 || M.current) return;
555
555
  let e = 0, t = 0;
556
556
  const n = [];
557
- if (w.forEach((o) => {
558
- const h = f.find((m) => m.internalName === o.id)?.typeAsString === "Note" ? x * 2 : x, d = S[o.id] || (typeof o.size == "number" ? o.size : h);
559
- !(o.id === "select") ? (t += d, n.push(o)) : e += d;
557
+ if (I.forEach((i) => {
558
+ const h = f.find((m) => m.internalName === i.id)?.typeAsString === "Note" ? w * 2 : w, d = S[i.id] || (typeof i.size == "number" ? i.size : h);
559
+ !(i.id === "select") ? (t += d, n.push(i)) : e += d;
560
560
  }), n.length === 0)
561
561
  return;
562
562
  const s = e + t;
563
- if (Math.abs(s - C) < 1) return;
564
- const r = C - e, i = r / t, a = { ...S };
565
- let c = 0;
566
- n.forEach((o, u) => {
567
- const h = S[o.id] || (typeof o.size == "number" ? o.size : x), d = o.minSize || _;
563
+ if (Math.abs(s - _) < 1) return;
564
+ const r = _ - e, c = r / t, a = { ...S };
565
+ let o = 0;
566
+ n.forEach((i, u) => {
567
+ const h = S[i.id] || (typeof i.size == "number" ? i.size : w), d = i.minSize || T;
568
568
  let l;
569
- u === n.length - 1 ? l = r - c : l = Math.round(h * i), l = Math.max(d, l), a[o.id] = l, c += l;
570
- }), N.current = !0, j(a), requestAnimationFrame(() => {
571
- N.current = !1;
569
+ u === n.length - 1 ? l = r - o : l = Math.round(h * c), l = Math.max(d, l), a[i.id] = l, o += l;
570
+ }), M.current = !0, j(a), requestAnimationFrame(() => {
571
+ M.current = !1;
572
572
  });
573
- }, [M, C, w, f]), T(() => {
574
- if (M || C <= 0)
573
+ }, [R, _, I, f]), k(() => {
574
+ if (R || _ <= 0)
575
575
  return;
576
- const e = C - Y;
576
+ const e = _ - Y;
577
577
  if (Math.abs(e) < 1)
578
578
  return;
579
- const t = w.filter((d) => d.id && d.id !== "select");
579
+ const t = I.filter((d) => d.id && d.id !== "select");
580
580
  if (t.length === 0) return;
581
- const n = t[t.length - 1], s = n.id, i = f.find((d) => d.internalName === s)?.typeAsString === "Note" ? x * 2 : x, c = (S[s] || (typeof n.size == "number" ? n.size : i)) + e, o = n.minSize || _, u = Math.max(o, c), h = S[s];
582
- Math.abs(h - u) < 1 || (N.current = !0, j((d) => ({
581
+ const n = t[t.length - 1], s = n.id, c = f.find((d) => d.internalName === s)?.typeAsString === "Note" ? w * 2 : w, o = (S[s] || (typeof n.size == "number" ? n.size : c)) + e, i = n.minSize || T, u = Math.max(i, o), h = S[s];
582
+ Math.abs(h - u) < 1 || (M.current = !0, j((d) => ({
583
583
  ...d,
584
584
  [s]: u
585
- })), N.current = !1);
586
- }, [M, C, Y, w, f]);
587
- const je = Mt(tt), Pe = Nt(nt), $ = Wt(st), mt = je ? [je, ...ie] : ie, ee = [];
585
+ })), M.current = !1);
586
+ }, [R, _, Y, I, f]);
587
+ const je = Rt(tt), Pe = Mt(nt), $ = Nt(st), mt = je ? [je, ...ce] : ce, ee = [];
588
588
  Pe && ee.push(Pe), $ && ee.push($);
589
- const pt = [...ee, ...it], gt = $ ? [$, ...ce] : ce;
589
+ const pt = [...ee, ...ct], gt = $ ? [$, ...oe] : oe;
590
590
  return /* @__PURE__ */ Ye(
591
- Ct,
591
+ _t,
592
592
  {
593
593
  size: "small",
594
594
  appearance: Ge,
595
- className: ct,
595
+ className: ot,
596
596
  style: {
597
597
  backgroundColor: K.colorNeutralBackground1,
598
598
  maxWidth: "100%",
@@ -602,18 +602,18 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
602
602
  ...Xe
603
603
  },
604
604
  children: [
605
- V && /* @__PURE__ */ v(
606
- kt,
605
+ V && /* @__PURE__ */ C(
606
+ Wt,
607
607
  {
608
- tableMethods: y,
608
+ tableMethods: x,
609
609
  alwaysButtons: mt,
610
610
  noSelectionButtons: rt,
611
611
  singleSelectionButtons: pt,
612
612
  multiSelectionButtons: gt,
613
- selectedRows: y.getSelectedRows()
613
+ selectedRows: x.getSelectedRows()
614
614
  }
615
615
  ),
616
- b.length > 0 ? /* @__PURE__ */ v(
616
+ b.length > 0 ? /* @__PURE__ */ C(
617
617
  "div",
618
618
  {
619
619
  ref: dt,
@@ -632,32 +632,32 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
632
632
  {
633
633
  className: "table-container",
634
634
  style: {
635
- minWidth: M ? "100%" : Y,
636
- width: M ? "100%" : Math.max(Y, 300)
635
+ minWidth: R ? "100%" : Y,
636
+ width: R ? "100%" : Math.max(Y, 300)
637
637
  },
638
638
  children: [
639
- /* @__PURE__ */ v(
640
- Tt,
639
+ /* @__PURE__ */ C(
640
+ kt,
641
641
  {
642
- table: ye,
642
+ table: xe,
643
643
  gridTemplateColumns: He,
644
644
  columnSizing: S,
645
- stickyColumnsInfo: we,
645
+ stickyColumnsInfo: Ie,
646
646
  resizableColumns: Q
647
647
  }
648
648
  ),
649
- /* @__PURE__ */ v(
650
- _t,
649
+ /* @__PURE__ */ C(
650
+ Tt,
651
651
  {
652
- table: ye,
652
+ table: xe,
653
653
  fields: f,
654
- tableContainerRef: xe,
654
+ tableContainerRef: we,
655
655
  useVirtualization: Ue,
656
- enableSelection: I,
656
+ enableSelection: y,
657
657
  itemSize: Ve,
658
658
  gridTemplateColumns: He,
659
659
  columnSizing: S,
660
- stickyColumnsInfo: we,
660
+ stickyColumnsInfo: Ie,
661
661
  onRowClick: ht
662
662
  }
663
663
  )
@@ -665,15 +665,15 @@ const G = {}, Bt = /* @__PURE__ */ new Set(), qe = [], X = [], x = 120, _ = 80,
665
665
  }
666
666
  )
667
667
  }
668
- ) : /* @__PURE__ */ v(At, { height: 250 })
668
+ ) : /* @__PURE__ */ C(At, { height: 250 })
669
669
  ]
670
670
  }
671
671
  );
672
672
  };
673
673
  export {
674
- x as COLS_DEF_WIDTH,
674
+ w as COLS_DEF_WIDTH,
675
675
  J as COLS_MAX_WIDTH,
676
- _ as COLS_MIN_WIDTH,
676
+ T as COLS_MIN_WIDTH,
677
677
  Ut as EFWTable,
678
678
  Qt as SELECTOR_CELL_HEIGHT,
679
679
  O as SELECTOR_CELL_WIDTH
@@ -4,7 +4,7 @@ import { DefaultDrawerButtonProps, EFWTableCommandBarButton } from './components
4
4
  import { EFWFormFieldProps, EFWFormFieldType, EFWFormFieldValue } from '../../forms/EFWForm';
5
5
 
6
6
  export interface EFWTableItem {
7
- readonly id?: string;
7
+ readonly _rowId?: string;
8
8
  [key: string]: EFWFormFieldValue | undefined;
9
9
  }
10
10
  export interface EFWTableRow<T = EFWTableItem> {
@@ -28,8 +28,8 @@ export interface OperationResult<T> {
28
28
  */
29
29
  export interface EFWTableMethods {
30
30
  getFields: () => EFWFormFieldProps[];
31
- addItem: (item: Omit<EFWTableItem, 'id'>) => Promise<OperationResult<EFWTableItem>>;
32
- addItems: (items: Omit<EFWTableItem, 'id'>[]) => Promise<OperationResult<EFWTableItem>>;
31
+ addItem: (item: Omit<EFWTableItem, '_rowId'>) => Promise<OperationResult<EFWTableItem>>;
32
+ addItems: (items: Omit<EFWTableItem, '_rowId'>[]) => Promise<OperationResult<EFWTableItem>>;
33
33
  updateItem: (index: number, item: Partial<EFWTableItem>) => Promise<OperationResult<EFWTableItem>>;
34
34
  updateItems: (items: {
35
35
  index: number;
@@ -1,9 +1,9 @@
1
- import { useRef as G, useState as m, useCallback as u, useEffect as d } from "react";
2
- const J = (I) => {
3
- const c = G(null), [l, a] = m([]), [i, g] = m(I || []), h = u(() => c.current?.getFields?.() || i, [i]), p = u((t) => {
1
+ import { useRef as D, useState as m, useCallback as u, useEffect as I } from "react";
2
+ const H = (d) => {
3
+ const c = D(null), [l, a] = m([]), [i, g] = m(d || []), h = u(() => c.current?.getFields?.() || i, [i]), p = u((t) => {
4
4
  g(t);
5
5
  }, []);
6
- d(() => {
6
+ I(() => {
7
7
  (() => {
8
8
  const e = c.current?.getItems?.();
9
9
  e && a(e);
@@ -135,21 +135,21 @@ const J = (I) => {
135
135
  }))
136
136
  };
137
137
  }
138
- }, []), v = u((t) => c.current?.getItem?.(t) || l.find((e) => e.id === t), [l]), T = u((t) => c.current?.getItemByIndex?.(t) || l[t], [l]), C = u((t) => {
138
+ }, []), v = u((t) => c.current?.getItem?.(t) || l.find((e) => e._rowId === t), [l]), T = u((t) => c.current?.getItemByIndex?.(t) || l[t], [l]), C = u((t) => {
139
139
  c.current?.replaceAllItems?.(t), a(t);
140
140
  }, []), x = u(() => {
141
141
  c.current?.clearItems?.(), a([]);
142
- }, []), A = u((t) => c.current?.getItemIndex?.(t) ?? l.findIndex((e) => e.id === t), [l]), F = u((t) => c.current?.itemExists?.(t) ?? l.some((e) => e.id === t), [l]), B = u(() => c.current?.getItemsCount?.() ?? l.length, [l.length]), k = u(() => c.current?.getItems?.() ?? l, [l]), j = u(() => {
142
+ }, []), A = u((t) => c.current?.getItemIndex?.(t) ?? l.findIndex((e) => e._rowId === t), [l]), F = u((t) => c.current?.itemExists?.(t) ?? l.some((e) => e._rowId === t), [l]), _ = u(() => c.current?.getItemsCount?.() ?? l.length, [l.length]), B = u(() => c.current?.getItems?.() ?? l, [l]), k = u(() => {
143
143
  c.current?.deselectAllRows?.();
144
- }, []), q = u(() => c.current?.getSelectedItems?.() ?? { items: [], indexes: [] }, []), z = u(() => c.current?.getSelectedRows?.() ?? [], []), D = u(() => c.current !== null, []);
145
- return d(() => () => {
144
+ }, []), j = u(() => c.current?.getSelectedItems?.() ?? { items: [], indexes: [] }, []), q = u(() => c.current?.getSelectedRows?.() ?? [], []), z = u(() => c.current !== null, []);
145
+ return I(() => () => {
146
146
  c.current = null;
147
147
  }, []), {
148
148
  tableRef: c,
149
149
  // Configuración
150
150
  getFields: h,
151
151
  setFieldsConfig: p,
152
- isTableReady: D,
152
+ isTableReady: z,
153
153
  // Operaciones CRUD
154
154
  addItem: y,
155
155
  addItems: b,
@@ -160,19 +160,19 @@ const J = (I) => {
160
160
  // Consultas
161
161
  getItem: v,
162
162
  getItemByIndex: T,
163
- getItems: k,
164
- getItemsCount: B,
163
+ getItems: B,
164
+ getItemsCount: _,
165
165
  getItemIndex: A,
166
166
  itemExists: F,
167
167
  // Manipulación masiva
168
168
  replaceAllItems: C,
169
169
  clearItems: x,
170
170
  // Selección
171
- deselectAllRows: j,
172
- getSelectedItems: q,
173
- getSelectedRows: z
171
+ deselectAllRows: k,
172
+ getSelectedItems: j,
173
+ getSelectedRows: q
174
174
  };
175
175
  };
176
176
  export {
177
- J as useTableController
177
+ H as useTableController
178
178
  };
@@ -1,9 +1,9 @@
1
- import { useRef as G, useState as m, useCallback as u, useEffect as d } from "react";
2
- const J = (I) => {
3
- const c = G(null), [l, a] = m([]), [i, g] = m(I || []), h = u(() => c.current?.getFields?.() || i, [i]), p = u((t) => {
1
+ import { useRef as D, useState as m, useCallback as u, useEffect as I } from "react";
2
+ const H = (d) => {
3
+ const c = D(null), [l, a] = m([]), [i, g] = m(d || []), h = u(() => c.current?.getFields?.() || i, [i]), p = u((t) => {
4
4
  g(t);
5
5
  }, []);
6
- d(() => {
6
+ I(() => {
7
7
  (() => {
8
8
  const e = c.current?.getItems?.();
9
9
  e && a(e);
@@ -135,21 +135,21 @@ const J = (I) => {
135
135
  }))
136
136
  };
137
137
  }
138
- }, []), v = u((t) => c.current?.getItem?.(t) || l.find((e) => e.id === t), [l]), T = u((t) => c.current?.getItemByIndex?.(t) || l[t], [l]), C = u((t) => {
138
+ }, []), v = u((t) => c.current?.getItem?.(t) || l.find((e) => e._rowId === t), [l]), T = u((t) => c.current?.getItemByIndex?.(t) || l[t], [l]), C = u((t) => {
139
139
  c.current?.replaceAllItems?.(t), a(t);
140
140
  }, []), x = u(() => {
141
141
  c.current?.clearItems?.(), a([]);
142
- }, []), A = u((t) => c.current?.getItemIndex?.(t) ?? l.findIndex((e) => e.id === t), [l]), F = u((t) => c.current?.itemExists?.(t) ?? l.some((e) => e.id === t), [l]), B = u(() => c.current?.getItemsCount?.() ?? l.length, [l.length]), k = u(() => c.current?.getItems?.() ?? l, [l]), j = u(() => {
142
+ }, []), A = u((t) => c.current?.getItemIndex?.(t) ?? l.findIndex((e) => e._rowId === t), [l]), F = u((t) => c.current?.itemExists?.(t) ?? l.some((e) => e._rowId === t), [l]), _ = u(() => c.current?.getItemsCount?.() ?? l.length, [l.length]), B = u(() => c.current?.getItems?.() ?? l, [l]), k = u(() => {
143
143
  c.current?.deselectAllRows?.();
144
- }, []), q = u(() => c.current?.getSelectedItems?.() ?? { items: [], indexes: [] }, []), z = u(() => c.current?.getSelectedRows?.() ?? [], []), D = u(() => c.current !== null, []);
145
- return d(() => () => {
144
+ }, []), j = u(() => c.current?.getSelectedItems?.() ?? { items: [], indexes: [] }, []), q = u(() => c.current?.getSelectedRows?.() ?? [], []), z = u(() => c.current !== null, []);
145
+ return I(() => () => {
146
146
  c.current = null;
147
147
  }, []), {
148
148
  tableRef: c,
149
149
  // Configuración
150
150
  getFields: h,
151
151
  setFieldsConfig: p,
152
- isTableReady: D,
152
+ isTableReady: z,
153
153
  // Operaciones CRUD
154
154
  addItem: y,
155
155
  addItems: b,
@@ -160,19 +160,19 @@ const J = (I) => {
160
160
  // Consultas
161
161
  getItem: v,
162
162
  getItemByIndex: T,
163
- getItems: k,
164
- getItemsCount: B,
163
+ getItems: B,
164
+ getItemsCount: _,
165
165
  getItemIndex: A,
166
166
  itemExists: F,
167
167
  // Manipulación masiva
168
168
  replaceAllItems: C,
169
169
  clearItems: x,
170
170
  // Selección
171
- deselectAllRows: j,
172
- getSelectedItems: q,
173
- getSelectedRows: z
171
+ deselectAllRows: k,
172
+ getSelectedItems: j,
173
+ getSelectedRows: q
174
174
  };
175
175
  };
176
176
  export {
177
- J as useTableController
177
+ H as useTableController
178
178
  };
@@ -1,6 +1,6 @@
1
1
  import { CACHE_CONFIG as f } from "./constants.js";
2
- import { getRenderContextVersion as y } from "./context.js";
3
- import { hashString as p, extractDateIdentifiers as g, extractAttachmentIdentifiers as w, extractOptionIdentifiers as S } from "./hashing.js";
2
+ import { getRenderContextVersion as w } from "./context.js";
3
+ import { hashString as p, extractDateIdentifiers as y, extractAttachmentIdentifiers as g, extractOptionIdentifiers as S } from "./hashing.js";
4
4
  function C(t, e) {
5
5
  if (t == null)
6
6
  return "null";
@@ -20,17 +20,17 @@ function C(t, e) {
20
20
  n = S(t);
21
21
  break;
22
22
  case "Attachments":
23
- n = w(t);
23
+ n = g(t);
24
24
  break;
25
25
  case "Date":
26
- n = g(t);
26
+ n = y(t);
27
27
  break;
28
28
  default:
29
- n = t.map((o, l) => `${l}-${String(o)}`);
29
+ n = t.map((i, l) => `${l}-${String(i)}`);
30
30
  }
31
31
  n.sort();
32
- const c = n.slice(0, 5).join(","), i = p(n.join("|"));
33
- return `array-${r}-${c}-${i}`;
32
+ const c = n.slice(0, 5).join(","), o = p(n.join("|"));
33
+ return `array-${r}-${c}-${o}`;
34
34
  }
35
35
  try {
36
36
  return `object-${p(JSON.stringify(t))}`;
@@ -38,14 +38,14 @@ function C(t, e) {
38
38
  return "complex-object";
39
39
  }
40
40
  }
41
- function k(t, e, r, n, c) {
41
+ function I(t, e, r, n, c) {
42
42
  return [
43
43
  t.internalName || t.id,
44
44
  t.typeAsString,
45
45
  C(e, t.typeAsString),
46
- r.id || `row-${n}`,
46
+ r._rowId || `row-${n}`,
47
47
  c ? p(JSON.stringify(Object.keys(c))) : "no-renderers",
48
- y().toString()
48
+ w().toString()
49
49
  ].join("|");
50
50
  }
51
51
  const s = /* @__PURE__ */ new Map();
@@ -68,16 +68,16 @@ function d() {
68
68
  function b() {
69
69
  const t = Math.floor(f.MAX_SIZE * 0.8);
70
70
  if (s.size <= t) return;
71
- const e = Array.from(s.entries()), r = Date.now(), n = e.map(([i, o]) => {
72
- const l = r - o.timestamp, u = o.hits / Math.max(1, l / 1e3);
73
- return { key: i, score: u, entry: o };
71
+ const e = Array.from(s.entries()), r = Date.now(), n = e.map(([o, i]) => {
72
+ const l = r - i.timestamp, u = i.hits / Math.max(1, l / 1e3);
73
+ return { key: o, score: u, entry: i };
74
74
  });
75
- n.sort((i, o) => i.score - o.score);
75
+ n.sort((o, i) => o.score - i.score);
76
76
  const c = n.slice(0, s.size - t);
77
- for (const { key: i } of c)
78
- s.delete(i);
77
+ for (const { key: o } of c)
78
+ s.delete(o);
79
79
  }
80
- function I(t) {
80
+ function k(t) {
81
81
  const e = s.get(t);
82
82
  if (!e) return;
83
83
  if (Date.now() - e.timestamp >= f.TTL_MS) {
@@ -119,8 +119,8 @@ function $(t) {
119
119
  }
120
120
  export {
121
121
  T as clearRenderCache,
122
- k as createCacheKey,
123
- I as getCachedResult,
122
+ I as createCacheKey,
123
+ k as getCachedResult,
124
124
  E as getRenderCacheStats,
125
125
  $ as prewarmCache,
126
126
  M as setCachedResult
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@envisiongroup/porygon",
3
- "version": "1.0.0-rc.02",
3
+ "version": "1.0.0-rc.03",
4
4
  "description": "Librerias de componentes de React creados por la empresa Envision",
5
5
  "license": "CC-BY-ND-4.0",
6
6
  "main": "./dist/index.js",