@declarion/react 0.80.0 → 0.82.0

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.
Files changed (28) hide show
  1. package/dist-lib/components/actions/ObjectActionBar.js +56 -54
  2. package/dist-lib/components/actions/PropertyGridEditor.js +56 -53
  3. package/dist-lib/components/actions/RowActionsKebab.js +51 -49
  4. package/dist-lib/components/detail-layout/AssociatedBlock.js +385 -383
  5. package/dist-lib/components/list/QuickPeek.js +77 -75
  6. package/dist-lib/components/pages/SmartDetailPage.impl.js +484 -458
  7. package/dist-lib/components/pages/SmartRecordListPage.impl.js +207 -206
  8. package/dist-lib/components/pages/list/DataCell.js +15 -15
  9. package/dist-lib/components/pages/list/ListFloatbar.js +55 -53
  10. package/dist-lib/components/pages/list/ListHeader.js +54 -52
  11. package/dist-lib/components/pages/list/ListTable.js +64 -64
  12. package/dist-lib/components/pages/list/cardProjection.js +85 -80
  13. package/dist-lib/components/pages/list/column-sizing.js +11 -1
  14. package/dist-lib/components/pages/list/use-filter-value-labels.js +29 -78
  15. package/dist-lib/components/pages/list/useListRowInteraction.js +78 -76
  16. package/dist-lib/components/pages/list/useRowMenu.js +60 -58
  17. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +341 -262
  18. package/dist-lib/components/params/ParamsBlock.js +59 -59
  19. package/dist-lib/components/params/param-editors.js +114 -99
  20. package/dist-lib/components/shared/ConfirmDialog.js +33 -66
  21. package/dist-lib/components/shared/ModalFrame.js +53 -0
  22. package/dist-lib/hooks/useRefRecords.js +73 -0
  23. package/dist-lib/hooks/useRowTenant.js +12 -0
  24. package/dist-lib/index.d.ts +4 -3
  25. package/dist-lib/lib/actions.js +105 -89
  26. package/dist-lib/lib/mass-edit.js +13 -13
  27. package/dist-lib/types/schema.js +29 -22
  28. package/package.json +1 -1
@@ -62,52 +62,53 @@ function f(e) {
62
62
  return y(t, a.columns, a.source);
63
63
  }
