@box/metadata-view 1.53.28 → 1.54.0

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,5 +1,5 @@
1
- import { V as e, I as F } from "../../chunks/types.js";
2
- import { ActionBar as U } from "./components/action-bar/action-bar.js";
1
+ import { V as e, I as U } from "../../chunks/types.js";
2
+ import { ActionBar as b } from "./components/action-bar/action-bar.js";
3
3
  import "./components/filter-row/filter-row.js";
4
4
  import "./components/filter-row/form-filter-chip.js";
5
5
  import "./components/filter-row/metadata-filter-chip.js";
@@ -8,8 +8,8 @@ import "./components/filter-row/predefinedFilters/index.js";
8
8
  import "./components/filter-sidepanel/filter.js";
9
9
  import "./components/filter-sidepanel/filter-side-panel.js";
10
10
  import "./components/item-action-menu/item-action-menu.js";
11
- import { MetadataGrid as b } from "./components/metadata-grid/metadata-grid.js";
12
- import { MetadataTable as q } from "./components/metadata-table/metadata-table.js";
11
+ import { MetadataGrid as q } from "./components/metadata-grid/metadata-grid.js";
12
+ import { MetadataTable as J } from "./components/metadata-table/metadata-table.js";
13
13
  import "./components/metadata-table/table-body/inline-editing-cell/inline-editing-cell.js";
14
14
  import "./components/metadata-table/table-renderer.js";
15
15
  import "./components/metadata-value/metadata-file-chip.js";
@@ -17,131 +17,135 @@ import "./components/metadata-value/metadata-file-field.js";
17
17
  import "./components/metadata-value/metadata-location-field.js";
18
18
  import "./components/metadata-value/metadata-radio-field.js";
19
19
  import "./components/metadata-value/metadata-search-field.js";
20
- import { Pagination as J } from "./components/pagination/pagination.js";
20
+ import { Pagination as Q } from "./components/pagination/pagination.js";
21
21
  import "./components/pagination/marker-based-pagination.js";
22
22
  import "./components/pagination/offset-based-pagination.js";
23
23
  import "./components/pagination/pagination-controls.js";
24
24
  import "./components/sort-dropdown/sort-dropdown.js";
