@box/metadata-view 0.24.7 → 0.24.9
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/table-body-with-data.js +139 -74
- package/dist/esm/lib/components/action-bar/action-bar.js +29 -28
- package/dist/esm/lib/components/filter-row/filter-row.js +25 -25
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +10 -10
- package/dist/esm/lib/components/metadata-table/metadata-table.js +5 -5
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +3 -2
- package/dist/esm/lib/metadata-view.js +54 -52
- package/dist/styles/metadata-view.css +1 -1
- package/dist/types/lib/components/action-bar/action-bar.d.ts +6 -3
- package/dist/types/lib/components/filter-row/filter-row.d.ts +2 -2
- package/dist/types/lib/metadata-view.d.ts +3 -3
- package/package.json +3 -3
|
@@ -1,77 +1,142 @@
|
|
|
1
|
-
import { TableBody as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
id: s,
|
|
35
|
-
subTitle: T,
|
|
36
|
-
textValue: u
|
|
37
|
-
} = a, n = `${u}-${e.id}`;
|
|
38
|
-
return s === "name" && (r === t.INLINE || r === t.INLINE_SUBTITLE) ? /* @__PURE__ */ l(c, {
|
|
39
|
-
children: /* @__PURE__ */ d("div", {
|
|
40
|
-
className: N.tableNameCell,
|
|
41
|
-
children: [/* @__PURE__ */ l(p, {
|
|
42
|
-
item: e
|
|
43
|
-
}), /* @__PURE__ */ d("div", {
|
|
44
|
-
className: f({
|
|
45
|
-
[N.tableNameCellSubTitle]: r === t.INLINE_SUBTITLE
|
|
46
|
-
}),
|
|
47
|
-
children: [/* @__PURE__ */ l(o, {
|
|
48
|
-
as: "span",
|
|
49
|
-
children: h(e, s)
|
|
50
|
-
}), r === t.INLINE_SUBTITLE ? /* @__PURE__ */ l(o, {
|
|
51
|
-
as: "span",
|
|
52
|
-
color: "textOnLightSecondary",
|
|
53
|
-
children: T
|
|
54
|
-
}) : null]
|
|
55
|
-
})]
|
|
56
|
-
})
|
|
57
|
-
}, n) : b ? /* @__PURE__ */ l(c, {
|
|
58
|
-
children: b(e, a)
|
|
59
|
-
}, n) : /* @__PURE__ */ l(c, {
|
|
60
|
-
children: /* @__PURE__ */ l(o, {
|
|
1
|
+
import { TableBody as N, Row as _, Cell as s, ActionCell as u, Text as h } from "@box/blueprint-web";
|
|
2
|
+
import I from "lodash/get";
|
|
3
|
+
import a from "react";
|
|
4
|
+
import { ItemTypeIcon as C } from "@box/item-icon";
|
|
5
|
+
import T from "clsx";
|
|
6
|
+
import { I as d } from "./types.js";
|
|
7
|
+
import { jsx as l, jsxs as m } from "react/jsx-runtime";
|
|
8
|
+
import { ItemActionMenu as x } from "../esm/lib/components/item-action-menu/item-action-menu.js";
|
|
9
|
+
import '../styles/table-body-with-data.css';const f = "_tableHeaderActionsWrapper_r2hj7_1", y = "_tableHeaderActions_r2hj7_1", A = "_selectAllCheckbox_r2hj7_33", S = "_tableNameCell_r2hj7_38", $ = "_tableNameCellSubTitle_r2hj7_44", p = {
|
|
10
|
+
tableHeaderActionsWrapper: f,
|
|
11
|
+
tableHeaderActions: y,
|
|
12
|
+
selectAllCheckbox: A,
|
|
13
|
+
tableNameCell: S,
|
|
14
|
+
tableNameCellSubTitle: $
|
|
15
|
+
}, L = /* @__PURE__ */ a.memo(({
|
|
16
|
+
item: t,
|
|
17
|
+
column: e,
|
|
18
|
+
iconColumnVariant: r
|
|
19
|
+
}) => {
|
|
20
|
+
const {
|
|
21
|
+
id: o,
|
|
22
|
+
subTitle: c
|
|
23
|
+
} = e, i = `${e.textValue}-${t.id}`;
|
|
24
|
+
return /* @__PURE__ */ l(s, {
|
|
25
|
+
children: /* @__PURE__ */ m("div", {
|
|
26
|
+
className: p.tableNameCell,
|
|
27
|
+
children: [/* @__PURE__ */ l(C, {
|
|
28
|
+
item: t
|
|
29
|
+
}), /* @__PURE__ */ m("div", {
|
|
30
|
+
className: T({
|
|
31
|
+
[p.tableNameCellSubTitle]: r === d.INLINE_SUBTITLE
|
|
32
|
+
}),
|
|
33
|
+
children: [/* @__PURE__ */ l(h, {
|
|
61
34
|
as: "span",
|
|
62
|
-
children:
|
|
63
|
-
})
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
35
|
+
children: I(t, o)
|
|
36
|
+
}), r === d.INLINE_SUBTITLE && /* @__PURE__ */ l(h, {
|
|
37
|
+
as: "span",
|
|
38
|
+
color: "textOnLightSecondary",
|
|
39
|
+
children: c
|
|
40
|
+
})]
|
|
41
|
+
})]
|
|
42
|
+
})
|
|
43
|
+
}, i);
|
|
44
|
+
}), j = /* @__PURE__ */ a.memo(({
|
|
45
|
+
item: t,
|
|
46
|
+
column: e
|
|
47
|
+
}) => {
|
|
48
|
+
var o;
|
|
49
|
+
const r = `${e.textValue}-${t.id}`;
|
|
50
|
+
return /* @__PURE__ */ l(s, {
|
|
51
|
+
children: (o = e.cellRenderer) == null ? void 0 : o.call(e, t, e)
|
|
52
|
+
}, r);
|
|
53
|
+
}), k = /* @__PURE__ */ a.memo(({
|
|
54
|
+
item: t,
|
|
55
|
+
column: e
|
|
56
|
+
}) => {
|
|
57
|
+
const r = `${e.textValue}-${t.id}`, o = I(t, e.id);
|
|
58
|
+
return o ? /* @__PURE__ */ l(s, {
|
|
59
|
+
children: o.join(" ")
|
|
60
|
+
}, r) : /* @__PURE__ */ l(s, {}, r);
|
|
61
|
+
}), E = /* @__PURE__ */ a.memo(({
|
|
62
|
+
item: t,
|
|
63
|
+
column: e
|
|
64
|
+
}) => {
|
|
65
|
+
const r = `${e.textValue}-${t.id}`;
|
|
66
|
+
return /* @__PURE__ */ l(s, {
|
|
67
|
+
children: /* @__PURE__ */ l(h, {
|
|
68
|
+
as: "span",
|
|
69
|
+
children: I(t, e.id)
|
|
70
|
+
})
|
|
71
|
+
}, r);
|
|
72
|
+
}), W = /* @__PURE__ */ a.memo(({
|
|
73
|
+
item: t,
|
|
74
|
+
column: e,
|
|
75
|
+
iconColumnVariant: r
|
|
76
|
+
}) => {
|
|
77
|
+
const {
|
|
78
|
+
cellRenderer: o,
|
|
79
|
+
id: c,
|
|
80
|
+
type: i
|
|
81
|
+
} = e;
|
|
82
|
+
return c === "name" && (r === d.INLINE || r === d.INLINE_SUBTITLE) ? /* @__PURE__ */ l(L, {
|
|
83
|
+
column: e,
|
|
84
|
+
iconColumnVariant: r,
|
|
85
|
+
item: t
|
|
86
|
+
}) : o ? /* @__PURE__ */ l(j, {
|
|
87
|
+
column: e,
|
|
88
|
+
item: t
|
|
89
|
+
}) : i === "multiSelect" ? /* @__PURE__ */ l(k, {
|
|
90
|
+
column: e,
|
|
91
|
+
item: t
|
|
92
|
+
}) : /* @__PURE__ */ l(E, {
|
|
93
|
+
column: e,
|
|
94
|
+
item: t
|
|
95
|
+
});
|
|
96
|
+
}), H = /* @__PURE__ */ a.memo(({
|
|
97
|
+
item: t
|
|
98
|
+
}) => /* @__PURE__ */ l(s, {
|
|
99
|
+
children: /* @__PURE__ */ l(C, {
|
|
100
|
+
item: t
|
|
101
|
+
})
|
|
102
|
+
}, `item-type-icon-${t.id}`)), B = /* @__PURE__ */ a.memo(({
|
|
103
|
+
item: t,
|
|
104
|
+
itemActionMenuProps: e
|
|
105
|
+
}) => /* @__PURE__ */ l(u, {
|
|
106
|
+
children: (r) => e ? /* @__PURE__ */ l(x, {
|
|
107
|
+
...e,
|
|
108
|
+
item: t,
|
|
109
|
+
onOpenChange: r
|
|
110
|
+
}) : null
|
|
111
|
+
})), V = ({
|
|
112
|
+
columns: t,
|
|
113
|
+
iconColumnVariant: e,
|
|
114
|
+
isSelectAllEnabled: r,
|
|
115
|
+
items: o,
|
|
116
|
+
itemActionMenuProps: c
|
|
117
|
+
}) => {
|
|
118
|
+
const i = e === d.COLUMN;
|
|
119
|
+
return /* @__PURE__ */ l(N, {
|
|
120
|
+
items: o.map((n) => ({
|
|
121
|
+
key: n.id,
|
|
122
|
+
...n
|
|
123
|
+
})),
|
|
124
|
+
children: (n) => /* @__PURE__ */ m(_, {
|
|
125
|
+
id: n.id,
|
|
126
|
+
children: [i && /* @__PURE__ */ l(H, {
|
|
127
|
+
item: n
|
|
128
|
+
}), t.map((b) => /* @__PURE__ */ l(W, {
|
|
129
|
+
column: b,
|
|
130
|
+
iconColumnVariant: e,
|
|
131
|
+
item: n
|
|
132
|
+
}, `${b.textValue}-${n.id}`)), r && /* @__PURE__ */ l(B, {
|
|
133
|
+
item: n,
|
|
134
|
+
itemActionMenuProps: c
|
|
135
|
+
})]
|
|
136
|
+
}, n.id)
|
|
137
|
+
});
|
|
138
|
+
};
|
|
74
139
|
export {
|
|
75
|
-
|
|
76
|
-
|
|
140
|
+
V as T,
|
|
141
|
+
p as s
|
|
77
142
|
};
|
|
@@ -1,47 +1,48 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Grid as
|
|
3
|
-
import { useIntl as
|
|
1
|
+
import { Button as f } from "@box/blueprint-web";
|
|
2
|
+
import { Grid as p } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useIntl as w } from "react-intl";
|
|
4
4
|
import { V as s } from "../../../../chunks/types.js";
|
|
5
5
|
import n from "./messages.js";
|
|
6
|
-
import { SortDropdown as
|
|
6
|
+
import { SortDropdown as _ } from "./sort-dropdown.js";
|
|
7
7
|
import { jsxs as c, jsx as i } from "react/jsx-runtime";
|
|
8
|
-
import { FilterRow as
|
|
9
|
-
import '../../../../styles/action-bar.css';const
|
|
10
|
-
actionBar:
|
|
11
|
-
filterRow:
|
|
12
|
-
additionalActions:
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
sortableColumnNames:
|
|
17
|
-
sortDropdownProps:
|
|
18
|
-
|
|
8
|
+
import { FilterRow as R } from "../filter-row/filter-row.js";
|
|
9
|
+
import '../../../../styles/action-bar.css';const B = "_actionBar_1jgp4_1", g = "_filterRow_1jgp4_8", h = "_additionalActions_1jgp4_13", o = {
|
|
10
|
+
actionBar: B,
|
|
11
|
+
filterRow: g,
|
|
12
|
+
additionalActions: h
|
|
13
|
+
}, I = ({
|
|
14
|
+
isViewModeButtonDisabled: e,
|
|
15
|
+
onViewModeClick: m,
|
|
16
|
+
sortableColumnNames: l,
|
|
17
|
+
sortDropdownProps: t,
|
|
18
|
+
viewMode: r,
|
|
19
|
+
...d
|
|
19
20
|
}) => {
|
|
20
21
|
const {
|
|
21
22
|
formatMessage: a
|
|
22
|
-
} =
|
|
23
|
+
} = w();
|
|
23
24
|
return /* @__PURE__ */ c("div", {
|
|
24
25
|
className: o.actionBar,
|
|
25
26
|
children: [/* @__PURE__ */ i("div", {
|
|
26
27
|
className: o.filterRow,
|
|
27
|
-
children: /* @__PURE__ */ i(
|
|
28
|
-
...
|
|
28
|
+
children: /* @__PURE__ */ i(R, {
|
|
29
|
+
...d
|
|
29
30
|
})
|
|
30
31
|
}), /* @__PURE__ */ c("div", {
|
|
31
32
|
className: o.additionalActions,
|
|
32
|
-
children: [
|
|
33
|
-
...
|
|
34
|
-
sortableColumnNames:
|
|
35
|
-
}), /* @__PURE__ */ i(
|
|
36
|
-
"aria-label":
|
|
37
|
-
icon:
|
|
38
|
-
onClick:
|
|
39
|
-
variant:
|
|
33
|
+
children: [t && /* @__PURE__ */ i(_, {
|
|
34
|
+
...t,
|
|
35
|
+
sortableColumnNames: l
|
|
36
|
+
}), !e && /* @__PURE__ */ i(f, {
|
|
37
|
+
"aria-label": r === s.GRID ? a(n.switchToListView) : a(n.switchToGridView),
|
|
38
|
+
icon: p,
|
|
39
|
+
onClick: m,
|
|
40
|
+
variant: r === s.GRID ? "primary" : "tertiary"
|
|
40
41
|
})]
|
|
41
42
|
})]
|
|
42
43
|
});
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
I as ActionBar,
|
|
47
|
+
I as default
|
|
47
48
|
};
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as C, useRef as S } from "react";
|
|
2
2
|
import { Formik as v, Form as G } from "formik";
|
|
3
3
|
import { FilterChip as I } from "@box/blueprint-web";
|
|
4
4
|
import R from "./all-filters-chip.js";
|
|
5
|
-
import { getInitialFieldValues as
|
|
6
|
-
import { MetadataFilterChip as
|
|
7
|
-
import { usePredefinedFilter as
|
|
8
|
-
import { s as
|
|
9
|
-
import { jsx as i, jsxs as
|
|
5
|
+
import { getInitialFieldValues as g } from "./initial-field-values.js";
|
|
6
|
+
import { MetadataFilterChip as j } from "./metadata-filter-chip.js";
|
|
7
|
+
import { usePredefinedFilter as w } from "./use-predefined-filter.js";
|
|
8
|
+
import { s as x } from "../../../../chunks/form-filter-chip.js";
|
|
9
|
+
import { jsx as i, jsxs as b } from "react/jsx-runtime";
|
|
10
10
|
const z = ({
|
|
11
11
|
disabledPredefinedFilters: n = [],
|
|
12
|
-
filterGroups:
|
|
13
|
-
isAllFiltersDisabled:
|
|
14
|
-
onFilterSubmit:
|
|
12
|
+
filterGroups: d = [],
|
|
13
|
+
isAllFiltersDisabled: p,
|
|
14
|
+
onFilterSubmit: l
|
|
15
15
|
}) => {
|
|
16
|
-
const [
|
|
16
|
+
const [s, c] = C([]), u = w(n), f = ([e, t]) => {
|
|
17
17
|
var r;
|
|
18
18
|
return ((r = t.value) == null ? void 0 : r.enum) && t.value.enum.length > 0;
|
|
19
|
-
},
|
|
19
|
+
}, h = ({
|
|
20
20
|
metadata: {
|
|
21
21
|
fields: e
|
|
22
22
|
}
|
|
23
23
|
}) => {
|
|
24
24
|
const t = Object.entries(e).filter(f).map(([r]) => r);
|
|
25
|
-
|
|
26
|
-
},
|
|
25
|
+
c(t), l && l(e);
|
|
26
|
+
}, o = [...u, ...d], m = o.flatMap(({
|
|
27
27
|
filters: e
|
|
28
|
-
}) => e),
|
|
28
|
+
}) => e), F = g(m), a = S(null);
|
|
29
29
|
return /* @__PURE__ */ i(v, {
|
|
30
|
-
initialValues:
|
|
31
|
-
onSubmit:
|
|
30
|
+
initialValues: F,
|
|
31
|
+
onSubmit: h,
|
|
32
32
|
children: /* @__PURE__ */ i(G, {
|
|
33
|
-
ref:
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
className:
|
|
33
|
+
ref: a,
|
|
34
|
+
children: /* @__PURE__ */ b(I.Group, {
|
|
35
|
+
className: x.filterChipGroup,
|
|
36
36
|
name: "metadata-view-filters",
|
|
37
37
|
type: "multiple",
|
|
38
|
-
children: [
|
|
39
|
-
activeFilterCount:
|
|
40
|
-
filterGroups:
|
|
41
|
-
}),
|
|
38
|
+
children: [p ? null : /* @__PURE__ */ i(R, {
|
|
39
|
+
activeFilterCount: s.length,
|
|
40
|
+
filterGroups: o
|
|
41
|
+
}), m.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ i(j, {
|
|
42
42
|
filterOption: e,
|
|
43
|
-
formRef:
|
|
44
|
-
selected:
|
|
43
|
+
formRef: a,
|
|
44
|
+
selected: s.includes(e.id)
|
|
45
45
|
}, e.id))]
|
|
46
46
|
})
|
|
47
47
|
})
|
|
@@ -4,18 +4,18 @@ import { useIntl as l } from "react-intl";
|
|
|
4
4
|
import { V as s } from "../../../../chunks/types.js";
|
|
5
5
|
import d from "./messages.js";
|
|
6
6
|
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
7
|
-
import { ItemActionMenu as
|
|
8
|
-
import '../../../../styles/metadata-grid.css';const
|
|
9
|
-
itemThumbnail:
|
|
7
|
+
import { ItemActionMenu as h } from "../item-action-menu/item-action-menu.js";
|
|
8
|
+
import '../../../../styles/metadata-grid.css';const u = "_itemThumbnail_1j3e6_1", p = {
|
|
9
|
+
itemThumbnail: u
|
|
10
10
|
}, w = ({
|
|
11
11
|
items: m,
|
|
12
12
|
itemActionMenuProps: t
|
|
13
13
|
}) => {
|
|
14
14
|
const {
|
|
15
|
-
formatMessage:
|
|
15
|
+
formatMessage: o
|
|
16
16
|
} = l();
|
|
17
17
|
return /* @__PURE__ */ e(i, {
|
|
18
|
-
"aria-label":
|
|
18
|
+
"aria-label": o(d.gridView),
|
|
19
19
|
selectionMode: "multiple",
|
|
20
20
|
children: m.map((r, f) => /* @__PURE__ */ c(i.Item, {
|
|
21
21
|
children: [/* @__PURE__ */ e(i.Thumbnail, {
|
|
@@ -28,14 +28,14 @@ import '../../../../styles/metadata-grid.css';const h = "_itemThumbnail_1j3e6_1"
|
|
|
28
28
|
children: r.name
|
|
29
29
|
}), /* @__PURE__ */ e(i.Subtitle, {
|
|
30
30
|
children: r.createdAt
|
|
31
|
-
}), /* @__PURE__ */ e(i.Actions, {
|
|
32
|
-
children: (
|
|
31
|
+
}), t ? /* @__PURE__ */ e(i.Actions, {
|
|
32
|
+
children: (n) => /* @__PURE__ */ e(h, {
|
|
33
33
|
...t,
|
|
34
34
|
item: r,
|
|
35
|
-
onOpenChange:
|
|
35
|
+
onOpenChange: n,
|
|
36
36
|
viewMode: s.GRID
|
|
37
|
-
})
|
|
38
|
-
})]
|
|
37
|
+
})
|
|
38
|
+
}) : null]
|
|
39
39
|
}, r.id))
|
|
40
40
|
});
|
|
41
41
|
};
|
|
@@ -7,11 +7,11 @@ import h from "./messages.js";
|
|
|
7
7
|
import { jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
8
8
|
const L = ({
|
|
9
9
|
columns: l,
|
|
10
|
-
isLoading: i,
|
|
10
|
+
isLoading: i = !1,
|
|
11
11
|
iconColumnVariant: o,
|
|
12
12
|
isSelectAllEnabled: d,
|
|
13
|
-
items:
|
|
14
|
-
itemActionMenuProps:
|
|
13
|
+
items: f,
|
|
14
|
+
itemActionMenuProps: p,
|
|
15
15
|
...u
|
|
16
16
|
}) => {
|
|
17
17
|
const {
|
|
@@ -72,8 +72,8 @@ const L = ({
|
|
|
72
72
|
columns: l,
|
|
73
73
|
iconColumnVariant: o,
|
|
74
74
|
isSelectAllEnabled: d,
|
|
75
|
-
itemActionMenuProps:
|
|
76
|
-
items:
|
|
75
|
+
itemActionMenuProps: p,
|
|
76
|
+
items: f
|
|
77
77
|
})]
|
|
78
78
|
});
|
|
79
79
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import "@box/blueprint-web";
|
|
2
2
|
import "lodash/get";
|
|
3
|
+
import "react";
|
|
3
4
|
import "@box/item-icon";
|
|
4
5
|
import "clsx";
|
|
5
6
|
import "../../../../../chunks/types.js";
|
|
6
|
-
import { T as
|
|
7
|
+
import { T as l } from "../../../../../chunks/table-body-with-data.js";
|
|
7
8
|
import "react/jsx-runtime";
|
|
8
9
|
import "../../item-action-menu/item-action-menu.js";
|
|
9
10
|
export {
|
|
10
|
-
|
|
11
|
+
l as default
|
|
11
12
|
};
|
|
@@ -2,66 +2,68 @@ import { useState as V } from "react";
|
|
|
2
2
|
import u from "./components/error-state/error-state.js";
|
|
3
3
|
import I from "./components/pagination/pagination.js";
|
|
4
4
|
import { MetadataGrid as T } from "./components/metadata-grid/metadata-grid.js";
|
|
5
|
-
import { SwitchCase as
|
|
5
|
+
import { SwitchCase as _, Case as a } from "./components/switch-case/switch-case.js";
|
|
6
6
|
import { V as e } from "../../chunks/types.js";
|
|
7
|
-
import { jsxs as
|
|
8
|
-
import { ActionBar as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import '../../styles/metadata-view.css';const
|
|
12
|
-
|
|
7
|
+
import { jsx as t, jsxs as s, Fragment as x } from "react/jsx-runtime";
|
|
8
|
+
import { ActionBar as b } from "./components/action-bar/action-bar.js";
|
|
9
|
+
import k from "./components/empty-state/empty-state.js";
|
|
10
|
+
import v from "./components/metadata-table/metadata-table.js";
|
|
11
|
+
import '../../styles/metadata-view.css';const D = "_container_nykl3_5", E = "_contentContainer_nykl3_14", p = {
|
|
12
|
+
container: D,
|
|
13
|
+
contentContainer: E
|
|
13
14
|
};
|
|
14
|
-
function
|
|
15
|
-
actionBarProps:
|
|
15
|
+
function H({
|
|
16
|
+
actionBarProps: i,
|
|
16
17
|
columns: m,
|
|
17
|
-
tableProps:
|
|
18
|
-
hasError:
|
|
19
|
-
onRefresh:
|
|
20
|
-
initialViewMode:
|
|
18
|
+
tableProps: f,
|
|
19
|
+
hasError: h,
|
|
20
|
+
onRefresh: C,
|
|
21
|
+
initialViewMode: M = e.LIST,
|
|
21
22
|
paginationProps: c,
|
|
23
|
+
isLoading: d,
|
|
22
24
|
...r
|
|
23
25
|
}) {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
return /* @__PURE__ */
|
|
26
|
+
const [n, l] = V(M), S = () => {
|
|
27
|
+
n === e.LIST ? l(e.GRID) : l(e.LIST);
|
|
28
|
+
}, w = !d && r.items.length === 0, y = i && i.sortDropdownProps && m.filter((o) => o.type !== "multiSelect" && o.type !== "enum").map((o) => o.textValue);
|
|
29
|
+
return /* @__PURE__ */ t("div", {
|
|
28
30
|
className: p.container,
|
|
29
|
-
children:
|
|
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
|
-
})
|
|
31
|
+
children: h ? /* @__PURE__ */ t(u, {
|
|
32
|
+
onRefresh: C
|
|
33
|
+
}) : /* @__PURE__ */ s(x, {
|
|
34
|
+
children: [/* @__PURE__ */ t(b, {
|
|
35
|
+
...i,
|
|
36
|
+
onViewModeClick: S,
|
|
37
|
+
sortableColumnNames: y,
|
|
38
|
+
viewMode: n
|
|
39
|
+
}), /* @__PURE__ */ t("div", {
|
|
40
|
+
className: p.contentContainer,
|
|
41
|
+
children: /* @__PURE__ */ s(_, {
|
|
42
|
+
children: [/* @__PURE__ */ t(a, {
|
|
43
|
+
condition: w,
|
|
44
|
+
children: /* @__PURE__ */ t(k, {})
|
|
45
|
+
}), /* @__PURE__ */ t(a, {
|
|
46
|
+
condition: n === e.LIST,
|
|
47
|
+
children: /* @__PURE__ */ t(v, {
|
|
48
|
+
columns: m,
|
|
49
|
+
isLoading: d,
|
|
50
|
+
...r,
|
|
51
|
+
...f
|
|
52
|
+
})
|
|
53
|
+
}), /* @__PURE__ */ t(a, {
|
|
54
|
+
condition: n === e.GRID,
|
|
55
|
+
children: /* @__PURE__ */ t(T, {
|
|
56
|
+
...r
|
|
57
|
+
})
|
|
58
|
+
})]
|
|
59
|
+
})
|
|
60
|
+
}), c && /* @__PURE__ */ t(I, {
|
|
61
|
+
...c
|
|
62
|
+
})]
|
|
63
|
+
})
|
|
62
64
|
});
|
|
63
65
|
}
|
|
64
66
|
export {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
H as MetadataView,
|
|
68
|
+
H as default
|
|
67
69
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.
|
|
1
|
+
._container_nykl3_5{display:flex;flex-direction:column;overflow:hidden}._contentContainer_nykl3_14{overflow:auto}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { FilterRowProps } from '../filter-row';
|
|
2
2
|
import { ViewMode } from '../../types';
|
|
3
3
|
import { SortDropdownProps } from './sort-dropdown';
|
|
4
|
-
|
|
4
|
+
import { FilterGroup } from '../filter-row/types';
|
|
5
|
+
export interface ActionBarProps extends Omit<FilterRowProps, 'filterGroups'> {
|
|
6
|
+
filterGroups?: FilterGroup[];
|
|
7
|
+
isViewModeButtonDisabled?: boolean;
|
|
5
8
|
onViewModeClick?: () => void;
|
|
6
|
-
viewMode?: ViewMode;
|
|
7
9
|
sortableColumnNames: string[];
|
|
8
10
|
sortDropdownProps?: SortDropdownProps;
|
|
11
|
+
viewMode?: ViewMode;
|
|
9
12
|
}
|
|
10
|
-
export declare const ActionBar: ({
|
|
13
|
+
export declare const ActionBar: ({ isViewModeButtonDisabled, onViewModeClick, sortableColumnNames, sortDropdownProps, viewMode, ...rest }: ActionBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
14
|
export default ActionBar;
|
|
@@ -2,9 +2,9 @@ import { MetadataTemplateField } from '@box/metadata-filter';
|
|
|
2
2
|
import { FilterGroup, PredefinedFilterName } from './types';
|
|
3
3
|
export interface FilterRowProps {
|
|
4
4
|
disabledPredefinedFilters?: Array<PredefinedFilterName>;
|
|
5
|
-
filterGroups
|
|
5
|
+
filterGroups?: Array<FilterGroup>;
|
|
6
6
|
isAllFiltersDisabled?: boolean;
|
|
7
|
-
onFilterSubmit
|
|
7
|
+
onFilterSubmit?: (fields: MetadataTemplateField[]) => void;
|
|
8
8
|
}
|
|
9
9
|
export declare const FilterRow: ({ disabledPredefinedFilters, filterGroups: customFilterGroups, isAllFiltersDisabled, onFilterSubmit, }: FilterRowProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default FilterRow;
|
|
@@ -3,13 +3,13 @@ import { PaginationProps } from './components/pagination/pagination';
|
|
|
3
3
|
import { ActionBarProps } from './components/action-bar';
|
|
4
4
|
import { ViewMode, Column, MetadataProps } from './types';
|
|
5
5
|
export interface MetadataViewProps extends MetadataProps {
|
|
6
|
-
columns: Column[];
|
|
7
6
|
actionBarProps?: Omit<ActionBarProps, 'onViewModeClick' | 'viewMode' | 'sortableColumnNames'>;
|
|
7
|
+
columns: Column[];
|
|
8
8
|
hasError?: boolean;
|
|
9
9
|
initialViewMode?: ViewMode;
|
|
10
10
|
onRefresh?: () => void;
|
|
11
|
-
tableProps
|
|
11
|
+
tableProps?: Omit<MetadataTableProps, 'columns' | 'items' | 'itemActionMenuProps'>;
|
|
12
12
|
paginationProps?: PaginationProps;
|
|
13
13
|
}
|
|
14
|
-
export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, onRefresh, initialViewMode, paginationProps, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, onRefresh, initialViewMode, paginationProps, isLoading, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export default MetadataView;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.9",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@box/blueprint-web": "^11.12.0",
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
"@box/blueprint-web": "^11.12.0",
|
|
20
20
|
"@box/blueprint-web-assets": "^4.58.0",
|
|
21
21
|
"@box/eslint-plugin-blueprint": "*",
|
|
22
|
-
"@box/item-icon": "^0.13.
|
|
23
|
-
"@box/metadata-filter": "^1.15.
|
|
22
|
+
"@box/item-icon": "^0.13.13",
|
|
23
|
+
"@box/metadata-filter": "^1.15.8",
|
|
24
24
|
"@box/storybook-utils": "0.13.12",
|
|
25
25
|
"@box/types": "0.2.1",
|
|
26
26
|
"react-intl": "^6.4.2"
|