@box/metadata-filter 1.81.2 → 1.81.4

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