@box/metadata-view 1.5.2 → 1.6.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/chunks/index.js
CHANGED
|
@@ -47,7 +47,12 @@ import '../styles/index.css';const k = "_tableHeaderActionsWrapper_1a999_1", U =
|
|
|
47
47
|
subtitle: S,
|
|
48
48
|
textValue: A,
|
|
49
49
|
type: H
|
|
50
|
-
} = c, i = `${A}-${l.id}
|
|
50
|
+
} = c, i = `${A}-${l.id}`;
|
|
51
|
+
if (d)
|
|
52
|
+
return /* @__PURE__ */ e(n, {
|
|
53
|
+
children: d(l, c)
|
|
54
|
+
}, i);
|
|
55
|
+
const L = f ? s.split(".")[1] : s, m = I(l, L);
|
|
51
56
|
if (s === "name" && (a === o.INLINE || a === o.INLINE_SUBTITLE))
|
|
52
57
|
return /* @__PURE__ */ e(n, {
|
|
53
58
|
children: /* @__PURE__ */ b("div", {
|
|
@@ -71,10 +76,6 @@ import '../styles/index.css';const k = "_tableHeaderActionsWrapper_1a999_1", U =
|
|
|
71
76
|
})]
|
|
72
77
|
})
|
|
73
78
|
}, i);
|
|
74
|
-
if (d)
|
|
75
|
-
return /* @__PURE__ */ e(n, {
|
|
76
|
-
children: d(l, c)
|
|
77
|
-
}, i);
|
|
78
79
|
if (H === "multiSelect") {
|
|
79
80
|
const N = I(l, s);
|
|
80
81
|
return /* @__PURE__ */ e(n, {
|
|
@@ -6,39 +6,39 @@ import I from "react";
|
|
|
6
6
|
import { I as N } from "../../../../../chunks/types.js";
|
|
7
7
|
import { THUMBNAIL_LIST_VIEW_HEIGHTS as w } from "../../constants.js";
|
|
8
8
|
import { s as i, T as B } from "../../../../../chunks/index.js";
|
|
9
|
-
import { jsx as
|
|
9
|
+
import { jsx as r, jsxs as T } from "react/jsx-runtime";
|
|
10
10
|
import { InlineEditingCell as _ } from "./inline-editing-cell/inline-editing-cell.js";
|
|
11
11
|
import { ItemActionMenu as M } from "../../item-action-menu/item-action-menu.js";
|
|
12
12
|
import { GhostTableRow as U } from "./ghost-table-row/ghost-table-row.js";
|
|
13
|
-
const E = (e, t,
|
|
14
|
-
const n =
|
|
13
|
+
const E = (e, t, l) => {
|
|
14
|
+
const n = l ? t.split(".")[1] : t;
|
|
15
15
|
return x(e, n);
|
|
16
|
-
},
|
|
16
|
+
}, k = /* @__PURE__ */ I.memo(({
|
|
17
17
|
column: e,
|
|
18
18
|
iconColumnVariant: t,
|
|
19
|
-
item:
|
|
19
|
+
item: l
|
|
20
20
|
}) => {
|
|
21
21
|
const {
|
|
22
22
|
id: n,
|
|
23
23
|
isItemMetadata: a,
|
|
24
24
|
subtitle: s,
|
|
25
25
|
textValue: m
|
|
26
|
-
} = e, d = `${m}-${
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
} = e, d = `${m}-${l.id}`;
|
|
27
|
+
return /* @__PURE__ */ r(h, {
|
|
28
28
|
children: /* @__PURE__ */ T("div", {
|
|
29
29
|
className: i.tableNameCell,
|
|
30
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ r(b, {
|
|
31
31
|
className: i.tableNameCellIconInline,
|
|
32
|
-
item:
|
|
32
|
+
item: l
|
|
33
33
|
}), /* @__PURE__ */ T("div", {
|
|
34
34
|
className: R(i.tableNameCellTitle, {
|
|
35
35
|
[i.hasSubtitle]: t === N.INLINE_SUBTITLE
|
|
36
36
|
}),
|
|
37
|
-
children: [/* @__PURE__ */
|
|
37
|
+
children: [/* @__PURE__ */ r(u, {
|
|
38
38
|
as: "span",
|
|
39
39
|
className: i.tableNameCellText,
|
|
40
|
-
children: E(
|
|
41
|
-
}), t === N.INLINE_SUBTITLE && /* @__PURE__ */
|
|
40
|
+
children: E(l, n, a)
|
|
41
|
+
}), t === N.INLINE_SUBTITLE && /* @__PURE__ */ r(u, {
|
|
42
42
|
as: "span",
|
|
43
43
|
className: i.tableNameCellText,
|
|
44
44
|
color: "textOnLightSecondary",
|
|
@@ -47,42 +47,42 @@ const E = (e, t, r) => {
|
|
|
47
47
|
})]
|
|
48
48
|
})
|
|
49
49
|
}, d);
|
|
50
|
-
}),
|
|
50
|
+
}), W = /* @__PURE__ */ I.memo(({
|
|
51
51
|
column: e,
|
|
52
52
|
item: t
|
|
53
53
|
}) => {
|
|
54
54
|
var n;
|
|
55
|
-
const
|
|
56
|
-
return /* @__PURE__ */
|
|
55
|
+
const l = `${e.textValue}-${t.id}`;
|
|
56
|
+
return /* @__PURE__ */ r(h, {
|
|
57
57
|
children: (n = e.cellRenderer) == null ? void 0 : n.call(e, t, e)
|
|
58
|
-
},
|
|
58
|
+
}, l);
|
|
59
59
|
}), j = /* @__PURE__ */ I.memo(({
|
|
60
60
|
column: e,
|
|
61
61
|
item: t
|
|
62
62
|
}) => {
|
|
63
|
-
const
|
|
64
|
-
return n ? /* @__PURE__ */
|
|
63
|
+
const l = `${e.textValue}-${t.id}`, n = x(t, e.id);
|
|
64
|
+
return n ? /* @__PURE__ */ r(h, {
|
|
65
65
|
children: n.join(" ")
|
|
66
|
-
},
|
|
66
|
+
}, l) : /* @__PURE__ */ r(h, {}, l);
|
|
67
67
|
}), D = /* @__PURE__ */ I.memo(({
|
|
68
68
|
column: e,
|
|
69
69
|
item: t
|
|
70
70
|
}) => {
|
|
71
71
|
const {
|
|
72
|
-
id:
|
|
72
|
+
id: l,
|
|
73
73
|
isItemMetadata: n,
|
|
74
74
|
textValue: a
|
|
75
75
|
} = e, s = `${a}-${t.id}`;
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
children: /* @__PURE__ */
|
|
76
|
+
return /* @__PURE__ */ r(h, {
|
|
77
|
+
children: /* @__PURE__ */ r(u, {
|
|
78
78
|
as: "span",
|
|
79
|
-
children: E(t,
|
|
79
|
+
children: E(t, l, n)
|
|
80
80
|
})
|
|
81
81
|
}, s);
|
|
82
82
|
}), G = /* @__PURE__ */ I.memo(({
|
|
83
83
|
column: e,
|
|
84
84
|
iconColumnVariant: t,
|
|
85
|
-
item:
|
|
85
|
+
item: l,
|
|
86
86
|
onInlineEditChange: n
|
|
87
87
|
}) => {
|
|
88
88
|
const {
|
|
@@ -90,43 +90,43 @@ const E = (e, t, r) => {
|
|
|
90
90
|
id: s,
|
|
91
91
|
isInlineEditingEnabled: m,
|
|
92
92
|
type: d
|
|
93
|
-
} = e;
|
|
94
|
-
return
|
|
93
|
+
} = e, f = s === "item.name" && (t === N.INLINE || t === N.INLINE_SUBTITLE);
|
|
94
|
+
return a ? /* @__PURE__ */ r(W, {
|
|
95
95
|
column: e,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}) : a ? /* @__PURE__ */ l(k, {
|
|
96
|
+
item: l
|
|
97
|
+
}) : f ? /* @__PURE__ */ r(k, {
|
|
99
98
|
column: e,
|
|
100
|
-
|
|
101
|
-
|
|
99
|
+
iconColumnVariant: t,
|
|
100
|
+
item: l
|
|
101
|
+
}) : m && (d === "multiSelect" || d === "enum") ? /* @__PURE__ */ r(_, {
|
|
102
102
|
column: e,
|
|
103
|
-
item:
|
|
103
|
+
item: l,
|
|
104
104
|
onInlineEditChange: n
|
|
105
|
-
}, `${e.id}-${
|
|
105
|
+
}, `${e.id}-${l.id}`) : d === "multiSelect" ? /* @__PURE__ */ r(j, {
|
|
106
106
|
column: e,
|
|
107
|
-
item:
|
|
108
|
-
}) : /* @__PURE__ */
|
|
107
|
+
item: l
|
|
108
|
+
}) : /* @__PURE__ */ r(D, {
|
|
109
109
|
column: e,
|
|
110
|
-
item:
|
|
110
|
+
item: l
|
|
111
111
|
});
|
|
112
112
|
}), H = /* @__PURE__ */ I.memo(({
|
|
113
113
|
item: e,
|
|
114
114
|
zoomLevel: t
|
|
115
|
-
}) => /* @__PURE__ */
|
|
115
|
+
}) => /* @__PURE__ */ r(h, {
|
|
116
116
|
style: {
|
|
117
117
|
height: w[t]
|
|
118
118
|
},
|
|
119
|
-
children: /* @__PURE__ */
|
|
119
|
+
children: /* @__PURE__ */ r(b, {
|
|
120
120
|
className: i.iconCell,
|
|
121
121
|
item: e
|
|
122
122
|
})
|
|
123
123
|
}, `item-type-icon-${e.id}`)), A = /* @__PURE__ */ I.memo(({
|
|
124
124
|
item: e,
|
|
125
125
|
itemActionMenuProps: t,
|
|
126
|
-
isCheckboxDisabled:
|
|
127
|
-
}) => /* @__PURE__ */
|
|
128
|
-
isCheckboxDisabled:
|
|
129
|
-
children: (n) => t ? /* @__PURE__ */
|
|
126
|
+
isCheckboxDisabled: l
|
|
127
|
+
}) => /* @__PURE__ */ r(S, {
|
|
128
|
+
isCheckboxDisabled: l,
|
|
129
|
+
children: (n) => t ? /* @__PURE__ */ r(M, {
|
|
130
130
|
...t,
|
|
131
131
|
item: e,
|
|
132
132
|
onOpenChange: n
|
|
@@ -134,39 +134,39 @@ const E = (e, t, r) => {
|
|
|
134
134
|
})), P = ({
|
|
135
135
|
areSelectionCheckboxesDisabled: e,
|
|
136
136
|
columnCount: t,
|
|
137
|
-
columns:
|
|
137
|
+
columns: l,
|
|
138
138
|
iconColumnVariant: n,
|
|
139
139
|
isSelectAllEnabled: a,
|
|
140
140
|
items: s,
|
|
141
141
|
itemActionMenuProps: m,
|
|
142
142
|
onInlineEditChange: d,
|
|
143
|
-
onTableRowClick:
|
|
143
|
+
onTableRowClick: f,
|
|
144
144
|
virtualItems: C,
|
|
145
145
|
zoomLevel: y
|
|
146
146
|
}) => {
|
|
147
147
|
const L = n === N.COLUMN;
|
|
148
148
|
if (C) {
|
|
149
|
-
const o = (c) => /* @__PURE__ */
|
|
149
|
+
const o = (c) => /* @__PURE__ */ r(U, {
|
|
150
150
|
columnLength: t || 0,
|
|
151
151
|
rowKey: `ghost-${c}`
|
|
152
|
-
}),
|
|
152
|
+
}), p = (c) => /* @__PURE__ */ r(B, {
|
|
153
153
|
areSelectionCheckboxesDisabled: e,
|
|
154
|
-
columns:
|
|
154
|
+
columns: l,
|
|
155
155
|
iconColumnVariant: n,
|
|
156
156
|
isSelectAllEnabled: a,
|
|
157
157
|
item: c,
|
|
158
158
|
itemActionMenuProps: m,
|
|
159
|
-
onTableRowClick:
|
|
159
|
+
onTableRowClick: f,
|
|
160
160
|
zoomLevel: y
|
|
161
161
|
});
|
|
162
|
-
return /* @__PURE__ */
|
|
162
|
+
return /* @__PURE__ */ r($, {
|
|
163
163
|
items: C,
|
|
164
164
|
children: ({
|
|
165
165
|
index: c
|
|
166
|
-
}) => c >= s.length ? o(c) :
|
|
166
|
+
}) => c >= s.length ? o(c) : p(s[c])
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
|
-
return /* @__PURE__ */
|
|
169
|
+
return /* @__PURE__ */ r($, {
|
|
170
170
|
items: s.map((o) => ({
|
|
171
171
|
key: o.id,
|
|
172
172
|
...o
|
|
@@ -174,16 +174,16 @@ const E = (e, t, r) => {
|
|
|
174
174
|
children: (o) => /* @__PURE__ */ T(g, {
|
|
175
175
|
className: i.tableRow,
|
|
176
176
|
id: o.id,
|
|
177
|
-
onAction: () =>
|
|
178
|
-
children: [L && /* @__PURE__ */
|
|
177
|
+
onAction: () => f(o),
|
|
178
|
+
children: [L && /* @__PURE__ */ r(H, {
|
|
179
179
|
item: o,
|
|
180
180
|
zoomLevel: y
|
|
181
|
-
}),
|
|
182
|
-
column:
|
|
181
|
+
}), l.map((p) => /* @__PURE__ */ r(G, {
|
|
182
|
+
column: p,
|
|
183
183
|
iconColumnVariant: n,
|
|
184
184
|
item: o,
|
|
185
185
|
onInlineEditChange: d
|
|
186
|
-
}, `${
|
|
186
|
+
}, `${p.textValue}-${o.id}`)), a && /* @__PURE__ */ r(A, {
|
|
187
187
|
isCheckboxDisabled: e,
|
|
188
188
|
item: o,
|
|
189
189
|
itemActionMenuProps: m
|
|
@@ -12,6 +12,7 @@ import { Column } from '../types';
|
|
|
12
12
|
export declare const getMockFilterGroups: (filters: FilterOption[]) => Array<FilterGroup>;
|
|
13
13
|
export declare const mockActiveFilterIds: string[];
|
|
14
14
|
export declare const mockColumnData: Column[];
|
|
15
|
+
export declare const mockColumnDataWithCustomRenderers: Column[];
|
|
15
16
|
export declare const mockColumnDataWithInlineEditingEnabled: Column[];
|
|
16
17
|
export declare const mockColumnDataWithInlineEditingEnabledAndMultiSelect: Column[];
|
|
17
18
|
export declare const mockFilterOptions: FilterOption[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@box/blueprint-web": "^12.76.2",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"react-intl": "^6.4.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@box/blueprint-web": "^12.
|
|
22
|
-
"@box/blueprint-web-assets": "^4.
|
|
23
|
-
"@box/box-item-type-selector": "^1.2.
|
|
21
|
+
"@box/blueprint-web": "^12.89.0",
|
|
22
|
+
"@box/blueprint-web-assets": "^4.75.0",
|
|
23
|
+
"@box/box-item-type-selector": "^1.2.4",
|
|
24
24
|
"@box/eslint-plugin-blueprint": "1.0.5",
|
|
25
|
-
"@box/item-icon": "^1.3.
|
|
26
|
-
"@box/metadata-filter": "^1.39.
|
|
27
|
-
"@box/storybook-utils": "0.14.
|
|
25
|
+
"@box/item-icon": "^1.3.4",
|
|
26
|
+
"@box/metadata-filter": "^1.39.4",
|
|
27
|
+
"@box/storybook-utils": "0.14.11",
|
|
28
28
|
"@box/types": "1.0.0",
|
|
29
29
|
"@tanstack/react-virtual": "^3.10.8",
|
|
30
30
|
"react-intl": "^6.4.2"
|