@box/metadata-filter 1.62.4 → 1.63.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.
Files changed (29) hide show
  1. package/dist/chunks/types.js +6 -3
  2. package/dist/esm/index.js +13 -12
  3. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-advanced.js +128 -128
  4. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/handlers.js +10 -9
  5. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field-advanced.js +32 -32
  6. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.js +53 -51
  7. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.js +54 -52
  8. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field-advanced.js +114 -0
  9. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/utils.js +15 -0
  10. package/dist/esm/lib/components/metadata-filter-fields/field-processing-utils.js +23 -13
  11. package/dist/esm/lib/components/metadata-filter-fields/filter-field-types.js +18 -17
  12. package/dist/esm/lib/components/metadata-filter-fields/is-modified-utils.js +58 -47
  13. package/dist/esm/lib/components/metadata-filter-fields/metadata-filter-fields-accordion.js +27 -25
  14. package/dist/esm/lib/components/metadata-filter-fields/metadata-filter-fields.js +31 -29
  15. package/dist/esm/lib/defaults.js +10 -8
  16. package/dist/esm/lib/metadata-filter.js +28 -26
  17. package/dist/styles/metadata-taxonomy-field-advanced.css +1 -0
  18. package/dist/types/lib/components/metadata-filter-fields/components/metadata-float-field/handlers.d.ts +2 -2
  19. package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field-advanced.d.ts +3 -0
  20. package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/types.d.ts +6 -0
  21. package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/utils.d.ts +12 -0
  22. package/dist/types/lib/components/metadata-filter-fields/field-processing-utils.d.ts +6 -4
  23. package/dist/types/lib/components/metadata-filter-fields/metadata-filter-fields-accordion.d.ts +1 -1
  24. package/dist/types/lib/components/metadata-filter-fields/metadata-filter-fields.d.ts +1 -1
  25. package/dist/types/lib/components/metadata-filter-fields/types.d.ts +9 -8
  26. package/dist/types/lib/metadata-filter.d.ts +1 -1
  27. package/dist/types/lib/test-utils/sample-data.d.ts +5 -4
  28. package/dist/types/lib/types.d.ts +50 -8
  29. package/package.json +7 -7
