@box/metadata-view 0.31.0 → 0.32.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.
|
@@ -1,33 +1,40 @@
|
|
|
1
|
-
import { DropdownMenu as r, TriggerButton as
|
|
2
|
-
import { ArrowUp as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { DropdownMenu as r, TriggerButton as w } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowUp as u, ArrowDown as D } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useState as d } from "react";
|
|
4
|
+
import { jsxs as f, jsx as o } from "react/jsx-runtime";
|
|
5
|
+
const S = ({
|
|
6
|
+
initialSortByColumn: s,
|
|
7
|
+
initialSortDirection: g,
|
|
8
|
+
onSortChange: t,
|
|
9
|
+
sortableColumnNames: p
|
|
9
10
|
}) => {
|
|
10
|
-
const
|
|
11
|
-
|
|
11
|
+
const [i, c] = d(g), [e, h] = d(s), l = (n) => {
|
|
12
|
+
if (n === e) {
|
|
13
|
+
const a = i === "ascending" ? "descending" : "ascending";
|
|
14
|
+
c(a), t(n, a);
|
|
15
|
+
} else
|
|
16
|
+
h(n), c("ascending"), t(n, "ascending");
|
|
17
|
+
};
|
|
18
|
+
return /* @__PURE__ */ f(r.Root, {
|
|
12
19
|
children: [/* @__PURE__ */ o(r.Trigger, {
|
|
13
|
-
children: /* @__PURE__ */ o(
|
|
14
|
-
caretDirection:
|
|
20
|
+
children: /* @__PURE__ */ o(w, {
|
|
21
|
+
caretDirection: i === "ascending" ? "up" : "down",
|
|
15
22
|
label: e,
|
|
16
|
-
startIcon:
|
|
23
|
+
startIcon: i === "ascending" ? u : D,
|
|
17
24
|
variant: "tertiary"
|
|
18
25
|
})
|
|
19
26
|
}), /* @__PURE__ */ o(r.Content, {
|
|
20
27
|
children: /* @__PURE__ */ o(r.RadioGroup, {
|
|
21
|
-
onValueChange:
|
|
28
|
+
onValueChange: l,
|
|
22
29
|
value: e,
|
|
23
|
-
children:
|
|
24
|
-
value:
|
|
25
|
-
children:
|
|
26
|
-
},
|
|
30
|
+
children: p.map((n) => /* @__PURE__ */ o(r.RadioSelectItem, {
|
|
31
|
+
value: n,
|
|
32
|
+
children: n
|
|
33
|
+
}, n))
|
|
27
34
|
})
|
|
28
35
|
})]
|
|
29
36
|
});
|
|
30
37
|
};
|
|
31
38
|
export {
|
|
32
|
-
|
|
39
|
+
S as SortDropdown
|
|
33
40
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { SortDirection } from 'react-aria-components';
|
|
2
2
|
export interface SortDropdownProps {
|
|
3
|
-
|
|
3
|
+
initialSortByColumn: string;
|
|
4
|
+
initialSortDirection: SortDirection;
|
|
5
|
+
onSortChange: (sortByColumn: string, sortDirection: SortDirection) => void;
|
|
4
6
|
sortableColumnNames: string[];
|
|
5
|
-
sortByColumn: string;
|
|
6
|
-
sortDirection: SortDirection;
|
|
7
7
|
}
|
|
8
|
-
export declare const SortDropdown: ({
|
|
8
|
+
export declare const SortDropdown: ({ initialSortByColumn, initialSortDirection, onSortChange, sortableColumnNames, }: SortDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.1",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@box/blueprint-web": "^11.12.0",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@box/blueprint-web": "^11.12.0",
|
|
22
22
|
"@box/blueprint-web-assets": "^4.62.0",
|
|
23
|
-
"@box/box-item-type-selector": "^0.62.
|
|
23
|
+
"@box/box-item-type-selector": "^0.62.1",
|
|
24
24
|
"@box/eslint-plugin-blueprint": "*",
|
|
25
|
-
"@box/item-icon": "^0.17.
|
|
26
|
-
"@box/metadata-filter": "^1.17.
|
|
25
|
+
"@box/item-icon": "^0.17.1",
|
|
26
|
+
"@box/metadata-filter": "^1.17.1",
|
|
27
27
|
"@box/storybook-utils": "0.13.17",
|
|
28
28
|
"@box/types": "0.2.1",
|
|
29
29
|
"@tanstack/react-virtual": "^3.10.8",
|