@box/metadata-view 1.53.22 → 1.53.24

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.
@@ -3,8 +3,8 @@ import { Grid as b } from "@box/blueprint-web-assets/icons/Fill";
3
3
  import { useIntl as u } from "react-intl";
4
4
  import { V as r } from "../../../../chunks/types.js";
5
5
  import { ZoomButton as R } from "./zoom-button.js";
6
- import s from "./messages.js";
7
- import { jsxs as e, jsx as o } from "react/jsx-runtime";
6
+ import e from "./messages.js";
7
+ import { jsxs as s, jsx as o } from "react/jsx-runtime";
8
8
  import { FilterRow as x } from "../filter-row/filter-row.js";
9
9
  import { SortDropdown as h } from "../sort-dropdown/sort-dropdown.js";
10
10
  import '../../../../styles/action-bar.css';const A = "_actionBar_bbxsv_1", C = "_filterRow_bbxsv_8", G = "_additionalActions_bbxsv_13", I = "_viewModeButtonContainer_bbxsv_24", t = {
@@ -15,8 +15,8 @@ import '../../../../styles/action-bar.css';const A = "_actionBar_bbxsv_1", C = "
15
15
  }, F = ({
16
16
  isIconColumnEnabled: c,
17
17
  isViewModeButtonDisabled: m,
18
- onSortDescriptorChange: l,
19
- onViewModeClick: d,
18
+ onSortDescriptorChange: d,
19
+ onViewModeClick: l,
20
20
  onZoomLevelChange: f,
21
21
  sortableColumns: w,
22
22
  sortDescriptor: _,
@@ -28,18 +28,18 @@ import '../../../../styles/action-bar.css';const A = "_actionBar_bbxsv_1", C = "
28
28
  const {
29
29
  formatMessage: a
30
30
  } = u();
31
- return /* @__PURE__ */ e("div", {
31
+ return /* @__PURE__ */ s("div", {
32
32
  className: t.actionBar,
33
33
  children: [/* @__PURE__ */ o("div", {
34
34
  className: t.filterRow,
35
35
  children: /* @__PURE__ */ o(x, {
36
36
  ...B
37
37
  })
38
- }), /* @__PURE__ */ e("div", {
38
+ }), /* @__PURE__ */ s("div", {
39
39
  className: t.additionalActions,
40
40
  children: [n && /* @__PURE__ */ o(h, {
41
41
  ...n,
42
- onSortDescriptorChange: l,
42
+ onSortDescriptorChange: d,
43
43
  sortableColumns: w,
44
44
  sortDescriptor: _
45
45
  }), (c || i === r.GRID) && /* @__PURE__ */ o(R, {
@@ -48,9 +48,9 @@ import '../../../../styles/action-bar.css';const A = "_actionBar_bbxsv_1", C = "
48
48
  }), !m && /* @__PURE__ */ o("div", {
49
49
  className: t.viewModeButtonContainer,
50
50
  children: /* @__PURE__ */ o(p, {
51
- "aria-label": i === r.GRID ? a(s.switchToListView) : a(s.switchToGridView),
52
- icon: b,
53
- onClick: d,
51
+ "aria-label": i === r.GRID ? a(e.switchToListView) : a(e.switchToGridView),
52
+ endIcon: b,
53
+ onClick: l,
54
54
  variant: i === r.GRID ? "primary" : "tertiary"
55
55
  })
56
56
  })]
@@ -4,21 +4,21 @@ import S from "lodash/get";
4
4
  import w from "lodash/isEqual";
5
5
  import { useIntl as x } from "react-intl";
6
6
  import y from "../../messages.js";
7
- import { jsx as t, jsxs as O } from "react/jsx-runtime";
8
- import '../../../../../../styles/inline-editing-cell.css';const j = "_inlineEditingCell_1iieg_1", D = {
9
- inlineEditingCell: j
7
+ import { jsx as t, jsxs as I } from "react/jsx-runtime";
8
+ import '../../../../../../styles/inline-editing-cell.css';const O = "_inlineEditingCell_1iieg_1", j = {
9
+ inlineEditingCell: O
10
10
  }, R = ({
11
- column: m,
11
+ column: d,
12
12
  item: s,
13
13
  onInlineEditChange: c
14
14
  }) => {
15
15
  const {
16
- formatMessage: d
16
+ formatMessage: m
17
17
  } = x(), {
18
18
  type: a,
19
19
  inlineEditingOptions: f,
20
20
  id: u
21
- } = m, r = S(s, u), n = typeof r == "string" ? [r] : r || [], o = d(y.unselectedOptionLabel), g = [{
21
+ } = d, r = S(s, u), n = typeof r == "string" ? [r] : r || [], o = m(y.unselectedOptionLabel), g = [{
22
22
  value: null,
23
23
  label: o
24
24
  }, ...(f ?? []).map((e) => ({
@@ -31,11 +31,11 @@ import '../../../../../../styles/inline-editing-cell.css';const j = "_inlineEdit
31
31
  a === "multiSelect" ? e === null ? l = [] : l = n.includes(e) ? n.filter((C) => C !== e) : [...n, e] : l = e, (a === "multiSelect" ? !w(l, n) : l !== n[0]) && c(s, l, u);
32
32
  }, p = (e) => e === null ? n.length === 0 : n.includes(e);
33
33
  return /* @__PURE__ */ t(b, {
34
- children: /* @__PURE__ */ O(i.Root, {
34
+ children: /* @__PURE__ */ I(i.Root, {
35
35
  children: [/* @__PURE__ */ t(i.Trigger, {
36
36
  children: /* @__PURE__ */ t(v, {
37
- className: D.inlineEditingCell,
38
- icon: E,
37
+ className: j.inlineEditingCell,
38
+ endIcon: E,
39
39
  variant: "secondary",
40
40
  children: n.length > 0 ? n.join(", ") : o
41
41
  })
@@ -1,44 +1,48 @@
1
- import { ContentField as u } from "@box/blueprint-web";
2
- import { useFormikContext as F } from "formik";
3
- import g from "lodash/noop";
4
- import { useIntl as p } from "react-intl";
5
- import C from "./messages.js";
6
- import { jsx as i } from "react/jsx-runtime";
7
- import '../../../../styles/metadata-location-field.css';const h = "_metadataLocationFieldTrigger_1d3ch_1", v = {
8
- metadataLocationFieldTrigger: h
9
- }, M = ({
1
+ import { useFormikContext as u } from "formik";
2
+ import F from "lodash/noop";
3
+ import { useIntl as g } from "react-intl";
4
+ import { FolderShared as p } from "@box/blueprint-web-assets/icons/Content";
5
+ import { ContentField as h } from "@box/content-field";
6
+ import v from "./messages.js";
7
+ import { jsx as l } from "react/jsx-runtime";
8
+ import '../../../../styles/metadata-location-field.css';const C = "_metadataLocationFieldTrigger_1d3ch_1", L = {
9
+ metadataLocationFieldTrigger: C
10
+ }, y = ({
10
11
  id: e,
11
- triggerSetValueCallback: l = g,
12
- renderer: r = (t) => t
12
+ triggerSetValueCallback: r = F,
13
+ renderer: i = (t) => t
13
14
  }) => {
14
15
  const {
15
16
  formatMessage: t
16
- } = p(), {
17
- values: n,
18
- setFieldValue: a
19
- } = F(), o = n.metadata.fields[e].value.enum?.[0], d = () => {
20
- a(`metadata.fields.${e}.value.enum`, []);
21
- }, s = () => {
22
- l((m, c, f = !1) => {
23
- a(`metadata.fields.${e}.value.enum[0]`, {
24
- folderId: m,
17
+ } = g(), {
18
+ values: d,
19
+ setFieldValue: o
20
+ } = u(), a = d.metadata.fields[e].value.enum?.[0], n = () => {
21
+ o(`metadata.fields.${e}.value.enum`, []);
22
+ }, m = () => {
23
+ r((s, c, f = !1) => {
24
+ o(`metadata.fields.${e}.value.enum[0]`, {
25
+ folderId: s,
25
26
  folderName: c,
26
27
  isFolderShared: f
27
28
  });
28
29
  });
29
30
  };
30
- return r(/* @__PURE__ */ i("div", {
31
- className: v.metadataLocationFieldTrigger,
32
- children: /* @__PURE__ */ i(u, {
31
+ return i(/* @__PURE__ */ l("div", {
32
+ className: L.metadataLocationFieldTrigger,
33
+ children: /* @__PURE__ */ l(h, {
33
34
  "data-target-id": `ContentField-filter_${e}`,
34
- hintText: t(C.selectFolderHint),
35
- isSharedFolder: o?.isFolderShared,
36
- onClick: s,
37
- onClickClearButton: d,
38
- title: o?.folderName
35
+ icon: a?.isFolderShared ? p : void 0,
36
+ onClear: n,
37
+ onClick: m,
38
+ placeholder: t(v.selectFolderHint),
39
+ title: a?.folderName ? {
40
+ titleValue: a.folderName,
41
+ type: "constant"
42
+ } : void 0
39
43
  })
40
44
  }));
41
45
  };
42
46
  export {
43
- M as MetadataLocationField
47
+ y as MetadataLocationField
44
48
  };
package/package.json CHANGED
@@ -1,31 +1,33 @@
1
1
  {
2
2
  "name": "@box/metadata-view",
3
- "version": "1.53.22",
3
+ "version": "1.53.24",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "peerDependencies": {
6
- "@box/blueprint-web": "^13.18.0",
7
- "@box/blueprint-web-assets": "^4.111.13",
8
- "@box/box-item-type-selector": "^1.39.17",
9
- "@box/item-icon": "^2.32.10",
10
- "@box/metadata-filter": "^1.80.19",
11
- "@box/types": "2.1.10",
6
+ "@box/blueprint-web": "^14.0.0",
7
+ "@box/blueprint-web-assets": "^4.111.15",
8
+ "@box/box-item-type-selector": "^1.39.19",
9
+ "@box/item-icon": "^2.32.12",
10
+ "@box/metadata-filter": "^1.80.21",
11
+ "@box/types": "2.1.11",
12
+ "@box/content-field": "^1.40.19",
12
13
  "@tanstack/react-virtual": "^3.10.8",
13
14
  "formik": "^2.4.5",
14
15
  "lodash": "^4.17.15",
15
16
  "react": "^18.0.0",
16
- "react-aria-components": "^1.7.1",
17
+ "react-aria-components": "1.16.0",
17
18
  "react-dom": "^18.0.0",
18
19
  "react-intl": "^6.4.2"
19
20
  },
20
21
  "devDependencies": {
21
- "@box/blueprint-web": "^13.18.0",
22
- "@box/blueprint-web-assets": "^4.111.13",
23
- "@box/box-item-type-selector": "^1.39.17",
24
- "@box/eslint-plugin-blueprint": "1.1.7",
25
- "@box/item-icon": "^2.32.10",
26
- "@box/metadata-filter": "^1.80.19",
27
- "@box/storybook-utils": "0.17.13",
28
- "@box/types": "2.1.10",
22
+ "@box/blueprint-web": "^14.0.0",
23
+ "@box/blueprint-web-assets": "^4.111.15",
24
+ "@box/box-item-type-selector": "^1.39.19",
25
+ "@box/eslint-plugin-blueprint": "1.1.8",
26
+ "@box/item-icon": "^2.32.12",
27
+ "@box/metadata-filter": "^1.80.21",
28
+ "@box/storybook-utils": "0.17.15",
29
+ "@box/types": "2.1.11",
30
+ "@box/content-field": "^1.40.19",
29
31
  "@tanstack/react-virtual": "^3.10.8",
30
32
  "react-intl": "^6.4.2"
31
33
  },