@@ -1,56 +1,58 @@
1
- import { getIn as v } from "formik";
2
- const f = (t) => typeof t == "object" && t !== null && "range" in t, O = (t) => typeof t == "object" && t !== null && "value" in t && typeof t.value == "string", y = ["string", "enum", "multiSelect", "float", "date"], A = {
1
+ import { getIn as g } from "formik";
2
+ const f = (t) => typeof t == "object" && t !== null && "range" in t, O = (t) => typeof t == "object" && t !== null && "value" in t && typeof t.value == "string", p = ["string", "enum", "multiSelect", "float", "date", "taxonomy"], A = {
3
3
  string: "matchExactly",
4
4
  float: "equals",
5
5
  enum: "matchAny",
6
6
  multiSelect: "matchAny",
7
- date: "selectFilterType"
8
- }, l = (t) => typeof t == "string" && t.trim() !== "", V = (t, n, e) => t !== void 0 ? t !== e : e !== void 0 && e !== n, u = (t) => {
7
+ date: "selectFilterType",
8
+ taxonomy: "matchAny"
9
+ }, l = (t) => typeof t == "string" && t.trim() !== "", x = (t, r, e) => t !== void 0 ? t !== e : r === void 0 ? !1 : e !== r, u = (t) => {
9
10
  if (!t || typeof t != "object")
10
11
  return !1;
11
- const n = t;
12
- return l(n.gt) || l(n.lt);
13
- }, m = (t) => Array.isArray(t) ? t.filter((n) => typeof n == "string" && n !== "").length > 0 : !1, o = (t) => {
12
+ const r = t;
13
+ return l(r.gt) || l(r.lt);
14
+ }, m = (t) => Array.isArray(t) ? t.filter((r) => typeof r == "string" && r !== "").length > 0 : !1, o = (t) => {
14
15
  if (!(!t || t === ""))
15
16
  return t;
16
17
  }, a = (t) => {
17
18
  if (t && typeof t == "object")
18
19
  return o(t.advancedFilterOption);
19
20
  }, h = (t) => {
20
- const n = t.enum?.[0];
21
- return a(n);
22
- }, F = (t) => {
23
- const n = t.enum;
24
- if (n && typeof n == "object" && !Array.isArray(n))
25
- return a(n);
26
- const e = Array.isArray(n) ? n[0] : void 0;
21
+ const r = t.enum?.[0];
22
+ return a(r);
23
+ }, y = (t) => {
24
+ const r = t.enum;
25
+ if (r && typeof r == "object" && !Array.isArray(r))
26
+ return a(r);
27
+ const e = Array.isArray(r) ? r[0] : void 0;
27
28
  return a(e);
28
- }, j = (t) => {
29
- const n = t.enum?.[0];
30
- return a(n);
31
- }, x = (t) => o(t.advancedFilterOption), S = {
29
+ }, V = (t) => {
30
+ const r = t.enum?.[0];
31
+ return a(r);
32
+ }, j = (t) => o(t.advancedFilterOption), S = (t) => o(t.advancedFilterOption), b = {
32
33
  string: h,
33
- enum: F,
34
- multiSelect: F,
35
- float: j,
36
- date: x
37
- }, b = (t, n, e) => {
38
- if (!e || !y.includes(t))
34
+ enum: y,
35
+ multiSelect: y,
36
+ float: V,
37
+ date: j,
38
+ taxonomy: S
39
+ }, E = (t, r, e) => {
40
+ if (!e || !p.includes(t))
39
41
  return;
40
- const r = S[t];
41
- return r ? r(n) : void 0;
42
- }, E = (t, n) => {
43
- if (!n)
42
+ const n = b[t];
43
+ return n ? n(r) : void 0;
44
+ }, M = (t, r) => {
45
+ if (!r)
44
46
  return !1;
45
47
  const e = t.enum?.[0];
46
48
  return e && typeof e == "object" && O(e) ? l(e.value) : typeof e == "string" && e !== "";
47
- }, p = (t, n) => {
48
- if (!n)
49
+ }, F = (t, r) => {
50
+ if (!r)
49
51
  return !1;
50
52
  const e = t.enum;
51
53
  return Array.isArray(e) ? m(e) : e && typeof e == "object" ? m(e.value) : !1;
52
- }, C = (t, n) => {
53
- if (n) {
54
+ }, C = (t, r) => {
55
+ if (r) {
54
56
  const e = t.enum?.[0];
55
57
  if (e && typeof e == "object") {
56
58
  if ("value" in e && f(e.value))
@@ -60,25 +62,34 @@ const f = (t) => typeof t == "object" && t !== null && "range" in t, O = (t) =>
60
62
  }
61
63
  }
62
64
  return u(t.range);
63
- }, M = () => !1, D = {
64
- string: E,
65
- enum: p,
66
- multiSelect: p,
65
+ }, D = () => !1, I = (t, r) => {
66
+ if (Array.isArray(t))
67
+ return t.length > 0;
68
+ if (r) {
69
+ const e = t.value;
70
+ return Array.isArray(e) && e.length > 0;
71
+ }
72
+ return !1;
73
+ }, k = {
74
+ string: M,
75
+ enum: F,
76
+ multiSelect: F,
67
77
  float: C,
68
- date: M
69
- }, I = (t, n) => v(t, `metadata.fields[${n}].value`), k = (t) => t.advancedFilterOptionToExecute || A[t.type], L = (t, n, e, r) => {
70
- const i = n || {}, s = b(t, i, e), c = o(r), g = o(A[t]);
71
- if ((e || t === "date") && V(s, c, g))
78
+ date: D,
79
+ taxonomy: I
80
+ }, L = (t, r) => g(t, `metadata.fields[${r}].value`), N = (t) => t.advancedFilterOptionToExecute || A[t.type], R = (t, r, e, n) => {
81
+ const i = r || {}, s = E(t, i, e), c = o(n), v = o(A[t]);
82
+ if ((e || t === "date") && x(s, c, v))
72
83
  return !0;
73
- if (!y.includes(t))
84
+ if (!p.includes(t))
74
85
  return !1;
75
- const d = D[t];
86
+ const d = k[t];
76
87
  return d ? d(i, e) : !1;
77
- }, R = (t, n, e) => !t || !Array.isArray(t) ? !1 : t.some((r, i) => {
78
- const s = I(n, i), c = k(r);
79
- return L(r.type, s, e, c);
88
+ }, _ = (t, r, e) => !t || !Array.isArray(t) ? !1 : t.some((n, i) => {
89
+ const s = L(r, i), c = N(n);
90
+ return R(n.type, s, e, c);
80
91
  });
81
92
  export {
82
- R as isAnyFieldModified,
83
- L as isFieldModifiedFromValue
93
+ _ as isAnyFieldModified,
94
+ R as isFieldModifiedFromValue
84
95
  };
@@ -1,13 +1,13 @@
1
1
  import { Accordion as c, Text as p } from "@box/blueprint-web";
2
- import { useFormikContext as I, getIn as f, FieldArray as T } from "formik";
3
- import { useMemo as b } from "react";
4
- import { useIntl as j, FormattedMessage as S } from "react-intl";
2
+ import { useFormikContext as T, getIn as f, FieldArray as b } from "formik";
3
+ import { useMemo as j } from "react";
4
+ import { useIntl as S, FormattedMessage as w } from "react-intl";
5
5
  import u from "../../messages.js";
6
- import { processMetadataField as w } from "./field-processing-utils.js";
7
- import { isFieldModifiedFromValue as P } from "./is-modified-utils.js";
8
- import { s as q } from "../../../../chunks/index.js";
9
- import { jsx as t, jsxs as z } from "react/jsx-runtime";
10
- const W = ({
6
+ import { processMetadataField as P } from "./field-processing-utils.js";
7
+ import { isFieldModifiedFromValue as q } from "./is-modified-utils.js";
8
+ import { s as z } from "../../../../chunks/index.js";
9
+ import { jsx as t, jsxs as B } from "react/jsx-runtime";
10
+ const X = ({
11
11
  disableForm: y,
12
12
  locale: F,
13
13
  portalElement: h,
@@ -19,40 +19,42 @@ const W = ({
19
19
  fieldAdvancedFilterOptions: s,
20
20
  isMultilevelTaxonomyFieldEnabled: x,
21
21
  filterOptionsMap: A,
22
- hasAccordion: O
22
+ hasAccordion: O,
23
+ isAdvancedTaxonomy: $
23
24
  }) => {
24
25
  const {
25
26
  values: n
26
- } = I(), l = j(), m = "metadata.fields", o = f(n, m), $ = b(() => o.map((e, a) => `field-${e.key}-${a}`), [o]);
27
- return o.length ? /* @__PURE__ */ t(T, {
27
+ } = T(), l = S(), m = "metadata.fields", o = f(n, m), k = j(() => o.map((e, a) => `field-${e.key}-${a}`), [o]);
28
+ return o.length ? /* @__PURE__ */ t(b, {
28
29
  name: m,
29
30
  validateOnChange: !1,
30
31
  children: () => /* @__PURE__ */ t(c, {
31
- defaultValue: $,
32
+ defaultValue: k,
32
33
  type: "multiple",
33
34
  children: o.map((e, a) => {
34
35
  const {
35
- MetadataFilterField: k,
36
- showField: N,
37
- getFilterOptionsForField: V
38
- } = w({
36
+ MetadataFilterField: N,
37
+ showField: V,
38
+ getFilterOptionsForField: L
39
+ } = P({
39
40
  field: e,
40
41
  isAdvancedFilterEnabled: i,
42
+ isAdvancedTaxonomy: $,
41
43
  intl: l,
42
44
  filterOptionsMap: A
43
- }), L = f(n, `metadata.fields[${a}].value`), C = s?.[e.key], d = P(e.type, L, i, C);
44
- return N && /* @__PURE__ */ t(c.Item, {
45
+ }), C = f(n, `metadata.fields[${a}].value`), I = s?.[e.key], d = q(e.type, C, i, I);
46
+ return V && /* @__PURE__ */ t(c.Item, {
45
47
  iconAriaLabel: d && r ? l.formatMessage(u.filterModifiedAriaLabel) : void 0,
46
48
  iconVariant: d && r ? "status-modified" : void 0,
47
49
  title: e.displayName,
48
50
  value: `field-${e.key}-${a}`,
49
- children: /* @__PURE__ */ z("div", {
50
- children: [/* @__PURE__ */ t(k, {
51
+ children: /* @__PURE__ */ B("div", {
52
+ children: [/* @__PURE__ */ t(N, {
51
53
  canUseRelativeDates: M,
52
54
  disableForm: y,
53
55
  fieldAdvancedFilterOptions: s?.[e.key],
54
56
  fieldNamePrefix: `metadata.fields[${a}]`,
55
- filterOptionsMap: V(),
57
+ filterOptionsMap: L(),
56
58
  hasAccordion: O,
57
59
  isAdvancedFilterEnabled: i,
58
60
  isMultilevelTaxonomyFieldEnabled: x,
@@ -73,14 +75,14 @@ const W = ({
73
75
  })
74
76
  }) : /* @__PURE__ */ t(p, {
75
77
  as: "span",
76
- className: q.noAttributesText,
78
+ className: z.noAttributesText,
77
79
  color: "textOnLightSecondary",
78
- children: /* @__PURE__ */ t(S, {
80
+ children: /* @__PURE__ */ t(w, {
79
81
  ...u.noTemplateAtributesError
80
82
  })
81
83
  });
82
84
  };
83
85
  export {
84
- W as MetadataFilterFieldsAccordion,
85
- W as default
86
+ X as MetadataFilterFieldsAccordion,
87
+ X as default
86
88
  };
@@ -1,13 +1,13 @@
1
1
  import { Text as m } from "@box/blueprint-web";
2
- import { useFormikContext as A, getIn as l, FieldArray as I } from "formik";
3
- import { useEffect as L } from "react";
4
- import { useIntl as S, FormattedMessage as V } from "react-intl";
5
- import $ from "../../messages.js";
6
- import { processMetadataField as w } from "./field-processing-utils.js";
7
- import { isAnyFieldModified as C, isFieldModifiedFromValue as P } from "./is-modified-utils.js";
8
- import { s as q } from "../../../../chunks/index.js";
9
- import { jsx as i, jsxs as z } from "react/jsx-runtime";
10
- const X = ({
2
+ import { useFormikContext as I, getIn as l, FieldArray as L } from "formik";
3
+ import { useEffect as S } from "react";
4
+ import { useIntl as V, FormattedMessage as $ } from "react-intl";
5
+ import w from "../../messages.js";
6
+ import { processMetadataField as C } from "./field-processing-utils.js";
7
+ import { isAnyFieldModified as P, isFieldModifiedFromValue as q } from "./is-modified-utils.js";
8
+ import { s as z } from "../../../../chunks/index.js";
9
+ import { jsx as i, jsxs as B } from "react/jsx-runtime";
10
+ const Y = ({
11
11
  disableForm: d,
12
12
  locale: p,
13
13
  portalElement: c,
@@ -19,39 +19,41 @@ const X = ({
19
19
  fieldAdvancedFilterOptions: M,
20
20
  isMultilevelTaxonomyFieldEnabled: y,
21
21
  filterOptionsMap: O,
22
- onDirtyChange: a
22
+ onDirtyChange: a,
23
+ isAdvancedTaxonomy: h
23
24
  }) => {
24
25
  const {
25
26
  values: o
26
- } = A(), h = S(), r = "metadata.fields", s = l(o, r);
27
- return L(() => {
27
+ } = I(), g = V(), r = "metadata.fields", s = l(o, r);
28
+ return S(() => {
28
29
  if (a) {
29
- const t = C(s, o, e);
30
+ const t = P(s, o, e);
30
31
  a(t);
31
32
  }
32
- }, [o, e, a, s]), s.length ? /* @__PURE__ */ i(I, {
33
+ }, [o, e, a, s]), s.length ? /* @__PURE__ */ i(L, {
33
34
  name: r,
34
35
  validateOnChange: !1,
35
36
  children: () => s.map((t, n) => {
36
37
  const {
37
- MetadataFilterField: g,
38
- showField: v,
39
- getFilterOptionsForField: N
40
- } = w({
38
+ MetadataFilterField: v,
39
+ showField: N,
40
+ getFilterOptionsForField: T
41
+ } = C({
41
42
  field: t,
42
43
  isAdvancedFilterEnabled: e,
43
- intl: h,
44
+ isAdvancedTaxonomy: h,
45
+ intl: g,
44
46
  filterOptionsMap: O
45
- }), T = l(o, `metadata.fields[${n}].value`), k = t.advancedFilterOptionToExecute, j = P(t.type, T, e, k);
46
- return v && /* @__PURE__ */ z("div", {
47
- children: [/* @__PURE__ */ i(g, {
47
+ }), k = l(o, `metadata.fields[${n}].value`), j = t.advancedFilterOptionToExecute, A = q(t.type, k, e, j);
48
+ return N && /* @__PURE__ */ B("div", {
49
+ children: [/* @__PURE__ */ i(v, {
48
50
  canUseRelativeDates: u,
49
51
  disableForm: d,
50
52
  fieldAdvancedFilterOptions: M?.[t.key],
51
53
  fieldNamePrefix: `metadata.fields[${n}]`,
52
- filterOptionsMap: N(),
54
+ filterOptionsMap: T(),
53
55
  isAdvancedFilterEnabled: e,
54
- isModified: j && F,
56
+ isModified: A && F,
55
57
  isMultilevelTaxonomyFieldEnabled: y,
56
58
  label: t.displayName,
57
59
  locale: p,
@@ -68,14 +70,14 @@ const X = ({
68
70
  })
69
71
  }) : /* @__PURE__ */ i(m, {
70
72
  as: "span",
71
- className: q.noAttributesText,
73
+ className: z.noAttributesText,
72
74
  color: "textOnLightSecondary",
73
- children: /* @__PURE__ */ i(V, {
74
- ...$.noTemplateAtributesError
75
+ children: /* @__PURE__ */ i($, {
76
+ ...w.noTemplateAtributesError
75
77
  })
76
78
  });
77
79
  };
78
80
  export {
79
- X as MetadataFilterFields,
80
- X as default
81
+ Y as MetadataFilterFields,
82
+ Y as default
81
83
  };
@@ -1,12 +1,13 @@
1
- import { SELECT_EMPTY_VALUE as e } from "@box/blueprint-web";
2
- const a = {
1
+ import { SELECT_EMPTY_VALUE as t } from "@box/blueprint-web";
2
+ import { F as e } from "../../chunks/types.js";
3
+ const l = {
3
4
  scope: "",
4
5
  templateKey: "",
5
6
  type: "",
6
- id: e,
7
+ id: t,
7
8
  hidden: !1,
8
9
  fields: []
9
- }, i = {
10
+ }, n = {
10
11
  string: {
11
12
  enum: [""]
12
13
  },
@@ -21,7 +22,7 @@ const a = {
21
22
  gt: "",
22
23
  lt: ""
23
24
  },
24
- advancedFilterOption: ""
25
+ advancedFilterOption: e.EQUALS
25
26
  },
26
27
  date: {
27
28
  range: {
@@ -31,10 +32,11 @@ const a = {
31
32
  relativeDays: void 0,
32
33
  relativeType: void 0,
33
34
  customType: "anyTime",
34
- customDays: void 0
35
+ customDays: void 0,
36
+ advancedFilterOption: e.SELECT_FILTER_TYPE
35
37
  }
36
38
  };
37
39
  export {
38
- a as defaultInitialValues,
39
- i as defaultMetadataValueMap
40
+ l as defaultInitialValues,
41
+ n as defaultMetadataValueMap
40
42
  };
@@ -1,26 +1,26 @@
1
1
  import "@box/combobox-with-api";
2
2
  import "./components/metadata-filter-fields/components/metadata-date-field/date-conversion-utils.js";
3
- import { defaultInitialValues as v } from "./defaults.js";
4
- import { LoadingIndicator as M } from "@box/blueprint-web";
5
- import { useFormikContext as N } from "formik";
6
- import { useEffect as V } from "react";
7
- import { useIntl as b } from "react-intl";
8
- import { MetadataFilterFields as k } from "./components/metadata-filter-fields/metadata-filter-fields.js";
9
- import { MetadataFilterFieldsAccordion as D } from "./components/metadata-filter-fields/metadata-filter-fields-accordion.js";
10
- import { MetadataTemplateSelector as L } from "./components/metadata-template-selector/metadata-template-selector.js";
11
- import { mapDataFromTemplate as S } from "./mappers.js";
12
- import q from "./messages.js";
13
- import { jsxs as w, jsx as r } from "react/jsx-runtime";
3
+ import { defaultInitialValues as M } from "./defaults.js";
4
+ import { LoadingIndicator as N } from "@box/blueprint-web";
5
+ import { useFormikContext as V } from "formik";
6
+ import { useEffect as b } from "react";
7
+ import { useIntl as k } from "react-intl";
8
+ import { MetadataFilterFields as D } from "./components/metadata-filter-fields/metadata-filter-fields.js";
9
+ import { MetadataFilterFieldsAccordion as L } from "./components/metadata-filter-fields/metadata-filter-fields-accordion.js";
10
+ import { MetadataTemplateSelector as S } from "./components/metadata-template-selector/metadata-template-selector.js";
11
+ import { mapDataFromTemplate as q } from "./mappers.js";
12
+ import w from "./messages.js";
13
+ import { jsxs as z, jsx as r } from "react/jsx-runtime";
14
14
  import "../../chunks/types.js";
15
15
  import "./components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.js";
16
16
  import "./components/metadata-filter-fields/components/metadata-enum-field/metadata-enum-field.js";
17
17
  import "./components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.js";
18
18
  import "./components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.js";
19
19
  import "./components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.js";
20
- import '../../styles/metadata-filter.css';const z = "_container_p63iy_1", A = "_loadingIndicator_p63iy_7", e = {
21
- container: z,
22
- loadingIndicator: A
23
- }, rt = ({
20
+ import '../../styles/metadata-filter.css';const A = "_container_p63iy_1", B = "_loadingIndicator_p63iy_7", e = {
21
+ container: A,
22
+ loadingIndicator: B
23
+ }, it = ({
24
24
  isAdvancedFilterEnabled: m,
25
25
  isModifiedMarkerEnabled: s,
26
26
  metadataTemplateOptions: l,
@@ -38,24 +38,26 @@ import '../../styles/metadata-filter.css';const z = "_container_p63iy_1", A = "_
38
38
  onAdvancedFilterOptionChange: _,
39
39
  fieldAdvancedFilterOptions: x,
40
40
  hasAccordion: n = !1,
41
- onDirtyChange: C
41
+ onDirtyChange: C,
42
+ isAdvancedTaxonomy: y = !1
42
43
  }) => {
43
44
  const {
44
45
  setFieldValue: o
45
- } = N(), y = b();
46
- V(() => {
47
- t ? o("metadata", S(t)) : o("metadata", v);
46
+ } = V(), j = k();
47
+ b(() => {
48
+ t ? o("metadata", q(t)) : o("metadata", M);
48
49
  }, [t, o]);
49
- const j = () => d ? /* @__PURE__ */ r(M, {
50
- "aria-label": y.formatMessage(q.loading),
50
+ const v = () => d ? /* @__PURE__ */ r(N, {
51
+ "aria-label": j.formatMessage(w.loading),
51
52
  className: e.loadingIndicator
52
- }) : t ? /* @__PURE__ */ r(n ? D : k, {
53
+ }) : t ? /* @__PURE__ */ r(n ? L : D, {
53
54
  canUseRelativeDates: g,
54
55
  disableForm: c,
55
56
  fieldAdvancedFilterOptions: x,
56
57
  filterOptionsMap: I,
57
58
  hasAccordion: n,
58
59
  isAdvancedFilterEnabled: m,
60
+ isAdvancedTaxonomy: y,
59
61
  isModifiedMarkerEnabled: s,
60
62
  isMultilevelTaxonomyFieldEnabled: F,
61
63
  locale: u,
@@ -64,15 +66,15 @@ import '../../styles/metadata-filter.css';const z = "_container_p63iy_1", A = "_
64
66
  portalElement: i,
65
67
  taxonomyOptionsFetcher: f
66
68
  }) : null;
67
- return /* @__PURE__ */ w("div", {
69
+ return /* @__PURE__ */ z("div", {
68
70
  className: e.container,
69
- children: [p && /* @__PURE__ */ r(L, {
71
+ children: [p && /* @__PURE__ */ r(S, {
70
72
  hasError: a,
71
73
  metadataTemplateOptions: l,
72
74
  portalElement: i
73
- }), !a && j()]
75
+ }), !a && v()]
74
76
  });
75
77
  };
76
78
  export {
77
- rt as MetadataFilter
79
+ it as MetadataFilter
78
80
  };
@@ -0,0 +1 @@
1
+ ._comboboxWrapper_1e1d8_1._disabled_1e1d8_1{pointer-events:none}._disabledTreeView_1e1d8_5{opacity:.5}
@@ -1,4 +1,4 @@
1
1
  import { FormikProps } from 'formik';
2
- import { RangeLabelType } from '../../../../types';
3
- export declare const createAdvancedFilterOptionHandler: (fieldName: string, onAdvancedFilterOptionChange?: (fieldName: string, value: string) => void, setAdvancedFilterOption?: (value: string) => void) => (value: string, currentFromValue: string, currentToValue: string, form: FormikProps<unknown>) => void;
2
+ import { FilterKey, RangeLabelType } from '../../../../types';
3
+ export declare const createAdvancedFilterOptionHandler: (fieldName: string, onAdvancedFilterOptionChange?: (fieldName: string, value: FilterKey) => void, setAdvancedFilterOption?: (value: FilterKey) => void) => (value: string, currentFromValue: string, currentToValue: string, form: FormikProps<unknown>) => void;
4
4
  export declare const createInputChangeHandler: (fieldName: string, advancedFilterOption: string, setLastChangedField: (field: RangeLabelType) => void, fieldType: RangeLabelType) => (value: string, otherValue: string, form: FormikProps<unknown>) => void;
@@ -0,0 +1,3 @@
1
+ import { MetadataFieldProps } from '../../types';
2
+ export declare const MetadataTaxonomyFieldAdvanced: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, isModified, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ export default MetadataTaxonomyFieldAdvanced;
@@ -1,6 +1,12 @@
1
1
  import { FetcherResponse, TreeOptionType, TreeQueryInput } from '@box/combobox-with-api';
2
+ import { FilterKey, FilterOption, TaxonomyMultiSelectFilterKey, TaxonomySingleSelectFilterKey } from '../../../../types';
2
3
  import { MetadataFieldProps } from '../../types';
3
4
  export type MetadataTaxonomyFieldProps = Omit<MetadataFieldProps, 'portalElement'> & {
4
5
  portalElement?: HTMLElement | (() => HTMLElement);
5
6
  };
6
7
  export type TaxonomyOptionsFetcher = (scope: string, templateKey: string, fieldKey: string, level: number, options: TreeQueryInput) => Promise<FetcherResponse<TreeOptionType>>;
8
+ export interface TaxonomyFieldValue<T> {
9
+ value: T[];
10
+ advancedFilterOption: FilterKey;
11
+ }
12
+ export type TaxonomyFilterOption = FilterOption<TaxonomyMultiSelectFilterKey | TaxonomySingleSelectFilterKey>;
@@ -0,0 +1,12 @@
1
+ import { FilterKey, FilterOption } from '../../../../types';
2
+ import { TaxonomyFieldValue } from './types';
3
+ export declare enum TaxonomyAdvancedFilterOption {
4
+ MATCH_ANY = "matchAny",
5
+ MATCH_ALL = "matchAll",
6
+ IS_BLANK = "isBlank",
7
+ IS_NOT_BLANK = "isNotBlank"
8
+ }
9
+ export declare const getInitialAdvancedFilterValue: (fieldAdvancedFilterOptions?: FilterKey, filterOptionsMap?: Array<FilterOption>) => FilterKey;
10
+ export declare const isBlankOption: (advancedFilterOption: FilterKey) => boolean;
11
+ export declare const getInputValue: <T>(fieldValue: unknown, isAdvancedFilterEnabled?: boolean) => T[];
12
+ export declare const createFieldValue: <T>(inputValue: T[], advancedFilterOption: FilterKey, isAdvancedFilterEnabled?: boolean) => T[] | TaxonomyFieldValue<T>;
@@ -1,17 +1,19 @@
1
1
  import { default as React } from 'react';
2
2
  import { IntlShape } from 'react-intl';
3
- import { FilterOption } from '../../types';
3
+ import { FilterOption, FilterOptionsMap, MetadataTemplateFieldType, TaxonomyOptionsRules } from '../../types';
4
4
  import { advancedFilterFieldTypes, filterFieldTypes } from './filter-field-types';
5
5
  import { MetadataFieldProps } from './types';
6
6
  type FieldProcessingOptions = {
7
7
  field: {
8
8
  key: string;
9
- type: string;
9
+ type: MetadataTemplateFieldType;
10
10
  hidden?: boolean;
11
+ optionsRules?: TaxonomyOptionsRules;
11
12
  };
12
13
  isAdvancedFilterEnabled?: boolean;
14
+ isAdvancedTaxonomy?: boolean;
13
15
  intl: IntlShape;
14
- filterOptionsMap?: Record<string, FilterOption[]>;
16
+ filterOptionsMap?: FilterOptionsMap;
15
17
  };
16
18
  type FieldProcessingResult = {
17
19
  fieldTypesMap: typeof filterFieldTypes | typeof advancedFilterFieldTypes;
@@ -22,5 +24,5 @@ type FieldProcessingResult = {
22
24
  /**
23
25
  * Processes field data to determine field types, visibility, and filter options
24
26
  */
25
- export declare const processMetadataField: ({ field, isAdvancedFilterEnabled, intl, filterOptionsMap, }: FieldProcessingOptions) => FieldProcessingResult;
27
+ export declare const processMetadataField: ({ field, isAdvancedFilterEnabled, isAdvancedTaxonomy, intl, filterOptionsMap, }: FieldProcessingOptions) => FieldProcessingResult;
26
28
  export {};
@@ -1,3 +1,3 @@
1
1
  import { MetadataFilterFieldsProps } from './types';
2
- export declare const MetadataFilterFieldsAccordion: ({ disableForm, locale, portalElement, taxonomyOptionsFetcher, canUseRelativeDates, isAdvancedFilterEnabled, isModifiedMarkerEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, hasAccordion, }: MetadataFilterFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataFilterFieldsAccordion: ({ disableForm, locale, portalElement, taxonomyOptionsFetcher, canUseRelativeDates, isAdvancedFilterEnabled, isModifiedMarkerEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, hasAccordion, isAdvancedTaxonomy, }: MetadataFilterFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataFilterFieldsAccordion;
@@ -1,3 +1,3 @@
1
1
  import { MetadataFilterFieldsProps } from './types';
2
- export declare const MetadataFilterFields: ({ disableForm, locale, portalElement, taxonomyOptionsFetcher, canUseRelativeDates, isAdvancedFilterEnabled, isModifiedMarkerEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, onDirtyChange, }: MetadataFilterFieldsProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataFilterFields: ({ disableForm, locale, portalElement, taxonomyOptionsFetcher, canUseRelativeDates, isAdvancedFilterEnabled, isModifiedMarkerEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, onDirtyChange, isAdvancedTaxonomy, }: MetadataFilterFieldsProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataFilterFields;
@@ -1,5 +1,5 @@
1
1
  import { Level } from '@box/combobox-with-api';
2
- import { FilterOption, MetadataTemplateFieldOption, MetadataTemplateFieldType, RangeValue } from '../../types';
2
+ import { FilterKey, FilterOption, FilterOptionsMap, MetadataTemplateFieldOption, MetadataTemplateFieldType, RangeValue } from '../../types';
3
3
  import { TaxonomyOptionsFetcher } from './components/metadata-taxonomy-field/types';
4
4
  export type CustomDateFilterOption = {
5
5
  name: string;
@@ -22,11 +22,12 @@ export type MetadataFilterFieldsProps = {
22
22
  isMultilevelTaxonomyFieldEnabled?: boolean;
23
23
  isAdvancedFilterEnabled?: boolean;
24
24
  isModifiedMarkerEnabled?: boolean;
25
- filterOptionsMap?: Record<string, FilterOption[]>;
26
- onAdvancedFilterOptionChange?: (fieldKey: string, option: string) => void;
27
- fieldAdvancedFilterOptions?: Record<string, string>;
25
+ filterOptionsMap?: FilterOptionsMap;
26
+ onAdvancedFilterOptionChange?: (fieldKey: string, option: FilterKey) => void;
27
+ fieldAdvancedFilterOptions?: Record<string, FilterKey>;
28
28
  hasAccordion?: boolean;
29
29
  onDirtyChange?: (isDirty: boolean) => void;
30
+ isAdvancedTaxonomy?: boolean;
30
31
  };
31
32
  export type MetadataFieldProps = {
32
33
  description?: string | null;
@@ -42,9 +43,9 @@ export type MetadataFieldProps = {
42
43
  isAdvancedFilterEnabled?: boolean;
43
44
  isMultilevelTaxonomyFieldEnabled?: boolean;
44
45
  levels?: Level[];
45
- filterOptionsMap?: [string, string][];
46
- onAdvancedFilterOptionChange?: (fieldKey: string, option: string) => void;
47
- fieldAdvancedFilterOptions?: string;
46
+ filterOptionsMap?: FilterOption[];
47
+ onAdvancedFilterOptionChange?: (fieldKey: string, option: FilterKey) => void;
48
+ fieldAdvancedFilterOptions?: FilterKey;
48
49
  direction?: 'horizontal' | 'vertical';
49
50
  customFieldLabels?: Array<string>;
50
51
  customDateFilterOptions?: Array<CustomDateFilterOptionsProps>;
@@ -52,7 +53,7 @@ export type MetadataFieldProps = {
52
53
  isModified?: boolean;
53
54
  placeholder?: string;
54
55
  };
55
- export type FieldType = Extract<MetadataTemplateFieldType, 'string' | 'float' | 'enum' | 'multiSelect' | 'date'>;
56
+ export type FieldType = Extract<MetadataTemplateFieldType, 'string' | 'float' | 'enum' | 'multiSelect' | 'date' | 'taxonomy'>;
56
57
  export type PartialRangeValue = Partial<RangeValue>;
57
58
  export interface StringFieldValue {
58
59
  enum?: [{
@@ -1,2 +1,2 @@
1
1
  import { MetadataFilterProps } from './types';
2
- export declare const MetadataFilter: ({ isAdvancedFilterEnabled, isModifiedMarkerEnabled, metadataTemplateOptions, portalElement, selectedMetadataTemplate, taxonomyOptionsFetcher, showMetadataSelector, disableForm, isLoading, hasError, locale, canUseRelativeDates, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, hasAccordion, onDirtyChange, }: MetadataFilterProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataFilter: ({ isAdvancedFilterEnabled, isModifiedMarkerEnabled, metadataTemplateOptions, portalElement, selectedMetadataTemplate, taxonomyOptionsFetcher, showMetadataSelector, disableForm, isLoading, hasError, locale, canUseRelativeDates, isMultilevelTaxonomyFieldEnabled, filterOptionsMap, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, hasAccordion, onDirtyChange, isAdvancedTaxonomy, }: MetadataFilterProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,15 +1,16 @@
1
- import { MetadataTemplate, MetadataTemplateField, MetadataTemplateOption } from '../types';
1
+ import { FilterKey, FilterOptionsMap, MetadataTemplate, MetadataTemplateField, MetadataTemplateOption } from '../types';
2
2
  declare const stringField: MetadataTemplateField;
3
3
  declare const dateField: MetadataTemplateField;
4
4
  declare const enumField: MetadataTemplateField;
5
5
  declare const floatField: MetadataTemplateField;
6
6
  declare const multiSelectField: MetadataTemplateField;
7
+ declare const taxonomyField: MetadataTemplateField;
7
8
  declare const allFieldsTemplate: MetadataTemplate;
8
9
  declare const nonHiddenFieldsTemplate: MetadataTemplate;
9
10
  declare const noFieldsTemplate: MetadataTemplate;
10
- declare const mockFilterOptionsMap: Record<string, [string, string][]>;
11
- declare const mockFieldAdvancedFilterOptions: Record<string, string>;
11
+ declare const mockFilterOptionsMap: FilterOptionsMap;
12
+ declare const mockFieldAdvancedFilterOptions: Record<string, FilterKey>;
12
13
  declare const templates: MetadataTemplate[];
13
14
  declare const templateOptions: MetadataTemplateOption[];
14
15
  declare const fields: MetadataTemplateField[];
15
- export { allFieldsTemplate, dateField, enumField, fields, floatField, mockFieldAdvancedFilterOptions, mockFilterOptionsMap, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, stringField, templateOptions, templates, };
16
+ export { allFieldsTemplate, dateField, enumField, fields, floatField, mockFieldAdvancedFilterOptions, mockFilterOptionsMap, multiSelectField, noFieldsTemplate, nonHiddenFieldsTemplate, stringField, taxonomyField, templateOptions, templates, };