@box/metadata-view 1.54.9 → 1.54.10
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/action-bar.js +48 -0
- package/dist/chunks/empty-state.js +24 -0
- package/dist/chunks/error-state.js +23 -0
- package/dist/chunks/filter-row.module.js +6 -8
- package/dist/chunks/filter-side-panel.js +65 -0
- package/dist/chunks/header.js +56 -0
- package/dist/chunks/inline-editing-cell.js +34 -0
- package/dist/chunks/item-action-menu.js +86 -0
- package/dist/chunks/metadata-grid.js +44 -0
- package/dist/chunks/metadata-location-field.js +35 -0
- package/dist/chunks/metadata-view.js +102 -0
- package/dist/chunks/pagination-controls.js +40 -0
- package/dist/chunks/table-row.js +72 -0
- package/dist/chunks/types.js +6 -11
- package/dist/chunks/types2.js +4 -0
- package/dist/chunks/zoom-button.js +20 -0
- package/dist/esm/index.js +29 -59
- package/dist/esm/lib/components/action-bar/action-bar.js +2 -62
- package/dist/esm/lib/components/action-bar/index.js +2 -4
- package/dist/esm/lib/components/action-bar/messages.js +22 -24
- package/dist/esm/lib/components/action-bar/zoom-button.js +2 -30
- package/dist/esm/lib/components/constants.js +14 -6
- package/dist/esm/lib/components/empty-state/empty-state.js +2 -30
- package/dist/esm/lib/components/empty-state/index.js +2 -4
- package/dist/esm/lib/components/empty-state/messages.js +10 -12
- package/dist/esm/lib/components/error-state/error-state.js +2 -31
- package/dist/esm/lib/components/error-state/index.js +2 -4
- package/dist/esm/lib/components/error-state/messages.js +10 -12
- package/dist/esm/lib/components/filter-row/advanced-field-content.js +30 -52
- package/dist/esm/lib/components/filter-row/advanced-filter-context.js +3 -6
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +31 -49
- package/dist/esm/lib/components/filter-row/filter-row.js +35 -59
- package/dist/esm/lib/components/filter-row/form-filter-chip.js +84 -113
- package/dist/esm/lib/components/filter-row/index.js +6 -12
- package/dist/esm/lib/components/filter-row/initial-field-values.js +31 -51
- package/dist/esm/lib/components/filter-row/is-blank-or-not-blank-filter.js +2 -4
- package/dist/esm/lib/components/filter-row/is-filter-selected.js +37 -58
- package/dist/esm/lib/components/filter-row/messages.js +38 -40
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +74 -103
- package/dist/esm/lib/components/filter-row/predefinedFilters/index.js +2 -6
- package/dist/esm/lib/components/filter-row/predefinedFilters/predefined-filter-options-factory.js +14 -21
- package/dist/esm/lib/components/filter-row/predefinedFilters/use-predefined-filter.js +58 -71
- package/dist/esm/lib/components/filter-row/select-filter-chip.js +41 -58
- package/dist/esm/lib/components/filter-row/use-form-filter-chip.js +36 -40
- package/dist/esm/lib/components/filter-sidepanel/filter-side-panel.js +2 -82
- package/dist/esm/lib/components/filter-sidepanel/filter.js +95 -140
- package/dist/esm/lib/components/filter-sidepanel/index.js +3 -6
- package/dist/esm/lib/components/filter-sidepanel/messages.js +18 -20
- package/dist/esm/lib/components/header/header.js +2 -82
- package/dist/esm/lib/components/header/index.js +2 -4
- package/dist/esm/lib/components/header/messages.js +14 -16
- package/dist/esm/lib/components/index.js +26 -53
- package/dist/esm/lib/components/item-action-menu/identifier.js +4 -7
- package/dist/esm/lib/components/item-action-menu/index.js +2 -4
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +2 -127
- package/dist/esm/lib/components/item-action-menu/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/index.js +2 -4
- package/dist/esm/lib/components/metadata-grid/messages.js +5 -9
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +2 -62
- package/dist/esm/lib/components/metadata-table/actionColumn.js +3 -5
- package/dist/esm/lib/components/metadata-table/hooks/useInfiniteScrollTableItems.js +24 -29
- package/dist/esm/lib/components/metadata-table/index.js +4 -8
- package/dist/esm/lib/components/metadata-table/messages.js +14 -16
- package/dist/esm/lib/components/metadata-table/metadata-table.js +89 -127
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-body.js +10 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/ghost-table-row.js +8 -19
- package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js +2 -56
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +135 -209
- package/dist/esm/lib/components/metadata-table/table-body/table-row/index.js +2 -4
- package/dist/esm/lib/components/metadata-table/table-body/table-row/table-row.js +2 -12
- package/dist/esm/lib/components/metadata-table/table-renderer.js +34 -55
- package/dist/esm/lib/components/metadata-value/index.js +6 -12
- package/dist/esm/lib/components/metadata-value/messages.js +15 -17
- package/dist/esm/lib/components/metadata-value/metadata-checkbox-field.js +24 -34
- package/dist/esm/lib/components/metadata-value/metadata-file-chip.js +14 -22
- package/dist/esm/lib/components/metadata-value/metadata-file-field.js +12 -19
- package/dist/esm/lib/components/metadata-value/metadata-location-field.js +2 -48
- package/dist/esm/lib/components/metadata-value/metadata-radio-field.js +26 -37
- package/dist/esm/lib/components/metadata-value/metadata-search-field.js +19 -30
- package/dist/esm/lib/components/pagination/index.js +4 -9
- package/dist/esm/lib/components/pagination/marker-based-pagination.js +12 -19
- package/dist/esm/lib/components/pagination/messages.js +19 -21
- package/dist/esm/lib/components/pagination/offset-based-pagination.js +22 -31
- package/dist/esm/lib/components/pagination/pagination-controls.js +2 -53
- package/dist/esm/lib/components/pagination/pagination.js +20 -35
- package/dist/esm/lib/components/pagination/utils.js +4 -6
- package/dist/esm/lib/components/sort-dropdown/index.js +2 -4
- package/dist/esm/lib/components/sort-dropdown/sort-dropdown.js +37 -56
- package/dist/esm/lib/components/switch-case/index.js +2 -5
- package/dist/esm/lib/components/switch-case/switch-case.js +4 -12
- package/dist/esm/lib/hooks/use-header.js +41 -37
- package/dist/esm/lib/index.js +28 -59
- package/dist/esm/lib/metadata-view.js +2 -151
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/empty-state.css +1 -1
- package/dist/styles/filter-row.css +1 -1
- package/dist/styles/header.css +1 -1
- package/dist/styles/inline-editing-cell.css +1 -1
- package/dist/styles/item-action-menu.css +1 -1
- package/dist/styles/metadata-grid.css +1 -1
- package/dist/styles/metadata-view.css +1 -1
- package/dist/styles/pagination-controls.css +1 -1
- package/dist/styles/table-row.css +1 -0
- package/dist/styles/zoom-button.css +1 -1
- package/package.json +14 -14
- package/dist/chunks/index.js +0 -105
- package/dist/styles/index.css +0 -1
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export {
|
|
9
|
-
t as default
|
|
10
|
-
};
|
|
2
|
+
var t = e({ actionMenu: {
|
|
3
|
+
id: "groupSharedFeatures.metadataView.itemActionMenu.actionMenu",
|
|
4
|
+
defaultMessage: "Action menu"
|
|
5
|
+
} });
|
|
6
|
+
export { t as default };
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
});
|
|
8
|
-
export {
|
|
9
|
-
s as default
|
|
10
|
-
};
|
|
2
|
+
var t = e({ gridView: {
|
|
3
|
+
id: "groupSharedFeatures.metadataView.gridList.gridView",
|
|
4
|
+
defaultMessage: "Grid View"
|
|
5
|
+
} });
|
|
6
|
+
export { t as default };
|
|
@@ -1,62 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { useIntl as I } from "react-intl";
|
|
4
|
-
import { V as h } from "../../../../chunks/types.js";
|
|
5
|
-
import { THUMBNAIL_GRID_VIEW_SIZES as T } from "../constants.js";
|
|
6
|
-
import b from "./messages.js";
|
|
7
|
-
import { jsx as t, jsxs as E } from "react/jsx-runtime";
|
|
8
|
-
import { ItemActionMenu as p } from "../item-action-menu/item-action-menu.js";
|
|
9
|
-
import '../../../../styles/metadata-grid.css';const R = "_itemThumbnail_93ess_1", f = {
|
|
10
|
-
itemThumbnail: R
|
|
11
|
-
}, L = 188, M = 250, A = 8, G = 5, g = (r) => L + M * (A - r) / G, O = ({
|
|
12
|
-
items: r,
|
|
13
|
-
itemActionMenuProps: n,
|
|
14
|
-
zoomLevel: o,
|
|
15
|
-
areSelectionCheckboxesDisabled: l,
|
|
16
|
-
...a
|
|
17
|
-
}) => {
|
|
18
|
-
const {
|
|
19
|
-
formatMessage: c
|
|
20
|
-
} = I();
|
|
21
|
-
return /* @__PURE__ */ t(i, {
|
|
22
|
-
"aria-label": c(b.gridView),
|
|
23
|
-
items: r,
|
|
24
|
-
style: {
|
|
25
|
-
gridTemplateColumns: `repeat(auto-fit, minmax(${g(T[o])}px, 1fr))`
|
|
26
|
-
},
|
|
27
|
-
...a,
|
|
28
|
-
children: (e) => {
|
|
29
|
-
const {
|
|
30
|
-
name: m,
|
|
31
|
-
createdAt: _
|
|
32
|
-
} = e, s = "thumbnailURLs" in e ? e.thumbnailURLs?.large || e.thumbnailURLs?.medium || e.thumbnailURLs?.small : void 0;
|
|
33
|
-
return /* @__PURE__ */ E(i.Item, {
|
|
34
|
-
textValue: m,
|
|
35
|
-
children: [/* @__PURE__ */ t(i.Thumbnail, {
|
|
36
|
-
className: f.itemThumbnail,
|
|
37
|
-
children: s ? /* @__PURE__ */ t("img", {
|
|
38
|
-
alt: m,
|
|
39
|
-
src: s
|
|
40
|
-
}) : /* @__PURE__ */ t(u, {
|
|
41
|
-
item: e
|
|
42
|
-
})
|
|
43
|
-
}), /* @__PURE__ */ t(i.Header, {
|
|
44
|
-
children: m
|
|
45
|
-
}), /* @__PURE__ */ t(i.Subtitle, {
|
|
46
|
-
children: _
|
|
47
|
-
}), /* @__PURE__ */ t(i.Actions, {
|
|
48
|
-
isSelectionCheckboxDisabled: l,
|
|
49
|
-
children: n ? (d) => /* @__PURE__ */ t(p, {
|
|
50
|
-
...n,
|
|
51
|
-
item: e,
|
|
52
|
-
onOpenChange: d,
|
|
53
|
-
viewMode: h.GRID
|
|
54
|
-
}) : null
|
|
55
|
-
})]
|
|
56
|
-
});
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
export {
|
|
61
|
-
O as MetadataGrid
|
|
62
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/metadata-grid.js";
|
|
2
|
+
export { e as MetadataGrid };
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
1
|
+
function e(e) {
|
|
2
|
+
return !!e.HeaderActions || e?.selectionMode && e.selectionMode !== "none";
|
|
3
3
|
}
|
|
4
|
-
export {
|
|
5
|
-
n as getShouldRenderActionColumn
|
|
6
|
-
};
|
|
4
|
+
export { e as getShouldRenderActionColumn };
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useVirtualizer as
|
|
3
|
-
import { Size14 as
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
totalVirtualSize: u.getTotalSize(),
|
|
25
|
-
virtualItemsToDisplay: n
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
export {
|
|
29
|
-
K as useInfiniteScrollTableItems
|
|
1
|
+
import { useEffect as e, useMemo as t, useRef as n } from "react";
|
|
2
|
+
import { useVirtualizer as r } from "@tanstack/react-virtual";
|
|
3
|
+
import { Size14 as i } from "@box/blueprint-web-assets/tokens/px-tokens";
|
|
4
|
+
var a = parseInt(i, 10), o = ({ items: i, hasNextPage: o = !1, isLoading: s = !1, parentRef: c, approximateRowHeight: l = a, onGetNextPage: u, placeholderRowsCount: d = 20 }) => {
|
|
5
|
+
let f = n(0), p = r({
|
|
6
|
+
count: t(() => i.length + (s || o ? d : 0), [
|
|
7
|
+
i,
|
|
8
|
+
o,
|
|
9
|
+
s,
|
|
10
|
+
d
|
|
11
|
+
]),
|
|
12
|
+
getScrollElement: () => c.current,
|
|
13
|
+
getItemKey: (e) => i[e]?.id || `table-item-${e}`,
|
|
14
|
+
estimateSize: () => l
|
|
15
|
+
}), m = p.getVirtualItems();
|
|
16
|
+
e(() => {
|
|
17
|
+
f.current = i.length;
|
|
18
|
+
}, [i.length]), (i.length === 0 || i.length > 0 && f.current === 0) && c.current && (c.current.scrollTop = 0);
|
|
19
|
+
let h = m[m.length - 1], g = !!h && h.index >= i.length - 1;
|
|
20
|
+
return !s && g && o && u && u(), {
|
|
21
|
+
totalVirtualSize: p.getTotalSize(),
|
|
22
|
+
virtualItemsToDisplay: m
|
|
23
|
+
};
|
|
30
24
|
};
|
|
25
|
+
export { o as useInfiniteScrollTableItems };
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { TableRenderer as
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
5
|
-
n as InlineEditingCell,
|
|
6
|
-
o as MetadataTable,
|
|
7
|
-
a as TableRenderer
|
|
8
|
-
};
|
|
1
|
+
import { t as e } from "../../../../chunks/inline-editing-cell.js";
|
|
2
|
+
import { TableRenderer as t } from "./table-renderer.js";
|
|
3
|
+
import { MetadataTable as n } from "./metadata-table.js";
|
|
4
|
+
export { e as InlineEditingCell, n as MetadataTable, t as TableRenderer };
|
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
var t = e({
|
|
3
|
+
listView: {
|
|
4
|
+
id: "groupSharedFeatures.metadataView.itemList.listView",
|
|
5
|
+
defaultMessage: "List view"
|
|
6
|
+
},
|
|
7
|
+
selectAll: {
|
|
8
|
+
id: "groupSharedFeatures.metadataView.itemList.selectAll",
|
|
9
|
+
defaultMessage: "Select all"
|
|
10
|
+
},
|
|
11
|
+
unselectedOptionLabel: {
|
|
12
|
+
id: "groupSharedFeatures.metadataView.inlineEditingCell.unselectedOptionLabel",
|
|
13
|
+
defaultMessage: "--"
|
|
14
|
+
}
|
|
15
15
|
});
|
|
16
|
-
export {
|
|
17
|
-
a as default
|
|
18
|
-
};
|
|
16
|
+
export { t as default };
|
|
@@ -1,128 +1,90 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { s as
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import { jsx as
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
isRowHeader: !1,
|
|
90
|
-
hideHeader: !1,
|
|
91
|
-
allowsSorting: !1,
|
|
92
|
-
maxWidth: x,
|
|
93
|
-
minWidth: A
|
|
94
|
-
});
|
|
95
|
-
const U = /* @__PURE__ */ t(F, {
|
|
96
|
-
columns: r,
|
|
97
|
-
children: (e) => /* @__PURE__ */ t(G, {
|
|
98
|
-
...e
|
|
99
|
-
})
|
|
100
|
-
}), p = {
|
|
101
|
-
columnCount: r.length,
|
|
102
|
-
columns: m,
|
|
103
|
-
formatMessage: f,
|
|
104
|
-
iconColumnVariant: d,
|
|
105
|
-
isLoading: s,
|
|
106
|
-
areSelectionCheckboxesDisabled: n,
|
|
107
|
-
itemActionMenuProps: w,
|
|
108
|
-
items: c,
|
|
109
|
-
onInlineEditChange: g,
|
|
110
|
-
onTableRowClick: C,
|
|
111
|
-
tableHeader: U,
|
|
112
|
-
tableProps: l,
|
|
113
|
-
zoomLevel: a
|
|
114
|
-
};
|
|
115
|
-
return T ? /* @__PURE__ */ t(E, {
|
|
116
|
-
ref: u,
|
|
117
|
-
children: /* @__PURE__ */ t(R, {
|
|
118
|
-
...p,
|
|
119
|
-
totalVirtualSize: D,
|
|
120
|
-
virtualItems: y
|
|
121
|
-
})
|
|
122
|
-
}) : /* @__PURE__ */ t(R, {
|
|
123
|
-
...p
|
|
124
|
-
});
|
|
125
|
-
};
|
|
126
|
-
export {
|
|
127
|
-
me as MetadataTable
|
|
1
|
+
import { t as e } from "../../../../chunks/types.js";
|
|
2
|
+
import { THUMBNAIL_WIDTHS as t } from "../constants.js";
|
|
3
|
+
import { useInfiniteScrollTableItems as n } from "./hooks/useInfiniteScrollTableItems.js";
|
|
4
|
+
import r from "./messages.js";
|
|
5
|
+
import { n as i } from "../../../../chunks/table-row.js";
|
|
6
|
+
import { getShouldRenderActionColumn as a } from "./actionColumn.js";
|
|
7
|
+
import { TableRenderer as o } from "./table-renderer.js";
|
|
8
|
+
import { Column as s, DataTableWrapper as c, ListCheckbox as l, TableHeader as u, Text as d } from "@box/blueprint-web";
|
|
9
|
+
import { useRef as f } from "react";
|
|
10
|
+
import { useIntl as p } from "react-intl";
|
|
11
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
12
|
+
var g = ({ areSelectionCheckboxesDisabled: g = !1, columns: _, hasNextPage: v = !1, iconColumnVariant: y, isInfiniteScrollEnabled: b = !1, isLoading: x = !1, isSelectAllEnabled: S, itemActionMenuProps: C, items: w, maxActionColumnWidth: T, minActionColumnWidth: E, onGetNextPage: D, onInlineEditChange: O, onTableRowClick: k, placeholderRowsCount: A, zoomLevel: j, ...M }) => {
|
|
13
|
+
let { formatMessage: N } = p(), P = f(null), { virtualItemsToDisplay: F, totalVirtualSize: I } = n({
|
|
14
|
+
items: w,
|
|
15
|
+
hasNextPage: v,
|
|
16
|
+
isLoading: x,
|
|
17
|
+
parentRef: P,
|
|
18
|
+
onGetNextPage: D,
|
|
19
|
+
placeholderRowsCount: A
|
|
20
|
+
}), L = [];
|
|
21
|
+
if (y === e.COLUMN) {
|
|
22
|
+
j ||= 0;
|
|
23
|
+
let e = parseInt(t[j], 10) + 24;
|
|
24
|
+
L.push({
|
|
25
|
+
id: "item-type-icon",
|
|
26
|
+
isRowHeader: !1,
|
|
27
|
+
hideHeader: !1,
|
|
28
|
+
minWidth: e,
|
|
29
|
+
maxWidth: e
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
let R = _.map((e) => {
|
|
33
|
+
let { id: t, isRowHeader: n, headerRenderer: r, textValue: i, type: a, allowsSorting: o, ...s } = e, c = a !== "multiSelect" && a !== "enum" && o === !0;
|
|
34
|
+
return {
|
|
35
|
+
...s,
|
|
36
|
+
children: r ? r(i, e) : /* @__PURE__ */ m(d, {
|
|
37
|
+
as: "span",
|
|
38
|
+
children: i
|
|
39
|
+
}),
|
|
40
|
+
isRowHeader: t === "name" || n,
|
|
41
|
+
id: t,
|
|
42
|
+
textValue: i,
|
|
43
|
+
allowsSorting: c
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
L.push(...R), a(M) && L.push({
|
|
47
|
+
id: "actions",
|
|
48
|
+
className: i.tableHeaderActions,
|
|
49
|
+
children: /* @__PURE__ */ h("div", {
|
|
50
|
+
className: i.tableHeaderActionsWrapper,
|
|
51
|
+
children: [M.HeaderActions, S ? /* @__PURE__ */ m(l, {
|
|
52
|
+
"aria-label": N(r.selectAll),
|
|
53
|
+
className: i.selectAllCheckbox,
|
|
54
|
+
isDisabled: x || g
|
|
55
|
+
}) : null]
|
|
56
|
+
}),
|
|
57
|
+
isRowHeader: !1,
|
|
58
|
+
hideHeader: !1,
|
|
59
|
+
allowsSorting: !1,
|
|
60
|
+
maxWidth: T,
|
|
61
|
+
minWidth: E
|
|
62
|
+
});
|
|
63
|
+
let z = /* @__PURE__ */ m(u, {
|
|
64
|
+
columns: L,
|
|
65
|
+
children: (e) => /* @__PURE__ */ m(s, { ...e })
|
|
66
|
+
}), B = {
|
|
67
|
+
columnCount: L.length,
|
|
68
|
+
columns: _,
|
|
69
|
+
formatMessage: N,
|
|
70
|
+
iconColumnVariant: y,
|
|
71
|
+
isLoading: x,
|
|
72
|
+
areSelectionCheckboxesDisabled: g,
|
|
73
|
+
itemActionMenuProps: C,
|
|
74
|
+
items: w,
|
|
75
|
+
onInlineEditChange: O,
|
|
76
|
+
onTableRowClick: k,
|
|
77
|
+
tableHeader: z,
|
|
78
|
+
tableProps: M,
|
|
79
|
+
zoomLevel: j
|
|
80
|
+
};
|
|
81
|
+
return b ? /* @__PURE__ */ m(c, {
|
|
82
|
+
ref: P,
|
|
83
|
+
children: /* @__PURE__ */ m(o, {
|
|
84
|
+
...B,
|
|
85
|
+
totalVirtualSize: I,
|
|
86
|
+
virtualItems: F
|
|
87
|
+
})
|
|
88
|
+
}) : /* @__PURE__ */ m(o, { ...B });
|
|
128
89
|
};
|
|
90
|
+
export { g as MetadataTable };
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}, (o, m) => ({
|
|
11
|
-
key: m
|
|
12
|
-
})),
|
|
13
|
-
children: (o) => /* @__PURE__ */ r(s, {
|
|
14
|
-
columnLength: e,
|
|
15
|
-
rowKey: o.key
|
|
16
|
-
})
|
|
1
|
+
import { GhostTableRow as e } from "./ghost-table-row/ghost-table-row.js";
|
|
2
|
+
import { TableBody as t } from "@box/blueprint-web";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
var r = 20, i = ({ columnLength: i, rowLength: a = r }) => /* @__PURE__ */ n(t, {
|
|
5
|
+
items: Array.from({ length: a }, (e, t) => ({ key: t })),
|
|
6
|
+
children: (t) => /* @__PURE__ */ n(e, {
|
|
7
|
+
columnLength: i,
|
|
8
|
+
rowKey: t.key
|
|
9
|
+
})
|
|
17
10
|
});
|
|
18
|
-
export {
|
|
19
|
-
T as GhostTableBody
|
|
20
|
-
};
|
|
11
|
+
export { i as GhostTableBody };
|
package/dist/esm/lib/components/metadata-table/table-body/ghost-table-row/ghost-table-row.js
CHANGED
|
@@ -1,20 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Size5 as m } from "@box/blueprint-web-assets/tokens/tokens";
|
|
1
|
+
import { Cell as e, Ghost as t, Row as n } from "@box/blueprint-web";
|
|
3
2
|
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
children: /* @__PURE__ */ r(l, {
|
|
12
|
-
height: m,
|
|
13
|
-
variant: "rectangle",
|
|
14
|
-
width: "100%"
|
|
15
|
-
})
|
|
16
|
-
}, e))
|
|
17
|
-
}, t);
|
|
18
|
-
export {
|
|
19
|
-
f as GhostTableRow
|
|
20
|
-
};
|
|
3
|
+
import { Size5 as i } from "@box/blueprint-web-assets/tokens/tokens";
|
|
4
|
+
var a = ({ columnLength: a, rowKey: o = "ghost-row" }) => /* @__PURE__ */ r(n, { children: Array.from({ length: a }, (n, a) => /* @__PURE__ */ r(e, { children: /* @__PURE__ */ r(t, {
|
|
5
|
+
height: i,
|
|
6
|
+
variant: "rectangle",
|
|
7
|
+
width: "100%"
|
|
8
|
+
}) }, a)) }, o);
|
|
9
|
+
export { a as GhostTableRow };
|
package/dist/esm/lib/components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js
CHANGED
|
@@ -1,56 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import S from "lodash/get";
|
|
4
|
-
import w from "lodash/isEqual";
|
|
5
|
-
import { useIntl as x } from "react-intl";
|
|
6
|
-
import y from "../../messages.js";
|
|
7
|
-
import { jsx as t, jsxs as I } from "react/jsx-runtime";
|
|
8
|
-
import '../../../../../../styles/inline-editing-cell.css';const O = "_inlineEditingCell_1iieg_1", j = {
|
|
9
|
-
inlineEditingCell: O
|
|
10
|
-
}, R = ({
|
|
11
|
-
column: d,
|
|
12
|
-
item: s,
|
|
13
|
-
onInlineEditChange: c
|
|
14
|
-
}) => {
|
|
15
|
-
const {
|
|
16
|
-
formatMessage: m
|
|
17
|
-
} = x(), {
|
|
18
|
-
type: a,
|
|
19
|
-
inlineEditingOptions: f,
|
|
20
|
-
id: u
|
|
21
|
-
} = d, r = S(s, u), n = typeof r == "string" ? [r] : r || [], o = m(y.unselectedOptionLabel), g = [{
|
|
22
|
-
value: null,
|
|
23
|
-
label: o
|
|
24
|
-
}, ...(f ?? []).map((e) => ({
|
|
25
|
-
value: e,
|
|
26
|
-
label: e
|
|
27
|
-
}))], h = (e) => {
|
|
28
|
-
if (!c)
|
|
29
|
-
return;
|
|
30
|
-
let l;
|
|
31
|
-
a === "multiSelect" ? e === null ? l = [] : l = n.includes(e) ? n.filter((C) => C !== e) : [...n, e] : l = e, (a === "multiSelect" ? !w(l, n) : l !== n[0]) && c(s, l, u);
|
|
32
|
-
}, p = (e) => e === null ? n.length === 0 : n.includes(e);
|
|
33
|
-
return /* @__PURE__ */ t(b, {
|
|
34
|
-
children: /* @__PURE__ */ I(i.Root, {
|
|
35
|
-
children: [/* @__PURE__ */ t(i.Trigger, {
|
|
36
|
-
children: /* @__PURE__ */ t(v, {
|
|
37
|
-
className: j.inlineEditingCell,
|
|
38
|
-
endIcon: E,
|
|
39
|
-
variant: "secondary",
|
|
40
|
-
children: n.length > 0 ? n.join(", ") : o
|
|
41
|
-
})
|
|
42
|
-
}), /* @__PURE__ */ t(i.Content, {
|
|
43
|
-
align: "start",
|
|
44
|
-
children: g.map((e) => /* @__PURE__ */ t(i.CheckboxItem, {
|
|
45
|
-
checked: p(e.value),
|
|
46
|
-
onSelect: () => h(e.value),
|
|
47
|
-
children: e.label
|
|
48
|
-
}, e.value ?? o))
|
|
49
|
-
})]
|
|
50
|
-
})
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
R as InlineEditingCell,
|
|
55
|
-
R as default
|
|
56
|
-
};
|
|
1
|
+
import { t as e } from "../../../../../../chunks/inline-editing-cell.js";
|
|
2
|
+
export { e as InlineEditingCell, e as default };
|