@box/metadata-view 0.21.1 → 0.23.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/esm/lib/components/action-bar/action-bar.js +37 -29
- package/dist/esm/lib/components/action-bar/sort-dropdown.js +33 -0
- package/dist/esm/lib/components/filter-row/all-filters-chip.js +36 -29
- package/dist/esm/lib/components/filter-row/filter-row.js +41 -52
- package/dist/esm/lib/components/filter-row/initial-field-values.js +21 -0
- package/dist/esm/lib/components/filter-row/messages.js +6 -2
- package/dist/esm/lib/components/filter-row/use-predefined-filter.js +23 -0
- package/dist/esm/lib/components/filter-sidepanel/filter-sidepanel.js +58 -30
- package/dist/esm/lib/components/filter-sidepanel/filter.js +38 -0
- package/dist/esm/lib/components/metadata-search-field/messages.js +14 -0
- package/dist/esm/lib/components/metadata-search-field/metadata-search-field.js +30 -0
- package/dist/esm/lib/metadata-view.js +48 -46
- package/dist/i18n/bn-IN.js +4 -1
- package/dist/i18n/da-DK.js +4 -1
- package/dist/i18n/de-DE.js +4 -1
- package/dist/i18n/en-AU.js +4 -1
- package/dist/i18n/en-CA.js +4 -1
- package/dist/i18n/en-GB.js +4 -1
- package/dist/i18n/en-US.js +4 -1
- package/dist/i18n/en-US.properties +6 -0
- package/dist/i18n/en-x-pseudo.js +4 -1
- package/dist/i18n/es-419.js +4 -1
- package/dist/i18n/es-ES.js +4 -1
- package/dist/i18n/fi-FI.js +4 -1
- package/dist/i18n/fr-CA.js +4 -1
- package/dist/i18n/fr-FR.js +4 -1
- package/dist/i18n/hi-IN.js +4 -1
- package/dist/i18n/it-IT.js +4 -1
- package/dist/i18n/ja-JP.js +4 -1
- package/dist/i18n/json/src/lib/components/filter-row/messages.json +1 -1
- package/dist/i18n/json/src/lib/components/metadata-search-field/messages.json +1 -0
- package/dist/i18n/ko-KR.js +4 -1
- package/dist/i18n/nb-NO.js +4 -1
- package/dist/i18n/nl-NL.js +4 -1
- package/dist/i18n/pl-PL.js +4 -1
- package/dist/i18n/pt-BR.js +4 -1
- package/dist/i18n/ru-RU.js +4 -1
- package/dist/i18n/sv-SE.js +4 -1
- package/dist/i18n/tr-TR.js +4 -1
- package/dist/i18n/zh-CN.js +4 -1
- package/dist/i18n/zh-TW.js +4 -1
- package/dist/styles/action-bar.css +1 -1
- package/dist/types/lib/components/action-bar/action-bar.d.ts +4 -1
- package/dist/types/lib/components/action-bar/sort-dropdown.d.ts +8 -0
- package/dist/types/lib/components/filter-row/all-filters-chip.d.ts +3 -1
- package/dist/types/lib/components/filter-row/filter-row.d.ts +4 -3
- package/dist/types/lib/components/filter-row/initial-field-values.d.ts +9 -0
- package/dist/types/lib/components/filter-row/messages.d.ts +5 -0
- package/dist/types/lib/components/filter-row/types.d.ts +14 -5
- package/dist/types/lib/components/filter-row/use-predefined-filter.d.ts +2 -0
- package/dist/types/lib/components/filter-sidepanel/filter-sidepanel.d.ts +4 -2
- package/dist/types/lib/components/filter-sidepanel/filter.d.ts +3 -0
- package/dist/types/lib/components/metadata-search-field/messages.d.ts +13 -0
- package/dist/types/lib/components/metadata-search-field/metadata-search-field.d.ts +7 -0
- package/dist/types/lib/metadata-view.d.ts +4 -3
- package/dist/types/lib/test-utils/mock-data.d.ts +30 -4
- package/dist/types/lib/types.d.ts +1 -1
- package/package.json +4 -3
|
@@ -1,37 +1,45 @@
|
|
|
1
|
-
import { Button as
|
|
2
|
-
import { Grid as
|
|
3
|
-
import { useIntl as
|
|
4
|
-
import { V as
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { Button as l } from "@box/blueprint-web";
|
|
2
|
+
import { Grid as p } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { useIntl as f } from "react-intl";
|
|
4
|
+
import { V as r } from "../../../../chunks/types.js";
|
|
5
|
+
import n from "./messages.js";
|
|
6
|
+
import { SortDropdown as h } from "./sort-dropdown.js";
|
|
7
|
+
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
8
|
+
import { FilterRow as B } from "../filter-row/filter-row.js";
|
|
9
|
+
import '../../../../styles/action-bar.css';const _ = "_actionBar_1bpah_1", w = "_additionalActions_1bpah_6", c = {
|
|
10
|
+
actionBar: _,
|
|
11
|
+
additionalActions: w
|
|
12
|
+
}, I = ({
|
|
13
|
+
onViewModeClick: m,
|
|
14
|
+
viewMode: o,
|
|
15
|
+
sortableColumnNames: e,
|
|
16
|
+
sortDropdownProps: t,
|
|
17
|
+
...d
|
|
14
18
|
}) => {
|
|
15
19
|
const {
|
|
16
|
-
formatMessage:
|
|
17
|
-
} =
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
className:
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
children: /* @__PURE__ */
|
|
22
|
-
...
|
|
23
|
-
})
|
|
24
|
-
}), /* @__PURE__ */ r("div", {
|
|
25
|
-
children: /* @__PURE__ */ r(n, {
|
|
26
|
-
"aria-label": i === t.GRID ? o(a.switchToListView) : o(a.switchToGridView),
|
|
27
|
-
icon: m,
|
|
28
|
-
onClick: s,
|
|
29
|
-
variant: i === t.GRID ? "primary" : "tertiary"
|
|
20
|
+
formatMessage: a
|
|
21
|
+
} = f();
|
|
22
|
+
return /* @__PURE__ */ s("div", {
|
|
23
|
+
className: c.actionBar,
|
|
24
|
+
children: [/* @__PURE__ */ i("div", {
|
|
25
|
+
children: /* @__PURE__ */ i(B, {
|
|
26
|
+
...d
|
|
30
27
|
})
|
|
28
|
+
}), /* @__PURE__ */ s("div", {
|
|
29
|
+
className: c.additionalActions,
|
|
30
|
+
children: [t && /* @__PURE__ */ i(h, {
|
|
31
|
+
...t,
|
|
32
|
+
sortableColumnNames: e
|
|
33
|
+
}), /* @__PURE__ */ i(l, {
|
|
34
|
+
"aria-label": o === r.GRID ? a(n.switchToListView) : a(n.switchToGridView),
|
|
35
|
+
icon: p,
|
|
36
|
+
onClick: m,
|
|
37
|
+
variant: o === r.GRID ? "primary" : "tertiary"
|
|
38
|
+
})]
|
|
31
39
|
})]
|
|
32
40
|
});
|
|
33
41
|
};
|
|
34
42
|
export {
|
|
35
|
-
|
|
36
|
-
|
|
43
|
+
I as ActionBar,
|
|
44
|
+
I as default
|
|
37
45
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { DropdownMenu as r, TriggerButton as p } from "@box/blueprint-web";
|
|
2
|
+
import { ArrowUp as c, ArrowDown as l } from "@box/blueprint-web-assets/icons/Fill";
|
|
3
|
+
import { jsxs as s, jsx as o } from "react/jsx-runtime";
|
|
4
|
+
const w = ({
|
|
5
|
+
onSortChange: i,
|
|
6
|
+
sortableColumnNames: a,
|
|
7
|
+
sortByColumn: e,
|
|
8
|
+
sortDirection: d
|
|
9
|
+
}) => {
|
|
10
|
+
const n = d === "ascending" ? "up" : "down";
|
|
11
|
+
return /* @__PURE__ */ s(r.Root, {
|
|
12
|
+
children: [/* @__PURE__ */ o(r.Trigger, {
|
|
13
|
+
children: /* @__PURE__ */ o(p, {
|
|
14
|
+
caretDirection: n,
|
|
15
|
+
label: e,
|
|
16
|
+
startIcon: n === "up" ? c : l,
|
|
17
|
+
variant: "tertiary"
|
|
18
|
+
})
|
|
19
|
+
}), /* @__PURE__ */ o(r.Content, {
|
|
20
|
+
children: /* @__PURE__ */ o(r.RadioGroup, {
|
|
21
|
+
onValueChange: i,
|
|
22
|
+
value: e,
|
|
23
|
+
children: a.map((t) => /* @__PURE__ */ o(r.RadioSelectItem, {
|
|
24
|
+
value: t,
|
|
25
|
+
children: t
|
|
26
|
+
}, t))
|
|
27
|
+
})
|
|
28
|
+
})]
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
export {
|
|
32
|
+
w as SortDropdown
|
|
33
|
+
};
|
|
@@ -1,36 +1,43 @@
|
|
|
1
1
|
import { FilterChip as e } from "@box/blueprint-web";
|
|
2
|
-
import { Filter as
|
|
3
|
-
import { useState as
|
|
4
|
-
import { useIntl as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { Filter as m } from "@box/blueprint-web-assets/icons/Line";
|
|
3
|
+
import { useState as f } from "react";
|
|
4
|
+
import { useIntl as c } from "react-intl";
|
|
5
|
+
import d from "../filter-sidepanel/filter-sidepanel.js";
|
|
6
|
+
import { getInitialFieldValues as h } from "./initial-field-values.js";
|
|
7
|
+
import u from "./messages.js";
|
|
8
|
+
import { jsxs as o, Fragment as g, jsx as t } from "react/jsx-runtime";
|
|
9
|
+
const M = ({
|
|
10
|
+
activeFilterCount: i,
|
|
11
|
+
filterGroups: l
|
|
10
12
|
}) => {
|
|
11
13
|
const {
|
|
12
|
-
formatMessage:
|
|
13
|
-
} =
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
children: [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
14
|
+
formatMessage: s
|
|
15
|
+
} = c(), [n, r] = f(!1), a = () => r(!0);
|
|
16
|
+
return /* @__PURE__ */ o(g, {
|
|
17
|
+
children: [
|
|
18
|
+
// We need to initialize the sidepanel state at the moment it is opened
|
|
19
|
+
n && /* @__PURE__ */ t(d, {
|
|
20
|
+
filterGroups: l,
|
|
21
|
+
getInitialFormValues: () => h(l.flatMap(({
|
|
22
|
+
filters: p
|
|
23
|
+
}) => p)),
|
|
24
|
+
isOpen: n,
|
|
25
|
+
onIsOpenChange: r
|
|
26
|
+
}),
|
|
27
|
+
/* @__PURE__ */ o(e.ChipButton, {
|
|
28
|
+
onClick: a,
|
|
29
|
+
value: "all-filters-chip-btn",
|
|
30
|
+
children: [/* @__PURE__ */ t(e.Icon, {
|
|
31
|
+
icon: m
|
|
32
|
+
}), /* @__PURE__ */ t(e.Label, {
|
|
33
|
+
children: s(u.allFilters)
|
|
34
|
+
}), i > 0 ? /* @__PURE__ */ t(e.Status, {
|
|
35
|
+
children: i.toString()
|
|
36
|
+
}) : null]
|
|
37
|
+
})
|
|
38
|
+
]
|
|
32
39
|
});
|
|
33
40
|
};
|
|
34
41
|
export {
|
|
35
|
-
|
|
42
|
+
M as default
|
|
36
43
|
};
|
|
@@ -1,86 +1,75 @@
|
|
|
1
|
-
import { FilterChip as
|
|
2
|
-
import { Formik as
|
|
3
|
-
import { useState as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import { FilterChip as n } from "@box/blueprint-web";
|
|
2
|
+
import { Formik as C, Form as v } from "formik";
|
|
3
|
+
import { useState as I, useRef as b } from "react";
|
|
4
|
+
import w from "./all-filters-chip.js";
|
|
5
|
+
import { getInitialFieldValues as R } from "./initial-field-values.js";
|
|
6
|
+
import { StringFilterChip as j } from "./string-filter-chip.js";
|
|
7
|
+
import { usePredefinedFilter as x } from "./use-predefined-filter.js";
|
|
8
|
+
import { jsx as r, jsxs as p } from "react/jsx-runtime";
|
|
9
|
+
const G = (e, a, m) => {
|
|
8
10
|
const {
|
|
9
11
|
icon: i
|
|
10
12
|
} = e;
|
|
11
13
|
switch (e.fieldType) {
|
|
12
14
|
case "float":
|
|
13
15
|
case "string":
|
|
14
|
-
return /* @__PURE__ */ r(
|
|
15
|
-
formRef:
|
|
16
|
+
return /* @__PURE__ */ r(j, {
|
|
17
|
+
formRef: m,
|
|
16
18
|
icon: i,
|
|
17
19
|
id: e.id,
|
|
18
20
|
name: e.name,
|
|
19
|
-
selected:
|
|
21
|
+
selected: a
|
|
20
22
|
}, e.id);
|
|
21
23
|
case "date":
|
|
22
24
|
case "enum":
|
|
23
25
|
case "multiSelect":
|
|
24
|
-
return /* @__PURE__ */
|
|
26
|
+
return /* @__PURE__ */ p(n.Chip, {
|
|
25
27
|
value: e.id,
|
|
26
|
-
children: [i && /* @__PURE__ */ r(
|
|
28
|
+
children: [i && /* @__PURE__ */ r(n.Icon, {
|
|
27
29
|
icon: i
|
|
28
|
-
}), /* @__PURE__ */ r(
|
|
30
|
+
}), /* @__PURE__ */ r(n.Label, {
|
|
29
31
|
children: e.name
|
|
30
32
|
})]
|
|
31
33
|
}, e.id);
|
|
32
34
|
default:
|
|
33
35
|
return null;
|
|
34
36
|
}
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
}, _ = ({
|
|
38
|
+
disabledPredefinedFilters: e = [],
|
|
39
|
+
filterGroups: a,
|
|
40
|
+
isAllFiltersDisabled: m,
|
|
41
|
+
onFilterSubmit: i
|
|
39
42
|
}) => {
|
|
40
|
-
const [
|
|
41
|
-
var
|
|
42
|
-
return ((
|
|
43
|
-
},
|
|
43
|
+
const [o, h] = I([]), f = x(e), F = ([t, l]) => {
|
|
44
|
+
var s;
|
|
45
|
+
return ((s = l.value) == null ? void 0 : s.enum) && l.value.enum.length > 0;
|
|
46
|
+
}, S = ({
|
|
44
47
|
metadata: {
|
|
45
48
|
fields: t
|
|
46
49
|
}
|
|
47
50
|
}) => {
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
default:
|
|
60
|
-
l = null;
|
|
61
|
-
}
|
|
62
|
-
return t[a.id] = {
|
|
63
|
-
value: l
|
|
64
|
-
}, t;
|
|
65
|
-
}, {})
|
|
66
|
-
}
|
|
67
|
-
}, m = g(null);
|
|
68
|
-
return /* @__PURE__ */ r(p, {
|
|
69
|
-
initialValues: F,
|
|
70
|
-
onSubmit: h,
|
|
71
|
-
children: /* @__PURE__ */ r(f, {
|
|
72
|
-
ref: m,
|
|
73
|
-
children: /* @__PURE__ */ d(s.Group, {
|
|
51
|
+
const l = Object.entries(t).filter(F).map(([s]) => s);
|
|
52
|
+
h(l), i(t);
|
|
53
|
+
}, c = [...f, ...a], d = c.flatMap(({
|
|
54
|
+
filters: t
|
|
55
|
+
}) => t), g = R(d), u = b(null);
|
|
56
|
+
return /* @__PURE__ */ r(C, {
|
|
57
|
+
initialValues: g,
|
|
58
|
+
onSubmit: S,
|
|
59
|
+
children: /* @__PURE__ */ r(v, {
|
|
60
|
+
ref: u,
|
|
61
|
+
children: /* @__PURE__ */ p(n.Group, {
|
|
74
62
|
name: "metadata-view-filters",
|
|
75
63
|
type: "multiple",
|
|
76
|
-
children: [
|
|
77
|
-
activeFilterCount:
|
|
78
|
-
|
|
64
|
+
children: [m ? null : /* @__PURE__ */ r(w, {
|
|
65
|
+
activeFilterCount: o.length,
|
|
66
|
+
filterGroups: c
|
|
67
|
+
}), d.filter((t) => t.shouldRenderChip).map((t) => G(t, o.includes(t.id), u))]
|
|
79
68
|
})
|
|
80
69
|
})
|
|
81
70
|
});
|
|
82
71
|
};
|
|
83
72
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
73
|
+
_ as FilterRow,
|
|
74
|
+
_ as default
|
|
86
75
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const u = (i) => ({
|
|
2
|
+
metadata: {
|
|
3
|
+
fields: i.reduce((a, l) => {
|
|
4
|
+
let e;
|
|
5
|
+
switch (l.fieldType) {
|
|
6
|
+
case "string":
|
|
7
|
+
case "float":
|
|
8
|
+
e = [""];
|
|
9
|
+
break;
|
|
10
|
+
default:
|
|
11
|
+
e = null;
|
|
12
|
+
}
|
|
13
|
+
return a[l.id] = {
|
|
14
|
+
value: e
|
|
15
|
+
}, a;
|
|
16
|
+
}, {})
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
u as getInitialFieldValues
|
|
21
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineMessages as e } from "react-intl";
|
|
2
|
-
const
|
|
2
|
+
const t = e({
|
|
3
3
|
applyButton: {
|
|
4
4
|
id: "groupSharedFeatures.metadataView.filterRow.applyButton",
|
|
5
5
|
defaultMessage: "Apply"
|
|
@@ -15,8 +15,12 @@ const a = e({
|
|
|
15
15
|
allFilters: {
|
|
16
16
|
id: "groupSharedFeatures.metadataView.filterRow.AllFilters",
|
|
17
17
|
defaultMessage: "All Filters"
|
|
18
|
+
},
|
|
19
|
+
keywordSearchFilterPlaceholder: {
|
|
20
|
+
id: "groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder",
|
|
21
|
+
defaultMessage: "Enter keywords"
|
|
18
22
|
}
|
|
19
23
|
});
|
|
20
24
|
export {
|
|
21
|
-
|
|
25
|
+
t as default
|
|
22
26
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useIntl as l } from "react-intl";
|
|
2
|
+
import o from "./messages.js";
|
|
3
|
+
const a = {
|
|
4
|
+
fieldType: "string",
|
|
5
|
+
id: "keyword-filter",
|
|
6
|
+
name: "",
|
|
7
|
+
selected: !1,
|
|
8
|
+
variant: "search"
|
|
9
|
+
}, i = (r) => r.reduce((e, t) => (e[t] = !0, e), {}), c = (r) => {
|
|
10
|
+
const {
|
|
11
|
+
formatMessage: e
|
|
12
|
+
} = l(), t = i(r), s = [];
|
|
13
|
+
return t.keywordSearchFilterGroup || s.push({
|
|
14
|
+
filters: [{
|
|
15
|
+
...a,
|
|
16
|
+
placeholder: e(o.keywordSearchFilterPlaceholder)
|
|
17
|
+
}],
|
|
18
|
+
togglable: !1
|
|
19
|
+
}), s;
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
c as usePredefinedFilter
|
|
23
|
+
};
|
|
@@ -1,43 +1,71 @@
|
|
|
1
|
-
import { SidePanel as
|
|
2
|
-
import { useIntl as
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { SidePanel as t, Accordion as c } from "@box/blueprint-web";
|
|
2
|
+
import { useIntl as b } from "react-intl";
|
|
3
|
+
import { useFormikContext as y } from "formik";
|
|
4
|
+
import { useState as g } from "react";
|
|
5
|
+
import x from "./filter.js";
|
|
6
|
+
import o from "./messages.js";
|
|
7
|
+
import { jsx as e, jsxs as d } from "react/jsx-runtime";
|
|
8
|
+
const O = ({
|
|
9
|
+
filterGroups: n,
|
|
10
|
+
isOpen: u,
|
|
11
|
+
onIsOpenChange: i,
|
|
12
|
+
getInitialFormValues: h
|
|
9
13
|
}) => {
|
|
10
14
|
const {
|
|
11
|
-
formatMessage:
|
|
12
|
-
} =
|
|
15
|
+
formatMessage: r
|
|
16
|
+
} = b(), {
|
|
17
|
+
handleSubmit: p,
|
|
18
|
+
resetForm: s,
|
|
19
|
+
values: F
|
|
20
|
+
} = y(), [f] = g(F), C = () => {
|
|
21
|
+
s({
|
|
22
|
+
values: h()
|
|
23
|
+
});
|
|
24
|
+
}, v = (l) => {
|
|
25
|
+
s({
|
|
26
|
+
values: f
|
|
27
|
+
}), i(l);
|
|
28
|
+
}, S = () => {
|
|
29
|
+
p(), i(!1);
|
|
13
30
|
};
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
onOpenChange:
|
|
16
|
-
open:
|
|
31
|
+
return /* @__PURE__ */ e(t, {
|
|
32
|
+
onOpenChange: v,
|
|
33
|
+
open: u,
|
|
17
34
|
variant: "overlay",
|
|
18
|
-
children: /* @__PURE__ */
|
|
19
|
-
children: /* @__PURE__ */
|
|
20
|
-
children: [/* @__PURE__ */
|
|
21
|
-
children: o
|
|
22
|
-
}), /* @__PURE__ */
|
|
23
|
-
children: /* @__PURE__ */
|
|
24
|
-
|
|
35
|
+
children: /* @__PURE__ */ e(t.Overlay, {
|
|
36
|
+
children: /* @__PURE__ */ d(t.Content, {
|
|
37
|
+
children: [/* @__PURE__ */ e(t.Header, {
|
|
38
|
+
children: r(o.filtersHeader)
|
|
39
|
+
}), /* @__PURE__ */ e(t.ScrollableContainer, {
|
|
40
|
+
children: /* @__PURE__ */ e(c, {
|
|
41
|
+
defaultValue: n.map((l, a) => `item-${a}`),
|
|
42
|
+
type: "multiple",
|
|
43
|
+
children: n.map((l, a) => /* @__PURE__ */ e(c.Item, {
|
|
44
|
+
...l.togglable ? {} : {
|
|
45
|
+
fixed: "true"
|
|
46
|
+
},
|
|
47
|
+
title: l.title,
|
|
48
|
+
value: `item-${a}`,
|
|
49
|
+
children: l.filters.map((m) => /* @__PURE__ */ e(x, {
|
|
50
|
+
...m
|
|
51
|
+
}, m.id))
|
|
52
|
+
}, `accordion-item-${l.title || "unnamed"}`))
|
|
25
53
|
})
|
|
26
|
-
}), /* @__PURE__ */
|
|
27
|
-
children: [/* @__PURE__ */
|
|
28
|
-
onClick:
|
|
29
|
-
children: o
|
|
30
|
-
}), /* @__PURE__ */
|
|
31
|
-
onClick:
|
|
32
|
-
children: o
|
|
54
|
+
}), /* @__PURE__ */ d(t.Footer, {
|
|
55
|
+
children: [/* @__PURE__ */ e(t.Footer.SecondaryButton, {
|
|
56
|
+
onClick: C,
|
|
57
|
+
children: r(o.clearAllButton)
|
|
58
|
+
}), /* @__PURE__ */ e(t.Footer.PrimaryButton, {
|
|
59
|
+
onClick: S,
|
|
60
|
+
children: r(o.showResultsButton)
|
|
33
61
|
})]
|
|
34
|
-
}), /* @__PURE__ */
|
|
35
|
-
"aria-label": o
|
|
62
|
+
}), /* @__PURE__ */ e(t.Close, {
|
|
63
|
+
"aria-label": r(o.closeAriaLabel)
|
|
36
64
|
})]
|
|
37
65
|
})
|
|
38
66
|
})
|
|
39
67
|
});
|
|
40
68
|
};
|
|
41
69
|
export {
|
|
42
|
-
|
|
70
|
+
O as default
|
|
43
71
|
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { MetadataStringField as t } from "@box/metadata-filter";
|
|
2
|
+
import { MetadataSearchField as i } from "../metadata-search-field/metadata-search-field.js";
|
|
3
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
4
|
+
const d = ({
|
|
5
|
+
...e
|
|
6
|
+
}) => {
|
|
7
|
+
switch (e.variant) {
|
|
8
|
+
case "search":
|
|
9
|
+
return /* @__PURE__ */ a(i, {
|
|
10
|
+
id: e.id,
|
|
11
|
+
name: e.name,
|
|
12
|
+
placeholder: e.placeholder
|
|
13
|
+
});
|
|
14
|
+
case "default":
|
|
15
|
+
default:
|
|
16
|
+
return /* @__PURE__ */ a(t, {
|
|
17
|
+
fieldNamePrefix: `metadata.fields.${e.id}`,
|
|
18
|
+
label: e.name
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}, m = ({
|
|
22
|
+
...e
|
|
23
|
+
}) => {
|
|
24
|
+
switch (e.fieldType) {
|
|
25
|
+
case "string":
|
|
26
|
+
return /* @__PURE__ */ a(d, {
|
|
27
|
+
...e
|
|
28
|
+
});
|
|
29
|
+
default:
|
|
30
|
+
return /* @__PURE__ */ a(t, {
|
|
31
|
+
fieldNamePrefix: `metadata.fields.${e.id}`,
|
|
32
|
+
label: e.name
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
m as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineMessages as a } from "react-intl";
|
|
2
|
+
const r = a({
|
|
3
|
+
searchInputAriaLabel: {
|
|
4
|
+
id: "groupSharedFeatures.metadataView.metadataSearchField.searchInputAriaLabel",
|
|
5
|
+
defaultMessage: "Search"
|
|
6
|
+
},
|
|
7
|
+
searchInputClearAriaLabel: {
|
|
8
|
+
id: "groupSharedFeatures.metadataView.metadataSearchField.searchInputClearAriaLabel",
|
|
9
|
+
defaultMessage: "Clear"
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
export {
|
|
13
|
+
r as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SearchInput as u } from "@box/blueprint-web";
|
|
2
|
+
import { useFormikContext as p } from "formik";
|
|
3
|
+
import { useIntl as c } from "react-intl";
|
|
4
|
+
import o from "./messages.js";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
const C = ({
|
|
7
|
+
id: e,
|
|
8
|
+
name: l,
|
|
9
|
+
placeholder: s
|
|
10
|
+
}) => {
|
|
11
|
+
const {
|
|
12
|
+
formatMessage: t
|
|
13
|
+
} = c(), {
|
|
14
|
+
values: n,
|
|
15
|
+
setFieldValue: r
|
|
16
|
+
} = p(), a = n.metadata.fields[e].value.enum;
|
|
17
|
+
return /* @__PURE__ */ i(u.Controlled, {
|
|
18
|
+
id: e,
|
|
19
|
+
name: l,
|
|
20
|
+
onChange: (m) => r(`metadata.fields.${e}.value.enum[0]`, m.target.value),
|
|
21
|
+
onClearInput: () => r(`metadata.fields.${e}.value.enum`, []),
|
|
22
|
+
placeholder: s || "",
|
|
23
|
+
searchInputAriaLabel: t(o.searchInputAriaLabel),
|
|
24
|
+
searchInputClearAriaLabel: t(o.searchInputClearAriaLabel),
|
|
25
|
+
value: (a == null ? void 0 : a[0]) || ""
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
export {
|
|
29
|
+
C as MetadataSearchField
|
|
30
|
+
};
|