@box/box-item-type-selector 1.15.0 → 1.17.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.
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { BoxItemTypeSelector as
|
|
2
|
-
import { Popover as
|
|
3
|
-
import { FileDefault as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
1
|
+
import { BoxItemTypeSelector as I } from "./box-item-type-selector.js";
|
|
2
|
+
import { useBlueprintModernization as x, Popover as i, FilterChip as p, Button as y } from "@box/blueprint-web";
|
|
3
|
+
import { FileDefault as _ } from "@box/blueprint-web-assets/icons/Line";
|
|
4
|
+
import { File as Q } from "@box/blueprint-web-assets/icons/Medium";
|
|
5
|
+
import L from "clsx";
|
|
6
|
+
import F from "react";
|
|
7
|
+
import { useIntl as j } from "react-intl";
|
|
8
|
+
import { b as g } from "../../chunks/constants.js";
|
|
8
9
|
import m from "./messages.js";
|
|
9
10
|
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
10
|
-
import '../../styles/box-item-type-selector-quick-filter.css';const
|
|
11
|
-
itemTypeSelectorQuickFilterPopoverContainer:
|
|
12
|
-
popoverMainContent:
|
|
13
|
-
boxItemTypeSelectorQuickFilter:
|
|
14
|
-
popoverFooterInline:
|
|
15
|
-
},
|
|
16
|
-
function
|
|
11
|
+
import '../../styles/box-item-type-selector-quick-filter.css';const N = "_itemTypeSelectorQuickFilterPopoverContainer_10sjf_1", P = "_popoverMainContent_10sjf_4", B = "_boxItemTypeSelectorQuickFilter_10sjf_8", z = "_popoverFooterInline_10sjf_11", a = {
|
|
12
|
+
itemTypeSelectorQuickFilterPopoverContainer: N,
|
|
13
|
+
popoverMainContent: P,
|
|
14
|
+
boxItemTypeSelectorQuickFilter: B,
|
|
15
|
+
popoverFooterInline: z
|
|
16
|
+
}, A = () => g.reduce((t, l) => t + (l.children ? l.children.length : 1), 0), D = (t) => g.map((o) => o.children ? o.children.every((e) => t.includes(e.value)) ? o.title : o.children.filter((e) => t.includes(e.value)).map((e) => e.title) : t.includes(o.value) ? o.title : []).flat(), w = (t, l) => t.length !== l.length ? !1 : t.every((o) => l.includes(o)), R = A();
|
|
17
|
+
function X(t) {
|
|
17
18
|
const {
|
|
18
19
|
allowAllOptionsSelect: l = !1,
|
|
19
20
|
applyButtonType: o = "button",
|
|
@@ -22,62 +23,64 @@ function J(t) {
|
|
|
22
23
|
onApply: C,
|
|
23
24
|
onFocus: v,
|
|
24
25
|
className: b
|
|
25
|
-
} = t,
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
} = t, n = j(), [s, c] = F.useState(e), {
|
|
27
|
+
enableModernizedComponents: T
|
|
28
|
+
} = x();
|
|
29
|
+
F.useEffect(() => {
|
|
30
|
+
c(e);
|
|
28
31
|
}, [e]);
|
|
29
|
-
const
|
|
30
|
-
const d =
|
|
31
|
-
return f ? f === 1 ?
|
|
32
|
+
const S = () => {
|
|
33
|
+
const d = D(e), f = d.length;
|
|
34
|
+
return f ? f === 1 ? n.formatMessage(d[0]) : n.formatMessage(m.multipleFiles, {
|
|
32
35
|
count: f - 1,
|
|
33
|
-
fileType:
|
|
34
|
-
}) :
|
|
35
|
-
},
|
|
36
|
-
!l &&
|
|
37
|
-
};
|
|
36
|
+
fileType: n.formatMessage(d[0])
|
|
37
|
+
}) : n.formatMessage(m.fileTypeLabelDropdown);
|
|
38
|
+
}, M = () => {
|
|
39
|
+
!l && s.length === R ? (c([]), C([])) : C(s);
|
|
40
|
+
}, k = T ? Q : _;
|
|
38
41
|
return /* @__PURE__ */ r("div", {
|
|
39
|
-
className:
|
|
40
|
-
children: /* @__PURE__ */ u(
|
|
42
|
+
className: L(b, a.boxItemTypeSelectorQuickFilterContainer),
|
|
43
|
+
children: /* @__PURE__ */ u(i.Root, {
|
|
41
44
|
modal: !1,
|
|
42
|
-
children: [/* @__PURE__ */ r(
|
|
45
|
+
children: [/* @__PURE__ */ r(i.Trigger, {
|
|
43
46
|
children: /* @__PURE__ */ u(p.TriggerChip, {
|
|
44
47
|
autoFocus: h,
|
|
45
|
-
onClick: () =>
|
|
48
|
+
onClick: () => c(e),
|
|
46
49
|
onFocus: v,
|
|
47
50
|
selected: !!e.length,
|
|
48
51
|
value: "trigger-chip",
|
|
49
52
|
children: [/* @__PURE__ */ r(p.Icon, {
|
|
50
|
-
icon:
|
|
53
|
+
icon: k
|
|
51
54
|
}), /* @__PURE__ */ r(p.Label, {
|
|
52
|
-
children:
|
|
55
|
+
children: S()
|
|
53
56
|
}), /* @__PURE__ */ r(p.DropdownIndicator, {})]
|
|
54
57
|
})
|
|
55
|
-
}), /* @__PURE__ */ u(
|
|
58
|
+
}), /* @__PURE__ */ u(i.ContentContainer, {
|
|
56
59
|
align: "start",
|
|
57
60
|
className: a.itemTypeSelectorQuickFilterPopoverContainer,
|
|
58
|
-
children: [/* @__PURE__ */ r(
|
|
61
|
+
children: [/* @__PURE__ */ r(i.MainContent, {
|
|
59
62
|
className: a.popoverMainContent,
|
|
60
|
-
children: /* @__PURE__ */ r(
|
|
63
|
+
children: /* @__PURE__ */ r(I, {
|
|
61
64
|
className: a.boxItemTypeSelectorQuickFilter,
|
|
62
|
-
onSelectionChange:
|
|
63
|
-
selected:
|
|
65
|
+
onSelectionChange: c,
|
|
66
|
+
selected: s
|
|
64
67
|
})
|
|
65
|
-
}), /* @__PURE__ */ u(
|
|
68
|
+
}), /* @__PURE__ */ u(i.Footer, {
|
|
66
69
|
className: a.popoverFooterInline,
|
|
67
70
|
children: [/* @__PURE__ */ r(y, {
|
|
68
|
-
disabled: !
|
|
69
|
-
onClick: () =>
|
|
71
|
+
disabled: !s.length,
|
|
72
|
+
onClick: () => c([]),
|
|
70
73
|
size: "small",
|
|
71
74
|
variant: "secondary",
|
|
72
|
-
children:
|
|
73
|
-
}), /* @__PURE__ */ r(
|
|
75
|
+
children: n.formatMessage(m.clear)
|
|
76
|
+
}), /* @__PURE__ */ r(i.Close, {
|
|
74
77
|
children: /* @__PURE__ */ r(y, {
|
|
75
|
-
disabled:
|
|
76
|
-
onClick:
|
|
78
|
+
disabled: w(s, e),
|
|
79
|
+
onClick: M,
|
|
77
80
|
size: "small",
|
|
78
81
|
type: o,
|
|
79
82
|
variant: "primary",
|
|
80
|
-
children:
|
|
83
|
+
children: n.formatMessage(m.apply)
|
|
81
84
|
})
|
|
82
85
|
})]
|
|
83
86
|
})]
|
|
@@ -86,6 +89,6 @@ function J(t) {
|
|
|
86
89
|
});
|
|
87
90
|
}
|
|
88
91
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
92
|
+
X as BoxItemTypeSelectorQuickFilter,
|
|
93
|
+
X as default
|
|
91
94
|
};
|
package/dist/i18n/en-x-pseudo.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
export default {
|
|
2
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType": "⟦萬
|
|
3
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType": "⟦萬萬
|
|
4
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType": "⟦萬萬
|
|
5
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType": "⟦萬萬
|
|
6
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType": "⟦萬萬
|
|
7
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType": "⟦萬
|
|
2
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType": "⟦萬 Āūďϊö 國⟧",
|
|
3
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType": "⟦萬萬 Бō× Ĉăлνāş 國國⟧",
|
|
4
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType": "⟦萬萬 Βо× Νõŧé 國國⟧",
|
|
5
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType": "⟦萬萬 Ďôčűmëņτ 國國⟧",
|
|
6
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType": "⟦萬萬 Ďŕâώìņĝ 國國⟧",
|
|
7
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType": "⟦萬 Îmåĝé 國⟧",
|
|
8
8
|
"groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles": "⟦萬萬萬 {fileType} +{count} 國國國⟧",
|
|
9
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType": "⟦ P
|
|
10
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType": "⟦萬萬萬 P
|
|
11
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType": "⟦萬萬萬
|
|
9
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType": "⟦ PĎ₣ ⟧",
|
|
10
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType": "⟦萬萬萬 Pŕĕşěŋτáŧίőл 國國國⟧",
|
|
11
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType": "⟦萬萬萬 ЅΡřεąďśĥεëτ 國國國⟧",
|
|
12
12
|
"groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType": "⟦ 3Ð ⟧",
|
|
13
|
-
"groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType": "⟦萬 V
|
|
14
|
-
"groupSharedFeatures.boxItemTypeSelector.itemType.fileType": "⟦萬
|
|
15
|
-
"groupSharedFeatures.boxItemTypeSelector.itemType.folderType": "⟦萬萬
|
|
16
|
-
"groupSharedFeatures.boxItemTypeSelector.quickFilter.apply": "⟦萬
|
|
17
|
-
"groupSharedFeatures.boxItemTypeSelector.quickFilter.clear": "⟦萬
|
|
18
|
-
"groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown": "⟦萬萬
|
|
13
|
+
"groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType": "⟦萬 Vіďěό 國⟧",
|
|
14
|
+
"groupSharedFeatures.boxItemTypeSelector.itemType.fileType": "⟦萬 ₣îľέś 國⟧",
|
|
15
|
+
"groupSharedFeatures.boxItemTypeSelector.itemType.folderType": "⟦萬萬 ₣ôĺďέгѕ 國國⟧",
|
|
16
|
+
"groupSharedFeatures.boxItemTypeSelector.quickFilter.apply": "⟦萬 ǺΡΡľγ 國⟧",
|
|
17
|
+
"groupSharedFeatures.boxItemTypeSelector.quickFilter.clear": "⟦萬 Čľєäŕ 國⟧",
|
|
18
|
+
"groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown": "⟦萬萬 ₣їľę ŤÿΡé 國國⟧"
|
|
19
19
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
# Label for the audio file type
|
|
2
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType = ⟦萬
|
|
2
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.audioType = ⟦萬 Āūďϊö 國⟧
|
|
3
3
|
# Label for the Box Canvas file type
|
|
4
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType = ⟦萬萬
|
|
4
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.boxcanvasType = ⟦萬萬 Бō× Ĉăлνāş 國國⟧
|
|
5
5
|
# Label for the Box Note file type
|
|
6
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType = ⟦萬萬
|
|
6
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.boxnoteType = ⟦萬萬 Βо× Νõŧé 國國⟧
|
|
7
7
|
# Label for the document file type
|
|
8
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType = ⟦萬萬
|
|
8
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.documentType = ⟦萬萬 Ďôčűmëņτ 國國⟧
|
|
9
9
|
# Label for the drawing file type
|
|
10
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType = ⟦萬萬
|
|
10
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.drawingType = ⟦萬萬 Ďŕâώìņĝ 國國⟧
|
|
11
11
|
# Label for the image file type
|
|
12
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType = ⟦萬
|
|
12
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.imageType = ⟦萬 Îmåĝé 國⟧
|
|
13
13
|
# Label for multiple file types
|
|
14
14
|
groupSharedFeatures.boxItemTypeSelector.boxFileType.multipleFiles = ⟦萬萬萬 {fileType} +{count} 國國國⟧
|
|
15
15
|
# Label for the PDF file type
|
|
16
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType = ⟦ P
|
|
16
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.pdfType = ⟦ PĎ₣ ⟧
|
|
17
17
|
# Label for the presentation file type
|
|
18
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType = ⟦萬萬萬 P
|
|
18
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.presentationType = ⟦萬萬萬 Pŕĕşěŋτáŧίőл 國國國⟧
|
|
19
19
|
# Label for the spreadsheet file type
|
|
20
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType = ⟦萬萬萬
|
|
20
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.spreadsheetType = ⟦萬萬萬 ЅΡřεąďśĥεëτ 國國國⟧
|
|
21
21
|
# Label for the 3D file type
|
|
22
22
|
groupSharedFeatures.boxItemTypeSelector.boxFileType.threedType = ⟦ 3Ð ⟧
|
|
23
23
|
# Label for the video file type
|
|
24
|
-
groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType = ⟦萬 V
|
|
24
|
+
groupSharedFeatures.boxItemTypeSelector.boxFileType.videoType = ⟦萬 Vіďěό 國⟧
|
|
25
25
|
# Label for the checkbox item type selector representing files
|
|
26
|
-
groupSharedFeatures.boxItemTypeSelector.itemType.fileType = ⟦萬
|
|
26
|
+
groupSharedFeatures.boxItemTypeSelector.itemType.fileType = ⟦萬 ₣îľέś 國⟧
|
|
27
27
|
# Label for the checkbox item type selector representing folders
|
|
28
|
-
groupSharedFeatures.boxItemTypeSelector.itemType.folderType = ⟦萬萬
|
|
28
|
+
groupSharedFeatures.boxItemTypeSelector.itemType.folderType = ⟦萬萬 ₣ôĺďέгѕ 國國⟧
|
|
29
29
|
# Label for the button in the selector to apply the selected filters
|
|
30
|
-
groupSharedFeatures.boxItemTypeSelector.quickFilter.apply = ⟦萬
|
|
30
|
+
groupSharedFeatures.boxItemTypeSelector.quickFilter.apply = ⟦萬 ǺΡΡľγ 國⟧
|
|
31
31
|
# Label for the button in the selector to clear all the selected filters
|
|
32
|
-
groupSharedFeatures.boxItemTypeSelector.quickFilter.clear = ⟦萬
|
|
32
|
+
groupSharedFeatures.boxItemTypeSelector.quickFilter.clear = ⟦萬 Čľєäŕ 國⟧
|
|
33
33
|
# Label for the dropdown chip when no specific selection has been made
|
|
34
|
-
groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown = ⟦萬萬
|
|
34
|
+
groupSharedFeatures.boxItemTypeSelector.quickFilter.fileTypeLabelDropdown = ⟦萬萬 ₣їľę ŤÿΡé 國國⟧
|
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@box/box-item-type-selector",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@box/blueprint-web": "^12.
|
|
6
|
-
"@box/blueprint-web-assets": "^4.
|
|
5
|
+
"@box/blueprint-web": "^12.104.1",
|
|
6
|
+
"@box/blueprint-web-assets": "^4.87.0",
|
|
7
7
|
"react": "^17.0.0 || ^18.0.0",
|
|
8
8
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
9
9
|
"react-intl": "6.4.2"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@box/blueprint-web": "^12.
|
|
13
|
-
"@box/blueprint-web-assets": "^4.
|
|
14
|
-
"@box/storybook-utils": "^0.14.
|
|
12
|
+
"@box/blueprint-web": "^12.104.1",
|
|
13
|
+
"@box/blueprint-web-assets": "^4.87.0",
|
|
14
|
+
"@box/storybook-utils": "^0.14.27",
|
|
15
15
|
"react": "^18.3.0",
|
|
16
16
|
"react-dom": "^18.3.0",
|
|
17
17
|
"react-intl": "6.4.2"
|