@box/metadata-view 0.19.1 → 0.20.1
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 +44 -47
- package/dist/chunks/types.js +9 -0
- package/dist/esm/index.js +5 -2
- package/dist/esm/lib/components/action-bar/action-bar.js +35 -22
- package/dist/esm/lib/components/action-bar/messages.js +14 -0
- package/dist/esm/lib/components/item-action-menu/item-action-menu.js +77 -63
- package/dist/esm/lib/components/metadata-grid/index.js +1 -0
- package/dist/esm/lib/components/metadata-grid/messages.js +10 -0
- package/dist/esm/lib/components/metadata-grid/metadata-grid.js +45 -0
- package/dist/esm/lib/components/metadata-table/metadata-table.js +18 -17
- package/dist/esm/lib/components/metadata-table/table-body/table-body-with-data.js +3 -2
- package/dist/esm/lib/components/switch-case/switch-case.js +14 -0
- package/dist/esm/lib/metadata-view.js +51 -28
- package/dist/i18n/bn-IN.js +5 -2
- package/dist/i18n/bn-IN.properties +16 -0
- package/dist/i18n/da-DK.js +5 -2
- package/dist/i18n/da-DK.properties +16 -0
- package/dist/i18n/de-DE.js +5 -2
- package/dist/i18n/de-DE.properties +16 -0
- package/dist/i18n/en-AU.js +3 -0
- package/dist/i18n/en-AU.properties +16 -0
- package/dist/i18n/en-CA.js +3 -0
- package/dist/i18n/en-CA.properties +16 -0
- package/dist/i18n/en-GB.js +3 -0
- package/dist/i18n/en-GB.properties +16 -0
- package/dist/i18n/en-US.js +3 -0
- package/dist/i18n/en-US.properties +6 -0
- package/dist/i18n/en-x-pseudo.js +18 -15
- package/dist/i18n/en-x-pseudo.properties +23 -7
- package/dist/i18n/es-419.js +5 -2
- package/dist/i18n/es-419.properties +16 -0
- package/dist/i18n/es-ES.js +5 -2
- package/dist/i18n/es-ES.properties +16 -0
- package/dist/i18n/fi-FI.js +5 -2
- package/dist/i18n/fi-FI.properties +16 -0
- package/dist/i18n/fr-CA.js +5 -2
- package/dist/i18n/fr-CA.properties +16 -0
- package/dist/i18n/fr-FR.js +5 -2
- package/dist/i18n/fr-FR.properties +16 -0
- package/dist/i18n/hi-IN.js +5 -2
- package/dist/i18n/hi-IN.properties +16 -0
- package/dist/i18n/it-IT.js +6 -3
- package/dist/i18n/it-IT.properties +17 -1
- package/dist/i18n/ja-JP.js +5 -2
- package/dist/i18n/ja-JP.properties +16 -0
- package/dist/i18n/json/src/lib/components/action-bar/messages.json +1 -0
- package/dist/i18n/json/src/lib/components/metadata-grid/messages.json +1 -0
- package/dist/i18n/ko-KR.js +5 -2
- package/dist/i18n/ko-KR.properties +16 -0
- package/dist/i18n/nb-NO.js +6 -3
- package/dist/i18n/nb-NO.properties +17 -1
- package/dist/i18n/nl-NL.js +5 -2
- package/dist/i18n/nl-NL.properties +16 -0
- package/dist/i18n/pl-PL.js +5 -2
- package/dist/i18n/pl-PL.properties +16 -0
- package/dist/i18n/pt-BR.js +5 -2
- package/dist/i18n/pt-BR.properties +16 -0
- package/dist/i18n/ru-RU.js +5 -2
- package/dist/i18n/ru-RU.properties +16 -0
- package/dist/i18n/sv-SE.js +5 -2
- package/dist/i18n/sv-SE.properties +16 -0
- package/dist/i18n/tr-TR.js +5 -2
- package/dist/i18n/tr-TR.properties +16 -0
- package/dist/i18n/zh-CN.js +5 -2
- package/dist/i18n/zh-CN.properties +16 -0
- package/dist/i18n/zh-TW.js +5 -2
- package/dist/i18n/zh-TW.properties +16 -0
- package/dist/styles/metadata-grid.css +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/lib/components/action-bar/action-bar.d.ts +5 -3
- package/dist/types/lib/components/action-bar/messages.d.ts +13 -0
- package/dist/types/lib/components/item-action-menu/item-action-menu.d.ts +3 -1
- package/dist/types/lib/components/metadata-grid/index.d.ts +0 -0
- package/dist/types/lib/components/metadata-grid/messages.d.ts +8 -0
- package/dist/types/lib/components/metadata-grid/metadata-grid.d.ts +4 -0
- package/dist/types/lib/components/metadata-table/metadata-table.d.ts +2 -7
- package/dist/types/lib/components/switch-case/switch-case.d.ts +12 -0
- package/dist/types/lib/metadata-view.d.ts +7 -5
- package/dist/types/lib/types.d.ts +10 -0
- package/package.json +5 -5
|
@@ -1,80 +1,77 @@
|
|
|
1
|
-
import { TableBody as
|
|
1
|
+
import { TableBody as C, Row as x, Cell as c, Text as o, ActionCell as A } from "@box/blueprint-web";
|
|
2
2
|
import h from "lodash/get";
|
|
3
3
|
import { ItemTypeIcon as p } from "@box/item-icon";
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const C = "_tableHeaderActionsWrapper_r2hj7_1", S = "_tableHeaderActions_r2hj7_1", y = "_selectAllCheckbox_r2hj7_33", j = "_tableNameCell_r2hj7_38", B = "_tableNameCellSubTitle_r2hj7_44", I = {
|
|
11
|
-
tableHeaderActionsWrapper: C,
|
|
4
|
+
import f from "clsx";
|
|
5
|
+
import { I as t } from "./types.js";
|
|
6
|
+
import { jsx as l, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import { ItemActionMenu as L } from "../esm/lib/components/item-action-menu/item-action-menu.js";
|
|
8
|
+
import '../styles/table-body-with-data.css';const y = "_tableHeaderActionsWrapper_r2hj7_1", S = "_tableHeaderActions_r2hj7_1", j = "_selectAllCheckbox_r2hj7_33", E = "_tableNameCell_r2hj7_38", H = "_tableNameCellSubTitle_r2hj7_44", N = {
|
|
9
|
+
tableHeaderActionsWrapper: y,
|
|
12
10
|
tableHeaderActions: S,
|
|
13
|
-
selectAllCheckbox:
|
|
14
|
-
tableNameCell:
|
|
15
|
-
tableNameCellSubTitle:
|
|
16
|
-
},
|
|
17
|
-
columns:
|
|
11
|
+
selectAllCheckbox: j,
|
|
12
|
+
tableNameCell: E,
|
|
13
|
+
tableNameCellSubTitle: H
|
|
14
|
+
}, O = ({
|
|
15
|
+
columns: m,
|
|
18
16
|
iconColumnVariant: r,
|
|
19
17
|
isSelectAllEnabled: _,
|
|
20
|
-
items:
|
|
21
|
-
itemActionMenuProps:
|
|
22
|
-
}) => /* @__PURE__ */ l(
|
|
23
|
-
items:
|
|
18
|
+
items: I,
|
|
19
|
+
itemActionMenuProps: i
|
|
20
|
+
}) => /* @__PURE__ */ l(C, {
|
|
21
|
+
items: I.map((e) => ({
|
|
24
22
|
key: e.id,
|
|
25
23
|
...e
|
|
26
24
|
})),
|
|
27
|
-
children: (e) => /* @__PURE__ */
|
|
25
|
+
children: (e) => /* @__PURE__ */ d(x, {
|
|
28
26
|
id: e.id,
|
|
29
|
-
children: [r ===
|
|
27
|
+
children: [r === t.COLUMN ? /* @__PURE__ */ l(c, {
|
|
30
28
|
children: /* @__PURE__ */ l(p, {
|
|
31
29
|
item: e
|
|
32
30
|
})
|
|
33
|
-
}, `item-type-icon-${e.id}`) : null,
|
|
31
|
+
}, `item-type-icon-${e.id}`) : null, m.map((a) => {
|
|
34
32
|
const {
|
|
35
|
-
cellRenderer:
|
|
36
|
-
id:
|
|
37
|
-
subTitle:
|
|
33
|
+
cellRenderer: b,
|
|
34
|
+
id: s,
|
|
35
|
+
subTitle: T,
|
|
38
36
|
textValue: u
|
|
39
|
-
} =
|
|
40
|
-
return
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
className:
|
|
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,
|
|
43
41
|
children: [/* @__PURE__ */ l(p, {
|
|
44
42
|
item: e
|
|
45
|
-
}), /* @__PURE__ */
|
|
46
|
-
className:
|
|
47
|
-
[
|
|
43
|
+
}), /* @__PURE__ */ d("div", {
|
|
44
|
+
className: f({
|
|
45
|
+
[N.tableNameCellSubTitle]: r === t.INLINE_SUBTITLE
|
|
48
46
|
}),
|
|
49
|
-
children: [/* @__PURE__ */ l(
|
|
47
|
+
children: [/* @__PURE__ */ l(o, {
|
|
50
48
|
as: "span",
|
|
51
|
-
children: h(e,
|
|
52
|
-
}), r ===
|
|
49
|
+
children: h(e, s)
|
|
50
|
+
}), r === t.INLINE_SUBTITLE ? /* @__PURE__ */ l(o, {
|
|
53
51
|
as: "span",
|
|
54
52
|
color: "textOnLightSecondary",
|
|
55
|
-
children:
|
|
53
|
+
children: T
|
|
56
54
|
}) : null]
|
|
57
55
|
})]
|
|
58
56
|
})
|
|
59
|
-
},
|
|
60
|
-
children:
|
|
61
|
-
},
|
|
62
|
-
children: /* @__PURE__ */ l(
|
|
57
|
+
}, n) : b ? /* @__PURE__ */ l(c, {
|
|
58
|
+
children: b(e, a)
|
|
59
|
+
}, n) : /* @__PURE__ */ l(c, {
|
|
60
|
+
children: /* @__PURE__ */ l(o, {
|
|
63
61
|
as: "span",
|
|
64
|
-
children: h(e,
|
|
62
|
+
children: h(e, s)
|
|
65
63
|
})
|
|
66
|
-
},
|
|
64
|
+
}, n);
|
|
67
65
|
}), _ && /* @__PURE__ */ l(A, {
|
|
68
|
-
children: (
|
|
69
|
-
...
|
|
66
|
+
children: (a) => i ? /* @__PURE__ */ l(L, {
|
|
67
|
+
...i,
|
|
70
68
|
item: e,
|
|
71
|
-
onOpenChange:
|
|
69
|
+
onOpenChange: a
|
|
72
70
|
}) : null
|
|
73
71
|
})]
|
|
74
72
|
}, e.id)
|
|
75
73
|
});
|
|
76
74
|
export {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
I as s
|
|
75
|
+
O as T,
|
|
76
|
+
N as s
|
|
80
77
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { MetadataView as
|
|
1
|
+
import { MetadataView as e } from "./lib/metadata-view.js";
|
|
2
|
+
import { I as t, V } from "../chunks/types.js";
|
|
2
3
|
export {
|
|
3
|
-
t as
|
|
4
|
+
t as IconColumnVariant,
|
|
5
|
+
e as MetadataView,
|
|
6
|
+
V as ViewMode
|
|
4
7
|
};
|
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
1
|
+
import { Button as n } from "@box/blueprint-web";
|
|
2
|
+
import { Grid as m } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useIntl as c } from "react-intl";
|
|
4
|
+
import { V as t } from "../../../../chunks/types.js";
|
|
5
|
+
import a from "./messages.js";
|
|
6
|
+
import { jsxs as l, jsx as r } from "react/jsx-runtime";
|
|
7
|
+
import { FilterRow as d } from "../filter-row/filter-row.js";
|
|
8
|
+
import '../../../../styles/action-bar.css';const f = "_actionBar_17enr_1", p = {
|
|
9
|
+
actionBar: f
|
|
10
|
+
}, x = ({
|
|
11
|
+
onViewModeClick: s,
|
|
12
|
+
viewMode: i,
|
|
13
|
+
...e
|
|
14
|
+
}) => {
|
|
15
|
+
const {
|
|
16
|
+
formatMessage: o
|
|
17
|
+
} = c();
|
|
18
|
+
return /* @__PURE__ */ l("div", {
|
|
19
|
+
className: p.actionBar,
|
|
20
|
+
children: [/* @__PURE__ */ r("div", {
|
|
21
|
+
children: /* @__PURE__ */ r(d, {
|
|
22
|
+
...e
|
|
23
|
+
})
|
|
24
|
+
}), /* @__PURE__ */ r("div", {
|
|
25
|
+
children: /* @__PURE__ */ r(n, {
|
|
26
|
+
"aria-label": i === t.GRID ? o(a.switchToListView) : o(a.switchToGridView),
|
|
27
|
+
icon: m,
|
|
28
|
+
onClick: s,
|
|
29
|
+
variant: i === t.GRID ? "primary" : "tertiary"
|
|
30
|
+
})
|
|
31
|
+
})]
|
|
32
|
+
});
|
|
33
|
+
};
|
|
21
34
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
35
|
+
x as ActionBar,
|
|
36
|
+
x as default
|
|
24
37
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineMessages as e } from "react-intl";
|
|
2
|
+
const t = e({
|
|
3
|
+
switchToGridView: {
|
|
4
|
+
id: "groupSharedFeatures.metadataView.actionBar.switchToGridView",
|
|
5
|
+
defaultMessage: "Switch to Grid View"
|
|
6
|
+
},
|
|
7
|
+
switchToListView: {
|
|
8
|
+
id: "groupSharedFeatures.metadataView.actionBar.switchToListView",
|
|
9
|
+
defaultMessage: "Switch to List View"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
t as default
|
|
14
|
+
};
|
|
@@ -1,84 +1,98 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import { IconButton as
|
|
3
|
-
import { Ellipsis as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { useIntl as _ } from "react-intl";
|
|
2
|
+
import { IconButton as h, DropdownMenu as n, GridList as M } from "@box/blueprint-web";
|
|
3
|
+
import { Ellipsis as S } from "@box/blueprint-web-assets/icons/Fill";
|
|
4
|
+
import B from "./messages.js";
|
|
5
|
+
import { V as u } from "../../../../chunks/types.js";
|
|
6
|
+
import { jsxs as e, jsx as o } from "react/jsx-runtime";
|
|
7
|
+
import '../../../../styles/item-action-menu.css';const L = "_tableActionBar_akgtp_1", T = "_actionItemIcon_akgtp_6", d = {
|
|
8
|
+
tableActionBar: L,
|
|
9
|
+
actionItemIcon: T
|
|
9
10
|
};
|
|
10
|
-
function
|
|
11
|
-
item:
|
|
12
|
-
label:
|
|
13
|
-
onClick:
|
|
11
|
+
function k({
|
|
12
|
+
item: l,
|
|
13
|
+
label: t,
|
|
14
|
+
onClick: m,
|
|
14
15
|
icon: r
|
|
15
16
|
}) {
|
|
16
|
-
const
|
|
17
|
-
l
|
|
17
|
+
const I = () => {
|
|
18
|
+
m(l);
|
|
18
19
|
};
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
onClick:
|
|
21
|
-
children: [/* @__PURE__ */
|
|
22
|
-
className:
|
|
23
|
-
}),
|
|
24
|
-
},
|
|
20
|
+
return /* @__PURE__ */ e(n.Item, {
|
|
21
|
+
onClick: I,
|
|
22
|
+
children: [/* @__PURE__ */ o(r, {
|
|
23
|
+
className: d.actionItemIcon
|
|
24
|
+
}), t]
|
|
25
|
+
}, t);
|
|
25
26
|
}
|
|
26
|
-
function
|
|
27
|
-
actions:
|
|
28
|
-
inlineActions:
|
|
29
|
-
isDisabled:
|
|
27
|
+
function G({
|
|
28
|
+
actions: l,
|
|
29
|
+
inlineActions: t,
|
|
30
|
+
isDisabled: m,
|
|
30
31
|
item: r,
|
|
31
|
-
onOpenChange:
|
|
32
|
-
subMenuActions:
|
|
33
|
-
subMenuTrigger:
|
|
32
|
+
onOpenChange: I,
|
|
33
|
+
subMenuActions: p,
|
|
34
|
+
subMenuTrigger: b,
|
|
35
|
+
viewMode: i = u.LIST
|
|
34
36
|
}) {
|
|
35
37
|
const {
|
|
36
|
-
formatMessage:
|
|
37
|
-
} =
|
|
38
|
-
label:
|
|
39
|
-
icon:
|
|
40
|
-
} =
|
|
41
|
-
return /* @__PURE__ */
|
|
42
|
-
className:
|
|
43
|
-
children: [
|
|
44
|
-
onClick:
|
|
45
|
-
label:
|
|
46
|
-
icon:
|
|
47
|
-
}) => /* @__PURE__ */
|
|
48
|
-
"aria-label":
|
|
49
|
-
icon:
|
|
50
|
-
onClick: () =>
|
|
38
|
+
formatMessage: f
|
|
39
|
+
} = _(), {
|
|
40
|
+
label: C,
|
|
41
|
+
icon: g
|
|
42
|
+
} = b || {};
|
|
43
|
+
return /* @__PURE__ */ e("div", {
|
|
44
|
+
className: d.tableActionBar,
|
|
45
|
+
children: [i === u.LIST && (t == null ? void 0 : t.map(({
|
|
46
|
+
onClick: a,
|
|
47
|
+
label: c,
|
|
48
|
+
icon: s
|
|
49
|
+
}) => /* @__PURE__ */ o(h, {
|
|
50
|
+
"aria-label": c,
|
|
51
|
+
icon: s,
|
|
52
|
+
onClick: () => a(r),
|
|
51
53
|
size: "large"
|
|
52
|
-
}, `${r.id}-${
|
|
53
|
-
onOpenChange:
|
|
54
|
-
children: [/* @__PURE__ */
|
|
55
|
-
children: /* @__PURE__ */
|
|
56
|
-
"aria-label":
|
|
57
|
-
disabled:
|
|
58
|
-
icon:
|
|
54
|
+
}, `${r.id}-${c}`))), l ? /* @__PURE__ */ e(n.Root, {
|
|
55
|
+
onOpenChange: I,
|
|
56
|
+
children: [/* @__PURE__ */ o(n.Trigger, {
|
|
57
|
+
children: i === u.LIST ? /* @__PURE__ */ o(h, {
|
|
58
|
+
"aria-label": f(B.actionMenu),
|
|
59
|
+
disabled: m,
|
|
60
|
+
icon: S,
|
|
59
61
|
size: "large"
|
|
62
|
+
}) : /* @__PURE__ */ o(M.ActionIconButton, {
|
|
63
|
+
"aria-label": f(B.actionMenu),
|
|
64
|
+
disabled: m,
|
|
65
|
+
icon: S
|
|
60
66
|
})
|
|
61
|
-
}), /* @__PURE__ */
|
|
67
|
+
}), /* @__PURE__ */ e(n.Content, {
|
|
62
68
|
align: "start",
|
|
63
|
-
children: [
|
|
69
|
+
children: [l.map((a) => /* @__PURE__ */ o(k, {
|
|
64
70
|
item: r,
|
|
65
|
-
...
|
|
66
|
-
},
|
|
67
|
-
children: [/* @__PURE__ */
|
|
68
|
-
children: [
|
|
69
|
-
className:
|
|
70
|
-
}),
|
|
71
|
-
}), /* @__PURE__ */
|
|
72
|
-
children:
|
|
71
|
+
...a
|
|
72
|
+
}, a.label)), p && b && /* @__PURE__ */ e(n.SubMenuRoot, {
|
|
73
|
+
children: [/* @__PURE__ */ e(n.SubMenuTrigger, {
|
|
74
|
+
children: [g && /* @__PURE__ */ o(g, {
|
|
75
|
+
className: d.actionItemIcon
|
|
76
|
+
}), C]
|
|
77
|
+
}), /* @__PURE__ */ o(n.SubMenuContent, {
|
|
78
|
+
children: p.map((a) => /* @__PURE__ */ o(k, {
|
|
73
79
|
item: r,
|
|
74
|
-
...
|
|
75
|
-
},
|
|
80
|
+
...a
|
|
81
|
+
}, a.label))
|
|
76
82
|
})]
|
|
77
83
|
})]
|
|
78
84
|
})]
|
|
79
|
-
}) : null
|
|
85
|
+
}) : null, i === u.GRID && (t == null ? void 0 : t.map(({
|
|
86
|
+
onClick: a,
|
|
87
|
+
label: c,
|
|
88
|
+
icon: s
|
|
89
|
+
}) => /* @__PURE__ */ o(M.ActionIconButton, {
|
|
90
|
+
"aria-label": c,
|
|
91
|
+
icon: s,
|
|
92
|
+
onClick: () => a(r)
|
|
93
|
+
}, `${r.id}-${c}`)))]
|
|
80
94
|
});
|
|
81
95
|
}
|
|
82
96
|
export {
|
|
83
|
-
|
|
97
|
+
G as ItemActionMenu
|
|
84
98
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { GridList as i } from "@box/blueprint-web";
|
|
2
|
+
import { ItemTypeIcon as a } from "@box/item-icon";
|
|
3
|
+
import { useIntl as l } from "react-intl";
|
|
4
|
+
import { V as s } from "../../../../chunks/types.js";
|
|
5
|
+
import d from "./messages.js";
|
|
6
|
+
import { jsx as e, jsxs as c } from "react/jsx-runtime";
|
|
7
|
+
import { ItemActionMenu as u } from "../item-action-menu/item-action-menu.js";
|
|
8
|
+
import '../../../../styles/metadata-grid.css';const h = "_itemThumbnail_1j3e6_1", p = {
|
|
9
|
+
itemThumbnail: h
|
|
10
|
+
}, w = ({
|
|
11
|
+
items: m,
|
|
12
|
+
itemActionMenuProps: t
|
|
13
|
+
}) => {
|
|
14
|
+
const {
|
|
15
|
+
formatMessage: n
|
|
16
|
+
} = l();
|
|
17
|
+
return /* @__PURE__ */ e(i, {
|
|
18
|
+
"aria-label": n(d.gridView),
|
|
19
|
+
selectionMode: "multiple",
|
|
20
|
+
children: m.map((r, f) => /* @__PURE__ */ c(i.Item, {
|
|
21
|
+
children: [/* @__PURE__ */ e(i.Thumbnail, {
|
|
22
|
+
className: p.itemThumbnail,
|
|
23
|
+
children: /* @__PURE__ */ e(a, {
|
|
24
|
+
dimension: 128,
|
|
25
|
+
item: r
|
|
26
|
+
})
|
|
27
|
+
}), /* @__PURE__ */ e(i.Header, {
|
|
28
|
+
children: r.name
|
|
29
|
+
}), /* @__PURE__ */ e(i.Subtitle, {
|
|
30
|
+
children: r.createdAt
|
|
31
|
+
}), /* @__PURE__ */ e(i.Actions, {
|
|
32
|
+
children: (o) => t ? /* @__PURE__ */ e(u, {
|
|
33
|
+
...t,
|
|
34
|
+
item: r,
|
|
35
|
+
onOpenChange: o,
|
|
36
|
+
viewMode: s.GRID
|
|
37
|
+
}) : null
|
|
38
|
+
})]
|
|
39
|
+
}, r.id))
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
w as MetadataGrid,
|
|
44
|
+
w as default
|
|
45
|
+
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { Text as x, ListCheckbox as T, Table as g, TableHeader as w, Column as W } from "@box/blueprint-web";
|
|
2
2
|
import { useIntl as y } from "react-intl";
|
|
3
3
|
import C from "./table-body/ghost-table-body.js";
|
|
4
|
-
import {
|
|
4
|
+
import { s as r, T as M } from "../../../../chunks/table-body-with-data.js";
|
|
5
|
+
import { I as N } from "../../../../chunks/types.js";
|
|
5
6
|
import h from "./messages.js";
|
|
6
7
|
import { jsx as e, jsxs as R } from "react/jsx-runtime";
|
|
7
|
-
const
|
|
8
|
-
columns:
|
|
8
|
+
const L = ({
|
|
9
|
+
columns: l,
|
|
9
10
|
isLoading: i,
|
|
10
11
|
iconColumnVariant: o,
|
|
11
12
|
isSelectAllEnabled: d,
|
|
@@ -14,18 +15,18 @@ const v = ({
|
|
|
14
15
|
...u
|
|
15
16
|
}) => {
|
|
16
17
|
const {
|
|
17
|
-
formatMessage:
|
|
18
|
+
formatMessage: m
|
|
18
19
|
} = y(), a = [];
|
|
19
|
-
o ===
|
|
20
|
+
o === N.COLUMN && a.push({
|
|
20
21
|
id: "item-type-icon",
|
|
21
22
|
isRowHeader: !1,
|
|
22
23
|
hideHeader: !1,
|
|
23
24
|
maxWidth: 60,
|
|
24
25
|
minWidth: 60
|
|
25
26
|
});
|
|
26
|
-
const b =
|
|
27
|
+
const b = l.map((s) => {
|
|
27
28
|
const {
|
|
28
|
-
id:
|
|
29
|
+
id: n,
|
|
29
30
|
headerRenderer: c,
|
|
30
31
|
textValue: t,
|
|
31
32
|
...H
|
|
@@ -35,20 +36,20 @@ const v = ({
|
|
|
35
36
|
as: "span",
|
|
36
37
|
children: t
|
|
37
38
|
}),
|
|
38
|
-
isRowHeader:
|
|
39
|
-
id:
|
|
39
|
+
isRowHeader: n === "name",
|
|
40
|
+
id: n,
|
|
40
41
|
textValue: t,
|
|
41
42
|
...H
|
|
42
43
|
};
|
|
43
44
|
});
|
|
44
45
|
return a.push(...b), d && a.push({
|
|
45
46
|
id: "actions",
|
|
46
|
-
className:
|
|
47
|
+
className: r.tableHeaderActions,
|
|
47
48
|
children: /* @__PURE__ */ e("div", {
|
|
48
|
-
className:
|
|
49
|
+
className: r.tableHeaderActionsWrapper,
|
|
49
50
|
children: /* @__PURE__ */ e(T, {
|
|
50
|
-
"aria-label":
|
|
51
|
-
className:
|
|
51
|
+
"aria-label": m(h.selectAll),
|
|
52
|
+
className: r.selectAllCheckbox,
|
|
52
53
|
isDisabled: i
|
|
53
54
|
})
|
|
54
55
|
}),
|
|
@@ -56,7 +57,7 @@ const v = ({
|
|
|
56
57
|
hideHeader: !1,
|
|
57
58
|
allowsSorting: !1
|
|
58
59
|
}), /* @__PURE__ */ R(g, {
|
|
59
|
-
"aria-label":
|
|
60
|
+
"aria-label": m(h.listView),
|
|
60
61
|
selectionBehavior: "toggle",
|
|
61
62
|
selectionMode: "multiple",
|
|
62
63
|
...u,
|
|
@@ -67,8 +68,8 @@ const v = ({
|
|
|
67
68
|
})
|
|
68
69
|
}), i ? /* @__PURE__ */ e(C, {
|
|
69
70
|
columnLength: a.length
|
|
70
|
-
}) : /* @__PURE__ */ e(
|
|
71
|
-
columns:
|
|
71
|
+
}) : /* @__PURE__ */ e(M, {
|
|
72
|
+
columns: l,
|
|
72
73
|
iconColumnVariant: o,
|
|
73
74
|
isSelectAllEnabled: d,
|
|
74
75
|
itemActionMenuProps: f,
|
|
@@ -77,5 +78,5 @@ const v = ({
|
|
|
77
78
|
});
|
|
78
79
|
};
|
|
79
80
|
export {
|
|
80
|
-
|
|
81
|
+
L as default
|
|
81
82
|
};
|
|
@@ -2,9 +2,10 @@ import "@box/blueprint-web";
|
|
|
2
2
|
import "lodash/get";
|
|
3
3
|
import "@box/item-icon";
|
|
4
4
|
import "clsx";
|
|
5
|
-
import
|
|
5
|
+
import "../../../../../chunks/types.js";
|
|
6
|
+
import { T as d } from "../../../../../chunks/table-body-with-data.js";
|
|
6
7
|
import "react/jsx-runtime";
|
|
7
8
|
import "../../item-action-menu/item-action-menu.js";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
d as default
|
|
10
11
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import e from "react";
|
|
2
|
+
const i = ({
|
|
3
|
+
condition: r,
|
|
4
|
+
children: n
|
|
5
|
+
}) => r ? n : null, s = ({
|
|
6
|
+
children: r
|
|
7
|
+
}) => {
|
|
8
|
+
const t = e.Children.toArray(r).find((o) => o.props.condition);
|
|
9
|
+
return t ? t.props.children : null;
|
|
10
|
+
};
|
|
11
|
+
export {
|
|
12
|
+
i as Case,
|
|
13
|
+
s as SwitchCase
|
|
14
|
+
};
|
|
@@ -1,33 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { useState as h } from "react";
|
|
2
|
+
import M from "./components/error-state/error-state.js";
|
|
3
|
+
import S from "./components/pagination/pagination.js";
|
|
4
|
+
import { MetadataGrid as w } from "./components/metadata-grid/metadata-grid.js";
|
|
5
|
+
import { V as t } from "../../chunks/types.js";
|
|
6
|
+
import { SwitchCase as I, Case as e } from "./components/switch-case/switch-case.js";
|
|
7
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
8
|
+
import { ActionBar as T } from "./components/action-bar/action-bar.js";
|
|
9
|
+
import V from "./components/empty-state/empty-state.js";
|
|
10
|
+
import C from "./components/metadata-table/metadata-table.js";
|
|
11
|
+
import '../../styles/metadata-view.css';const L = {};
|
|
12
|
+
function b({
|
|
13
|
+
actionBarProps: d,
|
|
14
|
+
tableProps: r,
|
|
15
|
+
hasError: c,
|
|
16
|
+
onRefresh: s,
|
|
17
|
+
initialViewMode: l = t.LIST,
|
|
18
|
+
...n
|
|
18
19
|
}) {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
const [i, a] = h(l), p = () => {
|
|
21
|
+
i === t.LIST ? a(t.GRID) : a(t.LIST);
|
|
22
|
+
}, f = !r.isLoading && n.items.length === 0;
|
|
23
|
+
return /* @__PURE__ */ m("div", {
|
|
24
|
+
className: L.container,
|
|
25
|
+
children: [/* @__PURE__ */ o(T, {
|
|
26
|
+
...d,
|
|
27
|
+
onViewModeClick: p,
|
|
28
|
+
viewMode: i
|
|
29
|
+
}), /* @__PURE__ */ m(I, {
|
|
30
|
+
children: [/* @__PURE__ */ o(e, {
|
|
31
|
+
condition: c,
|
|
32
|
+
children: /* @__PURE__ */ o(M, {
|
|
33
|
+
onRefresh: s
|
|
34
|
+
})
|
|
35
|
+
}), /* @__PURE__ */ o(e, {
|
|
36
|
+
condition: f,
|
|
37
|
+
children: /* @__PURE__ */ o(V, {})
|
|
38
|
+
}), /* @__PURE__ */ o(e, {
|
|
39
|
+
condition: i === t.LIST,
|
|
40
|
+
children: /* @__PURE__ */ o(C, {
|
|
41
|
+
...n,
|
|
42
|
+
...r
|
|
43
|
+
})
|
|
44
|
+
}), /* @__PURE__ */ o(e, {
|
|
45
|
+
condition: i === t.GRID,
|
|
46
|
+
children: /* @__PURE__ */ o(w, {
|
|
47
|
+
...n
|
|
48
|
+
})
|
|
49
|
+
})]
|
|
50
|
+
}), /* @__PURE__ */ o(S, {})]
|
|
28
51
|
});
|
|
29
52
|
}
|
|
30
53
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
54
|
+
b as MetadataView,
|
|
55
|
+
b as default
|
|
33
56
|
};
|