@box/metadata-filter 1.31.0 → 1.31.2

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 (52) hide show
  1. package/dist/chunks/index.js +54 -48
  2. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-advanced.js +39 -37
  3. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field-advanced.js +26 -24
  4. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.js +35 -33
  5. package/dist/esm/lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.js +26 -24
  6. package/dist/esm/lib/components/metadata-filter-fields/is-modified-utils.js +84 -0
  7. package/dist/esm/lib/components/metadata-filter-fields/metadata-filter-fields-accordion.js +64 -60
  8. package/dist/esm/lib/components/metadata-filter-fields/metadata-filter-fields.js +58 -48
  9. package/dist/esm/lib/messages.js +4 -0
  10. package/dist/esm/lib/metadata-filter.js +50 -46
  11. package/dist/i18n/bn-IN.js +1 -0
  12. package/dist/i18n/da-DK.js +1 -0
  13. package/dist/i18n/de-DE.js +1 -0
  14. package/dist/i18n/en-AU.js +1 -0
  15. package/dist/i18n/en-CA.js +1 -0
  16. package/dist/i18n/en-GB.js +1 -0
  17. package/dist/i18n/en-US.js +1 -0
  18. package/dist/i18n/en-US.properties +2 -0
  19. package/dist/i18n/en-x-pseudo.js +1 -0
  20. package/dist/i18n/es-419.js +1 -0
  21. package/dist/i18n/es-ES.js +1 -0
  22. package/dist/i18n/fi-FI.js +1 -0
  23. package/dist/i18n/fr-CA.js +1 -0
  24. package/dist/i18n/fr-FR.js +1 -0
  25. package/dist/i18n/hi-IN.js +1 -0
  26. package/dist/i18n/it-IT.js +1 -0
  27. package/dist/i18n/ja-JP.js +1 -0
  28. package/dist/i18n/json/src/lib/messages.json +1 -1
  29. package/dist/i18n/ko-KR.js +1 -0
  30. package/dist/i18n/nb-NO.js +1 -0
  31. package/dist/i18n/nl-NL.js +1 -0
  32. package/dist/i18n/pl-PL.js +1 -0
  33. package/dist/i18n/pt-BR.js +1 -0
  34. package/dist/i18n/ru-RU.js +1 -0
  35. package/dist/i18n/sv-SE.js +1 -0
  36. package/dist/i18n/tr-TR.js +1 -0
  37. package/dist/i18n/zh-CN.js +1 -0
  38. package/dist/i18n/zh-TW.js +1 -0
  39. package/dist/styles/index.css +1 -1
  40. package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-advanced.d.ts +1 -1
  41. package/dist/types/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field-advanced.d.ts +1 -1
  42. package/dist/types/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.d.ts +1 -1
  43. package/dist/types/lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
  44. package/dist/types/lib/components/metadata-filter-fields/components/shared/advanced-filter-select.d.ts +2 -1
  45. package/dist/types/lib/components/metadata-filter-fields/is-modified-utils.d.ts +3 -0
  46. package/dist/types/lib/components/metadata-filter-fields/metadata-filter-fields-accordion.d.ts +1 -1
  47. package/dist/types/lib/components/metadata-filter-fields/metadata-filter-fields.d.ts +1 -1
  48. package/dist/types/lib/components/metadata-filter-fields/types.d.ts +30 -1
  49. package/dist/types/lib/messages.d.ts +5 -0
  50. package/dist/types/lib/metadata-filter.d.ts +1 -1
  51. package/dist/types/lib/types.d.ts +2 -0
  52. package/package.json +2 -2
@@ -1,70 +1,76 @@
1
1
  import { Text as D, Select as c } from "@box/blueprint-web";