64
64
  function p(e) {
65
- let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Z(), p = r === "cards" ? a.renderFields : C(t, i, { explicit: !0 }), _ = r === "cards" ? g(t, n) : [];
66
- for (let e of p) f.addField(e, "render"), q(t, e, f, "render");
67
- for (let e of _) p.includes(e) || (f.addField(e, "variant"), q(t, e, f, "variant"));
68
- let v = P(t, f), y = z(t, [
65
+ let { entity: t, screen: n, presentation: r, visibleColumns: i, card: a, rowActions: o, toolbarActions: s, bulkActions: c, sort: l, includeDetailHandoff: u = !0, screens: d } = e, f = new Q(), p = r === "cards" ? a.renderFields : C(t, i, { explicit: !0 }), _ = r === "cards" ? g(t, n) : [];
66
+ for (let e of p) f.addField(e, "render"), J(t, e, f, "render");
67
+ for (let e of _) p.includes(e) || (f.addField(e, "variant"), J(t, e, f, "variant"));
68
+ let v = F(t, f), y = P(t, f), b = B(t, [
69
69
  o,
70
70
  s,
71
71
  c
72
- ], f), b = h(t, n, f), x = B(t, l, f), S = V(t, n, d, f), w = m(t, [
72
+ ], f), x = h(t, n, f), S = V(t, l, f), w = H(t, n, d, f), T = m(t, [
73
73
  p,
74
74
  _,
75
- S
75
+ w
76
76
  ], f);
77
77
  if (u) for (let e of v) f.addField(e, "detail_handoff");
78
- let T = new X();
79
- for (let e of v) T.add(e);
80
- for (let e of y) T.add(e);
81
- for (let e of b) T.add(e);
82
- for (let e of _) T.add(e);
83
- for (let e of x) T.add(e);
84
- for (let e of S) T.add(e);
85
- for (let e of w) T.add(e);
86
- let E = new X();
87
- for (let e of p) K(t, e, E, f);
88
- for (let e of T.values()) K(t, e, E, f);
89
- let D = E.values(), O = J(f);
78
+ let E = new Z();
79
+ for (let e of v) E.add(e);
80
+ for (let e of y) E.add(e);
81
+ for (let e of b) E.add(e);
82
+ for (let e of x) E.add(e);
83
+ for (let e of _) E.add(e);
84
+ for (let e of S) E.add(e);
85
+ for (let e of w) E.add(e);
86
+ for (let e of T) E.add(e);
87
+ let D = new Z();
88
+ for (let e of p) q(t, e, D, f);
89
+ for (let e of E.values()) q(t, e, D, f);
90
+ let O = D.values(), k = Y(f);
90
91
  return {
91
92
  renderFields: p,
92
- dependencyFields: T.values().filter((e) => !p.includes(e)),
93
- conditionFields: y,
93
+ dependencyFields: E.values().filter((e) => !p.includes(e)),
94
+ conditionFields: b,
94
95
  identityFields: v,
95
- sortFields: x,
96
- selectFields: D.length > 0 ? D : void 0,
97
- expandFields: O.length > 0 ? O : void 0,
96
+ sortFields: S,
97
+ selectFields: O.length > 0 ? O : void 0,
98
+ expandFields: k.length > 0 ? k : void 0,
98
99
  reasons: f.snapshot()
99
100
  };
100
101
  }
101
102
  function m(e, t, n) {
102
- let r = new X();
103
+ let r = new Z();
103
104
  for (let i of t.flat()) {
104
- let t = Y(e, i), a = t.kind === "field" ? t.field.display?.currency_field : void 0;
105
+ let t = X(e, i), a = t.kind === "field" ? t.field.display?.currency_field : void 0;
105
106
  a && (r.add(a), n.addField(a, "currency"));
106
107
  }
107
108
  return r.values();
108
109
  }
109
110
  function h(e, t, n) {
110
- let r = new X(), i = (t) => {
111
+ let r = new Z(), i = (t) => {
111
112
  for (let n of t) n.and ? i(n.and) : n.or ? i(n.or) : n.field && e?.fields.has(n.field) && r.add(n.field);
112
113
  };
113
114
  for (let t of e?.variants?.items() ?? []) t.when && i(t.when);
@@ -116,7 +117,7 @@ function h(e, t, n) {
116
117
  return r.values();
117
118
  }
118
119
  function g(e, t, n) {
119
- let r = new X();
120
+ let r = new Z();
120
121
  for (let i of f({
121
122
  entity: e,
122
123
  screen: t,
@@ -139,12 +140,12 @@ function _(e, t, n) {
139
140
  if (r && r.length > 0) return C(e, r, { explicit: !0 });
140
141
  let i = t.quick_peek?.sections;
141
142
  if (i && i.length > 0) {
142
- let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new X();
143
- H(r?.items, new Set(i.map(String)), a);
143
+ let r = Object.values(n ?? {}).find((e) => e.type === "detail" && e.entity === t.entity), a = new Z();
144
+ U(r?.items, new Set(i.map(String)), a);
144
145
  let o = C(e, a.values(), { explicit: !0 });
145
146
  if (o.length > 0) return o;
146
147
  }
147
- return G(e);
148
+ return K(e);
148
149
  }
149
150
  function v(e, t, r) {
150
151
  let i = t.max_body_fields ?? n, a = w(e, t.title_field, { explicit: !0 }), o = w(e, t.subtitle_field, { explicit: !0 }), s = C(e, t.badge_fields ?? [], { explicit: !0 }), c = C(e, t.fields ?? [], { explicit: !0 }), l = C(e, t.meta_fields ?? [], { explicit: !0 });
@@ -183,7 +184,7 @@ function y(e, t, a) {
183
184
  });
184
185
  }
185
186
  function b(e) {
186
- let t = new X(), n = [], r = (r, i) => {
187
+ let t = new Z(), n = [], r = (r, i) => {
187
188
  r && !t.has(r) && (t.add(r), n.push({
188
189
  field: r,
189
190
  bucket: i,
@@ -236,7 +237,7 @@ function S(e) {
236
237
  return t;
237
238
  }
238
239
  function C(e, t, n) {
239
- let r = new X();
240
+ let r = new Z();
240
241
  for (let i of t) {
241
242
  let t = w(e, i, n);
242
243
  t && r.add(t);
@@ -267,51 +268,55 @@ function E(e, t) {
267
268
  }
268
269
  function D(e, t) {
269
270
  if (M(e, t)) return !1;
270
- let n = Y(e, t);
271
+ let n = X(e, t);
271
272
  return n.kind === "field" && u.has(n.field.type);
272
273
  }
273
274
  function O(e, t) {
274
275
  if (t.startsWith("$status.") || t.startsWith("$property.") || t === "$evidence") return !0;
275
- let n = Y(e, t);
276
+ let n = X(e, t);
276
277
  return n.kind === "field" && c.has(n.field.type);
277
278
  }
278
279
  function k(e, t) {
279
- let n = new X();
280
+ let n = new Z();
280
281
  for (let e of t) (e.startsWith("$status.") || e.startsWith("$property.") || e === "$evidence") && n.add(e);
281
282
  for (let r of t) O(e, r) && n.add(r);
282
283
  return n.values();
283
284
  }
284
285
  function A(e, t) {
285
286
  if (M(e, t)) return !1;
286
- let n = Y(e, t);
287
+ let n = X(e, t);
287
288
  return n.kind === "field" && l.has(n.field.type);
288
289
  }
289
290
  function j(e, t) {
290
- return Y(e, t).kind !== "missing";
291
+ return X(e, t).kind !== "missing";
291
292
  }
292
293
  function M(e, t) {
293
- let n = Y(e, t);
294
+ let n = X(e, t);
294
295
  return n.kind === "field" && (n.field.primary === !0 || n.field.auto === !0);
295
296
  }
296
297
  function N(e, t) {
297
- let n = Y(e, t);
298
+ let n = X(e, t);
298
299
  return n.kind === "file" ? n.file.mode !== "single" : n.kind === "field" && s.has(n.field.type);
299
300
  }
300
- function P(t, n) {
301
+ function P(e, t) {
302
+ let n = e?.tenant_key;
303
+ return !n || X(e, n).kind === "missing" ? [] : (t.addField(n, "row_tenant"), [n]);
304
+ }
305
+ function F(t, n) {
301
306
  if (!t) return [];
302
- let r = new X();
307
+ let r = new Z();
303
308
  for (let i of e(t)) r.add(i), n.addField(i, "identity");
304
309
  let i = w(t, t.display.display_field, { explicit: !0 });
305
- i && (r.add(i), n.addField(i, "display"), q(t, i, n, "display"));
306
- for (let e of F(t.display.display_template)) {
310
+ i && (r.add(i), n.addField(i, "display"), J(t, i, n, "display"));
311
+ for (let e of I(t.display.display_template)) {
307
312
  let i = w(t, e, { explicit: !0 });
308
- i && (r.add(i), n.addField(i, "display_template"), q(t, i, n, "display_template"));
313
+ i && (r.add(i), n.addField(i, "display_template"), J(t, i, n, "display_template"));
309
314
  }
310
315
  return r.values();
311
316
  }
312
- function F(e) {
317
+ function I(e) {
313
318
  if (!e) return [];
314
- let t = new X(), n = 0;
319
+ let t = new Z(), n = 0;
315
320
  for (; n < e.length;) {
316
321
  let r = e.indexOf("${", n);
317
322
  if (r < 0) break;
@@ -319,14 +324,14 @@ function F(e) {
319
324
  n = r + 2;
320
325
  continue;
321
326
  }
322
- let i = I(e, r + 2);
327
+ let i = L(e, r + 2);
323
328
  if (i < 0) break;
324
- for (let n of L(e.slice(r + 2, i))) t.add(n);
329
+ for (let n of R(e.slice(r + 2, i))) t.add(n);
325
330
  n = i + 1;
326
331
  }
327
332
  return t.values();
328
333
  }
329
- function I(e, t) {
334
+ function L(e, t) {
330
335
  let n = 0;
331
336
  for (let r = t; r < e.length; r += 1) {
332
337
  let t = e[r];
@@ -338,46 +343,46 @@ function I(e, t) {
338
343
  }
339
344
  return -1;
340
345
  }
341
- function L(e) {
342
- let t = new X(), n = 0;
346
+ function R(e) {
347
+ let t = new Z(), n = 0;
343
348
  for (; n < e.length;) {
344
349
  let r = e.indexOf("row.", n);
345
350
  if (r < 0) break;
346
- if (r > 0 && R(e.charCodeAt(r - 1))) {
351
+ if (r > 0 && z(e.charCodeAt(r - 1))) {
347
352
  n = r + 4;
348
353
  continue;
349
354
  }
350
355
  let i = r + 4, a = i;
351
- for (; a < e.length && R(e.charCodeAt(a));) a += 1;
356
+ for (; a < e.length && z(e.charCodeAt(a));) a += 1;
352
357
  a > i && t.add(e.slice(i, a)), n = a;
353
358
  }
354
359
  return t.values();
355
360
  }
356
- function R(e) {
361
+ function z(e) {
357
362
  return e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e === 95;
358
363
  }
359
- function z(e, t, n) {
360
- let r = new X();
364
+ function B(e, t, n) {
365
+ let r = new Z();
361
366
  for (let i of t) for (let t of i ?? []) for (let i of [
362
367
  ...t.action.visible_if ?? [],
363
368
  ...t.action.enabled_if ?? [],
364
369
  ...t.action.conditions ?? []
365
370
  ]) {
366
371
  let t = w(e, i.field, { explicit: !0 });
367
- t && (r.add(t), n.addField(t, "condition"), q(e, t, n, "condition"));
372
+ t && (r.add(t), n.addField(t, "condition"), J(e, t, n, "condition"));
368
373
  }
369
374
  return r.values();
370
375
  }
371
- function B(e, n, r) {
372
- let i = typeof n == "string" ? t(n) : n ?? [], a = new X();
376
+ function V(e, n, r) {
377
+ let i = typeof n == "string" ? t(n) : n ?? [], a = new Z();
373
378
  for (let t of i) {
374
379
  let n = w(e, t.field, { explicit: !0 });
375
- n && (a.add(n), r.addField(n, "sort"), q(e, n, r, "sort"));
380
+ n && (a.add(n), r.addField(n, "sort"), J(e, n, r, "sort"));
376
381
  }
377
382
  return a.values();
378
383
  }
379
- function V(e, t, n, r) {
380
- let i = new X(), a = t?.variants?.items() ?? [];
384
+ function H(e, t, n, r) {
385
+ let i = new Z(), a = t?.variants?.items() ?? [];
381
386
  if (a.length === 0 || a.some((e) => e.quick_peek === void 0)) for (let r of _(e, t, n)) i.add(r);
382
387
  for (let r of a) {
383
388
  if (r.quick_peek === void 0) continue;
@@ -387,20 +392,20 @@ function V(e, t, n, r) {
387
392
  };
388
393
  for (let t of _(e, a, n)) i.add(t);
389
394
  }
390
- for (let t of i.values()) r.addField(t, "quick_peek"), q(e, t, r, "quick_peek");
395
+ for (let t of i.values()) r.addField(t, "quick_peek"), J(e, t, r, "quick_peek");
391
396
  return i.values();
392
397
  }
393
- function H(e, t, n) {
398
+ function U(e, t, n) {
394
399
  if (Array.isArray(e)) {
395
400
  for (let r of e) if (r && typeof r == "object") {
396
401
  if ("section" in r) {
397
- let e = r.section, i = W(e?.name);
398
- i && t.has(i) && U(e?.items, n);
399
- } else "fields" in r && U([r], n);
402
+ let e = r.section, i = G(e?.name);
403
+ i && t.has(i) && W(e?.items, n);
404
+ } else "fields" in r && W([r], n);
400
405
  }
401
406
  }
402
407
  }
403
- function U(e, t) {
408
+ function W(e, t) {
404
409
  if (Array.isArray(e)) {
405
410
  for (let n of e) if (n && typeof n == "object") {
406
411
  if ("fields" in n) {
@@ -413,11 +418,11 @@ function U(e, t) {
413
418
  }
414
419
  }
415
420
  }
416
- "section" in n && U(n.section?.items, t);
421
+ "section" in n && W(n.section?.items, t);
417
422
  }
418
423
  }
419
424
  }
420
- function W(e) {
425
+ function G(e) {
421
426
  if (typeof e == "string") return e;
422
427
  if (e && typeof e == "object") {
423
428
  let t = Object.values(e).find((e) => typeof e == "string");
@@ -425,7 +430,7 @@ function W(e) {
425
430
  }
426
431
  return "";
427
432
  }
428
- function G(e) {
433
+ function K(e) {
429
434
  let t = [];
430
435
  for (let [n, r] of e.fields) {
431
436
  if (r.primary || r.auto || r.ref || r.array || r.structure || r.display?.is_listable === !1) continue;
@@ -434,12 +439,12 @@ function G(e) {
434
439
  }
435
440
  return t;
436
441
  }
437
- function K(e, t, n, r) {
442
+ function q(e, t, n, r) {
438
443
  if (!t || t.startsWith("$")) return;
439
- let i = Y(e, t);
444
+ let i = X(e, t);
440
445
  i.kind !== "missing" && (n.add(t), i.kind === "file" && r.addField(t, "file_metadata"));
441
446
  }
442
- function q(e, t, n, r) {
447
+ function J(e, t, n, r) {
443
448
  if (t.startsWith("$status.")) {
444
449
  n.addExpand("statuses", "status_expand"), r !== "status_expand" && n.addExpand("statuses", r), r !== "status_expand" && n.addField(t, r);
445
450
  return;
@@ -454,14 +459,14 @@ function q(e, t, n, r) {
454
459
  n.addExpand("evidence", "evidence_expand"), r !== "evidence_expand" && n.addExpand("evidence", r), r !== "evidence_expand" && n.addField(t, r);
455
460
  return;
456
461
  }
457
- let i = Y(e, t);
462
+ let i = X(e, t);
458
463
  i.kind === "field" && i.field.type === "ref" && (n.addExpand("refs", "ref_expand"), r !== "ref_expand" && n.addExpand("refs", r));
459
464
  }
460
- function J(e) {
465
+ function Y(e) {
461
466
  let t = e.snapshot().expand, n = [];
462
467
  return t.refs && n.push("refs"), t.statuses && n.push("statuses"), t.properties && n.push("properties"), t.evidence && n.push("evidence"), n;
463
468
  }
464
- function Y(e, t) {
469
+ function X(e, t) {
465
470
  if (!e) return { kind: t.startsWith("$") ? "synthetic" : "missing" };
466
471
  if (t.startsWith("$status.")) return e.status_groups?.[t.slice(8)] ? { kind: "synthetic" } : { kind: "missing" };
467
472
  if (t.startsWith("$property.")) return e.properties?.[t.slice(10)] ? { kind: "synthetic" } : { kind: "missing" };
@@ -477,7 +482,7 @@ function Y(e, t) {
477
482
  file: r
478
483
  } : { kind: "missing" };
479
484
  }
480
- var X = class {
485
+ var Z = class {
481
486
  #e = [];
482
487
  #t = /* @__PURE__ */ new Set();
483
488
  add(e) {
@@ -489,7 +494,7 @@ var X = class {
489
494
  values() {
490
495
  return [...this.#e];
491
496
  }
492
- }, Z = class {
497
+ }, Q = class {
493
498
  #e = /* @__PURE__ */ new Map();
494
499
  #t = /* @__PURE__ */ new Map();
495
500
  addField(e, t) {
@@ -510,4 +515,4 @@ var X = class {
510
515
  }
511
516
  };
512
517
  //#endregion
513
- export { F as extractDisplayTemplateFields, f as resolveCard, p as resolveListProjection, _ as resolveQuickPeekFieldNames, g as resolveVariantRenderFields };
518
+ export { I as extractDisplayTemplateFields, f as resolveCard, p as resolveListProjection, _ as resolveQuickPeekFieldNames, g as resolveVariantRenderFields };
@@ -13,5 +13,15 @@ function r(n) {
13
13
  for (let n of r) i[e(n.id)] = n.getSize(), i[t(n.column.id)] = n.column.getSize();
14
14
  return i;
15
15
  }
16
+ function i(e) {
17
+ return e === "_select" ? {
18
+ position: "sticky",
19
+ left: 0
20
+ } : e === "_actions" ? {
21
+ position: "sticky",
22
+ right: 0,
23
+ boxShadow: "inset 1px 0 0 var(--divider)"
24
+ } : {};
25
+ }
16
26
  //#endregion
17
- export { r as buildColumnSizeVars, t as colSizeVar, e as headerSizeVar, n as sizeFromVar };
27
+ export { r as buildColumnSizeVars, t as colSizeVar, e as headerSizeVar, i as pinnedColumnStyle, n as sizeFromVar };
@@ -1,49 +1,13 @@
1
1
  import { coerceDisplayString as e } from "../../../lib/display-value.js";
2
- import { getPrimaryKeyFields as t, resolveRefRecordLabel as n } from "../../../types/schema.js";
3
- import { useText as r } from "../../../hooks/useText.js";
4
- import { listEntities as i } from "../../../api/data.js";
5
- import { flatFieldConditions as a } from "../../../lib/filters.js";
6
- import { useQueries as o } from "@tanstack/react-query";
2
+ import { useText as t } from "../../../hooks/useText.js";
3
+ import { flatFieldConditions as n } from "../../../lib/filters.js";
4
+ import { refLabel as r, useRefRecords as i } from "../../../hooks/useRefRecords.js";
7
5
  //#region src/components/pages/list/use-filter-value-labels.ts
8
- var s = 200;
9
- function c(t, a, c, u) {
10
- let d = r(), f = new Map(t.map((e) => [e.code, e])), p = l(f, a, c, u), m = o({ queries: p.map((e) => {
11
- let t = {
12
- per_page: s,
13
- filters: [{
14
- field: e.lookupField,
15
- op: "in",
16
- value: e.values
17
- }],
18
- count: "window"
19
- };
20
- return {
21
- queryKey: [
22
- "entity-data",
23
- e.entity,
24
- t
25
- ],
26
- queryFn: ({ signal: n }) => i(e.entity, t, { signal: n }),
27
- staleTime: 6e4
28
- };
29
- }) }), h = {};
30
- if (c) for (let [e, t] of Object.entries(c)) h[e] = { ...t };
31
- let g = /* @__PURE__ */ new Set();
32
- return m.forEach((t, n) => {
33
- let r = p[n];
34
- if (!r) return;
35
- let i = t.data?.data;
36
- if (i) {
37
- let t = h[r.entity] ??= {};
38
- for (let n of i) {
39
- let i = e(n[r.lookupField]);
40
- i && (t[i] = n);
41
- }
42
- }
43
- if (t.isLoading) for (let e of r.values) h[r.entity]?.[e] || g.add(`${r.entity}::${e}`);
44
- }), {
45
- labelFor: (t, r) => {
46
- let i = e(r), a = f.get(t);
6
+ function a(n, a, s, c) {
7
+ let l = t(), u = new Map(n.map((e) => [e.code, e])), { refs: d, isLoading: f } = i(o(u, a), s, c);
8
+ return {
9
+ labelFor: (t, n) => {
10
+ let i = e(n), a = u.get(t);
47
11
  if (!a) return {
48
12
  status: "plain",
49
13
  raw: i
@@ -51,7 +15,7 @@ function c(t, a, c, u) {
51
15
  let o = a.specialValues?.find((e) => e.code === i);
52
16
  if (o) return {
53
17
  status: "special",
54
- label: d(o.label) || i,
18
+ label: l(o.label) || i,
55
19
  raw: i
56
20
  };
57
21
  if (a.options) {
@@ -63,21 +27,17 @@ function c(t, a, c, u) {
63
27
  };
64
28
  }
65
29
  if (a.type === "ref" && a.ref?.entity) {
66
- let e = a.ref.entity, t = h[e]?.[i];
67
- if (t) {
68
- let r = a.ref.display?.field ?? u?.[e]?.display?.display_field;
69
- return {
70
- status: "resolved",
71
- label: n(d, t, r, i),
72
- raw: i
73
- };
74
- }
75
- return g.has(`${e}::${i}`) ? {
30
+ let e = r(l, d, a.ref, i, c);
31
+ return e === void 0 ? f(a.ref.entity, i) ? {
76
32
  status: "loading",
77
33
  raw: i
78
34
  } : {
79
35
  status: "unresolved",
80
36
  raw: i
37
+ } : {
38
+ status: "resolved",
39
+ label: e,
40
+ raw: i
81
41
  };
82
42
  }
83
43
  return {
@@ -85,31 +45,22 @@ function c(t, a, c, u) {
85
45
  raw: i
86
46
  };
87
47
  },
88
- refs: h
48
+ refs: d
89
49
  };
90
50
  }
91
- function l(n, r, i, o) {
92
- let s = /* @__PURE__ */ new Map();
93
- for (let c of a(r)) {
94
- if (!c.field) continue;
95
- let r = n.get(c.field);
96
- if (!r || r.type !== "ref" || !r.ref?.entity) continue;
97
- let a = r.ref.entity, l = o?.[a], u = r.ref.field || (l ? t(l)[0] : "id") || "id", d = Array.isArray(c.value) ? c.value : [c.value];
98
- for (let t of d) {
99
- let n = e(t);
100
- if (!n || r.specialValues?.some((e) => e.code === n) || i?.[a]?.[n]) continue;
101
- let o = `${a}::${u}`, c = s.get(o);
102
- c || (c = {
103
- key: o,
104
- entity: a,
105
- lookupField: u,
106
- values: []
107
- }, s.set(o, c)), c.values.includes(n) || c.values.push(n);
108
- }
51
+ function o(t, r) {
52
+ let i = [];
53
+ for (let a of n(r)) {
54
+ if (!a.field) continue;
55
+ let n = t.get(a.field);
56
+ if (!n || n.type !== "ref" || !n.ref?.entity) continue;
57
+ let r = Array.isArray(a.value) ? a.value : [a.value];
58
+ for (let t of r) n.specialValues?.some((n) => n.code === e(t)) || i.push({
59
+ ref: n.ref,
60
+ value: t
61
+ });
109
62
  }
110
- let c = [...s.values()];
111
- for (let e of c) e.values.sort();
112
- return c.sort((e, t) => e.key.localeCompare(t.key)), c;
63
+ return i;
113
64
  }
114
65
  //#endregion
115
- export { c as useFilterValueLabels };
66
+ export { a as useFilterValueLabels };