@box/metadata-view 1.33.2 → 1.33.4

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,16 +1,16 @@
1
- import { useRef as v } from "react";
2
- import { useIntl as B } from "react-intl";
3
- import { Text as O, ListCheckbox as Z, DataTableWrapper as _, TableHeader as q, Column as E } from "@box/blueprint-web";
4
- import { useInfiniteScrollTableItems as F } from "./hooks/useInfiniteScrollTableItems.js";
1
+ import { useRef as O } from "react";
2
+ import { useIntl as Z } from "react-intl";
3
+ import { Text as _, ListCheckbox as q, DataTableWrapper as E, TableHeader as F, Column as G } from "@box/blueprint-web";
4
+ import { useInfiniteScrollTableItems as J } from "./hooks/useInfiniteScrollTableItems.js";
5
5
  import { TableRenderer as R } from "./table-renderer.js";
6
- import { I as G } from "../../../../chunks/types.js";
7
- import { THUMBNAIL_WIDTHS as J } from "../constants.js";
6
+ import { I as K } from "../../../../chunks/types.js";
7
+ import { THUMBNAIL_WIDTHS as Q } from "../constants.js";
8
8
  import { s as i } from "../../../../chunks/index.js";
9
- import { getShouldRenderActionColumn as K } from "./actionColumn.js";
10
- import Q from "./messages.js";
11
- import { jsx as t, jsxs as X } from "react/jsx-runtime";
9
+ import { getShouldRenderActionColumn as X } from "./actionColumn.js";
10
+ import Y from "./messages.js";
11
+ import { jsx as t, jsxs as $ } from "react/jsx-runtime";
12
12
  import "./table-body/inline-editing-cell/inline-editing-cell.js";