2
- import { Field as I } from "formik";
3
- import { useState as k, useCallback as B } from "react";
4
- import { useIntl as $ } from "react-intl";
5
- import i from "../esm/lib/messages.js";
6
- import { jsxs as q, Fragment as w, jsx as e } from "react/jsx-runtime";
7
- import '../styles/index.css';const z = "_noAttributesText_12d80_1", E = "_fieldLabel_12d80_5", G = "_selectContainer_12d80_10", H = "_comboboxContainer_12d80_15", _ = {
8
- noAttributesText: z,
9
- fieldLabel: E,
10
- selectContainer: G,
11
- comboboxContainer: H
12
- }, V = ({
13
- label: d,
14
- fieldNamePrefix: n,
2
+ import { Field as k } from "formik";
3
+ import { useState as B, useCallback as M } from "react";
4
+ import { useIntl as N } from "react-intl";
5
+ import l from "../esm/lib/messages.js";
6
+ import { jsxs as _, Fragment as $, jsx as e } from "react/jsx-runtime";
7
+ import '../styles/index.css';const q = "_noAttributesText_2lw3u_1", z = "_fieldLabel_2lw3u_5", E = "_selectContainer_2lw3u_10", G = "_comboboxContainer_2lw3u_15", H = "_modifiedIcon_2lw3u_19", d = {
8
+ noAttributesText: q,
9
+ fieldLabel: z,
10
+ selectContainer: E,
11
+ comboboxContainer: G,
12
+ modifiedIcon: H
13
+ }, W = ({
14
+ label: m,
15
+ fieldNamePrefix: i,
15
16
  fieldAdvancedFilterOptions: h,
16
- filterOptionsMap: a,
17
+ filterOptionsMap: n,
17
18
  disableForm: b,
18
19
  portalElement: x,
19
- onAdvancedFilterOptionChange: l,
20
- onValueChange: m,
21
- defaultValue: f = "",
22
- showLabel: v = !0,
23
- advancedFilterFieldName: C = `${n}.value.advancedFilterOption`,
24
- value: o,
25
- labelClassName: L = _.fieldLabel,
26
- labelAs: g = "div",
27
- open: A,
28
- onOpenChange: T
20
+ onAdvancedFilterOptionChange: s,
21
+ onValueChange: u,
22
+ defaultValue: v = "",
23
+ showLabel: C = !0,
24
+ advancedFilterFieldName: L = `${i}.value.advancedFilterOption`,
25
+ value: r,
26
+ labelClassName: g = d.fieldLabel,
27
+ labelAs: A = "div",
28
+ open: I,
29
+ onOpenChange: w,
30
+ isModified: T
29
31
  }) => {
30
- const s = $(), [F, p] = k(h || f), y = o !== void 0 ? o : F, S = B((t, ...r) => {
31
- o === void 0 && p(t), l && l(n, t), m(t, ...r);
32
- }, [n, l, m, o]);
33
- return /* @__PURE__ */ q(w, {
34
- children: [v && /* @__PURE__ */ e(D, {
35
- as: g,
36
- className: L,
32
+ const a = N(), [F, p] = B(h || v), y = r !== void 0 ? r : F, S = M((t, ...o) => {
33
+ r === void 0 && p(t), s && s(i, t), u(t, ...o);
34
+ }, [i, s, u, r]);
35
+ return /* @__PURE__ */ _($, {
36
+ children: [C && /* @__PURE__ */ _(D, {
37
+ as: A,
38
+ className: g,
37
39
  color: "textOnLightDefault",
38
40
  variant: "bodyDefaultBold",
39
- children: d
40
- }), /* @__PURE__ */ e(I, {
41
- name: C,
41
+ children: [m, T && /* @__PURE__ */ e("div", {
42
+ "aria-label": a.formatMessage(l.filterModifiedAriaLabel),
43
+ className: d.modifiedIcon,
44
+ role: "img"
45
+ })]
46
+ }), /* @__PURE__ */ e(k, {
47
+ name: L,
42
48
  children: ({
43
49
  field: t,
44
- meta: r
50
+ meta: o
45
51
  }) => /* @__PURE__ */ e("div", {
46
- className: _.selectContainer,
52
+ className: d.selectContainer,
47
53
  children: /* @__PURE__ */ e(c, {
48
54
  ...t,
49
55
  "aria-disabled": b,
50
- "aria-label": s.formatMessage(i.advancedFilterOptionAriaLabel, {
51
- label: d
56
+ "aria-label": a.formatMessage(l.advancedFilterOptionAriaLabel, {
57
+ label: m
52
58
  }),
53
59
  disabled: b,
54
- error: r.touched && r.error ? r.error : void 0,
60
+ error: o.touched && o.error ? o.error : void 0,
55
61
  hideLabel: !0,
56
- label: s.formatMessage(i.selectFilterType),
57
- onOpenChange: T,
62
+ label: a.formatMessage(l.selectFilterType),
63
+ onOpenChange: w,
58
64
  onValueChange: S,
59
- open: A,
60
- placeholder: s.formatMessage(i.selectOptionPlaceholder),
65
+ open: I,
66
+ placeholder: a.formatMessage(l.selectOptionPlaceholder),
61
67
  value: y,
62
68
  children: /* @__PURE__ */ e(c.Content, {
63
69
  container: x,
64
- children: a == null ? void 0 : a.map(([u, j]) => /* @__PURE__ */ e(c.Option, {
70
+ children: n == null ? void 0 : n.map(([f, j]) => /* @__PURE__ */ e(c.Option, {
65
71
  text: j,
66
- value: u
67
- }, u))
72
+ value: f
73
+ }, f))
68
74
  })
69
75
  })
70
76
  })
@@ -72,6 +78,6 @@ import '../styles/index.css';const z = "_noAttributesText_12d80_1", E = "_fieldL
72
78
  });
73
79
  };
74
80
  export {
75
- V as A,
76
- _ as s
81
+ W as A,
82
+ d as s
77
83
  };
@@ -1,20 +1,20 @@
1
- import { DateI18nProvider as de, DatePicker as H, TextInput as ue } from "@box/blueprint-web";
2
- import me from "clsx";
3
- import { useFormikContext as fe, getIn as ve, Field as b } from "formik";
4
- import { useState as L, useRef as X, useCallback as v, useEffect as pe, useMemo as q } from "react";
5
- import { useIntl as he } from "react-intl";
1
+ import { DateI18nProvider as ue, DatePicker as H, TextInput as me } from "@box/blueprint-web";
2
+ import fe from "clsx";
3
+ import { useFormikContext as ve, getIn as pe, Field as b } from "formik";
4
+ import { useState as L, useRef as X, useCallback as v, useEffect as he, useMemo as q } from "react";
5
+ import { useIntl as ge } from "react-intl";
6
6
  import { R as s } from "../../../../../../chunks/types.js";
7
7
  import { DEFAULT_MAX_DATE as z } from "./constants.js";
8
8
  import { getRelativeFromToValues as J, convertToFormikValueRanged as K } from "./date-conversion-utils.js";
9
9
  import { s as p } from "../../../../../../chunks/metadata-date-field.module.js";
10
10
  import { E as A } from "../../../../../../chunks/types2.js";
11
- import { useDateValidation as ge } from "./use-date-validation.js";
12
- import { useIntegerValidation as Fe } from "./use-integer-validation.js";
13
- import { processRelativeDaysInput as De, getDynamicMaxMinValue as Q } from "./utils.js";
11
+ import { useDateValidation as Fe } from "./use-date-validation.js";
12
+ import { useIntegerValidation as De } from "./use-integer-validation.js";
13
+ import { processRelativeDaysInput as Me, getDynamicMaxMinValue as Q } from "./utils.js";
14
14
  import i from "../../../../messages.js";
15
15
  import { jsx as n, jsxs as W } from "react/jsx-runtime";
16
- import { A as Me } from "../../../../../../chunks/index.js";
17
- const _e = ({
16
+ import { A as Te } from "../../../../../../chunks/index.js";
17
+ const $e = ({
18
18
  disableForm: h,
19
19
  fieldNamePrefix: u,
20
20
  label: I,
@@ -23,21 +23,22 @@ const _e = ({
23
23
  filterOptionsMap: Y,
24
24
  onAdvancedFilterOptionChange: g,
25
25
  fieldAdvancedFilterOptions: N,
26
- hasAccordion: Z
26
+ hasAccordion: Z,
27
+ isModified: ee
27
28
  }) => {
28
29
  const T = `${u}.value.advancedFilterOption`, m = `${u}.value.relativeDays`, o = `${u}.value.range.gt`, r = `${u}.value.range.lt`, {
29
30
  values: E,
30
31
  setFieldValue: a,
31
32
  setFieldTouched: S
32
- } = fe(), {
33
+ } = ve(), {
33
34
  validateDates: B,
34
35
  fromDatePickerValue: F,
35
36
  toDatePickerValue: D,
36
37
  fromErrorType: x,
37
38
  toErrorType: P
38
- } = ge(E, o, r, C, !0), {
39
- validatePositiveInteger: ee
40
- } = Fe(), l = he(), [f, te] = L(N || ""), [U, V] = L(!1), d = ve(E, m), [_, R] = L(s.FROM), y = X(F), O = X(D), $ = {
39
+ } = Fe(E, o, r, C, !0), {
40
+ validatePositiveInteger: te
41
+ } = De(), l = ge(), [f, ae] = L(N || ""), [U, V] = L(!1), d = pe(E, m), [_, R] = L(s.FROM), y = X(F), O = X(D), $ = {
41
42
  clearDatePickerAriaLabel: l.formatMessage(i.clearSelectedDate),
42
43
  nextMonthAriaLabel: l.formatMessage(i.switchToNextMonth),
43
44
  openCalendarDropdownAriaLabel: l.formatMessage(i.openCalendar),
@@ -63,35 +64,35 @@ const _e = ({
63
64
  }
64
65
  }
65
66
  }, [f, d, o, r, a]);
66
- pe(() => {
67
+ he(() => {
67
68
  U && (w(), V(!1));
68
69
  }, [U, w]);
69
- const ae = v((e) => {
70
+ const oe = v((e) => {
70
71
  const t = e;
71
- te(t), a(T, t), g && g(u, t);
72
+ ae(t), a(T, t), g && g(u, t);
72
73
  const c = () => {
73
74
  a(m, void 0), a(o, void 0), a(r, void 0);
74
75
  }, k = () => {
75
76
  a(o, void 0), a(r, void 0);
76
77
  };
77
78
  ["isBlank", "isNotBlank", "selectFilterType"].includes(t) || !t || t === "customRange" ? c() : t === "today" ? (a(m, void 0), V(!0)) : k();
78
- }, [u, g, a, T, m, o, r]), oe = v((e) => {
79
+ }, [u, g, a, T, m, o, r]), re = v((e) => {
79
80
  const {
80
81
  valueToStore: t,
81
82
  shouldTriggerUpdate: c
82
- } = De(e);
83
+ } = Me(e);
83
84
  a(m, t), c && V(!0);
84
- }, [a, m]), re = v((e) => {
85
+ }, [a, m]), se = v((e) => {
85
86
  const t = K(e, s.FROM);
86
87
  y.current = e, a(o, t), R(s.FROM);
87
- }, [a, o]), se = v((e) => {
88
+ }, [a, o]), ne = v((e) => {
88
89
  const t = K(e, s.TO);
89
90
  O.current = e, a(r, t), R(s.TO);
90
91
  }, [a, r]), j = v((e) => {
91
92
  const t = e === s.FROM ? o : r;
92
93
  S(t, !0), R(e);
93
- }, [S, o, r]), ne = q(() => Q(D, z), [D]), le = q(() => Q(F), [F]), G = (e, t, c) => !!(t === A.MAX && e === A.OVERLAPPING || e === A.OVERLAPPING && c), ie = ["isBlank", "isNotBlank", "selectFilterType", "today"], ce = () => !f || ie.includes(f) ? null : f === "customRange" ? /* @__PURE__ */ W("div", {
94
- className: me(p.rangeInputsContainer, p.verticalLayout),
94
+ }, [S, o, r]), le = q(() => Q(D, z), [D]), ie = q(() => Q(F), [F]), G = (e, t, c) => !!(t === A.MAX && e === A.OVERLAPPING || e === A.OVERLAPPING && c), ce = ["isBlank", "isNotBlank", "selectFilterType", "today"], de = () => !f || ce.includes(f) ? null : f === "customRange" ? /* @__PURE__ */ W("div", {
95
+ className: fe(p.rangeInputsContainer, p.verticalLayout),
95
96
  children: [/* @__PURE__ */ n(b, {
96
97
  name: o,
97
98
  validate: (e) => B(y.current, O.current, s.FROM),
@@ -107,9 +108,9 @@ const _e = ({
107
108
  error: !G(x, P, _ !== s.FROM) && t.error,
108
109
  isDisabled: h,
109
110
  label: l.formatMessage(i.afterDate),
110
- maxValue: ne,
111
+ maxValue: le,
111
112
  onBlur: () => j(s.FROM),
112
- onChange: re,
113
+ onChange: se,
113
114
  portalElement: M,
114
115
  value: F
115
116
  })
@@ -130,9 +131,9 @@ const _e = ({
130
131
  isDisabled: h,
131
132
  label: l.formatMessage(i.beforeDate),
132
133
  maxValue: z,
133
- minValue: le,
134
+ minValue: ie,
134
135
  onBlur: () => j(s.TO),
135
- onChange: se,
136
+ onChange: ne,
136
137
  portalElement: M,
137
138
  value: D
138
139
  })
@@ -140,46 +141,47 @@ const _e = ({
140
141
  })]
141
142
  }) : /* @__PURE__ */ n(b, {
142
143
  name: m,
143
- validate: (e) => ee((e == null ? void 0 : e.toString()) || ""),
144
+ validate: (e) => te((e == null ? void 0 : e.toString()) || ""),
144
145
  children: ({
145
146
  field: e,
146
147
  meta: t
147
148
  }) => /* @__PURE__ */ n("div", {
148
149
  className: p.daysInputContainer,
149
- children: /* @__PURE__ */ n(ue, {
150
+ children: /* @__PURE__ */ n(me, {
150
151
  ...e,
151
152
  disabled: h,
152
153
  error: t.touched && t.error,
153
154
  hideLabel: !0,
154
155
  label: l.formatMessage(i.relativeDaysSelectLabel),
155
- onChange: (c) => oe(c.target.value),
156
+ onChange: (c) => re(c.target.value),
156
157
  placeholder: l.formatMessage(i.numberOfDays),
157
158
  value: (d == null ? void 0 : d.toString()) || ""
158
159
  })
159
160
  })
160
161
  });
161
- return /* @__PURE__ */ n(de, {
162
+ return /* @__PURE__ */ n(ue, {
162
163
  locale: C,
163
164
  children: /* @__PURE__ */ W("div", {
164
165
  className: p.advancedDateContainer,
165
166
  "data-testid": `${I}-advanced-field`,
166
- children: [/* @__PURE__ */ n(Me, {
167
+ children: [/* @__PURE__ */ n(Te, {
167
168
  advancedFilterFieldName: T,
168
169
  disableForm: h,
169
170
  fieldAdvancedFilterOptions: N,
170
171
  fieldNamePrefix: u,
171
172
  filterOptionsMap: Y,
173
+ isModified: ee,
172
174
  label: I,
173
175
  onAdvancedFilterOptionChange: g,
174
- onValueChange: ae,
176
+ onValueChange: oe,
175
177
  portalElement: M,
176
178
  showLabel: !Z,
177
179
  value: f
178
- }), ce()]
180
+ }), de()]
179
181
  })
180
182
  });
181
183
  };
182
184
  export {
183
- _e as MetadataDateFieldAdvanced,
184
- _e as default
185
+ $e as MetadataDateFieldAdvanced,
186
+ $e as default
185
187
  };
@@ -1,67 +1,69 @@
1
1
  import { TextInput as N } from "@box/blueprint-web";
2
- import { Field as $ } from "formik";
2
+ import { Field as k } from "formik";
3
3
  import { useState as S, useCallback as F } from "react";
4
- import { useIntl as k } from "react-intl";
4
+ import { useIntl as G } from "react-intl";
5
5
  import u from "../../../../messages.js";
6
6
  import { R as d } from "../../../../../../chunks/types.js";
7
7
  import { fieldDefaultProps as b } from "../constants.js";
8
- import { createAdvancedFilterOptionHandler as G, createInputChangeHandler as V } from "./handlers.js";
8
+ import { createAdvancedFilterOptionHandler as Q, createInputChangeHandler as V } from "./handlers.js";
9
9
  import { s as c } from "../../../../../../chunks/metadata-float-field.module.js";
10
- import { u as Q } from "../../../../../../chunks/use-float-validation.js";
11
- import { FloatAdvancedFilterOption as U, getInputValues as y, getInputDisplayState as q, FloatInputDisplayState as I } from "./utils.js";
12
- import { jsx as n, jsxs as A, Fragment as z } from "react/jsx-runtime";
13
- import { A as J } from "../../../../../../chunks/index.js";
14
- const se = ({
10
+ import { u as U } from "../../../../../../chunks/use-float-validation.js";
11
+ import { FloatAdvancedFilterOption as q, getInputValues as y, getInputDisplayState as z, FloatInputDisplayState as I } from "./utils.js";
12
+ import { jsx as n, jsxs as A, Fragment as J } from "react/jsx-runtime";
13
+ import { A as K } from "../../../../../../chunks/index.js";
14
+ const ie = ({
15
15
  label: m,
16
16
  fieldNamePrefix: C,
17
17
  disableForm: p,
18
18
  onAdvancedFilterOptionChange: h,
19
19
  fieldAdvancedFilterOptions: O,
20
20
  filterOptionsMap: E,
21
- hasAccordion: R
21
+ hasAccordion: R,
22
+ isModified: w
22
23
  }) => {
23
- const s = k(), o = `${C}.value.enum[0]`, [w, L] = S(d.FROM), [l, M] = S(O || U.EQUALS), {
24
+ const s = G(), o = `${C}.value.enum[0]`, [x, L] = S(d.FROM), [l, M] = S(O || q.EQUALS), {
24
25
  validateFloats: f
25
- } = Q(), x = F((a, t, r, e) => G(o, h, M)(a, t, r, e), [o, h, M]), D = F((a, t, r) => V(o, l, L, d.FROM)(a, t, r), [o, l]), H = F((a, t, r) => V(o, l, L, d.TO)(a, t, r), [o, l]);
26
+ } = U(), D = F((a, t, r, e) => Q(o, h, M)(a, t, r, e), [o, h, M]), H = F((a, t, r) => V(o, l, L, d.FROM)(a, t, r), [o, l]), P = F((a, t, r) => V(o, l, L, d.TO)(a, t, r), [o, l]);
26
27
  return /* @__PURE__ */ n("div", {
27
28
  className: c.advancedFilterContainer,
28
29
  "data-testid": `${m}-field`,
29
- children: /* @__PURE__ */ n($, {
30
+ children: /* @__PURE__ */ n(k, {
30
31
  name: o,
31
32
  validate: (a) => {
32
33
  const t = y(a, !0);
33
- return f(t.from, t.to, w, !0);
34
+ return f(t.from, t.to, x, !0);
34
35
  },
35
36
  children: ({
36
37
  field: a,
37
38
  meta: t,
38
39
  form: r
39
40
  }) => {
40
- const e = y(a.value, !0), g = q(l), P = g !== I.NONE, T = g === I.SINGLE, v = g === I.BOTH, j = f(e.from, e.to, d.FROM, !0), B = f(e.from, e.to, d.TO, !0);
41
- return /* @__PURE__ */ A(z, {
42
- children: [/* @__PURE__ */ n(J, {
41
+ const e = y(a.value, !0), g = z(l), j = g !== I.NONE, T = 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__ */ A(J, {
43
+ children: [/* @__PURE__ */ n(K, {
43
44
  disableForm: p,
44
45
  fieldAdvancedFilterOptions: O,
45
46
  fieldNamePrefix: C,
46
47
  filterOptionsMap: E,
48
+ isModified: w,
47
49
  label: m,
48
50
  onAdvancedFilterOptionChange: h,
49
- onValueChange: (i) => x(i, e.from, e.to, r),
51
+ onValueChange: (i) => D(i, e.from, e.to, r),
50
52
  showLabel: !R,
51
53
  value: l
52
- }), P && /* @__PURE__ */ A("div", {
54
+ }), j && /* @__PURE__ */ A("div", {
53
55
  className: c.rangeInputsContainer,
54
56
  children: [(T || v) && /* @__PURE__ */ n("div", {
55
57
  className: c.inputContainer,
56
58
  children: /* @__PURE__ */ n(N, {
57
59
  ...b,
58
60
  disabled: p,
59
- error: T ? t.error : j,
61
+ error: T ? t.error : B,
60
62
  hideLabel: !0,
61
63
  label: s.formatMessage(u.fieldFromLabel, {
62
64
  label: m
63
65
  }),
64
- onChange: (i) => D(i.currentTarget.value, e.to, r),
66
+ onChange: (i) => H(i.currentTarget.value, e.to, r),
65
67
  placeholder: v ? s.formatMessage(u.minValuePlaceholder) : s.formatMessage(u.enterNumberPlaceholder),
66
68
  value: e.from
67
69
  })
@@ -70,12 +72,12 @@ const se = ({
70
72
  children: /* @__PURE__ */ n(N, {
71
73
  ...b,
72
74
  disabled: p,
73
- error: B,
75
+ error: $,
74
76
  hideLabel: !0,
75
77
  label: s.formatMessage(u.fieldToLabel, {
76
78
  label: m
77
79
  }),
78
- onChange: (i) => H(i.currentTarget.value, e.from, r),
80
+ onChange: (i) => P(i.currentTarget.value, e.from, r),
79
81
  placeholder: s.formatMessage(u.maxValuePlaceholder),
80
82
  value: e.to
81
83
  })
@@ -87,6 +89,6 @@ const se = ({
87
89
  });
88
90
  };
89
91
  export {
90
- se as MetadataFloatFieldAdvanced,
91
- se as default
92
+ ie as MetadataFloatFieldAdvanced,
93
+ ie as default
92
94
  };
@@ -1,13 +1,13 @@
1
- import { TooltipProvider as D, Combobox as P } from "@box/blueprint-web";
2
- import { useFormikContext as U, getIn as q, Field as v } from "formik";
1
+ import { TooltipProvider as P, Combobox as U } from "@box/blueprint-web";
2
+ import { useFormikContext as q, getIn as v, Field as z } from "formik";
3
3
  import { useState as f, useCallback as p } from "react";
4
- import { useIntl as z } from "react-intl";
5
- import G from "../../../../messages.js";
6
- import { fieldDefaultProps as H } from "../constants.js";
7
- import { getInitialAdvancedFilterValue as J, createFieldValue as k, getInputValue as K } from "./utils.js";
8
- import { jsx as a, jsxs as N, Fragment as Q } from "react/jsx-runtime";
9
- import { A as R } from "../../../../../../chunks/index.js";
10
- const x = (t) => t === "isBlank" || t === "isNotBlank", se = ({
4
+ import { useIntl as G } from "react-intl";
5
+ import H from "../../../../messages.js";
6
+ import { fieldDefaultProps as J } from "../constants.js";
7
+ import { getInitialAdvancedFilterValue as K, createFieldValue as k, getInputValue as N } from "./utils.js";
8
+ import { jsx as a, jsxs as Q, Fragment as R } from "react/jsx-runtime";
9
+ import { A as W } from "../../../../../../chunks/index.js";
10
+ const x = (t) => t === "isBlank" || t === "isNotBlank", oe = ({
11
11
  label: t,
12
12
  fieldNamePrefix: m,
13
13
  disableForm: h,
@@ -16,61 +16,63 @@ const x = (t) => t === "isBlank" || t === "isNotBlank", se = ({
16
16
  fieldAdvancedFilterOptions: g,
17
17
  filterOptionsMap: V,
18
18
  portalElement: C,
19
- hasAccordion: I
19
+ hasAccordion: I,
20
+ isModified: S
20
21
  }) => {
21
22
  const {
22
- setFieldValue: S,
23
- values: w
24
- } = U(), L = z(), n = `${m}.value.enum`, y = q(w, `${m}.options`, []).map((e) => e == null ? void 0 : e.key).filter((e) => typeof e == "string"), [c, B] = f(J(g, V)), [O, d] = f(!1), [$, b] = f(!1), j = (e, s) => typeof s != "string" ? !1 : s.toLowerCase().includes(e.toLowerCase()), F = p((e, s, o) => {
25
- B(e), l == null || l(n, e);
23
+ setFieldValue: w,
24
+ values: L
25
+ } = q(), y = G(), n = `${m}.value.enum`, B = v(L, `${m}.options`, []).map((e) => e == null ? void 0 : e.key).filter((e) => typeof e == "string"), [c, O] = f(K(g, V)), [$, d] = f(!1), [j, b] = f(!1), F = (e, s) => typeof s != "string" ? !1 : s.toLowerCase().includes(e.toLowerCase()), M = p((e, s, o) => {
26
+ O(e), l == null || l(n, e);
26
27
  const r = x(e) ? [] : s, i = k(r, e, u);
27
28
  o.setFieldValue(n, i);
28
- }, [n, u, l]), M = p((e) => {
29
+ }, [n, u, l]), T = p((e) => {
29
30
  d(e), e && b(!1);
30
- }, []), T = p((e) => {
31
+ }, []), D = p((e) => {
31
32
  b(e), e && d(!1);
32
33
  }, []);
33
34
  return /* @__PURE__ */ a("div", {
34
35
  "data-testid": `${t}-field`,
35
- children: /* @__PURE__ */ a(v, {
36
+ children: /* @__PURE__ */ a(z, {
36
37
  name: n,
37
38
  children: ({
38
39
  field: e,
39
40
  form: s
40
41
  }) => {
41
- const o = K(e.value, u);
42
- return /* @__PURE__ */ N(Q, {
43
- children: [/* @__PURE__ */ a(R, {
42
+ const o = N(e.value, u);
43
+ return /* @__PURE__ */ Q(R, {
44
+ children: [/* @__PURE__ */ a(W, {
44
45
  disableForm: h,
45
46
  fieldAdvancedFilterOptions: g,
46
47
  fieldNamePrefix: m,
47
48
  filterOptionsMap: V,
49
+ isModified: S,
48
50
  label: t,
49
51
  onAdvancedFilterOptionChange: l,
50
- onOpenChange: T,
51
- onValueChange: (r) => F(r, o, s),
52
- open: $,
52
+ onOpenChange: D,
53
+ onValueChange: (r) => M(r, o, s),
54
+ open: j,
53
55
  portalElement: C,
54
56
  showLabel: !I,
55
57
  value: c
56
- }), !x(c) && /* @__PURE__ */ a(D, {
57
- children: /* @__PURE__ */ a(P, {
58
- ...H,
58
+ }), !x(c) && /* @__PURE__ */ a(P, {
59
+ children: /* @__PURE__ */ a(U, {
60
+ ...J,
59
61
  as: "input",
60
62
  disabled: h,
61
- filterFn: j,
63
+ filterFn: F,
62
64
  hideLabel: !0,
63
65
  label: t,
64
66
  multiselect: !0,
65
67
  name: e.name,
66
- onOpenChange: M,
68
+ onOpenChange: T,
67
69
  onValueChange: (r) => {
68
70
  const i = k(r, c, u);
69
- S(n, i);
71
+ w(n, i);
70
72
  },
71
- open: O,
72
- options: y,
73
- placeholder: !o || o.length === 0 ? L.formatMessage(G.multiselectPlaceholder) : "",
73
+ open: $,
74
+ options: B,
75
+ placeholder: !o || o.length === 0 ? y.formatMessage(H.multiselectPlaceholder) : "",
74
76
  portalElement: C,
75
77
  value: o
76
78
  })
@@ -81,5 +83,5 @@ const x = (t) => t === "isBlank" || t === "isNotBlank", se = ({
81
83
  });
82
84
  };
83
85
  export {
84
- se as MetadataMultiSelectFieldAdvanced
86
+ oe as MetadataMultiSelectFieldAdvanced
85
87
  };
@@ -1,13 +1,13 @@
1
- import { TextInput as T } from "@box/blueprint-web";
2
- import { Field as j } from "formik";
3
- import { useState as $, useCallback as n } from "react";
4
- import { useIntl as k } from "react-intl";
1
+ import { TextInput as j } from "@box/blueprint-web";
2
+ import { Field as $ } from "formik";
3
+ import { useState as k, useCallback as n } from "react";
4
+ import { useIntl as y } from "react-intl";
5
5
  import x from "../../../../messages.js";
6
- import { fieldDefaultProps as y } from "../constants.js";
7
- import { getInitialAdvancedFilterValue as D, createFieldValue as w, getInputValue as H, shouldHideTextInput as N } from "./utils.js";
8
- import { jsx as p, jsxs as P, Fragment as q } from "react/jsx-runtime";
9
- import { A as z } from "../../../../../../chunks/index.js";
10
- const B = ({
6
+ import { fieldDefaultProps as D } from "../constants.js";
7
+ import { getInitialAdvancedFilterValue as H, createFieldValue as w, getInputValue as N, shouldHideTextInput as P } from "./utils.js";
8
+ import { jsx as p, jsxs as q, Fragment as z } from "react/jsx-runtime";
9
+ import { A as B } from "../../../../../../chunks/index.js";
10
+ const G = ({
11
11
  label: s,
12
12
  fieldNamePrefix: f,
13
13
  disableForm: g,
@@ -15,39 +15,41 @@ const B = ({
15
15
  onAdvancedFilterOptionChange: o,
16
16
  fieldAdvancedFilterOptions: h,
17
17
  filterOptionsMap: I,
18
- hasAccordion: c
18
+ hasAccordion: c,
19
+ isModified: S
19
20
  }) => {
20
- const i = k(), r = `${f}.value.enum[0]`, [l, S] = $(D(h, I)), L = n((e, m, u) => {
21
- S(e), o == null || o(r, e);
21
+ const i = y(), r = `${f}.value.enum[0]`, [l, L] = k(H(h, I)), M = n((e, m, u) => {
22
+ L(e), o == null || o(r, e);
22
23
  const a = w(m, e, t);
23
24
  u.setFieldValue(r, a);
24
- }, [r, t, o]), M = n((e, m) => {
25
+ }, [r, t, o]), T = n((e, m) => {
25
26
  const u = e.target.value, a = w(u, l, t);
26
27
  m.setFieldValue(r, a);
27
28
  }, [l, t, r]);
28
29
  return /* @__PURE__ */ p("div", {
29
30
  "data-testid": `${s}-field`,
30
- children: /* @__PURE__ */ p(j, {
31
+ children: /* @__PURE__ */ p($, {
31
32
  name: r,
32
33
  children: ({
33
34
  field: e,
34
35
  meta: m,
35
36
  form: u
36
37
  }) => {
37
- const a = H(e.value, t);
38
- return /* @__PURE__ */ P(q, {
39
- children: [t && /* @__PURE__ */ p(z, {
38
+ const a = N(e.value, t);
39
+ return /* @__PURE__ */ q(z, {
40
+ children: [t && /* @__PURE__ */ p(B, {
40
41
  disableForm: g,
41
42
  fieldAdvancedFilterOptions: h,
42
43
  fieldNamePrefix: f,
43
44
  filterOptionsMap: I,
45
+ isModified: S,
44
46
  label: s,
45
47
  onAdvancedFilterOptionChange: o,
46
- onValueChange: (V) => L(V, a, u),
48
+ onValueChange: (V) => M(V, a, u),
47
49
  showLabel: t && !c,
48
50
  value: l
49
- }), !N(t, l) && /* @__PURE__ */ p(T, {
50
- ...y,
51
+ }), !P(t, l) && /* @__PURE__ */ p(j, {
52
+ ...D,
51
53
  ...e,
52
54
  "aria-label": i.formatMessage(x.enterValueAriaLabel, {
53
55
  label: s
@@ -56,7 +58,7 @@ const B = ({
56
58
  error: m.error,
57
59
  hideLabel: t || c,
58
60
  label: s,
59
- onChange: (V) => M(V, u),
61
+ onChange: (V) => T(V, u),
60
62
  placeholder: i.formatMessage(x.setValuePlaceholder),
61
63
  value: a
62
64
  })]
@@ -65,8 +67,8 @@ const B = ({
65
67
  })
66
68
  });
67
69
  };
68
- B.displayName = "MetadataStringField";
70
+ G.displayName = "MetadataStringField";
69
71
  export {
70
- B as MetadataStringField,
71
- B as default
72
+ G as MetadataStringField,
73
+ G as default
72
74
  };