@box/metadata-view 1.58.2 → 1.59.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.
|
@@ -12,33 +12,37 @@ import '../styles/action-bar.css';var u = {
|
|
|
12
12
|
filterRow: "_filterRow_bbxsv_8",
|
|
13
13
|
additionalActions: "_additionalActions_bbxsv_13",
|
|
14
14
|
viewModeButtonContainer: "_viewModeButtonContainer_bbxsv_24"
|
|
15
|
-
}, d = ({
|
|
16
|
-
let { formatMessage:
|
|
15
|
+
}, d = ({ dataTargetPrefix: d, isIconColumnEnabled: f, isViewModeButtonDisabled: p, onSortDescriptorChange: m, onViewModeClick: h, onZoomLevelChange: g, sortableColumns: _, sortDescriptor: v, sortDropdownProps: y, viewMode: b, zoomLevel: x, ...S }) => {
|
|
16
|
+
let { formatMessage: C } = s(), w = y?.triggerButtonDataTargetId ?? (d ? `${d}-sortButton` : void 0);
|
|
17
17
|
return /* @__PURE__ */ l("div", {
|
|
18
18
|
className: u.actionBar,
|
|
19
19
|
children: [/* @__PURE__ */ c("div", {
|
|
20
20
|
className: u.filterRow,
|
|
21
|
-
children: /* @__PURE__ */ c(t, {
|
|
21
|
+
children: /* @__PURE__ */ c(t, {
|
|
22
|
+
...S,
|
|
23
|
+
dataTargetPrefix: d
|
|
24
|
+
})
|
|
22
25
|
}), /* @__PURE__ */ l("div", {
|
|
23
26
|
className: u.additionalActions,
|
|
24
27
|
children: [
|
|
25
|
-
|
|
26
|
-
...
|
|
27
|
-
onSortDescriptorChange:
|
|
28
|
-
sortableColumns:
|
|
29
|
-
sortDescriptor:
|
|
28
|
+
y && /* @__PURE__ */ c(n, {
|
|
29
|
+
...y,
|
|
30
|
+
onSortDescriptorChange: m,
|
|
31
|
+
sortableColumns: _,
|
|
32
|
+
sortDescriptor: v,
|
|
33
|
+
triggerButtonDataTargetId: w
|
|
30
34
|
}),
|
|
31
|
-
(
|
|
32
|
-
onZoomLevelChange:
|
|
33
|
-
zoomLevel:
|
|
35
|
+
(f || b === e.GRID) && /* @__PURE__ */ c(r, {
|
|
36
|
+
onZoomLevelChange: g,
|
|
37
|
+
zoomLevel: x
|
|
34
38
|
}),
|
|
35
|
-
!
|
|
39
|
+
!p && /* @__PURE__ */ c("div", {
|
|
36
40
|
className: u.viewModeButtonContainer,
|
|
37
41
|
children: /* @__PURE__ */ c(a, {
|
|
38
|
-
"aria-label":
|
|
42
|
+
"aria-label": b === e.GRID ? C(i.switchToListView) : C(i.switchToGridView),
|
|
39
43
|
endIcon: o,
|
|
40
|
-
onClick:
|
|
41
|
-
variant:
|
|
44
|
+
onClick: h,
|
|
45
|
+
variant: b === e.GRID ? "primary" : "tertiary"
|
|
42
46
|
})
|
|
43
47
|
})
|
|
44
48
|
]
|
|
@@ -2,33 +2,34 @@ import { DropdownMenu as e, TriggerButton as t } from "@box/blueprint-web";
|
|
|
2
2
|
import { useState as n } from "react";
|
|
3
3
|
import { ArrowDown as r, ArrowUp as i } from "@box/blueprint-web-assets/icons/Fill";
|
|
4
4
|
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
5
|
-
var s = ({ onSortDescriptorChange: s, sortableColumns: c, sortDescriptor: l, initialSortByColumnId: u = c[0].id, initialSortDirection: d = "ascending",
|
|
6
|
-
let
|
|
5
|
+
var s = ({ onSortDescriptorChange: s, sortableColumns: c, sortDescriptor: l, initialSortByColumnId: u = c[0].id, initialSortDirection: d = "ascending", triggerButtonDataTargetId: f, onSortChange: p }) => {
|
|
6
|
+
let m = new Map(c.map((e) => [e.id, e.textValue])), [h, g] = n(u), [_, v] = n(d), y = l?.column == null ? h : String(l.column), b = l?.direction ?? _;
|
|
7
7
|
return /* @__PURE__ */ o(e.Root, { children: [/* @__PURE__ */ a(e.Trigger, { children: /* @__PURE__ */ a(t, {
|
|
8
|
-
caretDirection:
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
caretDirection: b === "ascending" ? "up" : "down",
|
|
9
|
+
"data-target-id": f,
|
|
10
|
+
label: m.get(y),
|
|
11
|
+
startIcon: b === "ascending" ? i : r,
|
|
11
12
|
variant: "tertiary"
|
|
12
13
|
}) }), /* @__PURE__ */ a(e.Content, { children: /* @__PURE__ */ a(e.RadioGroup, {
|
|
13
14
|
onValueChange: (e) => {
|
|
14
|
-
if (e ===
|
|
15
|
-
let t =
|
|
16
|
-
|
|
15
|
+
if (e === y) {
|
|
16
|
+
let t = b === "ascending" ? "descending" : "ascending";
|
|
17
|
+
v(t), s({
|
|
17
18
|
column: e,
|
|
18
19
|
direction: t
|
|
19
|
-
}),
|
|
20
|
+
}), p({
|
|
20
21
|
column: e,
|
|
21
22
|
direction: t
|
|
22
23
|
});
|
|
23
|
-
} else
|
|
24
|
+
} else g(e), v("ascending"), s({
|
|
24
25
|
column: e,
|
|
25
26
|
direction: "ascending"
|
|
26
|
-
}),
|
|
27
|
+
}), p({
|
|
27
28
|
column: e,
|
|
28
29
|
direction: "ascending"
|
|
29
30
|
});
|
|
30
31
|
},
|
|
31
|
-
value:
|
|
32
|
+
value: y,
|
|
32
33
|
children: c.map(({ id: t, textValue: n }) => /* @__PURE__ */ a(e.RadioSelectItem, {
|
|
33
34
|
value: t,
|
|
34
35
|
children: n
|
|
@@ -18,5 +18,5 @@ interface ActionBarInternalProps extends ActionBarProps {
|
|
|
18
18
|
sortableColumns: Column[];
|
|
19
19
|
sortDescriptor: SortDescriptor;
|
|
20
20
|
}
|
|
21
|
-
export declare const ActionBar: ({ isIconColumnEnabled, isViewModeButtonDisabled, onSortDescriptorChange, onViewModeClick, onZoomLevelChange, sortableColumns, sortDescriptor, sortDropdownProps, viewMode, zoomLevel, ...rest }: ActionBarInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export declare const ActionBar: ({ dataTargetPrefix, isIconColumnEnabled, isViewModeButtonDisabled, onSortDescriptorChange, onViewModeClick, onZoomLevelChange, sortableColumns, sortDescriptor, sortDropdownProps, viewMode, zoomLevel, ...rest }: ActionBarInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export {};
|
|
@@ -3,6 +3,7 @@ import { Column } from '../../types';
|
|
|
3
3
|
export interface SortDropdownProps {
|
|
4
4
|
initialSortByColumnId?: string;
|
|
5
5
|
initialSortDirection?: SortDirection;
|
|
6
|
+
triggerButtonDataTargetId?: string;
|
|
6
7
|
onSortChange: (sortDescriptor: SortDescriptor) => void;
|
|
7
8
|
}
|
|
8
9
|
interface SortDropdownInternalProps extends SortDropdownProps {
|
|
@@ -10,5 +11,5 @@ interface SortDropdownInternalProps extends SortDropdownProps {
|
|
|
10
11
|
sortableColumns: Column[];
|
|
11
12
|
sortDescriptor: SortDescriptor;
|
|
12
13
|
}
|
|
13
|
-
export declare const SortDropdown: ({ onSortDescriptorChange, sortableColumns, sortDescriptor, initialSortByColumnId, initialSortDirection, onSortChange, }: SortDropdownInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const SortDropdown: ({ onSortDescriptorChange, sortableColumns, sortDescriptor, initialSortByColumnId, initialSortDirection, triggerButtonDataTargetId, onSortChange, }: SortDropdownInternalProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export {};
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.59.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@box/blueprint-web": "^14.31.
|
|
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.
|
|
12
|
-
"@box/types": "2.2.
|
|
6
|
+
"@box/blueprint-web": "^14.31.1",
|
|
7
|
+
"@box/blueprint-web-assets": "^4.118.4",
|
|
8
|
+
"@box/box-item-type-selector": "^1.41.11",
|
|
9
|
+
"@box/content-field": "^1.42.11",
|
|
10
|
+
"@box/item-icon": "^2.35.11",
|
|
11
|
+
"@box/metadata-filter": "^1.83.11",
|
|
12
|
+
"@box/types": "2.2.2",
|
|
13
13
|
"@tanstack/react-virtual": "^3.10.8",
|
|
14
14
|
"formik": "^2.4.5",
|
|
15
15
|
"lodash": "^4.17.15",
|
|
@@ -19,15 +19,15 @@
|
|
|
19
19
|
"react-intl": "^6.4.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@box/blueprint-web": "^14.31.
|
|
23
|
-
"@box/blueprint-web-assets": "^4.118.
|
|
24
|
-
"@box/box-item-type-selector": "^1.41.
|
|
25
|
-
"@box/content-field": "^1.42.
|
|
26
|
-
"@box/eslint-plugin-blueprint": "1.2.
|
|
27
|
-
"@box/item-icon": "^2.35.
|
|
28
|
-
"@box/metadata-filter": "^1.83.
|
|
29
|
-
"@box/storybook-utils": "0.19.
|
|
30
|
-
"@box/types": "2.2.
|
|
22
|
+
"@box/blueprint-web": "^14.31.1",
|
|
23
|
+
"@box/blueprint-web-assets": "^4.118.4",
|
|
24
|
+
"@box/box-item-type-selector": "^1.41.11",
|
|
25
|
+
"@box/content-field": "^1.42.11",
|
|
26
|
+
"@box/eslint-plugin-blueprint": "1.2.2",
|
|
27
|
+
"@box/item-icon": "^2.35.11",
|
|
28
|
+
"@box/metadata-filter": "^1.83.11",
|
|
29
|
+
"@box/storybook-utils": "0.19.8",
|
|
30
|
+
"@box/types": "2.2.2",
|
|
31
31
|
"@tanstack/react-virtual": "^3.10.8",
|
|
32
32
|
"react-intl": "^6.4.2"
|
|
33
33
|
},
|