@patternfly/react-core 3.144.1 → 3.146.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/CHANGELOG.md +46 -0
- package/dist/esm/components/DataToolbar/DataToolbarFilter.js +16 -5
- package/dist/esm/components/Drawer/Drawer.js +26 -36
- package/dist/esm/components/Drawer/DrawerActions.js +28 -0
- package/dist/esm/components/Drawer/DrawerCloseButton.js +36 -0
- package/dist/esm/components/Drawer/DrawerContent.js +9 -6
- package/dist/esm/components/Drawer/DrawerContentBody.js +30 -0
- package/dist/esm/components/Drawer/DrawerHead.js +33 -0
- package/dist/esm/components/Drawer/DrawerMain.js +28 -0
- package/dist/esm/components/Drawer/DrawerPanelBody.js +30 -0
- package/dist/esm/components/Drawer/DrawerPanelContent.js +12 -8
- package/dist/esm/components/Drawer/DrawerSection.js +28 -0
- package/dist/esm/components/Drawer/index.js +7 -1
- package/dist/esm/components/Dropdown/Toggle.js +3 -1
- package/dist/esm/components/FileUpload/FileUpload.js +123 -0
- package/dist/esm/components/FileUpload/FileUploadField.js +123 -0
- package/dist/esm/components/FileUpload/index.js +3 -0
- package/dist/esm/components/Modal/ModalBoxDescription.js +30 -0
- package/dist/esm/components/Modal/ModalContent.js +2 -3
- package/dist/esm/components/Select/Select.js +70 -36
- package/dist/esm/components/Select/SelectMenu.js +34 -25
- package/dist/esm/components/Select/SelectOption.js +15 -5
- package/dist/esm/components/Select/SelectToggle.js +6 -3
- package/dist/esm/components/index.js +1 -0
- package/dist/esm/helpers/fileUtils.js +32 -0
- package/dist/esm/helpers/util.js +1 -1
- package/dist/js/components/DataToolbar/DataToolbarFilter.d.ts +8 -2
- package/dist/js/components/DataToolbar/DataToolbarFilter.js +21 -12
- package/dist/js/components/Drawer/Drawer.d.ts +7 -6
- package/dist/js/components/Drawer/Drawer.js +32 -67
- package/dist/js/components/Drawer/DrawerActions.d.ts +8 -0
- package/dist/js/components/Drawer/DrawerActions.js +44 -0
- package/dist/js/components/Drawer/DrawerCloseButton.d.ts +10 -0
- package/dist/js/components/Drawer/DrawerCloseButton.js +58 -0
- package/dist/js/components/Drawer/DrawerContent.d.ts +3 -1
- package/dist/js/components/Drawer/DrawerContent.js +9 -5
- package/dist/js/components/Drawer/DrawerContentBody.d.ts +10 -0
- package/dist/js/components/Drawer/DrawerContentBody.js +47 -0
- package/dist/js/components/Drawer/DrawerHead.d.ts +10 -0
- package/dist/js/components/Drawer/DrawerHead.js +51 -0
- package/dist/js/components/Drawer/DrawerMain.d.ts +8 -0
- package/dist/js/components/Drawer/DrawerMain.js +44 -0
- package/dist/js/components/Drawer/DrawerPanelBody.d.ts +10 -0
- package/dist/js/components/Drawer/DrawerPanelBody.js +47 -0
- package/dist/js/components/Drawer/DrawerPanelContent.d.ts +3 -4
- package/dist/js/components/Drawer/DrawerPanelContent.js +16 -10
- package/dist/js/components/Drawer/DrawerSection.d.ts +8 -0
- package/dist/js/components/Drawer/DrawerSection.js +44 -0
- package/dist/js/components/Drawer/index.d.ts +7 -1
- package/dist/js/components/Drawer/index.js +75 -3
- package/dist/js/components/Dropdown/Toggle.js +2 -1
- package/dist/js/components/FileUpload/FileUpload.d.ts +57 -0
- package/dist/js/components/FileUpload/FileUpload.js +151 -0
- package/dist/js/components/FileUpload/FileUploadField.d.ts +57 -0
- package/dist/js/components/FileUpload/FileUploadField.js +167 -0
- package/dist/js/components/FileUpload/index.d.ts +2 -0
- package/dist/js/components/FileUpload/index.js +30 -0
- package/dist/js/components/Modal/ModalBoxDescription.d.ts +10 -0
- package/dist/js/components/Modal/ModalBoxDescription.js +49 -0
- package/dist/js/components/Modal/ModalContent.js +3 -4
- package/dist/js/components/Select/Select.d.ts +2 -0
- package/dist/js/components/Select/Select.js +79 -35
- package/dist/js/components/Select/SelectMenu.d.ts +3 -1
- package/dist/js/components/Select/SelectMenu.js +30 -14
- package/dist/js/components/Select/SelectOption.d.ts +2 -0
- package/dist/js/components/Select/SelectOption.js +15 -5
- package/dist/js/components/Select/SelectToggle.d.ts +2 -0
- package/dist/js/components/Select/SelectToggle.js +6 -3
- package/dist/js/components/index.d.ts +1 -0
- package/dist/js/components/index.js +12 -0
- package/dist/js/helpers/fileUtils.d.ts +12 -0
- package/dist/js/helpers/fileUtils.js +45 -0
- package/dist/js/helpers/util.js +3 -1
- package/dist/umd/components/DataToolbar/DataToolbarFilter.js +16 -5
- package/dist/umd/components/Drawer/Drawer.js +27 -50
- package/dist/umd/components/Drawer/DrawerActions.js +154 -0
- package/dist/umd/components/Drawer/DrawerCloseButton.js +162 -0
- package/dist/umd/components/Drawer/DrawerContent.js +12 -10
- package/dist/umd/components/Drawer/DrawerContentBody.js +156 -0
- package/dist/umd/components/Drawer/DrawerHead.js +158 -0
- package/dist/umd/components/Drawer/DrawerMain.js +154 -0
- package/dist/umd/components/Drawer/DrawerPanelBody.js +156 -0
- package/dist/umd/components/Drawer/DrawerPanelContent.js +16 -13
- package/dist/umd/components/Drawer/DrawerSection.js +154 -0
- package/dist/umd/components/Drawer/index.js +60 -6
- package/dist/umd/components/Dropdown/Toggle.js +3 -1
- package/dist/umd/components/FileUpload/FileUpload.js +291 -0
- package/dist/umd/components/FileUpload/FileUploadField.js +243 -0
- package/dist/umd/components/FileUpload/index.js +38 -0
- package/dist/umd/components/Modal/ModalBoxDescription.js +156 -0
- package/dist/umd/components/Modal/ModalContent.js +5 -8
- package/dist/umd/components/Select/Select.js +71 -38
- package/dist/umd/components/Select/SelectMenu.js +37 -29
- package/dist/umd/components/Select/SelectOption.js +15 -5
- package/dist/umd/components/Select/SelectToggle.js +6 -3
- package/dist/umd/components/index.js +13 -4
- package/dist/umd/helpers/fileUtils.js +52 -0
- package/dist/umd/helpers/util.js +1 -1
- package/package.json +7 -6
- package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap +0 -6
- package/src/components/DataToolbar/DataToolbarFilter.tsx +18 -6
- package/src/components/DataToolbar/__tests__/__snapshots__/DataToolbar.test.tsx.snap +16 -0
- package/src/components/Drawer/Drawer.tsx +36 -31
- package/src/components/Drawer/DrawerActions.tsx +21 -0
- package/src/components/Drawer/DrawerCloseButton.tsx +28 -0
- package/src/components/Drawer/DrawerContent.tsx +11 -4
- package/src/components/Drawer/DrawerContentBody.tsx +24 -0
- package/src/components/Drawer/DrawerHead.tsx +27 -0
- package/src/components/Drawer/DrawerMain.tsx +21 -0
- package/src/components/Drawer/DrawerPanelBody.tsx +24 -0
- package/src/components/Drawer/DrawerPanelContent.tsx +19 -8
- package/src/components/Drawer/DrawerSection.tsx +21 -0
- package/src/components/Drawer/__tests__/Drawer.test.tsx +24 -13
- package/src/components/Drawer/__tests__/Generated/__snapshots__/Drawer.test.tsx.snap +13 -5
- package/src/components/Drawer/__tests__/Generated/__snapshots__/DrawerContent.test.tsx.snap +8 -6
- package/src/components/Drawer/__tests__/Generated/__snapshots__/DrawerPanelContent.test.tsx.snap +3 -11
- package/src/components/Drawer/__tests__/__snapshots__/Drawer.test.tsx.snap +764 -69
- package/src/components/Drawer/examples/Drawer.md +434 -11
- package/src/components/Drawer/index.ts +7 -1
- package/src/components/Dropdown/Toggle.tsx +2 -0
- package/src/components/Dropdown/__tests__/__snapshots__/Dropdown.test.tsx.snap +0 -14
- package/src/components/Dropdown/__tests__/__snapshots__/DropdownToggle.test.tsx.snap +0 -5
- package/src/components/Dropdown/__tests__/__snapshots__/Toggle.test.tsx.snap +0 -2
- package/src/components/FileUpload/FileUpload.tsx +150 -0
- package/src/components/FileUpload/FileUploadField.tsx +176 -0
- package/src/components/FileUpload/__tests__/FileUpload.test.tsx +22 -0
- package/src/components/FileUpload/__tests__/FileUploadField.test.tsx +27 -0
- package/src/components/FileUpload/__tests__/__snapshots__/FileUpload.test.tsx.snap +16 -0
- package/src/components/FileUpload/__tests__/__snapshots__/FileUploadField.test.tsx.snap +60 -0
- package/src/components/FileUpload/examples/FileUpload.md +283 -0
- package/src/components/FileUpload/index.ts +2 -0
- package/src/components/Modal/ModalBoxDescription.tsx +23 -0
- package/src/components/Modal/ModalContent.tsx +2 -6
- package/src/components/Modal/__tests__/__snapshots__/ModalContent.test.tsx.snap +2 -3
- package/src/components/OptionsMenu/__tests__/__snapshots__/OptionsMenu.test.tsx.snap +0 -7
- package/src/components/Pagination/__tests__/__snapshots__/Pagination.test.tsx.snap +0 -13
- package/src/components/Select/Select.tsx +74 -33
- package/src/components/Select/SelectMenu.tsx +28 -23
- package/src/components/Select/SelectOption.tsx +28 -3
- package/src/components/Select/SelectToggle.tsx +6 -1
- package/src/components/Select/__tests__/Select.test.tsx +16 -0
- package/src/components/Select/__tests__/__snapshots__/Select.test.tsx.snap +911 -174
- package/src/components/Select/__tests__/__snapshots__/SelectOption.test.tsx.snap +7 -7
- package/src/components/Select/__tests__/__snapshots__/SelectToggle.test.tsx.snap +3 -0
- package/src/components/Select/examples/Select.md +109 -6
- package/src/components/index.ts +1 -0
- package/src/helpers/__tests__/fileUtils.test.ts +17 -0
- package/src/helpers/fileUtils.ts +26 -0
- package/src/helpers/util.ts +1 -1
- package/src/components/Drawer/Drawer.test.tsx +0 -22
- package/src/components/Drawer/__snapshots__/Drawer.test.tsx.snap +0 -121
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
if (typeof define === "function" && define.amd) {
|
|
3
|
-
define(["exports", "./AboutModal", "./Accordion", "./Alert", "./AlertGroup", "./ApplicationLauncher", "./Avatar", "./Backdrop", "./BackgroundImage", "./Badge", "./Brand", "./Breadcrumb", "./Button", "./Card", "./Checkbox", "./ChipGroup", "./ClipboardCopy", "./ContextSelector", "./DataList", "./Dropdown", "./EmptyState", "./Expandable", "./Form", "./FormSelect", "./InputGroup", "./Label", "./List", "./LoginPage", "./Modal", "./Nav", "./NotificationBadge", "./OptionsMenu", "./Page", "./Pagination", "./Popover", "./Progress", "./Radio", "./Select", "./SimpleList", "./SkipToContent", "./Switch", "./Tabs", "./Text", "./TextArea", "./TextInput", "./Title", "./Tooltip", "./Wizard", "./withOuia"], factory);
|
|
3
|
+
define(["exports", "./AboutModal", "./Accordion", "./Alert", "./AlertGroup", "./ApplicationLauncher", "./Avatar", "./Backdrop", "./BackgroundImage", "./Badge", "./Brand", "./Breadcrumb", "./Button", "./Card", "./Checkbox", "./ChipGroup", "./ClipboardCopy", "./ContextSelector", "./DataList", "./Dropdown", "./EmptyState", "./Expandable", "./FileUpload", "./Form", "./FormSelect", "./InputGroup", "./Label", "./List", "./LoginPage", "./Modal", "./Nav", "./NotificationBadge", "./OptionsMenu", "./Page", "./Pagination", "./Popover", "./Progress", "./Radio", "./Select", "./SimpleList", "./SkipToContent", "./Switch", "./Tabs", "./Text", "./TextArea", "./TextInput", "./Title", "./Tooltip", "./Wizard", "./withOuia"], factory);
|
|
4
4
|
} else if (typeof exports !== "undefined") {
|
|
5
|
-
factory(exports, require("./AboutModal"), require("./Accordion"), require("./Alert"), require("./AlertGroup"), require("./ApplicationLauncher"), require("./Avatar"), require("./Backdrop"), require("./BackgroundImage"), require("./Badge"), require("./Brand"), require("./Breadcrumb"), require("./Button"), require("./Card"), require("./Checkbox"), require("./ChipGroup"), require("./ClipboardCopy"), require("./ContextSelector"), require("./DataList"), require("./Dropdown"), require("./EmptyState"), require("./Expandable"), require("./Form"), require("./FormSelect"), require("./InputGroup"), require("./Label"), require("./List"), require("./LoginPage"), require("./Modal"), require("./Nav"), require("./NotificationBadge"), require("./OptionsMenu"), require("./Page"), require("./Pagination"), require("./Popover"), require("./Progress"), require("./Radio"), require("./Select"), require("./SimpleList"), require("./SkipToContent"), require("./Switch"), require("./Tabs"), require("./Text"), require("./TextArea"), require("./TextInput"), require("./Title"), require("./Tooltip"), require("./Wizard"), require("./withOuia"));
|
|
5
|
+
factory(exports, require("./AboutModal"), require("./Accordion"), require("./Alert"), require("./AlertGroup"), require("./ApplicationLauncher"), require("./Avatar"), require("./Backdrop"), require("./BackgroundImage"), require("./Badge"), require("./Brand"), require("./Breadcrumb"), require("./Button"), require("./Card"), require("./Checkbox"), require("./ChipGroup"), require("./ClipboardCopy"), require("./ContextSelector"), require("./DataList"), require("./Dropdown"), require("./EmptyState"), require("./Expandable"), require("./FileUpload"), require("./Form"), require("./FormSelect"), require("./InputGroup"), require("./Label"), require("./List"), require("./LoginPage"), require("./Modal"), require("./Nav"), require("./NotificationBadge"), require("./OptionsMenu"), require("./Page"), require("./Pagination"), require("./Popover"), require("./Progress"), require("./Radio"), require("./Select"), require("./SimpleList"), require("./SkipToContent"), require("./Switch"), require("./Tabs"), require("./Text"), require("./TextArea"), require("./TextInput"), require("./Title"), require("./Tooltip"), require("./Wizard"), require("./withOuia"));
|
|
6
6
|
} else {
|
|
7
7
|
var mod = {
|
|
8
8
|
exports: {}
|
|
9
9
|
};
|
|
10
|
-
factory(mod.exports, global.AboutModal, global.Accordion, global.Alert, global.AlertGroup, global.ApplicationLauncher, global.Avatar, global.Backdrop, global.BackgroundImage, global.Badge, global.Brand, global.Breadcrumb, global.Button, global.Card, global.Checkbox, global.ChipGroup, global.ClipboardCopy, global.ContextSelector, global.DataList, global.Dropdown, global.EmptyState, global.Expandable, global.Form, global.FormSelect, global.InputGroup, global.Label, global.List, global.LoginPage, global.Modal, global.Nav, global.NotificationBadge, global.OptionsMenu, global.Page, global.Pagination, global.Popover, global.Progress, global.Radio, global.Select, global.SimpleList, global.SkipToContent, global.Switch, global.Tabs, global.Text, global.TextArea, global.TextInput, global.Title, global.Tooltip, global.Wizard, global.withOuia);
|
|
10
|
+
factory(mod.exports, global.AboutModal, global.Accordion, global.Alert, global.AlertGroup, global.ApplicationLauncher, global.Avatar, global.Backdrop, global.BackgroundImage, global.Badge, global.Brand, global.Breadcrumb, global.Button, global.Card, global.Checkbox, global.ChipGroup, global.ClipboardCopy, global.ContextSelector, global.DataList, global.Dropdown, global.EmptyState, global.Expandable, global.FileUpload, global.Form, global.FormSelect, global.InputGroup, global.Label, global.List, global.LoginPage, global.Modal, global.Nav, global.NotificationBadge, global.OptionsMenu, global.Page, global.Pagination, global.Popover, global.Progress, global.Radio, global.Select, global.SimpleList, global.SkipToContent, global.Switch, global.Tabs, global.Text, global.TextArea, global.TextInput, global.Title, global.Tooltip, global.Wizard, global.withOuia);
|
|
11
11
|
global.undefined = mod.exports;
|
|
12
12
|
}
|
|
13
|
-
})(this, function (exports, _AboutModal, _Accordion, _Alert, _AlertGroup, _ApplicationLauncher, _Avatar, _Backdrop, _BackgroundImage, _Badge, _Brand, _Breadcrumb, _Button, _Card, _Checkbox, _ChipGroup, _ClipboardCopy, _ContextSelector, _DataList, _Dropdown, _EmptyState, _Expandable, _Form, _FormSelect, _InputGroup, _Label, _List, _LoginPage, _Modal, _Nav, _NotificationBadge, _OptionsMenu, _Page, _Pagination, _Popover, _Progress, _Radio, _Select, _SimpleList, _SkipToContent, _Switch, _Tabs, _Text, _TextArea, _TextInput, _Title, _Tooltip, _Wizard, _withOuia) {
|
|
13
|
+
})(this, function (exports, _AboutModal, _Accordion, _Alert, _AlertGroup, _ApplicationLauncher, _Avatar, _Backdrop, _BackgroundImage, _Badge, _Brand, _Breadcrumb, _Button, _Card, _Checkbox, _ChipGroup, _ClipboardCopy, _ContextSelector, _DataList, _Dropdown, _EmptyState, _Expandable, _FileUpload, _Form, _FormSelect, _InputGroup, _Label, _List, _LoginPage, _Modal, _Nav, _NotificationBadge, _OptionsMenu, _Page, _Pagination, _Popover, _Progress, _Radio, _Select, _SimpleList, _SkipToContent, _Switch, _Tabs, _Text, _TextArea, _TextInput, _Title, _Tooltip, _Wizard, _withOuia) {
|
|
14
14
|
"use strict";
|
|
15
15
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -205,6 +205,15 @@
|
|
|
205
205
|
}
|
|
206
206
|
});
|
|
207
207
|
});
|
|
208
|
+
Object.keys(_FileUpload).forEach(function (key) {
|
|
209
|
+
if (key === "default" || key === "__esModule") return;
|
|
210
|
+
Object.defineProperty(exports, key, {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () {
|
|
213
|
+
return _FileUpload[key];
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
});
|
|
208
217
|
Object.keys(_Form).forEach(function (key) {
|
|
209
218
|
if (key === "default" || key === "__esModule") return;
|
|
210
219
|
Object.defineProperty(exports, key, {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
(function (global, factory) {
|
|
2
|
+
if (typeof define === "function" && define.amd) {
|
|
3
|
+
define(["exports"], factory);
|
|
4
|
+
} else if (typeof exports !== "undefined") {
|
|
5
|
+
factory(exports);
|
|
6
|
+
} else {
|
|
7
|
+
var mod = {
|
|
8
|
+
exports: {}
|
|
9
|
+
};
|
|
10
|
+
factory(mod.exports);
|
|
11
|
+
global.undefined = mod.exports;
|
|
12
|
+
}
|
|
13
|
+
})(this, function (exports) {
|
|
14
|
+
"use strict";
|
|
15
|
+
|
|
16
|
+
Object.defineProperty(exports, "__esModule", {
|
|
17
|
+
value: true
|
|
18
|
+
});
|
|
19
|
+
exports.readFile = readFile;
|
|
20
|
+
let fileReaderType = exports.fileReaderType = undefined;
|
|
21
|
+
/**
|
|
22
|
+
* Read a file using the FileReader API, either as a plain text string or as a DataURL string.
|
|
23
|
+
* Returns a promise which will resolve with the file contents as a string or reject with a DOMException.
|
|
24
|
+
*
|
|
25
|
+
* @param {File} fileHandle - File object to read
|
|
26
|
+
* @param {fileReaderType} type - How to read it
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
(function (fileReaderType) {
|
|
30
|
+
fileReaderType["text"] = "text";
|
|
31
|
+
fileReaderType["dataURL"] = "dataURL";
|
|
32
|
+
})(fileReaderType || (exports.fileReaderType = fileReaderType = {}));
|
|
33
|
+
|
|
34
|
+
function readFile(fileHandle, type) {
|
|
35
|
+
return new Promise((resolve, reject) => {
|
|
36
|
+
const reader = new FileReader();
|
|
37
|
+
|
|
38
|
+
reader.onload = () => resolve(reader.result);
|
|
39
|
+
|
|
40
|
+
reader.onerror = () => reject(reader.error);
|
|
41
|
+
|
|
42
|
+
if (type === fileReaderType.text) {
|
|
43
|
+
reader.readAsText(fileHandle);
|
|
44
|
+
} else if (type === fileReaderType.dataURL) {
|
|
45
|
+
reader.readAsDataURL(fileHandle);
|
|
46
|
+
} else {
|
|
47
|
+
reject('unknown type');
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=fileUtils.js.map
|
package/dist/umd/helpers/util.js
CHANGED
|
@@ -202,7 +202,7 @@
|
|
|
202
202
|
return;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
const isMultiDimensional = refsCollection[0].constructor === Array;
|
|
205
|
+
const isMultiDimensional = refsCollection.filter(ref => ref)[0].constructor === Array;
|
|
206
206
|
let nextIndex = index;
|
|
207
207
|
let nextInnerIndex = innerIndex;
|
|
208
208
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/react-core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.146.0",
|
|
4
4
|
"description": "This library provides a set of common React components for use with the PatternFly reference implementation.",
|
|
5
5
|
"main": "dist/js/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -40,12 +40,13 @@
|
|
|
40
40
|
"gen:tests": "yo tsx-docgen"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@patternfly/react-icons": "^3.15.
|
|
44
|
-
"@patternfly/react-styles": "^3.7.
|
|
45
|
-
"@patternfly/react-tokens": "^2.8.
|
|
43
|
+
"@patternfly/react-icons": "^3.15.11",
|
|
44
|
+
"@patternfly/react-styles": "^3.7.8",
|
|
45
|
+
"@patternfly/react-tokens": "^2.8.8",
|
|
46
46
|
"emotion": "^9.2.9",
|
|
47
47
|
"exenv": "^1.2.2",
|
|
48
48
|
"focus-trap-react": "^4.0.1",
|
|
49
|
+
"react-dropzone": "9.0.0",
|
|
49
50
|
"tippy.js": "5.1.2"
|
|
50
51
|
},
|
|
51
52
|
"devDependencies": {
|
|
@@ -57,7 +58,7 @@
|
|
|
57
58
|
"@babel/plugin-transform-typescript": "^7.0.0",
|
|
58
59
|
"@babel/preset-env": "^7.0.0",
|
|
59
60
|
"@babel/preset-react": "^7.0.0",
|
|
60
|
-
"@patternfly/patternfly": "2.
|
|
61
|
+
"@patternfly/patternfly": "2.68.3",
|
|
61
62
|
"@types/exenv": "^1.2.0",
|
|
62
63
|
"@types/jest": "^24.0.11",
|
|
63
64
|
"@types/react": "^16.4.0",
|
|
@@ -77,5 +78,5 @@
|
|
|
77
78
|
"react": "^16.4.0",
|
|
78
79
|
"react-dom": "^15.6.2 || ^16.4.0"
|
|
79
80
|
},
|
|
80
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "03e6dda724f83ae37584414ead6ab602cacf8aa7"
|
|
81
82
|
}
|
package/src/components/ApplicationLauncher/__tests__/__snapshots__/ApplicationLauncher.test.tsx.snap
CHANGED
|
@@ -508,7 +508,6 @@ exports[`ApplicationLauncher custom icon 1`] = `
|
|
|
508
508
|
aria-expanded={true}
|
|
509
509
|
aria-haspopup={true}
|
|
510
510
|
aria-label="Application launcher"
|
|
511
|
-
bubbleEvent={false}
|
|
512
511
|
className="pf-c-app-launcher__toggle"
|
|
513
512
|
disabled={false}
|
|
514
513
|
id="pf-toggle-id-5"
|
|
@@ -1215,7 +1214,6 @@ exports[`ApplicationLauncher dropup + right aligned 1`] = `
|
|
|
1215
1214
|
aria-expanded={false}
|
|
1216
1215
|
aria-haspopup={true}
|
|
1217
1216
|
aria-label="Application launcher"
|
|
1218
|
-
bubbleEvent={false}
|
|
1219
1217
|
className="pf-c-app-launcher__toggle"
|
|
1220
1218
|
disabled={false}
|
|
1221
1219
|
id="pf-toggle-id-3"
|
|
@@ -1605,7 +1603,6 @@ exports[`ApplicationLauncher dropup 1`] = `
|
|
|
1605
1603
|
aria-expanded={false}
|
|
1606
1604
|
aria-haspopup={true}
|
|
1607
1605
|
aria-label="Application launcher"
|
|
1608
|
-
bubbleEvent={false}
|
|
1609
1606
|
className="pf-c-app-launcher__toggle"
|
|
1610
1607
|
disabled={false}
|
|
1611
1608
|
id="pf-toggle-id-2"
|
|
@@ -2155,7 +2152,6 @@ exports[`ApplicationLauncher expanded 1`] = `
|
|
|
2155
2152
|
aria-expanded={true}
|
|
2156
2153
|
aria-haspopup={true}
|
|
2157
2154
|
aria-label="Application launcher"
|
|
2158
|
-
bubbleEvent={false}
|
|
2159
2155
|
className="pf-c-app-launcher__toggle"
|
|
2160
2156
|
disabled={false}
|
|
2161
2157
|
id="pf-toggle-id-4"
|
|
@@ -2860,7 +2856,6 @@ exports[`ApplicationLauncher regular 1`] = `
|
|
|
2860
2856
|
aria-expanded={false}
|
|
2861
2857
|
aria-haspopup={true}
|
|
2862
2858
|
aria-label="Application launcher"
|
|
2863
|
-
bubbleEvent={false}
|
|
2864
2859
|
className="pf-c-app-launcher__toggle"
|
|
2865
2860
|
disabled={false}
|
|
2866
2861
|
id="pf-toggle-id-0"
|
|
@@ -3250,7 +3245,6 @@ exports[`ApplicationLauncher right aligned 1`] = `
|
|
|
3250
3245
|
aria-expanded={false}
|
|
3251
3246
|
aria-haspopup={true}
|
|
3252
3247
|
aria-label="Application launcher"
|
|
3253
|
-
bubbleEvent={false}
|
|
3254
3248
|
className="pf-c-app-launcher__toggle"
|
|
3255
3249
|
disabled={false}
|
|
3256
3250
|
id="pf-toggle-id-1"
|
|
@@ -5,6 +5,13 @@ import { ChipGroup, Chip, ChipGroupToolbarItem } from '../../components/ChipGrou
|
|
|
5
5
|
import { DataToolbarContentContext, DataToolbarContext } from './DataToolbarUtils';
|
|
6
6
|
import { PickOptional } from '../../helpers/typeUtils';
|
|
7
7
|
|
|
8
|
+
export interface DataToolbarChipGroup {
|
|
9
|
+
/** A unique key to identify this chip group category */
|
|
10
|
+
key: string;
|
|
11
|
+
/** The category name to display for the chip group */
|
|
12
|
+
name: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
export interface DataToolbarChip {
|
|
9
16
|
/** A unique key to identify this chip */
|
|
10
17
|
key: string;
|
|
@@ -16,11 +23,11 @@ export interface DataToolbarFilterProps extends DataToolbarItemProps {
|
|
|
16
23
|
/** An array of strings to be displayed as chips in the expandable content */
|
|
17
24
|
chips?: (string | DataToolbarChip)[];
|
|
18
25
|
/** Callback passed by consumer used to delete a chip from the chips[] */
|
|
19
|
-
deleteChip?: (category: string, chip: DataToolbarChip | string) => void;
|
|
26
|
+
deleteChip?: (category: string | DataToolbarChipGroup, chip: DataToolbarChip | string) => void;
|
|
20
27
|
/** Content to be rendered inside the data toolbar item associated with the chip group */
|
|
21
28
|
children: React.ReactNode;
|
|
22
29
|
/** Unique category name to be used as a label for the chip group */
|
|
23
|
-
categoryName: string;
|
|
30
|
+
categoryName: string | DataToolbarChipGroup;
|
|
24
31
|
/** Flag to show the toolbar item */
|
|
25
32
|
showToolbarItem?: boolean;
|
|
26
33
|
}
|
|
@@ -32,7 +39,7 @@ interface DataToolbarFilterState {
|
|
|
32
39
|
export class DataToolbarFilter extends React.Component<DataToolbarFilterProps, DataToolbarFilterState> {
|
|
33
40
|
static contextType: any = DataToolbarContext;
|
|
34
41
|
static defaultProps: PickOptional<DataToolbarFilterProps> = {
|
|
35
|
-
chips: [] as string[],
|
|
42
|
+
chips: [] as (string | DataToolbarChip)[],
|
|
36
43
|
showToolbarItem: true
|
|
37
44
|
};
|
|
38
45
|
|
|
@@ -44,12 +51,14 @@ export class DataToolbarFilter extends React.Component<DataToolbarFilterProps, D
|
|
|
44
51
|
}
|
|
45
52
|
|
|
46
53
|
componentDidMount() {
|
|
47
|
-
|
|
54
|
+
const { categoryName, chips } = this.props;
|
|
55
|
+
this.context.updateNumberFilters(typeof categoryName === 'string' ? categoryName : categoryName.name, chips.length);
|
|
48
56
|
this.setState({ isMounted: true });
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
componentDidUpdate() {
|
|
52
|
-
|
|
60
|
+
const { categoryName, chips } = this.props;
|
|
61
|
+
this.context.updateNumberFilters(typeof categoryName === 'string' ? categoryName : categoryName.name, chips.length);
|
|
53
62
|
}
|
|
54
63
|
|
|
55
64
|
render() {
|
|
@@ -59,7 +68,10 @@ export class DataToolbarFilter extends React.Component<DataToolbarFilterProps, D
|
|
|
59
68
|
const chipGroup = chips.length ? (
|
|
60
69
|
<DataToolbarItem variant="chip-group">
|
|
61
70
|
<ChipGroup withToolbar>
|
|
62
|
-
<ChipGroupToolbarItem
|
|
71
|
+
<ChipGroupToolbarItem
|
|
72
|
+
key={typeof categoryName === 'string' ? categoryName : categoryName.key}
|
|
73
|
+
categoryName={typeof categoryName === 'string' ? categoryName : categoryName.name}
|
|
74
|
+
>
|
|
63
75
|
{chips.map(chip =>
|
|
64
76
|
typeof chip === 'string' ? (
|
|
65
77
|
<Chip key={chip} onClick={() => deleteChip(categoryName, chip)}>
|
|
@@ -171,6 +171,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
171
171
|
isChecked={false}
|
|
172
172
|
isDisabled={false}
|
|
173
173
|
isFocused={false}
|
|
174
|
+
isNoResultsOption={false}
|
|
174
175
|
isPlaceholder={false}
|
|
175
176
|
isSelected={false}
|
|
176
177
|
keyHandler={[Function]}
|
|
@@ -185,6 +186,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
185
186
|
isChecked={false}
|
|
186
187
|
isDisabled={false}
|
|
187
188
|
isFocused={false}
|
|
189
|
+
isNoResultsOption={false}
|
|
188
190
|
isPlaceholder={false}
|
|
189
191
|
isSelected={false}
|
|
190
192
|
keyHandler={[Function]}
|
|
@@ -213,6 +215,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
213
215
|
createText="Create"
|
|
214
216
|
customContent={null}
|
|
215
217
|
direction="down"
|
|
218
|
+
hasInlineFilter={false}
|
|
216
219
|
isCreatable={false}
|
|
217
220
|
isDisabled={false}
|
|
218
221
|
isExpanded={false}
|
|
@@ -250,6 +253,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
250
253
|
ariaLabelledBy=" pf-toggle-id-4"
|
|
251
254
|
className=""
|
|
252
255
|
handleTypeaheadKeys={[Function]}
|
|
256
|
+
hasClearButton={false}
|
|
253
257
|
id="pf-toggle-id-4"
|
|
254
258
|
isActive={false}
|
|
255
259
|
isDisabled={false}
|
|
@@ -889,6 +893,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
889
893
|
isChecked={false}
|
|
890
894
|
isDisabled={false}
|
|
891
895
|
isFocused={false}
|
|
896
|
+
isNoResultsOption={false}
|
|
892
897
|
isPlaceholder={false}
|
|
893
898
|
isSelected={false}
|
|
894
899
|
keyHandler={[Function]}
|
|
@@ -903,6 +908,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
903
908
|
isChecked={false}
|
|
904
909
|
isDisabled={false}
|
|
905
910
|
isFocused={false}
|
|
911
|
+
isNoResultsOption={false}
|
|
906
912
|
isPlaceholder={false}
|
|
907
913
|
isSelected={false}
|
|
908
914
|
keyHandler={[Function]}
|
|
@@ -931,6 +937,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
931
937
|
createText="Create"
|
|
932
938
|
customContent={null}
|
|
933
939
|
direction="down"
|
|
940
|
+
hasInlineFilter={false}
|
|
934
941
|
isCreatable={false}
|
|
935
942
|
isDisabled={false}
|
|
936
943
|
isExpanded={false}
|
|
@@ -968,6 +975,7 @@ exports[`data toolbar DataToolbarFilter 1`] = `
|
|
|
968
975
|
ariaLabelledBy=" pf-toggle-id-5"
|
|
969
976
|
className=""
|
|
970
977
|
handleTypeaheadKeys={[Function]}
|
|
978
|
+
hasClearButton={false}
|
|
971
979
|
id="pf-toggle-id-5"
|
|
972
980
|
isActive={false}
|
|
973
981
|
isDisabled={false}
|
|
@@ -2355,6 +2363,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2355
2363
|
isChecked={false}
|
|
2356
2364
|
isDisabled={false}
|
|
2357
2365
|
isFocused={false}
|
|
2366
|
+
isNoResultsOption={false}
|
|
2358
2367
|
isPlaceholder={false}
|
|
2359
2368
|
isSelected={false}
|
|
2360
2369
|
keyHandler={[Function]}
|
|
@@ -2369,6 +2378,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2369
2378
|
isChecked={false}
|
|
2370
2379
|
isDisabled={false}
|
|
2371
2380
|
isFocused={false}
|
|
2381
|
+
isNoResultsOption={false}
|
|
2372
2382
|
isPlaceholder={false}
|
|
2373
2383
|
isSelected={false}
|
|
2374
2384
|
keyHandler={[Function]}
|
|
@@ -2397,6 +2407,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2397
2407
|
createText="Create"
|
|
2398
2408
|
customContent={null}
|
|
2399
2409
|
direction="down"
|
|
2410
|
+
hasInlineFilter={false}
|
|
2400
2411
|
isCreatable={false}
|
|
2401
2412
|
isDisabled={false}
|
|
2402
2413
|
isExpanded={false}
|
|
@@ -2434,6 +2445,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2434
2445
|
ariaLabelledBy=" pf-toggle-id-0"
|
|
2435
2446
|
className=""
|
|
2436
2447
|
handleTypeaheadKeys={[Function]}
|
|
2448
|
+
hasClearButton={false}
|
|
2437
2449
|
id="pf-toggle-id-0"
|
|
2438
2450
|
isActive={false}
|
|
2439
2451
|
isDisabled={false}
|
|
@@ -2569,6 +2581,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2569
2581
|
isChecked={false}
|
|
2570
2582
|
isDisabled={false}
|
|
2571
2583
|
isFocused={false}
|
|
2584
|
+
isNoResultsOption={false}
|
|
2572
2585
|
isPlaceholder={false}
|
|
2573
2586
|
isSelected={false}
|
|
2574
2587
|
keyHandler={[Function]}
|
|
@@ -2583,6 +2596,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2583
2596
|
isChecked={false}
|
|
2584
2597
|
isDisabled={false}
|
|
2585
2598
|
isFocused={false}
|
|
2599
|
+
isNoResultsOption={false}
|
|
2586
2600
|
isPlaceholder={false}
|
|
2587
2601
|
isSelected={false}
|
|
2588
2602
|
keyHandler={[Function]}
|
|
@@ -2611,6 +2625,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2611
2625
|
createText="Create"
|
|
2612
2626
|
customContent={null}
|
|
2613
2627
|
direction="down"
|
|
2628
|
+
hasInlineFilter={false}
|
|
2614
2629
|
isCreatable={false}
|
|
2615
2630
|
isDisabled={false}
|
|
2616
2631
|
isExpanded={false}
|
|
@@ -2648,6 +2663,7 @@ exports[`data toolbar DataToolbarToggleGroup 1`] = `
|
|
|
2648
2663
|
ariaLabelledBy=" pf-toggle-id-1"
|
|
2649
2664
|
className=""
|
|
2650
2665
|
handleTypeaheadKeys={[Function]}
|
|
2666
|
+
hasClearButton={false}
|
|
2651
2667
|
id="pf-toggle-id-1"
|
|
2652
2668
|
isActive={false}
|
|
2653
2669
|
isDisabled={false}
|
|
@@ -7,41 +7,46 @@ export interface DrawerProps extends React.HTMLProps<HTMLDivElement> {
|
|
|
7
7
|
className?: string;
|
|
8
8
|
/** Content rendered in the left hand panel */
|
|
9
9
|
children?: React.ReactNode;
|
|
10
|
-
/**
|
|
10
|
+
/** Indicates if the drawer is expanded */
|
|
11
11
|
isExpanded?: boolean;
|
|
12
12
|
/** Indicates if the content element and panel element are displayed side by side. */
|
|
13
13
|
isInline?: boolean;
|
|
14
|
+
/* Indicates if the drawer will always show both content and panel. */
|
|
15
|
+
isStatic?: boolean;
|
|
16
|
+
/* Position of the drawer panel */
|
|
17
|
+
position?: 'left' | 'right';
|
|
14
18
|
}
|
|
15
19
|
|
|
16
|
-
export
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
super(props);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
componentDidMount() {
|
|
23
|
-
if (!Drawer.hasWarnBeta && process.env.NODE_ENV !== 'production') {
|
|
24
|
-
// eslint-disable-next-line no-console
|
|
25
|
-
console.warn('This component is in beta and subject to change.');
|
|
26
|
-
Drawer.hasWarnBeta = true;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
20
|
+
export interface DrawerContextProps {
|
|
21
|
+
isExpanded: boolean;
|
|
22
|
+
}
|
|
29
23
|
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
export const DrawerContext = React.createContext<Partial<DrawerContextProps>>({
|
|
25
|
+
isExpanded: false
|
|
26
|
+
});
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
28
|
+
export const Drawer: React.SFC<DrawerProps> = ({
|
|
29
|
+
className = '',
|
|
30
|
+
children,
|
|
31
|
+
isExpanded = false,
|
|
32
|
+
isInline = false,
|
|
33
|
+
isStatic = false,
|
|
34
|
+
position = 'right',
|
|
35
|
+
...props
|
|
36
|
+
}: DrawerProps) => (
|
|
37
|
+
<DrawerContext.Provider value={{ isExpanded }}>
|
|
38
|
+
<div
|
|
39
|
+
className={css(
|
|
40
|
+
styles.drawer,
|
|
41
|
+
isExpanded && styles.modifiers.expanded,
|
|
42
|
+
isInline && styles.modifiers.inline,
|
|
43
|
+
isStatic && styles.modifiers.static,
|
|
44
|
+
position === 'left' && styles.modifiers.panelLeft,
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
</div>
|
|
51
|
+
</DrawerContext.Provider>
|
|
52
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
export interface DrawerActionsProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** Additional classes added to the drawer actions button. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Actions to be rendered in the panel head. */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DrawerActions: React.SFC<DrawerActionsProps> = ({
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
className = '',
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}: DrawerActionsProps) => (
|
|
18
|
+
<div className={css(styles.drawerActions, className)} {...props}>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { Button } from '../Button';
|
|
5
|
+
import TimesIcon from '@patternfly/react-icons/dist/js/icons/times-icon';
|
|
6
|
+
|
|
7
|
+
export interface DrawerCloseButtonProps extends React.HTMLProps<HTMLDivElement> {
|
|
8
|
+
/** Additional classes added to the drawer close button outer <div>. */
|
|
9
|
+
className?: string;
|
|
10
|
+
/** A callback for when the close button is clicked */
|
|
11
|
+
onClose?: () => void;
|
|
12
|
+
/** Accessible label for the drawer close button */
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export const DrawerCloseButton: React.SFC<DrawerCloseButtonProps> = ({
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
+
className = '',
|
|
19
|
+
onClose = () => undefined as any,
|
|
20
|
+
'aria-label': ariaLabel = 'Close drawer panel',
|
|
21
|
+
...props
|
|
22
|
+
}: DrawerCloseButtonProps) => (
|
|
23
|
+
<div className={css(styles.drawerClose, className)} {...props}>
|
|
24
|
+
<Button variant="plain" onClick={onClose} aria-label={ariaLabel}>
|
|
25
|
+
<TimesIcon />
|
|
26
|
+
</Button>
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
@@ -1,21 +1,28 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
3
|
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { DrawerMain } from './DrawerMain';
|
|
4
5
|
|
|
5
6
|
export interface DrawerContentProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
7
|
/** Additional classes added to the Drawer. */
|
|
7
8
|
className?: string;
|
|
8
|
-
/** Content to rendered in the drawer */
|
|
9
|
+
/** Content to be rendered in the drawer. */
|
|
9
10
|
children?: React.ReactNode;
|
|
11
|
+
/** Content rendered in the drawer panel. */
|
|
12
|
+
panelContent: React.ReactNode;
|
|
10
13
|
}
|
|
11
14
|
|
|
12
15
|
export const DrawerContent: React.SFC<DrawerContentProps> = ({
|
|
13
16
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
17
|
className = '',
|
|
15
18
|
children,
|
|
19
|
+
panelContent,
|
|
16
20
|
...props
|
|
17
21
|
}: DrawerContentProps) => (
|
|
18
|
-
<
|
|
19
|
-
{
|
|
20
|
-
|
|
22
|
+
<DrawerMain>
|
|
23
|
+
<div className={css(styles.drawerContent, className)} {...props}>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
{panelContent}
|
|
27
|
+
</DrawerMain>
|
|
21
28
|
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
export interface DrawerContentBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** Additional classes added to the Drawer. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Content to be rendered in the drawer */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Indicates if there should be padding around the drawer content body */
|
|
11
|
+
hasPadding?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const DrawerContentBody: React.SFC<DrawerContentBodyProps> = ({
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
className = '',
|
|
17
|
+
children,
|
|
18
|
+
hasPadding = false,
|
|
19
|
+
...props
|
|
20
|
+
}: DrawerContentBodyProps) => (
|
|
21
|
+
<div className={css(styles.drawerBody, hasPadding && styles.modifiers.padding, className)} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
import { DrawerPanelBody } from './DrawerPanelBody';
|
|
5
|
+
|
|
6
|
+
export interface DrawerHeadProps extends React.HTMLProps<HTMLDivElement> {
|
|
7
|
+
/** Additional classes added to the drawer head. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Content to be rendered in the drawer head */
|
|
10
|
+
children?: React.ReactNode;
|
|
11
|
+
/** Indicates if there should be no padding around the drawer panel body of the head*/
|
|
12
|
+
noPadding?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export const DrawerHead: React.SFC<DrawerHeadProps> = ({
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
17
|
+
className = '',
|
|
18
|
+
children,
|
|
19
|
+
noPadding = false,
|
|
20
|
+
...props
|
|
21
|
+
}: DrawerHeadProps) => (
|
|
22
|
+
<DrawerPanelBody noPadding={noPadding}>
|
|
23
|
+
<div className={css(styles.drawerHead, className)} {...props}>
|
|
24
|
+
{children}
|
|
25
|
+
</div>
|
|
26
|
+
</DrawerPanelBody>
|
|
27
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
export interface DrawerMainProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** Additional classes added to the drawer main wrapper. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Content to be rendered in the drawer main wrapper*/
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export const DrawerMain: React.SFC<DrawerMainProps> = ({
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
14
|
+
className = '',
|
|
15
|
+
children,
|
|
16
|
+
...props
|
|
17
|
+
}: DrawerMainProps) => (
|
|
18
|
+
<div className={css(styles.drawerMain, className)} {...props}>
|
|
19
|
+
{children}
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import styles from '@patternfly/react-styles/css/components/Drawer/drawer';
|
|
3
|
+
import { css } from '@patternfly/react-styles';
|
|
4
|
+
|
|
5
|
+
export interface DrawerPanelBodyProps extends React.HTMLProps<HTMLDivElement> {
|
|
6
|
+
/** Additional classes added to the Drawer. */
|
|
7
|
+
className?: string;
|
|
8
|
+
/** Content to be rendered in the drawer */
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
/** Indicates if there should be no padding around the drawer panel body */
|
|
11
|
+
noPadding?: boolean;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const DrawerPanelBody: React.SFC<DrawerPanelBodyProps> = ({
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
16
|
+
className = '',
|
|
17
|
+
children,
|
|
18
|
+
noPadding = false,
|
|
19
|
+
...props
|
|
20
|
+
}: DrawerPanelBodyProps) => (
|
|
21
|
+
<div className={css(styles.drawerBody, noPadding && styles.modifiers.noPadding, className)} {...props}>
|
|
22
|
+
{children}
|
|
23
|
+
</div>
|
|
24
|
+
);
|