@box/metadata-filter 1.80.4 → 1.80.6

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,30 +1,30 @@
1
1
  import { ComboboxWithApiTreeView as J, ComboboxWithApiPagination as N } from "@box/combobox-with-api";
2
- import j from "clsx";
3
- import { useFormikContext as Q, getIn as X, Field as Y } from "formik";
4
- import { useState as F, useCallback as c } from "react";
5
- import { useIntl as Z } from "react-intl";
6
- import E from "../../../../messages.js";
7
- import { getInitialAdvancedFilterValue as ee, isBlankOption as M, createFieldValue as P, getInputValue as oe } from "./utils.js";
8
- import { jsx as s, jsxs as te, Fragment as se } from "react/jsx-runtime";
2
+ import F from "clsx";
3
+ import { useFormikContext as Q, getIn as R, Field as X } from "formik";
4
+ import { useState as M, useCallback as c } from "react";
5
+ import { useIntl as Y } from "react-intl";
6
+ import Z from "../../../../messages.js";
7
+ import { getInitialAdvancedFilterValue as E, isBlankOption as P, createFieldValue as $, getInputValue as ee } from "./utils.js";
8
+ import { jsx as l, jsxs as oe, Fragment as te } from "react/jsx-runtime";
9
9
  import { A as le } from "../../../../../../chunks/index.js";