13
- const ie = ({
13
+ const me = ({
14
14
  areSelectionCheckboxesDisabled: n = !1,
15
15
  columns: m,
16
16
  hasNextPage: b = !1,
@@ -18,33 +18,33 @@ const ie = ({
18
18
  isInfiniteScrollEnabled: T = !1,
19
19
  isLoading: s = !1,
20
20
  isSelectAllEnabled: W,
21
- itemActionMenuProps: x,
21
+ itemActionMenuProps: w,
22
22
  items: c,
23
- maxActionColumnWidth: A,
24
- minActionColumnWidth: w,
25
- onGetNextPage: C,
26
- onInlineEditChange: S,
27
- onTableRowClick: N,
28
- placeholderRowsCount: g,
23
+ maxActionColumnWidth: x,
24
+ minActionColumnWidth: A,
25
+ onGetNextPage: S,
26
+ onInlineEditChange: g,
27
+ onTableRowClick: C,
28
+ placeholderRowsCount: N,
29
29
  zoomLevel: a,
30
30
  ...l
31
31
  }) => {
32
32
  const {
33
33
  formatMessage: f
34
- } = B(), p = v(null), {
34
+ } = Z(), u = O(null), {
35
35
  virtualItemsToDisplay: y,
36
36
  totalVirtualSize: D
37
- } = F({
37
+ } = J({
38
38
  items: c,
39
39
  hasNextPage: b,
40
40
  isLoading: s,
41
- parentRef: p,
42
- onGetNextPage: C,
43
- placeholderRowsCount: g
41
+ parentRef: u,
42
+ onGetNextPage: S,
43
+ placeholderRowsCount: N
44
44
  }), r = [], M = 0;
45
- if (d === G.COLUMN) {
45
+ if (d === K.COLUMN) {
46
46
  a = a || M;
47
- const e = parseInt(J[a], 10) + 24;
47
+ const e = parseInt(Q[a], 10) + 24;
48
48
  r.push({
49
49
  id: "item-type-icon",
50
50
  isRowHeader: !1,
@@ -60,27 +60,28 @@ const ie = ({
60
60
  headerRenderer: H,
61
61
  textValue: o,
62
62
  type: I,
63
- ...k
64
- } = e;
63
+ allowsSorting: k,
64
+ ...v
65
+ } = e, B = I !== "multiSelect" && I !== "enum" && k === !0;
65
66
  return {
66
- ...k,
67
- children: H ? H(o, e) : /* @__PURE__ */ t(O, {
67
+ ...v,
68
+ children: H ? H(o, e) : /* @__PURE__ */ t(_, {
68
69
  as: "span",
69
70
  children: o
70
71
  }),
71
72
  isRowHeader: h === "name" || V,
72
73
  id: h,
73
74
  textValue: o,
74
- allowsSorting: I !== "multiSelect" && I !== "enum"
75
+ allowsSorting: B
75
76
  };
76
77
  });
77
- r.push(...j), K(l) && r.push({
78
+ r.push(...j), X(l) && r.push({
78
79
  id: "actions",
79
80
  className: i.tableHeaderActions,
80
- children: /* @__PURE__ */ X("div", {
81
+ children: /* @__PURE__ */ $("div", {
81
82
  className: i.tableHeaderActionsWrapper,
82
- children: [l.HeaderActions, W ? /* @__PURE__ */ t(Z, {
83
- "aria-label": f(Q.selectAll),
83
+ children: [l.HeaderActions, W ? /* @__PURE__ */ t(q, {
84
+ "aria-label": f(Y.selectAll),
84
85
  className: i.selectAllCheckbox,
85
86
  isDisabled: s || n
86
87
  }) : null]
@@ -88,40 +89,40 @@ const ie = ({
88
89
  isRowHeader: !1,
89
90
  hideHeader: !1,
90
91
  allowsSorting: !1,
91
- maxWidth: A,
92
- minWidth: w
92
+ maxWidth: x,
93
+ minWidth: A
93
94
  });
94
- const U = /* @__PURE__ */ t(q, {
95
+ const U = /* @__PURE__ */ t(F, {
95
96
  columns: r,
96
- children: (e) => /* @__PURE__ */ t(E, {
97
+ children: (e) => /* @__PURE__ */ t(G, {
97
98
  ...e
98
99
  })
99
- }), u = {
100
+ }), p = {
100
101
  columnCount: r.length,
101
102
  columns: m,
102
103
  formatMessage: f,
103
104
  iconColumnVariant: d,
104
105
  isLoading: s,
105
106
  areSelectionCheckboxesDisabled: n,
106
- itemActionMenuProps: x,
107
+ itemActionMenuProps: w,
107
108
  items: c,
108
- onInlineEditChange: S,
109
- onTableRowClick: N,
109
+ onInlineEditChange: g,
110
+ onTableRowClick: C,
110
111
  tableHeader: U,
111
112
  tableProps: l,
112
113
  zoomLevel: a
113
114
  };
114
- return T ? /* @__PURE__ */ t(_, {
115
- ref: p,
115
+ return T ? /* @__PURE__ */ t(E, {
116
+ ref: u,
116
117
  children: /* @__PURE__ */ t(R, {
117
- ...u,
118
+ ...p,
118
119
  totalVirtualSize: D,
119
120
  virtualItems: y
120
121
  })
121
122
  }) : /* @__PURE__ */ t(R, {
122
- ...u
123
+ ...p
123
124
  });
124
125
  };
125
126
  export {
126
- ie as MetadataTable
127
+ me as MetadataTable
127
128
  };
@@ -1,4 +1,4 @@
1
- import { V as t, I as O } from "../../chunks/types.js";
1
+ import { V as e, I as O } from "../../chunks/types.js";
2
2
  import { ActionBar as Z } 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";
@@ -25,7 +25,7 @@ import "./components/sort-dropdown/sort-dropdown.js";
25
25
  import { SwitchCase as A, Case as c } from "./components/switch-case/switch-case.js";
26
26
  import { TooltipProvider as F } from "@box/blueprint-web";
27
27
  import { useState as p, useRef as U, useCallback as q } from "react";
28
- import { jsx as o, jsxs as w, Fragment as H } from "react/jsx-runtime";
28
+ import { jsx as o, jsxs as v, Fragment as H } from "react/jsx-runtime";
29
29
  import { ErrorState as J } from "./components/error-state/error-state.js";
30
30
  import K from "./components/empty-state/empty-state.js";
31
31
  import '../../styles/metadata-view.css';const Q = "_container_1o9go_5", W = "_contentContainer_1o9go_15", T = {
@@ -38,7 +38,7 @@ function _o({
38
38
  tableProps: i,
39
39
  hasError: V,
40
40
  onRefresh: L,
41
- initialViewMode: _ = t.LIST,
41
+ initialViewMode: _ = e.LIST,
42
42
  paginationProps: l,
43
43
  isLoading: d,
44
44
  isSelectAllEnabled: y = !0,
@@ -46,52 +46,52 @@ function _o({
46
46
  areSelectionCheckboxesDisabled: h,
47
47
  ...m
48
48
  }) {
49
- const [n, f] = p(_), [u, S] = p(void 0), [a, D] = p(0), M = U(null), R = () => {
50
- n === t.LIST ? f(t.GRID) : f(t.LIST);
51
- }, x = !d && m.items.length === 0, E = r && r.sortDropdownProps && s.filter((e) => e.type !== "multiSelect" && e.type !== "enum"), {
52
- iconColumnVariant: g
53
- } = i || {}, G = g && g === O.COLUMN, I = i?.onSortChange, N = q(({
54
- column: e,
55
- direction: v
49
+ const [n, f] = p(_), [S, u] = p(void 0), [a, D] = p(0), g = U(null), R = () => {
50
+ n === e.LIST ? f(e.GRID) : f(e.LIST);
51
+ }, x = !d && m.items.length === 0, E = r && r.sortDropdownProps && s.filter((t) => t.type !== "multiSelect" && t.type !== "enum" && t.allowsSorting === !0), {
52
+ iconColumnVariant: M
53
+ } = i || {}, G = M && M === O.COLUMN, w = i?.onSortChange, N = q(({
54
+ column: t,
55
+ direction: I
56
56
  }) => {
57
- S({
58
- column: e,
59
- direction: v
60
- }), I?.({
61
- column: e,
62
- direction: v
57
+ u({
58
+ column: t,
59
+ direction: I
60
+ }), w?.({
61
+ column: t,
62
+ direction: I
63
63
  });
64
- }, [I]), j = {
64
+ }, [w]), j = {
65
65
  ...i,
66
- sortDescriptor: u,
66
+ sortDescriptor: S,
67
67
  onSortChange: N
68
68
  };
69
69
  return /* @__PURE__ */ o(F, {
70
70
  children: /* @__PURE__ */ o("div", {
71
- ref: M,
71
+ ref: g,
72
72
  className: T.container,
73
73
  children: V ? /* @__PURE__ */ o(J, {
74
74
  onRefresh: L
75
- }) : /* @__PURE__ */ w(H, {
75
+ }) : /* @__PURE__ */ v(H, {
76
76
  children: [/* @__PURE__ */ o(Z, {
77
77
  ...r,
78
- containerRef: M,
78
+ containerRef: g,
79
79
  isIconColumnEnabled: G,
80
- onSortDescriptorChange: S,
80
+ onSortDescriptorChange: u,
81
81
  onViewModeClick: R,
82
82
  onZoomLevelChange: D,
83
83
  sortableColumns: E,
84
- sortDescriptor: u,
84
+ sortDescriptor: S,
85
85
  viewMode: n,
86
86
  zoomLevel: a
87
87
  }), /* @__PURE__ */ o("div", {
88
88
  className: T.contentContainer,
89
- children: /* @__PURE__ */ w(A, {
89
+ children: /* @__PURE__ */ v(A, {
90
90
  children: [/* @__PURE__ */ o(c, {
91
91
  condition: x,
92
92
  children: /* @__PURE__ */ o(K, {})
93
93
  }), /* @__PURE__ */ o(c, {
94
- condition: n === t.LIST,
94
+ condition: n === e.LIST,
95
95
  children: /* @__PURE__ */ o(k, {
96
96
  areSelectionCheckboxesDisabled: h,
97
97
  columns: s,
@@ -103,7 +103,7 @@ function _o({
103
103
  ...j
104
104
  })
105
105
  }), /* @__PURE__ */ o(c, {
106
- condition: n === t.GRID,
106
+ condition: n === e.GRID,
107
107
  children: /* @__PURE__ */ o(b, {
108
108
  areSelectionCheckboxesDisabled: h,
109
109
  selectionMode: C ? "multiple" : "none",
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "1.33.2",
3
+ "version": "1.33.4",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^12.112.2",
7
- "@box/blueprint-web-assets": "^4.91.2",
8
- "@box/box-item-type-selector": "^1.22.2",
9
- "@box/item-icon": "^2.13.2",
10
- "@box/metadata-filter": "^1.59.2",
6
+ "@box/blueprint-web": "^12.112.3",
7
+ "@box/blueprint-web-assets": "^4.91.3",
8
+ "@box/box-item-type-selector": "^1.22.3",
9
+ "@box/item-icon": "^2.13.3",
10
+ "@box/metadata-filter": "^1.59.3",
11
11
  "@box/types": "0.2.1",
12
12
  "@tanstack/react-virtual": "^3.10.8",
13
13
  "formik": "^2.4.5",
@@ -18,13 +18,13 @@
18
18
  "react-intl": "^6.4.2"
19
19
  },
20
20
  "devDependencies": {
21
- "@box/blueprint-web": "^12.112.2",
22
- "@box/blueprint-web-assets": "^4.91.2",
23
- "@box/box-item-type-selector": "^1.22.2",
21
+ "@box/blueprint-web": "^12.112.3",
22
+ "@box/blueprint-web-assets": "^4.91.3",
23
+ "@box/box-item-type-selector": "^1.22.3",
24
24
  "@box/eslint-plugin-blueprint": "1.0.5",
25
- "@box/item-icon": "^2.13.2",
26
- "@box/metadata-filter": "^1.59.2",
27
- "@box/storybook-utils": "0.15.2",
25
+ "@box/item-icon": "^2.13.3",
26
+ "@box/metadata-filter": "^1.59.3",
27
+ "@box/storybook-utils": "0.15.3",
28
28
  "@box/types": "2.0.0",
29
29
  "@tanstack/react-virtual": "^3.10.8",
30
30
  "react-intl": "^6.4.2"