@declarion/react 0.81.0 → 0.83.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
@@ -1,27 +1,27 @@
1
- import { colSizeVar as e, sizeFromVar as t } from "./column-sizing.js";
2
- import { jsx as n } from "react/jsx-runtime";
1
+ import { colSizeVar as e, pinnedColumnStyle as t, sizeFromVar as n } from "./column-sizing.js";
2
+ import { jsx as r } from "react/jsx-runtime";
3
3
  //#region src/components/pages/list/DataCell.tsx
4
- function r({ cell: r }) {
5
- let i = r.column.id === "_select", a = r.column.id === "_actions", o = r.column.columnDef.cell, s = typeof o == "function" ? o(r.getContext()) : o;
6
- return /* @__PURE__ */ n("td", {
7
- title: typeof s == "string" ? s : void 0,
4
+ function i({ cell: i }) {
5
+ let a = i.column.id === "_select", o = i.column.id === "_actions", s = i.column.columnDef.cell, c = typeof s == "function" ? s(i.getContext()) : s;
6
+ return /* @__PURE__ */ r("td", {
7
+ title: typeof c == "string" ? c : void 0,
8
8
  style: {
9
- padding: i ? "0 6px 0 12px" : a ? "0 6px" : "0 10px",
9
+ padding: a ? "0 6px 0 12px" : o ? "0 6px" : "0 10px",
10
10
  verticalAlign: "middle",
11
11
  borderBottom: "1px solid var(--divider)",
12
- width: t(e(r.column.id)),
12
+ width: n(e(i.column.id)),
13
13
  whiteSpace: "nowrap",
14
14
  overflow: "hidden",
15
15
  textOverflow: "ellipsis",
16
- maxWidth: t(e(r.column.id)),
16
+ maxWidth: n(e(i.column.id)),
17
17
  color: "var(--text)",
18
- position: i ? "sticky" : "static",
19
- left: i ? 0 : "auto",
20
- zIndex: +!!i
18
+ position: "static",
19
+ ...t(i.column.id),
20
+ zIndex: a || o ? 1 : 0
21
21
  },
22
- onClick: i || a ? (e) => e.stopPropagation() : void 0,
23
- children: s
22
+ onClick: a || o ? (e) => e.stopPropagation() : void 0,
23
+ children: c
24
24
  });
25
25
  }
26
26
  //#endregion
27
- export { r as DataCell };
27
+ export { i as DataCell };
@@ -6,46 +6,48 @@ import { applyRowState as a, defaultFlatForSlot as o, filterLayoutForSlot as s }
6
6
  import { useActionRunner as c } from "../../actions/ActionRunner.js";
7
7
  import { dispatchAction as l } from "../../../lib/action-dispatch.js";
8
8
  import { ResponsiveActionBar as u } from "../../actions/ResponsiveActionBar.js";
9
- import { commonVariantActionCodes as d, effectiveScreenForRecord as f, resolveScreenVariantCode as p } from "../../../lib/variants.js";
10
- import { useMemo as m } from "react";
11
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
9
+ import { useRowTenant as d } from "../../../hooks/useRowTenant.js";
10
+ import { commonVariantActionCodes as f, effectiveScreenForRecord as p, resolveScreenVariantCode as m } from "../../../lib/variants.js";
11
+ import { useMemo as h } from "react";
12
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
13
  //#region src/components/pages/list/ListFloatbar.tsx
13
- var _ = "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}";
14
- function v({ selectedIds: v, floatbarActions: y, screenActionLayout: b, entityActionLayout: x, data: S, rowKey: C, entityCode: w, entity: T, screen: E, onClear: D, onActionSuccess: O, widgetContext: k }) {
15
- let A = n(), j = n("errors"), { run: M } = c(), N = m(() => {
14
+ var v = "@keyframes floatbarIn{from{transform:translateX(-50%) translateY(8px);opacity:0}to{transform:translateX(-50%) translateY(0);opacity:1}}";
15
+ function y({ selectedIds: y, floatbarActions: b, screenActionLayout: x, entityActionLayout: S, data: C, rowKey: w, entityCode: T, entity: E, screen: D, onClear: O, onActionSuccess: k, widgetContext: A }) {
16
+ let j = n(), M = d(E), N = n("errors"), { run: P } = c(), F = h(() => {
16
17
  let e = {};
17
- for (let { code: t, action: n } of y) e[t] = n;
18
+ for (let { code: t, action: n } of b) e[t] = n;
18
19
  return e;
19
- }, [y]), P = m(() => {
20
- if (v.length === 0) return [];
20
+ }, [b]), I = h(() => {
21
+ if (y.length === 0) return [];
21
22
  let e = /* @__PURE__ */ new Map();
22
- for (let t of S) e.set(C(t), t);
23
- return v.map((t) => e.get(t)).filter((e) => e !== void 0);
23
+ for (let t of C) e.set(w(t), t);
24
+ return y.map((t) => e.get(t)).filter((e) => e !== void 0);
24
25
  }, [
25
- v,
26
- S,
27
- C
28
- ]), F = m(() => {
29
- if (!T || !E || P.length === 0) return b;
30
- let e = P.map((e) => p(T, E, e));
31
- return e.some((t) => t !== e[0]) ? b : f(T, E, P[0])?.action_layout;
26
+ y,
27
+ C,
28
+ w
29
+ ]), L = h(() => {
30
+ if (!E || !D || I.length === 0) return x;
31
+ let e = I.map((e) => m(E, D, e));
32
+ return e.some((t) => t !== e[0]) ? x : p(E, D, I[0])?.action_layout;
32
33
  }, [
33
- T,
34
34
  E,
35
- P,
36
- b
37
- ]), I = m(() => s((F ?? x) || o(N, "list_floatbar"), N, void 0, "list_floatbar"), [
35
+ D,
36
+ I,
37
+ x
38
+ ]), R = h(() => s((L ?? S) || o(F, "list_floatbar"), F, void 0, "list_floatbar"), [
39
+ L,
40
+ S,
41
+ F
42
+ ]), z = h(() => a(j, R, F, void 0, {}, I, M, f(E, I)), [
43
+ j,
44
+ R,
38
45
  F,
39
- x,
40
- N
41
- ]), L = m(() => a(A, I, N, void 0, {}, P, d(T, P)), [
42
- A,
43
46
  I,
44
- N,
45
- P,
46
- T
47
+ E,
48
+ M
47
49
  ]);
48
- return L.length === 0 ? null : /* @__PURE__ */ g("div", {
50
+ return z.length === 0 ? null : /* @__PURE__ */ _("div", {
49
51
  style: {
50
52
  position: "fixed",
51
53
  left: "50%",
@@ -66,13 +68,13 @@ function v({ selectedIds: v, floatbarActions: y, screenActionLayout: b, entityAc
66
68
  animation: "floatbarIn .15s ease-out"
67
69
  },
68
70
  children: [
69
- /* @__PURE__ */ h("style", { children: _ }),
70
- /* @__PURE__ */ g("span", {
71
+ /* @__PURE__ */ g("style", { children: v }),
72
+ /* @__PURE__ */ _("span", {
71
73
  style: {
72
74
  fontSize: 12.5,
73
75
  fontWeight: 600
74
76
  },
75
- children: [/* @__PURE__ */ h("span", {
77
+ children: [/* @__PURE__ */ g("span", {
76
78
  style: {
77
79
  padding: "1px 7px",
78
80
  borderRadius: "var(--radius-sm)",
@@ -81,36 +83,36 @@ function v({ selectedIds: v, floatbarActions: y, screenActionLayout: b, entityAc
81
83
  marginRight: 6,
82
84
  fontSize: 11.5
83
85
  },
84
- children: v.length
85
- }), e(A, "list.selection.selected", v.length, {
86
+ children: y.length
87
+ }), e(j, "list.selection.selected", y.length, {
86
88
  one: "selected",
87
89
  other: "selected"
88
90
  })]
89
91
  }),
90
- /* @__PURE__ */ h(u, {
91
- layout: L,
92
+ /* @__PURE__ */ g(u, {
93
+ layout: z,
92
94
  kind: "toolbar",
93
- entityActions: N,
94
- rowSelection: P,
95
+ entityActions: F,
96
+ rowSelection: I,
95
97
  onRun: (e, t) => {
96
- let n = l(j, e, t, {}, w);
97
- if (n !== null) return M({
98
+ let n = l(N, e, t, {}, T);
99
+ if (n !== null) return P({
98
100
  action: t,
99
- title: A(t.display?.name) || e,
100
- bulkSelection: P,
101
- entity: w,
101
+ title: j(t.display?.name) || e,
102
+ bulkSelection: I,
103
+ entity: T,
102
104
  execute: async (e) => {
103
- let t = await i(n, r(e, v));
104
- return O(), t;
105
+ let t = await i(n, r(e, y));
106
+ return k(), t;
105
107
  }
106
108
  });
107
109
  },
108
- widgetContext: k,
109
- ariaLabel: A("list.selection.floatbar", "Floating action bar"),
110
+ widgetContext: A,
111
+ ariaLabel: j("list.selection.floatbar", "Floating action bar"),
110
112
  constrain: !1
111
113
  }),
112
- /* @__PURE__ */ h("button", {
113
- onClick: D,
114
+ /* @__PURE__ */ g("button", {
115
+ onClick: O,
114
116
  style: {
115
117
  background: "none",
116
118
  border: "none",
@@ -120,11 +122,11 @@ function v({ selectedIds: v, floatbarActions: y, screenActionLayout: b, entityAc
120
122
  padding: "4px 6px",
121
123
  borderRadius: "var(--radius-md)"
122
124
  },
123
- title: A("list.selection.clear", "Clear selection"),
124
- children: /* @__PURE__ */ h(t.x, { size: 14 })
125
+ title: j("list.selection.clear", "Clear selection"),
126
+ children: /* @__PURE__ */ g(t.x, { size: 14 })
125
127
  })
126
128
  ]
127
129
  });
128
130
  }
129
131
  //#endregion
130
- export { v as ListFloatbar };
132
+ export { y as ListFloatbar };
@@ -11,81 +11,83 @@ import { useBrandingChrome as m } from "../../../hooks/useBrandingChrome.js";
11
11
  import { useScreenBack as h } from "../../../hooks/useScreenBack.js";
12
12
  import { dispatchAction as g } from "../../../lib/action-dispatch.js";
13
13
  import { ResponsiveActionBar as _ } from "../../actions/ResponsiveActionBar.js";
14
- import { useMemo as v } from "react";
15
- import { jsx as y, jsxs as b } from "react/jsx-runtime";
14
+ import { useRowTenant as v } from "../../../hooks/useRowTenant.js";
15
+ import { useMemo as y } from "react";
16
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
16
17
  //#region src/components/pages/list/ListHeader.tsx
17
- function x({ title: x, description: S, toolbarActions: C, screenActionLayout: w, entityActionLayout: T, selectedIds: E, data: D, rowKey: O, onActionSuccess: k, widgetContext: A }) {
18
- let j = r(), M = r("errors"), { run: N } = p(), { isPhone: P } = i(), F = m("list"), I = F.isVisible("show_title"), L = F.isVisible("show_actions"), R = h(), z = v(() => {
18
+ function S({ title: S, description: C, toolbarActions: w, screenActionLayout: T, entityActionLayout: E, selectedIds: D, data: O, rowKey: k, onActionSuccess: A, widgetContext: j }) {
19
+ let M = r(), N = v(j.entity), P = r("errors"), { run: F } = p(), { isPhone: I } = i(), L = m("list"), R = L.isVisible("show_title"), z = L.isVisible("show_actions"), B = h(), V = y(() => {
19
20
  let e = {};
20
- for (let { code: t, action: n } of C) e[t] = n;
21
+ for (let { code: t, action: n } of w) e[t] = n;
21
22
  return e;
22
- }, [C]), B = v(() => f((w ?? T) || u(z, "list_toolbar"), z, void 0, "list_toolbar"), [
23
- w,
23
+ }, [w]), H = y(() => f((T ?? E) || u(V, "list_toolbar"), V, void 0, "list_toolbar"), [
24
24
  T,
25
- z
26
- ]), V = v(() => d(B, z, void 0, c, j("list.toolbar.select_rows_first", "Select one or more rows first")), [
27
- j,
28
- B,
29
- z
30
- ]), H = v(() => {
31
- if (E.length === 0) return [];
25
+ E,
26
+ V
27
+ ]), U = y(() => d(H, V, void 0, c, M("list.toolbar.select_rows_first", "Select one or more rows first")), [
28
+ M,
29
+ H,
30
+ V
31
+ ]), W = y(() => {
32
+ if (D.length === 0) return [];
32
33
  let e = /* @__PURE__ */ new Map();
33
- for (let t of D) e.set(O(t), t);
34
- return E.map((t) => e.get(t)).filter((e) => e !== void 0);
34
+ for (let t of O) e.set(k(t), t);
35
+ return D.map((t) => e.get(t)).filter((e) => e !== void 0);
35
36
  }, [
36
- E,
37
37
  D,
38
- O
39
- ]), U = v(() => l(j, B, z, void 0, {}, H), [
40
- j,
41
- B,
42
- z,
43
- H
44
- ]), W = E.length > 0 ? U : V, G = (e, t) => {
45
- let n = g(M, e, t, {});
38
+ O,
39
+ k
40
+ ]), G = y(() => l(M, H, V, void 0, {}, W, N), [
41
+ M,
42
+ H,
43
+ V,
44
+ W,
45
+ N
46
+ ]), K = D.length > 0 ? G : U, q = (e, t) => {
47
+ let n = g(P, e, t, {});
46
48
  if (n === null) return;
47
- let r = j(t.display?.name) || e;
48
- return N({
49
+ let r = M(t.display?.name) || e;
50
+ return F({
49
51
  action: t,
50
52
  title: r,
51
- bulkSelection: H.length > 0 ? H : void 0,
53
+ bulkSelection: W.length > 0 ? W : void 0,
52
54
  execute: async (e) => {
53
- let t = E.length > 0 ? E : void 0, r = await o(n, a(e, t));
54
- return t && t.length > 0 && k(), r;
55
+ let t = D.length > 0 ? D : void 0, r = await o(n, a(e, t));
56
+ return t && t.length > 0 && A(), r;
55
57
  }
56
58
  });
57
59
  };
58
- return !I && !L ? null : /* @__PURE__ */ b("div", {
60
+ return !R && !z ? null : /* @__PURE__ */ x("div", {
59
61
  style: {
60
62
  display: "flex",
61
63
  alignItems: "center",
62
64
  gap: 8,
63
- flexWrap: P ? "wrap" : "nowrap",
64
- paddingTop: P ? 12 : 16,
65
+ flexWrap: I ? "wrap" : "nowrap",
66
+ paddingTop: I ? 12 : 16,
65
67
  paddingBottom: 10,
66
- ...P ? s(12) : {
68
+ ...I ? s(12) : {
67
69
  paddingLeft: 20,
68
70
  paddingRight: 20
69
71
  }
70
72
  },
71
73
  children: [
72
- I && R.hasOriginBack && /* @__PURE__ */ y(t, {
73
- icon: /* @__PURE__ */ y(e.back, { size: 14 }),
74
- title: j("list.header.back", "Back"),
75
- onClick: R.goBack
74
+ R && B.hasOriginBack && /* @__PURE__ */ b(t, {
75
+ icon: /* @__PURE__ */ b(e.back, { size: 14 }),
76
+ title: M("list.header.back", "Back"),
77
+ onClick: B.goBack
76
78
  }),
77
- I && /* @__PURE__ */ y("div", {
79
+ R && /* @__PURE__ */ b("div", {
78
80
  style: {
79
- flex: P ? "1 1 100%" : "1 1 auto",
81
+ flex: I ? "1 1 100%" : "1 1 auto",
80
82
  minWidth: 0
81
83
  },
82
- children: /* @__PURE__ */ b("div", {
84
+ children: /* @__PURE__ */ x("div", {
83
85
  style: {
84
86
  display: "flex",
85
87
  alignItems: "baseline",
86
88
  gap: 10
87
89
  },
88
- children: [/* @__PURE__ */ y("h1", {
90
+ children: [/* @__PURE__ */ b("h1", {
89
91
  style: {
90
92
  margin: 0,
91
93
  minWidth: 0,
@@ -98,23 +100,23 @@ function x({ title: x, description: S, toolbarActions: C, screenActionLayout: w,
98
100
  letterSpacing: "-0.012em",
99
101
  color: "var(--text)"
100
102
  },
101
- children: x
102
- }), S && /* @__PURE__ */ y(n, {
103
- label: S,
103
+ children: S
104
+ }), C && /* @__PURE__ */ b(n, {
105
+ label: C,
104
106
  "data-testid": "list-description-info"
105
107
  })]
106
108
  })
107
109
  }),
108
- L && W.length > 0 && /* @__PURE__ */ y(_, {
109
- layout: W,
110
+ z && K.length > 0 && /* @__PURE__ */ b(_, {
111
+ layout: K,
110
112
  kind: "toolbar",
111
- entityActions: z,
112
- onRun: G,
113
- widgetContext: A,
114
- ariaLabel: j("list.toolbar.actions", "List toolbar actions")
113
+ entityActions: V,
114
+ onRun: q,
115
+ widgetContext: j,
116
+ ariaLabel: M("list.toolbar.actions", "List toolbar actions")
115
117
  })
116
118
  ]
117
119
  });
118
120
  }
119
121
  //#endregion
120
- export { x as ListHeader };
122
+ export { S as ListHeader };
@@ -1,101 +1,101 @@
1
1
  import { Icon as e } from "../../primitives/Icons.js";
2
2
  import { useText as t } from "../../../hooks/useText.js";
3
- import { headerSizeVar as n, sizeFromVar as r } from "./column-sizing.js";
4
- import { isHeaderSortable as i } from "./sortable-header.js";
5
- import { Suspense as a, lazy as o, memo as s } from "react";
6
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
7
- import { flexRender as u } from "@tanstack/react-table";
3
+ import { headerSizeVar as n, pinnedColumnStyle as r, sizeFromVar as i } from "./column-sizing.js";
4
+ import { isHeaderSortable as a } from "./sortable-header.js";
5
+ import { Suspense as o, lazy as s, memo as c } from "react";
6
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
7
+ import { flexRender as d } from "@tanstack/react-table";
8
8
  //#region src/components/pages/list/ListTable.tsx
9
- var d = o(() => import("./SortHeaderMenu.js").then((e) => ({ default: e.SortHeaderMenu }))), f = s(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a, showsPreviousRows: o }) {
10
- return /* @__PURE__ */ l("tbody", {
9
+ var f = s(() => import("./SortHeaderMenu.js").then((e) => ({ default: e.SortHeaderMenu }))), p = c(function({ virtualItems: e, topPad: t, bottomPad: n, colSpan: r, rows: i, renderRow: a, showsPreviousRows: o }) {
10
+ return /* @__PURE__ */ u("tbody", {
11
11
  style: o ? {
12
12
  opacity: .45,
13
13
  transition: "opacity 120ms"
14
14
  } : void 0,
15
15
  children: [
16
- e.length > 0 && /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
16
+ e.length > 0 && /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
17
17
  style: { height: t },
18
18
  colSpan: r
19
19
  }) }),
20
20
  e.map((e) => a(i[e.index], e.index)),
21
- e.length > 0 && /* @__PURE__ */ c("tr", { children: /* @__PURE__ */ c("td", {
21
+ e.length > 0 && /* @__PURE__ */ l("tr", { children: /* @__PURE__ */ l("td", {
22
22
  style: { height: n },
23
23
  colSpan: r
24
24
  }) })
25
25
  ]
26
26
  });
27
27
  }, (e, t) => t.isResizing);
28
- function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalColumnsWidth: g, theadRef: _, virtualizer: v, visibleCols: y, headerReorder: b, sortCols: x, sortNullsMap: S, shiftClickColumn: C, applyColumnSort: w, appendColumnSort: T, clearColumnSort: E, clearAllSorts: D, renderRow: O, isResizingColumn: k, showsPreviousRows: A }) {
29
- let j = t();
30
- return /* @__PURE__ */ l("table", {
28
+ function m({ table: s, columns: c, rows: m, entity: h, columnSizeVars: g, totalColumnsWidth: _, theadRef: v, virtualizer: y, visibleCols: b, headerReorder: x, sortCols: S, sortNullsMap: C, shiftClickColumn: w, applyColumnSort: T, appendColumnSort: E, clearColumnSort: D, clearAllSorts: O, renderRow: k, isResizingColumn: A, showsPreviousRows: j }) {
29
+ let M = t();
30
+ return /* @__PURE__ */ u("table", {
31
31
  "data-virtual-rows": "true",
32
- "aria-busy": A || void 0,
32
+ "aria-busy": j || void 0,
33
33
  style: {
34
- ...h,
34
+ ...g,
35
35
  tableLayout: "fixed",
36
36
  width: "100%",
37
- minWidth: g,
37
+ minWidth: _,
38
38
  borderCollapse: "separate",
39
39
  borderSpacing: 0,
40
40
  fontSize: 12.5,
41
41
  color: "var(--text)"
42
42
  },
43
- children: [/* @__PURE__ */ c("thead", {
44
- ref: _,
45
- children: o.getHeaderGroups().map((t) => /* @__PURE__ */ l("tr", {
43
+ children: [/* @__PURE__ */ l("thead", {
44
+ ref: v,
45
+ children: s.getHeaderGroups().map((t) => /* @__PURE__ */ u("tr", {
46
46
  style: {
47
47
  height: 32,
48
48
  background: "var(--surface-2)"
49
49
  },
50
50
  children: [t.headers.map((t) => {
51
- let o = i(t.id, m), s = t.column.getIsSorted(), f = t.id === "_select", p = t.id === "_actions", h = s ? x.findIndex((e) => e.field === t.id) + 1 : 0, g = x.length > 1 && h > 0, _ = h > 0, v = x.length < 5, O = o ? t.column.getToggleSortingHandler() : void 0, k = o ? (e) => {
52
- e.shiftKey ? (e.preventDefault(), C(t.id)) : O?.(e);
53
- } : void 0, A = !f && !p, M = A ? y.indexOf(t.id) : -1, N = b.dragColId === t.id, P = b.isDragging && M !== -1 && b.dropIndex === M, F = b.isDragging && M !== -1 && M === y.length - 1 && b.dropIndex === y.length;
54
- return /* @__PURE__ */ l("th", {
55
- "data-col-id": A ? t.id : void 0,
56
- onMouseDown: A ? (e) => b.onHeaderMouseDown(t.id, e) : void 0,
51
+ let s = a(t.id, h), c = t.column.getIsSorted(), p = t.id === "_select", m = t.id === "_actions", g = c ? S.findIndex((e) => e.field === t.id) + 1 : 0, _ = S.length > 1 && g > 0, v = g > 0, y = S.length < 5, k = s ? t.column.getToggleSortingHandler() : void 0, A = s ? (e) => {
52
+ e.shiftKey ? (e.preventDefault(), w(t.id)) : k?.(e);
53
+ } : void 0, j = !p && !m, N = j ? b.indexOf(t.id) : -1, P = x.dragColId === t.id, F = x.isDragging && N !== -1 && x.dropIndex === N, I = x.isDragging && N !== -1 && N === b.length - 1 && x.dropIndex === b.length;
54
+ return /* @__PURE__ */ u("th", {
55
+ "data-col-id": j ? t.id : void 0,
56
+ onMouseDown: j ? (e) => x.onHeaderMouseDown(t.id, e) : void 0,
57
57
  onClick: (e) => {
58
- b.consumeDragSuppression() || k?.(e);
58
+ x.consumeDragSuppression() || A?.(e);
59
59
  },
60
60
  style: {
61
- padding: f ? "0 6px 0 12px" : p ? "0 6px" : "0 10px",
61
+ padding: p ? "0 6px 0 12px" : m ? "0 6px" : "0 10px",
62
62
  textAlign: "left",
63
63
  fontWeight: 600,
64
64
  fontSize: 11,
65
65
  letterSpacing: "0.01em",
66
66
  color: "var(--text-3)",
67
67
  whiteSpace: "nowrap",
68
- cursor: o ? "pointer" : "default",
69
- opacity: N ? .4 : 1,
70
- boxShadow: P ? "inset 2px 0 0 0 var(--accent)" : F ? "inset -2px 0 0 0 var(--accent)" : void 0,
71
- width: r(n(t.id)),
72
- minWidth: r(n(t.id)),
68
+ cursor: s ? "pointer" : "default",
69
+ opacity: P ? .4 : 1,
70
+ boxShadow: F ? "inset 2px 0 0 0 var(--accent)" : I ? "inset -2px 0 0 0 var(--accent)" : void 0,
71
+ width: i(n(t.id)),
72
+ minWidth: i(n(t.id)),
73
73
  borderBottom: "1px solid var(--border)",
74
74
  background: "var(--surface-2)",
75
+ ...r(t.id),
75
76
  position: "sticky",
76
77
  top: 0,
77
- left: f ? 0 : "auto",
78
- zIndex: f ? 3 : 2
78
+ zIndex: p || m ? 3 : 2
79
79
  },
80
- children: [t.isPlaceholder ? null : o ? /* @__PURE__ */ l("span", {
80
+ children: [t.isPlaceholder ? null : s ? /* @__PURE__ */ u("span", {
81
81
  style: {
82
82
  display: "inline-flex",
83
83
  alignItems: "center",
84
84
  gap: 4
85
85
  },
86
86
  children: [
87
- u(t.column.columnDef.header, t.getContext()),
88
- /* @__PURE__ */ l("span", {
87
+ d(t.column.columnDef.header, t.getContext()),
88
+ /* @__PURE__ */ u("span", {
89
89
  style: {
90
90
  display: "inline-flex",
91
91
  flexDirection: "column",
92
92
  alignItems: "center",
93
93
  lineHeight: 0
94
94
  },
95
- children: [s === "asc" ? /* @__PURE__ */ c(e.arrowUp, { size: 11 }) : s === "desc" ? /* @__PURE__ */ c(e.arrowDown, { size: 11 }) : /* @__PURE__ */ c(e.sort, {
95
+ children: [c === "asc" ? /* @__PURE__ */ l(e.arrowUp, { size: 11 }) : c === "desc" ? /* @__PURE__ */ l(e.arrowDown, { size: 11 }) : /* @__PURE__ */ l(e.sort, {
96
96
  size: 11,
97
97
  style: { opacity: .35 }
98
- }), s && S.get(t.id) === "first" ? /* @__PURE__ */ c("span", {
98
+ }), c && C.get(t.id) === "first" ? /* @__PURE__ */ l("span", {
99
99
  "aria-hidden": "true",
100
100
  style: {
101
101
  width: 4,
@@ -106,8 +106,8 @@ function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalC
106
106
  }
107
107
  }) : null]
108
108
  }),
109
- g ? /* @__PURE__ */ c("span", {
110
- "aria-label": j("list.sort.rank", "Sort rank {rank}", { rank: h }),
109
+ _ ? /* @__PURE__ */ l("span", {
110
+ "aria-label": M("list.sort.rank", "Sort rank {rank}", { rank: g }),
111
111
  style: {
112
112
  fontSize: 10,
113
113
  lineHeight: 1,
@@ -115,24 +115,24 @@ function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalC
115
115
  verticalAlign: "super",
116
116
  fontVariantNumeric: "tabular-nums"
117
117
  },
118
- children: h
118
+ children: g
119
119
  }) : null,
120
- /* @__PURE__ */ c(a, {
120
+ /* @__PURE__ */ l(o, {
121
121
  fallback: null,
122
- children: /* @__PURE__ */ c(d, {
122
+ children: /* @__PURE__ */ l(f, {
123
123
  field: t.id,
124
- activeDir: s,
125
- activeNulls: S.get(t.id),
126
- inMultiSort: _,
127
- canAppend: v,
128
- onApply: (e, n) => w(t.id, e, n),
129
- onAppend: (e, n) => T(t.id, e, n),
130
- onClearColumn: () => E(t.id),
131
- onClearAll: D
124
+ activeDir: c,
125
+ activeNulls: C.get(t.id),
126
+ inMultiSort: v,
127
+ canAppend: y,
128
+ onApply: (e, n) => T(t.id, e, n),
129
+ onAppend: (e, n) => E(t.id, e, n),
130
+ onClearColumn: () => D(t.id),
131
+ onClearAll: O
132
132
  })
133
133
  })
134
134
  ]
135
- }) : u(t.column.columnDef.header, t.getContext()), t.column.getCanResize() && /* @__PURE__ */ c("div", {
135
+ }) : d(t.column.columnDef.header, t.getContext()), t.column.getCanResize() && /* @__PURE__ */ l("div", {
136
136
  "data-testid": "col-resize-handle",
137
137
  "aria-hidden": "true",
138
138
  onMouseDown: (e) => {
@@ -155,7 +155,7 @@ function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalC
155
155
  userSelect: "none",
156
156
  zIndex: 3
157
157
  },
158
- children: /* @__PURE__ */ c("span", { style: {
158
+ children: /* @__PURE__ */ l("span", { style: {
159
159
  width: 2,
160
160
  height: "60%",
161
161
  alignSelf: "center",
@@ -164,7 +164,7 @@ function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalC
164
164
  } })
165
165
  })]
166
166
  }, t.id);
167
- }), /* @__PURE__ */ c("th", {
167
+ }), /* @__PURE__ */ l("th", {
168
168
  "aria-hidden": "true",
169
169
  style: {
170
170
  borderBottom: "1px solid var(--border)",
@@ -175,17 +175,17 @@ function p({ table: o, columns: s, rows: p, entity: m, columnSizeVars: h, totalC
175
175
  }
176
176
  })]
177
177
  }, t.id))
178
- }), /* @__PURE__ */ c(f, {
179
- virtualItems: v.getVirtualItems(),
180
- topPad: v.getVirtualItems()[0]?.start ?? 0,
181
- bottomPad: v.getTotalSize() - (v.getVirtualItems().at(-1)?.end ?? 0),
182
- colSpan: s.length + 1,
183
- rows: p,
184
- renderRow: O,
185
- isResizing: !!k,
186
- showsPreviousRows: A
178
+ }), /* @__PURE__ */ l(p, {
179
+ virtualItems: y.getVirtualItems(),
180
+ topPad: y.getVirtualItems()[0]?.start ?? 0,
181
+ bottomPad: y.getTotalSize() - (y.getVirtualItems().at(-1)?.end ?? 0),
182
+ colSpan: c.length + 1,
183
+ rows: m,
184
+ renderRow: k,
185
+ isResizing: !!A,
186
+ showsPreviousRows: j
187
187
  })]
188
188
  });
189
189
  }
190
190
  //#endregion
191
- export { p as ListTable };
191
+ export { m as ListTable };