@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.
- package/dist-lib/components/actions/ObjectActionBar.js +56 -54
- package/dist-lib/components/actions/PropertyGridEditor.js +56 -53
- package/dist-lib/components/actions/RowActionsKebab.js +51 -49
- package/dist-lib/components/detail-layout/AssociatedBlock.js +385 -383
- package/dist-lib/components/list/QuickPeek.js +77 -75
- package/dist-lib/components/pages/SmartDetailPage.impl.js +484 -458
- package/dist-lib/components/pages/SmartRecordListPage.impl.js +207 -206
- package/dist-lib/components/pages/list/DataCell.js +15 -15
- package/dist-lib/components/pages/list/ListFloatbar.js +55 -53
- package/dist-lib/components/pages/list/ListHeader.js +54 -52
- package/dist-lib/components/pages/list/ListTable.js +64 -64
- package/dist-lib/components/pages/list/cardProjection.js +85 -80
- package/dist-lib/components/pages/list/column-sizing.js +11 -1
- package/dist-lib/components/pages/list/use-filter-value-labels.js +29 -78
- package/dist-lib/components/pages/list/useListRowInteraction.js +78 -76
- package/dist-lib/components/pages/list/useRowMenu.js +60 -58
- package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +341 -262
- package/dist-lib/components/params/ParamsBlock.js +59 -59
- package/dist-lib/components/params/param-editors.js +114 -99
- package/dist-lib/components/shared/ConfirmDialog.js +33 -66
- package/dist-lib/components/shared/ModalFrame.js +53 -0
- package/dist-lib/hooks/useRefRecords.js +73 -0
- package/dist-lib/hooks/useRowTenant.js +12 -0
- package/dist-lib/index.d.ts +4 -3
- package/dist-lib/lib/actions.js +105 -89
- package/dist-lib/lib/mass-edit.js +13 -13
- package/dist-lib/types/schema.js +29 -22
- package/package.json +1 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import { colSizeVar as e,
|
|
2
|
-
import { jsx as
|
|
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
|
|
5
|
-
let
|
|
6
|
-
return /* @__PURE__ */
|
|
7
|
-
title: typeof
|
|
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:
|
|
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:
|
|
12
|
+
width: n(e(i.column.id)),
|
|
13
13
|
whiteSpace: "nowrap",
|
|
14
14
|
overflow: "hidden",
|
|
15
15
|
textOverflow: "ellipsis",
|
|
16
|
-
maxWidth:
|
|
16
|
+
maxWidth: n(e(i.column.id)),
|
|
17
17
|
color: "var(--text)",
|
|
18
|
-
position:
|
|
19
|
-
|
|
20
|
-
zIndex:
|
|
18
|
+
position: "static",
|
|
19
|
+
...t(i.column.id),
|
|
20
|
+
zIndex: a || o ? 1 : 0
|
|
21
21
|
},
|
|
22
|
-
onClick:
|
|
23
|
-
children:
|
|
22
|
+
onClick: a || o ? (e) => e.stopPropagation() : void 0,
|
|
23
|
+
children: c
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
27
|
-
export {
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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
|
|
14
|
-
function
|
|
15
|
-
let
|
|
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
|
|
18
|
+
for (let { code: t, action: n } of b) e[t] = n;
|
|
18
19
|
return e;
|
|
19
|
-
}, [
|
|
20
|
-
if (
|
|
20
|
+
}, [b]), I = h(() => {
|
|
21
|
+
if (y.length === 0) return [];
|
|
21
22
|
let e = /* @__PURE__ */ new Map();
|
|
22
|
-
for (let t of
|
|
23
|
-
return
|
|
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
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
]),
|
|
29
|
-
if (!
|
|
30
|
-
let e =
|
|
31
|
-
return e.some((t) => t !== e[0]) ?
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
-
|
|
45
|
-
|
|
46
|
-
T
|
|
47
|
+
E,
|
|
48
|
+
M
|
|
47
49
|
]);
|
|
48
|
-
return
|
|
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__ */
|
|
70
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
85
|
-
}), e(
|
|
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__ */
|
|
91
|
-
layout:
|
|
92
|
+
/* @__PURE__ */ g(u, {
|
|
93
|
+
layout: z,
|
|
92
94
|
kind: "toolbar",
|
|
93
|
-
entityActions:
|
|
94
|
-
rowSelection:
|
|
95
|
+
entityActions: F,
|
|
96
|
+
rowSelection: I,
|
|
95
97
|
onRun: (e, t) => {
|
|
96
|
-
let n = l(
|
|
97
|
-
if (n !== null) return
|
|
98
|
+
let n = l(N, e, t, {}, T);
|
|
99
|
+
if (n !== null) return P({
|
|
98
100
|
action: t,
|
|
99
|
-
title:
|
|
100
|
-
bulkSelection:
|
|
101
|
-
entity:
|
|
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,
|
|
104
|
-
return
|
|
105
|
+
let t = await i(n, r(e, y));
|
|
106
|
+
return k(), t;
|
|
105
107
|
}
|
|
106
108
|
});
|
|
107
109
|
},
|
|
108
|
-
widgetContext:
|
|
109
|
-
ariaLabel:
|
|
110
|
+
widgetContext: A,
|
|
111
|
+
ariaLabel: j("list.selection.floatbar", "Floating action bar"),
|
|
110
112
|
constrain: !1
|
|
111
113
|
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
onClick:
|
|
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:
|
|
124
|
-
children: /* @__PURE__ */
|
|
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 {
|
|
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 {
|
|
15
|
-
import {
|
|
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
|
|
18
|
-
let
|
|
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
|
|
21
|
+
for (let { code: t, action: n } of w) e[t] = n;
|
|
21
22
|
return e;
|
|
22
|
-
}, [
|
|
23
|
-
w,
|
|
23
|
+
}, [w]), H = y(() => f((T ?? E) || u(V, "list_toolbar"), V, void 0, "list_toolbar"), [
|
|
24
24
|
T,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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
|
|
34
|
-
return
|
|
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
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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 =
|
|
48
|
-
return
|
|
49
|
+
let r = M(t.display?.name) || e;
|
|
50
|
+
return F({
|
|
49
51
|
action: t,
|
|
50
52
|
title: r,
|
|
51
|
-
bulkSelection:
|
|
53
|
+
bulkSelection: W.length > 0 ? W : void 0,
|
|
52
54
|
execute: async (e) => {
|
|
53
|
-
let t =
|
|
54
|
-
return t && t.length > 0 &&
|
|
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 !
|
|
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:
|
|
64
|
-
paddingTop:
|
|
65
|
+
flexWrap: I ? "wrap" : "nowrap",
|
|
66
|
+
paddingTop: I ? 12 : 16,
|
|
65
67
|
paddingBottom: 10,
|
|
66
|
-
...
|
|
68
|
+
...I ? s(12) : {
|
|
67
69
|
paddingLeft: 20,
|
|
68
70
|
paddingRight: 20
|
|
69
71
|
}
|
|
70
72
|
},
|
|
71
73
|
children: [
|
|
72
|
-
|
|
73
|
-
icon: /* @__PURE__ */
|
|
74
|
-
title:
|
|
75
|
-
onClick:
|
|
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
|
-
|
|
79
|
+
R && /* @__PURE__ */ b("div", {
|
|
78
80
|
style: {
|
|
79
|
-
flex:
|
|
81
|
+
flex: I ? "1 1 100%" : "1 1 auto",
|
|
80
82
|
minWidth: 0
|
|
81
83
|
},
|
|
82
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
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:
|
|
102
|
-
}),
|
|
103
|
-
label:
|
|
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
|
-
|
|
109
|
-
layout:
|
|
110
|
+
z && K.length > 0 && /* @__PURE__ */ b(_, {
|
|
111
|
+
layout: K,
|
|
110
112
|
kind: "toolbar",
|
|
111
|
-
entityActions:
|
|
112
|
-
onRun:
|
|
113
|
-
widgetContext:
|
|
114
|
-
ariaLabel:
|
|
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 {
|
|
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,
|
|
4
|
-
import { isHeaderSortable as
|
|
5
|
-
import { Suspense as
|
|
6
|
-
import { jsx as
|
|
7
|
-
import { flexRender as
|
|
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
|
|
10
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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
|
|
29
|
-
let
|
|
30
|
-
return /* @__PURE__ */
|
|
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":
|
|
32
|
+
"aria-busy": j || void 0,
|
|
33
33
|
style: {
|
|
34
|
-
...
|
|
34
|
+
...g,
|
|
35
35
|
tableLayout: "fixed",
|
|
36
36
|
width: "100%",
|
|
37
|
-
minWidth:
|
|
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__ */
|
|
44
|
-
ref:
|
|
45
|
-
children:
|
|
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
|
|
52
|
-
e.shiftKey ? (e.preventDefault(),
|
|
53
|
-
} : void 0,
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
"data-col-id":
|
|
56
|
-
onMouseDown:
|
|
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
|
-
|
|
58
|
+
x.consumeDragSuppression() || A?.(e);
|
|
59
59
|
},
|
|
60
60
|
style: {
|
|
61
|
-
padding:
|
|
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:
|
|
69
|
-
opacity:
|
|
70
|
-
boxShadow:
|
|
71
|
-
width:
|
|
72
|
-
minWidth:
|
|
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
|
-
|
|
78
|
-
zIndex: f ? 3 : 2
|
|
78
|
+
zIndex: p || m ? 3 : 2
|
|
79
79
|
},
|
|
80
|
-
children: [t.isPlaceholder ? null :
|
|
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
|
-
|
|
88
|
-
/* @__PURE__ */
|
|
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: [
|
|
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
|
-
}),
|
|
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
|
-
|
|
110
|
-
"aria-label":
|
|
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:
|
|
118
|
+
children: g
|
|
119
119
|
}) : null,
|
|
120
|
-
/* @__PURE__ */
|
|
120
|
+
/* @__PURE__ */ l(o, {
|
|
121
121
|
fallback: null,
|
|
122
|
-
children: /* @__PURE__ */
|
|
122
|
+
children: /* @__PURE__ */ l(f, {
|
|
123
123
|
field: t.id,
|
|
124
|
-
activeDir:
|
|
125
|
-
activeNulls:
|
|
126
|
-
inMultiSort:
|
|
127
|
-
canAppend:
|
|
128
|
-
onApply: (e, n) =>
|
|
129
|
-
onAppend: (e, n) =>
|
|
130
|
-
onClearColumn: () =>
|
|
131
|
-
onClearAll:
|
|
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
|
-
}) :
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
179
|
-
virtualItems:
|
|
180
|
-
topPad:
|
|
181
|
-
bottomPad:
|
|
182
|
-
colSpan:
|
|
183
|
-
rows:
|
|
184
|
-
renderRow:
|
|
185
|
-
isResizing: !!
|
|
186
|
-
showsPreviousRows:
|
|
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 {
|
|
191
|
+
export { m as ListTable };
|