@box/metadata-view 1.57.6 → 1.58.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/metadata-view.js +54 -52
- package/dist/chunks/table-row.js +23 -22
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +11 -10
- package/dist/esm/lib/components/filter-row/filter-row.js +14 -13
- package/dist/esm/lib/components/metadata-table/metadata-table.js +41 -40
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +28 -26
- package/dist/esm/lib/components/metadata-table/table-renderer.js +21 -20
- package/dist/types/lib/components/filter-row/all-filters-chip.d.ts +2 -1
- package/dist/types/lib/components/filter-row/filter-row.d.ts +2 -1
- package/dist/types/lib/components/metadata-table/metadata-table.d.ts +2 -1
- package/dist/types/lib/components/metadata-table/table-body/table-body-with-data.d.ts +1 -1
- package/dist/types/lib/components/metadata-table/table-body/table-row/table-row.d.ts +2 -1
- package/dist/types/lib/components/metadata-table/table-renderer.d.ts +2 -1
- package/dist/types/lib/metadata-view.d.ts +1 -1
- package/dist/types/lib/types.d.ts +3 -2
- package/package.json +14 -14
|
@@ -15,87 +15,89 @@ import '../styles/metadata-view.css';var y = {
|
|
|
15
15
|
container: "_container_1o9go_5",
|
|
16
16
|
contentContainer: "_contentContainer_1o9go_15"
|
|
17
17
|
};
|
|
18
|
-
function b({ actionBarProps: b, columns: x,
|
|
19
|
-
let [
|
|
20
|
-
headerProps:
|
|
21
|
-
items:
|
|
22
|
-
selectedKeys:
|
|
23
|
-
isSelectionEnabled:
|
|
24
|
-
onSelectionChange:
|
|
25
|
-
}),
|
|
26
|
-
|
|
18
|
+
function b({ actionBarProps: b, columns: x, dataTargetPrefix: S, tableProps: C, hasError: w, headerProps: T, onRefresh: E, onSelectionChange: D, onViewModeChange: O, selectedKeys: k, initialViewMode: A = e.LIST, paginationProps: j, isLoading: M, isSelectAllEnabled: N = !0, isSelectionEnabled: P, areSelectionCheckboxesDisabled: F, ...I }) {
|
|
19
|
+
let [L, R] = h(A), [z, B] = h(void 0), [V, H] = h(0), U = m(null), { headerSelectionProps: W, handleSelectionChange: G, selectionResetKey: K } = d({
|
|
20
|
+
headerProps: T,
|
|
21
|
+
items: I.items,
|
|
22
|
+
selectedKeys: k,
|
|
23
|
+
isSelectionEnabled: P,
|
|
24
|
+
onSelectionChange: D
|
|
25
|
+
}), q = () => {
|
|
26
|
+
R((t) => {
|
|
27
27
|
let n = t === e.LIST ? e.GRID : e.LIST;
|
|
28
|
-
return
|
|
28
|
+
return O?.(n), n;
|
|
29
29
|
});
|
|
30
|
-
},
|
|
31
|
-
|
|
30
|
+
}, J = !M && I.items.length === 0, Y = b && b.sortDropdownProps && x.filter((e) => e.type !== "multiSelect" && e.type !== "enum" && e.allowsSorting === !0), { iconColumnVariant: X } = C || {}, Z = X && X === t.COLUMN, Q = C?.onSortChange, $ = p(({ column: e, direction: t }) => {
|
|
31
|
+
B({
|
|
32
32
|
column: e,
|
|
33
33
|
direction: t
|
|
34
|
-
}),
|
|
34
|
+
}), Q?.({
|
|
35
35
|
column: e,
|
|
36
36
|
direction: t
|
|
37
37
|
});
|
|
38
|
-
}, [
|
|
39
|
-
...
|
|
40
|
-
sortDescriptor:
|
|
41
|
-
onSortChange:
|
|
38
|
+
}, [Q]), ee = {
|
|
39
|
+
...C,
|
|
40
|
+
sortDescriptor: z,
|
|
41
|
+
onSortChange: $
|
|
42
42
|
};
|
|
43
43
|
return /* @__PURE__ */ _(f, { children: /* @__PURE__ */ _("div", {
|
|
44
|
-
ref:
|
|
44
|
+
ref: U,
|
|
45
45
|
className: y.container,
|
|
46
|
-
children:
|
|
47
|
-
|
|
48
|
-
...
|
|
49
|
-
...
|
|
46
|
+
children: w ? /* @__PURE__ */ _(u, { onRefresh: E }) : /* @__PURE__ */ v(g, { children: [
|
|
47
|
+
T && /* @__PURE__ */ _(c, {
|
|
48
|
+
...T,
|
|
49
|
+
...W
|
|
50
50
|
}),
|
|
51
51
|
/* @__PURE__ */ _(n, {
|
|
52
52
|
...b,
|
|
53
|
-
containerRef:
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
containerRef: U,
|
|
54
|
+
dataTargetPrefix: S,
|
|
55
|
+
isIconColumnEnabled: Z,
|
|
56
|
+
onSortDescriptorChange: B,
|
|
57
|
+
onViewModeClick: q,
|
|
58
|
+
onZoomLevelChange: H,
|
|
59
|
+
sortableColumns: Y,
|
|
60
|
+
sortDescriptor: z,
|
|
61
|
+
viewMode: L,
|
|
62
|
+
zoomLevel: V
|
|
62
63
|
}),
|
|
63
64
|
/* @__PURE__ */ _("div", {
|
|
64
65
|
className: y.contentContainer,
|
|
65
66
|
children: /* @__PURE__ */ v(s, { children: [
|
|
66
67
|
/* @__PURE__ */ _(o, {
|
|
67
|
-
condition:
|
|
68
|
+
condition: J,
|
|
68
69
|
children: /* @__PURE__ */ _(l, {})
|
|
69
70
|
}),
|
|
70
71
|
/* @__PURE__ */ _(o, {
|
|
71
|
-
condition:
|
|
72
|
+
condition: L === e.LIST,
|
|
72
73
|
children: /* @__PURE__ */ _(i, {
|
|
73
|
-
areSelectionCheckboxesDisabled:
|
|
74
|
+
areSelectionCheckboxesDisabled: F,
|
|
74
75
|
columns: x,
|
|
75
|
-
isLoading:
|
|
76
|
-
isSelectAllEnabled:
|
|
77
|
-
onSelectionChange:
|
|
78
|
-
selectedKeys:
|
|
79
|
-
selectionMode:
|
|
80
|
-
zoomLevel:
|
|
81
|
-
...
|
|
82
|
-
|
|
83
|
-
|
|
76
|
+
isLoading: M,
|
|
77
|
+
isSelectAllEnabled: N,
|
|
78
|
+
onSelectionChange: G,
|
|
79
|
+
selectedKeys: k,
|
|
80
|
+
selectionMode: P ? "multiple" : "none",
|
|
81
|
+
zoomLevel: V,
|
|
82
|
+
...I,
|
|
83
|
+
...ee,
|
|
84
|
+
dataTargetPrefix: S
|
|
85
|
+
}, K)
|
|
84
86
|
}),
|
|
85
87
|
/* @__PURE__ */ _(o, {
|
|
86
|
-
condition:
|
|
88
|
+
condition: L === e.GRID,
|
|
87
89
|
children: /* @__PURE__ */ _(r, {
|
|
88
|
-
areSelectionCheckboxesDisabled:
|
|
89
|
-
onSelectionChange:
|
|
90
|
-
selectedKeys:
|
|
91
|
-
selectionMode:
|
|
92
|
-
zoomLevel:
|
|
93
|
-
...
|
|
94
|
-
},
|
|
90
|
+
areSelectionCheckboxesDisabled: F,
|
|
91
|
+
onSelectionChange: G,
|
|
92
|
+
selectedKeys: k,
|
|
93
|
+
selectionMode: P ? "multiple" : "none",
|
|
94
|
+
zoomLevel: V,
|
|
95
|
+
...I
|
|
96
|
+
}, K)
|
|
95
97
|
})
|
|
96
98
|
] })
|
|
97
99
|
}),
|
|
98
|
-
|
|
100
|
+
j && /* @__PURE__ */ _(a, { ...j })
|
|
99
101
|
] })
|
|
100
102
|
}) });
|
|
101
103
|
}
|
package/dist/chunks/table-row.js
CHANGED
|
@@ -18,31 +18,32 @@ import '../styles/table-row.css';var f = {
|
|
|
18
18
|
tableNameCellText: "_tableNameCellText_1sntd_65",
|
|
19
19
|
tableNameCellIconInline: "_tableNameCellIconInline_1sntd_70",
|
|
20
20
|
iconCell: "_iconCell_1sntd_74"
|
|
21
|
-
}, p = ({ areSelectionCheckboxesDisabled: p, columns: m,
|
|
22
|
-
className: u(f.tableRow, { [f.isClickable]:
|
|
23
|
-
id:
|
|
24
|
-
|
|
21
|
+
}, p = ({ areSelectionCheckboxesDisabled: p, columns: m, dataTargetPrefix: h, iconColumnVariant: g, item: _, itemActionMenuProps: v, onTableRowClick: y, shouldRenderActionColumn: b, zoomLevel: x = 0 }) => /* @__PURE__ */ c(a, {
|
|
22
|
+
className: u(f.tableRow, { [f.isClickable]: y }),
|
|
23
|
+
"data-target-id": h ? `${h}-itemRow-${_.id}` : void 0,
|
|
24
|
+
id: _.id,
|
|
25
|
+
onAction: () => y?.(_),
|
|
25
26
|
children: [
|
|
26
|
-
|
|
27
|
-
style: { height: n[
|
|
27
|
+
g === e.COLUMN ? /* @__PURE__ */ s(i, {
|
|
28
|
+
style: { height: n[x] },
|
|
28
29
|
children: /* @__PURE__ */ s(l, {
|
|
29
30
|
className: f.iconCell,
|
|
30
|
-
item:
|
|
31
|
+
item: _
|
|
31
32
|
})
|
|
32
|
-
}, `item-type-icon-${
|
|
33
|
+
}, `item-type-icon-${_.id}`) : null,
|
|
33
34
|
m.map((t) => {
|
|
34
|
-
let { cellRenderer: n, id: r, isItemMetadata: a, subtitle: p, textValue: m, type:
|
|
35
|
-
if (n) return /* @__PURE__ */ s(i, { children: n(
|
|
36
|
-
let y = d(
|
|
37
|
-
if (r === "name" && (
|
|
35
|
+
let { cellRenderer: n, id: r, isItemMetadata: a, subtitle: p, textValue: m, type: h } = t, v = `${m}-${_.id}`;
|
|
36
|
+
if (n) return /* @__PURE__ */ s(i, { children: n(_, t) }, v);
|
|
37
|
+
let y = d(_, a ? r.split(".")[1] : r);
|
|
38
|
+
if (r === "name" && (g === e.INLINE || g === e.INLINE_SUBTITLE)) return /* @__PURE__ */ s(i, { children: /* @__PURE__ */ c("div", {
|
|
38
39
|
className: f.tableNameCell,
|
|
39
|
-
children: [/* @__PURE__ */ s(l, { item:
|
|
40
|
-
className: u(f.tableNameCellTitle, { [f.hasSubtitle]:
|
|
40
|
+
children: [/* @__PURE__ */ s(l, { item: _ }), /* @__PURE__ */ c("div", {
|
|
41
|
+
className: u(f.tableNameCellTitle, { [f.hasSubtitle]: g === e.INLINE_SUBTITLE }),
|
|
41
42
|
children: [/* @__PURE__ */ s(o, {
|
|
42
43
|
as: "span",
|
|
43
44
|
className: f.tableNameCellText,
|
|
44
45
|
children: y
|
|
45
|
-
}),
|
|
46
|
+
}), g === e.INLINE_SUBTITLE ? /* @__PURE__ */ s(o, {
|
|
46
47
|
as: "span",
|
|
47
48
|
className: f.tableNameCellText,
|
|
48
49
|
color: "textOnLightSecondary",
|
|
@@ -50,8 +51,8 @@ import '../styles/table-row.css';var f = {
|
|
|
50
51
|
}) : null]
|
|
51
52
|
})]
|
|
52
53
|
}) }, v);
|
|
53
|
-
if (
|
|
54
|
-
let e = d(
|
|
54
|
+
if (h === "multiSelect") {
|
|
55
|
+
let e = d(_, r);
|
|
55
56
|
return /* @__PURE__ */ s(i, { children: e ? e.join(" ") : "" }, v);
|
|
56
57
|
}
|
|
57
58
|
return /* @__PURE__ */ s(i, { children: /* @__PURE__ */ s(o, {
|
|
@@ -59,14 +60,14 @@ import '../styles/table-row.css';var f = {
|
|
|
59
60
|
children: y
|
|
60
61
|
}) }, v);
|
|
61
62
|
}),
|
|
62
|
-
|
|
63
|
+
b && /* @__PURE__ */ s(r, {
|
|
63
64
|
isCheckboxDisabled: p,
|
|
64
|
-
children: (e) =>
|
|
65
|
-
...
|
|
66
|
-
item:
|
|
65
|
+
children: (e) => v ? /* @__PURE__ */ s(t, {
|
|
66
|
+
...v,
|
|
67
|
+
item: _,
|
|
67
68
|
onOpenChange: e
|
|
68
69
|
}) : null
|
|
69
70
|
})
|
|
70
71
|
]
|
|
71
|
-
},
|
|
72
|
+
}, _.id);
|
|
72
73
|
export { f as n, p as t };
|
|
@@ -9,24 +9,25 @@ import { useIntl as c } from "react-intl";
|
|
|
9
9
|
import { useFormikContext as l } from "formik";
|
|
10
10
|
import { Filter as u } from "@box/blueprint-web-assets/icons/Line";
|
|
11
11
|
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
12
|
-
var m = ({ containerRef: m,
|
|
13
|
-
let { formatMessage:
|
|
14
|
-
return /* @__PURE__ */ p(d, { children: [
|
|
12
|
+
var m = ({ containerRef: m, dataTargetPrefix: h, filterGroups: g, onAllFiltersClick: _ }) => {
|
|
13
|
+
let { formatMessage: v } = c(), { values: y } = l(), [b, x] = s(!1), S = () => _ ? _() : x(!0), C = o(() => Object.values(y.metadata.fields).filter((e) => n(e.value)).length, [y.metadata.fields]);
|
|
14
|
+
return /* @__PURE__ */ p(d, { children: [b && /* @__PURE__ */ f(e, {
|
|
15
15
|
containerRef: m,
|
|
16
|
-
filterGroups:
|
|
17
|
-
getInitialFormValues: () => t(
|
|
18
|
-
isOpen:
|
|
19
|
-
onIsOpenChange:
|
|
16
|
+
filterGroups: g,
|
|
17
|
+
getInitialFormValues: () => t(g.flatMap(({ filters: e }) => e)),
|
|
18
|
+
isOpen: b,
|
|
19
|
+
onIsOpenChange: x
|
|
20
20
|
}), /* @__PURE__ */ p(a.ChipButton, {
|
|
21
|
-
|
|
21
|
+
"data-target-id": h ? `${h}-allFilters` : void 0,
|
|
22
|
+
onClick: S,
|
|
22
23
|
value: "all-filters-chip-btn",
|
|
23
24
|
children: [
|
|
24
25
|
/* @__PURE__ */ f(a.Icon, {
|
|
25
26
|
className: i.filterChipIcon,
|
|
26
27
|
icon: u
|
|
27
28
|
}),
|
|
28
|
-
/* @__PURE__ */ f(a.Label, { children:
|
|
29
|
-
|
|
29
|
+
/* @__PURE__ */ f(a.Label, { children: v(r.allFilters) }),
|
|
30
|
+
C > 0 ? /* @__PURE__ */ f(a.Status, { children: C.toString() }) : null
|
|
30
31
|
]
|
|
31
32
|
})] });
|
|
32
33
|
};
|
|
@@ -7,27 +7,28 @@ import { FilterChip as a } from "@box/blueprint-web";
|
|
|
7
7
|
import { useMemo as o, useRef as s } from "react";
|
|
8
8
|
import { Form as c, Formik as l } from "formik";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
-
var f = ({
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
},
|
|
10
|
+
var f = ({ dataTargetPrefix: f, predefinedFilterOptions: p, containerRef: m, filterGroups: h = [], initialFilterValues: g, isAllFiltersDisabled: _, onAllFiltersClick: v, onFilterSubmit: y }) => {
|
|
11
|
+
let b = i(p), x = ({ metadata: { fields: e } }) => {
|
|
12
|
+
y && y(e);
|
|
13
|
+
}, S = [...b, ...h], C = S.flatMap(({ filters: e }) => e).sort((e, t) => (e.position ?? 0) - (t.position ?? 0)), w = o(() => e(C, g), [C.map((e) => `${e.id}:${e.fieldType}`).sort().join("|"), g]), T = s(null);
|
|
14
14
|
return /* @__PURE__ */ u(l, {
|
|
15
15
|
enableReinitialize: !0,
|
|
16
|
-
initialValues:
|
|
17
|
-
onSubmit:
|
|
16
|
+
initialValues: w,
|
|
17
|
+
onSubmit: x,
|
|
18
18
|
children: /* @__PURE__ */ u(c, {
|
|
19
|
-
ref:
|
|
19
|
+
ref: T,
|
|
20
20
|
children: /* @__PURE__ */ d(a.Group, {
|
|
21
21
|
className: t.filterChipGroup,
|
|
22
22
|
name: "metadata-view-filters",
|
|
23
23
|
type: "multiple",
|
|
24
|
-
children: [
|
|
25
|
-
containerRef:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
children: [_ ? null : /* @__PURE__ */ u(n, {
|
|
25
|
+
containerRef: m,
|
|
26
|
+
dataTargetPrefix: f,
|
|
27
|
+
filterGroups: S,
|
|
28
|
+
onAllFiltersClick: v
|
|
29
|
+
}), C.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ u(r, {
|
|
29
30
|
filterOption: e,
|
|
30
|
-
formRef:
|
|
31
|
+
formRef: T
|
|
31
32
|
}, e.id))]
|
|
32
33
|
})
|
|
33
34
|
})
|
|
@@ -9,19 +9,19 @@ import { Column as s, DataTableWrapper as c, ListCheckbox as l, TableHeader as u
|
|
|
9
9
|
import { useRef as f } from "react";
|
|
10
10
|
import { useIntl as p } from "react-intl";
|
|
11
11
|
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
-
var g = ({ areSelectionCheckboxesDisabled: g = !1, columns: _,
|
|
13
|
-
let { formatMessage:
|
|
14
|
-
items:
|
|
15
|
-
hasNextPage:
|
|
16
|
-
isLoading:
|
|
17
|
-
parentRef:
|
|
18
|
-
onGetNextPage:
|
|
19
|
-
placeholderRowsCount:
|
|
20
|
-
}),
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
let e = parseInt(t[
|
|
24
|
-
|
|
12
|
+
var g = ({ areSelectionCheckboxesDisabled: g = !1, columns: _, dataTargetPrefix: v, hasNextPage: y = !1, iconColumnVariant: b, isInfiniteScrollEnabled: x = !1, isLoading: S = !1, isSelectAllEnabled: C, itemActionMenuProps: w, items: T, maxActionColumnWidth: E, minActionColumnWidth: D, onGetNextPage: O, onInlineEditChange: k, onTableRowClick: A, placeholderRowsCount: j, zoomLevel: M, ...N }) => {
|
|
13
|
+
let { formatMessage: P } = p(), F = f(null), { virtualItemsToDisplay: I, totalVirtualSize: L } = n({
|
|
14
|
+
items: T,
|
|
15
|
+
hasNextPage: y,
|
|
16
|
+
isLoading: S,
|
|
17
|
+
parentRef: F,
|
|
18
|
+
onGetNextPage: O,
|
|
19
|
+
placeholderRowsCount: j
|
|
20
|
+
}), R = [];
|
|
21
|
+
if (b === e.COLUMN) {
|
|
22
|
+
M ||= 0;
|
|
23
|
+
let e = parseInt(t[M], 10) + 24;
|
|
24
|
+
R.push({
|
|
25
25
|
id: "item-type-icon",
|
|
26
26
|
isRowHeader: !1,
|
|
27
27
|
hideHeader: !1,
|
|
@@ -29,7 +29,7 @@ var g = ({ areSelectionCheckboxesDisabled: g = !1, columns: _, hasNextPage: v =
|
|
|
29
29
|
maxWidth: e
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
let
|
|
32
|
+
let z = _.map((e) => {
|
|
33
33
|
let { id: t, isRowHeader: n, headerRenderer: r, textValue: i, type: a, allowsSorting: o, ...s } = e, c = a !== "multiSelect" && a !== "enum" && o === !0;
|
|
34
34
|
return {
|
|
35
35
|
...s,
|
|
@@ -43,48 +43,49 @@ var g = ({ areSelectionCheckboxesDisabled: g = !1, columns: _, hasNextPage: v =
|
|
|
43
43
|
allowsSorting: c
|
|
44
44
|
};
|
|
45
45
|
});
|
|
46
|
-
|
|
46
|
+
R.push(...z), a(N) && R.push({
|
|
47
47
|
id: "actions",
|
|
48
48
|
className: i.tableHeaderActions,
|
|
49
49
|
children: /* @__PURE__ */ h("div", {
|
|
50
50
|
className: i.tableHeaderActionsWrapper,
|
|
51
|
-
children: [
|
|
52
|
-
"aria-label":
|
|
51
|
+
children: [N.HeaderActions, C ? /* @__PURE__ */ m(l, {
|
|
52
|
+
"aria-label": P(r.selectAll),
|
|
53
53
|
className: i.selectAllCheckbox,
|
|
54
|
-
isDisabled:
|
|
54
|
+
isDisabled: S || g
|
|
55
55
|
}) : null]
|
|
56
56
|
}),
|
|
57
57
|
isRowHeader: !1,
|
|
58
58
|
hideHeader: !1,
|
|
59
59
|
allowsSorting: !1,
|
|
60
|
-
maxWidth:
|
|
61
|
-
minWidth:
|
|
60
|
+
maxWidth: E,
|
|
61
|
+
minWidth: D
|
|
62
62
|
});
|
|
63
|
-
let
|
|
64
|
-
columns:
|
|
63
|
+
let B = /* @__PURE__ */ m(u, {
|
|
64
|
+
columns: R,
|
|
65
65
|
children: (e) => /* @__PURE__ */ m(s, { ...e })
|
|
66
|
-
}),
|
|
67
|
-
columnCount:
|
|
66
|
+
}), V = {
|
|
67
|
+
columnCount: R.length,
|
|
68
68
|
columns: _,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
dataTargetPrefix: v,
|
|
70
|
+
formatMessage: P,
|
|
71
|
+
iconColumnVariant: b,
|
|
72
|
+
isLoading: S,
|
|
72
73
|
areSelectionCheckboxesDisabled: g,
|
|
73
|
-
itemActionMenuProps:
|
|
74
|
-
items:
|
|
75
|
-
onInlineEditChange:
|
|
76
|
-
onTableRowClick:
|
|
77
|
-
tableHeader:
|
|
78
|
-
tableProps:
|
|
79
|
-
zoomLevel:
|
|
74
|
+
itemActionMenuProps: w,
|
|
75
|
+
items: T,
|
|
76
|
+
onInlineEditChange: k,
|
|
77
|
+
onTableRowClick: A,
|
|
78
|
+
tableHeader: B,
|
|
79
|
+
tableProps: N,
|
|
80
|
+
zoomLevel: M
|
|
80
81
|
};
|
|
81
|
-
return
|
|
82
|
-
ref:
|
|
82
|
+
return x ? /* @__PURE__ */ m(c, {
|
|
83
|
+
ref: F,
|
|
83
84
|
children: /* @__PURE__ */ m(o, {
|
|
84
|
-
...
|
|
85
|
-
totalVirtualSize:
|
|
86
|
-
virtualItems:
|
|
85
|
+
...V,
|
|
86
|
+
totalVirtualSize: L,
|
|
87
|
+
virtualItems: I
|
|
87
88
|
})
|
|
88
|
-
}) : /* @__PURE__ */ m(o, { ...
|
|
89
|
+
}) : /* @__PURE__ */ m(o, { ...V });
|
|
89
90
|
};
|
|
90
91
|
export { g as MetadataTable };
|
|
@@ -73,61 +73,63 @@ var v = (e, t, n) => _(e, n ? t.split(".")[1] : t), y = /* @__PURE__ */ f.memo((
|
|
|
73
73
|
item: e,
|
|
74
74
|
onOpenChange: r
|
|
75
75
|
}) : null
|
|
76
|
-
})), E = ({ areSelectionCheckboxesDisabled: t, columnCount: n, columns: i,
|
|
77
|
-
let
|
|
78
|
-
if (
|
|
76
|
+
})), E = ({ areSelectionCheckboxesDisabled: t, columnCount: n, columns: i, dataTargetPrefix: s, iconColumnVariant: c, items: d, itemActionMenuProps: f, onInlineEditChange: h, onTableRowClick: _, shouldRenderActionColumn: v, virtualItems: y, totalVirtualSize: b, zoomLevel: x }) => {
|
|
77
|
+
let S = c === e.COLUMN;
|
|
78
|
+
if (y) {
|
|
79
79
|
let e = (e) => /* @__PURE__ */ p(r, {
|
|
80
80
|
columnLength: n || 0,
|
|
81
81
|
rowKey: `ghost-${e}`
|
|
82
82
|
}), a = (e) => /* @__PURE__ */ p(o, {
|
|
83
83
|
areSelectionCheckboxesDisabled: t,
|
|
84
84
|
columns: i,
|
|
85
|
-
|
|
85
|
+
dataTargetPrefix: s,
|
|
86
|
+
iconColumnVariant: c,
|
|
86
87
|
item: e,
|
|
87
|
-
itemActionMenuProps:
|
|
88
|
-
onTableRowClick:
|
|
89
|
-
shouldRenderActionColumn:
|
|
90
|
-
zoomLevel:
|
|
91
|
-
}),
|
|
92
|
-
let e =
|
|
93
|
-
return Math.max((
|
|
94
|
-
},
|
|
88
|
+
itemActionMenuProps: f,
|
|
89
|
+
onTableRowClick: _,
|
|
90
|
+
shouldRenderActionColumn: v,
|
|
91
|
+
zoomLevel: x
|
|
92
|
+
}), h = () => y[0]?.start || 0, g = () => {
|
|
93
|
+
let e = y[y.length - 1]?.end || 0;
|
|
94
|
+
return Math.max((b || 0) - e, 0);
|
|
95
|
+
}, S = h(), C = g();
|
|
95
96
|
return /* @__PURE__ */ m(u, { children: [
|
|
96
|
-
!!x && /* @__PURE__ */ p(l, {
|
|
97
|
-
isDisabled: !0,
|
|
98
|
-
style: { height: `${x}px` }
|
|
99
|
-
}),
|
|
100
|
-
v.map(({ index: t }) => t >= c.length ? e(t) : a(c[t])),
|
|
101
97
|
!!S && /* @__PURE__ */ p(l, {
|
|
102
98
|
isDisabled: !0,
|
|
103
99
|
style: { height: `${S}px` }
|
|
100
|
+
}),
|
|
101
|
+
y.map(({ index: t }) => t >= d.length ? e(t) : a(d[t])),
|
|
102
|
+
!!C && /* @__PURE__ */ p(l, {
|
|
103
|
+
isDisabled: !0,
|
|
104
|
+
style: { height: `${C}px` }
|
|
104
105
|
})
|
|
105
106
|
] });
|
|
106
107
|
}
|
|
107
108
|
return /* @__PURE__ */ p(u, {
|
|
108
|
-
items:
|
|
109
|
+
items: d.map((e) => ({
|
|
109
110
|
key: e.id,
|
|
110
111
|
...e
|
|
111
112
|
})),
|
|
112
113
|
children: (e) => /* @__PURE__ */ m(l, {
|
|
113
|
-
className: g(a.tableRow, { [a.isClickable]:
|
|
114
|
+
className: g(a.tableRow, { [a.isClickable]: _ }),
|
|
115
|
+
"data-target-id": s ? `${s}-itemRow-${e.id}` : void 0,
|
|
114
116
|
id: e.id,
|
|
115
|
-
onAction: () =>
|
|
117
|
+
onAction: () => _?.(e),
|
|
116
118
|
children: [
|
|
117
|
-
|
|
119
|
+
S && /* @__PURE__ */ p(w, {
|
|
118
120
|
item: e,
|
|
119
|
-
zoomLevel:
|
|
121
|
+
zoomLevel: x
|
|
120
122
|
}),
|
|
121
123
|
i.map((t) => /* @__PURE__ */ p(C, {
|
|
122
124
|
column: t,
|
|
123
|
-
iconColumnVariant:
|
|
125
|
+
iconColumnVariant: c,
|
|
124
126
|
item: e,
|
|
125
|
-
onInlineEditChange:
|
|
127
|
+
onInlineEditChange: h
|
|
126
128
|
}, `${t.textValue}-${e.id}`)),
|
|
127
|
-
|
|
129
|
+
v && /* @__PURE__ */ p(T, {
|
|
128
130
|
isCheckboxDisabled: t,
|
|
129
131
|
item: e,
|
|
130
|
-
itemActionMenuProps:
|
|
132
|
+
itemActionMenuProps: f
|
|
131
133
|
})
|
|
132
134
|
]
|
|
133
135
|
}, e.id)
|
|
@@ -5,30 +5,31 @@ import r from "./table-body/table-body-with-data.js";
|
|
|
5
5
|
import { getShouldRenderActionColumn as i } from "./actionColumn.js";
|
|
6
6
|
import { Table as a } from "@box/blueprint-web";
|
|
7
7
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
8
|
-
var c = ({ columnCount: c, columns: l,
|
|
9
|
-
let
|
|
8
|
+
var c = ({ columnCount: c, columns: l, dataTargetPrefix: u, formatMessage: d, iconColumnVariant: f, isLoading: p, areSelectionCheckboxesDisabled: m, itemActionMenuProps: h, items: g, onInlineEditChange: _, onTableRowClick: v, style: y, tableHeader: b, tableProps: x, virtualItems: S, totalVirtualSize: C, zoomLevel: w }) => {
|
|
9
|
+
let T = i(x), E = c || (() => {
|
|
10
10
|
let t = l.length;
|
|
11
|
-
return
|
|
12
|
-
})(),
|
|
11
|
+
return f === e.COLUMN && (t += 1), T && (t += 1), t;
|
|
12
|
+
})(), D = p && !S?.length;
|
|
13
13
|
return /* @__PURE__ */ s(a, {
|
|
14
|
-
"aria-label":
|
|
14
|
+
"aria-label": d(n.listView),
|
|
15
15
|
selectionBehavior: "toggle",
|
|
16
|
-
style:
|
|
17
|
-
...
|
|
18
|
-
children: [
|
|
19
|
-
areSelectionCheckboxesDisabled:
|
|
20
|
-
columnCount:
|
|
16
|
+
style: y,
|
|
17
|
+
...x,
|
|
18
|
+
children: [b, D ? /* @__PURE__ */ o(t, { columnLength: E }) : /* @__PURE__ */ o(r, {
|
|
19
|
+
areSelectionCheckboxesDisabled: m,
|
|
20
|
+
columnCount: E,
|
|
21
21
|
columns: l,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
22
|
+
dataTargetPrefix: u,
|
|
23
|
+
iconColumnVariant: f,
|
|
24
|
+
isLoading: p,
|
|
25
|
+
itemActionMenuProps: h,
|
|
26
|
+
items: g,
|
|
27
|
+
onInlineEditChange: _,
|
|
28
|
+
onTableRowClick: v,
|
|
29
|
+
shouldRenderActionColumn: T,
|
|
30
|
+
totalVirtualSize: C,
|
|
31
|
+
virtualItems: S,
|
|
32
|
+
zoomLevel: w
|
|
32
33
|
})]
|
|
33
34
|
});
|
|
34
35
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FilterGroup } from './types';
|
|
2
2
|
type AllFiltersChipProps = {
|
|
3
3
|
containerRef?: React.RefObject<HTMLElement>;
|
|
4
|
+
dataTargetPrefix?: string;
|
|
4
5
|
filterGroups: Array<FilterGroup>;
|
|
5
6
|
onAllFiltersClick?: () => void;
|
|
6
7
|
};
|
|
7
|
-
declare const AllFiltersChip: ({ containerRef, filterGroups, onAllFiltersClick }: AllFiltersChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const AllFiltersChip: ({ containerRef, dataTargetPrefix, filterGroups, onAllFiltersClick }: AllFiltersChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export default AllFiltersChip;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { PredefinedFilterOptions } from './predefinedFilters/types';
|
|
2
2
|
import { FilterGroup, FilterValues, InitialFilterValues } from './types';
|
|
3
3
|
export interface FilterRowProps {
|
|
4
|
+
dataTargetPrefix?: string;
|
|
4
5
|
predefinedFilterOptions?: Partial<PredefinedFilterOptions>;
|
|
5
6
|
containerRef?: React.RefObject<HTMLElement>;
|
|
6
7
|
filterGroups?: Array<FilterGroup>;
|
|
@@ -9,4 +10,4 @@ export interface FilterRowProps {
|
|
|
9
10
|
onAllFiltersClick?: () => void;
|
|
10
11
|
onFilterSubmit?: (fields: FilterValues) => void;
|
|
11
12
|
}
|
|
12
|
-
export declare const FilterRow: ({ predefinedFilterOptions, containerRef, filterGroups: customFilterGroups, initialFilterValues: customFilterValues, isAllFiltersDisabled, onAllFiltersClick, onFilterSubmit, }: FilterRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare const FilterRow: ({ dataTargetPrefix, predefinedFilterOptions, containerRef, filterGroups: customFilterGroups, initialFilterValues: customFilterValues, isAllFiltersDisabled, onAllFiltersClick, onFilterSubmit, }: FilterRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -5,6 +5,7 @@ import { InlineEditingCellProps } from './table-body/inline-editing-cell';
|
|
|
5
5
|
export interface MetadataTableProps extends TableProps, MetadataProps, Pick<InlineEditingCellProps, 'onInlineEditChange'> {
|
|
6
6
|
areSelectionCheckboxesDisabled?: boolean;
|
|
7
7
|
columns: Column[];
|
|
8
|
+
dataTargetPrefix?: string;
|
|
8
9
|
hasNextPage?: boolean;
|
|
9
10
|
HeaderActions?: React.ReactElement;
|
|
10
11
|
iconColumnVariant?: IconColumnVariant;
|
|
@@ -17,4 +18,4 @@ export interface MetadataTableProps extends TableProps, MetadataProps, Pick<Inli
|
|
|
17
18
|
placeholderRowsCount?: number;
|
|
18
19
|
zoomLevel?: number;
|
|
19
20
|
}
|
|
20
|
-
export declare const MetadataTable: ({ areSelectionCheckboxesDisabled, columns, hasNextPage, iconColumnVariant, isInfiniteScrollEnabled, isLoading, isSelectAllEnabled, itemActionMenuProps, items, maxActionColumnWidth, minActionColumnWidth, onGetNextPage, onInlineEditChange, onTableRowClick, placeholderRowsCount, zoomLevel, ...tableProps }: MetadataTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const MetadataTable: ({ areSelectionCheckboxesDisabled, columns, dataTargetPrefix, hasNextPage, iconColumnVariant, isInfiniteScrollEnabled, isLoading, isSelectAllEnabled, itemActionMenuProps, items, maxActionColumnWidth, minActionColumnWidth, onGetNextPage, onInlineEditChange, onTableRowClick, placeholderRowsCount, zoomLevel, ...tableProps }: MetadataTableProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,5 +16,5 @@ type CellProps = {
|
|
|
16
16
|
iconColumnVariant: IconColumnVariant;
|
|
17
17
|
};
|
|
18
18
|
export type DataCellProps = CellProps & Pick<InlineEditingCellProps, 'onInlineEditChange'>;
|
|
19
|
-
declare const TableBodyWithData: ({ areSelectionCheckboxesDisabled, columnCount, columns, iconColumnVariant, items, itemActionMenuProps, onInlineEditChange, onTableRowClick, shouldRenderActionColumn, virtualItems, totalVirtualSize, zoomLevel, }: TableBodyWithDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare const TableBodyWithData: ({ areSelectionCheckboxesDisabled, columnCount, columns, dataTargetPrefix, iconColumnVariant, items, itemActionMenuProps, onInlineEditChange, onTableRowClick, shouldRenderActionColumn, virtualItems, totalVirtualSize, zoomLevel, }: TableBodyWithDataProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
20
|
export default TableBodyWithData;
|
|
@@ -3,6 +3,7 @@ import { MetadataTableProps } from '../../metadata-table';
|
|
|
3
3
|
export interface TableRowProps {
|
|
4
4
|
areSelectionCheckboxesDisabled?: MetadataTableProps['areSelectionCheckboxesDisabled'];
|
|
5
5
|
columns: MetadataTableProps['columns'];
|
|
6
|
+
dataTargetPrefix?: MetadataTableProps['dataTargetPrefix'];
|
|
6
7
|
iconColumnVariant: MetadataTableProps['iconColumnVariant'];
|
|
7
8
|
item: Item;
|
|
8
9
|
itemActionMenuProps: MetadataTableProps['itemActionMenuProps'];
|
|
@@ -10,4 +11,4 @@ export interface TableRowProps {
|
|
|
10
11
|
shouldRenderActionColumn?: boolean;
|
|
11
12
|
zoomLevel?: number;
|
|
12
13
|
}
|
|
13
|
-
export declare const TableRow: ({ areSelectionCheckboxesDisabled, columns, iconColumnVariant, item, itemActionMenuProps, onTableRowClick, shouldRenderActionColumn, zoomLevel, }: TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const TableRow: ({ areSelectionCheckboxesDisabled, columns, dataTargetPrefix, iconColumnVariant, item, itemActionMenuProps, onTableRowClick, shouldRenderActionColumn, zoomLevel, }: TableRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ import { InlineEditingCellProps } from './table-body/inline-editing-cell';
|
|
|
7
7
|
export interface TableRendererProps extends Pick<InlineEditingCellProps, 'onInlineEditChange'> {
|
|
8
8
|
columns: Column[];
|
|
9
9
|
columnCount?: number;
|
|
10
|
+
dataTargetPrefix?: string;
|
|
10
11
|
formatMessage: ReturnType<typeof useIntl>['formatMessage'];
|
|
11
12
|
iconColumnVariant?: IconColumnVariant;
|
|
12
13
|
isLoading?: boolean;
|
|
@@ -21,4 +22,4 @@ export interface TableRendererProps extends Pick<InlineEditingCellProps, 'onInli
|
|
|
21
22
|
totalVirtualSize?: number;
|
|
22
23
|
zoomLevel?: number;
|
|
23
24
|
}
|
|
24
|
-
export declare const TableRenderer: ({ columnCount: passedColumnCount, columns, formatMessage, iconColumnVariant, isLoading, areSelectionCheckboxesDisabled, itemActionMenuProps, items, onInlineEditChange, onTableRowClick, style, tableHeader, tableProps, virtualItems, totalVirtualSize, zoomLevel, }: TableRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const TableRenderer: ({ columnCount: passedColumnCount, columns, dataTargetPrefix, formatMessage, iconColumnVariant, isLoading, areSelectionCheckboxesDisabled, itemActionMenuProps, items, onInlineEditChange, onTableRowClick, style, tableHeader, tableProps, virtualItems, totalVirtualSize, zoomLevel, }: TableRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { MetadataViewProps } from './types';
|
|
2
|
-
export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, headerProps, onRefresh, onSelectionChange, onViewModeChange, selectedKeys, initialViewMode, paginationProps, isLoading, isSelectAllEnabled, isSelectionEnabled, areSelectionCheckboxesDisabled, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function MetadataView({ actionBarProps, columns, dataTargetPrefix, tableProps, hasError, headerProps, onRefresh, onSelectionChange, onViewModeChange, selectedKeys, initialViewMode, paginationProps, isLoading, isSelectAllEnabled, isSelectionEnabled, areSelectionCheckboxesDisabled, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default MetadataView;
|
|
@@ -60,7 +60,8 @@ export declare enum ViewMode {
|
|
|
60
60
|
LIST = "list"
|
|
61
61
|
}
|
|
62
62
|
export interface MetadataViewProps extends MetadataProps {
|
|
63
|
-
actionBarProps?: Omit<ActionBarProps, 'onViewModeClick' | 'onZoomLevelChange' | 'viewMode'>;
|
|
63
|
+
actionBarProps?: Omit<ActionBarProps, 'dataTargetPrefix' | 'onViewModeClick' | 'onZoomLevelChange' | 'viewMode'>;
|
|
64
|
+
dataTargetPrefix?: string;
|
|
64
65
|
columns: Column[];
|
|
65
66
|
hasError?: boolean;
|
|
66
67
|
initialViewMode?: ViewMode;
|
|
@@ -71,7 +72,7 @@ export interface MetadataViewProps extends MetadataProps {
|
|
|
71
72
|
isSelectAllEnabled?: boolean;
|
|
72
73
|
isSelectionEnabled?: boolean;
|
|
73
74
|
areSelectionCheckboxesDisabled?: boolean;
|
|
74
|
-
tableProps?: Omit<MetadataTableProps, 'columns' | 'isSelectAllEnabled' | 'items' | 'itemActionMenuProps' | 'onSelectionChange' | 'selectedKeys'>;
|
|
75
|
+
tableProps?: Omit<MetadataTableProps, 'columns' | 'dataTargetPrefix' | 'isSelectAllEnabled' | 'items' | 'itemActionMenuProps' | 'onSelectionChange' | 'selectedKeys'>;
|
|
75
76
|
paginationProps?: PaginationProps;
|
|
76
77
|
headerProps?: HeaderProps;
|
|
77
78
|
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.58.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^14.30.
|
|
7
|
-
"@box/blueprint-web-assets": "^4.118.
|
|
8
|
-
"@box/box-item-type-selector": "^1.41.
|
|
9
|
-
"@box/content-field": "^1.42.
|
|
10
|
-
"@box/item-icon": "^2.35.
|
|
11
|
-
"@box/metadata-filter": "^1.83.
|
|
6
|
+
"@box/blueprint-web": "^14.30.4",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.118.2",
|
|
8
|
+
"@box/box-item-type-selector": "^1.41.8",
|
|
9
|
+
"@box/content-field": "^1.42.8",
|
|
10
|
+
"@box/item-icon": "^2.35.8",
|
|
11
|
+
"@box/metadata-filter": "^1.83.8",
|
|
12
12
|
"@box/types": "2.2.1",
|
|
13
13
|
"@tanstack/react-virtual": "^3.10.8",
|
|
14
14
|
"formik": "^2.4.5",
|
|
@@ -19,14 +19,14 @@
|
|
|
19
19
|
"react-intl": "^6.4.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@box/blueprint-web": "^14.30.
|
|
23
|
-
"@box/blueprint-web-assets": "^4.118.
|
|
24
|
-
"@box/box-item-type-selector": "^1.41.
|
|
25
|
-
"@box/content-field": "^1.42.
|
|
22
|
+
"@box/blueprint-web": "^14.30.4",
|
|
23
|
+
"@box/blueprint-web-assets": "^4.118.2",
|
|
24
|
+
"@box/box-item-type-selector": "^1.41.8",
|
|
25
|
+
"@box/content-field": "^1.42.8",
|
|
26
26
|
"@box/eslint-plugin-blueprint": "1.2.1",
|
|
27
|
-
"@box/item-icon": "^2.35.
|
|
28
|
-
"@box/metadata-filter": "^1.83.
|
|
29
|
-
"@box/storybook-utils": "0.19.
|
|
27
|
+
"@box/item-icon": "^2.35.8",
|
|
28
|
+
"@box/metadata-filter": "^1.83.8",
|
|
29
|
+
"@box/storybook-utils": "0.19.6",
|
|
30
30
|
"@box/types": "2.2.1",
|
|
31
31
|
"@tanstack/react-virtual": "^3.10.8",
|
|
32
32
|
"react-intl": "^6.4.2"
|