@box/metadata-filter 2.0.0 → 2.1.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.
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/utils.js +21 -21
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-multi-select-field/utils.js +2 -2
- package/dist/esm/lib/components/metadata-filter-fields/components/metadata-string-field/utils.js +1 -1
- package/package.json +7 -7
package/dist/esm/lib/components/metadata-filter-fields/components/metadata-float-field/utils.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
var e = /* @__PURE__ */ function(e) {
|
|
2
2
|
return e.EQUALS = "equals", e.IS_NOT = "isNot", e.GREATER_THAN = "greaterThanOrEqual", e.LESS_THAN = "lessThanOrEqual", e.BETWEEN = "between", e.IS_BLANK = "isBlank", e.IS_NOT_BLANK = "isNotBlank", e;
|
|
3
|
-
}({}), t = (
|
|
3
|
+
}({}), t = (e, t) => e && t?.some(([t]) => t === e) ? e : "equals", n = /* @__PURE__ */ function(e) {
|
|
4
4
|
return e.BOTH = "both", e.SINGLE = "single", e.NONE = "none", e;
|
|
5
|
-
}({}), r = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
].includes(
|
|
5
|
+
}({}), r = (e) => e === "isBlank" || e === "isNotBlank" ? "none" : e === "between" ? "both" : [
|
|
6
|
+
"equals",
|
|
7
|
+
"isNot",
|
|
8
|
+
"greaterThanOrEqual",
|
|
9
|
+
"lessThanOrEqual"
|
|
10
|
+
].includes(e) ? "single" : "none", i = (e) => e.lt && !e.gt ? {
|
|
11
11
|
from: e.lt,
|
|
12
12
|
to: ""
|
|
13
13
|
} : {
|
|
14
14
|
from: e.gt || "",
|
|
15
15
|
to: e.lt || ""
|
|
16
|
-
}, a = (
|
|
17
|
-
from:
|
|
16
|
+
}, a = (e) => e.advancedFilterOption === "lessThanOrEqual" ? {
|
|
17
|
+
from: e.value?.range?.lt || "",
|
|
18
18
|
to: ""
|
|
19
19
|
} : {
|
|
20
|
-
from:
|
|
21
|
-
to:
|
|
20
|
+
from: e.value?.range?.gt || "",
|
|
21
|
+
to: e.value?.range?.lt || ""
|
|
22
22
|
}, o = (e) => typeof e == "object" && !!e, s = (e) => o(e) && "advancedFilterOption" in e && "value" in e && typeof e.advancedFilterOption == "string", c = (e, t) => {
|
|
23
23
|
if (!o(e)) return {
|
|
24
24
|
from: "",
|
|
@@ -29,19 +29,19 @@ var e = /* @__PURE__ */ function(e) {
|
|
|
29
29
|
from: "",
|
|
30
30
|
to: ""
|
|
31
31
|
};
|
|
32
|
-
}, l = (t, n, r
|
|
33
|
-
if (
|
|
34
|
-
if (
|
|
32
|
+
}, l = (e, t, n, r) => {
|
|
33
|
+
if (r) {
|
|
34
|
+
if (n === "isBlank" || n === "isNotBlank") return {
|
|
35
35
|
value: { range: {} },
|
|
36
|
-
advancedFilterOption:
|
|
36
|
+
advancedFilterOption: n
|
|
37
37
|
};
|
|
38
|
-
let
|
|
39
|
-
return
|
|
40
|
-
value: { range:
|
|
41
|
-
advancedFilterOption:
|
|
38
|
+
let r = {};
|
|
39
|
+
return e && (n === "lessThanOrEqual" ? r.lt = e : r.gt = e), t && n === "between" && (r.lt = t), {
|
|
40
|
+
value: { range: r },
|
|
41
|
+
advancedFilterOption: n
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
let
|
|
45
|
-
return
|
|
44
|
+
let i = {};
|
|
45
|
+
return e && (i.gt = e), t && (i.lt = t), { range: i };
|
|
46
46
|
};
|
|
47
47
|
export { e as FloatAdvancedFilterOption, n as FloatInputDisplayState, l as createFieldValue, t as getInitialAdvancedFilterValue, r as getInputDisplayState, c as getInputValues };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var e = /* @__PURE__ */ function(e) {
|
|
2
2
|
return e.MATCH_ANY = "matchAny", e.MATCH_ALL = "matchAll", e.IS_BLANK = "isBlank", e.IS_NOT_BLANK = "isNotBlank", e;
|
|
3
|
-
}({}), t = (
|
|
3
|
+
}({}), t = (e, t) => e && t?.some(([t]) => t === e) ? e : "matchAny", n = (e, t) => {
|
|
4
4
|
if (Array.isArray(e)) return e.filter((e) => e !== "");
|
|
5
5
|
if (t && typeof e == "object" && e) return (e.value || []).filter((e) => e !== "");
|
|
6
6
|
let n = e || [];
|
|
@@ -8,5 +8,5 @@ var e = /* @__PURE__ */ function(e) {
|
|
|
8
8
|
}, r = (e, t, n) => n ? {
|
|
9
9
|
value: i(t) ? [] : e,
|
|
10
10
|
advancedFilterOption: t
|
|
11
|
-
} : e, i = (
|
|
11
|
+
} : e, i = (e) => e === "isBlank" || e === "isNotBlank";
|
|
12
12
|
export { e as MultiSelectAdvancedFilterOption, r as createFieldValue, t as getInitialAdvancedFilterValue, n as getInputValue };
|
package/dist/esm/lib/components/metadata-filter-fields/components/metadata-string-field/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var e = /* @__PURE__ */ function(e) {
|
|
2
2
|
return e.MATCH_EXACTLY = "matchExactly", e.STARTS_WITH = "startsWith", e.CONTAINS = "contains", e.DOES_NOT_CONTAIN = "doesNotContain", e.IS_NOT = "isNot", e.IS_BLANK = "isBlank", e.IS_NOT_BLANK = "isNotBlank", e;
|
|
3
|
-
}({}), t = (
|
|
3
|
+
}({}), t = (e, t) => e && t?.some(([t]) => t === e) ? e : "matchExactly", n = (e) => e === "isBlank" || e === "isNotBlank", r = (e, t) => t && typeof e == "object" && e ? e.value || "" : e || "", i = (e, t, r) => r ? {
|
|
4
4
|
value: n(t) ? "" : e,
|
|
5
5
|
advancedFilterOption: t
|
|
6
6
|
} : e, a = (e, t) => e && n(t);
|
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-filter",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@box/blueprint-web": "^16.
|
|
6
|
-
"@box/blueprint-web-assets": "^5.
|
|
7
|
-
"@box/combobox-with-api": "^2.
|
|
5
|
+
"@box/blueprint-web": "^16.1.1",
|
|
6
|
+
"@box/blueprint-web-assets": "^5.1.1",
|
|
7
|
+
"@box/combobox-with-api": "^2.1.2",
|
|
8
8
|
"formik": "^2.0.3",
|
|
9
9
|
"react": "^17.0.0 || ^18.0.0",
|
|
10
10
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
11
11
|
"react-intl": "6.4.2"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@box/blueprint-web": "^16.
|
|
15
|
-
"@box/blueprint-web-assets": "^5.
|
|
16
|
-
"@box/storybook-utils": "^1.
|
|
14
|
+
"@box/blueprint-web": "^16.1.1",
|
|
15
|
+
"@box/blueprint-web-assets": "^5.1.1",
|
|
16
|
+
"@box/storybook-utils": "^1.1.1",
|
|
17
17
|
"react": "^18.3.0",
|
|
18
18
|
"react-dom": "^18.3.0",
|
|
19
19
|
"react-intl": "6.4.2"
|