@box/metadata-filter 1.78.10 → 1.79.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 (21) hide show
  1. package/dist/chunks/metadata-float-field-advanced.js +98 -0
  2. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.js +56 -52
  3. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field-advanced.js +15 -92
  4. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.js +64 -57
  5. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.js +72 -73
  6. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +32 -24
  7. package/dist/esm/lib/components/metadata-filter-fields/filter-field-types.js +3 -1
  8. package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-advanced.d.ts +2 -2
  9. package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-relative.d.ts +2 -2
  10. package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.d.ts +3 -3
  11. package/dist/types/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.d.ts +1 -1
  12. package/dist/types/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.d.ts +1 -1
  13. package/dist/types/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +1 -1
  14. package/dist/types/lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
  15. package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field-advanced.d.ts +2 -2
  16. package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.d.ts +2 -2
  17. package/dist/types/lib/components/metadata-filter-fields/types.d.ts +8 -2
  18. package/dist/types/lib/types.d.ts +1 -0
  19. package/package.json +7 -7
  20. package/dist/chunks/metadata-float-field.module.js +0 -9
  21. /package/dist/styles/{metadata-float-field.css → metadata-float-field-advanced.css} +0 -0
@@ -0,0 +1,98 @@
1
+ import { TextInput as L } from "@box/blueprint-web";
2
+ import { Field as B } from "formik";
3
+ import { useState as w, useCallback as C } from "react";
4
+ import { useIntl as $ } from "react-intl";
5
+ import u from "../esm/lib/messages.js";
6
+ import { R as c, F as k } from "./types.js";
7
+ import { fieldDefaultProps as N } from "../esm/lib/components/metadata-filter-fields/components/constants.js";
8
+ import { createAdvancedFilterOptionHandler as G, createInputChangeHandler as S } from "../esm/lib/components/metadata-filter-fields/components/metadata-float-field/handlers.js";
9
+ import { u as K } from "./use-float-validation.js";
10
+ import { getInputValues as b, getInputDisplayState as Q, FloatInputDisplayState as F } from "../esm/lib/components/metadata-filter-fields/components/metadata-float-field/utils.js";
11
+ import { jsx as o, jsxs as y, Fragment as U } from "react/jsx-runtime";
12
+ import { A as z } from "./index.js";
13
+ import '../styles/metadata-float-field-advanced.css';const J = "_container_uvlwq_1", W = "_rangeInputsContainer_uvlwq_6", X = "_inputContainer_uvlwq_16", Y = "_advancedFilterContainer_uvlwq_23", m = {
14
+ container: J,
15
+ rangeInputsContainer: W,
16
+ inputContainer: X,
17
+ advancedFilterContainer: Y
18
+ }, de = ({
19
+ label: d,
20
+ fieldNamePrefix: I,
21
+ disableForm: p,
22
+ onAdvancedFilterOptionChange: h,
23
+ fieldAdvancedFilterOptions: _,
24
+ filterOptionsMap: V,
25
+ hasAccordion: E,
26
+ isModified: R
27
+ }) => {
28
+ const l = $(), r = `${I}.value.enum[0]`, [q, M] = w(c.FROM), [s, O] = w(_ || k.EQUALS), {
29
+ validateFloats: f
30
+ } = K(), x = C((a, t, n, e) => G(r, h, O)(a, t, n, e), [r, h, O]), A = C((a, t, n) => S(r, s, M, c.FROM)(a, t, n), [r, s]), D = C((a, t, n) => S(r, s, M, c.TO)(a, t, n), [r, s]);
31
+ return /* @__PURE__ */ o("div", {
32
+ className: m.advancedFilterContainer,
33
+ "data-testid": `${d}-field`,
34
+ children: /* @__PURE__ */ o(B, {
35
+ name: r,
36
+ validate: (a) => {
37
+ const t = b(a, !0);
38
+ return f(t.from, t.to, q, !0);
39
+ },
40
+ children: ({
41
+ field: a,
42
+ meta: t,
43
+ form: n
44
+ }) => {
45
+ const e = b(a.value, !0), g = Q(s), H = g !== F.NONE, T = g === F.SINGLE, v = g === F.BOTH, P = f(e.from, e.to, c.FROM, !0), j = f(e.from, e.to, c.TO, !0);
46
+ return /* @__PURE__ */ y(U, {
47
+ children: [/* @__PURE__ */ o(z, {
48
+ disableForm: p,
49
+ fieldAdvancedFilterOptions: _,
50
+ fieldNamePrefix: I,
51
+ filterOptionsMap: V,
52
+ isModified: R,
53
+ label: d,
54
+ onAdvancedFilterOptionChange: h,
55
+ onValueChange: (i) => x(i, e.from, e.to, n),
56
+ showLabel: !E,
57
+ value: s
58
+ }), H && /* @__PURE__ */ y("div", {
59
+ className: m.rangeInputsContainer,
60
+ children: [(T || v) && /* @__PURE__ */ o("div", {
61
+ className: m.inputContainer,
62
+ children: /* @__PURE__ */ o(L, {
63
+ ...N,
64
+ disabled: p,
65
+ error: T ? t.error : P,
66
+ hideLabel: !0,
67
+ label: l.formatMessage(u.fieldFromLabel, {
68
+ label: d
69
+ }),
70
+ onChange: (i) => A(i.currentTarget.value, e.to, n),
71
+ placeholder: v ? l.formatMessage(u.minValuePlaceholder) : l.formatMessage(u.enterNumberPlaceholder),
72
+ value: e.from
73
+ })
74
+ }), v && /* @__PURE__ */ o("div", {
75
+ className: m.inputContainer,
76
+ children: /* @__PURE__ */ o(L, {
77
+ ...N,
78
+ disabled: p,
79
+ error: j,
80
+ hideLabel: !0,
81
+ label: l.formatMessage(u.fieldToLabel, {
82
+ label: d
83
+ }),
84
+ onChange: (i) => D(i.currentTarget.value, e.from, n),
85
+ placeholder: l.formatMessage(u.maxValuePlaceholder),
86
+ value: e.to
87
+ })
88
+ })]
89
+ })]
90
+ });
91
+ }
92
+ })
93
+ });
94
+ };
95
+ export {
96
+ de as M,
97
+ m as s
98
+ };
@@ -6,30 +6,34 @@ import n from "../../../../messages.js";
6
6
  import { R as a } from "../../../../../../chunks/types.js";
