@box/metadata-view 1.25.0 → 1.25.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.
|
@@ -1,53 +1,58 @@
|
|
|
1
|
-
import { FilterChip as
|
|
2
|
-
import { Formik as
|
|
3
|
-
import { useRef as
|
|
4
|
-
import
|
|
5
|
-
import { getInitialFieldValues as
|
|
1
|
+
import { FilterChip as h } from "@box/blueprint-web";
|
|
2
|
+
import { Formik as F, Form as C } from "formik";
|
|
3
|
+
import { useMemo as R, useRef as y } from "react";
|
|
4
|
+
import G from "./all-filters-chip.js";
|
|
5
|
+
import { getInitialFieldValues as j } from "./initial-field-values.js";
|
|
6
6
|
import { MetadataFilterChip as x } from "./metadata-filter-chip.js";
|
|
7
|
-
import { usePredefinedFilter as
|
|
7
|
+
import { usePredefinedFilter as M } from "./predefinedFilters/use-predefined-filter.js";
|
|
8
8
|
import { s as b } from "../../../../chunks/filter-row.module.js";
|
|
9
|
-
import { jsx as
|
|
9
|
+
import { jsx as i, jsxs as w } from "react/jsx-runtime";
|
|
10
10
|
import "./form-filter-chip.js";
|
|
11
11
|
import "./select-filter-chip.js";
|
|
12
12
|
import "./predefinedFilters/index.js";
|
|
13
|
-
const
|
|
14
|
-
predefinedFilterOptions:
|
|
13
|
+
const T = ({
|
|
14
|
+
predefinedFilterOptions: p,
|
|
15
15
|
containerRef: s,
|
|
16
|
-
filterGroups:
|
|
17
|
-
initialFilterValues:
|
|
18
|
-
isAllFiltersDisabled:
|
|
19
|
-
onFilterSubmit:
|
|
16
|
+
filterGroups: a = [],
|
|
17
|
+
initialFilterValues: t,
|
|
18
|
+
isAllFiltersDisabled: f,
|
|
19
|
+
onFilterSubmit: o
|
|
20
20
|
}) => {
|
|
21
|
-
const
|
|
21
|
+
const n = M(p), d = ({
|
|
22
22
|
metadata: {
|
|
23
|
-
fields:
|
|
23
|
+
fields: e
|
|
24
24
|
}
|
|
25
25
|
}) => {
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
filters:
|
|
29
|
-
}) =>
|
|
30
|
-
|
|
26
|
+
o && o(e);
|
|
27
|
+
}, l = [...n, ...a], r = l.flatMap(({
|
|
28
|
+
filters: e
|
|
29
|
+
}) => e), u = r.map((e) => `${e.id}:${e.fieldType}`).join("|"), c = R(
|
|
30
|
+
() => j(r, t),
|
|
31
|
+
// Intentionally depend on filterSchemaKey (not filterOptions identity) to prevent unwanted reinitialization
|
|
32
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps -- depend on schema key instead of filterOptions identity
|
|
33
|
+
[u, t]
|
|
34
|
+
), m = y(null);
|
|
35
|
+
return /* @__PURE__ */ i(F, {
|
|
31
36
|
enableReinitialize: !0,
|
|
32
|
-
initialValues:
|
|
33
|
-
onSubmit:
|
|
34
|
-
children: /* @__PURE__ */
|
|
35
|
-
ref:
|
|
36
|
-
children: /* @__PURE__ */
|
|
37
|
+
initialValues: c,
|
|
38
|
+
onSubmit: d,
|
|
39
|
+
children: /* @__PURE__ */ i(C, {
|
|
40
|
+
ref: m,
|
|
41
|
+
children: /* @__PURE__ */ w(h.Group, {
|
|
37
42
|
className: b.filterChipGroup,
|
|
38
43
|
name: "metadata-view-filters",
|
|
39
44
|
type: "multiple",
|
|
40
|
-
children: [
|
|
45
|
+
children: [f ? null : /* @__PURE__ */ i(G, {
|
|
41
46
|
containerRef: s,
|
|
42
|
-
filterGroups:
|
|
43
|
-
}),
|
|
44
|
-
filterOption:
|
|
45
|
-
formRef:
|
|
46
|
-
},
|
|
47
|
+
filterGroups: l
|
|
48
|
+
}), r.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ i(x, {
|
|
49
|
+
filterOption: e,
|
|
50
|
+
formRef: m
|
|
51
|
+
}, e.id))]
|
|
47
52
|
})
|
|
48
53
|
})
|
|
49
54
|
});
|
|
50
55
|
};
|
|
51
56
|
export {
|
|
52
|
-
|
|
57
|
+
T as FilterRow
|
|
53
58
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@box/blueprint-web": "^12.76.2",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"react-intl": "^6.4.2"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@box/blueprint-web": "^12.103.
|
|
22
|
-
"@box/blueprint-web-assets": "^4.
|
|
23
|
-
"@box/box-item-type-selector": "^1.14.
|
|
21
|
+
"@box/blueprint-web": "^12.103.1",
|
|
22
|
+
"@box/blueprint-web-assets": "^4.86.0",
|
|
23
|
+
"@box/box-item-type-selector": "^1.14.3",
|
|
24
24
|
"@box/eslint-plugin-blueprint": "1.0.5",
|
|
25
|
-
"@box/item-icon": "^2.5.
|
|
26
|
-
"@box/metadata-filter": "^1.52.
|
|
27
|
-
"@box/storybook-utils": "0.14.
|
|
25
|
+
"@box/item-icon": "^2.5.3",
|
|
26
|
+
"@box/metadata-filter": "^1.52.3",
|
|
27
|
+
"@box/storybook-utils": "0.14.23",
|
|
28
28
|
"@box/types": "2.0.0",
|
|
29
29
|
"@tanstack/react-virtual": "^3.10.8",
|
|
30
30
|
"react-intl": "^6.4.2"
|