25
- import { SwitchCase as Q, Case as s } from "./components/switch-case/switch-case.js";
26
- import { Header as W } from "./components/header/header.js";
27
- import { TooltipProvider as X } from "@box/blueprint-web";
28
- import { useState as d, useRef as Y, useCallback as $ } from "react";
29
- import { useHeader as B } from "./hooks/use-header.js";
30
- import { jsx as o, jsxs as _, Fragment as K } from "react/jsx-runtime";
31
- import { ErrorState as P } from "./components/error-state/error-state.js";
32
- import oo from "./components/empty-state/empty-state.js";
33
- import '../../styles/metadata-view.css';const to = "_container_1o9go_5", eo = "_contentContainer_1o9go_15", D = {
34
- container: to,
35
- contentContainer: eo
25
+ import { SwitchCase as W, Case as d } from "./components/switch-case/switch-case.js";
26
+ import { Header as X } from "./components/header/header.js";
27
+ import { TooltipProvider as Y } from "@box/blueprint-web";
28
+ import { useState as C, useRef as $, useCallback as B } from "react";
29
+ import { useHeader as K } from "./hooks/use-header.js";
30
+ import { jsx as o, jsxs as L, Fragment as P } from "react/jsx-runtime";
31
+ import { ErrorState as oo } from "./components/error-state/error-state.js";
32
+ import to from "./components/empty-state/empty-state.js";
33
+ import '../../styles/metadata-view.css';const eo = "_container_1o9go_5", no = "_contentContainer_1o9go_15", _ = {
34
+ container: eo,
35
+ contentContainer: no
36
36
  };
37
- function Oo({
37
+ function Zo({
38
38
  actionBarProps: i,
39
- columns: C,
39
+ columns: h,
40
40
  tableProps: m,
41
- hasError: R,
41
+ hasError: D,
42
42
  headerProps: a,
43
- onRefresh: y,
43
+ onRefresh: R,
44
44
  onSelectionChange: x,
45
+ onViewModeChange: y,
45
46
  selectedKeys: c,
46
47
  initialViewMode: G = e.LIST,
47
- paginationProps: h,
48
- isLoading: f,
48
+ paginationProps: f,
49
+ isLoading: S,
49
50
  isSelectAllEnabled: N = !0,
50
51
  isSelectionEnabled: p,
51
- areSelectionCheckboxesDisabled: S,
52
- ...n
52
+ areSelectionCheckboxesDisabled: g,
53
+ ...r
53
54
  }) {
54
- const [r, g] = d(G), [u, M] = d(void 0), [l, j] = d(0), w = Y(null), {
55
- headerSelectionProps: E,
55
+ const [s, j] = C(G), [u, M] = C(void 0), [l, E] = C(0), w = $(null), {
56
+ headerSelectionProps: H,
56
57
  handleSelectionChange: I,
57
- selectionResetKey: v
58
- } = B({
58
+ selectionResetKey: V
59
+ } = K({
59
60
  headerProps: a,
60
- items: n.items,
61
+ items: r.items,
61
62
  selectedKeys: c,
62
63
  isSelectionEnabled: p,
63
64
  onSelectionChange: x
64
- }), H = () => {
65
- r === e.LIST ? g(e.GRID) : g(e.LIST);
66
- }, O = !f && n.items.length === 0, Z = i && i.sortDropdownProps && C.filter((t) => t.type !== "multiSelect" && t.type !== "enum" && t.allowsSorting === !0), {
67
- iconColumnVariant: T
68
- } = m || {}, k = T && T === F.COLUMN, V = m?.onSortChange, z = $(({
65
+ }), O = () => {
66
+ j((t) => {
67
+ const n = t === e.LIST ? e.GRID : e.LIST;
68
+ return y?.(n), n;
69
+ });
70
+ }, Z = !S && r.items.length === 0, k = i && i.sortDropdownProps && h.filter((t) => t.type !== "multiSelect" && t.type !== "enum" && t.allowsSorting === !0), {
71
+ iconColumnVariant: v
72
+ } = m || {}, z = v && v === U.COLUMN, T = m?.onSortChange, A = B(({
69
73
  column: t,
70
- direction: L
74
+ direction: n
71
75
  }) => {
72
76
  M({
73
77
  column: t,
74
- direction: L
75
- }), V?.({
78
+ direction: n
79
+ }), T?.({
76
80
  column: t,
77
- direction: L
81
+ direction: n
78
82
  });
79
- }, [V]), A = {
83
+ }, [T]), F = {
80
84
  ...m,
81
85
  sortDescriptor: u,
82
- onSortChange: z
86
+ onSortChange: A
83
87
  };
84
- return /* @__PURE__ */ o(X, {
88
+ return /* @__PURE__ */ o(Y, {
85
89
  children: /* @__PURE__ */ o("div", {
86
90
  ref: w,
87
- className: D.container,
88
- children: R ? /* @__PURE__ */ o(P, {
89
- onRefresh: y
90
- }) : /* @__PURE__ */ _(K, {
91
- children: [a && /* @__PURE__ */ o(W, {
91
+ className: _.container,
92
+ children: D ? /* @__PURE__ */ o(oo, {
93
+ onRefresh: R
94
+ }) : /* @__PURE__ */ L(P, {
95
+ children: [a && /* @__PURE__ */ o(X, {
92
96
  ...a,
93
- ...E
94
- }), /* @__PURE__ */ o(U, {
97
+ ...H
98
+ }), /* @__PURE__ */ o(b, {
95
99
  ...i,
96
100
  containerRef: w,
97
- isIconColumnEnabled: k,
101
+ isIconColumnEnabled: z,
98
102
  onSortDescriptorChange: M,
99
- onViewModeClick: H,
100
- onZoomLevelChange: j,
101
- sortableColumns: Z,
103
+ onViewModeClick: O,
104
+ onZoomLevelChange: E,
105
+ sortableColumns: k,
102
106
  sortDescriptor: u,
103
- viewMode: r,
107
+ viewMode: s,
104
108
  zoomLevel: l
105
109
  }), /* @__PURE__ */ o("div", {
106
- className: D.contentContainer,
107
- children: /* @__PURE__ */ _(Q, {
108
- children: [/* @__PURE__ */ o(s, {
109
- condition: O,
110
- children: /* @__PURE__ */ o(oo, {})
111
- }), /* @__PURE__ */ o(s, {
112
- condition: r === e.LIST,
113
- children: /* @__PURE__ */ o(q, {
114
- areSelectionCheckboxesDisabled: S,
115
- columns: C,
116
- isLoading: f,
110
+ className: _.contentContainer,
111
+ children: /* @__PURE__ */ L(W, {
112
+ children: [/* @__PURE__ */ o(d, {
113
+ condition: Z,
114
+ children: /* @__PURE__ */ o(to, {})
115
+ }), /* @__PURE__ */ o(d, {
116
+ condition: s === e.LIST,
117
+ children: /* @__PURE__ */ o(J, {
118
+ areSelectionCheckboxesDisabled: g,
119
+ columns: h,
120
+ isLoading: S,
117
121
  isSelectAllEnabled: N,
118
122
  onSelectionChange: I,
119
123
  selectedKeys: c,
120
124
  selectionMode: p ? "multiple" : "none",
121
125
  zoomLevel: l,
122
- ...n,
123
- ...A
124
- }, v)
125
- }), /* @__PURE__ */ o(s, {
126
- condition: r === e.GRID,
127
- children: /* @__PURE__ */ o(b, {
128
- areSelectionCheckboxesDisabled: S,
126
+ ...r,
127
+ ...F
128
+ }, V)
129
+ }), /* @__PURE__ */ o(d, {
130
+ condition: s === e.GRID,
131
+ children: /* @__PURE__ */ o(q, {
132
+ areSelectionCheckboxesDisabled: g,
129
133
  onSelectionChange: I,
130
134
  selectedKeys: c,
131
135
  selectionMode: p ? "multiple" : "none",
132
136
  zoomLevel: l,
133
- ...n
134
- }, v)
137
+ ...r
138
+ }, V)
135
139
  })]
136
140
  })
137
- }), h && /* @__PURE__ */ o(J, {
138
- ...h
141
+ }), f && /* @__PURE__ */ o(Q, {
142
+ ...f
139
143
  })]
140
144
  })
141
145
  })
142
146
  });
143
147
  }
144
148
  export {
145
- Oo as MetadataView,
146
- Oo as default
149
+ Zo as MetadataView,
150
+ Zo as default
147
151
  };
@@ -1,3 +1,3 @@
1
1
  import { MetadataViewProps } from './types';
2
- export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, headerProps, onRefresh, onSelectionChange, selectedKeys, initialViewMode, paginationProps, isLoading, isSelectAllEnabled, isSelectionEnabled, areSelectionCheckboxesDisabled, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function MetadataView({ actionBarProps, columns, tableProps, hasError, headerProps, onRefresh, onSelectionChange, onViewModeChange, selectedKeys, initialViewMode, paginationProps, isLoading, isSelectAllEnabled, isSelectionEnabled, areSelectionCheckboxesDisabled, ...rest }: MetadataViewProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataView;
@@ -66,6 +66,7 @@ export interface MetadataViewProps extends MetadataProps {
66
66
  initialViewMode?: ViewMode;
67
67
  onRefresh?: () => void;
68
68
  onSelectionChange?: (keys: Selection) => void;
69
+ onViewModeChange?: (newViewMode: ViewMode) => void;
69
70
  selectedKeys?: typeof SELECT_ALL | Iterable<string | number>;
70
71
  isSelectAllEnabled?: boolean;
71
72
  isSelectionEnabled?: boolean;
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "1.53.28",
3
+ "version": "1.54.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^14.2.0",
7
- "@box/blueprint-web-assets": "^4.111.19",
8
- "@box/box-item-type-selector": "^1.39.23",
9
- "@box/item-icon": "^2.32.16",
10
- "@box/metadata-filter": "^1.80.25",
6
+ "@box/blueprint-web": "^14.3.0",
7
+ "@box/blueprint-web-assets": "^4.111.20",
8
+ "@box/box-item-type-selector": "^1.39.24",
9
+ "@box/item-icon": "^2.32.17",
10
+ "@box/metadata-filter": "^1.80.26",
11
11
  "@box/types": "2.1.12",
12
- "@box/content-field": "^1.40.23",
12
+ "@box/content-field": "^1.40.24",
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.2.0",
23
- "@box/blueprint-web-assets": "^4.111.19",
24
- "@box/box-item-type-selector": "^1.39.23",
22
+ "@box/blueprint-web": "^14.3.0",
23
+ "@box/blueprint-web-assets": "^4.111.20",
24
+ "@box/box-item-type-selector": "^1.39.24",
25
25
  "@box/eslint-plugin-blueprint": "1.1.9",
26
- "@box/item-icon": "^2.32.16",
27
- "@box/metadata-filter": "^1.80.25",
28
- "@box/storybook-utils": "0.17.19",
26
+ "@box/item-icon": "^2.32.17",
27
+ "@box/metadata-filter": "^1.80.26",
28
+ "@box/storybook-utils": "0.17.20",
29
29
  "@box/types": "2.1.12",
30
- "@box/content-field": "^1.40.23",
30
+ "@box/content-field": "^1.40.24",
31
31
  "@tanstack/react-virtual": "^3.10.8",
32
32
  "react-intl": "^6.4.2"
33
33
  },