7
7
  import { DEFAULT_MAX_DATE as I } from "./constants.js";
8
8
  import { convertToFormikValueRanged as $ } from "./date-conversion-utils.js";
9
- import { MetadataDateFieldRelative as Z } from "./metadata-date-field-relative.js";
10
- import { s as i } from "../../../../../../chunks/metadata-date-field.module.js";
11
- import { E as p } from "../../../../../../chunks/types2.js";
12
- import { useDateValidation as ee } from "./use-date-validation.js";
9
+ import { MetadataDateFieldAdvanced as Z } from "./metadata-date-field-advanced.js";
10
+ import { MetadataDateFieldRelative as ee } from "./metadata-date-field-relative.js";
11
+ import { s as l } from "../../../../../../chunks/metadata-date-field.module.js";
12
+ import { E as v } from "../../../../../../chunks/types2.js";
13
+ import { useDateValidation as ae } from "./use-date-validation.js";
13
14
  import { getDynamicMaxMinValue as B } from "./utils.js";
14
- import { jsx as t, jsxs as _ } from "react/jsx-runtime";
15
- const Fe = ({
15
+ import { jsx as r, jsxs as _ } from "react/jsx-runtime";
16
+ const De = ({
16
17
  canUseRelativeDates: M,
17
- ...s
18
- }) => M ? /* @__PURE__ */ t(Z, {
19
- ...s
20
- }) : /* @__PURE__ */ t(ae, {
21
- ...s
22
- }), ae = ({
18
+ isAdvancedFilterEnabled: h,
19
+ ...i
20
+ }) => h ? /* @__PURE__ */ r(Z, {
21
+ ...i
22
+ }) : M ? /* @__PURE__ */ r(ee, {
23
+ ...i
24
+ }) : /* @__PURE__ */ r(te, {
25
+ ...i
26
+ }), te = ({
23
27
  customFieldLabels: M = [],
24
- direction: s = "horizontal",
25
- disableForm: D,
28
+ direction: h = "horizontal",
29
+ disableForm: i,
26
30
  fieldNamePrefix: d,
27
- label: v,
31
+ label: p,
28
32
  locale: T,
29
33
  portalElement: O,
30
34
  hasAccordion: w
31
35
  }) => {
32
- const [L, h] = W(a.FROM), m = `${d}.value.range.gt`, c = `${d}.value.range.lt`, {
36
+ const [L, F] = W(a.FROM), m = `${d}.value.range.gt`, c = `${d}.value.range.lt`, {
33
37
  values: S,
34
38
  setFieldTouched: j,
35
39
  setFieldValue: R
@@ -39,77 +43,77 @@ const Fe = ({
39
43
  toDatePickerValue: f,
40
44
  fromErrorType: b,
41
45
  toErrorType: A
42
- } = ee(S, m, c, T, !0), o = Y(), F = y(u), g = y(f), C = {
46
+ } = ae(S, m, c, T, !0), o = Y(), g = y(u), D = y(f), C = {
43
47
  clearDatePickerAriaLabel: o.formatMessage(n.clearSelectedDate),
44
48
  nextMonthAriaLabel: o.formatMessage(n.switchToNextMonth),
45
49
  openCalendarDropdownAriaLabel: o.formatMessage(n.openCalendar),
46
50
  previousMonthAriaLabel: o.formatMessage(n.switchToNextMonth)
47
51
  }, [G, X] = M, z = (e) => {
48
- const r = $(e, a.FROM);
49
- F.current = e, R(m, r), h(a.FROM);
52
+ const t = $(e, a.FROM);
53
+ g.current = e, R(m, t), F(a.FROM);
50
54
  }, H = (e) => {
51
- const r = $(e, a.TO);
52
- g.current = e, R(c, r), h(a.TO);
55
+ const t = $(e, a.TO);
56
+ D.current = e, R(c, t), F(a.TO);
53
57
  }, k = (e) => {
54
- const r = e === a.FROM ? m : c;
55
- j(r, !0), h(e);
56
- }, U = E(() => B(f, I), [f]), q = E(() => B(u), [u]), x = (e, r, l) => !!(r === p.MAX && e === p.OVERLAPPING || e === p.OVERLAPPING && l);
58
+ const t = e === a.FROM ? m : c;
59
+ j(t, !0), F(e);
60
+ }, U = E(() => B(f, I), [f]), q = E(() => B(u), [u]), x = (e, t, s) => !!(t === v.MAX && e === v.OVERLAPPING || e === v.OVERLAPPING && s);
57
61
  return /* @__PURE__ */ _("div", {
58
- className: i.container,
59
- "data-testid": `${v}-field`,
60
- children: [!w && /* @__PURE__ */ t(J, {
62
+ className: l.container,
63
+ "data-testid": `${p}-field`,
64
+ children: [!w && /* @__PURE__ */ r(J, {
61
65
  as: "span",
62
- className: i.rangeFieldLabel,
66
+ className: l.rangeFieldLabel,
63
67
  color: "textOnLightSecondary",
64
68
  variant: "bodyDefaultBold",
65
- children: v
66
- }), /* @__PURE__ */ t(K, {
69
+ children: p
70
+ }), /* @__PURE__ */ r(K, {
67
71
  locale: T,
68
72
  children: /* @__PURE__ */ _("div", {
69
- className: `${i.rangeInputsContainer} ${s === "vertical" ? i.verticalLayout : ""}`,
70
- children: [/* @__PURE__ */ t(P, {
73
+ className: `${l.rangeInputsContainer} ${h === "vertical" ? l.verticalLayout : ""}`,
74
+ children: [/* @__PURE__ */ r(P, {
71
75
  name: m,
72
- validate: (e) => V(F.current, g.current, a.FROM),
76
+ validate: (e) => V(g.current, D.current, a.FROM),
73
77
  children: ({
74
78
  field: e,
75
- meta: r
76
- }) => /* @__PURE__ */ t("div", {
77
- className: i.inputContainer,
78
- children: /* @__PURE__ */ t(N, {
79
+ meta: t
80
+ }) => /* @__PURE__ */ r("div", {
81
+ className: l.inputContainer,
82
+ children: /* @__PURE__ */ r(N, {
79
83
  ...e,
80
84
  ...C,
81
85
  calendarAriaLabel: o.formatMessage(n.selectFromDate),
82
86
  dataTargetId: `DatePicker-${d}_from`,
83
- error: x(b, A, L !== a.FROM) ? void 0 : r.error,
84
- isDisabled: D,
87
+ error: x(b, A, L !== a.FROM) ? void 0 : t.error,
88
+ isDisabled: i,
85
89
  label: G || o.formatMessage(n.fieldFromLabel),
86
90
  maxValue: U,
87
91
  onBlur: () => k(a.FROM),
88
- onChange: (l) => z(l),
92
+ onChange: (s) => z(s),
89
93
  portalElement: O,
90
94
  value: u
91
95
  })
92
96
  })
93
- }), /* @__PURE__ */ t(P, {
97
+ }), /* @__PURE__ */ r(P, {
94
98
  name: c,
95
- validate: (e) => V(F.current, g.current, a.TO),
99
+ validate: (e) => V(g.current, D.current, a.TO),
96
100
  children: ({
97
101
  field: e,
98
- meta: r
99
- }) => /* @__PURE__ */ t("div", {
100
- className: i.inputContainer,
101
- children: /* @__PURE__ */ t(N, {
102
+ meta: t
103
+ }) => /* @__PURE__ */ r("div", {
104
+ className: l.inputContainer,
105
+ children: /* @__PURE__ */ r(N, {
102
106
  ...e,
103
107
  ...C,
104
108
  calendarAriaLabel: o.formatMessage(n.selectToDate),
105
109
  dataTargetId: `DatePicker-${d}_to`,
106
- error: x(A, b, L !== a.TO) ? void 0 : r.error,
107
- isDisabled: D,
110
+ error: x(A, b, L !== a.TO) ? void 0 : t.error,
111
+ isDisabled: i,
108
112
  label: X || o.formatMessage(n.fieldToLabel),
109
113
  maxValue: I,
110
114
  minValue: q,
111
115
  onBlur: () => k(a.TO),
112
- onChange: (l) => H(l),
116
+ onChange: (s) => H(s),
113
117
  portalElement: O,
114
118
  value: f
115
119
  })
@@ -120,7 +124,7 @@ const Fe = ({
120
124
  });
121
125
  };
122
126
  export {
123
- Fe as MetadataDateField,
124
- ae as MetadataDateFieldNonRelative,
125
- Fe as default
127
+ De as MetadataDateField,
128
+ te as MetadataDateFieldNonRelative,
129
+ De as default
126
130
  };
@@ -1,94 +1,17 @@
1
- import { TextInput as N } from "@box/blueprint-web";
2
- import { Field as k } from "formik";
3
- import { useState as S, useCallback as F } from "react";
4
- import { useIntl as G } from "react-intl";
5
- import u from "../../../../messages.js";
6
- import { R as d, F as K } from "../../../../../../chunks/types.js";
7
- import { fieldDefaultProps as b } from "../constants.js";
8
- import { createAdvancedFilterOptionHandler as Q, createInputChangeHandler as y } from "./handlers.js";
9
- import { s as c } from "../../../../../../chunks/metadata-float-field.module.js";
10
- import { u as U } from "../../../../../../chunks/use-float-validation.js";
11
- import { getInputValues as V, getInputDisplayState as q, FloatInputDisplayState as I } from "./utils.js";
12
- import { jsx as n, jsxs as E, Fragment as z } from "react/jsx-runtime";
13
- import { A as J } from "../../../../../../chunks/index.js";
14
- const ie = ({
15
- label: m,
16
- fieldNamePrefix: C,
17
- disableForm: p,
18
- onAdvancedFilterOptionChange: h,
19
- fieldAdvancedFilterOptions: O,
20
- filterOptionsMap: R,
21
- hasAccordion: w,
22
- isModified: x
23
- }) => {
24
- const l = G(), o = `${C}.value.enum[0]`, [A, T] = S(d.FROM), [s, L] = S(O || K.EQUALS), {
25
- validateFloats: f
26
- } = U(), D = F((r, t, a, e) => Q(o, h, L)(r, t, a, e), [o, h, L]), H = F((r, t, a) => y(o, s, T, d.FROM)(r, t, a), [o, s]), P = F((r, t, a) => y(o, s, T, d.TO)(r, t, a), [o, s]);
27
- return /* @__PURE__ */ n("div", {
28
- className: c.advancedFilterContainer,
29
- "data-testid": `${m}-field`,
30
- children: /* @__PURE__ */ n(k, {
31
- name: o,
32
- validate: (r) => {
33
- const t = V(r, !0);
34
- return f(t.from, t.to, A, !0);
35
- },
36
- children: ({
37
- field: r,
38
- meta: t,
39
- form: a
40
- }) => {
41
- const e = V(r.value, !0), g = q(s), j = g !== I.NONE, M = g === I.SINGLE, v = g === I.BOTH, B = f(e.from, e.to, d.FROM, !0), $ = f(e.from, e.to, d.TO, !0);
42
- return /* @__PURE__ */ E(z, {
43
- children: [/* @__PURE__ */ n(J, {
44
- disableForm: p,
45
- fieldAdvancedFilterOptions: O,
46
- fieldNamePrefix: C,
47
- filterOptionsMap: R,
48
- isModified: x,
49
- label: m,
50
- onAdvancedFilterOptionChange: h,
51
- onValueChange: (i) => D(i, e.from, e.to, a),
52
- showLabel: !w,
53
- value: s
54
- }), j && /* @__PURE__ */ E("div", {
55
- className: c.rangeInputsContainer,
56
- children: [(M || v) && /* @__PURE__ */ n("div", {
57
- className: c.inputContainer,
58
- children: /* @__PURE__ */ n(N, {
59
- ...b,
60
- disabled: p,
61
- error: M ? t.error : B,
62
- hideLabel: !0,
63
- label: l.formatMessage(u.fieldFromLabel, {
64
- label: m
65
- }),
66
- onChange: (i) => H(i.currentTarget.value, e.to, a),
67
- placeholder: v ? l.formatMessage(u.minValuePlaceholder) : l.formatMessage(u.enterNumberPlaceholder),
68
- value: e.from
69
- })
70
- }), v && /* @__PURE__ */ n("div", {
71
- className: c.inputContainer,
72
- children: /* @__PURE__ */ n(N, {
73
- ...b,
74
- disabled: p,
75
- error: $,
76
- hideLabel: !0,
77
- label: l.formatMessage(u.fieldToLabel, {
78
- label: m
79
- }),
80
- onChange: (i) => P(i.currentTarget.value, e.from, a),
81
- placeholder: l.formatMessage(u.maxValuePlaceholder),
82
- value: e.to
83
- })
84
- })]
85
- })]
86
- });
87
- }
88
- })
89
- });
90
- };
1
+ import "@box/blueprint-web";
2
+ import "formik";
3
+ import "react";
4
+ import "react-intl";
5
+ import "../../../../messages.js";
6
+ import "../../../../../../chunks/types.js";
7
+ import "../constants.js";
8
+ import "./handlers.js";
9
+ import { M as c, M as n } from "../../../../../../chunks/metadata-float-field-advanced.js";
10
+ import "../../../../../../chunks/use-float-validation.js";
11
+ import "./utils.js";
12
+ import "react/jsx-runtime";
13
+ import "../../../../../../chunks/index.js";
91
14
  export {
92
- ie as MetadataFloatFieldAdvanced,
93
- ie as default
15
+ c as MetadataFloatFieldAdvanced,
16
+ n as default
94
17
  };
@@ -1,93 +1,100 @@
1
- import { Text as S, TextInput as y } from "@box/blueprint-web";
2
- import { useFormikContext as _, getIn as M, Field as E } from "formik";
3
- import { useState as k, useRef as I } from "react";
4
- import { useIntl as A } from "react-intl";
1
+ import { Text as D, TextInput as C } from "@box/blueprint-web";
2
+ import { useFormikContext as S, getIn as y, Field as E } from "formik";
3
+ import { useState as _, useRef as I } from "react";
4
+ import { useIntl as k } from "react-intl";
5
5
  import V from "../../../../messages.js";
6
- import { R as r } from "../../../../../../chunks/types.js";
6
+ import { R as t } from "../../../../../../chunks/types.js";
7
7
  import { fieldDefaultProps as $ } from "../constants.js";
8
- import { s as d } from "../../../../../../chunks/metadata-float-field.module.js";
9
- import { u as G, E as H } from "../../../../../../chunks/use-float-validation.js";
10
- import { jsxs as x, jsx as t } from "react/jsx-runtime";
11
- const Y = ({
12
- label: n,
13
- fieldNamePrefix: s,
8
+ import { M as G, s as i } from "../../../../../../chunks/metadata-float-field-advanced.js";
9
+ import { u as H, E as q } from "../../../../../../chunks/use-float-validation.js";
10
+ import { jsx as r, jsxs as x } from "react/jsx-runtime";
11
+ const w = ({
12
+ label: o,
13
+ fieldNamePrefix: a,
14
14
  disableForm: p,
15
15
  hasAccordion: L
16
16
  }) => {
17
- const f = A(), [h, c] = k(r.FROM), {
18
- values: g,
19
- setFieldValue: F,
20
- setFieldTouched: b
21
- } = _(), l = `${s}.value.range.gt`, i = `${s}.value.range.lt`, B = M(g, l), N = M(g, i), u = I(B), m = I(N), {
17
+ const f = k(), [h, c] = _(t.FROM), {
18
+ values: F,
19
+ setFieldValue: g,
20
+ setFieldTouched: B
21
+ } = S(), s = `${a}.value.range.gt`, d = `${a}.value.range.lt`, b = y(F, s), N = y(F, d), u = I(b), m = I(N), {
22
22
  validateFloats: T,
23
- fromErrorType: O,
24
- toErrorType: v
25
- } = G(), j = (e) => {
26
- u.current = e, F(l, e), c(r.FROM);
27
- }, D = (e) => {
28
- m.current = e, F(i, e), c(r.TO);
29
- }, R = (e, o) => {
30
- b(e, !0), c(o);
31
- }, C = (e, o, a) => !!(e === H.OVERLAPPING && a);
23
+ fromErrorType: v,
24
+ toErrorType: O
25
+ } = H(), j = (e) => {
26
+ u.current = e, g(s, e), c(t.FROM);
27
+ }, A = (e) => {
28
+ m.current = e, g(d, e), c(t.TO);
29
+ }, M = (e, n) => {
30
+ B(e, !0), c(n);
31
+ }, R = (e, n, l) => !!(e === q.OVERLAPPING && l);
32
32
  return /* @__PURE__ */ x("div", {
33
- className: d.container,
34
- "data-testid": `${n}-field`,
35
- children: [!L && /* @__PURE__ */ t(S, {
33
+ className: i.container,
34
+ "data-testid": `${o}-field`,
35
+ children: [!L && /* @__PURE__ */ r(D, {
36
36
  as: "span",
37
37
  color: "textOnLightSecondary",
38
38
  variant: "bodyDefaultBold",
39
- children: n
39
+ children: o
40
40
  }), /* @__PURE__ */ x("div", {
41
- className: d.rangeInputsContainer,
42
- children: [/* @__PURE__ */ t(E, {
43
- name: `${l}`,
44
- validate: () => T(u.current, m.current, r.FROM),
41
+ className: i.rangeInputsContainer,
42
+ children: [/* @__PURE__ */ r(E, {
43
+ name: `${s}`,
44
+ validate: () => T(u.current, m.current, t.FROM),
45
45
  children: ({
46
46
  field: e,
47
- meta: o
48
- }) => /* @__PURE__ */ t("div", {
49
- className: d.inputContainer,
50
- children: /* @__PURE__ */ t(y, {
47
+ meta: n
48
+ }) => /* @__PURE__ */ r("div", {
49
+ className: i.inputContainer,
50
+ children: /* @__PURE__ */ r(C, {
51
51
  ...$,
52
52
  ...e,
53
- "data-target-id": `TextInput-${s}_from`,
53
+ "data-target-id": `TextInput-${a}_from`,
54
54
  disabled: p,
55
- error: C(O, v, h !== r.FROM) ? void 0 : o.error,
55
+ error: R(v, O, h !== t.FROM) ? void 0 : n.error,
56
56
  label: f.formatMessage(V.fieldFromLabel, {
57
- label: n
57
+ label: o
58
58
  }),
59
- onBlur: () => R(l, r.FROM),
60
- onChange: (a) => j(a.currentTarget.value),
59
+ onBlur: () => M(s, t.FROM),
60
+ onChange: (l) => j(l.currentTarget.value),
61
61
  placeholder: "0"
62
62
  })
63
63
  })
64
- }), /* @__PURE__ */ t(E, {
65
- name: `${i}`,
66
- validate: () => T(u.current, m.current, r.TO),
64
+ }), /* @__PURE__ */ r(E, {
65
+ name: `${d}`,
66
+ validate: () => T(u.current, m.current, t.TO),
67
67
  children: ({
68
68
  field: e,
69
- meta: o
70
- }) => /* @__PURE__ */ t("div", {
71
- className: d.inputContainer,
72
- children: /* @__PURE__ */ t(y, {
69
+ meta: n
70
+ }) => /* @__PURE__ */ r("div", {
71
+ className: i.inputContainer,
72
+ children: /* @__PURE__ */ r(C, {
73
73
  ...$,
74
74
  ...e,
75
- "data-target-id": `TextInput-${s}_to`,
75
+ "data-target-id": `TextInput-${a}_to`,
76
76
  disabled: p,
77
- error: C(v, O, h !== r.TO) ? void 0 : o.error,
77
+ error: R(O, v, h !== t.TO) ? void 0 : n.error,
78
78
  label: f.formatMessage(V.fieldToLabel, {
79
- label: n
79
+ label: o
80
80
  }),
81
- onBlur: () => R(i, r.TO),
82
- onChange: (a) => D(a.currentTarget.value),
81
+ onBlur: () => M(d, t.TO),
82
+ onChange: (l) => A(l.currentTarget.value),
83
83
  placeholder: "0"
84
84
  })
85
85
  })
86
86
  })]
87
87
  })]
88
88
  });
89
- };
89
+ }, ee = ({
90
+ isAdvancedFilterEnabled: o,
91
+ ...a
92
+ }) => o ? /* @__PURE__ */ r(G, {
93
+ ...a
94
+ }) : /* @__PURE__ */ r(w, {
95
+ ...a
96
+ });
90
97
  export {
91
- Y as MetadataFloatField,
92
- Y as default
98
+ ee as MetadataFloatField,
99
+ ee as default
93
100
  };
@@ -1,86 +1,85 @@
1
- import { TooltipProvider as U, Combobox as Y } from "@box/blueprint-web";
2
- import { useFormikContext as q, getIn as G, Field as J } from "formik";
3
- import { useMemo as Q, useState as p, useRef as w, useCallback as s } from "react";
4
- import { useIntl as W } from "react-intl";
5
- import X from "../../../../messages.js";
6
- import { F as f } from "../../../../../../chunks/types.js";
7
- import { fieldDefaultProps as Z } from "../constants.js";
8
- import { getInitialAdvancedFilterValue as E, createFieldValue as y, getInputValue as ee } from "./utils.js";
9
- import { jsx as a, jsxs as te, Fragment as oe } from "react/jsx-runtime";
1
+ import { TooltipProvider as P, Combobox as U } from "@box/blueprint-web";
2
+ import { useFormikContext as Y, getIn as q, Field as G } from "formik";
3
+ import { useMemo as J, useState as m, useRef as A, useCallback as s } from "react";
4
+ import { useIntl as Q } from "react-intl";
5
+ import W from "../../../../messages.js";
6
+ import { F as p } from "../../../../../../chunks/types.js";
7
+ import { fieldDefaultProps as X } from "../constants.js";
8
+ import { getInitialAdvancedFilterValue as Z, createFieldValue as x, getInputValue as E } from "./utils.js";
9
+ import { jsx as l, jsxs as ee, Fragment as te } from "react/jsx-runtime";
10
10
  import { A as ne } from "../../../../../../chunks/index.js";
11
- const T = (o) => o === f.IS_BLANK || o === f.IS_NOT_BLANK, he = ({
12
- label: o,
13
- fieldNamePrefix: c,
14
- disableForm: h,
15
- isAdvancedFilterEnabled: r,
16
- onAdvancedFilterOptionChange: i,
17
- fieldAdvancedFilterOptions: g,
18
- filterOptionsMap: d,
19
- portalElement: C,
20
- hasAccordion: k,
21
- isModified: v,
22
- hasExperimentalVirtualization: M
11
+ const L = (n) => n === p.IS_BLANK || n === p.IS_NOT_BLANK, de = ({
12
+ label: n,
13
+ fieldNamePrefix: a,
14
+ disableForm: d,
15
+ onAdvancedFilterOptionChange: u,
16
+ fieldAdvancedFilterOptions: f,
17
+ filterOptionsMap: h,
18
+ portalElement: g,
19
+ hasAccordion: w,
20
+ isModified: y,
21
+ hasExperimentalVirtualization: T
23
22
  }) => {
24
23
  const {
25
- setFieldValue: V,
26
- values: O
27
- } = q(), S = W(), n = `${c}.value.enum`, _ = Q(() => G(O, `${c}.options`, []).map((e) => e?.key).filter((e) => typeof e == "string"), [O, c]), [u, A] = p(E(g, d) || f.MATCH_ANY), [B, I] = p(!1), [K, F] = p(!1), R = (e, t) => typeof t != "string" ? !1 : t.toLowerCase().includes(e.toLowerCase()), x = w([]), m = w(null), L = s((e, t, l) => {
28
- const b = e;
29
- A(b), i?.(n, b);
30
- const H = T(e) ? [] : t, P = y(H, e, r);
31
- l.setFieldValue(n, P);
32
- }, [n, r, i]), $ = s((e) => {
33
- m.current && L(e, x.current, m.current);
34
- }, [L]), j = s((e) => {
35
- const t = y(e, u, r);
36
- V(n, t);
37
- }, [u, n, r, V]), N = s((e) => {
38
- I(e), e && F(!1);
39
- }, []), z = s((e) => {
40
- F(e), e && I(!1);
41
- }, []), D = s((e) => !e || e.length === 0 ? S.formatMessage(X.multiselectPlaceholder) : "", [S]);
42
- return /* @__PURE__ */ a("div", {
43
- "data-testid": `${o}-field`,
44
- children: /* @__PURE__ */ a(J, {
45
- name: n,
24
+ setFieldValue: C,
25
+ values: V
26
+ } = Y(), F = Q(), o = `${a}.value.enum`, k = J(() => q(V, `${a}.options`, []).map((e) => e?.key).filter((e) => typeof e == "string"), [V, a]), [c, M] = m(Z(f, h) || p.MATCH_ANY), [_, b] = m(!1), [B, O] = m(!1), K = (e, t) => typeof t != "string" ? !1 : t.toLowerCase().includes(e.toLowerCase()), S = A([]), i = A(null), v = s((e, t, r) => {
27
+ const I = e;
28
+ M(I), u?.(o, I);
29
+ const D = L(e) ? [] : t, H = x(D, e, !0);
30
+ r.setFieldValue(o, H);
31
+ }, [o, u]), R = s((e) => {
32
+ i.current && v(e, S.current, i.current);
33
+ }, [v]), $ = s((e) => {
34
+ const t = x(e, c, !0);
35
+ C(o, t);
36
+ }, [c, o, C]), j = s((e) => {
37
+ b(e), e && O(!1);
38
+ }, []), N = s((e) => {
39
+ O(e), e && b(!1);
40
+ }, []), z = s((e) => !e || e.length === 0 ? F.formatMessage(W.multiselectPlaceholder) : "", [F]);
41
+ return /* @__PURE__ */ l("div", {
42
+ "data-testid": `${n}-field`,
43
+ children: /* @__PURE__ */ l(G, {
44
+ name: o,
46
45
  children: ({
47
46
  field: e,
48
47
  form: t
49
48
  }) => {
50
- const l = ee(e.value, r);
51
- return x.current = l, m.current = t, /* @__PURE__ */ te(oe, {
52
- children: [/* @__PURE__ */ a(ne, {
53
- disableForm: h,
54
- fieldAdvancedFilterOptions: g,
55
- fieldNamePrefix: c,
56
- filterOptionsMap: d,
57
- isModified: v,
58
- label: o,
59
- onAdvancedFilterOptionChange: i,
60
- onOpenChange: z,
61
- onValueChange: $,
62
- open: K,
63
- portalElement: C,
64
- showLabel: !k,
65
- value: u
66
- }), !T(u) && /* @__PURE__ */ a(U, {
67
- children: /* @__PURE__ */ a(Y, {
68
- ...Z,
49
+ const r = E(e.value, !0);
50
+ return S.current = r, i.current = t, /* @__PURE__ */ ee(te, {
51
+ children: [/* @__PURE__ */ l(ne, {
52
+ disableForm: d,
53
+ fieldAdvancedFilterOptions: f,
54
+ fieldNamePrefix: a,
55
+ filterOptionsMap: h,
56
+ isModified: y,
57
+ label: n,
58
+ onAdvancedFilterOptionChange: u,
59
+ onOpenChange: N,
60
+ onValueChange: R,
61
+ open: B,
62
+ portalElement: g,
63
+ showLabel: !w,
64
+ value: c
65
+ }), !L(c) && /* @__PURE__ */ l(P, {
66
+ children: /* @__PURE__ */ l(U, {
67
+ ...X,
69
68
  as: "input",
70
- disabled: h,
71
- experimentalVirtualization: M,
72
- filterFn: R,
69
+ disabled: d,
70
+ experimentalVirtualization: T,
71
+ filterFn: K,
73
72
  hideLabel: !0,
74
- label: o,
73
+ label: n,
75
74
  multiselect: !0,
76
75
  name: e.name,
77
- onOpenChange: N,
78
- onValueChange: j,
79
- open: B,
80
- options: _,
81
- placeholder: D(l),
82
- portalElement: C,
83
- value: l
76
+ onOpenChange: j,
77
+ onValueChange: $,
78
+ open: _,
79
+ options: k,
80
+ placeholder: z(r),
81
+ portalElement: g,
82
+ value: r
84
83
  })
85
84
  })]
86
85
  });
@@ -89,5 +88,5 @@ const T = (o) => o === f.IS_BLANK || o === f.IS_NOT_BLANK, he = ({
89
88
  });
90
89
  };
91
90
  export {
92
- he as MetadataMultiSelectFieldAdvanced
91
+ de as MetadataMultiSelectFieldAdvanced
93
92
  };
@@ -1,57 +1,65 @@
1
- import { TooltipProvider as b, Combobox as f } from "@box/blueprint-web";
2
- import { useFormikContext as F, getIn as M, Field as V } from "formik";
3
- import { useMemo as $, useCallback as l } from "react";
1
+ import { TooltipProvider as F, Combobox as M } from "@box/blueprint-web";
2
+ import { useFormikContext as f, getIn as b, Field as V } from "formik";
3
+ import { useMemo as $, useCallback as n } from "react";
4
4
  import { useIntl as x } from "react-intl";
5
5
  import L from "../../../../messages.js";
6
- import { fieldDefaultProps as k } from "../constants.js";
6
+ import { fieldDefaultProps as S } from "../constants.js";
7
+ import { MetadataMultiSelectFieldAdvanced as k } from "./metadata-multi-select-field-advanced.js";
7
8
  import { jsx as o } from "react/jsx-runtime";
8
- const T = ({
9
- disableForm: m,
9
+ const w = ({
10
+ disableForm: a,
10
11
  fieldNamePrefix: t,
11
12
  label: r,
12
- portalElement: u,
13
- hasAccordion: d,
13
+ portalElement: d,
14
+ hasAccordion: u,
14
15
  hasExperimentalVirtualization: c
15
16
  }) => {
16
17
  const {
17
- setFieldValue: n,
18
+ setFieldValue: i,
18
19
  values: s
19
- } = F(), i = x(), a = `${t}.value.enum`, p = $(() => M(s, `${t}.options`, []).map(({
20
+ } = f(), m = x(), l = `${t}.value.enum`, p = $(() => b(s, `${t}.options`, []).map(({
20
21
  key: e
21
- }) => e), [s, t]), h = l((e, v) => v.toLowerCase().includes(e.toLowerCase()), []), g = l((e) => n(a, e), [n, a]), C = l((e) => (
22
+ }) => e), [s, t]), h = n((e, C) => C.toLowerCase().includes(e.toLowerCase()), []), g = n((e) => i(l, e), [i, l]), v = n((e) => (
22
23
  // Empty array must be substituted if there is no value found
23
24
  // Otherwise no placeholder appears despite no selection
24
- (e || [])?.length === 0 ? i.formatMessage(L.multiselectPlaceholder) : ""
25
- ), [i]);
25
+ (e || [])?.length === 0 ? m.formatMessage(L.multiselectPlaceholder) : ""
26
+ ), [m]);
26
27
  return /* @__PURE__ */ o("div", {
27
28
  "data-testid": `${r}-field`,
28
29
  children: /* @__PURE__ */ o(V, {
29
- name: a,
30
+ name: l,
30
31
  children: ({
31
32
  field: e
32
- }) => /* @__PURE__ */ o(b, {
33
- children: /* @__PURE__ */ o(f, {
34
- ...k,
33
+ }) => /* @__PURE__ */ o(F, {
34
+ children: /* @__PURE__ */ o(M, {
35
+ ...S,
35
36
  as: "input",
36
37
  "data-target-id": `Combobox-${t}`,
37
- disabled: m,
38
+ disabled: a,
38
39
  filterFn: h,
39
- hideLabel: d,
40
+ hideLabel: u,
40
41
  label: r,
41
42
  multiselect: !0,
42
43
  experimentalVirtualization: c,
43
44
  name: e.name,
44
45
  onValueChange: g,
45
46
  options: p,
46
- placeholder: C(e.value),
47
- portalElement: u,
47
+ placeholder: v(e.value),
48
+ portalElement: d,
48
49
  value: e.value
49
50
  })
50
51
  })
51
52
  })
52
53
  });
53
- };
54
+ }, q = ({
55
+ isAdvancedFilterEnabled: a,
56
+ ...t
57
+ }) => a ? /* @__PURE__ */ o(k, {
58
+ ...t
59
+ }) : /* @__PURE__ */ o(w, {
60
+ ...t
61
+ });
54
62
  export {
55
- T as MetadataMultiSelectField,
56
- T as default
63
+ q as MetadataMultiSelectField,
64
+ q as default
57
65
  };
@@ -2,7 +2,7 @@ import { MetadataDateField as d } from "./components/metadata-date-field/metadat
2
2
  import { MetadataDateFieldAdvanced as i } from "./components/metadata-date-field/metadata-date-field-advanced.js";
3
3
  import { MetadataEnumField as m } from "./components/metadata-enum-field/metadata-enum-field.js";
4
4
  import { MetadataFloatField as r } from "./components/metadata-float-field/metadata-float-field.js";
5
- import { MetadataFloatFieldAdvanced as l } from "./components/metadata-float-field/metadata-float-field-advanced.js";
5
+ import { M as l } from "../../../../chunks/metadata-float-field-advanced.js";
6
6
  import { MetadataMultiSelectField as n } from "./components/metadata-multi-select-field/metadata-multi-select-field.js";
7
7
  import { MetadataMultiSelectFieldAdvanced as e } from "./components/metadata-multi-select-field/metadata-multi-select-field-advanced.js";
8
8
  import { MetadataStringField as o } from "./components/metadata-string-field/metadata-string-field.js";
@@ -10,6 +10,7 @@ import { MetadataTaxonomyField as F } from "./components/metadata-taxonomy-field
10
10
  import { MetadataTaxonomyFieldAdvanced as f } from "./components/metadata-taxonomy-field/metadata-taxonomy-field-advanced.js";
11
11
  import { jsx as a } from "react/jsx-runtime";
12
12
  const g = {
13
+ // locale is always provided by the parent for all field types, so the cast is safe even though MetadataFieldProps types it as optional
13
14
  date: (t) => /* @__PURE__ */ a(d, {
14
15
  ...t
15
16
  }),
@@ -29,6 +30,7 @@ const g = {
29
30
  ...t
30
31
  })
31
32
  }, D = {
33
+ // locale is always provided by the parent for all field types, so the cast is safe even though MetadataFieldProps types it as optional
32
34
  date: (t) => /* @__PURE__ */ a(i, {
33
35
  ...t
34
36
  }),
@@ -1,3 +1,3 @@
1
- import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataDateFieldAdvanced: ({ disableForm, fieldNamePrefix, label, locale, portalElement, filterOptionsMap, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, hasAccordion, isModified, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { MetadataDateFieldProps } from '../../types';
2
+ export declare const MetadataDateFieldAdvanced: ({ disableForm, fieldNamePrefix, label, locale, portalElement, filterOptionsMap, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, hasAccordion, isModified, }: MetadataDateFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataDateFieldAdvanced;
@@ -1,3 +1,3 @@
1
- import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataDateFieldRelative: ({ customDateFilterOptions, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }: Omit<MetadataFieldProps, "taxonomyOptionsFetcher">) => import("react/jsx-runtime").JSX.Element;
1
+ import { MetadataDateFieldProps } from '../../types';
2
+ export declare const MetadataDateFieldRelative: ({ customDateFilterOptions, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }: MetadataDateFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataDateFieldRelative;
@@ -1,4 +1,4 @@
1
- import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataDateField: ({ canUseRelativeDates, ...props }: Omit<MetadataFieldProps, "taxonomyOptionsFetcher">) => import("react/jsx-runtime").JSX.Element;
3
- export declare const MetadataDateFieldNonRelative: ({ customFieldLabels, direction, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }: Omit<MetadataFieldProps, "taxonomyOptionsFetcher">) => import("react/jsx-runtime").JSX.Element;
1
+ import { MetadataDateFieldProps } from '../../types';
2
+ export declare const MetadataDateField: ({ canUseRelativeDates, isAdvancedFilterEnabled, ...props }: MetadataDateFieldProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const MetadataDateFieldNonRelative: ({ customFieldLabels, direction, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }: MetadataDateFieldProps) => import("react/jsx-runtime").JSX.Element;
4
4
  export default MetadataDateField;
@@ -1,3 +1,3 @@
1
1
  import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataFloatField: ({ label, fieldNamePrefix, disableForm, hasAccordion, }: Omit<MetadataFieldProps, "locale">) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataFloatField: ({ isAdvancedFilterEnabled, ...props }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataFloatField;
@@ -1,2 +1,2 @@
1
1
  import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataMultiSelectFieldAdvanced: ({ label, fieldNamePrefix, disableForm, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, portalElement, hasAccordion, isModified, hasExperimentalVirtualization, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataMultiSelectFieldAdvanced: ({ label, fieldNamePrefix, disableForm, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, portalElement, hasAccordion, isModified, hasExperimentalVirtualization, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataMultiSelectField: ({ disableForm, fieldNamePrefix, label, portalElement, hasAccordion, hasExperimentalVirtualization, }: Omit<MetadataFieldProps, "locale" | "taxonomyOptionsFetcher">) => import("react/jsx-runtime").JSX.Element;
2
+ export declare const MetadataMultiSelectField: ({ isAdvancedFilterEnabled, ...props }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataMultiSelectField;
@@ -1,6 +1,6 @@
1
1
  import { MetadataFieldProps } from '../../types';
2
2
  export declare const MetadataStringField: {
3
- ({ label, fieldNamePrefix, disableForm, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, hasAccordion, isModified, placeholder, }: Omit<MetadataFieldProps, "locale" | "taxonomyOptionsFetcher">): import("react/jsx-runtime").JSX.Element;
3
+ ({ label, fieldNamePrefix, disableForm, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, hasAccordion, isModified, placeholder, }: MetadataFieldProps): import("react/jsx-runtime").JSX.Element;
4
4
  displayName: string;
5
5
  };
6
6
  export default MetadataStringField;
@@ -1,3 +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;
1
+ import { MetadataTaxonomyFieldProps } from '../../types';
2
+ export declare const MetadataTaxonomyFieldAdvanced: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, isModified, }: MetadataTaxonomyFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataTaxonomyFieldAdvanced;
@@ -1,3 +1,3 @@
1
- import { MetadataFieldProps } from '../../types';
2
- export declare const MetadataTaxonomyField: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, }: MetadataFieldProps) => import("react/jsx-runtime").JSX.Element;
1
+ import { MetadataTaxonomyFieldProps } from '../../types';
2
+ export declare const MetadataTaxonomyField: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, }: MetadataTaxonomyFieldProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default MetadataTaxonomyField;
@@ -37,8 +37,6 @@ export type MetadataFieldProps = {
37
37
  disableForm?: boolean;
38
38
  portalElement?: HTMLElement;
39
39
  options?: Array<MetadataTemplateFieldOption>;
40
- locale: string;
41
- taxonomyOptionsFetcher?: TaxonomyOptionsFetcher;
42
40
  className?: string;
43
41
  canUseRelativeDates?: boolean;
44
42
  isAdvancedFilterEnabled?: boolean;
@@ -54,6 +52,14 @@ export type MetadataFieldProps = {
54
52
  isModified?: boolean;
55
53
  placeholder?: string;
56
54
  hasExperimentalVirtualization?: boolean;
55
+ locale?: string;
56
+ taxonomyOptionsFetcher?: TaxonomyOptionsFetcher;
57
+ };
58
+ export type MetadataDateFieldProps = MetadataFieldProps & {
59
+ locale: string;
60
+ };
61
+ export type MetadataTaxonomyFieldProps = MetadataFieldProps & {
62
+ taxonomyOptionsFetcher?: TaxonomyOptionsFetcher;
57
63
  };
58
64
  export type FieldType = Extract<MetadataTemplateFieldType, 'string' | 'float' | 'enum' | 'multiSelect' | 'date' | 'taxonomy'>;
59
65
  export type PartialRangeValue = Partial<RangeValue>;
@@ -3,6 +3,7 @@ import { TaxonomyOptionsFetcher } from './components/metadata-filter-fields/comp
3
3
  export type MetadataFormFieldValue = EnumType | RangeType | FloatType;
4
4
  export type EnumType = {
5
5
  enum: Array<string>;
6
+ advancedFilterOption?: FilterKey;
6
7
  } | BaseOptionType[];
7
8
  export type RelativeRangeType = 'today' | 'next' | 'past' | 'olderThan';
8
9
  export type RelDateTypeUi = RelativeRangeType | 'customRange' | 'anyTime';
package/package.json CHANGED
@@ -1,19 +1,19 @@
1
1
  {
2
2
  "name": "@box/metadata-filter",
3
- "version": "1.78.10",
3
+ "version": "1.79.1",
4
4
  "peerDependencies": {
5
- "@box/blueprint-web": "^13.5.13",
6
- "@box/blueprint-web-assets": "^4.104.8",
7
- "@box/combobox-with-api": "^1.41.19",
5
+ "@box/blueprint-web": "^13.6.0",
6
+ "@box/blueprint-web-assets": "^4.104.9",
7
+ "@box/combobox-with-api": "^1.41.20",
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.5.13",
15
- "@box/blueprint-web-assets": "^4.104.8",
16
- "@box/storybook-utils": "^0.16.69",
14
+ "@box/blueprint-web": "^13.6.0",
15
+ "@box/blueprint-web-assets": "^4.104.9",
16
+ "@box/storybook-utils": "^0.16.70",
17
17
  "react": "^18.3.0",
18
18
  "react-dom": "^18.3.0",
19
19
  "react-intl": "6.4.2"
@@ -1,9 +0,0 @@
1
- import '../styles/metadata-float-field.css';const n = "_container_uvlwq_1", t = "_rangeInputsContainer_uvlwq_6", e = "_inputContainer_uvlwq_16", a = "_advancedFilterContainer_uvlwq_23", r = {
2
- container: n,
3
- rangeInputsContainer: t,
4
- inputContainer: e,
5
- advancedFilterContainer: a
6
- };
7
- export {
8
- r as s
9
- };