@box/metadata-view 1.59.14 → 1.60.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/filter-row/advanced-field-content.js +27 -19
- package/dist/esm/lib/components/filter-row/filter-chip-popover-context.js +3 -0
- package/dist/esm/lib/components/filter-row/filter-row.js +24 -15
- package/dist/esm/lib/components/filter-row/form-filter-chip.js +79 -65
- package/dist/esm/lib/components/filter-row/initial-field-values.js +33 -18
- package/dist/esm/lib/components/filter-row/is-filter-selected.js +2 -0
- package/dist/esm/lib/components/filter-row/metadata-filter-chip.js +23 -20
- package/dist/esm/lib/components/filter-row/use-nested-overlay-popover-open-change.js +30 -0
- package/dist/i18n/en-x-pseudo.js +34 -34
- package/dist/i18n/en-x-pseudo.properties +34 -34
- package/dist/types/lib/components/filter-row/advanced-field-content.d.ts +5 -2
- package/dist/types/lib/components/filter-row/filter-chip-popover-context.d.ts +2 -0
- package/dist/types/lib/components/filter-row/initial-field-values.d.ts +3 -4
- package/dist/types/lib/components/filter-row/is-filter-selected.d.ts +8 -2
- package/dist/types/lib/components/filter-row/types.d.ts +32 -6
- package/dist/types/lib/components/filter-row/use-nested-overlay-popover-open-change.d.ts +15 -0
- package/dist/types/lib/components/filter-sidepanel/filter.d.ts +2 -2
- package/dist/types/lib/test-utils/mock-data.d.ts +1 -0
- package/dist/types/lib/types.d.ts +1 -1
- package/package.json +9 -9
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
import { useAdvancedFilterContext as e } from "./advanced-filter-context.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { useFilterChipPopoverPortalElement as t } from "./filter-chip-popover-context.js";
|
|
3
|
+
import { MetadataDateField as n, MetadataFloatField as r, MetadataMultiSelectField as i, MetadataStringField as a, MetadataTaxonomyFieldAdvanced as o } from "@box/metadata-filter";
|
|
4
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
5
|
+
var c = ({ fieldNamePrefix: t, filterOptionsMap: n, label: r, portalElement: i }) => {
|
|
6
|
+
let a = e();
|
|
6
7
|
return {
|
|
7
|
-
key:
|
|
8
|
-
fieldAdvancedFilterOptions:
|
|
8
|
+
key: a?.resetKey,
|
|
9
|
+
fieldAdvancedFilterOptions: a?.currentOption,
|
|
9
10
|
fieldNamePrefix: t,
|
|
10
11
|
filterOptionsMap: n,
|
|
11
12
|
isAdvancedFilterEnabled: !0,
|
|
12
13
|
label: r,
|
|
13
|
-
onAdvancedFilterOptionChange:
|
|
14
|
+
onAdvancedFilterOptionChange: a ? (e, t) => a.onOptionChange(t) : void 0,
|
|
15
|
+
portalElement: i ?? void 0
|
|
14
16
|
};
|
|
15
|
-
},
|
|
16
|
-
let
|
|
17
|
-
fieldNamePrefix:
|
|
18
|
-
filterOptionsMap:
|
|
19
|
-
label:
|
|
17
|
+
}, l = ({ fieldType: e, fieldNamePrefix: l, filterOptionsMap: u, isMultilevelTaxonomyFieldEnabled: d, label: f, locale: p, portalElement: m, taxonomyOptionsFetcher: h }) => {
|
|
18
|
+
let g = c({
|
|
19
|
+
fieldNamePrefix: l,
|
|
20
|
+
filterOptionsMap: u,
|
|
21
|
+
label: f,
|
|
22
|
+
portalElement: t() ?? m
|
|
20
23
|
});
|
|
21
24
|
switch (e) {
|
|
22
|
-
case "date": return /* @__PURE__ */
|
|
23
|
-
...
|
|
24
|
-
locale:
|
|
25
|
+
case "date": return /* @__PURE__ */ s(n, {
|
|
26
|
+
...g,
|
|
27
|
+
locale: p
|
|
25
28
|
});
|
|
26
|
-
case "float": return /* @__PURE__ */
|
|
27
|
-
case "string": return /* @__PURE__ */ a
|
|
28
|
-
|
|
29
|
+
case "float": return /* @__PURE__ */ s(r, { ...g });
|
|
30
|
+
case "string": return /* @__PURE__ */ s(a, { ...g });
|
|
31
|
+
case "taxonomy": return /* @__PURE__ */ s(o, {
|
|
32
|
+
...g,
|
|
33
|
+
isMultilevelTaxonomyFieldEnabled: d,
|
|
34
|
+
taxonomyOptionsFetcher: h
|
|
35
|
+
});
|
|
36
|
+
default: return /* @__PURE__ */ s(i, { ...g });
|
|
29
37
|
}
|
|
30
38
|
};
|
|
31
|
-
export {
|
|
39
|
+
export { l as AdvancedFieldContent };
|
|
@@ -7,31 +7,40 @@ import { FilterChip as a } from "@box/blueprint-web";
|
|
|
7
7
|
import { useMemo as o, useRef as s } from "react";
|
|
8
8
|
import { Form as c, Formik as l } from "formik";
|
|
9
9
|
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
10
|
-
var f = (
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var f = (e) => {
|
|
11
|
+
let t = e.fieldType === "taxonomy" ? [
|
|
12
|
+
e.key,
|
|
13
|
+
JSON.stringify(e.optionsRules),
|
|
14
|
+
JSON.stringify(e.levels),
|
|
15
|
+
e.scope,
|
|
16
|
+
e.templateKey
|
|
17
|
+
].join(":") : "";
|
|
18
|
+
return `${e.id}:${e.fieldType}:${t}`;
|
|
19
|
+
}, p = ({ dataTargetPrefix: p, predefinedFilterOptions: m, containerRef: h, filterGroups: g = [], initialFilterValues: _, isAllFiltersDisabled: v, onAllFiltersClick: y, onFilterSubmit: b }) => {
|
|
20
|
+
let x = i(m), S = ({ metadata: { fields: e } }) => {
|
|
21
|
+
b && b(e);
|
|
22
|
+
}, C = [...x, ...g], w = C.flatMap(({ filters: e }) => e).sort((e, t) => (e.position ?? 0) - (t.position ?? 0)), T = o(() => e(w, _), [w.map((e) => f(e)).sort().join("|"), _]), E = s(null);
|
|
14
23
|
return /* @__PURE__ */ u(l, {
|
|
15
24
|
enableReinitialize: !0,
|
|
16
|
-
initialValues:
|
|
17
|
-
onSubmit:
|
|
25
|
+
initialValues: T,
|
|
26
|
+
onSubmit: S,
|
|
18
27
|
children: /* @__PURE__ */ u(c, {
|
|
19
|
-
ref:
|
|
28
|
+
ref: E,
|
|
20
29
|
children: /* @__PURE__ */ d(a.Group, {
|
|
21
30
|
className: t.filterChipGroup,
|
|
22
31
|
name: "metadata-view-filters",
|
|
23
32
|
type: "multiple",
|
|
24
|
-
children: [
|
|
25
|
-
containerRef:
|
|
26
|
-
dataTargetPrefix:
|
|
27
|
-
filterGroups:
|
|
28
|
-
onAllFiltersClick:
|
|
29
|
-
}),
|
|
33
|
+
children: [v ? null : /* @__PURE__ */ u(n, {
|
|
34
|
+
containerRef: h,
|
|
35
|
+
dataTargetPrefix: p,
|
|
36
|
+
filterGroups: C,
|
|
37
|
+
onAllFiltersClick: y
|
|
38
|
+
}), w.filter((e) => e.shouldRenderChip).map((e) => /* @__PURE__ */ u(r, {
|
|
30
39
|
filterOption: e,
|
|
31
|
-
formRef:
|
|
40
|
+
formRef: E
|
|
32
41
|
}, e.id))]
|
|
33
42
|
})
|
|
34
43
|
})
|
|
35
44
|
});
|
|
36
45
|
};
|
|
37
|
-
export {
|
|
46
|
+
export { p as FilterRow };
|
|
@@ -4,82 +4,96 @@ import { extractAdvancedFilterOption as n, isFilterSelected as r } from "./is-fi
|
|
|
4
4
|
import i from "./messages.js";
|
|
5
5
|
import { t as a } from "../../../../chunks/filter-row.module.js";
|
|
6
6
|
import { AdvancedFilterContext as o } from "./advanced-filter-context.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, [
|
|
21
|
-
|
|
22
|
-
}, q = ()
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
|
|
7
|
+
import { FilterChipPopoverPortalProvider as s } from "./filter-chip-popover-context.js";
|
|
8
|
+
import { useFormFilterChip as c } from "./use-form-filter-chip.js";
|
|
9
|
+
import { useNestedOverlayPopoverOpenChange as l } from "./use-nested-overlay-popover-open-change.js";
|
|
10
|
+
import { Button as u, FilterChip as d, Popover as f } from "@box/blueprint-web";
|
|
11
|
+
import { useMemo as p, useState as m } from "react";
|
|
12
|
+
import { useIntl as h } from "react-intl";
|
|
13
|
+
import { getIn as g, useFormikContext as _ } from "formik";
|
|
14
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
15
|
+
var b = ({ children: b, formRef: x, icon: S, id: C, name: w = "", isAdvancedFilterEnabled: T, advancedFilterOptionsMap: E }) => {
|
|
16
|
+
let { formatMessage: D } = h(), [O, k] = m(!1), { handleSubmit: A, setFieldValue: j, resetForm: M, values: N } = _(), P = g(N, `metadata.fields.${C}.fieldType`), F = g(N, `metadata.fields.${C}.value`), { appliedAdvancedFilterOption: I, currentAdvancedFilterOption: L, dynamicDisplayName: R, handleAdvancedFilterOptionChange: z, handleApply: B, handleCancel: V, handleClear: H } = c({
|
|
17
|
+
name: w,
|
|
18
|
+
advancedFilterOptionsMap: E,
|
|
19
|
+
initialAdvancedFilterOption: T && F ? n(F) : void 0
|
|
20
|
+
}), [U, W] = m(0), G = () => {
|
|
21
|
+
T && B(), A(), k(!1);
|
|
22
|
+
}, [K, q] = m(N), { handlePopoverOpenChange: J, portalElement: Y, setPopoverContentRef: X } = l({
|
|
23
|
+
onOpenChange: (e) => {
|
|
24
|
+
k(e), e ? (q(N), T && W((e) => e + 1)) : (M({ values: K }), T && V());
|
|
25
|
+
},
|
|
26
|
+
popoverOpen: O
|
|
27
|
+
}), Z = () => {
|
|
28
|
+
j(`metadata.fields.${C}.value`, e({
|
|
29
|
+
fieldType: P,
|
|
30
|
+
isAdvancedFilterEnabled: T
|
|
31
|
+
})), T && H();
|
|
32
|
+
}, Q = p(() => {
|
|
33
|
+
if (T && t(I)) return !0;
|
|
34
|
+
let e = g(N, `metadata.fields.${C}.value`);
|
|
30
35
|
return e ? r(e) : !1;
|
|
31
36
|
}, [
|
|
32
|
-
|
|
33
|
-
x,
|
|
37
|
+
N,
|
|
34
38
|
C,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
39
|
+
T,
|
|
40
|
+
I
|
|
41
|
+
]), $ = () => {
|
|
42
|
+
if (P === "date") {
|
|
43
|
+
let e = g(N, `metadata.fields.${C}.value.customType`), t = e && e !== "anyTime" && e !== "customRange", n = g(N, `metadata.fields.${C}.value.relativeType`);
|
|
44
|
+
return (t || n && n !== "customRange") && !Q;
|
|
40
45
|
}
|
|
41
46
|
return !1;
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
}, ee = T && Q ? R : w, te = p(() => ({
|
|
48
|
+
currentOption: L,
|
|
49
|
+
onOptionChange: z,
|
|
50
|
+
resetKey: U
|
|
51
|
+
}), [
|
|
52
|
+
L,
|
|
53
|
+
z,
|
|
54
|
+
U
|
|
55
|
+
]), ne = T ? /* @__PURE__ */ v(o.Provider, {
|
|
56
|
+
value: te,
|
|
57
|
+
children: b
|
|
58
|
+
}) : b;
|
|
59
|
+
return /* @__PURE__ */ v("div", { children: /* @__PURE__ */ y(f.Root, {
|
|
60
|
+
modal: !1,
|
|
61
|
+
onOpenChange: J,
|
|
62
|
+
open: O,
|
|
63
|
+
children: [/* @__PURE__ */ v(f.Trigger, { children: /* @__PURE__ */ y(d.TriggerChip, {
|
|
64
|
+
selected: Q,
|
|
65
|
+
value: C,
|
|
56
66
|
children: [
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
67
|
+
S && /* @__PURE__ */ v(d.Icon, { icon: S }),
|
|
68
|
+
/* @__PURE__ */ v(d.Label, { children: ee }),
|
|
69
|
+
/* @__PURE__ */ v(d.DropdownIndicator, {})
|
|
60
70
|
]
|
|
61
|
-
},
|
|
71
|
+
}, C) }), /* @__PURE__ */ v(f.ContentContainer, {
|
|
72
|
+
ref: X,
|
|
62
73
|
align: "start",
|
|
63
74
|
className: a.popoverContent,
|
|
64
|
-
container:
|
|
75
|
+
container: x.current,
|
|
65
76
|
"data-testid": "form-filter-chip-popover",
|
|
66
|
-
children:
|
|
67
|
-
|
|
68
|
-
children: [/* @__PURE__ */
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
77
|
+
children: /* @__PURE__ */ y(s, {
|
|
78
|
+
value: Y,
|
|
79
|
+
children: [/* @__PURE__ */ v(f.MainContent, { children: ne }), /* @__PURE__ */ y(f.Footer, {
|
|
80
|
+
className: a.popoverFooter,
|
|
81
|
+
children: [/* @__PURE__ */ v(u, {
|
|
82
|
+
onClick: Z,
|
|
83
|
+
size: "small",
|
|
84
|
+
variant: "secondary",
|
|
85
|
+
children: D(i.clearButton)
|
|
86
|
+
}), /* @__PURE__ */ v(u, {
|
|
87
|
+
disabled: $(),
|
|
88
|
+
onClick: G,
|
|
89
|
+
size: "small",
|
|
90
|
+
type: "submit",
|
|
91
|
+
variant: "primary",
|
|
92
|
+
children: D(i.applyButton)
|
|
93
|
+
})]
|
|
80
94
|
})]
|
|
81
|
-
})
|
|
95
|
+
})
|
|
82
96
|
})]
|
|
83
97
|
}) });
|
|
84
98
|
};
|
|
85
|
-
export {
|
|
99
|
+
export { b as FormFilterChip };
|
|
@@ -1,32 +1,47 @@
|
|
|
1
|
-
|
|
1
|
+
import { FilterKeyTypes as e } from "@box/metadata-filter";
|
|
2
|
+
var t = (e) => ({
|
|
2
3
|
key: e,
|
|
3
4
|
id: e
|
|
4
|
-
}),
|
|
5
|
+
}), n = ({ fieldType: e, options: n }) => ["enum", "multiSelect"].includes(e) ? (n || []).map(t) : [], r = ({ fieldType: t, isAdvancedFilterEnabled: n }) => t === "taxonomy" ? n ? {
|
|
6
|
+
value: [],
|
|
7
|
+
advancedFilterOption: e.MATCH_ANY
|
|
8
|
+
} : [] : t === "date" ? {
|
|
5
9
|
customType: "anyTime",
|
|
6
10
|
range: {
|
|
7
11
|
gt: "",
|
|
8
12
|
lt: ""
|
|
9
13
|
}
|
|
10
|
-
} :
|
|
14
|
+
} : t === "float" ? n ? { enum: [] } : { range: {
|
|
11
15
|
gt: "",
|
|
12
16
|
lt: ""
|
|
13
|
-
} } : { enum: [] },
|
|
14
|
-
let a = e.reduce((e,
|
|
15
|
-
let a =
|
|
16
|
-
fieldType:
|
|
17
|
-
isAdvancedFilterEnabled:
|
|
18
|
-
})
|
|
19
|
-
return e[r.id] = {
|
|
17
|
+
} } : { enum: [] }, i = (e) => Array.isArray(e) ? e.length > 1 ? "multiSelect" : "enum" : !e || typeof e != "object" ? "enum" : "customDays" in e || "relativeDays" in e || "customType" in e || "relativeType" in e ? "date" : "range" in e ? "float" : "value" in e && Array.isArray(e.value) ? "taxonomy" : "enum" in e && e.enum.length > 1 ? "multiSelect" : "enum", a = (e, t) => {
|
|
18
|
+
let a = e.reduce((e, i) => {
|
|
19
|
+
let a = t?.[i.id]?.value, o = r({
|
|
20
|
+
fieldType: i.fieldType,
|
|
21
|
+
isAdvancedFilterEnabled: i.isAdvancedFilterEnabled
|
|
22
|
+
}), s = {
|
|
20
23
|
value: a ?? o,
|
|
21
|
-
fieldType:
|
|
22
|
-
options:
|
|
23
|
-
}
|
|
24
|
+
fieldType: i.fieldType,
|
|
25
|
+
options: n(i)
|
|
26
|
+
};
|
|
27
|
+
return e[i.id] = i.fieldType === "taxonomy" ? {
|
|
28
|
+
...s,
|
|
29
|
+
key: i.key ?? i.id,
|
|
30
|
+
levels: i.levels,
|
|
31
|
+
optionsRules: i.optionsRules
|
|
32
|
+
} : s, e;
|
|
24
33
|
}, {});
|
|
25
|
-
|
|
34
|
+
t && Object.keys(t).filter((e) => !a[e]).forEach((e) => {
|
|
26
35
|
a[e] = {
|
|
27
|
-
value:
|
|
28
|
-
fieldType:
|
|
36
|
+
value: t[e].value,
|
|
37
|
+
fieldType: i(t[e].value)
|
|
29
38
|
};
|
|
30
|
-
})
|
|
39
|
+
});
|
|
40
|
+
let o = e.find((e) => e.fieldType === "taxonomy");
|
|
41
|
+
return { metadata: {
|
|
42
|
+
fields: a,
|
|
43
|
+
scope: o?.scope,
|
|
44
|
+
templateKey: o?.templateKey
|
|
45
|
+
} };
|
|
31
46
|
};
|
|
32
|
-
export {
|
|
47
|
+
export { r as getDefaultFieldValue, a as getInitialFieldValues, i as inferFieldType };
|
|
@@ -20,7 +20,9 @@ var n = (e) => !!e && typeof e == "object" && !Array.isArray(e) && "advancedFilt
|
|
|
20
20
|
let n = o(e);
|
|
21
21
|
return n && n !== t.SELECT_FILTER_TYPE ? n : void 0;
|
|
22
22
|
}, c = (t) => {
|
|
23
|
+
if (Array.isArray(t)) return t.length > 0;
|
|
23
24
|
if ("advancedFilterOption" in t && e(t.advancedFilterOption)) return !0;
|
|
25
|
+
if ("value" in t && Array.isArray(t.value)) return t.value.length > 0;
|
|
24
26
|
if ("range" in t) {
|
|
25
27
|
let { range: e } = t;
|
|
26
28
|
return !!(e && (e.gt || e.lt));
|
|
@@ -6,21 +6,24 @@ import { useIntl as i } from "react-intl";
|
|
|
6
6
|
import { MetadataDateField as a, MetadataFloatField as o, MetadataStringField as s } from "@box/metadata-filter";
|
|
7
7
|
import { jsx as c } from "react/jsx-runtime";
|
|
8
8
|
var l = ({ filterOption: l, formRef: u }) => {
|
|
9
|
-
let { advancedFilterOptionsMap: d, canUseRelativeDates: f, customDateFilterOptions: p, fieldType: m, icon: h, id: g, isAdvancedFilterEnabled: _,
|
|
10
|
-
if (m === "multiSelect" &&
|
|
9
|
+
let { advancedFilterOptionsMap: d, canUseRelativeDates: f, customDateFilterOptions: p, fieldType: m, icon: h, id: g, isAdvancedFilterEnabled: _, isMultilevelTaxonomyFieldEnabled: v, name: y, options: b, placeholder: x, taxonomyOptionsFetcher: S, variant: C } = l, { locale: w } = i(), T = `metadata.fields.${g}`, E = y ?? "";
|
|
10
|
+
if (m === "multiSelect" && C === "file") return /* @__PURE__ */ c(e, { id: g });
|
|
11
11
|
if (_) return /* @__PURE__ */ c(n, {
|
|
12
12
|
advancedFilterOptionsMap: d,
|
|
13
13
|
formRef: u,
|
|
14
14
|
icon: h,
|
|
15
15
|
id: g,
|
|
16
16
|
isAdvancedFilterEnabled: !0,
|
|
17
|
-
name:
|
|
17
|
+
name: y,
|
|
18
18
|
children: /* @__PURE__ */ c(t, {
|
|
19
19
|
fieldType: m,
|
|
20
|
-
fieldNamePrefix:
|
|
20
|
+
fieldNamePrefix: T,
|
|
21
21
|
filterOptionsMap: d,
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
isMultilevelTaxonomyFieldEnabled: v,
|
|
23
|
+
label: E,
|
|
24
|
+
locale: w,
|
|
25
|
+
portalElement: u.current,
|
|
26
|
+
taxonomyOptionsFetcher: S
|
|
24
27
|
})
|
|
25
28
|
}, g);
|
|
26
29
|
switch (m) {
|
|
@@ -28,45 +31,45 @@ var l = ({ filterOption: l, formRef: u }) => {
|
|
|
28
31
|
formRef: u,
|
|
29
32
|
icon: h,
|
|
30
33
|
id: g,
|
|
31
|
-
name:
|
|
34
|
+
name: y,
|
|
32
35
|
children: /* @__PURE__ */ c(a, {
|
|
33
36
|
canUseRelativeDates: f,
|
|
34
37
|
customDateFilterOptions: p,
|
|
35
38
|
direction: "vertical",
|
|
36
|
-
fieldNamePrefix:
|
|
37
|
-
label:
|
|
38
|
-
locale:
|
|
39
|
+
fieldNamePrefix: T,
|
|
40
|
+
label: E,
|
|
41
|
+
locale: w
|
|
39
42
|
})
|
|
40
43
|
}, g);
|
|
41
44
|
case "float": return /* @__PURE__ */ c(n, {
|
|
42
45
|
formRef: u,
|
|
43
46
|
icon: h,
|
|
44
47
|
id: g,
|
|
45
|
-
name:
|
|
48
|
+
name: y,
|
|
46
49
|
children: /* @__PURE__ */ c(o, {
|
|
47
|
-
fieldNamePrefix:
|
|
48
|
-
label:
|
|
50
|
+
fieldNamePrefix: T,
|
|
51
|
+
label: E
|
|
49
52
|
})
|
|
50
53
|
}, g);
|
|
51
54
|
case "string": return /* @__PURE__ */ c(n, {
|
|
52
55
|
formRef: u,
|
|
53
56
|
icon: h,
|
|
54
57
|
id: g,
|
|
55
|
-
name:
|
|
58
|
+
name: y,
|
|
56
59
|
children: /* @__PURE__ */ c(s, {
|
|
57
|
-
fieldNamePrefix:
|
|
58
|
-
label:
|
|
60
|
+
fieldNamePrefix: T,
|
|
61
|
+
label: E
|
|
59
62
|
})
|
|
60
63
|
}, g);
|
|
61
64
|
case "multiSelect":
|
|
62
65
|
case "enum": return /* @__PURE__ */ c(r, {
|
|
63
|
-
fieldNamePrefix:
|
|
66
|
+
fieldNamePrefix: T,
|
|
64
67
|
formRef: u,
|
|
65
68
|
icon: h,
|
|
66
69
|
id: g,
|
|
67
|
-
name:
|
|
68
|
-
options:
|
|
69
|
-
placeholder:
|
|
70
|
+
name: y,
|
|
71
|
+
options: b,
|
|
72
|
+
placeholder: x,
|
|
70
73
|
type: m
|
|
71
74
|
});
|
|
72
75
|
default: return null;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { useCallback as e, useEffect as t, useRef as n, useState as r } from "react";
|
|
2
|
+
var i = ({ onOpenChange: i, popoverOpen: a }) => {
|
|
3
|
+
let o = n(null), s = n(!1), [c, l] = r(null);
|
|
4
|
+
return t(() => {
|
|
5
|
+
if (!a) return;
|
|
6
|
+
let e = () => {
|
|
7
|
+
let e = o.current;
|
|
8
|
+
return e ? !!(e.querySelector("[role=\"combobox\"][aria-expanded=\"true\"]") ?? e.querySelector("[aria-haspopup=\"tree\"][aria-expanded=\"true\"]")) : !1;
|
|
9
|
+
}, t = (t) => {
|
|
10
|
+
if (t.key !== "Escape") return;
|
|
11
|
+
let n = o.current;
|
|
12
|
+
!n || !(t.target instanceof Node) || !n.contains(t.target) || (s.current = e());
|
|
13
|
+
}, n = (t) => {
|
|
14
|
+
let n = o.current;
|
|
15
|
+
n && t.target instanceof Node && n.contains(t.target) || (s.current = e());
|
|
16
|
+
};
|
|
17
|
+
return document.addEventListener("keydown", t, !0), document.addEventListener("pointerdown", n, !0), () => {
|
|
18
|
+
document.removeEventListener("keydown", t, !0), document.removeEventListener("pointerdown", n, !0);
|
|
19
|
+
};
|
|
20
|
+
}, [a]), {
|
|
21
|
+
handlePopoverOpenChange: e((e) => {
|
|
22
|
+
e ? i(!0) : s.current ? s.current = !1 : i(!1);
|
|
23
|
+
}, [i]),
|
|
24
|
+
portalElement: c,
|
|
25
|
+
setPopoverContentRef: e((e) => {
|
|
26
|
+
o.current = e, l(e);
|
|
27
|
+
}, [])
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export { i as useNestedOverlayPopoverOpenChange };
|
package/dist/i18n/en-x-pseudo.js
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
"groupSharedFeatures.emptyState.body": "⟦萬萬萬萬萬萬萬萬萬萬萬
|
|
3
|
-
"groupSharedFeatures.emptyState.heading": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬
|
|
4
|
-
"groupSharedFeatures.metadataView.actionBar.sliderDecreaseSize": "⟦萬萬
|
|
5
|
-
"groupSharedFeatures.metadataView.actionBar.sliderIncreaseSize": "⟦萬萬
|
|
6
|
-
"groupSharedFeatures.metadataView.actionBar.sliderLabel": "⟦萬
|
|
7
|
-
"groupSharedFeatures.metadataView.actionBar.switchToGridView": "⟦萬萬萬萬萬
|
|
8
|
-
"groupSharedFeatures.metadataView.actionBar.switchToListView": "⟦萬萬萬萬萬
|
|
9
|
-
"groupSharedFeatures.metadataView.filterRow.AllFilters": "⟦萬萬萬
|
|
10
|
-
"groupSharedFeatures.metadataView.filterRow.applyButton": "⟦萬
|
|
2
|
+
"groupSharedFeatures.emptyState.body": "⟦萬萬萬萬萬萬萬萬萬萬萬 Τґŷ āďĵµѕťįņġ ÿøűř ƒíĺτεѓś ōґ ķèÿẁöѓďѕ. 國國國國國國國國國國國⟧",
|
|
3
|
+
"groupSharedFeatures.emptyState.heading": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬 ЅōѓґУ, ωè ċоũĺďŋ'ţ ƒîйď ωнάť ŷόŭ'ŕё ĺōøкĩņġ ƒōѓ. 國國國國國國國國國國國國國國⟧",
|
|
4
|
+
"groupSharedFeatures.metadataView.actionBar.sliderDecreaseSize": "⟦萬萬 Ďесŕěãѕĕ 國國⟧",
|
|
5
|
+
"groupSharedFeatures.metadataView.actionBar.sliderIncreaseSize": "⟦萬萬 Ĭй¢ѓěǻśë 國國⟧",
|
|
6
|
+
"groupSharedFeatures.metadataView.actionBar.sliderLabel": "⟦萬 Ŝľίďєѓ 國⟧",
|
|
7
|
+
"groupSharedFeatures.metadataView.actionBar.switchToGridView": "⟦萬萬萬萬萬 Ŝŵīŧ¢ĥ ŧō Ĝґíď Vιěẁ 國國國國國⟧",
|
|
8
|
+
"groupSharedFeatures.metadataView.actionBar.switchToListView": "⟦萬萬萬萬萬 Śщιť¢ħ ŧό Ĺĩśţ Vιęŵ 國國國國國⟧",
|
|
9
|
+
"groupSharedFeatures.metadataView.filterRow.AllFilters": "⟦萬萬萬 Ąľĺ ₣ĭľťëяѕ 國國國⟧",
|
|
10
|
+
"groupSharedFeatures.metadataView.filterRow.applyButton": "⟦萬 ÂΡΡļў 國⟧",
|
|
11
11
|
"groupSharedFeatures.metadataView.filterRow.chipNameWithCount": "⟦萬萬萬 {name} ({count}) 國國國⟧",
|
|
12
12
|
"groupSharedFeatures.metadataView.filterRow.chipNameWithFilterOption": "⟦萬萬萬 {name} - {optionLabel} 國國國⟧",
|
|
13
|
-
"groupSharedFeatures.metadataView.filterRow.clearButton": "⟦萬
|
|
14
|
-
"groupSharedFeatures.metadataView.filterRow.fileTypeFilterTitle": "⟦萬萬
|
|
15
|
-
"groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder": "⟦萬萬萬萬
|
|
16
|
-
"groupSharedFeatures.metadataView.filterRow.locationFilterTitle": "⟦萬萬
|
|
17
|
-
"groupSharedFeatures.metadataView.filterRow.textInputPlaceholder": "⟦萬萬
|
|
18
|
-
"groupSharedFeatures.metadataView.filterSidepanel.clearAllButton": "⟦萬萬
|
|
19
|
-
"groupSharedFeatures.metadataView.filterSidepanel.closeAriaLabel": "⟦萬
|
|
20
|
-
"groupSharedFeatures.metadataView.filterSidepanel.filtersHeader": "⟦萬萬
|
|
21
|
-
"groupSharedFeatures.metadataView.filterSidepanel.showResultsButton": "⟦萬
|
|
22
|
-
"groupSharedFeatures.metadataView.gridList.gridView": "⟦萬萬
|
|
23
|
-
"groupSharedFeatures.metadataView.header.clearSelectionAriaLabel": "⟦萬萬萬萬
|
|
24
|
-
"groupSharedFeatures.metadataView.header.itemsSelected": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 {count, plural, one {
|
|
25
|
-
"groupSharedFeatures.metadataView.header.singleItemSelected": "⟦萬萬萬萬萬萬萬
|
|
13
|
+
"groupSharedFeatures.metadataView.filterRow.clearButton": "⟦萬 Ĉļêăґ 國⟧",
|
|
14
|
+
"groupSharedFeatures.metadataView.filterRow.fileTypeFilterTitle": "⟦萬萬 ₣ίľě ΤўΡе 國國⟧",
|
|
15
|
+
"groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder": "⟦萬萬萬萬 Еήŧěŕ ķěýώσŗďś 國國國國⟧",
|
|
16
|
+
"groupSharedFeatures.metadataView.filterRow.locationFilterTitle": "⟦萬萬 Ľόсάţїоπ 國國⟧",
|
|
17
|
+
"groupSharedFeatures.metadataView.filterRow.textInputPlaceholder": "⟦萬萬 Ŝèţ Våĺμë 國國⟧",
|
|
18
|
+
"groupSharedFeatures.metadataView.filterSidepanel.clearAllButton": "⟦萬萬 Čļєāř Ăľĺ 國國⟧",
|
|
19
|
+
"groupSharedFeatures.metadataView.filterSidepanel.closeAriaLabel": "⟦萬 Çļóѕε 國⟧",
|
|
20
|
+
"groupSharedFeatures.metadataView.filterSidepanel.filtersHeader": "⟦萬萬 ₣ĩľŧėŗŝ 國國⟧",
|
|
21
|
+
"groupSharedFeatures.metadataView.filterSidepanel.showResultsButton": "⟦萬 Şεáŕçн 國⟧",
|
|
22
|
+
"groupSharedFeatures.metadataView.gridList.gridView": "⟦萬萬 Ĝґìď Vιêщ 國國⟧",
|
|
23
|
+
"groupSharedFeatures.metadataView.header.clearSelectionAriaLabel": "⟦萬萬萬萬 Ćļéáг śĕļĕĉŧīόń 國國國國⟧",
|
|
24
|
+
"groupSharedFeatures.metadataView.header.itemsSelected": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 {count, plural, one {<ь># îţėm</в> ĭś ŝēļêćτęď} other {<в># íťєmś</в> åřé śєľесţєď}} 國國國國國國國國國國國國國國國國國國國⟧",
|
|
25
|
+
"groupSharedFeatures.metadataView.header.singleItemSelected": "⟦萬萬萬萬萬萬萬 <ь>{name}</ь> ϊѕ ѕęļèçŧēď 國國國國國國國⟧",
|
|
26
26
|
"groupSharedFeatures.metadataView.inlineEditingCell.unselectedOptionLabel": "⟦ -- ⟧",
|
|
27
|
-
"groupSharedFeatures.metadataView.itemActionMenu.actionMenu": "⟦萬萬萬
|
|
28
|
-
"groupSharedFeatures.metadataView.itemList.errorMessage": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬
|
|
29
|
-
"groupSharedFeatures.metadataView.itemList.listView": "⟦萬萬
|
|
30
|
-
"groupSharedFeatures.metadataView.itemList.refreshButton": "⟦萬萬
|
|
31
|
-
"groupSharedFeatures.metadataView.itemList.selectAll": "⟦萬萬
|
|
32
|
-
"groupSharedFeatures.metadataView.metadataValue.metadataLocation.locationTriggerHint": "⟦萬萬萬萬
|
|
33
|
-
"groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputAriaLabel": "⟦萬
|
|
34
|
-
"groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputClearAriaLabel": "⟦萬
|
|
35
|
-
"groupSharedFeatures.metadataView.pagination.nextPageButton": "⟦萬
|
|
36
|
-
"groupSharedFeatures.metadataView.pagination.pageEntryStatus": "⟦萬萬萬萬萬萬萬萬萬萬萬
|
|
37
|
-
"groupSharedFeatures.metadataView.pagination.paginationLabel": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 P
|
|
38
|
-
"groupSharedFeatures.metadataView.pagination.previousPageButton": "⟦萬萬 P
|
|
27
|
+
"groupSharedFeatures.metadataView.itemActionMenu.actionMenu": "⟦萬萬萬 Āĉŧίøи mєňµ 國國國⟧",
|
|
28
|
+
"groupSharedFeatures.metadataView.itemList.errorMessage": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬 Ѕоmëťħĭńĝ ώĕлť ŵřőʼnġ. Pļĕąŝē гèƒѓèѕħ ŧнίŝ Ρǻĝĕ. 國國國國國國國國國國國國國國⟧",
|
|
29
|
+
"groupSharedFeatures.metadataView.itemList.listView": "⟦萬萬 Ĺįѕτ νιêẃ 國國⟧",
|
|
30
|
+
"groupSharedFeatures.metadataView.itemList.refreshButton": "⟦萬萬 Řêƒŗèśħ 國國⟧",
|
|
31
|
+
"groupSharedFeatures.metadataView.itemList.selectAll": "⟦萬萬 Śёļēçτ äĺľ 國國⟧",
|
|
32
|
+
"groupSharedFeatures.metadataView.metadataValue.metadataLocation.locationTriggerHint": "⟦萬萬萬萬 Ѕеļêçτ α ƒοľďěѓ 國國國國⟧",
|
|
33
|
+
"groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputAriaLabel": "⟦萬 Ѕёáяċн 國⟧",
|
|
34
|
+
"groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputClearAriaLabel": "⟦萬 Čļēäґ 國⟧",
|
|
35
|
+
"groupSharedFeatures.metadataView.pagination.nextPageButton": "⟦萬 Ńě×ŧ 國⟧",
|
|
36
|
+
"groupSharedFeatures.metadataView.pagination.pageEntryStatus": "⟦萬萬萬萬萬萬萬萬萬萬萬 Ѕĥøώîńğ {startEntryIndex} ŧõ {endEntryIndex} øƒ {totalCount} εʼnτґϊēѕ 國國國國國國國國國國國⟧",
|
|
37
|
+
"groupSharedFeatures.metadataView.pagination.paginationLabel": "⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 Pάğïлάŧîōņ πåνįĝàτιôπ ćøпŧѓòĺѕ άйď ¢ųґгēņť Ρâġе īлƒóŕmãŧіóπ 國國國國國國國國國國國國國國國國國⟧",
|
|
38
|
+
"groupSharedFeatures.metadataView.pagination.previousPageButton": "⟦萬萬 Pґενïόűŝ 國國⟧"
|
|
39
39
|
}
|
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
# Body text for the empty state when no items are found
|
|
2
|
-
groupSharedFeatures.emptyState.body = ⟦萬萬萬萬萬萬萬萬萬萬萬
|
|
2
|
+
groupSharedFeatures.emptyState.body = ⟦萬萬萬萬萬萬萬萬萬萬萬 Τґŷ āďĵµѕťįņġ ÿøűř ƒíĺτεѓś ōґ ķèÿẁöѓďѕ. 國國國國國國國國國國國⟧
|
|
3
3
|
# Heading for the empty state when no items are found
|
|
4
|
-
groupSharedFeatures.emptyState.heading = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬
|
|
4
|
+
groupSharedFeatures.emptyState.heading = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬 ЅōѓґУ, ωè ċоũĺďŋ'ţ ƒîйď ωнάť ŷόŭ'ŕё ĺōøкĩņġ ƒōѓ. 國國國國國國國國國國國國國國⟧
|
|
5
5
|
# Label for decreasing the size of column.
|
|
6
|
-
groupSharedFeatures.metadataView.actionBar.sliderDecreaseSize = ⟦萬萬
|
|
6
|
+
groupSharedFeatures.metadataView.actionBar.sliderDecreaseSize = ⟦萬萬 Ďесŕěãѕĕ 國國⟧
|
|
7
7
|
# Label for increasing the size of column.
|
|
8
|
-
groupSharedFeatures.metadataView.actionBar.sliderIncreaseSize = ⟦萬萬
|
|
8
|
+
groupSharedFeatures.metadataView.actionBar.sliderIncreaseSize = ⟦萬萬 Ĭй¢ѓěǻśë 國國⟧
|
|
9
9
|
# Label for the slider that controls the size of column.
|
|
10
|
-
groupSharedFeatures.metadataView.actionBar.sliderLabel = ⟦萬
|
|
10
|
+
groupSharedFeatures.metadataView.actionBar.sliderLabel = ⟦萬 Ŝľίďєѓ 國⟧
|
|
11
11
|
# Label to switch to grid view
|
|
12
|
-
groupSharedFeatures.metadataView.actionBar.switchToGridView = ⟦萬萬萬萬萬
|
|
12
|
+
groupSharedFeatures.metadataView.actionBar.switchToGridView = ⟦萬萬萬萬萬 Ŝŵīŧ¢ĥ ŧō Ĝґíď Vιěẁ 國國國國國⟧
|
|
13
13
|
# Label to switch to list view
|
|
14
|
-
groupSharedFeatures.metadataView.actionBar.switchToListView = ⟦萬萬萬萬萬
|
|
14
|
+
groupSharedFeatures.metadataView.actionBar.switchToListView = ⟦萬萬萬萬萬 Śщιť¢ħ ŧό Ĺĩśţ Vιęŵ 國國國國國⟧
|
|
15
15
|
# Button label to open the sidepanel with all filters
|
|
16
|
-
groupSharedFeatures.metadataView.filterRow.AllFilters = ⟦萬萬萬
|
|
16
|
+
groupSharedFeatures.metadataView.filterRow.AllFilters = ⟦萬萬萬 Ąľĺ ₣ĭľťëяѕ 國國國⟧
|
|
17
17
|
# Button label to apply the current input as a filter to the metadata table
|
|
18
|
-
groupSharedFeatures.metadataView.filterRow.applyButton = ⟦萬
|
|
18
|
+
groupSharedFeatures.metadataView.filterRow.applyButton = ⟦萬 ÂΡΡļў 國⟧
|
|
19
19
|
# Label for a filter chip that includes the name and count of selected options
|
|
20
20
|
groupSharedFeatures.metadataView.filterRow.chipNameWithCount = ⟦萬萬萬 {name} ({count}) 國國國⟧
|
|
21
21
|
# Label for a filter chip showing the field name and active filter option, e.g. "Modified - Is blank"
|
|
22
22
|
groupSharedFeatures.metadataView.filterRow.chipNameWithFilterOption = ⟦萬萬萬 {name} - {optionLabel} 國國國⟧
|
|
23
23
|
# Button label to clear the current input in a textarea
|
|
24
|
-
groupSharedFeatures.metadataView.filterRow.clearButton = ⟦萬
|
|
24
|
+
groupSharedFeatures.metadataView.filterRow.clearButton = ⟦萬 Ĉļêăґ 國⟧
|
|
25
25
|
# Title for the file type filter group
|
|
26
|
-
groupSharedFeatures.metadataView.filterRow.fileTypeFilterTitle = ⟦萬萬
|
|
26
|
+
groupSharedFeatures.metadataView.filterRow.fileTypeFilterTitle = ⟦萬萬 ₣ίľě ΤўΡе 國國⟧
|
|
27
27
|
# Placeholder text for the keyword search filter
|
|
28
|
-
groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder = ⟦萬萬萬萬
|
|
28
|
+
groupSharedFeatures.metadataView.filterRow.keywordSearchFilterPlaceholder = ⟦萬萬萬萬 Еήŧěŕ ķěýώσŗďś 國國國國⟧
|
|
29
29
|
# Title for the location filter group
|
|
30
|
-
groupSharedFeatures.metadataView.filterRow.locationFilterTitle = ⟦萬萬
|
|
30
|
+
groupSharedFeatures.metadataView.filterRow.locationFilterTitle = ⟦萬萬 Ľόсάţїоπ 國國⟧
|
|
31
31
|
# Placeholder text for the input field in the filter row
|
|
32
|
-
groupSharedFeatures.metadataView.filterRow.textInputPlaceholder = ⟦萬萬
|
|
32
|
+
groupSharedFeatures.metadataView.filterRow.textInputPlaceholder = ⟦萬萬 Ŝèţ Våĺμë 國國⟧
|
|
33
33
|
# Button label to clear all filters in the sidepanel
|
|
34
|
-
groupSharedFeatures.metadataView.filterSidepanel.clearAllButton = ⟦萬萬
|
|
34
|
+
groupSharedFeatures.metadataView.filterSidepanel.clearAllButton = ⟦萬萬 Čļєāř Ăľĺ 國國⟧
|
|
35
35
|
# Aria label for the close button in the filter sidepanel
|
|
36
|
-
groupSharedFeatures.metadataView.filterSidepanel.closeAriaLabel = ⟦萬
|
|
36
|
+
groupSharedFeatures.metadataView.filterSidepanel.closeAriaLabel = ⟦萬 Çļóѕε 國⟧
|
|
37
37
|
# Header for the filter sidepanel
|
|
38
|
-
groupSharedFeatures.metadataView.filterSidepanel.filtersHeader = ⟦萬萬
|
|
38
|
+
groupSharedFeatures.metadataView.filterSidepanel.filtersHeader = ⟦萬萬 ₣ĩľŧėŗŝ 國國⟧
|
|
39
39
|
# Button label to apply filters and show results
|
|
40
|
-
groupSharedFeatures.metadataView.filterSidepanel.showResultsButton = ⟦萬
|
|
40
|
+
groupSharedFeatures.metadataView.filterSidepanel.showResultsButton = ⟦萬 Şεáŕçн 國⟧
|
|
41
41
|
# Label for the grid view of files and folders
|
|
42
|
-
groupSharedFeatures.metadataView.gridList.gridView = ⟦萬萬
|
|
42
|
+
groupSharedFeatures.metadataView.gridList.gridView = ⟦萬萬 Ĝґìď Vιêщ 國國⟧
|
|
43
43
|
# Aria label for the clear selection button
|
|
44
|
-
groupSharedFeatures.metadataView.header.clearSelectionAriaLabel = ⟦萬萬萬萬
|
|
44
|
+
groupSharedFeatures.metadataView.header.clearSelectionAriaLabel = ⟦萬萬萬萬 Ćļéáг śĕļĕĉŧīόń 國國國國⟧
|
|
45
45
|
# Selection count text in the header when multiple items are selected or item name is unavailable
|
|
46
|
-
groupSharedFeatures.metadataView.header.itemsSelected = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 {count, plural, one {
|
|
46
|
+
groupSharedFeatures.metadataView.header.itemsSelected = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 {count, plural, one {<ь># îţėm</в> ĭś ŝēļêćτęď} other {<в># íťєmś</в> åřé śєľесţєď}} 國國國國國國國國國國國國國國國國國國國⟧
|
|
47
47
|
# Selection text in the header when a single item is selected, showing the item name
|
|
48
|
-
groupSharedFeatures.metadataView.header.singleItemSelected = ⟦萬萬萬萬萬萬萬
|
|
48
|
+
groupSharedFeatures.metadataView.header.singleItemSelected = ⟦萬萬萬萬萬萬萬 <ь>{name}</ь> ϊѕ ѕęļèçŧēď 國國國國國國國⟧
|
|
49
49
|
# Label for the default unselected option in inline editing dropdowns
|
|
50
50
|
groupSharedFeatures.metadataView.inlineEditingCell.unselectedOptionLabel = ⟦ -- ⟧
|
|
51
51
|
# Label for the action menu for an item in the metadata view list
|
|
52
|
-
groupSharedFeatures.metadataView.itemActionMenu.actionMenu = ⟦萬萬萬
|
|
52
|
+
groupSharedFeatures.metadataView.itemActionMenu.actionMenu = ⟦萬萬萬 Āĉŧίøи mєňµ 國國國⟧
|
|
53
53
|
# Error message displayed when metadata fails to load
|
|
54
|
-
groupSharedFeatures.metadataView.itemList.errorMessage = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬
|
|
54
|
+
groupSharedFeatures.metadataView.itemList.errorMessage = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬 Ѕоmëťħĭńĝ ώĕлť ŵřőʼnġ. Pļĕąŝē гèƒѓèѕħ ŧнίŝ Ρǻĝĕ. 國國國國國國國國國國國國國國⟧
|
|
55
55
|
# Label for the list of files and folders displayed in a list view
|
|
56
|
-
groupSharedFeatures.metadataView.itemList.listView = ⟦萬萬
|
|
56
|
+
groupSharedFeatures.metadataView.itemList.listView = ⟦萬萬 Ĺįѕτ νιêẃ 國國⟧
|
|
57
57
|
# Label for the refresh button in error state
|
|
58
|
-
groupSharedFeatures.metadataView.itemList.refreshButton = ⟦萬萬
|
|
58
|
+
groupSharedFeatures.metadataView.itemList.refreshButton = ⟦萬萬 Řêƒŗèśħ 國國⟧
|
|
59
59
|
# Label for the select all checkbox in the metadata table
|
|
60
|
-
groupSharedFeatures.metadataView.itemList.selectAll = ⟦萬萬
|
|
60
|
+
groupSharedFeatures.metadataView.itemList.selectAll = ⟦萬萬 Śёļēçτ äĺľ 國國⟧
|
|
61
61
|
# Placeholder for select folder trigger
|
|
62
|
-
groupSharedFeatures.metadataView.metadataValue.metadataLocation.locationTriggerHint = ⟦萬萬萬萬
|
|
62
|
+
groupSharedFeatures.metadataView.metadataValue.metadataLocation.locationTriggerHint = ⟦萬萬萬萬 Ѕеļêçτ α ƒοľďěѓ 國國國國⟧
|
|
63
63
|
# Aria label for the search input
|
|
64
|
-
groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputAriaLabel = ⟦萬
|
|
64
|
+
groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputAriaLabel = ⟦萬 Ѕёáяċн 國⟧
|
|
65
65
|
# Aria label for the clear button in the search input
|
|
66
|
-
groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputClearAriaLabel = ⟦萬
|
|
66
|
+
groupSharedFeatures.metadataView.metadataValue.metadataSearch.searchInputClearAriaLabel = ⟦萬 Čļēäґ 國⟧
|
|
67
67
|
# Label for the next page button
|
|
68
|
-
groupSharedFeatures.metadataView.pagination.nextPageButton = ⟦萬
|
|
68
|
+
groupSharedFeatures.metadataView.pagination.nextPageButton = ⟦萬 Ńě×ŧ 國⟧
|
|
69
69
|
# Pagination menu status with the range of entries shown
|
|
70
|
-
groupSharedFeatures.metadataView.pagination.pageEntryStatus = ⟦萬萬萬萬萬萬萬萬萬萬萬
|
|
70
|
+
groupSharedFeatures.metadataView.pagination.pageEntryStatus = ⟦萬萬萬萬萬萬萬萬萬萬萬 Ѕĥøώîńğ {startEntryIndex} ŧõ {endEntryIndex} øƒ {totalCount} εʼnτґϊēѕ 國國國國國國國國國國國⟧
|
|
71
71
|
# Aria label for the pagination component, which includes entry status and previous/next page controls
|
|
72
|
-
groupSharedFeatures.metadataView.pagination.paginationLabel = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 P
|
|
72
|
+
groupSharedFeatures.metadataView.pagination.paginationLabel = ⟦萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬萬 Pάğïлάŧîōņ πåνįĝàτιôπ ćøпŧѓòĺѕ άйď ¢ųґгēņť Ρâġе īлƒóŕmãŧіóπ 國國國國國國國國國國國國國國國國國⟧
|
|
73
73
|
# Label for the previous page button
|
|
74
|
-
groupSharedFeatures.metadataView.pagination.previousPageButton = ⟦萬萬 P
|
|
74
|
+
groupSharedFeatures.metadataView.pagination.previousPageButton = ⟦萬萬 Pґενïόűŝ 國國⟧
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import { AdvancedFilterOptionsMap, FilterOption } from './types';
|
|
1
|
+
import { AdvancedFilterOptionsMap, FilterOption, TaxonomyOptionsFetcher } from './types';
|
|
2
2
|
type BaseAdvancedFieldProps = {
|
|
3
3
|
fieldNamePrefix: string;
|
|
4
4
|
filterOptionsMap?: AdvancedFilterOptionsMap;
|
|
5
5
|
label: string;
|
|
6
|
+
portalElement?: HTMLElement | null;
|
|
6
7
|
};
|
|
7
8
|
type AdvancedFieldContentProps = BaseAdvancedFieldProps & {
|
|
8
9
|
fieldType: FilterOption['fieldType'];
|
|
10
|
+
isMultilevelTaxonomyFieldEnabled?: boolean;
|
|
9
11
|
locale: string;
|
|
12
|
+
taxonomyOptionsFetcher?: TaxonomyOptionsFetcher;
|
|
10
13
|
};
|
|
11
|
-
export declare const AdvancedFieldContent: ({ fieldType, fieldNamePrefix, filterOptionsMap, label, locale, }: AdvancedFieldContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare const AdvancedFieldContent: ({ fieldType, fieldNamePrefix, filterOptionsMap, isMultilevelTaxonomyFieldEnabled, label, locale, portalElement, taxonomyOptionsFetcher, }: AdvancedFieldContentProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
15
|
export {};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { MetadataFormFieldValue } from '@box/metadata-filter';
|
|
2
1
|
import { MetadataFieldType } from '../../types';
|
|
3
|
-
import { FilterOption, InitialFilterValues, MetadataFormValues } from './types';
|
|
2
|
+
import { FilterFieldValue, FilterOption, InitialFilterValues, MetadataFormValues } from './types';
|
|
4
3
|
export declare const getDefaultFieldValue: ({ fieldType, isAdvancedFilterEnabled, }: {
|
|
5
4
|
fieldType?: MetadataFieldType;
|
|
6
5
|
isAdvancedFilterEnabled?: boolean;
|
|
7
|
-
}) =>
|
|
8
|
-
export declare const inferFieldType: (value:
|
|
6
|
+
}) => FilterFieldValue;
|
|
7
|
+
export declare const inferFieldType: (value: FilterFieldValue) => MetadataFieldType;
|
|
9
8
|
export declare const getInitialFieldValues: (filterOptions: FilterOption[], customFieldValues?: InitialFilterValues) => MetadataFormValues;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { FilterKey, MetadataFormFieldValue } from '@box/metadata-filter';
|
|
2
|
-
|
|
2
|
+
type TaxonomyFieldValue = {
|
|
3
|
+
value?: unknown[];
|
|
4
|
+
advancedFilterOption?: FilterKey;
|
|
5
|
+
};
|
|
6
|
+
type FilterFieldValue = MetadataFormFieldValue | TaxonomyFieldValue;
|
|
7
|
+
export declare const extractAdvancedFilterOption: (value: FilterFieldValue) => FilterKey | undefined;
|
|
3
8
|
/**
|
|
4
9
|
* Returns true if the given field value is considered "selected" (i.e., not empty).
|
|
5
10
|
* Also returns true when an isBlank/isNotBlank advanced filter option is applied,
|
|
6
11
|
* since those filters are active even when the field value itself is empty.
|
|
7
12
|
*/
|
|
8
|
-
export declare const isFilterSelected: (value:
|
|
13
|
+
export declare const isFilterSelected: (value: FilterFieldValue) => boolean;
|
|
14
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FilterKey, MetadataFormFieldValue, MetadataTemplateFieldOption } from '@box/metadata-filter';
|
|
1
|
+
import { FetcherResponse, FilterKey, Level, MetadataFormFieldValue, MetadataTemplateFieldOption, TaxonomyOptionsRules, TreeOptionType, TreeQueryInput } from '@box/metadata-filter';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { FilterVariant, MetadataFieldType } from '../../types';
|
|
4
4
|
export interface CustomDateFilterOption {
|
|
@@ -19,17 +19,28 @@ export interface FilterGroup {
|
|
|
19
19
|
toggleable: boolean;
|
|
20
20
|
}
|
|
21
21
|
export type AdvancedFilterOptionsMap = [FilterKey, string][];
|
|
22
|
-
export
|
|
22
|
+
export type TaxonomyOptionsFetcher = (scope: string, templateKey: string, fieldKey: string, level: number, options: TreeQueryInput) => Promise<FetcherResponse<TreeOptionType>>;
|
|
23
|
+
export type TaxonomyFilterValue = TreeOptionType[] | {
|
|
24
|
+
value: TreeOptionType[];
|
|
25
|
+
advancedFilterOption: FilterKey;
|
|
26
|
+
};
|
|
27
|
+
export type FilterFieldValue = MetadataFormFieldValue | TaxonomyFilterValue;
|
|
28
|
+
interface BaseFilterOption {
|
|
23
29
|
customLabels?: string[];
|
|
24
|
-
fieldType: MetadataFieldType;
|
|
25
30
|
icon?: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, 'ref'> & React.RefAttributes<SVGSVGElement>>;
|
|
26
31
|
id: string;
|
|
27
|
-
isAdvancedFilterEnabled?: boolean;
|
|
28
32
|
advancedFilterOptionsMap?: AdvancedFilterOptionsMap;
|
|
33
|
+
isMultilevelTaxonomyFieldEnabled?: boolean;
|
|
29
34
|
isItemMetadata?: boolean;
|
|
35
|
+
key?: string;
|
|
36
|
+
levels?: Level[];
|
|
30
37
|
name?: string;
|
|
31
38
|
options?: string[];
|
|
39
|
+
optionsRules?: TaxonomyOptionsRules;
|
|
32
40
|
placeholder?: string;
|
|
41
|
+
scope?: string;
|
|
42
|
+
taxonomyOptionsFetcher?: TaxonomyOptionsFetcher;
|
|
43
|
+
templateKey?: string;
|
|
33
44
|
canUseRelativeDates?: boolean;
|
|
34
45
|
customDateFilterOptions?: Array<CustomDateFilterOptionsProps>;
|
|
35
46
|
selected: boolean;
|
|
@@ -43,6 +54,15 @@ export interface FilterOption {
|
|
|
43
54
|
*/
|
|
44
55
|
position?: number;
|
|
45
56
|
}
|
|
57
|
+
interface TaxonomyFilterOption extends BaseFilterOption {
|
|
58
|
+
fieldType: 'taxonomy';
|
|
59
|
+
isAdvancedFilterEnabled: true;
|
|
60
|
+
}
|
|
61
|
+
interface NonTaxonomyFilterOption extends BaseFilterOption {
|
|
62
|
+
fieldType: Exclude<MetadataFieldType, 'taxonomy'>;
|
|
63
|
+
isAdvancedFilterEnabled?: boolean;
|
|
64
|
+
}
|
|
65
|
+
export type FilterOption = TaxonomyFilterOption | NonTaxonomyFilterOption;
|
|
46
66
|
export interface FilterChipProps {
|
|
47
67
|
formRef: React.RefObject<HTMLFormElement>;
|
|
48
68
|
icon?: React.ForwardRefExoticComponent<Omit<React.SVGProps<SVGSVGElement>, 'ref'> & React.RefAttributes<SVGSVGElement>>;
|
|
@@ -52,14 +72,20 @@ export interface FilterChipProps {
|
|
|
52
72
|
}
|
|
53
73
|
export type FilterValues = Record<string, {
|
|
54
74
|
fieldType: MetadataFieldType;
|
|
75
|
+
key?: string;
|
|
76
|
+
levels?: Level[];
|
|
55
77
|
options?: Array<MetadataTemplateFieldOption>;
|
|
56
|
-
|
|
78
|
+
optionsRules?: TaxonomyOptionsRules;
|
|
79
|
+
value: FilterFieldValue;
|
|
57
80
|
}>;
|
|
58
81
|
export type InitialFilterValues = Record<string, {
|
|
59
|
-
value:
|
|
82
|
+
value: FilterFieldValue;
|
|
60
83
|
}>;
|
|
61
84
|
export type MetadataFormValues = {
|
|
62
85
|
metadata: {
|
|
63
86
|
fields: FilterValues;
|
|
87
|
+
scope?: string;
|
|
88
|
+
templateKey?: string;
|
|
64
89
|
};
|
|
65
90
|
};
|
|
91
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
type UseNestedOverlayPopoverOpenChangeProps = {
|
|
2
|
+
onOpenChange: (open: boolean) => void;
|
|
3
|
+
popoverOpen: boolean;
|
|
4
|
+
};
|
|
5
|
+
/**
|
|
6
|
+
* Default Popover dismissal treats Escape or outside pointer events from nested combobox/tree
|
|
7
|
+
* overlays as a parent close too. Taxonomy/combobox filters need that first dismiss to close
|
|
8
|
+
* only the nested overlay while keeping the filter popover open.
|
|
9
|
+
*/
|
|
10
|
+
export declare const useNestedOverlayPopoverOpenChange: ({ onOpenChange, popoverOpen, }: UseNestedOverlayPopoverOpenChangeProps) => {
|
|
11
|
+
handlePopoverOpenChange: (open: boolean) => void;
|
|
12
|
+
portalElement: HTMLElement;
|
|
13
|
+
setPopoverContentRef: (node: HTMLDivElement | null) => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { FilterOption } from '../filter-row/types';
|
|
2
|
-
|
|
2
|
+
type FilterProps = FilterOption & {
|
|
3
3
|
parentRef: HTMLElement;
|
|
4
|
-
}
|
|
4
|
+
};
|
|
5
5
|
export declare const Filter: ({ ...props }: FilterProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export {};
|
|
@@ -30,6 +30,7 @@ export declare const ADVANCED_FILTER_IDS: {
|
|
|
30
30
|
readonly fileSize: "file-size-filter";
|
|
31
31
|
readonly phoneNumber: "phone-number-filter";
|
|
32
32
|
readonly roleAdvanced: "role-advanced-filter";
|
|
33
|
+
readonly taxonomyAdvanced: "taxonomy-advanced-filter";
|
|
33
34
|
};
|
|
34
35
|
export declare const mockAdvancedFilterOptions: FilterOption[];
|
|
35
36
|
export declare const mockFilterOptionsWithEnumPlaceholder: FilterOption[];
|
|
@@ -4,7 +4,7 @@ import { Selection } from 'react-aria-components';
|
|
|
4
4
|
import { ActionBarProps, MetadataTableProps, PaginationProps } from './components';
|
|
5
5
|
import { ItemActionMenuProps } from './components/item-action-menu';
|
|
6
6
|
export declare const SELECT_ALL: "all";
|
|
7
|
-
export type MetadataFieldType = 'date' | 'enum' | 'float' | 'multiSelect' | 'string';
|
|
7
|
+
export type MetadataFieldType = 'date' | 'enum' | 'float' | 'multiSelect' | 'string' | 'taxonomy';
|
|
8
8
|
export type FilterVariant = 'default' | 'search' | 'file' | 'radio' | 'relative' | 'checkbox';
|
|
9
9
|
export interface Column extends Partial<ColumnProps> {
|
|
10
10
|
cellRenderer?: (item: Item, column: Column) => React.ReactNode | undefined;
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/metadata-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.60.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"@box/blueprint-web": "^14.36.0",
|
|
7
7
|
"@box/blueprint-web-assets": "^4.120.2",
|
|
8
|
-
"@box/box-item-type-selector": "^1.41.
|
|
9
|
-
"@box/content-field": "^1.42.
|
|
10
|
-
"@box/item-icon": "^2.35.
|
|
11
|
-
"@box/metadata-filter": "^1.83.
|
|
8
|
+
"@box/box-item-type-selector": "^1.41.24",
|
|
9
|
+
"@box/content-field": "^1.42.24",
|
|
10
|
+
"@box/item-icon": "^2.35.24",
|
|
11
|
+
"@box/metadata-filter": "^1.83.25",
|
|
12
12
|
"@box/types": "2.2.3",
|
|
13
13
|
"@tanstack/react-virtual": "^3.10.8",
|
|
14
14
|
"formik": "^2.4.5",
|
|
@@ -21,11 +21,11 @@
|
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@box/blueprint-web": "^14.36.0",
|
|
23
23
|
"@box/blueprint-web-assets": "^4.120.2",
|
|
24
|
-
"@box/box-item-type-selector": "^1.41.
|
|
25
|
-
"@box/content-field": "^1.42.
|
|
24
|
+
"@box/box-item-type-selector": "^1.41.24",
|
|
25
|
+
"@box/content-field": "^1.42.24",
|
|
26
26
|
"@box/eslint-plugin-blueprint": "1.2.3",
|
|
27
|
-
"@box/item-icon": "^2.35.
|
|
28
|
-
"@box/metadata-filter": "^1.83.
|
|
27
|
+
"@box/item-icon": "^2.35.24",
|
|
28
|
+
"@box/metadata-filter": "^1.83.25",
|
|
29
29
|
"@box/storybook-utils": "0.19.17",
|
|
30
30
|
"@box/types": "2.2.3",
|
|
31
31
|
"@tanstack/react-virtual": "^3.10.8",
|