10
- import '../../../../../../styles/metadata-taxonomy-field-advanced.css';const ae = "_comboboxWrapper_1e1d8_1", ne = "_disabled_1e1d8_1", ce = "_disabledTreeView_1e1d8_5", V = {
11
- comboboxWrapper: ae,
12
- disabled: ne,
13
- disabledTreeView: ce
14
- }, ge = ({
10
+ import '../../../../../../styles/metadata-taxonomy-field-advanced.css';const se = "_comboboxWrapper_1e1d8_1", ae = "_disabled_1e1d8_1", ne = "_disabledTreeView_1e1d8_5", V = {
11
+ comboboxWrapper: se,
12
+ disabled: ae,
13
+ disabledTreeView: ne
14
+ }, Ve = ({
15
15
  className: g,
16
- disableForm: l,
16
+ disableForm: s,
17
17
  fieldNamePrefix: d,
18
- label: u,
19
- portalElement: m,
18
+ label: m,
19
+ portalElement: u,
20
20
  taxonomyOptionsFetcher: p,
21
- isMultilevelTaxonomyFieldEnabled: $,
22
- hasAccordion: A,
21
+ isMultilevelTaxonomyFieldEnabled: A,
22
+ hasAccordion: B,
23
23
  isAdvancedFilterEnabled: a,
24
24
  onAdvancedFilterOptionChange: h,
25
25
  fieldAdvancedFilterOptions: f,
26
26
  filterOptionsMap: C,
27
- isModified: B
27
+ isModified: K
28
28
  }) => {
29
29
  const {
30
30
  setFieldValue: v,
@@ -34,72 +34,71 @@ import '../../../../../../styles/metadata-taxonomy-field-advanced.css';const ae
34
34
  templateKey: _,
35
35
  scope: w
36
36
  }
37
- } = x, T = Z(), t = `${d}.value`, K = X(x, d), {
37
+ } = x, T = Y(), t = `${d}.value`, U = R(x, d), {
38
38
  key: W,
39
- optionsRules: R,
40
- levels: U
41
- } = K, k = !0, i = R?.selectableLevels, q = $ && i?.some((e) => e > 1), [r, z] = F(ee(f, C)), [D, I] = F(!1), S = c((e) => p ? p(w, _, W, i?.[0] ?? 0, e) : Promise.resolve({
39
+ levels: k
40
+ } = U, I = !0, i = k?.map((e) => e.level), q = A && i?.some((e) => e > 1), [r, z] = M(E(f, C)), [D, S] = M(!1), O = c((e) => p ? p(w, _, W, i?.[0] ?? 0, e) : Promise.resolve({
42
41
  options: []
43
- }), [W, w, i, p, _]), L = c((e) => e?.length === 0 ? T.formatMessage(E.multiselectPlaceholder) : "", [T]), G = c((e, n, o) => {
42
+ }), [W, w, i, p, _]), y = c((e) => e?.length === 0 ? T.formatMessage(Z.multiselectPlaceholder) : "", [T]), G = c((e, n, o) => {
44
43
  z(e), h?.(t, e);
45
- const b = M(e) ? [] : n, H = P(b, e, a);
44
+ const b = P(e) ? [] : n, H = $(b, e, a);
46
45
  o.setFieldValue(t, H);
47
- }, [t, a, h]), O = c((e) => {
48
- e && I(!1);
49
- }, []), y = c((e) => {
50
- const n = P(e, r, a);
46
+ }, [t, a, h]), L = c((e) => {
47
+ e && S(!1);
48
+ }, []), j = c((e) => {
49
+ const n = $(e, r, a);
51
50
  v(t, n);
52
51
  }, [r, t, a, v]);
53
- return /* @__PURE__ */ s("div", {
54
- "data-testid": `${u}-field`,
55
- children: /* @__PURE__ */ s(Y, {
52
+ return /* @__PURE__ */ l("div", {
53
+ "data-testid": `${m}-field`,
54
+ children: /* @__PURE__ */ l(X, {
56
55
  name: t,
57
56
  children: ({
58
57
  field: e,
59
58
  form: n
60
59
  }) => {
61
- const o = oe(e.value, a);
62
- return /* @__PURE__ */ te(se, {
63
- children: [/* @__PURE__ */ s(le, {
64
- disableForm: l ?? !1,
60
+ const o = ee(e.value, a);
61
+ return /* @__PURE__ */ oe(te, {
62
+ children: [/* @__PURE__ */ l(le, {
63
+ disableForm: s ?? !1,
65
64
  fieldAdvancedFilterOptions: f,
66
65
  fieldNamePrefix: d,
67
66
  filterOptionsMap: C,
68
- isModified: B,
69
- label: u,
67
+ isModified: K,
68
+ label: m,
70
69
  onAdvancedFilterOptionChange: h,
71
- onOpenChange: I,
70
+ onOpenChange: S,
72
71
  onValueChange: (b) => G(b, o, n),
73
72
  open: D,
74
- portalElement: m,
75
- showLabel: !A,
73
+ portalElement: u,
74
+ showLabel: !B,
76
75
  value: r
77
- }), !M(r) && /* @__PURE__ */ s("div", {
78
- className: j(V.comboboxWrapper, l && V.disabled),
79
- children: q ? /* @__PURE__ */ s(J, {
80
- className: j(g, l && V.disabledTreeView),
81
- defaultFetcher: S,
82
- disabled: l,
76
+ }), !P(r) && /* @__PURE__ */ l("div", {
77
+ className: F(V.comboboxWrapper, s && V.disabled),
78
+ children: q ? /* @__PURE__ */ l(J, {
79
+ className: F(g, s && V.disabledTreeView),
80
+ defaultFetcher: O,
81
+ disabled: s,
83
82
  hideLabel: !0,
84
- label: u,
85
- levels: U,
86
- multiselect: k,
87
- onOpenChange: O,
88
- onValueChange: y,
89
- placeholder: L(o),
90
- portalElement: m,
83
+ label: m,
84
+ levels: k,
85
+ multiselect: I,
86
+ onOpenChange: L,
87
+ onValueChange: j,
88
+ placeholder: y(o),
89
+ portalElement: u,
91
90
  selectableLevels: i,
92
91
  value: o
93
- }) : /* @__PURE__ */ s(N, {
92
+ }) : /* @__PURE__ */ l(N, {
94
93
  className: g,
95
- defaultFetcher: S,
96
- disabled: l,
94
+ defaultFetcher: O,
95
+ disabled: s,
97
96
  label: void 0,
98
- multiselect: k,
99
- onOpenChange: O,
100
- onValueChange: y,
101
- placeholder: L(o),
102
- portalElement: m,
97
+ multiselect: I,
98
+ onOpenChange: L,
99
+ onValueChange: j,
100
+ placeholder: y(o),
101
+ portalElement: u,
103
102
  value: o
104
103
  })
105
104
  })]
@@ -109,6 +108,6 @@ import '../../../../../../styles/metadata-taxonomy-field-advanced.css';const ae
109
108
  });
110
109
  };
111
110
  export {
112
- ge as MetadataTaxonomyFieldAdvanced,
113
- ge as default
111
+ Ve as MetadataTaxonomyFieldAdvanced,
112
+ Ve as default
114
113
  };
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@box/metadata-filter",
3
- "version": "1.80.4",
3
+ "version": "1.80.6",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^13.12.0",
6
- "@box/blueprint-web-assets": "^4.111.3",
7
- "@box/combobox-with-api": "^1.42.4",
5
+ "@box/blueprint-web": "^13.13.0",
6
+ "@box/blueprint-web-assets": "^4.111.4",
7
+ "@box/combobox-with-api": "^1.42.5",
8
8
  "formik": "^2.0.3",
9
9
  "react": "^17.0.0 || ^18.0.0",
10
10
  "react-dom": "^17.0.0 || ^18.0.0",
11
11
  "react-intl": "6.4.2"
12
12
  },
13
13
  "devDependencies": {
14
- "@box/blueprint-web": "^13.12.0",
15
- "@box/blueprint-web-assets": "^4.111.3",
16
- "@box/storybook-utils": "^0.17.3",
14
+ "@box/blueprint-web": "^13.13.0",
15
+ "@box/blueprint-web-assets": "^4.111.4",
16
+ "@box/storybook-utils": "^0.17.4",
17
17
  "react": "^18.3.0",
18
18
  "react-dom": "^18.3.0",
19
19
  "react-intl": "6.4.2"