@box/metadata-filter 1.78.10 → 1.79.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.
- package/dist/chunks/metadata-float-field-advanced.js +98 -0
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.js +56 -52
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field-advanced.js +15 -92
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.js +64 -57
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.js +72 -73
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.js +32 -24
- package/dist/esm/lib/components/metadata-filter-fields/filter-field-types.js +3 -1
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-advanced.d.ts +2 -2
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field-relative.d.ts +2 -2
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-date-field/metadata-date-field.d.ts +3 -3
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-float-field/metadata-float-field.d.ts +1 -1
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field-advanced.d.ts +1 -1
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-multi-select-field/metadata-multi-select-field.d.ts +1 -1
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-string-field/metadata-string-field.d.ts +1 -1
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field-advanced.d.ts +2 -2
- package/dist/types/lib/components/metadata-filter-fields/components/metadata-taxonomy-field/metadata-taxonomy-field.d.ts +2 -2
- package/dist/types/lib/components/metadata-filter-fields/types.d.ts +8 -2
- package/dist/types/lib/types.d.ts +1 -0
- package/package.json +1 -1
- package/dist/chunks/metadata-float-field.module.js +0 -9
- /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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
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
|
|
15
|
-
const
|
|
15
|
+
import { jsx as r, jsxs as _ } from "react/jsx-runtime";
|
|
16
|
+
const De = ({
|
|
16
17
|
canUseRelativeDates: M,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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:
|
|
25
|
-
disableForm:
|
|
28
|
+
direction: h = "horizontal",
|
|
29
|
+
disableForm: i,
|
|
26
30
|
fieldNamePrefix: d,
|
|
27
|
-
label:
|
|
31
|
+
label: p,
|
|
28
32
|
locale: T,
|
|
29
33
|
portalElement: O,
|
|
30
34
|
hasAccordion: w
|
|
31
35
|
}) => {
|
|
32
|
-
const [L,
|
|
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
|
-
} =
|
|
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
|
|
49
|
-
|
|
52
|
+
const t = $(e, a.FROM);
|
|
53
|
+
g.current = e, R(m, t), F(a.FROM);
|
|
50
54
|
}, H = (e) => {
|
|
51
|
-
const
|
|
52
|
-
|
|
55
|
+
const t = $(e, a.TO);
|
|
56
|
+
D.current = e, R(c, t), F(a.TO);
|
|
53
57
|
}, k = (e) => {
|
|
54
|
-
const
|
|
55
|
-
j(
|
|
56
|
-
}, U = E(() => B(f, I), [f]), q = E(() => B(u), [u]), x = (e,
|
|
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:
|
|
59
|
-
"data-testid": `${
|
|
60
|
-
children: [!w && /* @__PURE__ */
|
|
62
|
+
className: l.container,
|
|
63
|
+
"data-testid": `${p}-field`,
|
|
64
|
+
children: [!w && /* @__PURE__ */ r(J, {
|
|
61
65
|
as: "span",
|
|
62
|
-
className:
|
|
66
|
+
className: l.rangeFieldLabel,
|
|
63
67
|
color: "textOnLightSecondary",
|
|
64
68
|
variant: "bodyDefaultBold",
|
|
65
|
-
children:
|
|
66
|
-
}), /* @__PURE__ */
|
|
69
|
+
children: p
|
|
70
|
+
}), /* @__PURE__ */ r(K, {
|
|
67
71
|
locale: T,
|
|
68
72
|
children: /* @__PURE__ */ _("div", {
|
|
69
|
-
className: `${
|
|
70
|
-
children: [/* @__PURE__ */
|
|
73
|
+
className: `${l.rangeInputsContainer} ${h === "vertical" ? l.verticalLayout : ""}`,
|
|
74
|
+
children: [/* @__PURE__ */ r(P, {
|
|
71
75
|
name: m,
|
|
72
|
-
validate: (e) => V(
|
|
76
|
+
validate: (e) => V(g.current, D.current, a.FROM),
|
|
73
77
|
children: ({
|
|
74
78
|
field: e,
|
|
75
|
-
meta:
|
|
76
|
-
}) => /* @__PURE__ */
|
|
77
|
-
className:
|
|
78
|
-
children: /* @__PURE__ */
|
|
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 :
|
|
84
|
-
isDisabled:
|
|
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: (
|
|
92
|
+
onChange: (s) => z(s),
|
|
89
93
|
portalElement: O,
|
|
90
94
|
value: u
|
|
91
95
|
})
|
|
92
96
|
})
|
|
93
|
-
}), /* @__PURE__ */
|
|
97
|
+
}), /* @__PURE__ */ r(P, {
|
|
94
98
|
name: c,
|
|
95
|
-
validate: (e) => V(
|
|
99
|
+
validate: (e) => V(g.current, D.current, a.TO),
|
|
96
100
|
children: ({
|
|
97
101
|
field: e,
|
|
98
|
-
meta:
|
|
99
|
-
}) => /* @__PURE__ */
|
|
100
|
-
className:
|
|
101
|
-
children: /* @__PURE__ */
|
|
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 :
|
|
107
|
-
isDisabled:
|
|
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: (
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
127
|
+
De as MetadataDateField,
|
|
128
|
+
te as MetadataDateFieldNonRelative,
|
|
129
|
+
De as default
|
|
126
130
|
};
|
|
@@ -1,94 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
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
|
-
|
|
93
|
-
|
|
15
|
+
c as MetadataFloatFieldAdvanced,
|
|
16
|
+
n as default
|
|
94
17
|
};
|
|
@@ -1,93 +1,100 @@
|
|
|
1
|
-
import { Text as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useIntl as
|
|
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
|
|
6
|
+
import { R as t } from "../../../../../../chunks/types.js";
|
|
7
7
|
import { fieldDefaultProps as $ } from "../constants.js";
|
|
8
|
-
import { s as
|
|
9
|
-
import { u as
|
|
10
|
-
import {
|
|
11
|
-
const
|
|
12
|
-
label:
|
|
13
|
-
fieldNamePrefix:
|
|
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 =
|
|
18
|
-
values:
|
|
19
|
-
setFieldValue:
|
|
20
|
-
setFieldTouched:
|
|
21
|
-
} =
|
|
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:
|
|
24
|
-
toErrorType:
|
|
25
|
-
} =
|
|
26
|
-
u.current = e,
|
|
27
|
-
},
|
|
28
|
-
m.current = e,
|
|
29
|
-
},
|
|
30
|
-
|
|
31
|
-
},
|
|
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:
|
|
34
|
-
"data-testid": `${
|
|
35
|
-
children: [!L && /* @__PURE__ */
|
|
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:
|
|
39
|
+
children: o
|
|
40
40
|
}), /* @__PURE__ */ x("div", {
|
|
41
|
-
className:
|
|
42
|
-
children: [/* @__PURE__ */
|
|
43
|
-
name: `${
|
|
44
|
-
validate: () => T(u.current, m.current,
|
|
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:
|
|
48
|
-
}) => /* @__PURE__ */
|
|
49
|
-
className:
|
|
50
|
-
children: /* @__PURE__ */
|
|
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-${
|
|
53
|
+
"data-target-id": `TextInput-${a}_from`,
|
|
54
54
|
disabled: p,
|
|
55
|
-
error:
|
|
55
|
+
error: R(v, O, h !== t.FROM) ? void 0 : n.error,
|
|
56
56
|
label: f.formatMessage(V.fieldFromLabel, {
|
|
57
|
-
label:
|
|
57
|
+
label: o
|
|
58
58
|
}),
|
|
59
|
-
onBlur: () =>
|
|
60
|
-
onChange: (
|
|
59
|
+
onBlur: () => M(s, t.FROM),
|
|
60
|
+
onChange: (l) => j(l.currentTarget.value),
|
|
61
61
|
placeholder: "0"
|
|
62
62
|
})
|
|
63
63
|
})
|
|
64
|
-
}), /* @__PURE__ */
|
|
65
|
-
name: `${
|
|
66
|
-
validate: () => T(u.current, m.current,
|
|
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:
|
|
70
|
-
}) => /* @__PURE__ */
|
|
71
|
-
className:
|
|
72
|
-
children: /* @__PURE__ */
|
|
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-${
|
|
75
|
+
"data-target-id": `TextInput-${a}_to`,
|
|
76
76
|
disabled: p,
|
|
77
|
-
error:
|
|
77
|
+
error: R(O, v, h !== t.TO) ? void 0 : n.error,
|
|
78
78
|
label: f.formatMessage(V.fieldToLabel, {
|
|
79
|
-
label:
|
|
79
|
+
label: o
|
|
80
80
|
}),
|
|
81
|
-
onBlur: () =>
|
|
82
|
-
onChange: (
|
|
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
|
-
|
|
92
|
-
|
|
98
|
+
ee as MetadataFloatField,
|
|
99
|
+
ee as default
|
|
93
100
|
};
|
|
@@ -1,86 +1,85 @@
|
|
|
1
|
-
import { TooltipProvider as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { useMemo as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import { F as
|
|
7
|
-
import { fieldDefaultProps as
|
|
8
|
-
import { getInitialAdvancedFilterValue as
|
|
9
|
-
import { jsx as
|
|
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
|
|
12
|
-
label:
|
|
13
|
-
fieldNamePrefix:
|
|
14
|
-
disableForm:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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:
|
|
26
|
-
values:
|
|
27
|
-
} =
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
}, [
|
|
33
|
-
|
|
34
|
-
}, [
|
|
35
|
-
const t =
|
|
36
|
-
|
|
37
|
-
}, [
|
|
38
|
-
|
|
39
|
-
}, []),
|
|
40
|
-
|
|
41
|
-
}, []),
|
|
42
|
-
return /* @__PURE__ */
|
|
43
|
-
"data-testid": `${
|
|
44
|
-
children: /* @__PURE__ */
|
|
45
|
-
name:
|
|
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
|
|
51
|
-
return
|
|
52
|
-
children: [/* @__PURE__ */
|
|
53
|
-
disableForm:
|
|
54
|
-
fieldAdvancedFilterOptions:
|
|
55
|
-
fieldNamePrefix:
|
|
56
|
-
filterOptionsMap:
|
|
57
|
-
isModified:
|
|
58
|
-
label:
|
|
59
|
-
onAdvancedFilterOptionChange:
|
|
60
|
-
onOpenChange:
|
|
61
|
-
onValueChange:
|
|
62
|
-
open:
|
|
63
|
-
portalElement:
|
|
64
|
-
showLabel: !
|
|
65
|
-
value:
|
|
66
|
-
}), !
|
|
67
|
-
children: /* @__PURE__ */
|
|
68
|
-
...
|
|
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:
|
|
71
|
-
experimentalVirtualization:
|
|
72
|
-
filterFn:
|
|
69
|
+
disabled: d,
|
|
70
|
+
experimentalVirtualization: T,
|
|
71
|
+
filterFn: K,
|
|
73
72
|
hideLabel: !0,
|
|
74
|
-
label:
|
|
73
|
+
label: n,
|
|
75
74
|
multiselect: !0,
|
|
76
75
|
name: e.name,
|
|
77
|
-
onOpenChange:
|
|
78
|
-
onValueChange:
|
|
79
|
-
open:
|
|
80
|
-
options:
|
|
81
|
-
placeholder:
|
|
82
|
-
portalElement:
|
|
83
|
-
value:
|
|
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
|
-
|
|
91
|
+
de as MetadataMultiSelectFieldAdvanced
|
|
93
92
|
};
|
|
@@ -1,57 +1,65 @@
|
|
|
1
|
-
import { TooltipProvider as
|
|
2
|
-
import { useFormikContext as
|
|
3
|
-
import { useMemo as $, useCallback as
|
|
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
|
|
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
|
|
9
|
-
disableForm:
|
|
9
|
+
const w = ({
|
|
10
|
+
disableForm: a,
|
|
10
11
|
fieldNamePrefix: t,
|
|
11
12
|
label: r,
|
|
12
|
-
portalElement:
|
|
13
|
-
hasAccordion:
|
|
13
|
+
portalElement: d,
|
|
14
|
+
hasAccordion: u,
|
|
14
15
|
hasExperimentalVirtualization: c
|
|
15
16
|
}) => {
|
|
16
17
|
const {
|
|
17
|
-
setFieldValue:
|
|
18
|
+
setFieldValue: i,
|
|
18
19
|
values: s
|
|
19
|
-
} =
|
|
20
|
+
} = f(), m = x(), l = `${t}.value.enum`, p = $(() => b(s, `${t}.options`, []).map(({
|
|
20
21
|
key: e
|
|
21
|
-
}) => e), [s, t]), h =
|
|
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 ?
|
|
25
|
-
), [
|
|
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:
|
|
30
|
+
name: l,
|
|
30
31
|
children: ({
|
|
31
32
|
field: e
|
|
32
|
-
}) => /* @__PURE__ */ o(
|
|
33
|
-
children: /* @__PURE__ */ o(
|
|
34
|
-
...
|
|
33
|
+
}) => /* @__PURE__ */ o(F, {
|
|
34
|
+
children: /* @__PURE__ */ o(M, {
|
|
35
|
+
...S,
|
|
35
36
|
as: "input",
|
|
36
37
|
"data-target-id": `Combobox-${t}`,
|
|
37
|
-
disabled:
|
|
38
|
+
disabled: a,
|
|
38
39
|
filterFn: h,
|
|
39
|
-
hideLabel:
|
|
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:
|
|
47
|
-
portalElement:
|
|
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
|
-
|
|
56
|
-
|
|
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 {
|
|
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 {
|
|
2
|
-
export declare const MetadataDateFieldAdvanced: ({ disableForm, fieldNamePrefix, label, locale, portalElement, filterOptionsMap, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, hasAccordion, isModified, }:
|
|
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 {
|
|
2
|
-
export declare const MetadataDateFieldRelative: ({ customDateFilterOptions, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }:
|
|
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 {
|
|
2
|
-
export declare const MetadataDateField: ({ canUseRelativeDates, ...props }:
|
|
3
|
-
export declare const MetadataDateFieldNonRelative: ({ customFieldLabels, direction, disableForm, fieldNamePrefix, label, locale, portalElement, hasAccordion, }:
|
|
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: ({
|
|
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,
|
|
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: ({
|
|
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, }:
|
|
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 {
|
|
2
|
-
export declare const MetadataTaxonomyFieldAdvanced: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, isAdvancedFilterEnabled, onAdvancedFilterOptionChange, fieldAdvancedFilterOptions, filterOptionsMap, isModified, }:
|
|
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 {
|
|
2
|
-
export declare const MetadataTaxonomyField: ({ className, disableForm, fieldNamePrefix, label, portalElement, taxonomyOptionsFetcher, isMultilevelTaxonomyFieldEnabled, hasAccordion, }:
|
|
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,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
|
-
};
|
|
File without changes
|