@box/metadata-filter 1.62.3 → 1.63.0

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,6 +1,9 @@
1
- let O = /* @__PURE__ */ (function(t) {
2
- return t[t.TO = 0] = "TO", t[t.FROM = 1] = "FROM", t;
1
+ let _ = /* @__PURE__ */ (function(A) {
2
+ return A[A.TO = 0] = "TO", A[A.FROM = 1] = "FROM", A;
3
+ })({}), N = /* @__PURE__ */ (function(A) {
4
+ return A.MATCH_EXACTLY = "matchExactly", A.STARTS_WITH = "startsWith", A.CONTAINS = "contains", A.IS_NOT = "isNot", A.IS_BLANK = "isBlank", A.IS_NOT_BLANK = "isNotBlank", A.SELECT_FILTER_TYPE = "selectFilterType", A.TODAY = "today", A.NEXT = "next", A.PAST = "past", A.OLDER_THAN = "olderThan", A.CUSTOM_RANGE = "customRange", A.EQUALS = "equals", A.GREATER_THAN_OR_EQUAL = "greaterThanOrEqual", A.LESS_THAN_OR_EQUAL = "lessThanOrEqual", A.BETWEEN = "between", A.MATCH_ANY = "matchAny", A.MATCH_ALL = "matchAll", A.IS_NOT_ANY = "isNotAny", A.MATCH_AT_OR_WITHIN = "matchAtOrWithin", A.IS_NOT_AT_OR_WITHIN = "isNotAtOrWithin", A;
3
5
  })({});
4
6
  export {
5
- O as R
7
+ N as F,
8
+ _ as R
6
9
  };
package/dist/esm/index.js CHANGED
@@ -1,22 +1,23 @@
1
1
  export * from "@box/combobox-with-api";
2
2
  import { getRelativeFromToValues as o } from "./lib/components/metadata-filter-fields/components/metadata-date-field/date-conversion-utils.js";
3
3
  import { defaultInitialValues as l, defaultMetadataValueMap as d } from "./lib/defaults.js";
4
- import { MetadataFilter as f } from "./lib/metadata-filter.js";
5
- import { R as p } from "../chunks/types.js";
6
- import { MetadataDateField as M, MetadataDateFieldNonRelative as F } from "./lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.js";
7
- import { MetadataEnumField as n } from "./lib/components/metadata-filter-fields/components/metadata-enum-field/metadata-enum-field.js";
4
+ import { MetadataFilter as p } from "./lib/metadata-filter.js";
5
+ import { F as m, R as F } from "../chunks/types.js";
6
+ import { MetadataDateField as M, MetadataDateFieldNonRelative as u } from "./lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.js";
7
+ import { MetadataEnumField as s } from "./lib/components/metadata-filter-fields/components/metadata-enum-field/metadata-enum-field.js";
8
8
  import { MetadataFloatField as g } from "./lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.js";
9
- import { MetadataMultiSelectField as V } from "./lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.js";
10
- import { MetadataStringField as D } from "./lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.js";
9
+ import { MetadataMultiSelectField as T } from "./lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.js";
10
+ import { MetadataStringField as v } from "./lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.js";
11
11
  export {
12
+ m as FilterKeyTypes,
12
13
  M as MetadataDateField,
13
- F as MetadataDateFieldNonRelative,
14
- n as MetadataEnumField,
15
- f as MetadataFilter,
14
+ u as MetadataDateFieldNonRelative,
15
+ s as MetadataEnumField,
16
+ p as MetadataFilter,
16
17
  g as MetadataFloatField,
17
- V as MetadataMultiSelectField,
18
- D as MetadataStringField,
19
- p as RangeLabelType,
18
+ T as MetadataMultiSelectField,
19
+ v as MetadataStringField,
20
+ F as RangeLabelType,
20
21
  l as defaultInitialValues,
21
22
  d as defaultMetadataValueMap,
22
23
  o as getRelativeFromToValues
@@ -1,187 +1,187 @@
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
- import { R as s } from "../../../../../../chunks/types.js";
7
- import { DEFAULT_MAX_DATE as z } from "./constants.js";
8
- import { getRelativeFromToValues as J, convertToFormikValueRanged as K } from "./date-conversion-utils.js";
1
+ import { DateI18nProvider as me, DatePicker as H, TextInput as fe } from "@box/blueprint-web";
2
+ import ve from "clsx";
3
+ import { useFormikContext as Te, getIn as pe, Field as I } from "formik";
4
+ import { useState as N, useRef as X, useCallback as T, useEffect as he, useMemo as j } from "react";
5
+ import { useIntl as Fe } from "react-intl";
6
+ import { F as r, R as n } from "../../../../../../chunks/types.js";
7
+ import { DEFAULT_MAX_DATE as q } from "./constants.js";
8
+ import { getRelativeFromToValues as z, convertToFormikValueRanged as J } from "./date-conversion-utils.js";
9
9
  import { s as p } from "../../../../../../chunks/metadata-date-field.module.js";
10
- import { E as A } from "../../../../../../chunks/types2.js";
11
- import { useDateValidation as Fe } from "./use-date-validation.js";
12
- import { useIntegerValidation as De } from "./use-integer-validation.js";
10
+ import { E as S } from "../../../../../../chunks/types2.js";
11
+ import { useDateValidation as De } from "./use-date-validation.js";
12
+ import { useIntegerValidation as ge } from "./use-integer-validation.js";
13
13
  import { processRelativeDaysInput as Me, getDynamicMaxMinValue as Q } from "./utils.js";
14
- import i from "../../../../messages.js";
15
- import { jsx as n, jsxs as W } from "react/jsx-runtime";
16
- import { A as Te } from "../../../../../../chunks/index.js";
17
- const $e = ({
14
+ import c from "../../../../messages.js";
15
+ import { jsx as l, jsxs as W } from "react/jsx-runtime";
16
+ import { A as Oe } from "../../../../../../chunks/index.js";
17
+ const Ke = ({
18
18
  disableForm: h,
19
- fieldNamePrefix: d,
20
- label: I,
21
- locale: C,
19
+ fieldNamePrefix: u,
20
+ label: _,
21
+ locale: y,
22
22
  portalElement: M,
23
- filterOptionsMap: Y,
24
- onAdvancedFilterOptionChange: g,
25
- fieldAdvancedFilterOptions: N,
26
- hasAccordion: Z,
27
- isModified: ee
23
+ filterOptionsMap: Z,
24
+ onAdvancedFilterOptionChange: F,
25
+ fieldAdvancedFilterOptions: C,
26
+ hasAccordion: ee,
27
+ isModified: ae
28
28
  }) => {
29
- const T = `${d}.value.advancedFilterOption`, u = `${d}.value.relativeDays`, r = `${d}.value.range.gt`, o = `${d}.value.range.lt`, {
30
- values: E,
29
+ const O = `${u}.value.advancedFilterOption`, m = `${u}.value.relativeDays`, o = `${u}.value.range.gt`, s = `${u}.value.range.lt`, {
30
+ values: b,
31
31
  setFieldValue: t,
32
- setFieldTouched: S
33
- } = ve(), {
34
- validateDates: B,
35
- fromDatePickerValue: F,
36
- toDatePickerValue: D,
37
- fromErrorType: x,
38
- toErrorType: P
39
- } = Fe(E, r, o, C, !0), {
40
- validatePositiveInteger: ae
41
- } = De(), l = ge(), [m, te] = L(N || ""), [U, V] = L(!1), f = pe(E, u), [_, y] = L(s.FROM), R = X(F), O = X(D), $ = {
42
- clearDatePickerAriaLabel: l.formatMessage(i.clearSelectedDate),
43
- nextMonthAriaLabel: l.formatMessage(i.switchToNextMonth),
44
- openCalendarDropdownAriaLabel: l.formatMessage(i.openCalendar),
45
- previousMonthAriaLabel: l.formatMessage(i.switchToNextMonth)
46
- }, w = v(() => {
47
- if (m === "today") {
32
+ setFieldTouched: k
33
+ } = Te(), {
34
+ validateDates: P,
35
+ fromDatePickerValue: D,
36
+ toDatePickerValue: g,
37
+ fromErrorType: B,
38
+ toErrorType: U
39
+ } = De(b, o, s, y, !0), {
40
+ validatePositiveInteger: te
41
+ } = ge(), i = Fe(), [f, re] = N(C || r.SELECT_FILTER_TYPE), [x, E] = N(!1), v = pe(b, m), [Y, L] = N(n.FROM), A = X(D), R = X(g), K = {
42
+ clearDatePickerAriaLabel: i.formatMessage(c.clearSelectedDate),
43
+ nextMonthAriaLabel: i.formatMessage(c.switchToNextMonth),
44
+ openCalendarDropdownAriaLabel: i.formatMessage(c.openCalendar),
45
+ previousMonthAriaLabel: i.formatMessage(c.switchToNextMonth)
46
+ }, $ = T(() => {
47
+ if (f === r.TODAY) {
48
48
  const {
49
49
  from: e,
50
50
  to: a
51
- } = J("today", void 0);
52
- t(r, e), t(o, a);
53
- } else if (f !== void 0) {
54
- const e = typeof f == "string" ? Number(f) : f;
51
+ } = z("today", void 0);
52
+ t(o, e), t(s, a);
53
+ } else if (v !== void 0) {
54
+ const e = typeof v == "string" ? Number(v) : v;
55
55
  if (!isNaN(e) && e > 0) {
56
- const a = m;
57
- if (["next", "past", "olderThan"].includes(a)) {
56
+ const a = f;
57
+ if ([r.NEXT, r.PAST, r.OLDER_THAN].includes(a)) {
58
58
  const {
59
- from: c,
60
- to: k
61
- } = J(a, e);
62
- t(r, c), t(o, k);
59
+ from: d,
60
+ to: V
61
+ } = z(a, e);
62
+ t(o, d), t(s, V);
63
63
  }
64
64
  }
65
65
  }
66
- }, [m, f, r, o, t]);
66
+ }, [f, v, o, s, t]);
67
67
  he(() => {
68
- U && (w(), V(!1));
69
- }, [U, w]);
70
- const re = v((e) => {
68
+ x && ($(), E(!1));
69
+ }, [x, $]);
70
+ const oe = T((e) => {
71
71
  const a = e;
72
- te(a), t(T, a), g && g(d, a);
73
- const c = () => {
74
- t(u, void 0), t(r, void 0), t(o, void 0);
75
- }, k = () => {
76
- t(r, void 0), t(o, void 0);
72
+ re(a), t(O, a), F && F(u, a);
73
+ const d = () => {
74
+ t(m, void 0), t(o, void 0), t(s, void 0);
75
+ }, V = () => {
76
+ t(o, void 0), t(s, void 0);
77
77
  };
78
- ["isBlank", "isNotBlank", "selectFilterType"].includes(a) || !a || a === "customRange" ? c() : a === "today" ? (t(u, void 0), V(!0)) : k();
79
- }, [d, g, t, T, u, r, o]), oe = v((e) => {
78
+ [r.IS_BLANK, r.IS_NOT_BLANK, r.SELECT_FILTER_TYPE].includes(a) || !a || a === r.CUSTOM_RANGE ? d() : a === r.TODAY ? (t(m, void 0), E(!0)) : V();
79
+ }, [u, F, t, O, m, o, s]), se = T((e) => {
80
80
  const {
81
81
  valueToStore: a,
82
- shouldTriggerUpdate: c
82
+ shouldTriggerUpdate: d
83
83
  } = Me(e);
84
- t(u, a), c && V(!0);
85
- }, [t, u]), se = v((e) => {
86
- const a = K(e, s.FROM);
87
- R.current = e, t(r, a), y(s.FROM);
88
- }, [t, r]), ne = v((e) => {
89
- const a = K(e, s.TO);
90
- O.current = e, t(o, a), y(s.TO);
91
- }, [t, o]), j = v((e) => {
92
- const a = e === s.FROM ? r : o;
93
- S(a, !0), y(e);
94
- }, [S, r, o]), le = q(() => Q(D, z), [D]), ie = q(() => Q(F), [F]), G = (e, a, c) => !!(a === A.MAX && e === A.OVERLAPPING || e === A.OVERLAPPING && c), ce = ["isBlank", "isNotBlank", "selectFilterType", "today"], de = () => !m || ce.includes(m) ? null : m === "customRange" ? /* @__PURE__ */ W("div", {
95
- className: fe(p.rangeInputsContainer, p.verticalLayout),
96
- children: [/* @__PURE__ */ n(b, {
97
- name: r,
98
- validate: (e) => B(R.current, O.current, s.FROM),
84
+ t(m, a), d && E(!0);
85
+ }, [t, m]), ne = T((e) => {
86
+ const a = J(e, n.FROM);
87
+ A.current = e, t(o, a), L(n.FROM);
88
+ }, [t, o]), le = T((e) => {
89
+ const a = J(e, n.TO);
90
+ R.current = e, t(s, a), L(n.TO);
91
+ }, [t, s]), w = T((e) => {
92
+ const a = e === n.FROM ? o : s;
93
+ k(a, !0), L(e);
94
+ }, [k, o, s]), ie = j(() => Q(g, q), [g]), ce = j(() => Q(D), [D]), G = (e, a, d) => !!(a === S.MAX && e === S.OVERLAPPING || e === S.OVERLAPPING && d), de = [r.IS_BLANK, r.IS_NOT_BLANK, r.SELECT_FILTER_TYPE, r.TODAY], ue = () => !f || de.includes(f) ? null : f === r.CUSTOM_RANGE ? /* @__PURE__ */ W("div", {
95
+ className: ve(p.rangeInputsContainer, p.verticalLayout),
96
+ children: [/* @__PURE__ */ l(I, {
97
+ name: o,
98
+ validate: (e) => P(A.current, R.current, n.FROM),
99
99
  children: ({
100
100
  field: e,
101
101
  meta: a
102
- }) => /* @__PURE__ */ n("div", {
102
+ }) => /* @__PURE__ */ l("div", {
103
103
  className: p.datePicker,
104
- children: /* @__PURE__ */ n(H, {
104
+ children: /* @__PURE__ */ l(H, {
105
105
  ...e,
106
- ...$,
107
- calendarAriaLabel: l.formatMessage(i.selectStartDate),
108
- error: !G(x, P, _ !== s.FROM) && a.error,
106
+ ...K,
107
+ calendarAriaLabel: i.formatMessage(c.selectStartDate),
108
+ error: !G(B, U, Y !== n.FROM) && a.error,
109
109
  isDisabled: h,
110
- label: l.formatMessage(i.afterDate),
111
- maxValue: le,
112
- onBlur: () => j(s.FROM),
113
- onChange: se,
110
+ label: i.formatMessage(c.afterDate),
111
+ maxValue: ie,
112
+ onBlur: () => w(n.FROM),
113
+ onChange: ne,
114
114
  portalElement: M,
115
- value: F
115
+ value: D
116
116
  })
117
117
  })
118
- }), /* @__PURE__ */ n(b, {
119
- name: o,
120
- validate: (e) => B(R.current, O.current, s.TO),
118
+ }), /* @__PURE__ */ l(I, {
119
+ name: s,
120
+ validate: (e) => P(A.current, R.current, n.TO),
121
121
  children: ({
122
122
  field: e,
123
123
  meta: a
124
- }) => /* @__PURE__ */ n("div", {
124
+ }) => /* @__PURE__ */ l("div", {
125
125
  className: p.datePicker,
126
- children: /* @__PURE__ */ n(H, {
126
+ children: /* @__PURE__ */ l(H, {
127
127
  ...e,
128
- ...$,
129
- calendarAriaLabel: l.formatMessage(i.selectEndDate),
130
- error: !G(P, x, _ !== s.TO) && a.error,
128
+ ...K,
129
+ calendarAriaLabel: i.formatMessage(c.selectEndDate),
130
+ error: !G(U, B, Y !== n.TO) && a.error,
131
131
  isDisabled: h,
132
- label: l.formatMessage(i.beforeDate),
133
- maxValue: z,
134
- minValue: ie,
135
- onBlur: () => j(s.TO),
136
- onChange: ne,
132
+ label: i.formatMessage(c.beforeDate),
133
+ maxValue: q,
134
+ minValue: ce,
135
+ onBlur: () => w(n.TO),
136
+ onChange: le,
137
137
  portalElement: M,
138
- value: D
138
+ value: g
139
139
  })
140
140
  })
141
141
  })]
142
- }) : /* @__PURE__ */ n(b, {
143
- name: u,
144
- validate: (e) => ae(e?.toString() || ""),
142
+ }) : /* @__PURE__ */ l(I, {
143
+ name: m,
144
+ validate: (e) => te(e?.toString() || ""),
145
145
  children: ({
146
146
  field: e,
147
147
  meta: a
148
- }) => /* @__PURE__ */ n("div", {
148
+ }) => /* @__PURE__ */ l("div", {
149
149
  className: p.daysInputContainer,
150
- children: /* @__PURE__ */ n(me, {
150
+ children: /* @__PURE__ */ l(fe, {
151
151
  ...e,
152
152
  disabled: h,
153
153
  error: a.touched && a.error,
154
154
  hideLabel: !0,
155
- label: l.formatMessage(i.relativeDaysSelectLabel),
156
- onChange: (c) => oe(c.target.value),
157
- placeholder: l.formatMessage(i.numberOfDays),
158
- value: f?.toString() || ""
155
+ label: i.formatMessage(c.relativeDaysSelectLabel),
156
+ onChange: (d) => se(d.target.value),
157
+ placeholder: i.formatMessage(c.numberOfDays),
158
+ value: v?.toString() || ""
159
159
  })
160
160
  })
161
161
  });
162
- return /* @__PURE__ */ n(ue, {
163
- locale: C,
162
+ return /* @__PURE__ */ l(me, {
163
+ locale: y,
164
164
  children: /* @__PURE__ */ W("div", {
165
165
  className: p.advancedDateContainer,
166
- "data-testid": `${I}-advanced-field`,
167
- children: [/* @__PURE__ */ n(Te, {
168
- advancedFilterFieldName: T,
166
+ "data-testid": `${_}-advanced-field`,
167
+ children: [/* @__PURE__ */ l(Oe, {
168
+ advancedFilterFieldName: O,
169
169
  disableForm: h,
170
- fieldAdvancedFilterOptions: N,
171
- fieldNamePrefix: d,
172
- filterOptionsMap: Y,
173
- isModified: ee,
174
- label: I,
175
- onAdvancedFilterOptionChange: g,
176
- onValueChange: re,
170
+ fieldAdvancedFilterOptions: C,
171
+ fieldNamePrefix: u,
172
+ filterOptionsMap: Z,
173
+ isModified: ae,
174
+ label: _,
175
+ onAdvancedFilterOptionChange: F,
176
+ onValueChange: oe,
177
177
  portalElement: M,
178
- showLabel: !Z,
179
- value: m
180
- }), de()]
178
+ showLabel: !ee,
179
+ value: f
180
+ }), ue()]
181
181
  })
182
182
  });
183
183
  };
184
184
  export {
185
- $e as MetadataDateFieldAdvanced,
186
- $e as default
185
+ Ke as MetadataDateFieldAdvanced,
186
+ Ke as default
187
187
  };
@@ -1,15 +1,16 @@
1
1
  import { R as l } from "../../../../../../chunks/types.js";
2
2
  import { createFieldValue as i } from "./utils.js";
3
- const d = (n, o, a) => (t, e, r, s) => {
4
- a?.(t), o?.(n, t);
5
- const V = i(t === "isBlank" || t === "isNotBlank" ? "" : e, t === "isBlank" || t === "isNotBlank" ? "" : r, t, !0);
6
- s.setFieldValue(n, V);
7
- }, k = (n, o, a, t) => (e, r, s) => {
8
- a(t);
9
- const c = i(t === l.FROM ? e : r, t === l.TO ? e : r, o, !0);
10
- s.setFieldValue(n, c);
3
+ const F = (e, a, s) => (t, n, o, c) => {
4
+ const r = t;
5
+ s?.(r), a?.(e, r);
6
+ const V = i(t === "isBlank" || t === "isNotBlank" ? "" : n, t === "isBlank" || t === "isNotBlank" ? "" : o, t, !0);
7
+ c.setFieldValue(e, V);
8
+ }, k = (e, a, s, t) => (n, o, c) => {
9
+ s(t);
10
+ const r = i(t === l.FROM ? n : o, t === l.TO ? n : o, a, !0);
11
+ c.setFieldValue(e, r);
11
12
  };
12
13
  export {
13
- d as createAdvancedFilterOptionHandler,
14
+ F as createAdvancedFilterOptionHandler,
14
15
  k as createInputChangeHandler
15
16
  };
@@ -3,68 +3,68 @@ import { Field as k } from "formik";
3
3
  import { useState as S, useCallback as F } from "react";
4
4
  import { useIntl as G } from "react-intl";
5
5
  import u from "../../../../messages.js";
6
- import { R as d } from "../../../../../../chunks/types.js";
6
+ import { R as d, F as K } from "../../../../../../chunks/types.js";
7
7
  import { fieldDefaultProps as b } from "../constants.js";
8
- import { createAdvancedFilterOptionHandler as Q, createInputChangeHandler as V } from "./handlers.js";
8
+ import { createAdvancedFilterOptionHandler as Q, createInputChangeHandler as y } from "./handlers.js";
9
9
  import { s as c } from "../../../../../../chunks/metadata-float-field.module.js";
10
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";
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
14
  const ie = ({
15
15
  label: m,
16
16
  fieldNamePrefix: C,
17
17
  disableForm: p,
18
18
  onAdvancedFilterOptionChange: h,
19
19
  fieldAdvancedFilterOptions: O,
20
- filterOptionsMap: E,
21
- hasAccordion: R,
22
- isModified: w
20
+ filterOptionsMap: R,
21
+ hasAccordion: w,
22
+ isModified: x
23
23
  }) => {
24
- const s = G(), o = `${C}.value.enum[0]`, [x, L] = S(d.FROM), [l, M] = S(O || q.EQUALS), {
24
+ const l = G(), o = `${C}.value.enum[0]`, [A, T] = S(d.FROM), [s, L] = S(O || K.EQUALS), {
25
25
  validateFloats: f
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
+ } = 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
27
  return /* @__PURE__ */ n("div", {
28
28
  className: c.advancedFilterContainer,
29
29
  "data-testid": `${m}-field`,
30
30
  children: /* @__PURE__ */ n(k, {
31
31
  name: o,
32
- validate: (a) => {
33
- const t = y(a, !0);
34
- return f(t.from, t.to, x, !0);
32
+ validate: (r) => {
33
+ const t = V(r, !0);
34
+ return f(t.from, t.to, A, !0);
35
35
  },
36
36
  children: ({
37
- field: a,
37
+ field: r,
38
38
  meta: t,
39
- form: r
39
+ form: a
40
40
  }) => {
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, {
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
44
  disableForm: p,
45
45
  fieldAdvancedFilterOptions: O,
46
46
  fieldNamePrefix: C,
47
- filterOptionsMap: E,
48
- isModified: w,
47
+ filterOptionsMap: R,
48
+ isModified: x,
49
49
  label: m,
50
50
  onAdvancedFilterOptionChange: h,
51
- onValueChange: (i) => D(i, e.from, e.to, r),
52
- showLabel: !R,
53
- value: l
54
- }), j && /* @__PURE__ */ A("div", {
51
+ onValueChange: (i) => D(i, e.from, e.to, a),
52
+ showLabel: !w,
53
+ value: s
54
+ }), j && /* @__PURE__ */ E("div", {
55
55
  className: c.rangeInputsContainer,
56
- children: [(T || v) && /* @__PURE__ */ n("div", {
56
+ children: [(M || v) && /* @__PURE__ */ n("div", {
57
57
  className: c.inputContainer,
58
58
  children: /* @__PURE__ */ n(N, {
59
59
  ...b,
60
60
  disabled: p,
61
- error: T ? t.error : B,
61
+ error: M ? t.error : B,
62
62
  hideLabel: !0,
63
- label: s.formatMessage(u.fieldFromLabel, {
63
+ label: l.formatMessage(u.fieldFromLabel, {
64
64
  label: m
65
65
  }),
66
- onChange: (i) => H(i.currentTarget.value, e.to, r),
67
- placeholder: v ? s.formatMessage(u.minValuePlaceholder) : s.formatMessage(u.enterNumberPlaceholder),
66
+ onChange: (i) => H(i.currentTarget.value, e.to, a),
67
+ placeholder: v ? l.formatMessage(u.minValuePlaceholder) : l.formatMessage(u.enterNumberPlaceholder),
68
68
  value: e.from
69
69
  })
70
70
  }), v && /* @__PURE__ */ n("div", {
@@ -74,11 +74,11 @@ const ie = ({
74
74
  disabled: p,
75
75
  error: $,
76
76
  hideLabel: !0,
77
- label: s.formatMessage(u.fieldToLabel, {
77
+ label: l.formatMessage(u.fieldToLabel, {
78
78
  label: m
79
79
  }),
80
- onChange: (i) => P(i.currentTarget.value, e.from, r),
81
- placeholder: s.formatMessage(u.maxValuePlaceholder),
80
+ onChange: (i) => P(i.currentTarget.value, e.from, a),
81
+ placeholder: l.formatMessage(u.maxValuePlaceholder),
82
82
  value: e.to
83
83
  })
84
84
  })]