From aad5876c464102cf966ece07887fce93a12a4ca3 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Fri, 7 Jun 2019 17:19:45 +0000 Subject: [PATCH 01/83] chore(release): releasing packages [ci skip] - @patternfly/react-docs@4.6.6 - @patternfly/react-inline-edit-extension@2.7.2 - @patternfly/react-table@2.10.2 - @patternfly/react-virtualized-extension@1.0.1 --- packages/patternfly-4/react-docs/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-docs/package.json | 2 +- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 4 ++-- packages/patternfly-4/react-table/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-table/package.json | 6 +++--- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 12 ++++++------ 8 files changed, 44 insertions(+), 12 deletions(-) create mode 100644 packages/patternfly-4/react-virtualized-extension/CHANGELOG.md diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index c3743c38623..b4733440edb 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.5...@patternfly/react-docs@4.6.6) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-docs + + + + + ## [4.6.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.4...@patternfly/react-docs@4.6.5) (2019-06-06) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index c4de0798f82..0f7e9d41ce0 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.5", + "version": "4.6.6", "author": "Red Hat", "license": "MIT", "private": true, diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index 3361d4fe556..1cf306f4eda 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.1...@patternfly/react-inline-edit-extension@2.7.2) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.0...@patternfly/react-inline-edit-extension@2.7.1) (2019-06-06) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index 898127a04b5..8e27518b8e9 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.1", + "version": "2.7.2", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ "@patternfly/react-core": "^3.36.1", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-table": "^2.10.1", + "@patternfly/react-table": "^2.10.2", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index 758970787a3..643501a19d5 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.1...@patternfly/react-table@2.10.2) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-table + + + + + ## [2.10.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.0...@patternfly/react-table@2.10.1) (2019-06-06) **Note:** Version bump only for package @patternfly/react-table diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index e85e091ab33..da34cd05acd 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.10.1", + "version": "2.10.2", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -35,10 +35,10 @@ "exenv": "^1.2.2" }, "peerDependencies": { + "lodash-es": "4.x", "prop-types": "^15.6.1", "react": "^16.4.0", - "react-dom": "^15.6.2 || ^16.4.0", - "lodash-es": "4.x" + "react-dom": "^15.6.2 || ^16.4.0" }, "scripts": { "build": "yarn build:babel && node ./scripts/copyTS.js && node ./build/copyStyles.js", diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md new file mode 100644 index 00000000000..d6a9a45c4d0 --- /dev/null +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -0,0 +1,8 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +## 1.0.1 (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index 30b4902329e..c76b8e44713 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.0", + "version": "1.0.1", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -31,12 +31,12 @@ "@patternfly/react-core": "^3.36.0", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", - "exenv": "^1.2.2", - "react-virtualized": "9.21.1", "clsx": "^1.0.1", "dom-helpers": "^2.4.0 || ^3.0.0", + "exenv": "^1.2.2", + "linear-layout-vector": "0.0.1", "react-lifecycles-compat": "^3.0.4", - "linear-layout-vector": "0.0.1" + "react-virtualized": "9.21.1" }, "peerDependencies": { "@patternfly/react-table": "^2.10.0", @@ -59,7 +59,7 @@ "css": "^2.2.3", "fs-extra": "^6.0.1", "glob": "^7.1.2", - "uuid": "^3.3.2", - "rimraf": "^2.6.2" + "rimraf": "^2.6.2", + "uuid": "^3.3.2" } } From 41d76dcf7e313c7555c9e72f75df5806abc52739 Mon Sep 17 00:00:00 2001 From: Patrick Riley Date: Fri, 7 Jun 2019 13:30:38 -0400 Subject: [PATCH 02/83] fix(react-docs): react-virtualized live edit (#2187) --- .../react-docs/src/components/componentDocs/liveEdit.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js b/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js index 3ba7f83305a..f5da4e519ee 100644 --- a/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js +++ b/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js @@ -12,6 +12,7 @@ import * as ReactInlineEdit from '@patternfly/react-inline-edit-extension'; import * as ReactStyledSystem from '@patternfly/react-styled-system'; import * as ReactStyles from '@patternfly/react-styles'; import * as ReactTable from '@patternfly/react-table'; +import * as ReactVirtualizedExtension from '@patternfly/react-virtualized-extension'; import * as ReactTokens from '@patternfly/react-tokens'; import './live-edit.scss'; @@ -46,6 +47,7 @@ export class LiveEdit extends React.Component { ...ReactStyledSystem, ...ReactStyles, ...ReactTable, + ...ReactVirtualizedExtension, ...ReactTokens } : {}; From 0bebc189a8b737a8ca44cea838c6c95443c3bb38 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Fri, 7 Jun 2019 17:45:38 +0000 Subject: [PATCH 03/83] chore(release): releasing packages [ci skip] - @patternfly/react-docs@4.6.7 --- packages/patternfly-4/react-docs/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-docs/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index b4733440edb..525cd2bec54 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.6...@patternfly/react-docs@4.6.7) (2019-06-07) + + +### Bug Fixes + +* **react-docs:** react-virtualized live edit ([#2187](https://github.com/patternfly/patternfly-react/issues/2187)) ([41d76dc](https://github.com/patternfly/patternfly-react/commit/41d76dc)) + + + + + ## [4.6.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.5...@patternfly/react-docs@4.6.6) (2019-06-07) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index 0f7e9d41ce0..b666874d7c7 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.6", + "version": "4.6.7", "author": "Red Hat", "license": "MIT", "private": true, From cb97dfdad3e334e7de31f252c92e2e739b0971cf Mon Sep 17 00:00:00 2001 From: Karel Hala Date: Fri, 7 Jun 2019 22:29:31 +0200 Subject: [PATCH 04/83] feat(PF4: Pagination): When empty array sent to pagination no per page should be visible (#2175) --- .../components/Pagination/OptionsToggle.js | 29 +- .../components/Pagination/Pagination.test.js | 5 + .../Pagination/PaginationOptionsMenu.js | 1 + .../__snapshots__/Pagination.test.js.snap | 401 +++++++++++++++++- 4 files changed, 419 insertions(+), 17 deletions(-) diff --git a/packages/patternfly-4/react-core/src/components/Pagination/OptionsToggle.js b/packages/patternfly-4/react-core/src/components/Pagination/OptionsToggle.js index de9b1479614..b58f345aea0 100644 --- a/packages/patternfly-4/react-core/src/components/Pagination/OptionsToggle.js +++ b/packages/patternfly-4/react-core/src/components/Pagination/OptionsToggle.js @@ -14,6 +14,7 @@ const OptionsToggle = ({ widgetId, onToggle, isOpen, + showToggle, toggleTemplate: ToggleTemplate }) => (
@@ -24,18 +25,20 @@ const OptionsToggle = ({ )} - + {showToggle && ( + + )}
); @@ -48,6 +51,7 @@ OptionsToggle.propTypes = { widgetId: PropTypes.string, onToggle: PropTypes.func, isOpen: PropTypes.bool, + showToggle: PropTypes.bool, toggleTemplate: PropTypes.oneOfType([PropTypes.string, PropTypes.func]) }; @@ -60,6 +64,7 @@ OptionsToggle.defaultProps = { widgetId: '', onToggle: () => undefined, isOpen: false, + showToggle: true, toggleTemplate: '' }; diff --git a/packages/patternfly-4/react-core/src/components/Pagination/Pagination.test.js b/packages/patternfly-4/react-core/src/components/Pagination/Pagination.test.js index a316c2a0839..bf8f7fae9f8 100644 --- a/packages/patternfly-4/react-core/src/components/Pagination/Pagination.test.js +++ b/packages/patternfly-4/react-core/src/components/Pagination/Pagination.test.js @@ -28,6 +28,11 @@ describe('component render', () => { expect(wrapper).toMatchSnapshot(); }); + test('empty per page options', () => { + const wrapper = mount(); + expect(wrapper).toMatchSnapshot(); + }); + test('no items', () => { const wrapper = mount(); expect(wrapper).toMatchSnapshot(); diff --git a/packages/patternfly-4/react-core/src/components/Pagination/PaginationOptionsMenu.js b/packages/patternfly-4/react-core/src/components/Pagination/PaginationOptionsMenu.js index 3e3e6928b83..35e96350037 100644 --- a/packages/patternfly-4/react-core/src/components/Pagination/PaginationOptionsMenu.js +++ b/packages/patternfly-4/react-core/src/components/Pagination/PaginationOptionsMenu.js @@ -123,6 +123,7 @@ class PaginationOptionsMenu extends Component { toggle={ 0} itemsTitle={itemsTitle} onToggle={this.onToggle} isOpen={this.state.isOpen} diff --git a/packages/patternfly-4/react-core/src/components/Pagination/__snapshots__/Pagination.test.js.snap b/packages/patternfly-4/react-core/src/components/Pagination/__snapshots__/Pagination.test.js.snap index a30f459bf9a..5f8401b67da 100644 --- a/packages/patternfly-4/react-core/src/components/Pagination/__snapshots__/Pagination.test.js.snap +++ b/packages/patternfly-4/react-core/src/components/Pagination/__snapshots__/Pagination.test.js.snap @@ -202,6 +202,7 @@ exports[`component render custom pagination toggle 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate="\${firstIndex} - \${lastIndex} - \${itemCount} - \${itemsTitle}" widgetId="pagination-options-menu" /> @@ -213,7 +214,7 @@ exports[`component render custom pagination toggle 1`] = ` @@ -622,6 +624,7 @@ exports[`component render custom perPageOptions 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -643,6 +646,7 @@ exports[`component render custom perPageOptions 1`] = ` onEnter={[Function]} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" > @@ -1141,6 +1145,7 @@ exports[`component render custom start end 1`] = ` lastIndex={15} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -1152,7 +1157,7 @@ exports[`component render custom start end 1`] = ` @@ -1458,6 +1464,377 @@ exports[`component render custom start end 1`] = ` `; +exports[`component render empty per page options 1`] = ` + +
+
+ 40 items +
+ +
+ + + } + > +
+ +
+ + + + 1 + - + 10 + + + of + + 40 + + + items + + +
+
+
+
+
+
+ + + +
+
+`; + exports[`component render last page 1`] = ` @@ -1681,6 +2059,7 @@ exports[`component render last page 1`] = ` onEnter={[Function]} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" > @@ -2179,6 +2558,7 @@ exports[`component render limited number of pages 1`] = ` lastIndex={20} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -2200,6 +2580,7 @@ exports[`component render limited number of pages 1`] = ` onEnter={[Function]} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" > @@ -2698,6 +3079,7 @@ exports[`component render no items 1`] = ` lastIndex={0} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -2709,7 +3091,7 @@ exports[`component render no items 1`] = ` @@ -3212,6 +3595,7 @@ exports[`component render should render correctly bottom 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -3233,6 +3617,7 @@ exports[`component render should render correctly bottom 1`] = ` onEnter={[Function]} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" > @@ -3731,6 +4116,7 @@ exports[`component render should render correctly top 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -3752,6 +4138,7 @@ exports[`component render should render correctly top 1`] = ` onEnter={[Function]} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" > @@ -4241,6 +4628,7 @@ exports[`component render titles 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -4252,7 +4640,7 @@ exports[`component render titles 1`] = ` @@ -4760,6 +5149,7 @@ exports[`component render up drop direction 1`] = ` lastIndex={10} onToggle={[Function]} optionsToggle="Select" + showToggle={true} toggleTemplate={[Function]} widgetId="pagination-options-menu" /> @@ -4771,7 +5161,7 @@ exports[`component render up drop direction 1`] = ` From 979f13f1525410f7bccc108480736d3898550333 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Fri, 7 Jun 2019 20:52:46 +0000 Subject: [PATCH 05/83] chore(release): releasing packages [ci skip] - @patternfly/react-core@3.37.0 - @patternfly/react-docs@4.6.8 - @patternfly/react-inline-edit-extension@2.7.3 - demo-app-ts@1.18.2 - @patternfly/react-table@2.10.3 - @patternfly/react-virtualized-extension@1.0.2 --- packages/patternfly-4/react-core/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-core/package.json | 2 +- packages/patternfly-4/react-docs/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-docs/package.json | 4 ++-- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 6 +++--- .../react-integration/demo-app-ts/CHANGELOG.md | 8 ++++++++ .../react-integration/demo-app-ts/package.json | 4 ++-- packages/patternfly-4/react-table/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-table/package.json | 4 ++-- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 4 ++-- 12 files changed, 63 insertions(+), 12 deletions(-) diff --git a/packages/patternfly-4/react-core/CHANGELOG.md b/packages/patternfly-4/react-core/CHANGELOG.md index 749541a8888..524519faa5c 100644 --- a/packages/patternfly-4/react-core/CHANGELOG.md +++ b/packages/patternfly-4/react-core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.37.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.36.1...@patternfly/react-core@3.37.0) (2019-06-07) + + +### Features + +* **PF4: Pagination:** When empty array sent to pagination no per page should be visible ([#2175](https://github.com/patternfly/patternfly-react/issues/2175)) ([cb97dfd](https://github.com/patternfly/patternfly-react/commit/cb97dfd)) + + + + + ## [3.36.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.36.0...@patternfly/react-core@3.36.1) (2019-06-06) **Note:** Version bump only for package @patternfly/react-core diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index a0d062f6649..62a52cc996a 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "3.36.1", + "version": "3.37.0", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index 525cd2bec54..7f00823549b 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.7...@patternfly/react-docs@4.6.8) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-docs + + + + + ## [4.6.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.6...@patternfly/react-docs@4.6.7) (2019-06-07) diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index b666874d7c7..a6dc5c9e5ee 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.7", + "version": "4.6.8", "author": "Red Hat", "license": "MIT", "private": true, @@ -17,7 +17,7 @@ "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.36.1", + "@patternfly/react-core": "^3.37.0", "@patternfly/react-icons": "^3.9.3", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index 1cf306f4eda..7dfa537e65f 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.2...@patternfly/react-inline-edit-extension@2.7.3) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.1...@patternfly/react-inline-edit-extension@2.7.2) (2019-06-07) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index 8e27518b8e9..af038ce54e3 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.2", + "version": "2.7.3", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.36.1", + "@patternfly/react-core": "^3.37.0", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-table": "^2.10.2", + "@patternfly/react-table": "^2.10.3", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" diff --git a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md index 9405343ef9b..1e5a772ae1f 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.18.2](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.1...demo-app-ts@1.18.2) (2019-06-07) + +**Note:** Version bump only for package demo-app-ts + + + + + ## [1.18.1](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.0...demo-app-ts@1.18.1) (2019-06-06) **Note:** Version bump only for package demo-app-ts diff --git a/packages/patternfly-4/react-integration/demo-app-ts/package.json b/packages/patternfly-4/react-integration/demo-app-ts/package.json index d4893c6f75d..fe08df66333 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/package.json +++ b/packages/patternfly-4/react-integration/demo-app-ts/package.json @@ -1,13 +1,13 @@ { "name": "demo-app-ts", "private": true, - "version": "1.18.1", + "version": "1.18.2", "scripts": { "build:demo-app": "react-scripts build", "start:demo-app": "react-scripts start" }, "dependencies": { - "@patternfly/react-core": "^3.36.1", + "@patternfly/react-core": "^3.37.0", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router": "^4.3.1", diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index 643501a19d5..3697dba373c 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.2...@patternfly/react-table@2.10.3) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-table + + + + + ## [2.10.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.1...@patternfly/react-table@2.10.2) (2019-06-07) **Note:** Version bump only for package @patternfly/react-table diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index da34cd05acd..eede6976ebb 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.10.2", + "version": "2.10.3", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,7 +28,7 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.36.1", + "@patternfly/react-core": "^3.37.0", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", "classnames": "^2.2.5", diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md index d6a9a45c4d0..356d6cf9c30 100644 --- a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.1...@patternfly/react-virtualized-extension@1.0.2) (2019-06-07) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension + + + + + ## 1.0.1 (2019-06-07) **Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index c76b8e44713..cdd4a85f9c8 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.1", + "version": "1.0.2", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,7 +28,7 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.36.0", + "@patternfly/react-core": "^3.37.0", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", "clsx": "^1.0.1", From 59aadfce875d7172c82c56ed70379dafde788896 Mon Sep 17 00:00:00 2001 From: Dan Labrecque Date: Mon, 10 Jun 2019 10:08:45 -0400 Subject: [PATCH 06/83] fix(charts): align label vertically and add donutHeight/Width defaults (#2193) * fix(charts): align label vertically and add defaults for donutHeight donutWidth Fixes https://github.com/patternfly/patternfly-react/issues/2191 Fixes https://github.com/patternfly/patternfly-react/issues/2192 * fix(charts): apply defaults to custom legend https://github.com/patternfly/patternfly-react/issues/2194 --- .../ChartDonutThreshold.tsx | 88 +++++---- .../ChartDonutUtilization.tsx | 113 ++++++++--- .../ChartDonutThreshold.test.tsx.snap | 10 +- .../ChartDonutUtilization.test.tsx.snap | 14 +- .../examples/ChartDonutUtilization.md | 175 ++++++++++++++++-- .../examples/chart-donut-utilization.scss | 51 +++-- 6 files changed, 352 insertions(+), 99 deletions(-) diff --git a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.tsx b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.tsx index fde2c785622..5e3f7343830 100644 --- a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.tsx +++ b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutThreshold.tsx @@ -122,8 +122,14 @@ export interface ChartDonutThresholdProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: The parent container must be set to the same height in order to maintain the aspect ratio. Otherwise, the - * innerRadius may need to be set when using this property. + * Note: When adding a legend, height (the overall SVG height) may need to be larger than donutHeight (the donut size) + * in order to accommodate the extra legend. + * + * By default, donutHeight is the min. of either height or width. This covers most use cases in order to accommodate + * legends within the same SVG. However, donutHeight (not height) may need to be set in order to adjust the donut + * height. + * + * The innerRadius may also need to be set when changing the donut size. */ donutHeight?: number; /** @@ -138,8 +144,13 @@ export interface ChartDonutThresholdProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: The parent container must be set to the same height in order to maintain the aspect ratio. Otherwise, the - * innerRadius may need to be set when using this property. + * Note: When adding a legend, width (the overall SVG width) may need to be larger than donutWidth (the donut size) + * in order to accommodate the extra legend. + * + * By default, donutWidth is the min. of either height or width. This covers most use cases in order to accommodate + * legends within the same SVG. However, donutWidth (not width) may need to be set in order to adjust the donut width. + * + * The innerRadius may also need to be set when changing the donut size. */ donutWidth?: number; /** @@ -211,7 +222,10 @@ export interface ChartDonutThresholdProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: innerRadius may need to be set when using this property. + * Note: When adding a legend, height (the overall SVG height) may need to be larger than donutHeight (the donut size) + * in order to accommodate the extra legend. + * + * Typically, the parent container is set to the same height in order to maintain the aspect ratio. */ height?: number; /** @@ -344,7 +358,10 @@ export interface ChartDonutThresholdProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: innerRadius may need to be set when using this property. + * Note: When adding a legend, width (the overall SVG width) may need to be larger than donutWidth (the donut size) + * in order to accommodate the extra legend. + * + * Typically, the parent container is set to the same width in order to maintain the aspect ratio. */ width?: number; /** @@ -383,11 +400,12 @@ export const ChartDonutThreshold: React.FunctionComponent { // Returns computed data representing pie chart slices @@ -410,42 +428,48 @@ export const ChartDonutThreshold: React.FunctionComponent { + const dynamicWidth = donutWidth - (theme.pie.width - dynamicTheme.pie.width); switch (orientation) { case 'left': - return Math.round((theme.pie.width - dynamicTheme.pie.width) / 2); + return Math.round((donutWidth - dynamicWidth) / 2); case 'right': - return -Math.round((theme.pie.width - dynamicTheme.pie.width) / 2); + return -Math.round((donutWidth - dynamicWidth) / 2); default: return 0; } }; // Returns the vertical shift for the dynamic utilization donut cart - const getDynamicDonutDy = (dynamicTheme: ChartThemeDefinition) => - Math.round((theme.pie.height - dynamicTheme.pie.height) / 2); + const getDynamicDonutDy = (dynamicTheme: ChartThemeDefinition) => { + const dynamicHeight = donutHeight - (theme.pie.height - dynamicTheme.pie.height); + return Math.round((donutHeight - dynamicHeight) / 2); + } // Render dynamic utilization donut cart const renderChildren = () => React.Children.toArray(children).map(child => { - const datum = getData([{ ...child.props.data }]); - const orientation = child.props.donutOrientation || donutOrientation; - const dynamicTheme = - child.props.theme || - getDonutThresholdDynamicTheme(child.props.themeColor || themeColor, - child.props.themeVariant || themeVariant); - return React.cloneElement(child, { - donutDx: child.props.donutDx || getDynamicDonutDx(dynamicTheme, orientation), - donutDy: child.props.donutDy || getDynamicDonutDy(dynamicTheme), - donutHeight: child.props.donutHeight || dynamicTheme.pie.height, - donutOrientation: orientation, - donutWidth: child.props.donutWidth || dynamicTheme.pie.width, - endAngle: child.props.endAngle || 360 * (datum[0]._y ? datum[0]._y / 100 : 100), - height: child.props.height || height, - showStatic: child.props.showStatic || false, - standalone: false, - theme: dynamicTheme, - width: child.props.width || width - }); + if (child.props) { + const datum = getData([{ ...child.props.data }]); + const orientation = child.props.donutOrientation || donutOrientation; + const dynamicTheme = + child.props.theme || + getDonutThresholdDynamicTheme(child.props.themeColor || themeColor, + child.props.themeVariant || themeVariant); + return React.cloneElement(child, { + donutDx: child.props.donutDx || getDynamicDonutDx(dynamicTheme, orientation), + donutDy: child.props.donutDy || getDynamicDonutDy(dynamicTheme), + donutHeight: child.props.donutHeight || donutHeight - (theme.pie.height - dynamicTheme.pie.height), + donutOrientation: orientation, + donutWidth: child.props.donutWidth || donutWidth - (theme.pie.width - dynamicTheme.pie.width), + endAngle: child.props.endAngle || 360 * (datum[0]._y ? datum[0]._y / 100 : 100), + height: child.props.height || height, + showStatic: child.props.showStatic || false, + standalone: false, + theme: dynamicTheme, + width: child.props.width || width + }); + } + return child; }); // Static threshold dount chart diff --git a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.tsx b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.tsx index 425be3bd16e..42874621cc6 100644 --- a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.tsx +++ b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/ChartDonutUtilization.tsx @@ -60,6 +60,13 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * {duration: 500, onExit: () => {}, onEnter: {duration: 500, before: () => ({y: 0})})} */ animate?: AnimatePropTypeInterface; + /** + * The capHeight prop defines a text metric for the font being used: the expected height of capital letters. + * This is necessary because of SVG, which (a) positions the *bottom* of the text at `y`, and (b) has no notion of + * line height. The value should ideally use the same units as `lineHeight` and `dy`, preferably ems. If given a + * unitless number, it is assumed to be ems. + */ + capHeight?: StringOrNumberOrCallback; /** * The categories prop specifies how categorical data for a chart should be ordered. * This prop should be given as an array of string values, or an object with @@ -134,8 +141,14 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: The parent container must be set to the same height in order to maintain the aspect ratio. Otherwise, the - * innerRadius may need to be set when using this property. + * Note: When adding a legend, height (the overall SVG height) may need to be larger than donutHeight (the donut size) + * in order to accommodate the extra legend. + * + * By default, donutHeight is the min. of either height or width. This covers most use cases in order to accommodate + * legends within the same SVG. However, donutHeight (not height) may need to be set in order to adjust the donut + * height. + * + * The innerRadius may also need to be set when changing the donut size. */ donutHeight?: number; /** @@ -150,8 +163,13 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: The parent container must be set to the same height in order to maintain the aspect ratio. Otherwise, the - * innerRadius may need to be set when using this property. + * Note: When adding a legend, width (the overall SVG width) may need to be larger than donutWidth (the donut size) + * in order to accommodate the extra legend. + * + * By default, donutWidth is the min. of either height or width. This covers most use cases in order to accommodate + * legends within the same SVG. However, donutWidth (not width) may need to be set in order to adjust the donut width. + * + * The innerRadius may also need to be set when changing the donut size. */ donutWidth?: number; /** @@ -223,7 +241,10 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: innerRadius may need to be set when using this property. + * Note: When adding a legend, height (the overall SVG height) may need to be larger than donutHeight (the donut size) + * in order to accommodate the extra legend. + * + * Typically, the parent container is set to the same height in order to maintain the aspect ratio. */ height?: number; /** @@ -250,7 +271,9 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { */ labelPosition?: 'startAngle' | 'endAngle' | 'centroid'; /** - * The legend component to render with chart. This overrides other legend props. + * The legend component to render with chart. + * + * Note: Default legend properties may be applied */ legendComponent?: React.ReactElement; /** @@ -261,8 +284,6 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * Each data point may be any format you wish (depending on the `x` and `y` accessor props), * but by default, an object with x and y properties is expected. * - * Note: Not compatible with legendComponent prop. - * * @example legendData={[{ name: `GBps capacity - 45%` }, { name: 'Unused' }]} */ legendData?: any[]; @@ -274,9 +295,6 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * and text-wrapping is not currently supported, so "vertical" * orientation is both the default setting and recommended for * displaying many series of data. - * - * Note: May need to set legendHeight and legendWidth in order to position properly. - * Not compatible with legendComponent prop. */ legendOrientation?: 'horizontal' | 'vertical'; /** @@ -402,7 +420,10 @@ export interface ChartDonutUtilizationProps extends ChartPieProps { * height of the chart in number of pixels, but instead define an aspect ratio for the chart. The exact number of * pixels will depend on the size of the container the chart is rendered into. * - * Note: innerRadius may need to be set when using this property. + * Note: When adding a legend, width (the overall SVG width) may need to be larger than donutWidth (the donut size) + * in order to accommodate the extra legend. + * + * Typically, the parent container is set to the same width in order to maintain the aspect ratio. */ width?: number; /** @@ -449,11 +470,12 @@ export const ChartDonutUtilization: React.FunctionComponent { // Returns computed data representing pie chart slices @@ -490,9 +512,31 @@ export const ChartDonutUtilization: React.FunctionComponent { if (legendComponent) { - return legendComponent; - } - if (legendData) { + const props = legendComponent.props; + return React.cloneElement(legendComponent, { + data: props.data ? props.data : legendData, + orientation: props.legendOrientation ? props.legendOrientation : legendOrientation, + standalone: false, + theme: props.theme ? props.theme : theme, + x: props.x ? props.x : getLegendX({ + chartOrientation: donutOrientation, + legendOrientation: props.legendOrientation ? props.legendOrientation : legendOrientation, + legendWidth: getLegendDimensions().width, + theme, + width + }), + y: props.y ? props.y : getLegendY({ + chartDy: donutDy, + chartHeight: donutHeight, + chartOrientation: donutOrientation, + chartType: 'pie', + height, + legendData: props.data ? props.data : legendData, + legendHeight: getLegendDimensions().height, + theme + }) + }); + } else if (legendData) { return ( @@ -522,6 +566,25 @@ export const ChartDonutUtilization: React.FunctionComponent { + if (legendComponent) { + const props = legendComponent.props; + return (VictoryLegend as any).getDimensions({ + data: props.data ? props.data : legendData, + orientation: props.legendOrientation ? props.legendOrientation : legendOrientation, + theme: props.theme ? props.theme : theme, + }); + } else if (legendData) { + return (VictoryLegend as any).getDimensions({ + data: legendData, + orientation: legendOrientation, + theme + }); + } + return {}; + } + // Returns theme based on threshold and current value const getThresholdTheme = () => { const newTheme = { ...theme }; @@ -543,18 +606,10 @@ export const ChartDonutUtilization: React.FunctionComponent `; diff --git a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap index 31cd7c1e016..846aca8d1e8 100644 --- a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap +++ b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/__snapshots__/ChartDonutUtilization.test.tsx.snap @@ -1015,8 +1015,8 @@ exports[`renders component data 1`] = ` } textAnchor="middle" verticalAnchor="middle" - x={115} - y={115} + x={100} + y={100} /> `; diff --git a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/ChartDonutUtilization.md b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/ChartDonutUtilization.md index 83c9a08756d..d0eff3dd7eb 100644 --- a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/ChartDonutUtilization.md +++ b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/ChartDonutUtilization.md @@ -58,7 +58,7 @@ class UtilizationChart extends React.Component { const { spacer, used } = this.state; return (
-
+
datum.x ? `${datum.x} - ${datum.y}%` : null} @@ -108,7 +108,7 @@ class UtilizationChart extends React.Component { const { spacer, used } = this.state; return (
-
+
datum.x ? `${datum.x} - ${datum.y}%` : null} @@ -133,9 +133,10 @@ import React from 'react'; import { ChartDonutUtilization } from '@patternfly/react-charts';
-
+
datum.x ? `${datum.x} - ${datum.y}%` : null} @@ -157,7 +158,7 @@ import React from 'react'; import { ChartDonutUtilization } from '@patternfly/react-charts';
-
+
-
+
datum.x ? datum.x : null} - width={475} > -
+
datum.x ? datum.x : null} @@ -245,7 +245,7 @@ class ThresholdChart extends React.Component { } ``` -## Green donut utilization chart with static thresholds and right-aligned legend +## Green donut utilization chart with static thresholds and right-aligned (custom) legend ```js import React from 'react'; import { ChartDonutThreshold, ChartDonutUtilization, ChartThemeColor, ChartThemeVariant } from '@patternfly/react-charts'; @@ -273,7 +273,7 @@ class ThresholdChart extends React.Component { const { used } = this.state; return (
-
+
datum.x ? datum.x : null} @@ -282,7 +282,11 @@ class ThresholdChart extends React.Component { datum.x ? `${datum.x} - ${datum.y}%` : null} - legendData={[{ name: `GBps capacity - ${used}%` }, { name: 'Warning threshold at - 60%' }, { name: 'Danger threshold at - 90%' }]} + legendComponent={ + + } subTitle="of 100 GBps" title={`${used}%`} themeColor={ChartThemeColor.green} @@ -303,13 +307,13 @@ import React from 'react'; import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts';
-
+
datum.x ? datum.x : null} - width={275} + width={230} > -
+
``` + +## Small donut utilization chart +```js +import React from 'react'; +import { ChartDonutUtilization } from '@patternfly/react-charts'; + +
+
+ datum.x ? `${datum.x} - ${datum.y}%` : null} + subTitle="of 100 GBps" + title="75%" + width={150} + /> +
+
+``` + +## Small donut utilization chart with right-aligned legend +```js +import React from 'react'; +import { ChartDonutUtilization } from '@patternfly/react-charts'; + +class UtilizationChart extends React.Component { + constructor(props) { + super(props); + this.state = { + spacer: '', + used: 0 + }; + } + + componentDidMount() { + this.interval = setInterval(() => { + const { used } = this.state; + const val = (used + 10) % 100; + this.setState({ + spacer: val < 10 ? ' ' : '', + used: val + }); + }, 1000); + } + + componentWillUnmount() { + clearInterval(this.interval); + } + + render() { + const { spacer, used } = this.state; + return ( +
+
+ datum.x ? `${datum.x} - ${datum.y}%` : null} + legendData={[{ name: `GBps capacity - ${spacer}${used}%` }, { name: 'Unused' }]} + subTitle="of 100 GBps" + title={`${used}%`} + thresholds={[{ value: 60 }, { value: 90 }]} + width={350} + /> +
+
+ ); + } +} +``` + +## Small donut utilization chart with static thresholds +```js +import React from 'react'; +import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts'; + +
+
+ datum.x ? datum.x : null} + width={175} + > + datum.x ? `${datum.x} - ${datum.y}%` : null} + subTitle="of 100 GBps" + title="45%" + /> + +
+
+``` + +## Small donut utilization chart with static thresholds and right-aligned legend +```js +import React from 'react'; +import { ChartDonutThreshold, ChartDonutUtilization } from '@patternfly/react-charts'; + +class ThresholdChart extends React.Component { + constructor(props) { + super(props); + this.state = { + used: 0 + }; + } + + componentDidMount() { + this.interval = setInterval(() => { + const { used } = this.state; + this.setState({ used: (used + 10) % 100 }); + }, 1000); + } + + componentWillUnmount() { + clearInterval(this.interval); + } + + render() { + const { used } = this.state; + return ( +
+
+ datum.x ? datum.x : null} + width={425} + > + datum.x ? `${datum.x} - ${datum.y}%` : null} + legendData={[{ name: `GBps capacity - ${used}%` }, { name: 'Warning threshold at - 60%' }, { name: 'Danger threshold at - 90%' }]} + subTitle="of 100 GBps" + title={`${used}%`} + thresholds={[{ value: 60 }, { value: 90 }]} + /> + +
+
+ ); + } +} +``` diff --git a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/chart-donut-utilization.scss b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/chart-donut-utilization.scss index 13de880e58a..8e37a9a8f27 100644 --- a/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/chart-donut-utilization.scss +++ b/packages/patternfly-4/react-charts/src/components/ChartDonutUtilization/examples/chart-donut-utilization.scss @@ -1,18 +1,33 @@ .ws-preview { & > * { - .donut-threshold-chart-horz { + .donut-threshold-chart { height: 230px; - width: 492px; + width: 230px; + } + + .donut-threshold-chart-sm { + height: 175px; + width: 175px; } - .donut-threshold-chart-horz-sm { + .donut-threshold-chart-legend-bottom { + height: 325px; + width: 230px; + } + + .donut-threshold-chart-legend-left { height: 230px; width: 475px; } - .donut-threshold-chart-vert { - height: 325px; - width: 275px; + .donut-threshold-chart-legend-right { + height: 230px; + width: 492px; + } + + .donut-threshold-chart-legend-right-sm { + height: 175px; + width: 425px; } .donut-utilization-chart { @@ -20,19 +35,29 @@ width: 230px; } - .donut-utilization-chart-horz { - height: 230px; - width: 435px; + .donut-utilization-chart-sm { + height: 150px; + width: 150px; + } + + .donut-utilization-chart-legend-bottom { + height: 275px; + width: 300px; } - .donut-utilization-chart-horz-sm { + .donut-utilization-chart-legend-left { height: 230px; width: 425px; } - .donut-utilization-chart-vert { - height: 275px; - width: 300px; + .donut-utilization-chart-legend-right { + height: 230px; + width: 435px; + } + + .donut-utilization-chart-legend-right-sm { + height: 150px; + width: 350px; } } } From a3e5de0126fd55b64f0327880d8f7c6e0cbe30a9 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Mon, 10 Jun 2019 14:23:36 +0000 Subject: [PATCH 07/83] chore(release): releasing packages [ci skip] - @patternfly/react-charts@4.1.2 --- packages/patternfly-4/react-charts/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-charts/package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/patternfly-4/react-charts/CHANGELOG.md b/packages/patternfly-4/react-charts/CHANGELOG.md index 02e57a52717..d11b1c23292 100644 --- a/packages/patternfly-4/react-charts/CHANGELOG.md +++ b/packages/patternfly-4/react-charts/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 4.1.2 (2019-06-10) + + +### Bug Fixes + +* **charts:** align label vertically and add donutHeight/Width defaults ([#2193](https://github.com/patternfly/patternfly-react/issues/2193)) ([59aadfc](https://github.com/patternfly/patternfly-react/commit/59aadfc)) + + + + + ## [4.1.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.0...@patternfly/react-charts@4.1.1) (2019-06-05) **Note:** Version bump only for package @patternfly/react-charts diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index 3029c840b83..b46e92c51a3 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "4.1.1", + "version": "4.1.2", "description": "This library provides a set of React chart components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", From b35f3d1cc997a04484d92fd13fcde4aa9fffbcc3 Mon Sep 17 00:00:00 2001 From: zallen <47335686+redallen@users.noreply.github.com> Date: Mon, 10 Jun 2019 11:05:10 -0400 Subject: [PATCH 08/83] build(esm): fix esm output and convert react-virtualized-extension to TS (#2190) * convert react-virtualized-extension to typescript * fix babelrcs and package.json * hoist babel config and use json * fix jest test * fix circular dependency * fix pf3 build --- .babelrc | 3 - babel.config.js | 4 + jest.config.js | 2 +- package.json | 19 ++-- .../patternfly-react-extensions/package.json | 11 ++ .../patternfly-react-wooden-tree/package.json | 13 +++ .../patternfly-react/package.json | 11 ++ .../src/components/Cards/Card.js | 37 ------- .../UtilizationTrendCard/UtilizationCard.js | 2 +- .../src/components/Cards/index.js | 18 +++ .../patternfly-3/react-console/package.json | 11 ++ packages/patternfly-4/.babelrc | 11 ++ packages/patternfly-4/.babelrc.js | 38 ------- packages/patternfly-4/react-charts/.babelrc | 3 + .../patternfly-4/react-charts/.babelrc.js | 5 - .../patternfly-4/react-charts/package.json | 11 +- packages/patternfly-4/react-core/.babelrc | 3 + packages/patternfly-4/react-core/.babelrc.js | 20 ---- packages/patternfly-4/react-core/package.json | 9 +- .../react-inline-edit-extension/.babelrc | 6 +- .../react-inline-edit-extension/package.json | 20 +++- .../patternfly-4/react-styled-system/.babelrc | 4 +- .../react-styled-system/package.json | 18 ++- packages/patternfly-4/react-styles/.babelrc | 4 +- .../patternfly-4/react-styles/package.json | 18 ++- packages/patternfly-4/react-table/.babelrc | 6 +- .../patternfly-4/react-table/package.json | 18 ++- .../patternfly-4/react-tokens/package.json | 4 +- .../react-virtualized-extension/.babelrc | 5 +- .../react-virtualized-extension/package.json | 17 ++- .../{VirtualGrid.js => VirtualGrid.ts} | 103 ++++++++++-------- ...irtualTableBody.js => VirtualTableBody.ts} | 20 ++-- ... => accessibilityOverscanIndicesGetter.ts} | 4 +- ...enderer.js => defaultCellRangeRenderer.ts} | 3 +- ...ter.js => defaultOverscanIndicesGetter.ts} | 4 +- .../Virtualized/{index.js => index.ts} | 0 .../Virtualized/{types.js => types.ts} | 26 ++--- ...nager.js => CellSizeAndPositionManager.ts} | 5 +- ...s => ScalingCellSizeAndPositionManager.ts} | 3 +- .../{animationFrame.js => animationFrame.ts} | 0 ...zeAndPositionDataAndUpdateScrollOffset.ts} | 8 +- ...kMemoizer.js => createCallbackMemoizer.ts} | 0 .../{maxElementSize.js => maxElementSize.ts} | 4 +- ...nTimeout.js => requestAnimationTimeout.ts} | 0 ...exHelper.js => updateScrollIndexHelper.ts} | 4 +- .../src/components/{index.js => index.ts} | 0 .../src/{index.js => index.ts} | 0 packages/react-icons/.babelrc | 4 +- packages/react-icons/package.json | 17 ++- test.env.js | 6 +- yarn.lock | 33 ++---- 51 files changed, 298 insertions(+), 297 deletions(-) delete mode 100644 .babelrc create mode 100644 babel.config.js create mode 100644 packages/patternfly-4/.babelrc delete mode 100644 packages/patternfly-4/.babelrc.js create mode 100644 packages/patternfly-4/react-charts/.babelrc delete mode 100644 packages/patternfly-4/react-charts/.babelrc.js create mode 100644 packages/patternfly-4/react-core/.babelrc delete mode 100644 packages/patternfly-4/react-core/.babelrc.js rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{VirtualGrid.js => VirtualGrid.ts} (97%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{VirtualTableBody.js => VirtualTableBody.ts} (96%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{accessibilityOverscanIndicesGetter.js => accessibilityOverscanIndicesGetter.ts} (93%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{defaultCellRangeRenderer.js => defaultCellRangeRenderer.ts} (98%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{defaultOverscanIndicesGetter.js => defaultOverscanIndicesGetter.ts} (91%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{index.js => index.ts} (100%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/{types.js => types.ts} (84%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{CellSizeAndPositionManager.js => CellSizeAndPositionManager.ts} (98%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{ScalingCellSizeAndPositionManager.js => ScalingCellSizeAndPositionManager.ts} (98%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{animationFrame.js => animationFrame.ts} (100%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{calculateSizeAndPositionDataAndUpdateScrollOffset.js => calculateSizeAndPositionDataAndUpdateScrollOffset.ts} (96%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{createCallbackMemoizer.js => createCallbackMemoizer.ts} (100%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{maxElementSize.js => maxElementSize.ts} (78%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{requestAnimationTimeout.js => requestAnimationTimeout.ts} (100%) rename packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/{updateScrollIndexHelper.js => updateScrollIndexHelper.ts} (97%) rename packages/patternfly-4/react-virtualized-extension/src/components/{index.js => index.ts} (100%) rename packages/patternfly-4/react-virtualized-extension/src/{index.js => index.ts} (100%) diff --git a/.babelrc b/.babelrc deleted file mode 100644 index ec6da7006b9..00000000000 --- a/.babelrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "presets": ["./packages/patternfly-3/.babelrc.js"] -} diff --git a/babel.config.js b/babel.config.js new file mode 100644 index 00000000000..429a1720c05 --- /dev/null +++ b/babel.config.js @@ -0,0 +1,4 @@ +module.exports = { + extends: './packages/patternfly-4/.babelrc', + presets: [['@babel/env', {'modules': 'commonjs'}], '@babel/react'], +} \ No newline at end of file diff --git a/jest.config.js b/jest.config.js index a5d66cd9119..2b770f22737 100644 --- a/jest.config.js +++ b/jest.config.js @@ -26,7 +26,7 @@ module.exports = { "/packages/patternfly-4/react-core/scripts/snapshot-serializer" ], transform: { - '^.+\\.(ts|tsx)?$': 'ts-jest', + '^.+\\.(ts|tsx?)$': 'ts-jest', '^.+\\.jsx?$': 'babel-jest', '\\.(css)$': '/packages/patternfly-4/react-styles/jest-transform.js' }, diff --git a/package.json b/package.json index bca7d01f9c2..475780604be 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,13 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", "@storybook/addon-actions": "^v3.4.11", "@storybook/addon-info": "^v3.4.11", "@storybook/addon-knobs": "^v3.4.11", @@ -33,17 +40,7 @@ "@storybook/addons": "^3.3.0", "@storybook/react": "^v3.4.11", "@storybook/storybook-deployer": "^2.1.0", - "babel-cli": "^6.26.0", - "babel-core": "^6.26.0", - "babel-eslint": "^9.0.0", - "babel-jest": "^23.6.0", - "babel-plugin-transform-class-properties": "^6.24.1", - "babel-plugin-transform-export-extensions": "^6.22.0", - "babel-plugin-transform-imports": "^1.5.0", - "babel-plugin-transform-object-assign": "^6.22.0", - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-preset-env": "^1.6.1", - "babel-preset-react": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "change-case": "^3.0.2", "codecov": "^3.2.0", "commitizen": "^3.0.7", diff --git a/packages/patternfly-3/patternfly-react-extensions/package.json b/packages/patternfly-3/patternfly-react-extensions/package.json index 0f8c520631a..b4c7fdb6016 100644 --- a/packages/patternfly-3/patternfly-react-extensions/package.json +++ b/packages/patternfly-3/patternfly-react-extensions/package.json @@ -51,6 +51,17 @@ "unidiff": "^1.0.1" }, "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^9.0.0", + "babel-jest": "^23.6.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-plugin-transform-imports": "^1.5.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.6.1", + "babel-preset-react": "^6.24.1", "rimraf": "^2.6.2", "shx": "^0.3.2" }, diff --git a/packages/patternfly-3/patternfly-react-wooden-tree/package.json b/packages/patternfly-3/patternfly-react-wooden-tree/package.json index f4db1ceb26a..0c73acee136 100644 --- a/packages/patternfly-3/patternfly-react-wooden-tree/package.json +++ b/packages/patternfly-3/patternfly-react-wooden-tree/package.json @@ -33,6 +33,19 @@ "dependencies": { "react-wooden-tree": "^2.0.1" }, + "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^9.0.0", + "babel-jest": "^23.6.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-plugin-transform-imports": "^1.5.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.6.1", + "babel-preset-react": "^6.24.1" + }, "peerDependencies": { "prop-types": "^15.6.1", "react": "^16.3.2", diff --git a/packages/patternfly-3/patternfly-react/package.json b/packages/patternfly-3/patternfly-react/package.json index a566382c20e..dc86bee6c35 100644 --- a/packages/patternfly-3/patternfly-react/package.json +++ b/packages/patternfly-3/patternfly-react/package.json @@ -68,6 +68,17 @@ "clean": "rimraf dist" }, "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^9.0.0", + "babel-jest": "^23.6.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-plugin-transform-imports": "^1.5.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.6.1", + "babel-preset-react": "^6.24.1", "clean-css-cli": "^4.2.1", "react-axe": "^3.0.2", "rimraf": "^2.6.2", diff --git a/packages/patternfly-3/patternfly-react/src/components/Cards/Card.js b/packages/patternfly-3/patternfly-react/src/components/Cards/Card.js index b1144b2adfe..1aa2c55d1c4 100644 --- a/packages/patternfly-3/patternfly-react/src/components/Cards/Card.js +++ b/packages/patternfly-3/patternfly-react/src/components/Cards/Card.js @@ -2,25 +2,6 @@ import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; -import CardTitle from './CardTitle'; -import CardBody from './CardBody'; -import CardHeading from './CardHeading'; -import CardFooter from './CardFooter'; -import CardLink from './CardLink'; -import CardGrid from './CardGrid'; -import CardDropdownButton from './CardDropdownButton'; -import CardHeightMatching from './CardHeightMatching'; -import { - UtilizationCard, - UtilizationCardDetails, - UtilizationCardDetailsCount, - UtilizationCardDetailsDesc, - UtilizationCardDetailsLine1, - UtilizationCardDetailsLine2 -} from './UtilizationTrendCard'; - -import { AggregateStatusCount, AggregateStatusNotifications, AggregateStatusNotification } from './AggregateStatusCard'; - /** * Card Component for PatternFly React */ @@ -69,22 +50,4 @@ Card.defaultProps = { cardRef: null }; -Card.Title = CardTitle; -Card.Body = CardBody; -Card.Heading = CardHeading; -Card.Footer = CardFooter; -Card.Link = CardLink; -Card.Grid = CardGrid; -Card.DropdownButton = CardDropdownButton; -Card.HeightMatching = CardHeightMatching; -Card.UtilizationCard = UtilizationCard; -Card.UtilizationCardDetails = UtilizationCardDetails; -Card.UtilizationCardDetailsCount = UtilizationCardDetailsCount; -Card.UtilizationCardDetailsDesc = UtilizationCardDetailsDesc; -Card.UtilizationCardDetailsLine1 = UtilizationCardDetailsLine1; -Card.UtilizationCardDetailsLine2 = UtilizationCardDetailsLine2; -Card.AggregateStatusCount = AggregateStatusCount; -Card.AggregateStatusNotifications = AggregateStatusNotifications; -Card.AggregateStatusNotification = AggregateStatusNotification; - export default Card; diff --git a/packages/patternfly-3/patternfly-react/src/components/Cards/UtilizationTrendCard/UtilizationCard.js b/packages/patternfly-3/patternfly-react/src/components/Cards/UtilizationTrendCard/UtilizationCard.js index 8e1787d2d3a..0b589f4e73c 100644 --- a/packages/patternfly-3/patternfly-react/src/components/Cards/UtilizationTrendCard/UtilizationCard.js +++ b/packages/patternfly-3/patternfly-react/src/components/Cards/UtilizationTrendCard/UtilizationCard.js @@ -1,7 +1,7 @@ import classNames from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; -import { Card } from '../index'; +import Card from '../Card'; const UtilizationCard = ({ children, className, ...props }) => { const classes = classNames('card-pf-utilization', className); diff --git a/packages/patternfly-3/patternfly-react/src/components/Cards/index.js b/packages/patternfly-3/patternfly-react/src/components/Cards/index.js index 64d2530f843..5252339c44c 100644 --- a/packages/patternfly-3/patternfly-react/src/components/Cards/index.js +++ b/packages/patternfly-3/patternfly-react/src/components/Cards/index.js @@ -17,6 +17,24 @@ import { UtilizationCardDetailsLine2 } from './UtilizationTrendCard'; +Card.Title = CardTitle; +Card.Body = CardBody; +Card.Heading = CardHeading; +Card.Footer = CardFooter; +Card.Link = CardLink; +Card.Grid = CardGrid; +Card.DropdownButton = CardDropdownButton; +Card.HeightMatching = CardHeightMatching; +Card.UtilizationCard = UtilizationCard; +Card.UtilizationCardDetails = UtilizationCardDetails; +Card.UtilizationCardDetailsCount = UtilizationCardDetailsCount; +Card.UtilizationCardDetailsDesc = UtilizationCardDetailsDesc; +Card.UtilizationCardDetailsLine1 = UtilizationCardDetailsLine1; +Card.UtilizationCardDetailsLine2 = UtilizationCardDetailsLine2; +Card.AggregateStatusCount = AggregateStatusCount; +Card.AggregateStatusNotifications = AggregateStatusNotifications; +Card.AggregateStatusNotification = AggregateStatusNotification; + export { Card, CardTitle, diff --git a/packages/patternfly-3/react-console/package.json b/packages/patternfly-3/react-console/package.json index fdb4d362a1c..39ca82545a1 100644 --- a/packages/patternfly-3/react-console/package.json +++ b/packages/patternfly-3/react-console/package.json @@ -46,6 +46,17 @@ "xterm": "^3.3.0" }, "devDependencies": { + "babel-cli": "^6.26.0", + "babel-core": "^6.26.0", + "babel-eslint": "^9.0.0", + "babel-jest": "^23.6.0", + "babel-plugin-transform-class-properties": "^6.24.1", + "babel-plugin-transform-export-extensions": "^6.22.0", + "babel-plugin-transform-imports": "^1.5.0", + "babel-plugin-transform-object-assign": "^6.22.0", + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-preset-env": "^1.6.1", + "babel-preset-react": "^6.24.1", "patternfly": "^3.58.0", "patternfly-react": "^2.36.0", "rimraf": "^2.6.2", diff --git a/packages/patternfly-4/.babelrc b/packages/patternfly-4/.babelrc new file mode 100644 index 00000000000..38cc0d3fe51 --- /dev/null +++ b/packages/patternfly-4/.babelrc @@ -0,0 +1,11 @@ +{ + "presets": ["@babel/react"], + "ignore": ["**/__snapshots__", "**/*.d.ts"], + "plugins": [ + "@babel/plugin-transform-typescript", + "babel-plugin-typescript-to-proptypes", + "@babel/plugin-proposal-export-default-from", + "@babel/proposal-class-properties", + "@babel/proposal-object-rest-spread", + ] +} diff --git a/packages/patternfly-4/.babelrc.js b/packages/patternfly-4/.babelrc.js deleted file mode 100644 index 0804442c329..00000000000 --- a/packages/patternfly-4/.babelrc.js +++ /dev/null @@ -1,38 +0,0 @@ -const babelENV = process.env.BABEL_ENV || 'development'; -const modules = babelENV !== 'production:esm' ? 'commonjs' : false; - -module.exports = { - presets: [['env', { modules }], 'react'], - plugins: [ - 'transform-class-properties', - 'transform-export-extensions', - 'transform-object-rest-spread', - 'transform-object-assign', - babelENV !== 'development' && [ - 'transform-imports', - { - '@patternfly/react-icons': { - kebabCase: true, - preventFullImport: true, - transform: importName => { - if (importName.toLowerCase() === 'icon') { - throw new Error('Icon import is not allowed'); - } - const importPath = `icons/${importName}`; - if (!modules) { - return `@patternfly/react-icons/dist/esm/${importPath}`; - } - return `@patternfly/react-icons/dist/js/${importPath}`; - } - } - } - ] - ].filter(Boolean), - ignore: (() => { - const ignore = ['src/**/__snapshots__']; - if (babelENV.includes('production')) { - ignore.push('test.js', '__mocks__'); - } - return ignore; - })() -}; diff --git a/packages/patternfly-4/react-charts/.babelrc b/packages/patternfly-4/react-charts/.babelrc new file mode 100644 index 00000000000..25c4221a16d --- /dev/null +++ b/packages/patternfly-4/react-charts/.babelrc @@ -0,0 +1,3 @@ +{ + "extends": "../.babelrc" +} \ No newline at end of file diff --git a/packages/patternfly-4/react-charts/.babelrc.js b/packages/patternfly-4/react-charts/.babelrc.js deleted file mode 100644 index a59fe297daa..00000000000 --- a/packages/patternfly-4/react-charts/.babelrc.js +++ /dev/null @@ -1,5 +0,0 @@ -const coreConfig = require('../react-core/.babelrc.js'); - -module.exports = { - ...coreConfig -} diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index b46e92c51a3..bc74dbb3e44 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -37,10 +37,10 @@ }, "scripts": { "build": "yarn build:babel && yarn build:types && node ./scripts/copyTS.js", - "build:babel": "concurrently 'yarn build:babel:cjs' 'yarn build:babel:esm && yarn build:babel:umd'", - "build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js --extensions '.js,.ts,.tsx' -q", - "build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm --extensions '.js,.ts,.tsx' -q", - "build:babel:umd": "cross-env BABEL_ENV=production:umd babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd --extensions '.js,.ts,.tsx' -q", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "build:types": "tsc -p tsconfig.gen-dts.json", "clean": "rimraf dist", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose --source-maps", @@ -60,9 +60,7 @@ "@babel/core": "^7.0.0", "@babel/plugin-proposal-class-properties": "^7.0.0", "@babel/plugin-proposal-export-default-from": "^7.0.0", - "@babel/plugin-proposal-export-namespace-from": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0", - "@babel/plugin-transform-object-assign": "^7.0.0", "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", @@ -70,7 +68,6 @@ "@patternfly/react-icons": "^3.9.3", "@patternfly/react-tokens": "^2.5.3", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", - "babel-plugin-transform-imports": "^1.5.0", "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "enzyme": "3.9.0", diff --git a/packages/patternfly-4/react-core/.babelrc b/packages/patternfly-4/react-core/.babelrc new file mode 100644 index 00000000000..25c4221a16d --- /dev/null +++ b/packages/patternfly-4/react-core/.babelrc @@ -0,0 +1,3 @@ +{ + "extends": "../.babelrc" +} \ No newline at end of file diff --git a/packages/patternfly-4/react-core/.babelrc.js b/packages/patternfly-4/react-core/.babelrc.js deleted file mode 100644 index ee1e6c7192e..00000000000 --- a/packages/patternfly-4/react-core/.babelrc.js +++ /dev/null @@ -1,20 +0,0 @@ -const babelENV = process.env.BABEL_ENV || 'development'; -const modules = babelENV !== 'production:esm' ? 'commonjs' : false; - -module.exports = { - presets: [['@babel/env', { modules }], '@babel/react'], - ignore: (() => { - const ignore = ['**/__snapshots__', '**/*.d.ts']; - if (babelENV.includes('production')) { - ignore.push('test.js', '__mocks__'); - } - return ignore; - })(), - plugins: [ - '@babel/plugin-transform-typescript', - 'babel-plugin-typescript-to-proptypes', - '@babel/plugin-proposal-export-default-from', - '@babel/proposal-class-properties', - '@babel/proposal-object-rest-spread', - ] -}; diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index 62a52cc996a..db9875d1541 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -31,9 +31,9 @@ "scripts": { "build": "yarn typecheck && yarn build:babel && yarn build:types && node ./scripts/copyTS.js && node ./scripts/copyStyles.js", "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", - "build:babel:cjs": "babel src --out-dir dist/js --extensions '.js,.ts,.tsx' -q", - "build:babel:esm": "babel src --out-dir dist/esm --extensions '.js,.ts,.tsx' -q", - "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd -q", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "build:types": "tsc -p tsconfig.gen-dts.json", "clean": "rimraf dist", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose", @@ -54,9 +54,7 @@ "@babel/core": "^7.0.0", "@babel/plugin-proposal-class-properties": "^7.0.0", "@babel/plugin-proposal-export-default-from": "^7.0.0", - "@babel/plugin-proposal-export-namespace-from": "^7.0.0", "@babel/plugin-proposal-object-rest-spread": "^7.0.0", - "@babel/plugin-transform-object-assign": "^7.0.0", "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", @@ -68,7 +66,6 @@ "@types/react": "~16.8.0", "@types/react-dom": "~16.8.0", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", - "babel-plugin-transform-imports": "^1.5.0", "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "enzyme": "3.9.0", diff --git a/packages/patternfly-4/react-inline-edit-extension/.babelrc b/packages/patternfly-4/react-inline-edit-extension/.babelrc index 36d1937e56b..25c4221a16d 100644 --- a/packages/patternfly-4/react-inline-edit-extension/.babelrc +++ b/packages/patternfly-4/react-inline-edit-extension/.babelrc @@ -1,5 +1,3 @@ { - "presets": [ - "../.babelrc.js" - ] -} + "extends": "../.babelrc" +} \ No newline at end of file diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index af038ce54e3..d507fe70643 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -42,11 +42,11 @@ "react-dom": "^15.6.2 || ^16.4.0" }, "scripts": { - "build": "yarn build:babel && yarn build:ts", - "build:babel": "concurrently \"yarn build:babel:cjs\" \"yarn build:babel:esm\"", - "build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js -q", - "build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm -q", - "build:ts": "node ./scripts/copyTS.js", + "build": "yarn build:babel && node ./scripts/copyTS.js", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose", "postbuild": "node ./build/copyStyles.js" }, @@ -54,6 +54,16 @@ "@patternfly/react-tokens": "^2.5.3" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "enzyme": "3.9.0", "fs-extra": "^6.0.1", diff --git a/packages/patternfly-4/react-styled-system/.babelrc b/packages/patternfly-4/react-styled-system/.babelrc index 4aa312ac898..25c4221a16d 100644 --- a/packages/patternfly-4/react-styled-system/.babelrc +++ b/packages/patternfly-4/react-styled-system/.babelrc @@ -1,5 +1,3 @@ { - "presets": [ - "../.babelrc.js" - ] + "extends": "../.babelrc" } \ No newline at end of file diff --git a/packages/patternfly-4/react-styled-system/package.json b/packages/patternfly-4/react-styled-system/package.json index ca1e0b901c9..8cbb14d2046 100644 --- a/packages/patternfly-4/react-styled-system/package.json +++ b/packages/patternfly-4/react-styled-system/package.json @@ -27,9 +27,10 @@ "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { "build": "yarn build:babel && node ./scripts/copyTS.js", - "build:babel": "concurrently 'yarn build:babel:cjs' 'yarn build:babel:esm'", - "build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js -q", - "build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm -q", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "clean": "rimraf dist", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, @@ -45,8 +46,17 @@ "react": "^16.4.0" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", "@patternfly/patternfly": "2.8.2", - "babel-core": "^6.26.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "enzyme": "3.9.0", "fs-extra": "^6.0.1", diff --git a/packages/patternfly-4/react-styles/.babelrc b/packages/patternfly-4/react-styles/.babelrc index 8ade66d8e14..25c4221a16d 100644 --- a/packages/patternfly-4/react-styles/.babelrc +++ b/packages/patternfly-4/react-styles/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["../.babelrc.js"] -} + "extends": "../.babelrc" +} \ No newline at end of file diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index d1b38536b59..9922c87a899 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -13,10 +13,10 @@ }, "scripts": { "build": "yarn build:babel && node ./scripts/copyTS.js && yarn build:css && yarn build:types && node ./scripts/copyStyles.js", - "build:babel": "concurrently 'yarn build:babel:cjs' 'yarn build:babel:esm && yarn build:babel:umd'", - "build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js -q", - "build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm -q", - "build:babel:umd": "cross-env BABEL_ENV=production:umd babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd -q", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/preset-env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "build:css": "node src/generateClasses.js", "build:types": "tsc", "clean": "rimraf dist css", @@ -38,8 +38,18 @@ "typescript": "3.4.5" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-flow-strip-types": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", "@patternfly/patternfly": "2.8.2", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "glob": "^7.1.2", "rimraf": "^2.6.2" }, diff --git a/packages/patternfly-4/react-table/.babelrc b/packages/patternfly-4/react-table/.babelrc index 36d1937e56b..25c4221a16d 100644 --- a/packages/patternfly-4/react-table/.babelrc +++ b/packages/patternfly-4/react-table/.babelrc @@ -1,5 +1,3 @@ { - "presets": [ - "../.babelrc.js" - ] -} + "extends": "../.babelrc" +} \ No newline at end of file diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index eede6976ebb..4e22418cc18 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -31,6 +31,7 @@ "@patternfly/react-core": "^3.37.0", "@patternfly/react-icons": "^3.9.3", "@patternfly/react-styles": "^3.3.0", + "@patternfly/react-tokens": "^2.5.3", "classnames": "^2.2.5", "exenv": "^1.2.2" }, @@ -43,14 +44,23 @@ "scripts": { "build": "yarn build:babel && node ./scripts/copyTS.js && node ./build/copyStyles.js", "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", - "build:babel:cjs": "babel src --out-dir dist/js -q", - "build:babel:esm": "babel src --out-dir dist/esm -q", - "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd --extensions '.js,.ts,.tsx' -q", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "clean": "rimraf dist", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, "devDependencies": { - "@patternfly/react-tokens": "^2.5.3", + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "enzyme": "3.9.0", "fs-extra": "^6.0.1", diff --git a/packages/patternfly-4/react-tokens/package.json b/packages/patternfly-4/react-tokens/package.json index 33a49a89a34..d673bf4f364 100644 --- a/packages/patternfly-4/react-tokens/package.json +++ b/packages/patternfly-4/react-tokens/package.json @@ -26,10 +26,12 @@ "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { "build": "node src/generateTokens.js && yarn build:babel:umd", - "build:babel:umd": "cross-env BABEL_ENV=production:umd babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd -q", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd -q", "clean": "rimraf dist" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", "@patternfly/patternfly": "2.8.2", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "css": "^2.2.3", diff --git a/packages/patternfly-4/react-virtualized-extension/.babelrc b/packages/patternfly-4/react-virtualized-extension/.babelrc index 40b9ca6c624..25c4221a16d 100644 --- a/packages/patternfly-4/react-virtualized-extension/.babelrc +++ b/packages/patternfly-4/react-virtualized-extension/.babelrc @@ -1,6 +1,3 @@ { - "presets": [ - "../.babelrc.js", - "flow" - ] + "extends": "../.babelrc" } \ No newline at end of file diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index cdd4a85f9c8..b2e23c562c5 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -48,14 +48,23 @@ "scripts": { "build": "yarn build:babel && node ./scripts/copyTS.js && node ./build/copyStyles.js", "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", - "build:babel:cjs": "babel src --out-dir dist/js -q", - "build:babel:esm": "babel src --out-dir dist/esm -q", - "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd --extensions '.js,.ts,.tsx' -q", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "clean": "rimraf dist", "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, "devDependencies": { - "babel-preset-flow": "^6.23.0", + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", "fs-extra": "^6.0.1", "glob": "^7.1.2", diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.ts similarity index 97% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.ts index ccb17f4b936..b8c95f18e05 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualGrid.ts @@ -1,23 +1,4 @@ -/** @flow */ /* eslint-disable */ - -import type { - CellRenderer, - CellRangeRenderer, - CellPosition, - CellSize, - CellSizeGetter, - NoContentRenderer, - Scroll, - ScrollbarPresenceChange, - RenderedSection, - OverscanIndicesGetter, - Alignment, - CellCache, - StyleCache -} from './types'; -import type { AnimationTimeoutId } from './utils/requestAnimationTimeout'; - import * as React from 'react'; import clsx from 'clsx'; import calculateSizeAndPositionDataAndUpdateScrollOffset from './utils/calculateSizeAndPositionDataAndUpdateScrollOffset'; @@ -33,6 +14,22 @@ import scrollbarSize from 'dom-helpers/util/scrollbarSize'; import { polyfill } from 'react-lifecycles-compat'; import { requestAnimationTimeout, cancelAnimationTimeout } from './utils/requestAnimationTimeout'; +import { + CellRenderer, + CellRangeRenderer, + CellPosition, + CellSize, + CellSizeGetter, + NoContentRenderer, + Scroll, + ScrollbarPresenceChange, + RenderedSection, + OverscanIndicesGetter, + Alignment, + CellCache, + StyleCache +} from './types'; +import { overflow } from 'styled-system'; /** * Specifies the number of milliseconds during which to disable pointer events while a scroll is in progress. * This improves performance and makes scrolling smoother. @@ -93,19 +90,19 @@ type Props = { columnWidth: CellSize, /** Unfiltered props for the VirtualGrid container. */ - containerProps?: Object, + containerProps?: any, /** ARIA role for the cell-container. */ containerRole: string, /** Optional inline style applied to inner cell-container */ - containerStyle: Object, + containerStyle: any, /** * If CellMeasurer is used to measure this VirtualGrid's children, this should be a pointer to its CellMeasurerCache. * A shared CellMeasurerCache reference enables VirtualGrid and CellMeasurer to share measurement data. */ - deferredMeasurementCache?: Object, + deferredMeasurementCache?: any, /** * Used to estimate the total width of a VirtualGrid before all of its columns have actually been measured. @@ -212,10 +209,10 @@ type Props = { scrollToRow: number, /** Optional inline style */ - style: Object, + style: any, /** Tab index for focus */ - tabIndex: ?number, + tabIndex?: number, /** Width of VirtualGrid; this property determines the number of visible (vs virtualized) columns. */ width: number, @@ -236,8 +233,8 @@ type InstanceProps = { prevIsScrolling: boolean, prevScrollToColumn: number, prevScrollToRow: number, - prevScrollLeft: ?number, - prevScrollTop: ?number, + prevScrollLeft?: number, + prevScrollTop?: number, columnSizeAndPositionManager: ScalingCellSizeAndPositionManager, rowSizeAndPositionManager: ScalingCellSizeAndPositionManager, @@ -247,14 +244,14 @@ type InstanceProps = { }; type State = { - instanceProps: InstanceProps, - isScrolling: boolean, - scrollDirectionHorizontal: -1 | 1, - scrollDirectionVertical: -1 | 1, - scrollLeft: number, - scrollTop: number, - scrollPositionChangeReason: 'observed' | 'requested' | null, - needToResetStyleCache: boolean + instanceProps?: InstanceProps, + isScrolling?: boolean, + scrollDirectionHorizontal?: -1 | 1, + scrollDirectionVertical?: -1 | 1, + scrollLeft?: number, + scrollTop?: number, + scrollPositionChangeReason?: 'observed' | 'requested', + needToResetStyleCache?: boolean }; /** @@ -307,7 +304,7 @@ class VirtualGrid extends React.PureComponent { _scrollbarPresenceChanged = false; _scrollingContainer: Element; - _childrenToDisplay: React.Element<*>[]; + _childrenToDisplay: React.ReactElement[]; _columnStartIndex: number; _columnStopIndex: number; @@ -321,7 +318,7 @@ class VirtualGrid extends React.PureComponent { _initialScrollTop: number; _initialScrollLeft: number; - _disablePointerEventsTimeoutId: ?AnimationTimeoutId; + _disablePointerEventsTimeoutId; _styleCache: StyleCache = {}; _cellCache: CellCache = {}; @@ -461,11 +458,11 @@ class VirtualGrid extends React.PureComponent { : SCROLL_DIRECTION_BACKWARD : this.state.scrollDirectionVertical; - const newState: $Shape = { + const newState: State = { isScrolling: true, scrollDirectionHorizontal, scrollDirectionVertical, - scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.OBSERVED + scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.OBSERVED as 'observed' | 'requested' }; if (!autoHeight) { @@ -523,7 +520,7 @@ class VirtualGrid extends React.PureComponent { * This function should be called if dynamic column or row sizes have changed but nothing else has. * Since VirtualGrid only receives :columnCount and :rowCount it has no way of detecting when the underlying data changes. */ - recomputeVirtualGridSize({ columnIndex = 0, rowIndex = 0 }: CellPosition = {}) { + recomputeVirtualGridSize({ columnIndex = 0, rowIndex = 0 } = {}) { const { scrollToColumn, scrollToRow } = this.props; const { instanceProps } = this.state; @@ -779,8 +776,8 @@ class VirtualGrid extends React.PureComponent { * 2) New scroll props overriding the current state * 3) Cells-count or cells-size has changed, making previous scroll offsets invalid */ - static getDerivedStateFromProps(nextProps: Props, prevState: State): $Shape { - const newState = {}; + static getDerivedStateFromProps(nextProps: Props, prevState: State): State { + const newState: State = {}; const { instanceProps } = prevState; if ( @@ -917,7 +914,17 @@ class VirtualGrid extends React.PureComponent { const isScrolling = this._isScrolling(); - const gridStyle: Object = { + const gridStyle: { + boxSizing: string, + direction: string, + height: string | number, + position: string, + width: string | number, + WebkitOverflowScrolling: string, + willChange: string, + overflowX?: string, + overflowY?: string + } = { boxSizing: 'border-box', direction: 'ltr', height: autoHeight ? 'auto' : height, @@ -1291,8 +1298,8 @@ class VirtualGrid extends React.PureComponent { prevState: State, scrollLeft?: number, scrollTop?: number - }): $Shape { - const newState: Object = { + }): State { + const newState: any = { scrollPositionChangeReason: SCROLL_POSITION_CHANGE_REASONS.REQUESTED }; @@ -1335,7 +1342,7 @@ class VirtualGrid extends React.PureComponent { } static _wrapSizeGetter(value: CellSize): CellSizeGetter { - return typeof value === 'function' ? value : () => (value: any); + return typeof value === 'function' ? value : () => value as any; } static _getCalculatedScrollLeft(nextProps: Props, prevState: State) { @@ -1363,7 +1370,7 @@ class VirtualGrid extends React.PureComponent { return VirtualGrid._getCalculatedScrollLeft(props, state); } - static _getScrollLeftForScrollToColumnStateUpdate(nextProps: Props, prevState: State): $Shape { + static _getScrollLeftForScrollToColumnStateUpdate(nextProps: Props, prevState: State): State { const { scrollLeft } = prevState; const calculatedScrollLeft = VirtualGrid._getCalculatedScrollLeft(nextProps, prevState); @@ -1437,7 +1444,7 @@ class VirtualGrid extends React.PureComponent { } } - static _getScrollTopForScrollToRowStateUpdate(nextProps: Props, prevState: State): $Shape { + static _getScrollTopForScrollToRowStateUpdate(nextProps: Props, prevState: State): State { const { scrollTop } = prevState; const calculatedScrollTop = VirtualGrid._getCalculatedScrollTop(nextProps, prevState); @@ -1464,7 +1471,7 @@ class VirtualGrid extends React.PureComponent { // This invalid event can be detected by comparing event.target to this component's scrollable DOM element. // See issue #404 for more information. if (event.target === this._scrollingContainer) { - this.handleScrollEvent((event.target: any)); + this.handleScrollEvent(event.target as any); } }; } diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.ts similarity index 96% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.ts index 02180fc3760..d6708ecf229 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/VirtualTableBody.ts @@ -1,8 +1,7 @@ -/** @flow */ /* eslint-disable */ import * as React from 'react'; -import type { +import { NoContentRenderer, Alignment, CellSize, @@ -11,8 +10,6 @@ import type { RenderedSection, CellRendererParams, Scroll as VirtualGridScroll, - RowRenderer, - RenderedRows, Scroll } from './types'; @@ -55,7 +52,7 @@ type Props = { /** Callback invoked with information about the slice of rows that were just rendered. */ - onRowsRendered: (params: RenderedRows) => void, + onRowsRendered: (params: any) => void, /** * Callback invoked whenever the scroll offset changes within the inner scrollable region. @@ -76,7 +73,7 @@ type Props = { rowHeight: CellSize, /** Responsible for rendering a row given an index; ({ index: number }): node */ - rowRenderer: RowRenderer, + rowRenderer: any, /** Number of rows in list. */ rowCount: number, @@ -99,9 +96,9 @@ type Props = { /** Width of list */ width: number, - columns: Array, + columns: any[], - rows: Array + rows: any[] }; export default class VirtualTableBody extends React.PureComponent { @@ -118,7 +115,7 @@ export default class VirtualTableBody extends React.PureComponent { style: {} }; - VirtualGrid: ?React.ElementRef; + VirtualGrid: any; forceUpdateVirtualGrid() { if (this.VirtualGrid) { @@ -199,11 +196,12 @@ export default class VirtualTableBody extends React.PureComponent { const classNames = clsx('ReactVirtualized__List', className); + const VirtualGridAny = VirtualGrid as any; return ( // note: these aria props if rendered will break a11y for role="presentation" // this approach attempts to fix non standard table grids // see: https://www.html5accessibility.com/tests/aria-table-fix.html - { }); }; - _setRef = (ref: ?React.ElementRef) => { + _setRef = (ref: any) => { this.VirtualGrid = ref; }; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.ts similarity index 93% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.ts index 24cb2384f7a..c1bc8ace6f8 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/accessibilityOverscanIndicesGetter.ts @@ -1,6 +1,4 @@ -// @flow - -import type { OverscanIndicesGetterParams, OverscanIndices } from './types'; +import { OverscanIndicesGetterParams, OverscanIndices } from './types'; export const SCROLL_DIRECTION_BACKWARD = -1; export const SCROLL_DIRECTION_FORWARD = 1; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.ts similarity index 98% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.ts index 857546d5216..493b5104b60 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultCellRangeRenderer.ts @@ -1,7 +1,6 @@ -/** @flow */ /* eslint-disable */ -import type { CellRangeRendererParams } from './types'; +import { CellRangeRendererParams } from './types'; /** * Default implementation of cellRangeRenderer used by Grid. diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.ts similarity index 91% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.ts index 4e2ed49204f..7ea879f740b 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/defaultOverscanIndicesGetter.ts @@ -1,6 +1,4 @@ -// @flow - -import type { OverscanIndicesGetterParams, OverscanIndices } from './types'; +import { OverscanIndicesGetterParams, OverscanIndices } from './types'; export const SCROLL_DIRECTION_BACKWARD = -1; export const SCROLL_DIRECTION_FORWARD = 1; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/index.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/index.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/index.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/index.ts diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.ts similarity index 84% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.ts index fd450b44a15..b8b3109eb7d 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/types.ts @@ -1,24 +1,22 @@ -// @flow - import * as React from 'react'; import ScalingCellSizeAndPositionManager from './utils/ScalingCellSizeAndPositionManager'; -export type CellPosition = { columnIndex: number, rowIndex: number }; +export type CellPosition = { columnIndex?: number, rowIndex?: number }; export type CellRendererParams = { columnIndex: number, isScrolling: boolean, isVisible: boolean, key: string, - parent: Object, + parent: any, rowIndex: number, - style: Object + style: any }; -export type CellRenderer = (props: CellRendererParams) => React.Element<*>; +export type CellRenderer = (props: CellRendererParams) => React.ReactElement; -export type CellCache = { [key: string]: React.Element<*> }; -export type StyleCache = { [key: string]: Object }; +export type CellCache = { [key: string]: React.ReactElement }; +export type StyleCache = { [key: string]: any }; export type CellRangeRendererParams = { cellCache: CellCache, @@ -26,11 +24,11 @@ export type CellRangeRendererParams = { columnSizeAndPositionManager: ScalingCellSizeAndPositionManager, columnStartIndex: number, columnStopIndex: number, - deferredMeasurementCache?: Object, + deferredMeasurementCache?: any, horizontalOffsetAdjustment: number, isScrolling: boolean, isScrollingOptOut: boolean, - parent: Object, + parent: any, rowSizeAndPositionManager: ScalingCellSizeAndPositionManager, rowStartIndex: number, rowStopIndex: number, @@ -38,17 +36,17 @@ export type CellRangeRendererParams = { scrollTop: number, styleCache: StyleCache, verticalOffsetAdjustment: number, - visibleColumnIndices: Object, - visibleRowIndices: Object + visibleColumnIndices: any, + visibleRowIndices: any }; -export type CellRangeRenderer = (params: CellRangeRendererParams) => React.Element<*>[]; +export type CellRangeRenderer = (params: CellRangeRendererParams) => React.ReactElement[]; export type CellSizeGetter = (params: { index: number }) => number; export type CellSize = CellSizeGetter | number; -export type NoContentRenderer = () => React.Element<*> | null; +export type NoContentRenderer = () => React.ReactElement | null; export type Scroll = { clientHeight: number, diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.ts similarity index 98% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.ts index 64cd9021196..7c32f03fd2a 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/CellSizeAndPositionManager.ts @@ -1,8 +1,7 @@ -/** @flow */ /* eslint-disable */ import LinearLayoutVector from 'linear-layout-vector'; -import type { Alignment, CellSizeGetter, VisibleCellRange } from '../types'; +import { Alignment, CellSizeGetter, VisibleCellRange } from '../types'; type CellSizeAndPositionManagerParams = { cellCount: number, @@ -40,7 +39,7 @@ type SizeAndPositionData = { export default class CellSizeAndPositionManager { // Cache of size and position data for cells, mapped by cell index. // Note that invalid values may exist in this map so only rely on cells up to this._lastMeasuredIndex - _layoutVector: LinearLayoutVector; + _layoutVector; // Measurements for cells up to this index can be trusted; cells afterward should be estimated. _lastMeasuredIndex = -1; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.ts similarity index 98% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.ts index 3686a83af4d..3414b9a910f 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/ScalingCellSizeAndPositionManager.ts @@ -1,7 +1,6 @@ -/** @flow */ /* eslint-disable */ -import type { Alignment, CellSizeGetter, VisibleCellRange } from '../types'; +import { Alignment, CellSizeGetter, VisibleCellRange } from '../types'; import CellSizeAndPositionManager from './CellSizeAndPositionManager'; import { getMaxElementSize } from './maxElementSize.js'; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/animationFrame.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/animationFrame.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/animationFrame.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/animationFrame.ts diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.ts similarity index 96% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.ts index f5c5eb2909f..a249213838c 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/calculateSizeAndPositionDataAndUpdateScrollOffset.ts @@ -1,5 +1,3 @@ -// @flow - /** * Helper method that determines when to recalculate row or column metadata. */ @@ -9,7 +7,7 @@ type Params = { cellCount: number, // Width or height of cells for the current axis - cellSize: ?number, + cellSize?: number, // Method to invoke if cell metadata should be recalculated computeMetadataCallback: (props: T) => void, @@ -21,7 +19,7 @@ type Params = { nextCellsCount: number, // Newly updated width or height of cells for the current axis - nextCellSize: ?number, + nextCellSize?: number, // Newly updated scroll-to-index nextScrollToIndex: number, @@ -43,7 +41,7 @@ export default function calculateSizeAndPositionDataAndUpdateScrollOffset({ nextScrollToIndex, scrollToIndex, updateScrollOffsetForScrollToIndex -}: Params<*>) { +}: Params) { // Don't compare cell sizes if they are functions because inline functions would cause infinite loops. // In that event users should use the manual recompute methods to inform of changes. if ( diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/createCallbackMemoizer.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/createCallbackMemoizer.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/createCallbackMemoizer.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/createCallbackMemoizer.ts diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.ts similarity index 78% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.ts index 506c0c5b62a..ebd82d343dc 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/maxElementSize.ts @@ -1,11 +1,9 @@ -// @flow - const DEFAULT_MAX_ELEMENT_SIZE = 1500000; const CHROME_MAX_ELEMENT_SIZE = 1.67771e7; const isBrowser = () => typeof window !== 'undefined'; -const isChrome = () => !!window.chrome && !!window.chrome.webstore; +const isChrome = () => !!(window as any).chrome && !!(window as any).chrome.webstore; export const getMaxElementSize = (): number => { if (isBrowser()) { diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/requestAnimationTimeout.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/requestAnimationTimeout.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/requestAnimationTimeout.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/requestAnimationTimeout.ts diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.js b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.ts similarity index 97% rename from packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.js rename to packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.ts index c0cb6347b9f..e5d5e0fd96c 100644 --- a/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.js +++ b/packages/patternfly-4/react-virtualized-extension/src/components/Virtualized/utils/updateScrollIndexHelper.ts @@ -1,6 +1,4 @@ -// @flow - -import type { Alignment, CellSize } from '../types'; +import { Alignment, CellSize } from '../types'; import ScalingCellSizeAndPositionManager from './ScalingCellSizeAndPositionManager.js'; diff --git a/packages/patternfly-4/react-virtualized-extension/src/components/index.js b/packages/patternfly-4/react-virtualized-extension/src/components/index.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/components/index.js rename to packages/patternfly-4/react-virtualized-extension/src/components/index.ts diff --git a/packages/patternfly-4/react-virtualized-extension/src/index.js b/packages/patternfly-4/react-virtualized-extension/src/index.ts similarity index 100% rename from packages/patternfly-4/react-virtualized-extension/src/index.js rename to packages/patternfly-4/react-virtualized-extension/src/index.ts diff --git a/packages/react-icons/.babelrc b/packages/react-icons/.babelrc index d0be3075281..d51d42dfe95 100644 --- a/packages/react-icons/.babelrc +++ b/packages/react-icons/.babelrc @@ -1,3 +1,3 @@ { - "presets": ["../patternfly-4/.babelrc.js"] -} + "extends": "../patternfly-4/.babelrc" +} \ No newline at end of file diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 6087c271ad2..34a67d266b0 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -25,17 +25,26 @@ "homepage": "https://github.com/patternfly/patternfly-react#readme", "scripts": { "build": "node ./build/generateIcons.js && yarn build:babel && node ./scripts/copyTS.js", - "build:babel": "concurrently 'yarn build:babel:cjs' 'yarn build:babel:esm' && yarn build:babel:umd", - "build:babel:cjs": "cross-env BABEL_ENV=production:cjs babel src --out-dir dist/js -q", - "build:babel:esm": "cross-env BABEL_ENV=production:esm babel src --out-dir dist/esm -q", - "build:babel:umd": "cross-env BABEL_ENV=production:umd babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd -q", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/js --presets=@babel/env", + "build:babel:esm": "babel --extensions '.js,.ts,.tsx' src --out-dir dist/esm", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins=transform-es2015-modules-umd", "clean": "rimraf dist src/icons src/index.js src/index.d.ts" }, "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", "@fortawesome/free-regular-svg-icons": "^5.7.2", "@fortawesome/free-solid-svg-icons": "^5.7.2", "@patternfly/patternfly": "2.8.2", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", "fs-extra": "^6.0.1", "glob": "^7.1.2", "node-plop": "^0.15.0", diff --git a/test.env.js b/test.env.js index a339faf05a5..767857b265e 100644 --- a/test.env.js +++ b/test.env.js @@ -1,6 +1,6 @@ -import 'raf/polyfill'; -import { configure } from 'enzyme'; -import Adapter from 'enzyme-adapter-react-16'; +require('raf/polyfill'); +const { configure } = require('enzyme'); +const Adapter = require('enzyme-adapter-react-16'); const MutationObserverPolyfill = require('mutation-observer'); // referenced from '@novnc/nvnc/core/util/events.js' diff --git a/yarn.lock b/yarn.lock index 4c88df211c6..6a9e1cafc82 100644 --- a/yarn.lock +++ b/yarn.lock @@ -302,13 +302,6 @@ "@babel/helper-plugin-utils" "^7.0.0" "@babel/plugin-syntax-export-default-from" "^7.2.0" -"@babel/plugin-proposal-export-namespace-from@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.2.0.tgz#308fd4d04ff257fc3e4be090550840eeabad5dd9" - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-export-namespace-from" "^7.2.0" - "@babel/plugin-proposal-json-strings@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.2.0.tgz#568ecc446c6148ae6b267f02551130891e29f317" @@ -375,12 +368,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-syntax-export-namespace-from@^7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.2.0.tgz#8d257838c6b3b779db52c0224443459bd27fb039" - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-syntax-flow@^7.0.0", "@babel/plugin-syntax-flow@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.2.0.tgz#a765f061f803bc48f240c26f8747faf97c26bf7c" @@ -589,12 +576,6 @@ dependencies: "@babel/helper-plugin-utils" "^7.0.0" -"@babel/plugin-transform-object-assign@^7.0.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-assign/-/plugin-transform-object-assign-7.2.0.tgz#6fdeea42be17040f119e38e23ea0f49f31968bde" - dependencies: - "@babel/helper-plugin-utils" "^7.0.0" - "@babel/plugin-transform-object-super@^7.0.0", "@babel/plugin-transform-object-super@^7.2.0": version "7.2.0" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.2.0.tgz#b35d4c10f56bab5d650047dad0f1d8e8814b6598" @@ -3180,6 +3161,7 @@ any-promise@^1.0.0, any-promise@^1.1.0: anymatch@^1.3.0: version "1.3.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a" + integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA== dependencies: micromatch "^2.1.5" normalize-path "^2.0.0" @@ -3576,6 +3558,7 @@ axobject-query@^2.0.1, axobject-query@^2.0.2: babel-cli@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1" + integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE= dependencies: babel-core "^6.26.0" babel-polyfill "^6.26.0" @@ -4332,6 +4315,7 @@ babel-plugin-transform-function-bind@^6.22.0: babel-plugin-transform-imports@^1.5.0: version "1.5.1" resolved "https://registry.yarnpkg.com/babel-plugin-transform-imports/-/babel-plugin-transform-imports-1.5.1.tgz#b3756696aea907719d0d63b0e67c88fba963adb0" + integrity sha512-Jkb0tjqye8kjOD7GdcKJTGB3dC9fruQhwRFZCeYS0sZO2otyjG6SohKR8nZiSm/OvhY+Ny2ktzVE59XKgIqskA== dependencies: babel-types "^6.6.0" is-valid-path "^0.1.1" @@ -4359,6 +4343,7 @@ babel-plugin-transform-minify-booleans@^6.9.0: babel-plugin-transform-object-assign@^6.22.0: version "6.22.0" resolved "https://registry.yarnpkg.com/babel-plugin-transform-object-assign/-/babel-plugin-transform-object-assign-6.22.0.tgz#f99d2f66f1a0b0d498e346c5359684740caa20ba" + integrity sha1-+Z0vZvGgsNSY40bFNZaEdAyqILo= dependencies: babel-runtime "^6.22.0" @@ -4463,6 +4448,7 @@ babel-plugin-typescript-to-proptypes@^0.17.1: babel-polyfill@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153" + integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM= dependencies: babel-runtime "^6.26.0" core-js "^2.5.0" @@ -5677,6 +5663,7 @@ chokidar@2.1.2: chokidar@^1.6.1: version "1.7.0" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468" + integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg= dependencies: anymatch "^1.3.0" async-each "^1.0.0" @@ -5913,7 +5900,6 @@ clone@^1.0.2: clsx@^1.0.1: version "1.0.4" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.0.4.tgz#0c0171f6d5cb2fe83848463c15fcc26b4df8c2ec" - integrity sha512-1mQ557MIZTrL/140j+JVdRM6e31/OA4vTYxXgqIIZlndyfjHpyawKZia1Im05Vp9BWmImkcNrNtFYQMyFcgJDg== cmd-shim@^2.0.2: version "2.0.2" @@ -12112,7 +12098,6 @@ jsdom@^11.5.1: jsdom@^15.1.0: version "15.1.0" resolved "https://registry.yarnpkg.com/jsdom/-/jsdom-15.1.0.tgz#80c5f0dd69466742ab1194f15d301bdd01417596" - integrity sha512-QEmc2XIkNfCK3KRfa9ljMJjC4kAGdVgRrs/pCBsQG/QoKz0B42+C58f6TdAmhq/rw494eFCoLHxX6+hWuxb96Q== dependencies: abab "^2.0.0" acorn "^6.0.4" @@ -12559,7 +12544,6 @@ liftoff@^2.5.0: linear-layout-vector@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/linear-layout-vector/-/linear-layout-vector-0.0.1.tgz#398114d7303b6ecc7fd6b273af7b8401d8ba9c70" - integrity sha1-OYEU1zA7bsx/1rJzr3uEAdi6nHA= listr-silent-renderer@^1.1.1: version "1.1.1" @@ -12768,6 +12752,7 @@ lodash.filter@^4.4.0: lodash.findkey@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/lodash.findkey/-/lodash.findkey-4.6.0.tgz#83058e903b51cbb759d09ccf546dea3ea39c4718" + integrity sha1-gwWOkDtRy7dZ0JzPVG3qPqOcRxg= lodash.findlastindex@^4.6.0: version "4.6.0" @@ -12868,6 +12853,7 @@ lodash.set@^4.3.2: lodash.snakecase@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz#39d714a35357147837aefd64b5dcbb16becd8f8d" + integrity sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40= lodash.some@^4.4.0, lodash.some@^4.6.0: version "4.6.0" @@ -14608,6 +14594,7 @@ osenv@0, osenv@^0.1.4, osenv@^0.1.5: output-file-sync@^1.1.2: version "1.1.2" resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76" + integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY= dependencies: graceful-fs "^4.1.4" mkdirp "^0.5.1" @@ -17308,6 +17295,7 @@ regenerate@^1.2.1, regenerate@^1.4.0: regenerator-runtime@^0.10.5: version "0.10.5" resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" + integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg= regenerator-runtime@^0.11.0: version "0.11.1" @@ -21117,7 +21105,6 @@ ws@^5.2.0, ws@^5.2.1: ws@^6.1.2: version "6.2.1" resolved "https://registry.yarnpkg.com/ws/-/ws-6.2.1.tgz#442fdf0a47ed64f59b6a5d8ff130f4748ed524fb" - integrity sha512-GIyAXC2cB7LjvpgMt9EKS2ldqr0MTrORaleiOno6TweZ6r3TKtoFQWay/2PceJ3RuBasOHzXNn5Lrw1X0bEjqA== dependencies: async-limiter "~1.0.0" From 2cbdfb8dd3c7e39b68fa8f7778967eafba688d9a Mon Sep 17 00:00:00 2001 From: Kun Yan Date: Mon, 10 Jun 2019 23:06:24 +0800 Subject: [PATCH 09/83] fix(react-table): Fix error Unknown event handler property `onCollapse`. It will be ignored. (#2195) --- .../src/components/Table/BodyWrapper.js | 2 +- .../Table/__snapshots__/Table.test.js.snap | 80 ------------------- 2 files changed, 1 insertion(+), 81 deletions(-) diff --git a/packages/patternfly-4/react-table/src/components/Table/BodyWrapper.js b/packages/patternfly-4/react-table/src/components/Table/BodyWrapper.js index 9b3c17cc0db..6ffdc21ec7e 100644 --- a/packages/patternfly-4/react-table/src/components/Table/BodyWrapper.js +++ b/packages/patternfly-4/react-table/src/components/Table/BodyWrapper.js @@ -7,7 +7,7 @@ import { mapOpenedRows } from './utils/headerUtils'; // eslint-disable-next-line react/prefer-stateless-function class BodyWrapper extends React.Component { render() { - const { mappedRows, tbodyRef, ...props } = this.props; + const { mappedRows, tbodyRef, rows, onCollapse, ...props } = this.props; if (mappedRows && mappedRows.some(row => row.hasOwnProperty('parent'))) { return ( diff --git a/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap b/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap index 847654317e7..d7ad140c2b9 100644 --- a/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap +++ b/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap @@ -2406,8 +2406,6 @@ exports[`Actions table 1`] = ` > Date: Mon, 10 Jun 2019 23:13:55 +0800 Subject: [PATCH 10/83] fix(react-table): Some props of IRow should not required (#2196) --- .../react-table/src/components/Table/Table.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/patternfly-4/react-table/src/components/Table/Table.d.ts b/packages/patternfly-4/react-table/src/components/Table/Table.d.ts index 4db02c5dee8..2202173d133 100644 --- a/packages/patternfly-4/react-table/src/components/Table/Table.d.ts +++ b/packages/patternfly-4/react-table/src/components/Table/Table.d.ts @@ -77,9 +77,9 @@ export interface IRowCell { export interface IRow { cells: Array; - isOpen: Boolean; - parent: Number; - props: any; + isOpen?: Boolean; + parent?: Number; + props?: any; fullWidth?: Boolean; noPadding?: Boolean; } From 65727b9a6ffd62fd941255c723a5846ec1739fac Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Mon, 10 Jun 2019 15:50:24 +0000 Subject: [PATCH 11/83] chore(release): releasing packages [ci skip] - patternfly-react-extensions@2.19.1 - patternfly-react-wooden-tree@2.0.1 - patternfly-react@2.36.1 - @patternfly/react-console@1.11.1 - @patternfly/react-charts@4.1.3 - @patternfly/react-core@3.37.1 - @patternfly/react-docs@4.6.9 - @patternfly/react-inline-edit-extension@2.7.4 - demo-app-ts@1.18.3 - @patternfly/react-styled-system@3.5.1 - @patternfly/react-styles@3.3.1 - @patternfly/react-table@2.10.4 - @patternfly/react-tokens@2.5.4 - @patternfly/react-virtualized-extension@1.0.3 - @patternfly/react-icons@3.9.4 --- .../patternfly-react-extensions/CHANGELOG.md | 8 ++++++++ .../patternfly-react-extensions/package.json | 4 ++-- .../patternfly-react-wooden-tree/CHANGELOG.md | 8 ++++++++ .../patternfly-react-wooden-tree/package.json | 2 +- packages/patternfly-3/patternfly-react/CHANGELOG.md | 8 ++++++++ packages/patternfly-3/patternfly-react/package.json | 2 +- packages/patternfly-3/react-console/CHANGELOG.md | 8 ++++++++ packages/patternfly-3/react-console/package.json | 4 ++-- packages/patternfly-4/react-charts/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-charts/package.json | 8 ++++---- packages/patternfly-4/react-core/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-core/package.json | 8 ++++---- packages/patternfly-4/react-docs/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-docs/package.json | 6 +++--- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 12 ++++++------ .../react-integration/demo-app-ts/CHANGELOG.md | 8 ++++++++ .../react-integration/demo-app-ts/package.json | 4 ++-- .../patternfly-4/react-styled-system/CHANGELOG.md | 8 ++++++++ .../patternfly-4/react-styled-system/package.json | 6 +++--- packages/patternfly-4/react-styles/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-styles/package.json | 2 +- packages/patternfly-4/react-table/CHANGELOG.md | 12 ++++++++++++ packages/patternfly-4/react-table/package.json | 10 +++++----- packages/patternfly-4/react-tokens/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-tokens/package.json | 2 +- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 8 ++++---- packages/react-icons/CHANGELOG.md | 8 ++++++++ packages/react-icons/package.json | 2 +- 30 files changed, 164 insertions(+), 40 deletions(-) diff --git a/packages/patternfly-3/patternfly-react-extensions/CHANGELOG.md b/packages/patternfly-3/patternfly-react-extensions/CHANGELOG.md index ea538d1eebe..8aff961ff5c 100644 --- a/packages/patternfly-3/patternfly-react-extensions/CHANGELOG.md +++ b/packages/patternfly-3/patternfly-react-extensions/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2.19.1 (2019-06-10) + +**Note:** Version bump only for package patternfly-react-extensions + + + + + # 2.19.0 (2019-06-05) diff --git a/packages/patternfly-3/patternfly-react-extensions/package.json b/packages/patternfly-3/patternfly-react-extensions/package.json index b4c7fdb6016..a1419ba23b6 100644 --- a/packages/patternfly-3/patternfly-react-extensions/package.json +++ b/packages/patternfly-3/patternfly-react-extensions/package.json @@ -1,6 +1,6 @@ { "name": "patternfly-react-extensions", - "version": "2.19.0", + "version": "2.19.1", "private": false, "description": "This library provides an extended set of React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", @@ -42,7 +42,7 @@ "classnames": "^2.2.5", "css-element-queries": "^1.0.1", "patternfly": "^3.58.0", - "patternfly-react": "^2.36.0", + "patternfly-react": "^2.36.1", "react-bootstrap": "^0.32.1", "react-click-outside": "^3.0.1", "react-diff-view": "^1.8.1", diff --git a/packages/patternfly-3/patternfly-react-wooden-tree/CHANGELOG.md b/packages/patternfly-3/patternfly-react-wooden-tree/CHANGELOG.md index 53f612ca02b..dbdb650c84c 100644 --- a/packages/patternfly-3/patternfly-react-wooden-tree/CHANGELOG.md +++ b/packages/patternfly-3/patternfly-react-wooden-tree/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2.0.1 (2019-06-10) + +**Note:** Version bump only for package patternfly-react-wooden-tree + + + + + # 2.0.0 (2019-06-05) diff --git a/packages/patternfly-3/patternfly-react-wooden-tree/package.json b/packages/patternfly-3/patternfly-react-wooden-tree/package.json index 0c73acee136..9a6227dcfa5 100644 --- a/packages/patternfly-3/patternfly-react-wooden-tree/package.json +++ b/packages/patternfly-3/patternfly-react-wooden-tree/package.json @@ -1,6 +1,6 @@ { "name": "patternfly-react-wooden-tree", - "version": "2.0.0", + "version": "2.0.1", "description": "Reexport react-wooden-tree with Patternfly design.", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/patternfly-3/patternfly-react/CHANGELOG.md b/packages/patternfly-3/patternfly-react/CHANGELOG.md index c480e4b7744..b1fdbbc9617 100644 --- a/packages/patternfly-3/patternfly-react/CHANGELOG.md +++ b/packages/patternfly-3/patternfly-react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2.36.1 (2019-06-10) + +**Note:** Version bump only for package patternfly-react + + + + + # 2.36.0 (2019-06-05) diff --git a/packages/patternfly-3/patternfly-react/package.json b/packages/patternfly-3/patternfly-react/package.json index dc86bee6c35..0dbebff8747 100644 --- a/packages/patternfly-3/patternfly-react/package.json +++ b/packages/patternfly-3/patternfly-react/package.json @@ -1,6 +1,6 @@ { "name": "patternfly-react", - "version": "2.36.0", + "version": "2.36.1", "private": false, "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", diff --git a/packages/patternfly-3/react-console/CHANGELOG.md b/packages/patternfly-3/react-console/CHANGELOG.md index 266b1ae15b1..701e3a9f6b1 100644 --- a/packages/patternfly-3/react-console/CHANGELOG.md +++ b/packages/patternfly-3/react-console/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 1.11.1 (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-console + + + + + # 1.11.0 (2019-06-05) diff --git a/packages/patternfly-3/react-console/package.json b/packages/patternfly-3/react-console/package.json index 39ca82545a1..1f16b3402c5 100644 --- a/packages/patternfly-3/react-console/package.json +++ b/packages/patternfly-3/react-console/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-console", - "version": "1.11.0", + "version": "1.11.1", "private": false, "description": "This library provides a set of Console React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", @@ -58,7 +58,7 @@ "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "patternfly": "^3.58.0", - "patternfly-react": "^2.36.0", + "patternfly-react": "^2.36.1", "rimraf": "^2.6.2", "shx": "^0.3.2" }, diff --git a/packages/patternfly-4/react-charts/CHANGELOG.md b/packages/patternfly-4/react-charts/CHANGELOG.md index d11b1c23292..97a9c4782d4 100644 --- a/packages/patternfly-4/react-charts/CHANGELOG.md +++ b/packages/patternfly-4/react-charts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.1.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.2...@patternfly/react-charts@4.1.3) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-charts + + + + + ## 4.1.2 (2019-06-10) diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index bc74dbb3e44..176c7ad9fcc 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "4.1.2", + "version": "4.1.3", "description": "This library provides a set of React chart components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "dependencies": { - "@patternfly/react-styles": "^3.3.0" + "@patternfly/react-styles": "^3.3.1" }, "peerDependencies": { "prop-types": "^15.6.1", @@ -65,8 +65,8 @@ "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", "@patternfly/patternfly": "2.8.2", - "@patternfly/react-icons": "^3.9.3", - "@patternfly/react-tokens": "^2.5.3", + "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-tokens": "^2.5.4", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", diff --git a/packages/patternfly-4/react-core/CHANGELOG.md b/packages/patternfly-4/react-core/CHANGELOG.md index 524519faa5c..9645f143860 100644 --- a/packages/patternfly-4/react-core/CHANGELOG.md +++ b/packages/patternfly-4/react-core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.37.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.37.0...@patternfly/react-core@3.37.1) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-core + + + + + # [3.37.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.36.1...@patternfly/react-core@3.37.0) (2019-06-07) diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index db9875d1541..6d3b18fba7c 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "3.37.0", + "version": "3.37.1", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "typecheck": "tsc -p tsconfig.typecheck.json" }, "dependencies": { - "@patternfly/react-icons": "^3.9.3", - "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-tokens": "^2.5.3", + "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-styles": "^3.3.1", + "@patternfly/react-tokens": "^2.5.4", "@tippy.js/react": "^1.1.1", "emotion": "^9.2.9", "exenv": "^1.2.2", diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index 7f00823549b..e70d3205d06 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.9](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.8...@patternfly/react-docs@4.6.9) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-docs + + + + + ## [4.6.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.7...@patternfly/react-docs@4.6.8) (2019-06-07) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index a6dc5c9e5ee..448a4cc34d7 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.8", + "version": "4.6.9", "author": "Red Hat", "license": "MIT", "private": true, @@ -17,8 +17,8 @@ "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.37.0", - "@patternfly/react-icons": "^3.9.3", + "@patternfly/react-core": "^3.37.1", + "@patternfly/react-icons": "^3.9.4", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", "gatsby-plugin-react-helmet": "^3.0.11", diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index 7dfa537e65f..ffc4f15cd46 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.3...@patternfly/react-inline-edit-extension@2.7.4) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.2...@patternfly/react-inline-edit-extension@2.7.3) (2019-06-07) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index d507fe70643..e0ce010314c 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.3", + "version": "2.7.4", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.37.0", - "@patternfly/react-icons": "^3.9.3", - "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-table": "^2.10.3", + "@patternfly/react-core": "^3.37.1", + "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-styles": "^3.3.1", + "@patternfly/react-table": "^2.10.4", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" @@ -51,7 +51,7 @@ "postbuild": "node ./build/copyStyles.js" }, "optionalDependencies": { - "@patternfly/react-tokens": "^2.5.3" + "@patternfly/react-tokens": "^2.5.4" }, "devDependencies": { "@babel/cli": "^7.0.0", diff --git a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md index 1e5a772ae1f..f8db2493bc3 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.18.3](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.2...demo-app-ts@1.18.3) (2019-06-10) + +**Note:** Version bump only for package demo-app-ts + + + + + ## [1.18.2](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.1...demo-app-ts@1.18.2) (2019-06-07) **Note:** Version bump only for package demo-app-ts diff --git a/packages/patternfly-4/react-integration/demo-app-ts/package.json b/packages/patternfly-4/react-integration/demo-app-ts/package.json index fe08df66333..7cc7186a780 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/package.json +++ b/packages/patternfly-4/react-integration/demo-app-ts/package.json @@ -1,13 +1,13 @@ { "name": "demo-app-ts", "private": true, - "version": "1.18.2", + "version": "1.18.3", "scripts": { "build:demo-app": "react-scripts build", "start:demo-app": "react-scripts start" }, "dependencies": { - "@patternfly/react-core": "^3.37.0", + "@patternfly/react-core": "^3.37.1", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router": "^4.3.1", diff --git a/packages/patternfly-4/react-styled-system/CHANGELOG.md b/packages/patternfly-4/react-styled-system/CHANGELOG.md index f446bb4098d..809110cff0e 100644 --- a/packages/patternfly-4/react-styled-system/CHANGELOG.md +++ b/packages/patternfly-4/react-styled-system/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 3.5.1 (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-styled-system + + + + + # [3.5.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styled-system@3.4.6...@patternfly/react-styled-system@3.5.0) (2019-06-05) diff --git a/packages/patternfly-4/react-styled-system/package.json b/packages/patternfly-4/react-styled-system/package.json index 8cbb14d2046..6f41775dc65 100644 --- a/packages/patternfly-4/react-styled-system/package.json +++ b/packages/patternfly-4/react-styled-system/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styled-system", - "version": "3.5.0", + "version": "3.5.1", "description": "Experimental: Styled System package with PatternFly 4 theming", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -35,8 +35,8 @@ "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, "dependencies": { - "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-tokens": "^2.5.3", + "@patternfly/react-styles": "^3.3.1", + "@patternfly/react-tokens": "^2.5.4", "emotion-theming": "^9.2.9", "react-emotion": "^9.2.9", "styled-system": "^3.1.11" diff --git a/packages/patternfly-4/react-styles/CHANGELOG.md b/packages/patternfly-4/react-styles/CHANGELOG.md index 0b512a80cc4..14f6c42c239 100644 --- a/packages/patternfly-4/react-styles/CHANGELOG.md +++ b/packages/patternfly-4/react-styles/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 3.3.1 (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-styles + + + + + # [3.3.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@3.2.4...@patternfly/react-styles@3.3.0) (2019-06-05) diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index 9922c87a899..c4e17b8e5e8 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styles", - "version": "3.3.0", + "version": "3.3.1", "main": "dist/js/index.js", "module": "dist/esm/index.js", "types": "dist/js/index.d.ts", diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index 3697dba373c..ea2c55a7491 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.3...@patternfly/react-table@2.10.4) (2019-06-10) + + +### Bug Fixes + +* **react-table:** Fix error Unknown event handler property `onCollapse`. It will be ignored. ([#2195](https://github.com/patternfly/patternfly-react/issues/2195)) ([2cbdfb8](https://github.com/patternfly/patternfly-react/commit/2cbdfb8)) +* **react-table:** Some props of IRow should not required ([#2196](https://github.com/patternfly/patternfly-react/issues/2196)) ([343f928](https://github.com/patternfly/patternfly-react/commit/343f928)) + + + + + ## [2.10.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.2...@patternfly/react-table@2.10.3) (2019-06-07) **Note:** Version bump only for package @patternfly/react-table diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index 4e22418cc18..2dce02aed94 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.10.3", + "version": "2.10.4", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.37.0", - "@patternfly/react-icons": "^3.9.3", - "@patternfly/react-styles": "^3.3.0", - "@patternfly/react-tokens": "^2.5.3", + "@patternfly/react-core": "^3.37.1", + "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-styles": "^3.3.1", + "@patternfly/react-tokens": "^2.5.4", "classnames": "^2.2.5", "exenv": "^1.2.2" }, diff --git a/packages/patternfly-4/react-tokens/CHANGELOG.md b/packages/patternfly-4/react-tokens/CHANGELOG.md index 80101cfba3d..5f2b529ac68 100644 --- a/packages/patternfly-4/react-tokens/CHANGELOG.md +++ b/packages/patternfly-4/react-tokens/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 2.5.4 (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-tokens + + + + + ## 2.5.3 (2019-05-29) **Note:** Version bump only for package @patternfly/react-tokens diff --git a/packages/patternfly-4/react-tokens/package.json b/packages/patternfly-4/react-tokens/package.json index d673bf4f364..647d0067077 100644 --- a/packages/patternfly-4/react-tokens/package.json +++ b/packages/patternfly-4/react-tokens/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-tokens", - "version": "2.5.3", + "version": "2.5.4", "description": "This library provides access to the design tokens of PatternFly 4 from JavaScript", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md index 356d6cf9c30..7fc823c32d0 100644 --- a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.2...@patternfly/react-virtualized-extension@1.0.3) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension + + + + + ## [1.0.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.1...@patternfly/react-virtualized-extension@1.0.2) (2019-06-07) **Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index b2e23c562c5..296a787eeae 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.2", + "version": "1.0.3", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,9 +28,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.8.2", - "@patternfly/react-core": "^3.37.0", - "@patternfly/react-icons": "^3.9.3", - "@patternfly/react-styles": "^3.3.0", + "@patternfly/react-core": "^3.37.1", + "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-styles": "^3.3.1", "clsx": "^1.0.1", "dom-helpers": "^2.4.0 || ^3.0.0", "exenv": "^1.2.2", diff --git a/packages/react-icons/CHANGELOG.md b/packages/react-icons/CHANGELOG.md index f4caf6ab088..c25275a3f26 100644 --- a/packages/react-icons/CHANGELOG.md +++ b/packages/react-icons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## 3.9.4 (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-icons + + + + + ## 3.9.3 (2019-05-29) **Note:** Version bump only for package @patternfly/react-icons diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index 34a67d266b0..cba90e334ff 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-icons", - "version": "3.9.3", + "version": "3.9.4", "description": "PatternFly 4 Icons as React Components", "main": "dist/js/index.js", "module": "dist/esm/index.js", From 417751a305eb9070e57f12e194bd7601aeee4516 Mon Sep 17 00:00:00 2001 From: Patternfly Build Date: Mon, 10 Jun 2019 16:00:30 -0400 Subject: [PATCH 12/83] Bump @patternfly/patternfly versions to 2.12.5 (#2184) * chore(package): Bump @patternfly/patternfly versions to 2.12.5 * fix build failure * fix buil failure * tweak glob --- .../patternfly-4/react-charts/package.json | 2 +- packages/patternfly-4/react-core/package.json | 2 +- packages/patternfly-4/react-docs/package.json | 3 ++- .../react-inline-edit-extension/package.json | 2 +- .../react-styled-system/package.json | 2 +- .../patternfly-4/react-styles/package.json | 2 +- .../react-styles/src/generateClasses.js | 2 +- .../patternfly-4/react-table/package.json | 2 +- .../patternfly-4/react-tokens/package.json | 2 +- .../react-virtualized-extension/package.json | 2 +- packages/react-icons/package.json | 2 +- yarn.lock | 19 +++++++++++++++++++ 12 files changed, 31 insertions(+), 11 deletions(-) diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index 176c7ad9fcc..9936b998a1a 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -64,7 +64,7 @@ "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@patternfly/react-icons": "^3.9.4", "@patternfly/react-tokens": "^2.5.4", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index 6d3b18fba7c..694f6e30049 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -58,7 +58,7 @@ "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@types/enzyme": "3.9.0", "@types/exenv": "^1.2.0", "@types/jest": "^24.0.11", diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index 448a4cc34d7..f2dcb476867 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -16,9 +16,10 @@ "dependencies": { "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@patternfly/react-core": "^3.37.1", "@patternfly/react-icons": "^3.9.4", + "@patternfly/react-virtualized-extension": "^1.0.1", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", "gatsby-plugin-react-helmet": "^3.0.11", diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index e0ce010314c..7a0be599dff 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@patternfly/react-core": "^3.37.1", "@patternfly/react-icons": "^3.9.4", "@patternfly/react-styles": "^3.3.1", diff --git a/packages/patternfly-4/react-styled-system/package.json b/packages/patternfly-4/react-styled-system/package.json index 6f41775dc65..5c9697abc0c 100644 --- a/packages/patternfly-4/react-styled-system/package.json +++ b/packages/patternfly-4/react-styled-system/package.json @@ -54,7 +54,7 @@ "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index c4e17b8e5e8..55d8c264271 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -47,7 +47,7 @@ "@babel/plugin-transform-typescript": "^7.0.0", "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-plugin-typescript-to-proptypes": "^0.17.1", "glob": "^7.1.2", diff --git a/packages/patternfly-4/react-styles/src/generateClasses.js b/packages/patternfly-4/react-styles/src/generateClasses.js index 980d3e5a6b8..b91ad5b6984 100644 --- a/packages/patternfly-4/react-styles/src/generateClasses.js +++ b/packages/patternfly-4/react-styles/src/generateClasses.js @@ -11,7 +11,7 @@ const pfStylesDir = dirname(require.resolve('@patternfly/patternfly/patternfly.c const cssFiles = glob.sync('**/*.css', { cwd: pfStylesDir, - ignore: ['assets/**'] + ignore: ['assets/**', '*ie11*.css'] }); cssFiles.forEach(filePath => { diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index 2dce02aed94..3b4116a3b97 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@patternfly/react-core": "^3.37.1", "@patternfly/react-icons": "^3.9.4", "@patternfly/react-styles": "^3.3.1", diff --git a/packages/patternfly-4/react-tokens/package.json b/packages/patternfly-4/react-tokens/package.json index 647d0067077..0f512dc8882 100644 --- a/packages/patternfly-4/react-tokens/package.json +++ b/packages/patternfly-4/react-tokens/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@babel/cli": "^7.0.0", "@babel/core": "^7.0.0", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "css": "^2.2.3", "fs-extra": "^6.0.1", diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index 296a787eeae..2472d780fc0 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -27,7 +27,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "@patternfly/react-core": "^3.37.1", "@patternfly/react-icons": "^3.9.4", "@patternfly/react-styles": "^3.3.1", diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index cba90e334ff..c7ebcd2617d 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -42,7 +42,7 @@ "@babel/preset-react": "^7.0.0", "@fortawesome/free-regular-svg-icons": "^5.7.2", "@fortawesome/free-solid-svg-icons": "^5.7.2", - "@patternfly/patternfly": "2.8.2", + "@patternfly/patternfly": "2.12.5", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-plugin-typescript-to-proptypes": "^0.17.1", "fs-extra": "^6.0.1", diff --git a/yarn.lock b/yarn.lock index 6a9e1cafc82..dde038ed561 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1714,10 +1714,29 @@ universal-user-agent "^2.0.0" url-template "^2.0.8" +"@patternfly/patternfly@2.12.5": + version "2.12.5" + resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-2.12.5.tgz#f2c5924deb875a8cde95e09e6d5c9022f00429da" + "@patternfly/patternfly@2.8.2": version "2.8.2" resolved "https://registry.yarnpkg.com/@patternfly/patternfly/-/patternfly-2.8.2.tgz#8362795b17a73be76dd9408b3c0d370e8a030d77" +"@patternfly/react-virtualized-extension@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@patternfly/react-virtualized-extension/-/react-virtualized-extension-1.0.1.tgz#d5e5e416445d7bc55170a96e3c04caf8c98e309b" + dependencies: + "@patternfly/patternfly" "2.8.2" + "@patternfly/react-core" "^3.36.0" + "@patternfly/react-icons" "^3.9.3" + "@patternfly/react-styles" "^3.3.0" + clsx "^1.0.1" + dom-helpers "^2.4.0 || ^3.0.0" + exenv "^1.2.2" + linear-layout-vector "0.0.1" + react-lifecycles-compat "^3.0.4" + react-virtualized "9.21.1" + "@pieh/friendly-errors-webpack-plugin@1.7.0-chalk-2": version "1.7.0-chalk-2" resolved "https://registry.yarnpkg.com/@pieh/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.0-chalk-2.tgz#2e9da9d3ade9d18d013333eb408c457d04eabac0" From fd3d7719c26a1108da09ad259cce8451def63c25 Mon Sep 17 00:00:00 2001 From: Jessie Date: Mon, 10 Jun 2019 16:16:11 -0400 Subject: [PATCH 13/83] feat(backdrop): Convert backdrop to typescript (#2105) * Converted backdrop component to typescript * Add demo and tests --- .../AboutModal/AboutModalContainer.tsx | 2 +- .../AboutModalContainer.test.tsx.snap | 6 ++-- .../src/components/Backdrop/Backdrop.d.ts | 10 ------- .../src/components/Backdrop/Backdrop.js | 27 ----------------- .../{Backdrop.test.js => Backdrop.test.tsx} | 2 +- .../src/components/Backdrop/Backdrop.tsx | 20 +++++++++++++ ...op.test.js.snap => Backdrop.test.tsx.snap} | 0 .../src/components/Backdrop/index.d.ts | 1 - .../src/components/Backdrop/index.js | 1 - .../src/components/Backdrop/index.ts | 1 + .../src/components/Modal/ModalContent.tsx | 2 +- .../__snapshots__/ModalContent.test.tsx.snap | 30 +++++++------------ .../Wizard/__snapshots__/Wizard.test.tsx.snap | 6 ++-- .../cypress/integration/backdrop.spec.ts | 11 +++++++ .../demo-app-ts/src/Demos.ts | 5 ++++ .../demos/BackdropDemo/BackdropDemo.tsx | 12 ++++++++ .../demo-app-ts/src/components/demos/index.ts | 1 + 17 files changed, 67 insertions(+), 70 deletions(-) delete mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.js rename packages/patternfly-4/react-core/src/components/Backdrop/{Backdrop.test.js => Backdrop.test.tsx} (82%) create mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.tsx rename packages/patternfly-4/react-core/src/components/Backdrop/__snapshots__/{Backdrop.test.js.snap => Backdrop.test.tsx.snap} (100%) delete mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/index.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/index.js create mode 100644 packages/patternfly-4/react-core/src/components/Backdrop/index.ts create mode 100644 packages/patternfly-4/react-integration/cypress/integration/backdrop.spec.ts create mode 100644 packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/BackdropDemo/BackdropDemo.tsx diff --git a/packages/patternfly-4/react-core/src/components/AboutModal/AboutModalContainer.tsx b/packages/patternfly-4/react-core/src/components/AboutModal/AboutModalContainer.tsx index aacbe730a2b..497b6cd2062 100644 --- a/packages/patternfly-4/react-core/src/components/AboutModal/AboutModalContainer.tsx +++ b/packages/patternfly-4/react-core/src/components/AboutModal/AboutModalContainer.tsx @@ -5,7 +5,7 @@ import { AboutModalBoxHero } from './AboutModalBoxHero'; import { AboutModalBoxBrand } from './AboutModalBoxBrand'; import { AboutModalBoxCloseButton } from './AboutModalBoxCloseButton'; import { AboutModalBox } from './AboutModalBox'; -import Backdrop from '../Backdrop/Backdrop'; +import { Backdrop } from '../Backdrop/Backdrop'; import Bullseye from '../../layouts/Bullseye/Bullseye'; export interface AboutModalContainerProps extends React.HTMLProps { diff --git a/packages/patternfly-4/react-core/src/components/AboutModal/__snapshots__/AboutModalContainer.test.tsx.snap b/packages/patternfly-4/react-core/src/components/AboutModal/__snapshots__/AboutModalContainer.test.tsx.snap index 6f52e4feea7..3da487c4c62 100644 --- a/packages/patternfly-4/react-core/src/components/AboutModal/__snapshots__/AboutModalContainer.test.tsx.snap +++ b/packages/patternfly-4/react-core/src/components/AboutModal/__snapshots__/AboutModalContainer.test.tsx.snap @@ -1,9 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`About Modal Container Test isOpen 1`] = ` - + - + `; exports[`About Modal Container Test simple 1`] = `""`; diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.d.ts b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.d.ts deleted file mode 100644 index d618ac52dba..00000000000 --- a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -import { FunctionComponent, HTMLProps, ReactNode } from 'react'; - -export interface BackdropProps extends HTMLProps { - children?: ReactNode; - className?: string; -} - -declare const Backdrop: FunctionComponent; - -export default Backdrop; diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.js b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.js deleted file mode 100644 index 066f421ce34..00000000000 --- a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.js +++ /dev/null @@ -1,27 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import { css } from '@patternfly/react-styles'; -import styles from '@patternfly/react-styles/css/components/Backdrop/backdrop'; - -const propTypes = { - /** content rendered inside the backdrop */ - children: PropTypes.node, - /** additional classes added to the button */ - className: PropTypes.string -}; - -const defaultProps = { - children: null, - className: '' -}; - -const Backdrop = ({ className, children, ...props }) => ( -
- {children} -
-); - -Backdrop.propTypes = propTypes; -Backdrop.defaultProps = defaultProps; - -export default Backdrop; diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.js b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.tsx similarity index 82% rename from packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.js rename to packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.tsx index 99d675aca51..cfd8d97ec70 100644 --- a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.js +++ b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.test.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { shallow } from 'enzyme'; -import Backdrop from './Backdrop'; +import { Backdrop } from './Backdrop'; test('Backdrop Test', () => { const view = shallow(Backdrop); diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.tsx b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.tsx new file mode 100644 index 00000000000..ae7b7c8d7ce --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Backdrop/Backdrop.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; +import { css } from '@patternfly/react-styles'; +import styles from '@patternfly/react-styles/css/components/Backdrop/backdrop'; + +export interface BackdropProps extends React.HTMLProps { + /** content rendered inside the backdrop */ + children?: React.ReactNode; + /** additional classes added to the button */ + className?: string; +} + +export const Backdrop: React.FunctionComponent = ({ + children = null, + className = '', + ...props +}: BackdropProps) => ( +
+ {children} +
+) \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/__snapshots__/Backdrop.test.js.snap b/packages/patternfly-4/react-core/src/components/Backdrop/__snapshots__/Backdrop.test.tsx.snap similarity index 100% rename from packages/patternfly-4/react-core/src/components/Backdrop/__snapshots__/Backdrop.test.js.snap rename to packages/patternfly-4/react-core/src/components/Backdrop/__snapshots__/Backdrop.test.tsx.snap diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/index.d.ts b/packages/patternfly-4/react-core/src/components/Backdrop/index.d.ts deleted file mode 100644 index c76cf6cade7..00000000000 --- a/packages/patternfly-4/react-core/src/components/Backdrop/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as Backdrop, BackdropProps } from './Backdrop'; diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/index.js b/packages/patternfly-4/react-core/src/components/Backdrop/index.js deleted file mode 100644 index 70cf60d910c..00000000000 --- a/packages/patternfly-4/react-core/src/components/Backdrop/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as Backdrop } from './Backdrop'; diff --git a/packages/patternfly-4/react-core/src/components/Backdrop/index.ts b/packages/patternfly-4/react-core/src/components/Backdrop/index.ts new file mode 100644 index 00000000000..b4c58db120a --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Backdrop/index.ts @@ -0,0 +1 @@ +export * from './Backdrop'; diff --git a/packages/patternfly-4/react-core/src/components/Modal/ModalContent.tsx b/packages/patternfly-4/react-core/src/components/Modal/ModalContent.tsx index 32f61a280e4..c8a3de99645 100644 --- a/packages/patternfly-4/react-core/src/components/Modal/ModalContent.tsx +++ b/packages/patternfly-4/react-core/src/components/Modal/ModalContent.tsx @@ -8,7 +8,7 @@ const FocusTrap: any = require('focus-trap-react'); import styles from '@patternfly/react-styles/css/layouts/Bullseye/bullseye'; import { css } from '@patternfly/react-styles'; -import Backdrop from '../Backdrop/Backdrop'; +import { Backdrop } from '../Backdrop/Backdrop'; import { ModalBoxBody } from './ModalBoxBody'; import { ModalBoxHeader } from './ModalBoxHeader'; import { ModalBoxCloseButton } from './ModalBoxCloseButton'; diff --git a/packages/patternfly-4/react-core/src/components/Modal/__snapshots__/ModalContent.test.tsx.snap b/packages/patternfly-4/react-core/src/components/Modal/__snapshots__/ModalContent.test.tsx.snap index 6c5194b15f3..415e4c3f592 100644 --- a/packages/patternfly-4/react-core/src/components/Modal/__snapshots__/ModalContent.test.tsx.snap +++ b/packages/patternfly-4/react-core/src/components/Modal/__snapshots__/ModalContent.test.tsx.snap @@ -1,9 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Modal Content Test isOpen 1`] = ` - + - + `; exports[`Modal Content Test only body 1`] = ` - + - + `; exports[`Modal Content Test with footer 1`] = ` - + - + `; exports[`Modal Content Test with onclose 1`] = ` - + - + `; exports[`Modal Content test without footer 1`] = ` - + - + `; diff --git a/packages/patternfly-4/react-core/src/components/Wizard/__snapshots__/Wizard.test.tsx.snap b/packages/patternfly-4/react-core/src/components/Wizard/__snapshots__/Wizard.test.tsx.snap index 6f2e477daec..1100830e93f 100644 --- a/packages/patternfly-4/react-core/src/components/Wizard/__snapshots__/Wizard.test.tsx.snap +++ b/packages/patternfly-4/react-core/src/components/Wizard/__snapshots__/Wizard.test.tsx.snap @@ -15,9 +15,7 @@ exports[`Wizard should match snapshot 1`] = ` paused={false} tag="div" > - + - + , "containerInfo":
diff --git a/packages/patternfly-4/react-integration/cypress/integration/backdrop.spec.ts b/packages/patternfly-4/react-integration/cypress/integration/backdrop.spec.ts new file mode 100644 index 00000000000..19c4ef4f860 --- /dev/null +++ b/packages/patternfly-4/react-integration/cypress/integration/backdrop.spec.ts @@ -0,0 +1,11 @@ +describe('Backdrop Demo Test', () => { + it('Navigate to demo section', () => { + cy.visit('http://localhost:3000/'); + cy.get('#backdrop-demo-nav-item-link').click(); + cy.url().should('eq', 'http://localhost:3000/backdrop-demo-nav-link'); + }); + + it('Verify has correct className', () => { + cy.get('.backdrop').should('have.class', 'pf-c-backdrop'); + }); +}) \ No newline at end of file diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts b/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts index 7491b597704..5a6c6d32ae7 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts @@ -25,6 +25,11 @@ export const Demos: DemoInterface[] = [ name: 'Avatar Demo', componentType: Examples.AvatarDemo }, + { + id: 'backdrop-demo', + name: 'Backdrop Demo', + componentType: Examples.BackdropDemo + }, { id: 'backgroundimage-demo', name: 'Background Image Demo', diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/BackdropDemo/BackdropDemo.tsx b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/BackdropDemo/BackdropDemo.tsx new file mode 100644 index 00000000000..caaa67989ef --- /dev/null +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/BackdropDemo/BackdropDemo.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import { Backdrop } from '@patternfly/react-core'; + +export class BackdropDemo extends React.Component { + render() { + return ( + + ); + } +} + + \ No newline at end of file diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts index e90b8830c72..35aacf61847 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts @@ -1,6 +1,7 @@ export * from './AboutModal/AboutModalDemo'; export * from './AlertDemo/AlertDemo'; export * from './AvatarDemo/AvatarDemo'; +export * from './BackdropDemo/BackdropDemo'; export * from './BackgroundImageDemo/BackgroundImageDemo'; export * from './BadgeDemo/BadgeDemo'; export * from './BrandDemo/BrandDemo'; From 8a90f8000b0116542096f85bb52e3a658c55cf9e Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Mon, 10 Jun 2019 20:47:56 +0000 Subject: [PATCH 14/83] chore(release): releasing packages [ci skip] - @patternfly/react-charts@4.1.4 - @patternfly/react-core@3.38.0 - @patternfly/react-docs@4.6.10 - @patternfly/react-inline-edit-extension@2.7.5 - demo-app-ts@1.19.0 - @patternfly/react-integration@1.18.0 - @patternfly/react-styled-system@3.5.2 - @patternfly/react-styles@3.3.2 - @patternfly/react-table@2.10.5 - @patternfly/react-tokens@2.5.5 - @patternfly/react-virtualized-extension@1.0.4 - @patternfly/react-icons@3.9.5 --- packages/patternfly-4/react-charts/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-charts/package.json | 8 ++++---- packages/patternfly-4/react-core/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-core/package.json | 8 ++++---- packages/patternfly-4/react-docs/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-docs/package.json | 8 ++++---- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 12 ++++++------ packages/patternfly-4/react-integration/CHANGELOG.md | 12 ++++++++++++ .../react-integration/demo-app-ts/CHANGELOG.md | 11 +++++++++++ .../react-integration/demo-app-ts/package.json | 4 ++-- packages/patternfly-4/react-integration/package.json | 2 +- .../patternfly-4/react-styled-system/CHANGELOG.md | 8 ++++++++ .../patternfly-4/react-styled-system/package.json | 6 +++--- packages/patternfly-4/react-styles/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-styles/package.json | 2 +- packages/patternfly-4/react-table/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-table/package.json | 10 +++++----- packages/patternfly-4/react-tokens/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-tokens/package.json | 2 +- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 8 ++++---- packages/react-icons/CHANGELOG.md | 8 ++++++++ packages/react-icons/package.json | 2 +- 24 files changed, 142 insertions(+), 36 deletions(-) diff --git a/packages/patternfly-4/react-charts/CHANGELOG.md b/packages/patternfly-4/react-charts/CHANGELOG.md index 97a9c4782d4..831a6661c01 100644 --- a/packages/patternfly-4/react-charts/CHANGELOG.md +++ b/packages/patternfly-4/react-charts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.1.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.3...@patternfly/react-charts@4.1.4) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-charts + + + + + ## [4.1.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.2...@patternfly/react-charts@4.1.3) (2019-06-10) **Note:** Version bump only for package @patternfly/react-charts diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index 9936b998a1a..791dbac6f11 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "4.1.3", + "version": "4.1.4", "description": "This library provides a set of React chart components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "dependencies": { - "@patternfly/react-styles": "^3.3.1" + "@patternfly/react-styles": "^3.3.2" }, "peerDependencies": { "prop-types": "^15.6.1", @@ -65,8 +65,8 @@ "@babel/preset-env": "^7.0.0", "@babel/preset-react": "^7.0.0", "@patternfly/patternfly": "2.12.5", - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-tokens": "^2.5.4", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-tokens": "^2.5.5", "babel-plugin-transform-es2015-modules-umd": "^6.24.1", "babel-plugin-typescript-to-proptypes": "^0.17.1", "css": "^2.2.3", diff --git a/packages/patternfly-4/react-core/CHANGELOG.md b/packages/patternfly-4/react-core/CHANGELOG.md index 9645f143860..c8289799342 100644 --- a/packages/patternfly-4/react-core/CHANGELOG.md +++ b/packages/patternfly-4/react-core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.38.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.37.1...@patternfly/react-core@3.38.0) (2019-06-10) + + +### Features + +* **backdrop:** Convert backdrop to typescript ([#2105](https://github.com/patternfly/patternfly-react/issues/2105)) ([fd3d771](https://github.com/patternfly/patternfly-react/commit/fd3d771)) + + + + + ## [3.37.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.37.0...@patternfly/react-core@3.37.1) (2019-06-10) **Note:** Version bump only for package @patternfly/react-core diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index 694f6e30049..a179a158a2b 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "3.37.1", + "version": "3.38.0", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -41,9 +41,9 @@ "typecheck": "tsc -p tsconfig.typecheck.json" }, "dependencies": { - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-styles": "^3.3.1", - "@patternfly/react-tokens": "^2.5.4", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-tokens": "^2.5.5", "@tippy.js/react": "^1.1.1", "emotion": "^9.2.9", "exenv": "^1.2.2", diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index e70d3205d06..75d629c950f 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.10](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.9...@patternfly/react-docs@4.6.10) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-docs + + + + + ## [4.6.9](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.8...@patternfly/react-docs@4.6.9) (2019-06-10) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index f2dcb476867..aacecce0746 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.9", + "version": "4.6.10", "author": "Red Hat", "license": "MIT", "private": true, @@ -17,9 +17,9 @@ "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.37.1", - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-virtualized-extension": "^1.0.1", + "@patternfly/react-core": "^3.38.0", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-virtualized-extension": "^1.0.4", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", "gatsby-plugin-react-helmet": "^3.0.11", diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index ffc4f15cd46..d9896873320 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.4...@patternfly/react-inline-edit-extension@2.7.5) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.3...@patternfly/react-inline-edit-extension@2.7.4) (2019-06-10) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index 7a0be599dff..7c30bde0fa0 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.4", + "version": "2.7.5", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.37.1", - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-styles": "^3.3.1", - "@patternfly/react-table": "^2.10.4", + "@patternfly/react-core": "^3.38.0", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-table": "^2.10.5", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" @@ -51,7 +51,7 @@ "postbuild": "node ./build/copyStyles.js" }, "optionalDependencies": { - "@patternfly/react-tokens": "^2.5.4" + "@patternfly/react-tokens": "^2.5.5" }, "devDependencies": { "@babel/cli": "^7.0.0", diff --git a/packages/patternfly-4/react-integration/CHANGELOG.md b/packages/patternfly-4/react-integration/CHANGELOG.md index 20d638ec4d5..be71a2f984e 100644 --- a/packages/patternfly-4/react-integration/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# 1.18.0 (2019-06-10) + + +### Features + +* **backdrop:** Convert backdrop to typescript ([#2105](https://github.com/patternfly/patternfly-react/issues/2105)) ([fd3d771](https://github.com/patternfly/patternfly-react/commit/fd3d771)) +* **PF4: Pagination:** When empty array sent to pagination no per page should be visible ([#2175](https://github.com/patternfly/patternfly-react/issues/2175)) ([cb97dfd](https://github.com/patternfly/patternfly-react/commit/cb97dfd)) + + + + + # [1.17.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-integration@1.16.0...@patternfly/react-integration@1.17.0) (2019-06-05) diff --git a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md index f8db2493bc3..1e7c2dcc8b8 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.19.0](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.3...demo-app-ts@1.19.0) (2019-06-10) + + +### Features + +* **backdrop:** Convert backdrop to typescript ([#2105](https://github.com/patternfly/patternfly-react/issues/2105)) ([fd3d771](https://github.com/patternfly/patternfly-react/commit/fd3d771)) + + + + + ## [1.18.3](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.2...demo-app-ts@1.18.3) (2019-06-10) **Note:** Version bump only for package demo-app-ts diff --git a/packages/patternfly-4/react-integration/demo-app-ts/package.json b/packages/patternfly-4/react-integration/demo-app-ts/package.json index 7cc7186a780..50823a7b09d 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/package.json +++ b/packages/patternfly-4/react-integration/demo-app-ts/package.json @@ -1,13 +1,13 @@ { "name": "demo-app-ts", "private": true, - "version": "1.18.3", + "version": "1.19.0", "scripts": { "build:demo-app": "react-scripts build", "start:demo-app": "react-scripts start" }, "dependencies": { - "@patternfly/react-core": "^3.37.1", + "@patternfly/react-core": "^3.38.0", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router": "^4.3.1", diff --git a/packages/patternfly-4/react-integration/package.json b/packages/patternfly-4/react-integration/package.json index a6186f242fd..61a92d9b7b5 100644 --- a/packages/patternfly-4/react-integration/package.json +++ b/packages/patternfly-4/react-integration/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-integration", "private": true, - "version": "1.17.0", + "version": "1.18.0", "description": "Integration testing for PF4 using demo applications", "main": "lib/index.js", "sideEffects": false, diff --git a/packages/patternfly-4/react-styled-system/CHANGELOG.md b/packages/patternfly-4/react-styled-system/CHANGELOG.md index 809110cff0e..41d0ecf612a 100644 --- a/packages/patternfly-4/react-styled-system/CHANGELOG.md +++ b/packages/patternfly-4/react-styled-system/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.5.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styled-system@3.5.1...@patternfly/react-styled-system@3.5.2) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-styled-system + + + + + ## 3.5.1 (2019-06-10) **Note:** Version bump only for package @patternfly/react-styled-system diff --git a/packages/patternfly-4/react-styled-system/package.json b/packages/patternfly-4/react-styled-system/package.json index 5c9697abc0c..0b140b6f499 100644 --- a/packages/patternfly-4/react-styled-system/package.json +++ b/packages/patternfly-4/react-styled-system/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styled-system", - "version": "3.5.1", + "version": "3.5.2", "description": "Experimental: Styled System package with PatternFly 4 theming", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -35,8 +35,8 @@ "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, "dependencies": { - "@patternfly/react-styles": "^3.3.1", - "@patternfly/react-tokens": "^2.5.4", + "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-tokens": "^2.5.5", "emotion-theming": "^9.2.9", "react-emotion": "^9.2.9", "styled-system": "^3.1.11" diff --git a/packages/patternfly-4/react-styles/CHANGELOG.md b/packages/patternfly-4/react-styles/CHANGELOG.md index 14f6c42c239..b4ba4c5566d 100644 --- a/packages/patternfly-4/react-styles/CHANGELOG.md +++ b/packages/patternfly-4/react-styles/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.3.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@3.3.1...@patternfly/react-styles@3.3.2) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-styles + + + + + ## 3.3.1 (2019-06-10) **Note:** Version bump only for package @patternfly/react-styles diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index 55d8c264271..71da4c8c860 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styles", - "version": "3.3.1", + "version": "3.3.2", "main": "dist/js/index.js", "module": "dist/esm/index.js", "types": "dist/js/index.d.ts", diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index ea2c55a7491..cb1df69b510 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.10.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.4...@patternfly/react-table@2.10.5) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-table + + + + + ## [2.10.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.3...@patternfly/react-table@2.10.4) (2019-06-10) diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index 3b4116a3b97..b75df0ee7fb 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.10.4", + "version": "2.10.5", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.37.1", - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-styles": "^3.3.1", - "@patternfly/react-tokens": "^2.5.4", + "@patternfly/react-core": "^3.38.0", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-tokens": "^2.5.5", "classnames": "^2.2.5", "exenv": "^1.2.2" }, diff --git a/packages/patternfly-4/react-tokens/CHANGELOG.md b/packages/patternfly-4/react-tokens/CHANGELOG.md index 5f2b529ac68..5e03821752c 100644 --- a/packages/patternfly-4/react-tokens/CHANGELOG.md +++ b/packages/patternfly-4/react-tokens/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.5.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-tokens@2.5.4...@patternfly/react-tokens@2.5.5) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-tokens + + + + + ## 2.5.4 (2019-06-10) **Note:** Version bump only for package @patternfly/react-tokens diff --git a/packages/patternfly-4/react-tokens/package.json b/packages/patternfly-4/react-tokens/package.json index 0f512dc8882..339471b93e6 100644 --- a/packages/patternfly-4/react-tokens/package.json +++ b/packages/patternfly-4/react-tokens/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-tokens", - "version": "2.5.4", + "version": "2.5.5", "description": "This library provides access to the design tokens of PatternFly 4 from JavaScript", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md index 7fc823c32d0..84636f9269f 100644 --- a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.3...@patternfly/react-virtualized-extension@1.0.4) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension + + + + + ## [1.0.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.2...@patternfly/react-virtualized-extension@1.0.3) (2019-06-10) **Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index 2472d780fc0..d5234edba9d 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.3", + "version": "1.0.4", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,9 +28,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.37.1", - "@patternfly/react-icons": "^3.9.4", - "@patternfly/react-styles": "^3.3.1", + "@patternfly/react-core": "^3.38.0", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-styles": "^3.3.2", "clsx": "^1.0.1", "dom-helpers": "^2.4.0 || ^3.0.0", "exenv": "^1.2.2", diff --git a/packages/react-icons/CHANGELOG.md b/packages/react-icons/CHANGELOG.md index c25275a3f26..4caf1dd9905 100644 --- a/packages/react-icons/CHANGELOG.md +++ b/packages/react-icons/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.9.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-icons@3.9.4...@patternfly/react-icons@3.9.5) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-icons + + + + + ## 3.9.4 (2019-06-10) **Note:** Version bump only for package @patternfly/react-icons diff --git a/packages/react-icons/package.json b/packages/react-icons/package.json index c7ebcd2617d..73f84f3e166 100644 --- a/packages/react-icons/package.json +++ b/packages/react-icons/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-icons", - "version": "3.9.4", + "version": "3.9.5", "description": "PatternFly 4 Icons as React Components", "main": "dist/js/index.js", "module": "dist/esm/index.js", From 0f9ebf99a158ed9c340e4480e57a053206841b74 Mon Sep 17 00:00:00 2001 From: Rebecca Alpert Date: Mon, 10 Jun 2019 17:21:31 -0400 Subject: [PATCH 15/83] feat(Table): Add support for .pf-m-grid-2xl breakpoint (#2206) Added breakpoint to list of available breakpoints and updated snapshot. Fixes https://github.com/patternfly/patternfly-react/issues/2198 --- .../src/components/Table/Table.d.ts | 3 +- .../react-table/src/components/Table/Table.js | 3 +- .../Table/__snapshots__/Table.test.js.snap | 6053 +++++++++++++++++ 3 files changed, 6057 insertions(+), 2 deletions(-) diff --git a/packages/patternfly-4/react-table/src/components/Table/Table.d.ts b/packages/patternfly-4/react-table/src/components/Table/Table.d.ts index 2202173d133..eb4a91ea269 100644 --- a/packages/patternfly-4/react-table/src/components/Table/Table.d.ts +++ b/packages/patternfly-4/react-table/src/components/Table/Table.d.ts @@ -11,7 +11,8 @@ export const TableGridBreakpoint: { grid: 'grid', gridMd: 'grid-md', gridLg: 'grid-lg', - gridXl: 'grid-xl' + gridXl: 'grid-xl', + grid2xl: 'grid-2xl' }; export const TableVariant: { diff --git a/packages/patternfly-4/react-table/src/components/Table/Table.js b/packages/patternfly-4/react-table/src/components/Table/Table.js index 302bd677e9f..9e5643b3298 100644 --- a/packages/patternfly-4/react-table/src/components/Table/Table.js +++ b/packages/patternfly-4/react-table/src/components/Table/Table.js @@ -17,7 +17,8 @@ export const TableGridBreakpoint = { grid: 'grid', gridMd: 'grid-md', gridLg: 'grid-lg', - gridXl: 'grid-xl' + gridXl: 'grid-xl', + grid2xl: 'grid-2xl' }; export const TableVariant = { diff --git a/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap b/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap index d7ad140c2b9..2abe5b04541 100644 --- a/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap +++ b/packages/patternfly-4/react-table/src/components/Table/__snapshots__/Table.test.js.snap @@ -86125,6 +86125,6059 @@ exports[`Table variants Breakpoint - grid 1`] = ` `; +exports[`Table variants Breakpoint - grid-2xl 1`] = ` + + +
+ + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + Branches + + Pull requests + + Workspaces + + Last Commit +
+ + +`; + exports[`Table variants Breakpoint - grid-lg 1`] = ` Date: Mon, 10 Jun 2019 21:35:29 +0000 Subject: [PATCH 16/83] chore(release): releasing packages [ci skip] - @patternfly/react-inline-edit-extension@2.7.6 - @patternfly/react-table@2.11.0 --- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 4 ++-- packages/patternfly-4/react-table/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-table/package.json | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-) diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index d9896873320..7cbb9ea957b 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.5...@patternfly/react-inline-edit-extension@2.7.6) (2019-06-10) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.4...@patternfly/react-inline-edit-extension@2.7.5) (2019-06-10) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index 7c30bde0fa0..81a8629def4 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.5", + "version": "2.7.6", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -31,7 +31,7 @@ "@patternfly/react-core": "^3.38.0", "@patternfly/react-icons": "^3.9.5", "@patternfly/react-styles": "^3.3.2", - "@patternfly/react-table": "^2.10.5", + "@patternfly/react-table": "^2.11.0", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index cb1df69b510..a59be5ec9b8 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.11.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.5...@patternfly/react-table@2.11.0) (2019-06-10) + + +### Features + +* **Table:** Add support for .pf-m-grid-2xl breakpoint ([#2206](https://github.com/patternfly/patternfly-react/issues/2206)) ([0f9ebf9](https://github.com/patternfly/patternfly-react/commit/0f9ebf9)) + + + + + ## [2.10.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.4...@patternfly/react-table@2.10.5) (2019-06-10) **Note:** Version bump only for package @patternfly/react-table diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index b75df0ee7fb..d6cd25d71eb 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.10.5", + "version": "2.11.0", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", From 6365c33b29faf0b6dd965bdc134e508a20376dc5 Mon Sep 17 00:00:00 2001 From: Dana Gutride Date: Tue, 11 Jun 2019 09:38:17 -0400 Subject: [PATCH 17/83] fix(styles): add sideeffects to react-styles (#2207) --- packages/patternfly-4/react-styles/package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index 71da4c8c860..511087f7cc9 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -4,7 +4,10 @@ "main": "dist/js/index.js", "module": "dist/esm/index.js", "types": "dist/js/index.d.ts", - "sideEffects": false, + "sideEffects": [ + "*.css", + "*.scss" + ], "description": "", "author": "Red Hat", "publishConfig": { From d8bf5f5df124e1045866aa06a804356cffd755b4 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Tue, 11 Jun 2019 14:02:47 +0000 Subject: [PATCH 18/83] chore(release): releasing packages [ci skip] - @patternfly/react-charts@4.1.5 - @patternfly/react-core@3.38.1 - @patternfly/react-docs@4.6.11 - @patternfly/react-inline-edit-extension@2.7.7 - demo-app-ts@1.19.1 - @patternfly/react-styled-system@3.5.3 - @patternfly/react-styles@3.3.3 - @patternfly/react-table@2.11.1 - @patternfly/react-virtualized-extension@1.0.5 --- packages/patternfly-4/react-charts/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-charts/package.json | 4 ++-- packages/patternfly-4/react-core/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-core/package.json | 4 ++-- packages/patternfly-4/react-docs/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-docs/package.json | 6 +++--- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 8 ++++---- .../react-integration/demo-app-ts/CHANGELOG.md | 8 ++++++++ .../react-integration/demo-app-ts/package.json | 4 ++-- .../patternfly-4/react-styled-system/CHANGELOG.md | 8 ++++++++ .../patternfly-4/react-styled-system/package.json | 4 ++-- packages/patternfly-4/react-styles/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-styles/package.json | 2 +- packages/patternfly-4/react-table/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-table/package.json | 6 +++--- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 6 +++--- 18 files changed, 97 insertions(+), 22 deletions(-) diff --git a/packages/patternfly-4/react-charts/CHANGELOG.md b/packages/patternfly-4/react-charts/CHANGELOG.md index 831a6661c01..dbfd1fb1926 100644 --- a/packages/patternfly-4/react-charts/CHANGELOG.md +++ b/packages/patternfly-4/react-charts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.1.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.4...@patternfly/react-charts@4.1.5) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-charts + + + + + ## [4.1.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-charts@4.1.3...@patternfly/react-charts@4.1.4) (2019-06-10) **Note:** Version bump only for package @patternfly/react-charts diff --git a/packages/patternfly-4/react-charts/package.json b/packages/patternfly-4/react-charts/package.json index 791dbac6f11..3442af6a225 100644 --- a/packages/patternfly-4/react-charts/package.json +++ b/packages/patternfly-4/react-charts/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-charts", - "version": "4.1.4", + "version": "4.1.5", "description": "This library provides a set of React chart components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react#readme", "dependencies": { - "@patternfly/react-styles": "^3.3.2" + "@patternfly/react-styles": "^3.3.3" }, "peerDependencies": { "prop-types": "^15.6.1", diff --git a/packages/patternfly-4/react-core/CHANGELOG.md b/packages/patternfly-4/react-core/CHANGELOG.md index c8289799342..d21a94a2288 100644 --- a/packages/patternfly-4/react-core/CHANGELOG.md +++ b/packages/patternfly-4/react-core/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.38.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.38.0...@patternfly/react-core@3.38.1) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-core + + + + + # [3.38.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.37.1...@patternfly/react-core@3.38.0) (2019-06-10) diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index a179a158a2b..1b3f03eb8ef 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "3.38.0", + "version": "3.38.1", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -42,7 +42,7 @@ }, "dependencies": { "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-styles": "^3.3.3", "@patternfly/react-tokens": "^2.5.5", "@tippy.js/react": "^1.1.1", "emotion": "^9.2.9", diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index 75d629c950f..103fa6c38b3 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [4.6.11](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.10...@patternfly/react-docs@4.6.11) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-docs + + + + + ## [4.6.10](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.9...@patternfly/react-docs@4.6.10) (2019-06-10) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index aacecce0746..a3a7faf04e9 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.10", + "version": "4.6.11", "author": "Red Hat", "license": "MIT", "private": true, @@ -17,9 +17,9 @@ "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.38.1", "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-virtualized-extension": "^1.0.4", + "@patternfly/react-virtualized-extension": "^1.0.5", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", "gatsby-plugin-react-helmet": "^3.0.11", diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index 7cbb9ea957b..08f142cec47 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.6...@patternfly/react-inline-edit-extension@2.7.7) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.5...@patternfly/react-inline-edit-extension@2.7.6) (2019-06-10) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index 81a8629def4..b8f9ed1a6fe 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.6", + "version": "2.7.7", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.38.1", "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-styles": "^3.3.2", - "@patternfly/react-table": "^2.11.0", + "@patternfly/react-styles": "^3.3.3", + "@patternfly/react-table": "^2.11.1", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" diff --git a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md index 1e7c2dcc8b8..589a6b59f9d 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.19.1](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.19.0...demo-app-ts@1.19.1) (2019-06-11) + +**Note:** Version bump only for package demo-app-ts + + + + + # [1.19.0](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.18.3...demo-app-ts@1.19.0) (2019-06-10) diff --git a/packages/patternfly-4/react-integration/demo-app-ts/package.json b/packages/patternfly-4/react-integration/demo-app-ts/package.json index 50823a7b09d..3c922f1ab8d 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/package.json +++ b/packages/patternfly-4/react-integration/demo-app-ts/package.json @@ -1,13 +1,13 @@ { "name": "demo-app-ts", "private": true, - "version": "1.19.0", + "version": "1.19.1", "scripts": { "build:demo-app": "react-scripts build", "start:demo-app": "react-scripts start" }, "dependencies": { - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.38.1", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router": "^4.3.1", diff --git a/packages/patternfly-4/react-styled-system/CHANGELOG.md b/packages/patternfly-4/react-styled-system/CHANGELOG.md index 41d0ecf612a..b2c25b71ce1 100644 --- a/packages/patternfly-4/react-styled-system/CHANGELOG.md +++ b/packages/patternfly-4/react-styled-system/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.5.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styled-system@3.5.2...@patternfly/react-styled-system@3.5.3) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-styled-system + + + + + ## [3.5.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styled-system@3.5.1...@patternfly/react-styled-system@3.5.2) (2019-06-10) **Note:** Version bump only for package @patternfly/react-styled-system diff --git a/packages/patternfly-4/react-styled-system/package.json b/packages/patternfly-4/react-styled-system/package.json index 0b140b6f499..f22c11045b7 100644 --- a/packages/patternfly-4/react-styled-system/package.json +++ b/packages/patternfly-4/react-styled-system/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styled-system", - "version": "3.5.2", + "version": "3.5.3", "description": "Experimental: Styled System package with PatternFly 4 theming", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -35,7 +35,7 @@ "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose" }, "dependencies": { - "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-styles": "^3.3.3", "@patternfly/react-tokens": "^2.5.5", "emotion-theming": "^9.2.9", "react-emotion": "^9.2.9", diff --git a/packages/patternfly-4/react-styles/CHANGELOG.md b/packages/patternfly-4/react-styles/CHANGELOG.md index b4ba4c5566d..8623655d4fa 100644 --- a/packages/patternfly-4/react-styles/CHANGELOG.md +++ b/packages/patternfly-4/react-styles/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.3.3](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@3.3.2...@patternfly/react-styles@3.3.3) (2019-06-11) + + +### Bug Fixes + +* **styles:** add sideeffects to react-styles ([#2207](https://github.com/patternfly/patternfly-react/issues/2207)) ([6365c33](https://github.com/patternfly/patternfly-react/commit/6365c33)) + + + + + ## [3.3.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-styles@3.3.1...@patternfly/react-styles@3.3.2) (2019-06-10) **Note:** Version bump only for package @patternfly/react-styles diff --git a/packages/patternfly-4/react-styles/package.json b/packages/patternfly-4/react-styles/package.json index 511087f7cc9..be44ff89a4e 100644 --- a/packages/patternfly-4/react-styles/package.json +++ b/packages/patternfly-4/react-styles/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-styles", - "version": "3.3.2", + "version": "3.3.3", "main": "dist/js/index.js", "module": "dist/esm/index.js", "types": "dist/js/index.d.ts", diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index a59be5ec9b8..6386e9beca9 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.11.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.11.0...@patternfly/react-table@2.11.1) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-table + + + + + # [2.11.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.10.5...@patternfly/react-table@2.11.0) (2019-06-10) diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index d6cd25d71eb..5b790cad642 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.11.0", + "version": "2.11.1", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,9 +28,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.38.1", "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-styles": "^3.3.3", "@patternfly/react-tokens": "^2.5.5", "classnames": "^2.2.5", "exenv": "^1.2.2" diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md index 84636f9269f..6f6d9c1bce0 100644 --- a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.4...@patternfly/react-virtualized-extension@1.0.5) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension + + + + + ## [1.0.4](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.3...@patternfly/react-virtualized-extension@1.0.4) (2019-06-10) **Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index d5234edba9d..19191ed84f7 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.4", + "version": "1.0.5", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,9 +28,9 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.38.1", "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-styles": "^3.3.2", + "@patternfly/react-styles": "^3.3.3", "clsx": "^1.0.1", "dom-helpers": "^2.4.0 || ^3.0.0", "exenv": "^1.2.2", From 58eb9ccdcfd020797b6c8a6094c58365be925368 Mon Sep 17 00:00:00 2001 From: Jeff Phillips Date: Tue, 11 Jun 2019 14:13:17 -0400 Subject: [PATCH 19/83] feat(Topology): Add @patternfly/react-topology package (#2170) --- .../src/layouts/Stack/examples/stack.scss | 4 +- .../src/layouts/Toolbar/examples/toolbar.scss | 4 +- packages/patternfly-4/react-docs/.eslintrc.js | 1 + .../patternfly-4/react-docs/gatsby-node.js | 1 + .../src/components/componentDocs/liveEdit.js | 4 +- packages/patternfly-4/react-topology/.babelrc | 3 + .../patternfly-4/react-topology/.npmignore | 1 + .../patternfly-4/react-topology/CHANGELOG.md | 5 + .../patternfly-4/react-topology/README.md | 105 ++ .../react-topology/build/copyStyles.js | 42 + .../patternfly-4/react-topology/package.json | 73 + .../TopologyControlBar.test.tsx | 45 + .../TopologyControlBar/TopologyControlBar.tsx | 294 ++++ .../TopologyControlBar.test.tsx.snap | 1427 +++++++++++++++++ .../css/topology-controlbar-css.ts | 23 + .../components/TopologyControlBar/index.ts | 1 + .../TopologyView/TopologyView.test.tsx | 25 + .../components/TopologyView/TopologyView.tsx | 41 + .../__snapshots__/TopologyView.test.tsx.snap | 141 ++ .../TopologyView/css/topology-view-css.ts | 33 + .../TopologyView/examples/ProjectToolbar.js | 118 ++ .../TopologyView/examples/Topology.md | 121 ++ .../TopologyView/examples/ViewToolbar.js | 139 ++ .../examples/topology-example.scss | 19 + .../src/components/TopologyView/index.ts | 1 + .../react-topology/src/components/index.ts | 2 + .../patternfly-4/react-topology/src/index.ts | 1 + .../react-topology/tsconfig.base.json | 25 + .../react-topology/tsconfig.gen-dts.json | 8 + .../react-topology/tsconfig.typecheck.json | 7 + 30 files changed, 2709 insertions(+), 5 deletions(-) create mode 100644 packages/patternfly-4/react-topology/.babelrc create mode 100644 packages/patternfly-4/react-topology/.npmignore create mode 100644 packages/patternfly-4/react-topology/CHANGELOG.md create mode 100644 packages/patternfly-4/react-topology/README.md create mode 100644 packages/patternfly-4/react-topology/build/copyStyles.js create mode 100644 packages/patternfly-4/react-topology/package.json create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.test.tsx create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.tsx create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyControlBar/__snapshots__/TopologyControlBar.test.tsx.snap create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyControlBar/css/topology-controlbar-css.ts create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyControlBar/index.ts create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.test.tsx create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.tsx create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/__snapshots__/TopologyView.test.tsx.snap create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/css/topology-view-css.ts create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/examples/ProjectToolbar.js create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/examples/Topology.md create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/examples/ViewToolbar.js create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/examples/topology-example.scss create mode 100644 packages/patternfly-4/react-topology/src/components/TopologyView/index.ts create mode 100644 packages/patternfly-4/react-topology/src/components/index.ts create mode 100644 packages/patternfly-4/react-topology/src/index.ts create mode 100644 packages/patternfly-4/react-topology/tsconfig.base.json create mode 100644 packages/patternfly-4/react-topology/tsconfig.gen-dts.json create mode 100644 packages/patternfly-4/react-topology/tsconfig.typecheck.json diff --git a/packages/patternfly-4/react-core/src/layouts/Stack/examples/stack.scss b/packages/patternfly-4/react-core/src/layouts/Stack/examples/stack.scss index 4a08fa4a7d8..8057d502281 100644 --- a/packages/patternfly-4/react-core/src/layouts/Stack/examples/stack.scss +++ b/packages/patternfly-4/react-core/src/layouts/Stack/examples/stack.scss @@ -1,11 +1,11 @@ .ws-preview { - & .pf-l-stack { + &.pf-l-stack { padding: 1rem; border-width: 2px; border-style: dashed; } - & .pf-l-stack > .pf-l-stack__item { + &.pf-l-stack > .pf-l-stack__item { padding: 1rem; border-width: 2px; border-style: dashed; diff --git a/packages/patternfly-4/react-core/src/layouts/Toolbar/examples/toolbar.scss b/packages/patternfly-4/react-core/src/layouts/Toolbar/examples/toolbar.scss index 2b87038b590..60e4e6aa862 100644 --- a/packages/patternfly-4/react-core/src/layouts/Toolbar/examples/toolbar.scss +++ b/packages/patternfly-4/react-core/src/layouts/Toolbar/examples/toolbar.scss @@ -1,11 +1,11 @@ .ws-preview { - & .pf-l-toolbar { + &.pf-l-toolbar { padding: 1rem; border-width: 2px; border-style: dashed; } - & .pf-l-toolbar > div { + &.pf-l-toolbar > div { padding: 1rem; border-width: 2px; border-style: dashed; diff --git a/packages/patternfly-4/react-docs/.eslintrc.js b/packages/patternfly-4/react-docs/.eslintrc.js index df4531c0c5d..757807959ff 100644 --- a/packages/patternfly-4/react-docs/.eslintrc.js +++ b/packages/patternfly-4/react-docs/.eslintrc.js @@ -20,6 +20,7 @@ module.exports = { '@patternfly-safe/react-core', '@patternfly-safe/react-icons', '@patternfly-safe/react-tokens', + '@patternfly/react-topology', '@patternfly-safe/patternfly/patternfly.css' ] } diff --git a/packages/patternfly-4/react-docs/gatsby-node.js b/packages/patternfly-4/react-docs/gatsby-node.js index 68c746a33d7..44916e5d3de 100644 --- a/packages/patternfly-4/react-docs/gatsby-node.js +++ b/packages/patternfly-4/react-docs/gatsby-node.js @@ -96,6 +96,7 @@ exports.onCreateWebpackConfig = ({ actions }) => { '@patternfly/react-styles': path.resolve(__dirname, '../react-styles'), '@patternfly/react-table': path.resolve(__dirname, '../react-table'), '@patternfly/react-tokens': path.resolve(__dirname, '../react-tokens'), + '@patternfly/react-topology': path.resolve(__dirname, '../react-topology'), // Hack to work downstream in https://github.com/patternfly/patternfly-org '@content': path.resolve(__dirname, 'src/components/componentDocs') } diff --git a/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js b/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js index f5da4e519ee..f85d739029d 100644 --- a/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js +++ b/packages/patternfly-4/react-docs/src/components/componentDocs/liveEdit.js @@ -14,6 +14,7 @@ import * as ReactStyles from '@patternfly/react-styles'; import * as ReactTable from '@patternfly/react-table'; import * as ReactVirtualizedExtension from '@patternfly/react-virtualized-extension'; import * as ReactTokens from '@patternfly/react-tokens'; +import * as ReactTopology from '@patternfly/react-topology'; import './live-edit.scss'; @@ -48,7 +49,8 @@ export class LiveEdit extends React.Component { ...ReactStyles, ...ReactTable, ...ReactVirtualizedExtension, - ...ReactTokens + ...ReactTokens, + ...ReactTopology } : {}; this.scope = { diff --git a/packages/patternfly-4/react-topology/.babelrc b/packages/patternfly-4/react-topology/.babelrc new file mode 100644 index 00000000000..3eeb33a71bc --- /dev/null +++ b/packages/patternfly-4/react-topology/.babelrc @@ -0,0 +1,3 @@ +{ + "extends": "../.babelrc" +} diff --git a/packages/patternfly-4/react-topology/.npmignore b/packages/patternfly-4/react-topology/.npmignore new file mode 100644 index 00000000000..378eac25d31 --- /dev/null +++ b/packages/patternfly-4/react-topology/.npmignore @@ -0,0 +1 @@ +build diff --git a/packages/patternfly-4/react-topology/CHANGELOG.md b/packages/patternfly-4/react-topology/CHANGELOG.md new file mode 100644 index 00000000000..767840ada8e --- /dev/null +++ b/packages/patternfly-4/react-topology/CHANGELOG.md @@ -0,0 +1,5 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + diff --git a/packages/patternfly-4/react-topology/README.md b/packages/patternfly-4/react-topology/README.md new file mode 100644 index 00000000000..7952c074557 --- /dev/null +++ b/packages/patternfly-4/react-topology/README.md @@ -0,0 +1,105 @@ +# @patternfly/react-topology + +This package provides Topology View components based on [PatternFly 4][patternfly-4] + +### Prerequisite + +#### Node Environment + +This project currently supports Node [Active LTS](https://github.com/nodejs/Release#release-schedule) releases. Please stay current with Node Active LTS when developing patternfly-react. + +For example, to develop with Node 8, use the following: + +``` +nvm install 8 +nvm use 8 +``` + +This project also requires a Yarn version of >=1.6.0. The latest version can be installed [here](https://yarnpkg.com/). + +### Installing + +``` +yarn add @patternfly/react-topology +``` + +or + +``` +npm install @patternfly/react-topology --save +``` + +## Usage + +It's strongly advised to use the PatternFly Base CSS in your whole project, or some components may diverge in appearance: + +```javascript +import '@patternfly/react-core/dist/styles/base.css'; +``` + +#### Example Component Usage + +```javascript +import React from 'react'; +... TBD +``` + +## Contribution + +This library makes use of the babel plugin from [@patternfly/react-styles](../react-styles/README.md) to enable providing the CSS alongside the components. This removes the need for consumers to use (style|css|sass)-loaders. For an example of using CSS from core you can reference [Button.js](./src/components/Button/Button.js). For any CSS not provided by core please use the `StyleSheet.create` utility from [@patternfly/react-styles](../react-styles/README.md). This will prevent collisions with any consumers, and allow the CSS to be bundled with the component. + +### Documentation + +This project uses Gatsby. For an overview of the project structure please refer to the [Gatsby documentation - Building with Components](https://www.gatsbyjs.org/docs/building-with-components/). + +A comprehensive list of components and detailed usage of each can be found on the [PatternFly React Docs][docs] website +You can also find how each component is meant to be used from a design perspective on the [PatternFly 4 Core][patternfly-4] website. + +Note: All commands below assume you are on the root directory in this repository. + +### Install + +Run to install all the dependencies + +```sh +yarn && yarn bootstrap && yarn build && yarn build:docs +``` + +### Building + +```sh +yarn bootstrap && yarn build && yarn build:docs +``` + +### Running + +To start the site locally. + +```sh +yarn build && yarn start:pf4 +``` + +### Building + +To build the site. + +```sh +yarn build:docs +``` + +### Building + +``` +yarn build +``` + +### Testing + +Testing is done at the root of this repo. To only run the @patternfly/react-topology tests: + +``` +yarn test packages/patternfly-4/react-topology +``` + +[patternfly-4]: https://github.com/patternfly/patternfly-next +[docs]: https://patternfly-react.surge.sh/patternfly-4 diff --git a/packages/patternfly-4/react-topology/build/copyStyles.js b/packages/patternfly-4/react-topology/build/copyStyles.js new file mode 100644 index 00000000000..3c501ed0ad6 --- /dev/null +++ b/packages/patternfly-4/react-topology/build/copyStyles.js @@ -0,0 +1,42 @@ +/* eslint-disable no-case-declarations */ +const { copySync, readFileSync, writeFileSync } = require('fs-extra'); +const { resolve, dirname, join } = require('path'); +const { parse: parseCSS, stringify: stringifyCSS } = require('css'); + +const baseCSSFilename = 'patternfly-base.css'; +const stylesDir = resolve(__dirname, '../dist/styles'); +const pfDir = dirname(require.resolve(`@patternfly/patternfly/${baseCSSFilename}`)); + +const css = readFileSync(join(pfDir, baseCSSFilename), 'utf8'); +const ast = parseCSS(css); + +const unusedSelectorRegEx = /(\.fas?|\.sr-only)/; +const unusedKeyFramesRegEx = /fa-/; +const unusedFontFamilyRegEx = /Font Awesome 5 Free/; +const ununsedFontFilesRegExt = /(fa-|\.html$|\.css$)/; + +// Core provides font awesome fonts and utlities. React does not use these +ast.stylesheet.rules = ast.stylesheet.rules.filter(rule => { + switch (rule.type) { + case 'rule': + return !rule.selectors.some(sel => unusedSelectorRegEx.test(sel)); + case 'keyframes': + return !unusedKeyFramesRegEx.test(rule.name); + case 'charset': + case 'comment': + return false; + case 'font-face': + const fontFamilyDecl = rule.declarations.find(decl => decl.property === 'font-family'); + return !unusedFontFamilyRegEx.test(fontFamilyDecl.value); + default: + return true; + } +}); + +copySync(join(pfDir, 'assets/images'), join(stylesDir, 'assets/images')); +copySync(join(pfDir, 'assets/fonts'), join(stylesDir, 'assets/fonts'), { + filter(src) { + return !ununsedFontFilesRegExt.test(src); + } +}); +writeFileSync(join(stylesDir, 'base.css'), stringifyCSS(ast)); diff --git a/packages/patternfly-4/react-topology/package.json b/packages/patternfly-4/react-topology/package.json new file mode 100644 index 00000000000..b00185cb417 --- /dev/null +++ b/packages/patternfly-4/react-topology/package.json @@ -0,0 +1,73 @@ +{ + "name": "@patternfly/react-topology", + "version": "2.0.0", + "description": "This library provides a set of React topology view components for use with the PatternFly 4", + "main": "dist/js/index.js", + "module": "dist/esm/index.js", + "types": "dist/js/index.d.ts", + "publishConfig": { + "access": "public", + "tag": "prerelease" + }, + "repository": { + "type": "git", + "url": "https://github.com/patternfly/patternfly-react.git" + }, + "keywords": [ + "react", + "patternfly", + "topology" + ], + "author": "Red Hat", + "license": "MIT", + "bugs": { + "url": "https://github.com/patternfly/patternfly-react/issues" + }, + "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-topology#readme", + "dependencies": { + "@patternfly/react-core": "^3.38.0", + "@patternfly/react-icons": "^3.9.5", + "@patternfly/react-styles": "^3.3.2" + }, + "peerDependencies": { + "prop-types": "^15.6.1", + "react": "^16.4.0", + "react-dom": "^15.6.2 || ^16.4.0" + }, + "scripts": { + "build": "yarn typecheck && yarn build:babel && yarn build:types && node ./build/copyStyles.js", + "build:babel": "concurrently 'yarn build:babel:esm && yarn build:babel:umd' 'yarn build:babel:cjs'", + "build:babel:cjs": "babel src --out-dir dist/js --extensions '.js,.ts,.tsx' -q", + "build:babel:esm": "babel src --out-dir dist/esm --extensions '.js,.ts,.tsx' -q", + "build:babel:umd": "babel dist/esm --out-dir dist/umd --plugins transform-es2015-modules-umd --extensions '.js,.ts,.tsx' -q", + "build:types": "tsc -p tsconfig.gen-dts.json", + "clean": "rimraf dist", + "develop": "yarn build:babel:esm --skip-initial-build --watch --verbose", + "lint:ts": "tslint -p tsconfig.typecheck.json", + "typecheck": "tsc -p tsconfig.typecheck.json" + }, + "devDependencies": { + "@babel/cli": "^7.0.0", + "@babel/core": "^7.0.0", + "@babel/plugin-proposal-class-properties": "^7.0.0", + "@babel/plugin-proposal-export-default-from": "^7.0.0", + "@babel/plugin-proposal-object-rest-spread": "^7.0.0", + "@babel/plugin-transform-typescript": "^7.0.0", + "@babel/preset-env": "^7.0.0", + "@babel/preset-react": "^7.0.0", + "@patternfly/react-tokens": "^2.5.1", + "@types/prop-types": "^15.7.0", + "@types/react": "~16.8.0", + "@types/react-dom": "~16.8.0", + "babel-plugin-transform-es2015-modules-umd": "^6.24.1", + "babel-plugin-typescript-to-proptypes": "^0.17.1", + "css": "^2.2.3", + "fs-extra": "^6.0.1", + "glob": "^7.1.2", + "rimraf": "^2.6.2", + "tslint": "^5.12.0", + "tslint-config-prettier": "^1.17.0", + "tslint-react": "^3.6.0", + "typescript": "3.4.5" + } +} diff --git a/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.test.tsx b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.test.tsx new file mode 100644 index 00000000000..c9176174473 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.test.tsx @@ -0,0 +1,45 @@ +import * as React from 'react'; +import {mount} from 'enzyme'; +import {TopologyControlBar, createTopologyControlButtons, defaultControlButtonsOptions, ZOOM_IN} from './TopologyControlBar'; + +describe('TopologyControlBar', () => { + test('should display the default controls correctly', () => { + const controlButtons = createTopologyControlButtons(); + const mockfn = jest.fn(); + const view = mount( + + ); + expect(view).toMatchSnapshot(); + view + .find(`#${ZOOM_IN}`) + .at(0) + .simulate('click'); + expect(mockfn.mock.calls).toHaveLength(1); + }); + + test('should accept button options correctly', () => { + const mockfn = jest.fn(); + const controlButtons = createTopologyControlButtons( + { ...defaultControlButtonsOptions, + zoomInCallback: mockfn, + zoomInAriaLabel: 'test-zoom-in-aria-label', + zoomInIcon: test zoom in, + zoomInTip: 'test zoom in tooltip', + fitToScreenHidden: true, + resetViewDisabled: true, + legend: false + }); + const view = mount( + + ); + expect(view).toMatchSnapshot(); + view + .find(`#${ZOOM_IN}`) + .at(0) + .simulate('click'); + expect(mockfn.mock.calls).toHaveLength(1); + }); +}); diff --git a/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.tsx b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.tsx new file mode 100644 index 00000000000..0259773dec9 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/TopologyControlBar.tsx @@ -0,0 +1,294 @@ +import * as React from 'react'; +import { Button, Toolbar, ToolbarGroup, ToolbarItem, Tooltip } from '@patternfly/react-core'; +import { ExpandIcon, ExpandArrowsAltIcon, SearchPlusIcon, SearchMinusIcon } from '@patternfly/react-icons'; + +import { topologyControlbarCss } from './css/topology-controlbar-css'; + +topologyControlbarCss.inject(); + +/* ID's for common control buttons */ +export const ZOOM_IN = 'zoom-in'; +export const ZOOM_OUT = 'zoom-out'; +export const FIT_TO_SCREEN = 'fit-to-screen'; +export const RESET_VIEW = 'reset-view'; +export const LEGEND = 'legend'; + +/* Data needed for each control button */ +export interface TopologyControlButton { + id: any, + icon: React.ReactNode; + tooltip?: React.ReactNode; + ariaLabel?: string; + callback?: (id: any) => void; + disabled?: boolean; + hidden?: boolean; +} + +/* Options for creating the control buttons */ +export interface TopologyControlButtonsOptions { + zoomIn: boolean; + zoomInIcon: React.ReactNode; + zoomInTip: React.ReactNode; + zoomInAriaLabel: string; + zoomInCallback: (id: any) => void; + zoomInDisabled: boolean; + zoomInHidden: boolean; + + zoomOut: boolean; + zoomOutIcon: React.ReactNode; + zoomOutTip: React.ReactNode; + zoomOutAriaLabel: string; + zoomOutCallback: (id: any) => void; + zoomOutDisabled: boolean; + zoomOutHidden: boolean; + + fitToScreen: boolean; + fitToScreenIcon: React.ReactNode; + fitToScreenTip: React.ReactNode; + fitToScreenAriaLabel: string; + fitToScreenCallback: (id: any) => void; + fitToScreenDisabled: boolean; + fitToScreenHidden: boolean; + + resetView: boolean; + resetViewIcon: React.ReactNode; + resetViewTip: React.ReactNode; + resetViewAriaLabel: string; + resetViewCallback: (id: any) => void; + resetViewDisabled: boolean; + resetViewHidden: boolean; + + legend: boolean; + legendIcon: React.ReactNode; + legendTip: string; + legendAriaLabel: string; + legendCallback: (id: any) => void; + legendDisabled: boolean; + legendHidden: boolean; + + customButtons: TopologyControlButton[]; +} + +/* Default options for creating control buttons */ +export const defaultControlButtonsOptions: TopologyControlButtonsOptions = { + zoomIn: true, + zoomInIcon: , + zoomInTip: 'Zoom In', + zoomInAriaLabel: 'Zoom In', + zoomInCallback: null, + zoomInDisabled: false, + zoomInHidden: false, + + zoomOut: true, + zoomOutIcon: , + zoomOutTip: 'Zoom Out', + zoomOutAriaLabel: 'Zoom Out', + zoomOutCallback: null, + zoomOutDisabled: false, + zoomOutHidden: false, + + fitToScreen: true, + fitToScreenIcon: , + fitToScreenTip: 'Fit to Screen', + fitToScreenAriaLabel: 'Fit to Screen', + fitToScreenCallback: null, + fitToScreenDisabled: false, + fitToScreenHidden: false, + + resetView: true, + resetViewIcon: , + resetViewTip: 'Reset View', + resetViewAriaLabel: 'Reset View', + resetViewCallback: null, + resetViewDisabled: false, + resetViewHidden: false, + + legend: true, + legendIcon: 'Legend', + legendTip: '', + legendAriaLabel: null, + legendCallback: null, + legendDisabled: false, + legendHidden: false, + + customButtons: [] +}; + +/* Utility function to create the common control buttons, can pass null for all defaults, or specify overrides */ +export const createTopologyControlButtons = ({ + zoomIn = defaultControlButtonsOptions.zoomIn, + zoomInIcon= defaultControlButtonsOptions.zoomInIcon, + zoomInTip= defaultControlButtonsOptions.zoomInTip, + zoomInAriaLabel= defaultControlButtonsOptions.zoomInAriaLabel, + zoomInCallback= defaultControlButtonsOptions.zoomInCallback, + zoomInDisabled= defaultControlButtonsOptions.zoomInDisabled, + zoomInHidden= defaultControlButtonsOptions.zoomInHidden, + + zoomOut = defaultControlButtonsOptions.zoomOut, + zoomOutIcon = defaultControlButtonsOptions.zoomOutIcon, + zoomOutTip = defaultControlButtonsOptions.zoomOutTip, + zoomOutAriaLabel = defaultControlButtonsOptions.zoomOutAriaLabel, + zoomOutCallback = defaultControlButtonsOptions.zoomOutCallback, + zoomOutDisabled = defaultControlButtonsOptions.zoomOutDisabled, + zoomOutHidden = defaultControlButtonsOptions.zoomOutHidden, + + fitToScreen = defaultControlButtonsOptions.fitToScreen, + fitToScreenIcon = defaultControlButtonsOptions.fitToScreenIcon, + fitToScreenTip = defaultControlButtonsOptions.fitToScreenTip, + fitToScreenAriaLabel = defaultControlButtonsOptions.fitToScreenAriaLabel, + fitToScreenCallback = defaultControlButtonsOptions.fitToScreenCallback, + fitToScreenDisabled = defaultControlButtonsOptions.fitToScreenDisabled, + fitToScreenHidden = defaultControlButtonsOptions.fitToScreenHidden, + + resetView = defaultControlButtonsOptions.resetView, + resetViewIcon = defaultControlButtonsOptions.resetViewIcon, + resetViewTip = defaultControlButtonsOptions.resetViewTip, + resetViewAriaLabel = defaultControlButtonsOptions.resetViewAriaLabel, + resetViewCallback = defaultControlButtonsOptions.resetViewCallback, + resetViewDisabled = defaultControlButtonsOptions.resetViewDisabled, + resetViewHidden = defaultControlButtonsOptions.resetViewHidden, + + legend = defaultControlButtonsOptions.legend, + legendIcon = defaultControlButtonsOptions.legendIcon, + legendTip = defaultControlButtonsOptions.legendTip, + legendAriaLabel = defaultControlButtonsOptions.legendAriaLabel, + legendCallback = defaultControlButtonsOptions.legendCallback, + legendDisabled = defaultControlButtonsOptions.legendDisabled, + legendHidden = defaultControlButtonsOptions.legendHidden, + + customButtons = defaultControlButtonsOptions.customButtons, +} : TopologyControlButtonsOptions = defaultControlButtonsOptions) : TopologyControlButton[] => { + const controlButtons: TopologyControlButton[] = []; + + if (zoomIn) { + controlButtons.push({ + id: ZOOM_IN, + icon: zoomInIcon, + tooltip: zoomInTip, + ariaLabel: zoomInAriaLabel, + callback: zoomInCallback, + disabled: zoomInDisabled, + hidden: zoomInHidden + }); + } + + + if (zoomOut) { + controlButtons.push({ + id: ZOOM_OUT, + icon: zoomOutIcon, + tooltip: zoomOutTip, + ariaLabel: zoomOutAriaLabel, + callback: zoomOutCallback, + disabled: zoomOutDisabled, + hidden: zoomOutHidden + }); + } + + if (fitToScreen) { + controlButtons.push({ + id: FIT_TO_SCREEN, + icon: fitToScreenIcon, + tooltip: fitToScreenTip, + ariaLabel: fitToScreenAriaLabel, + callback: fitToScreenCallback, + disabled: fitToScreenDisabled, + hidden: fitToScreenHidden + }); + } + + if (resetView) { + controlButtons.push({ + id: RESET_VIEW, + icon: resetViewIcon, + tooltip: resetViewTip, + ariaLabel: resetViewAriaLabel, + callback: resetViewCallback, + disabled: resetViewDisabled, + hidden: resetViewHidden + }); + } + + if (customButtons) { + controlButtons.push(...customButtons); + } + + if (legend) { + controlButtons.push({ + id: LEGEND, + icon: legendIcon, + tooltip: legendTip, + ariaLabel: legendAriaLabel, + callback: legendCallback, + disabled: legendDisabled, + hidden: legendHidden + }); + } + + return controlButtons; +}; + +export interface TopologyControlBarProps extends React.HTMLProps { + /** Additional classes added to the control bar */ + className?: string; + /** Any extra child nodes (placed after the buttons) */ + children?: React.ReactNode; + /** Buttons to be added to the bar */ + controlButtons?: TopologyControlButton[]; + /** Callback when any button is clicked, id of the clicked button is passed */ + onButtonClick?: (id: any) => void; +} + +export const TopologyControlBar: React.FunctionComponent = ({ + className = null, + children = null, + controlButtons = [], + onButtonClick = () => undefined, + ...props +}: TopologyControlBarProps) => { + + const handleButtonClick = (event: React.MouseEvent, button: TopologyControlButton) => { + event.preventDefault(); + onButtonClick(button.id); + if (button.callback) { + button.callback(button.id); + } + }; + + const renderButton = (button: TopologyControlButton): React.ReactNode => { + const renderedButton = ( + + ); + + if (button.tooltip) { + return ( + {renderedButton} + ); + } + + return renderedButton; + }; + + return ( + + + {controlButtons.map((button: TopologyControlButton) => { + return button.hidden ? null : {renderButton(button)}; + })} + {children} + + + ); +}; diff --git a/packages/patternfly-4/react-topology/src/components/TopologyControlBar/__snapshots__/TopologyControlBar.test.tsx.snap b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/__snapshots__/TopologyControlBar.test.tsx.snap new file mode 100644 index 00000000000..30a1c6948a4 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/__snapshots__/TopologyControlBar.test.tsx.snap @@ -0,0 +1,1427 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TopologyControlBar should accept button options correctly 1`] = ` +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs.pf-m-disabled { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-l-toolbar__group { + display: flex; + flex-wrap: wrap; + align-items: center; +} +.pf-l-toolbar.default-test-class { + display: flex; + flex-wrap: wrap; + align-items: center; +} + + + test zoom in + , + "id": "zoom-in", + "tooltip": "test zoom in tooltip", + }, + Object { + "ariaLabel": "Zoom Out", + "callback": null, + "disabled": false, + "hidden": false, + "icon": , + "id": "zoom-out", + "tooltip": "Zoom Out", + }, + Object { + "ariaLabel": "Fit to Screen", + "callback": null, + "disabled": false, + "hidden": true, + "icon": , + "id": "fit-to-screen", + "tooltip": "Fit to Screen", + }, + Object { + "ariaLabel": "Reset View", + "callback": null, + "disabled": true, + "hidden": false, + "icon": , + "id": "reset-view", + "tooltip": "Reset View", + }, + ] + } + id="default-test-id" +> + +
+ +
+ +
+ + + + + test zoom in tooltip + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ test zoom in tooltip +
+
+
+ + + +
+
+ +
+ + + + + Zoom Out + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Zoom Out +
+
+
+ + + +
+
+ +
+ + + + + Reset View + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Reset View +
+
+
+ + + +
+
+
+
+
+
+
+`; + +exports[`TopologyControlBar should display the default controls correctly 1`] = ` +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-c-tooltip__arrow { + display: block; +} +.pf-c-tooltip { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-c-button.pf-m-tertiary.pf-topology-control-bar__button.pf-u-px-sm.pf-u-mr-xs { + display: block; +} +.pf-l-toolbar__item { + display: block; +} +.pf-l-toolbar__group { + display: flex; + flex-wrap: wrap; + align-items: center; +} +.pf-l-toolbar.default-test-class { + display: flex; + flex-wrap: wrap; + align-items: center; +} + +, + "id": "zoom-in", + "tooltip": "Zoom In", + }, + Object { + "ariaLabel": "Zoom Out", + "callback": null, + "disabled": false, + "hidden": false, + "icon": , + "id": "zoom-out", + "tooltip": "Zoom Out", + }, + Object { + "ariaLabel": "Fit to Screen", + "callback": null, + "disabled": false, + "hidden": false, + "icon": , + "id": "fit-to-screen", + "tooltip": "Fit to Screen", + }, + Object { + "ariaLabel": "Reset View", + "callback": null, + "disabled": false, + "hidden": false, + "icon": , + "id": "reset-view", + "tooltip": "Reset View", + }, + Object { + "ariaLabel": null, + "callback": null, + "disabled": false, + "hidden": false, + "icon": "Legend", + "id": "legend", + "tooltip": "", + }, + ] + } + id="default-test-id" + onButtonClick={[MockFunction]} +> + +
+ +
+ +
+ + + + + Zoom In + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Zoom In +
+
+
+ + + +
+
+ +
+ + + + + Zoom Out + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Zoom Out +
+
+
+ + + +
+
+ +
+ + + + + Fit to Screen + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Fit to Screen +
+
+
+ + + +
+
+ +
+ + + + + Reset View + +
+ } + delay={ + Array [ + 500, + 500, + ] + } + distance={15} + flip={true} + lazy={true} + maxWidth="18.75rem" + onCreate={[Function]} + performance={true} + placement="top" + popperOptions={ + Object { + "modifiers": Object { + "hide": Object { + "enabled": true, + }, + "preventOverflow": Object { + "enabled": true, + }, + }, + } + } + theme="pf-tippy" + trigger="mouseenter focus" + zIndex={9999} + > + + + + + } + > +
+ +
+ + +
+ Reset View +
+
+
+ + + +
+
+ +
+ + +
+
+
+
+
+
+
+`; diff --git a/packages/patternfly-4/react-topology/src/components/TopologyControlBar/css/topology-controlbar-css.ts b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/css/topology-controlbar-css.ts new file mode 100644 index 00000000000..6c550f28181 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/css/topology-controlbar-css.ts @@ -0,0 +1,23 @@ +import { StyleSheet } from '@patternfly/react-styles'; + +export const topologyControlbarCss = StyleSheet.parse(` + .pf-topology-control-bar { + position: absolute; + bottom: var(--pf-global--spacer--md); + left: var(--pf-global--spacer--xl); + + .pf-c-button.pf-m-tertiary { + background-color: var(--pf-global--BackgroundColor--100); + border: none; + border-radius: var(--pf-global--BorderRadius--sm); + box-shadow: var(--pf-global--BoxShadow--sm); + } + .pf-c-button.pf-m-tertiary:after { + display: none; + } + .pf-c-button.pf-m-tertiary:hover { + border: none; + box-shadow: var(--pf-global--BoxShadow--md); + } + } +`); diff --git a/packages/patternfly-4/react-topology/src/components/TopologyControlBar/index.ts b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/index.ts new file mode 100644 index 00000000000..817d213a556 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyControlBar/index.ts @@ -0,0 +1 @@ +export * from './TopologyControlBar'; diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.test.tsx b/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.test.tsx new file mode 100644 index 00000000000..d0724e23ca4 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.test.tsx @@ -0,0 +1,25 @@ +import * as React from 'react'; +import { mount } from 'enzyme'; +import { TopologyView } from './index'; + +describe('TopologyView', () => { + test('should display an empty topology correctly', () => { + const view = mount(); + expect(view).toMatchSnapshot(); + }); + + test('should display topology correctly', () => { + const view = mount( + } + viewToolbar={
} + controlBar={
} + > +
+ + ); + expect(view).toMatchSnapshot(); + }); +}); diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.tsx b/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.tsx new file mode 100644 index 00000000000..92a81b8f420 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/TopologyView.tsx @@ -0,0 +1,41 @@ +import * as React from 'react'; +import { Stack, StackItem } from '@patternfly/react-core'; + +import { topologyViewCss } from './css/topology-view-css'; + +topologyViewCss.inject(); + +export interface TopologyViewProps extends React.HTMLProps { + /** Additional classes added to the view */ + className?: string; + /** Topology inner container (canvas) */ + children?: React.ReactNode; + /** Context toolbar to be displayed at the top of the view, should contain components for changing context */ + contextToolbar?: React.ReactNode; + /** View toolbar to be displayed below the context toolbar, should contain components for changing view contents */ + viewToolbar?: React.ReactNode; + /** Topology control bar (typically a TopologyControlBar), used to manipulate the graph layout */ + controlBar?: React.ReactNode; +}; + +export const TopologyView: React.FunctionComponent = ({ + className = '', + contextToolbar = null, + viewToolbar = null, + children = null, + controlBar = null, + ...props +}: TopologyViewProps) => { + return ( + + {contextToolbar && {contextToolbar}} + {viewToolbar && {viewToolbar}} + +
+ {children} + {controlBar && {controlBar}} +
+
+
+ ); +}; diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/__snapshots__/TopologyView.test.tsx.snap b/packages/patternfly-4/react-topology/src/components/TopologyView/__snapshots__/TopologyView.test.tsx.snap new file mode 100644 index 00000000000..c0f95b8924c --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/__snapshots__/TopologyView.test.tsx.snap @@ -0,0 +1,141 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`TopologyView should display an empty topology correctly 1`] = ` +.pf-topology-content { + display: flex; + background-color: #ededed; + position: relative; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} + + + +
+ +
+
+
+ +
+ + +`; + +exports[`TopologyView should display topology correctly 1`] = ` +.pf-topology-control-bar { + display: block; + position: absolute; + bottom: 1rem; + left: 2rem; +} +.pf-topology-content { + display: flex; + background-color: #ededed; + position: relative; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; +} + + + } + controlBar={ +
+ } + id="simple-test-id" + viewToolbar={ +
+ } +> + +
+ +
+
+
+ + +
+
+
+ + +
+
+
+ +
+ +
+
+ +
+ + +`; diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/css/topology-view-css.ts b/packages/patternfly-4/react-topology/src/components/TopologyView/css/topology-view-css.ts new file mode 100644 index 00000000000..a7df8682e79 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/css/topology-view-css.ts @@ -0,0 +1,33 @@ +import { StyleSheet } from '@patternfly/react-styles'; + +export const topologyViewCss = StyleSheet.parse(` + .pf-topology-content { + background-color: var(--pf-global--Color--light-200); + position: relative; + display: flex; + justify-content: center; + align-items: center; + width: 100%; + height: 100%; + } + + .pf-topology-control-bar { + position: absolute; + bottom: var(--pf-global--spacer--md); + left: var(--pf-global--spacer--xl); + + .pf-c-button.pf-m-tertiary { + background-color: var(--pf-global--BackgroundColor--100); + border: none; + border-radius: var(--pf-global--BorderRadius--sm); + box-shadow: var(--pf-global--BoxShadow--sm); + } + .pf-c-button.pf-m-tertiary:after { + display: none; + } + .pf-c-button.pf-m-tertiary:hover { + border: none; + box-shadow: var(--pf-global--BoxShadow--md); + } + } +`); diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ProjectToolbar.js b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ProjectToolbar.js new file mode 100644 index 00000000000..ca46deea0d0 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ProjectToolbar.js @@ -0,0 +1,118 @@ +import React from 'react'; +import { + Dropdown, + DropdownPosition, + DropdownToggle, + DropdownItem, + Stack, + StackItem, + Toolbar, + ToolbarGroup, + ToolbarItem +} from '@patternfly/react-core'; + +const projects = [ + { id: 1, name: 'Project 1' }, + { id: 2, name: 'Project 2' }, + { id: 3, name: 'Project 3' }, + { id: 4, name: 'Project 4' }, + { id: 'all', name: 'All' } +]; + +const applications = [ + { id: 1, name: 'Application 1' }, + { id: 2, name: 'Application 2' }, + { id: 3, name: 'Application 3' }, + { id: 4, name: 'Application 4' }, + { id: 'all', name: 'All' } +]; + +export class ProjectToolbar extends React.Component { + state = { + selectedProject: projects[4], + selectedApplication: applications[4], + projectDropDownOpen: false, + applicationDropDownOpen: false + }; + + onProjectDropDownToggle = isOpen => { + this.setState({ projectDropDownOpen: isOpen }); + }; + + onProjectSelect = (e, project) => { + e.preventDefault(); + this.setState({ selectedProject: project, projectDropDownOpen: false }); + }; + + onApplicationDropDownToggle = isOpen => { + this.setState({ applicationDropDownOpen: isOpen }); + }; + + onApplicationSelect = (e, application) => { + e.preventDefault(); + this.setState({ selectedApplication: application, applicationDropDownOpen: false }); + }; + + renderProjectDropdown = () => { + const { projectDropDownOpen, selectedProject } = this.state; + + return ( + + + + + + {selectedProject.name}} + isOpen={projectDropDownOpen} + dropdownItems={projects.map(project => ( + this.onProjectSelect(e, project)}> + {project.name} + + ))} + /> + + + ); + }; + + renderApplicationDropdown = () => { + const { applicationDropDownOpen, selectedApplication } = this.state; + + return ( + + + + + + {selectedApplication.name} + } + isOpen={applicationDropDownOpen} + dropdownItems={applications.map(application => ( + this.onApplicationSelect(e, application)}> + {application.name} + + ))} + /> + + + ); + }; + + render() { + return ( + + + {this.renderProjectDropdown()} + {this.renderApplicationDropdown()} + + + ); + } +} diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/examples/Topology.md b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/Topology.md new file mode 100644 index 00000000000..fc4f0248e69 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/Topology.md @@ -0,0 +1,121 @@ +--- +title: 'TopologyView' +--- + +Note: Topology lives in its own package at [`@patternfly/react-topology`](https://www.npmjs.com/package/@patternfly/react-topology) + +import { ExternalLinkAltIcon, FilmIcon, GlassCheersIcon } from '@patternfly/react-icons'; +import { TopologyView, TopologyControlBar, createTopologyControlButtons } from '@patternfly/react-topology'; +import { ProjectToolbar } from './ProjectToolbar'; +import { ViewToolbar } from './ViewToolbar'; +import './topology-example.scss'; + +## TopologyView - Default Controls + +```js +import React from 'react'; +import { TopologyView, TopologyControlBar, createTopologyControlButtons } from '@patternfly/react-topology'; +import { ProjectToolbar } from './ProjectToolbar'; +import { ViewToolbar } from './ViewToolbar'; + +class DefaultTopologyView extends React.Component { + + render() { + const controlButtons = createTopologyControlButtons(); + + return ( +
+ } + viewToolbar={} + controlBar={} + > +
CANVAS
+
+
+ ); + } +} +``` + +## TopologyView - Selected Controls + +```js +import React from 'react'; +import { TopologyView, TopologyControlBar, createTopologyControlButtons } from '@patternfly/react-topology'; +import { ViewToolbar } from './ViewToolbar'; + +class SelectedTopologyView extends React.Component { + + render() { + const controlButtons = createTopologyControlButtons({ fitToScreen: false, legend: false }); + + return ( +
+ } + controlBar={} + > +
CANVAS
+
+
+ ); + } +} +``` + +## TopologyView - Custom Controls + +```js +import React from 'react'; +import { ExternalLinkAltIcon, FilmIcon, GlassCheersIcon } from '@patternfly/react-icons'; +import { TopologyView, TopologyControlBar, createTopologyControlButtons } from '@patternfly/react-topology'; +import { ViewToolbar } from './ViewToolbar'; + +class CustomTopologyView extends React.Component { + + render() { + const customButtons = [ + { + id: 'custom-1', + icon: , + tooltip: 'External Link', + ariaLabel: 'external link', + callback: null, + disabled: true, + hidden: false + }, + { + id: 'custom-2', + icon: , + tooltip: 'Watch', + ariaLabel: 'watch', + callback: null, + disabled: false, + hidden: false + }, + { + id: 'custom-3', + icon: , + tooltip: 'Cheers', + ariaLabel: 'cheers', + callback: null, + disabled: false, + hidden: true + }, + ] + const controlButtons = createTopologyControlButtons({ fitToScreen: false, customButtons}); + + return ( +
+ } + controlBar={} + > +
CANVAS
+
+
+ ); + } +} +``` diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ViewToolbar.js b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ViewToolbar.js new file mode 100644 index 00000000000..5aaf2518c1a --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/ViewToolbar.js @@ -0,0 +1,139 @@ +import React from 'react'; +import { + Button, + Dropdown, + DropdownPosition, + DropdownToggle, + DropdownItem, + KebabToggle, + TextInput, + Toolbar, + ToolbarGroup, + ToolbarItem +} from '@patternfly/react-core'; +import { FilterIcon } from '@patternfly/react-icons'; + +export class ViewToolbar extends React.Component { + state = { + filterType: 'Name', + filterValue: '', + filterDropDownOpen: false, + actionKebabOpen: false + }; + + onFilterDropDownToggle = isOpen => { + this.setState({ filterDropDownOpen: isOpen }); + }; + + onFilterTypeSelect = (e, filterType) => { + e.preventDefault(); + this.setState({ + filterType, + filterDropDownOpen: false, + filterValue: filterType === this.state.filterType ? this.state.filterValue : '' + }); + }; + + handleFilterInputChange = value => { + this.setState({ filterValue: value }); + }; + + onActionKebabToggle = isOpen => { + this.setState({ actionKebabOpen: isOpen }); + }; + + onActionKebabSelect = (e, action) => { + e.preventDefault(); + this.setState({ actionKebabOpen: false }); + }; + + renderFilterInput = () => { + const { filterValue } = this.state; + return ( + + ); + }; + + renderFilterTypeDropdown = () => { + const { filterDropDownOpen, filterType } = this.state; + return ( + + + {filterType} + + } + isOpen={filterDropDownOpen} + dropdownItems={[ + this.onFilterTypeSelect(e, 'Name')}> + Name + , + this.onFilterTypeSelect(e, 'Type')}> + Type + , + this.onFilterTypeSelect(e, 'Status')}> + Status + + ]} + /> + ); + }; + + renderActionsdKebab = () => { + const { actionKebabOpen } = this.state; + + return ( + } + isOpen={actionKebabOpen} + isPlain + dropdownItems={[ + this.onActionKebabSelect(e, 'Action 3')}> + Action 3 + , + this.onActionKebabSelect(e, 'Action 4')}> + Action 4 + , + this.onActionKebabSelect(e, 'Disabled Action')}> + Disabled Action + + ]} + /> + ); + }; + + render() { + return ( + + + {this.renderFilterTypeDropdown()} + {this.renderFilterInput()} + + + + + + + + + {this.renderActionsdKebab()} + + + ); + } +} diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/examples/topology-example.scss b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/topology-example.scss new file mode 100644 index 00000000000..0e1a203a1b8 --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/examples/topology-example.scss @@ -0,0 +1,19 @@ +.topology-example { + margin: -9px; + width: calc(100% + 18px); + height: 500px; + + .project-toolbar { + .pf-c-dropdown > button { + justify-content: space-between; + width: 150px; + } + } + + .topology-view-filter-dropdown { + > button { + justify-content: space-between; + width: 130px; + } + } +} diff --git a/packages/patternfly-4/react-topology/src/components/TopologyView/index.ts b/packages/patternfly-4/react-topology/src/components/TopologyView/index.ts new file mode 100644 index 00000000000..8124fd0742f --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/TopologyView/index.ts @@ -0,0 +1 @@ +export * from './TopologyView'; diff --git a/packages/patternfly-4/react-topology/src/components/index.ts b/packages/patternfly-4/react-topology/src/components/index.ts new file mode 100644 index 00000000000..71656309a7d --- /dev/null +++ b/packages/patternfly-4/react-topology/src/components/index.ts @@ -0,0 +1,2 @@ +export * from './TopologyView'; +export * from './TopologyControlBar'; diff --git a/packages/patternfly-4/react-topology/src/index.ts b/packages/patternfly-4/react-topology/src/index.ts new file mode 100644 index 00000000000..07635cbbc8e --- /dev/null +++ b/packages/patternfly-4/react-topology/src/index.ts @@ -0,0 +1 @@ +export * from './components'; diff --git a/packages/patternfly-4/react-topology/tsconfig.base.json b/packages/patternfly-4/react-topology/tsconfig.base.json new file mode 100644 index 00000000000..44d1b907915 --- /dev/null +++ b/packages/patternfly-4/react-topology/tsconfig.base.json @@ -0,0 +1,25 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "jsx": "react", + "lib": [ + "es2017", + "dom" + ], + "module": "commonjs", + "moduleResolution": "node", + "skipLibCheck": true, + "strict": true, + "strictNullChecks": false, + "target": "es5" + }, + "include": [ + "./src/*", + "./src/**/*" + ], + "exclude": [ + "./src/**/**.test.tsx", + "./src/**/**.test.ts", + "./src/**/examples/**" + ] +} diff --git a/packages/patternfly-4/react-topology/tsconfig.gen-dts.json b/packages/patternfly-4/react-topology/tsconfig.gen-dts.json new file mode 100644 index 00000000000..f4158c6576c --- /dev/null +++ b/packages/patternfly-4/react-topology/tsconfig.gen-dts.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "dist/js" + } +} diff --git a/packages/patternfly-4/react-topology/tsconfig.typecheck.json b/packages/patternfly-4/react-topology/tsconfig.typecheck.json new file mode 100644 index 00000000000..87a71ad6ef0 --- /dev/null +++ b/packages/patternfly-4/react-topology/tsconfig.typecheck.json @@ -0,0 +1,7 @@ +{ + "extends": "./tsconfig.base.json", + "compilerOptions": { + "allowJs": true, + "noEmit": true + } +} From 1970d3e9c90abf9796dcba3f489f4881017485e4 Mon Sep 17 00:00:00 2001 From: patternfly-build Date: Tue, 11 Jun 2019 18:33:57 +0000 Subject: [PATCH 20/83] chore(release): releasing packages [ci skip] - @patternfly/react-core@3.39.0 - @patternfly/react-docs@4.7.0 - @patternfly/react-inline-edit-extension@2.7.8 - demo-app-ts@1.19.2 - @patternfly/react-table@2.11.2 - @patternfly/react-topology@2.1.0 - @patternfly/react-virtualized-extension@1.0.6 --- packages/patternfly-4/react-core/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-core/package.json | 2 +- packages/patternfly-4/react-docs/CHANGELOG.md | 11 +++++++++++ packages/patternfly-4/react-docs/package.json | 6 +++--- .../react-inline-edit-extension/CHANGELOG.md | 8 ++++++++ .../react-inline-edit-extension/package.json | 6 +++--- .../react-integration/demo-app-ts/CHANGELOG.md | 8 ++++++++ .../react-integration/demo-app-ts/package.json | 4 ++-- packages/patternfly-4/react-table/CHANGELOG.md | 8 ++++++++ packages/patternfly-4/react-table/package.json | 4 ++-- packages/patternfly-4/react-topology/CHANGELOG.md | 6 ++++++ packages/patternfly-4/react-topology/package.json | 4 ++-- .../react-virtualized-extension/CHANGELOG.md | 8 ++++++++ .../react-virtualized-extension/package.json | 4 ++-- 14 files changed, 75 insertions(+), 15 deletions(-) diff --git a/packages/patternfly-4/react-core/CHANGELOG.md b/packages/patternfly-4/react-core/CHANGELOG.md index d21a94a2288..d8b74182567 100644 --- a/packages/patternfly-4/react-core/CHANGELOG.md +++ b/packages/patternfly-4/react-core/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [3.39.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.38.1...@patternfly/react-core@3.39.0) (2019-06-11) + + +### Features + +* **Topology:** Add @patternfly/react-topology package ([#2170](https://github.com/patternfly/patternfly-react/issues/2170)) ([58eb9cc](https://github.com/patternfly/patternfly-react/commit/58eb9cc)) + + + + + ## [3.38.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-core@3.38.0...@patternfly/react-core@3.38.1) (2019-06-11) **Note:** Version bump only for package @patternfly/react-core diff --git a/packages/patternfly-4/react-core/package.json b/packages/patternfly-4/react-core/package.json index 1b3f03eb8ef..3f71ab48212 100644 --- a/packages/patternfly-4/react-core/package.json +++ b/packages/patternfly-4/react-core/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-core", - "version": "3.38.1", + "version": "3.39.0", "description": "This library provides a set of common React components for use with the PatternFly reference implementation.", "main": "dist/js/index.js", "module": "dist/esm/index.js", diff --git a/packages/patternfly-4/react-docs/CHANGELOG.md b/packages/patternfly-4/react-docs/CHANGELOG.md index 103fa6c38b3..d4bda72ebcf 100644 --- a/packages/patternfly-4/react-docs/CHANGELOG.md +++ b/packages/patternfly-4/react-docs/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.7.0](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.11...@patternfly/react-docs@4.7.0) (2019-06-11) + + +### Features + +* **Topology:** Add @patternfly/react-topology package ([#2170](https://github.com/patternfly/patternfly-react/issues/2170)) ([58eb9cc](https://github.com/patternfly/patternfly-react/commit/58eb9cc)) + + + + + ## [4.6.11](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-docs@4.6.10...@patternfly/react-docs@4.6.11) (2019-06-11) **Note:** Version bump only for package @patternfly/react-docs diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index a3a7faf04e9..849ea732ca0 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -1,7 +1,7 @@ { "name": "@patternfly/react-docs", "description": "PatternFly React Docs", - "version": "4.6.11", + "version": "4.7.0", "author": "Red Hat", "license": "MIT", "private": true, @@ -17,9 +17,9 @@ "@mdx-js/mdx": "1.0.2", "@mdx-js/react": "1.0.2", "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.1", + "@patternfly/react-core": "^3.39.0", "@patternfly/react-icons": "^3.9.5", - "@patternfly/react-virtualized-extension": "^1.0.5", + "@patternfly/react-virtualized-extension": "^1.0.6", "gatsby": "2.3.14", "gatsby-mdx": "0.6.3", "gatsby-plugin-react-helmet": "^3.0.11", diff --git a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md index 08f142cec47..a6a4360f4fe 100644 --- a/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-inline-edit-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.7.8](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.7...@patternfly/react-inline-edit-extension@2.7.8) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-inline-edit-extension + + + + + ## [2.7.7](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-inline-edit-extension@2.7.6...@patternfly/react-inline-edit-extension@2.7.7) (2019-06-11) **Note:** Version bump only for package @patternfly/react-inline-edit-extension diff --git a/packages/patternfly-4/react-inline-edit-extension/package.json b/packages/patternfly-4/react-inline-edit-extension/package.json index b8f9ed1a6fe..f34f3f2d73a 100644 --- a/packages/patternfly-4/react-inline-edit-extension/package.json +++ b/packages/patternfly-4/react-inline-edit-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-inline-edit-extension", - "version": "2.7.7", + "version": "2.7.8", "description": "This library provides inline editing support for PatternFly 4 React table", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,10 +28,10 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.1", + "@patternfly/react-core": "^3.39.0", "@patternfly/react-icons": "^3.9.5", "@patternfly/react-styles": "^3.3.3", - "@patternfly/react-table": "^2.11.1", + "@patternfly/react-table": "^2.11.2", "classnames": "^2.2.5", "exenv": "^1.2.2", "reactabular-table": "^8.14.0" diff --git a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md index 589a6b59f9d..aab3cd00790 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md +++ b/packages/patternfly-4/react-integration/demo-app-ts/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.19.2](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.19.1...demo-app-ts@1.19.2) (2019-06-11) + +**Note:** Version bump only for package demo-app-ts + + + + + ## [1.19.1](https://github.com/patternfly/patternfly-react/compare/demo-app-ts@1.19.0...demo-app-ts@1.19.1) (2019-06-11) **Note:** Version bump only for package demo-app-ts diff --git a/packages/patternfly-4/react-integration/demo-app-ts/package.json b/packages/patternfly-4/react-integration/demo-app-ts/package.json index 3c922f1ab8d..a706a0ff5d8 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/package.json +++ b/packages/patternfly-4/react-integration/demo-app-ts/package.json @@ -1,13 +1,13 @@ { "name": "demo-app-ts", "private": true, - "version": "1.19.1", + "version": "1.19.2", "scripts": { "build:demo-app": "react-scripts build", "start:demo-app": "react-scripts start" }, "dependencies": { - "@patternfly/react-core": "^3.38.1", + "@patternfly/react-core": "^3.39.0", "react": "^16.8.4", "react-dom": "^16.8.4", "react-router": "^4.3.1", diff --git a/packages/patternfly-4/react-table/CHANGELOG.md b/packages/patternfly-4/react-table/CHANGELOG.md index 6386e9beca9..06268f57314 100644 --- a/packages/patternfly-4/react-table/CHANGELOG.md +++ b/packages/patternfly-4/react-table/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [2.11.2](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.11.1...@patternfly/react-table@2.11.2) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-table + + + + + ## [2.11.1](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-table@2.11.0...@patternfly/react-table@2.11.1) (2019-06-11) **Note:** Version bump only for package @patternfly/react-table diff --git a/packages/patternfly-4/react-table/package.json b/packages/patternfly-4/react-table/package.json index 5b790cad642..5dd3b9712af 100644 --- a/packages/patternfly-4/react-table/package.json +++ b/packages/patternfly-4/react-table/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-table", - "version": "2.11.1", + "version": "2.11.2", "description": "This library provides a set of React table components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,7 +28,7 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-table#readme", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.1", + "@patternfly/react-core": "^3.39.0", "@patternfly/react-icons": "^3.9.5", "@patternfly/react-styles": "^3.3.3", "@patternfly/react-tokens": "^2.5.5", diff --git a/packages/patternfly-4/react-topology/CHANGELOG.md b/packages/patternfly-4/react-topology/CHANGELOG.md index 767840ada8e..b6d64ae8149 100644 --- a/packages/patternfly-4/react-topology/CHANGELOG.md +++ b/packages/patternfly-4/react-topology/CHANGELOG.md @@ -3,3 +3,9 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# 2.1.0 (2019-06-11) + + +### Features + +* **Topology:** Add @patternfly/react-topology package ([#2170](https://github.com/patternfly/patternfly-react/issues/2170)) ([58eb9cc](https://github.com/patternfly/patternfly-react/commit/58eb9cc)) diff --git a/packages/patternfly-4/react-topology/package.json b/packages/patternfly-4/react-topology/package.json index b00185cb417..3ce026d7242 100644 --- a/packages/patternfly-4/react-topology/package.json +++ b/packages/patternfly-4/react-topology/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-topology", - "version": "2.0.0", + "version": "2.1.0", "description": "This library provides a set of React topology view components for use with the PatternFly 4", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -25,7 +25,7 @@ }, "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/react-topology#readme", "dependencies": { - "@patternfly/react-core": "^3.38.0", + "@patternfly/react-core": "^3.39.0", "@patternfly/react-icons": "^3.9.5", "@patternfly/react-styles": "^3.3.2" }, diff --git a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md index 6f6d9c1bce0..8140e01184b 100644 --- a/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md +++ b/packages/patternfly-4/react-virtualized-extension/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.0.6](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.5...@patternfly/react-virtualized-extension@1.0.6) (2019-06-11) + +**Note:** Version bump only for package @patternfly/react-virtualized-extension + + + + + ## [1.0.5](https://github.com/patternfly/patternfly-react/compare/@patternfly/react-virtualized-extension@1.0.4...@patternfly/react-virtualized-extension@1.0.5) (2019-06-11) **Note:** Version bump only for package @patternfly/react-virtualized-extension diff --git a/packages/patternfly-4/react-virtualized-extension/package.json b/packages/patternfly-4/react-virtualized-extension/package.json index 19191ed84f7..9a493d70225 100644 --- a/packages/patternfly-4/react-virtualized-extension/package.json +++ b/packages/patternfly-4/react-virtualized-extension/package.json @@ -1,6 +1,6 @@ { "name": "@patternfly/react-virtualized-extension", - "version": "1.0.5", + "version": "1.0.6", "description": "This library provides efficient rendering extensions for PatternFly 4 React tables and lists.", "main": "dist/js/index.js", "module": "dist/esm/index.js", @@ -28,7 +28,7 @@ "homepage": "https://github.com/patternfly/patternfly-react/tree/master/packages/patternfly-4/", "dependencies": { "@patternfly/patternfly": "2.12.5", - "@patternfly/react-core": "^3.38.1", + "@patternfly/react-core": "^3.39.0", "@patternfly/react-icons": "^3.9.5", "@patternfly/react-styles": "^3.3.3", "clsx": "^1.0.1", From 9b90f94cea164158ce766b6f7fd984f45e3767bd Mon Sep 17 00:00:00 2001 From: Jessie Date: Tue, 11 Jun 2019 15:13:40 -0400 Subject: [PATCH 21/83] feat(ApplicationLauncher): Convert application launcher to typescript (#2166) * Began conversion of application launcher to typescript * fix imports and onSelect * Fix linting errors * Fix imports * Fix imports * Create demo and tests * Fix onSelect and add tests * Address feedback * Address feedback * Add space for linting --- .../ApplicationLauncher.d.ts | 12 -- .../ApplicationLauncher.js | 91 ------------- .../ApplicationLauncher.md | 1 + .../ApplicationLauncher.test.js | 4 +- .../ApplicationLauncher.tsx | 86 +++++++++++++ ...herMenu.js => ApplicationLauncherMenu.tsx} | 85 ++++++------ ...oggle.js => ApplicationLauncherToggle.tsx} | 121 +++++++++--------- .../applicationLauncherConstants.d.ts | 4 - ...ts.js => applicationLauncherConstants.tsx} | 0 .../components/ApplicationLauncher/index.d.ts | 1 - .../components/ApplicationLauncher/index.js | 1 - .../components/ApplicationLauncher/index.ts | 1 + .../src/components/Dropdown/Dropdown.d.ts | 4 +- .../src/components/Dropdown/DropdownItem.d.ts | 31 ++++- .../Dropdown/dropdownConstants.d.ts | 30 +++-- .../integration/applicationlauncher.spec.ts | 28 ++++ .../demo-app-ts/src/Demos.ts | 5 + .../ApplicationLauncherDemo.tsx | 66 ++++++++++ .../demo-app-ts/src/components/demos/index.ts | 1 + 19 files changed, 333 insertions(+), 239 deletions(-) delete mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.js create mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx rename packages/patternfly-4/react-core/src/components/ApplicationLauncher/{ApplicationLauncherMenu.js => ApplicationLauncherMenu.tsx} (53%) rename packages/patternfly-4/react-core/src/components/ApplicationLauncher/{Toggle.js => ApplicationLauncherToggle.tsx} (50%) delete mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.d.ts rename packages/patternfly-4/react-core/src/components/ApplicationLauncher/{applicationLauncherConstants.js => applicationLauncherConstants.tsx} (100%) delete mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.js create mode 100644 packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.ts create mode 100644 packages/patternfly-4/react-integration/cypress/integration/applicationlauncher.spec.ts create mode 100644 packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/ApplicationLauncherDemo/ApplicationLauncherDemo.tsx diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.d.ts b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.d.ts deleted file mode 100644 index 9b873b3e085..00000000000 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { FunctionComponent, HTMLProps, ReactNode } from 'react'; - -export interface ApplicationLauncherProps extends HTMLProps { - dropdownItems: ReactNode[]; - isOpen?: boolean; - onSelect(event: React.SyntheticEvent): void; - onToggle?(event: React.SyntheticEvent): void; -} - -declare const ApplicationLauncher: FunctionComponent; - -export default ApplicationLauncher; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.js deleted file mode 100644 index 84e1595c113..00000000000 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.js +++ /dev/null @@ -1,91 +0,0 @@ -import React, { Children, cloneElement } from 'react'; -import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher'; -import { css } from '@patternfly/react-styles'; -import PropTypes from 'prop-types'; -import ApplicationLauncherMenu from './ApplicationLauncherMenu'; -import Toggle from './Toggle'; -import { ThIcon } from '@patternfly/react-icons'; -import { DropdownContext } from '../Dropdown/dropdownConstants'; -import GenerateId from '../../helpers/GenerateId/GenerateId'; - -export const propTypes = { - /** Additional element css classes */ - className: PropTypes.string, - /** Array of DropdownItem nodes that will be rendered in the dropdown Menu list */ - dropdownItems: PropTypes.array, - /** open bool */ - isOpen: PropTypes.bool, - /** Function callback called when user selects item */ - onSelect: PropTypes.func, - /** Callback called when application launcher toggle is clicked */ - onToggle: PropTypes.func, - /** Adds accessible text to the button. Required for plain buttons */ - 'aria-label': PropTypes.string -}; - -export const defaultProps = { - className: '', - dropdownItems: [], - isOpen: false, - onSelect: Function.prototype, - onToggle: Function.prototype, - 'aria-label': 'Actions' -}; - -class ApplicationLauncher extends React.Component { - onEnter = () => { - this.openedOnEnter = true; - }; - - componentDidUpdate() { - if (!this.props.isOpen) this.openedOnEnter = false; - } - - render() { - const { 'aria-label': ariaLabel, dropdownItems, className, isOpen, onSelect, onToggle } = this.props; - return ( - - {randomId => ( -
{ - this.parentRef = ref; - }} - > - {Children.map( - - - , - oneToggle => - cloneElement(oneToggle, { - parentRef: this.parentRef, - id: randomId, - isOpen, - isPlain: true, - 'aria-haspopup': true, - onEnter: this.onEnter - }) - )} - {isOpen && ( - onSelect && onSelect(event)}> - - {dropdownItems} - - - )} -
- )} -
- ); - } -} - -ApplicationLauncher.propTypes = propTypes; -ApplicationLauncher.defaultProps = defaultProps; - -export default ApplicationLauncher; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.md b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.md index 205b23f870a..28cff0d2ec5 100644 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.md +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.md @@ -2,6 +2,7 @@ title: 'Application launcher' cssPrefix: 'pf-c-app-launcher' propComponents: ['ApplicationLauncher'] +typescript: true --- import { ApplicationLauncher, DropdownItem, Tooltip } from '@patternfly/react-core'; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.test.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.test.js index 7208f104f39..96f4f47b7ea 100644 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.test.js +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.test.js @@ -1,7 +1,7 @@ import React from 'react'; import { shallow } from 'enzyme'; -import ApplicationLauncher from './ApplicationLauncher'; -import DropdownItem from '../Dropdown/DropdownItem'; +import { ApplicationLauncher } from './ApplicationLauncher'; +import { DropdownItem } from '../Dropdown/DropdownItem'; import { DropdownPosition, DropdownDirection } from '../Dropdown/dropdownConstants'; import DropdownSeparator from '../Dropdown/Separator'; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx new file mode 100644 index 00000000000..b551f3f9159 --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncher.tsx @@ -0,0 +1,86 @@ +import * as React from 'react'; +import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher'; +import { css } from '@patternfly/react-styles'; +import { ApplicationLauncherMenu } from './ApplicationLauncherMenu'; +import { ApplicationLauncherToggle } from './ApplicationLauncherToggle'; +import { ThIcon } from '@patternfly/react-icons'; +import { DropdownContext } from '../Dropdown/dropdownConstants'; +import GenerateId from '../../helpers/GenerateId/GenerateId'; + +export interface ApplicationLauncherProps extends React.HTMLProps { + /** Additional element css classes */ + className: string; + /** Array of DropdownItem nodes that will be rendered in the dropdown Menu list */ + dropdownItems: React.ReactNode[]; + /** open bool */ + isOpen: boolean; + /** Function callback called when user selects item */ + onSelect: (event: any) => void; + /** Callback called when application launcher toggle is clicked */ + onToggle?: (value: boolean) => void; + /** Adds accessible text to the button. Required for plain buttons */ + 'aria-label': string; +} + +export class ApplicationLauncher extends React.Component { + static defaultProps = { + className: '', + dropdownItems: [] as React.ReactNode[], + isOpen: false, + onSelect: (_event: any): any => undefined, + onToggle: (_value: boolean): any => undefined, + 'aria-label': 'Actions' + }; + + parentRef = React.createRef(); + openedOnEnter: boolean = false; + + onEnter = () => { + this.openedOnEnter = true; + }; + + componentDidUpdate() { + if (!this.props.isOpen){ this.openedOnEnter = false}; + } + + render() { + const { 'aria-label': ariaLabel, dropdownItems, className, isOpen, onSelect, onToggle } = this.props; + return ( + + {randomId => ( +
+ {React.Children.map( + + + , + oneToggle => + React.cloneElement(oneToggle, { + parentRef: this.parentRef, + id: randomId, + isOpen, + isPlain: true, + 'aria-haspopup': true, + onEnter: this.onEnter + }) + )} + {isOpen && ( + + + {dropdownItems} + + + )} +
+ )} +
+ ); + } +} \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.tsx similarity index 53% rename from packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.js rename to packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.tsx index 5faa51d7443..9637e094f49 100644 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.js +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherMenu.tsx @@ -1,61 +1,55 @@ -import React from 'react'; +import * as React from 'react'; +import * as ReactDOM from 'react-dom'; import styles from '@patternfly/react-styles/css/components/AppLauncher/app-launcher'; import { css } from '@patternfly/react-styles'; -import PropTypes from 'prop-types'; import { ApplicationLauncherPosition } from './applicationLauncherConstants'; import { DropdownArrowContext } from '../Dropdown/dropdownConstants'; -import ReactDOM from 'react-dom'; import { keyHandler } from '../../helpers/util'; import { KEY_CODES, KEYHANDLER_DIRECTION } from '../../helpers/constants'; -const propTypes = { - /** Anything which can be rendered as dropdown items */ - children: PropTypes.node, - /** Classess applied to root element of dropdown menu */ - className: PropTypes.string, - /** internal index of the item */ - index: PropTypes.number, - /** Flag to indicate if menu is opened */ - isOpen: PropTypes.bool, - /** Flag to indicate if menu should be opened on enter */ - openedOnEnter: PropTypes.bool, - /** Indicates where menu will be alligned horizontally */ - position: PropTypes.oneOf(Object.values(ApplicationLauncherPosition)), - /** Additional props are spread to the container component */ - '': PropTypes.any // eslint-disable-line react/require-default-props -}; +export interface ApplicationLauncherMenuProps extends React.HTMLProps { + /** Anything which can be rendered as dropdown items */ + children?: React.ReactNode; + /** Classess applied to root element of dropdown menu */ + className?: string; + /** internal index of the item */ + index?: number; + /** Flag to indicate if menu is opened */ + isOpen?: boolean; + /** Flag to indicate if menu should be opened on enter */ + openedOnEnter?: boolean; + /** Indicates where menu will be alligned horizontally */ + position?: typeof ApplicationLauncherPosition | keyof typeof ApplicationLauncherPosition; +} -const defaultProps = { - children: null, - className: '', - index: null, - isOpen: true, - openedOnEnter: false, - position: ApplicationLauncherPosition.left -}; +export class ApplicationLauncherMenu extends React.Component { + refsCollection: any[] = []; + ref = React.createRef(); -class ApplicationLauncherMenu extends React.Component { - refsCollection = []; + static defaultProps = { + children: null as React.ReactNode, + className: '', + index: null as number, + isOpen: true, + openedOnEnter: false, + position: ApplicationLauncherPosition.left + }; - childKeyHandler = (index, position, custom = false) => { - keyHandler(index, position, this.refsCollection, this.props.children, custom); + childKeyHandler = (index: number, position: any, custom = false) => { + keyHandler(index, position, this.refsCollection, this.props.children as any[], custom); }; - onKeyDown = event => { + onKeyDown = (event: any) => { // Detected key press on this item, notify the menu parent so that the appropriate // item can be focused - if (event.key === KEY_CODES.TAB) return; + if (event.key === KEY_CODES.TAB) {return}; event.preventDefault(); if (event.keyCode === KEY_CODES.ARROW_UP) { - keyHandler(this.props.index, KEYHANDLER_DIRECTION.UP, this.refsCollection, this.props.children); + keyHandler(this.props.index, KEYHANDLER_DIRECTION.UP, this.refsCollection, this.props.children as any[]); } else if (event.keyCode === KEY_CODES.ARROW_DOWN) { - keyHandler(this.props.index, KEYHANDLER_DIRECTION.DOWN, this.refsCollection, this.props.children); + keyHandler(this.props.index, KEYHANDLER_DIRECTION.DOWN, this.refsCollection, this.props.children as any[]); } else if (event.key === KEY_CODES.ENTER) { - if (!this.ref.current.getAttribute) { - ReactDOM.findDOMNode(this.ref.current).click(); // eslint-disable-line react/no-find-dom-node - } else { - this.ref.current.click && this.ref.current.click(); - } + this.ref.current.click(); } }; @@ -65,7 +59,7 @@ class ApplicationLauncherMenu extends React.Component { } } - sendRef = (index, node, isDisabled) => { + sendRef = (index: number, node: any, isDisabled: boolean) => { if (!node.getAttribute) { this.refsCollection[index] = ReactDOM.findDOMNode(node); // eslint-disable-line react/no-find-dom-node } else if (isDisabled || node.getAttribute('role') === 'separator') { @@ -77,7 +71,7 @@ class ApplicationLauncherMenu extends React.Component { extendChildren() { return React.Children.map(this.props.children, (child, index) => - React.cloneElement(child, { + React.cloneElement(child as any, { index, isAppLauncher: true }) @@ -100,9 +94,4 @@ class ApplicationLauncherMenu extends React.Component { ); } -} - -ApplicationLauncherMenu.propTypes = propTypes; -ApplicationLauncherMenu.defaultProps = defaultProps; - -export default ApplicationLauncherMenu; +} \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/Toggle.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherToggle.tsx similarity index 50% rename from packages/patternfly-4/react-core/src/components/ApplicationLauncher/Toggle.js rename to packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherToggle.tsx index 1b1c24003f9..5fbcf2997e9 100644 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/Toggle.js +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/ApplicationLauncherToggle.tsx @@ -1,53 +1,53 @@ -import React, { Component } from 'react'; -import PropTypes from 'prop-types'; +import * as React from 'react'; import styles from '@patternfly/react-styles/css/components/Button/button'; import { css } from '@patternfly/react-styles'; import { KEY_CODES } from '../../helpers/constants'; -const propTypes = { - /** HTML ID of toggle */ - id: PropTypes.string.isRequired, - /** Type to put on the button */ - type: PropTypes.string, - /** Anything which can be rendered as toggle */ - children: PropTypes.node, - /** Classes applied to root element of toggle */ - className: PropTypes.string, - /** Flag to indicate if menu is opened */ - isOpen: PropTypes.bool, - /** Callback called when toggle is clicked */ - onToggle: PropTypes.func, - /** Callback for toggle open on keyboard entry */ - onEnter: PropTypes.func, - /** Element which wraps toggle */ - parentRef: PropTypes.any, - /** Forces focus state */ - isFocused: PropTypes.bool, - /** Forces hover state */ - isHovered: PropTypes.bool, - /** Forces active state */ - isActive: PropTypes.bool, - /** Display the toggle with no border or background */ - isPlain: PropTypes.bool, - /** Additional props are spread to the container ); } -} - -ApplicationLauncherToggle.propTypes = propTypes; -ApplicationLauncherToggle.defaultProps = defaultProps; - -export default ApplicationLauncherToggle; +} \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.d.ts b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.d.ts deleted file mode 100644 index d9d4dc49c7c..00000000000 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.d.ts +++ /dev/null @@ -1,4 +0,0 @@ -export const ApplicationLauncherPosition: { - right: 'right'; - left: 'left'; -}; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.tsx similarity index 100% rename from packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.js rename to packages/patternfly-4/react-core/src/components/ApplicationLauncher/applicationLauncherConstants.tsx diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.d.ts b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.d.ts deleted file mode 100644 index eb80d448cc0..00000000000 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.d.ts +++ /dev/null @@ -1 +0,0 @@ -export { default as ApplicationLauncher } from './ApplicationLauncher'; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.js b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.js deleted file mode 100644 index eb80d448cc0..00000000000 --- a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.js +++ /dev/null @@ -1 +0,0 @@ -export { default as ApplicationLauncher } from './ApplicationLauncher'; diff --git a/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.ts b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.ts new file mode 100644 index 00000000000..3554cd7dddd --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/ApplicationLauncher/index.ts @@ -0,0 +1 @@ +export * from './ApplicationLauncher'; diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.d.ts b/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.d.ts index 0e7ab679cfd..dea648c0a12 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.d.ts +++ b/packages/patternfly-4/react-core/src/components/Dropdown/Dropdown.d.ts @@ -10,8 +10,8 @@ export interface DropdownProps extends HTMLProps { isAction?: boolean; isGrouped?: boolean; onSelect?(event: React.SyntheticEvent): void; - position?: OneOf; - direction?: OneOf; + position?: DropdownPosition | 'right' | 'left'; + direction?: DropdownDirection | 'up' | 'down'; toggle?: ReactNode; } diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownItem.d.ts b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownItem.d.ts index 009ef1350e9..78131ea10d2 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/DropdownItem.d.ts +++ b/packages/patternfly-4/react-core/src/components/Dropdown/DropdownItem.d.ts @@ -1,6 +1,27 @@ -import { HTMLProps, ReactType } from 'react'; +import * as React from 'react'; -export interface DropdownItemProps extends HTMLProps { - component?: ReactType | string; - isDisabled?: Boolean; -} +export interface DropdownItemProps extends React.HTMLProps { + /** Anything which can be rendered as dropdown item */ + children?: React.ReactNode; + /** Classes applied to root element of dropdown item */ + className?: string; + /** Indicates which component will be used as dropdown item */ + component?: React.ReactType | string; + /** Flag if this is for the app launcher */ + isAppLauncher?: boolean; + /** Role for the item */ + role?: string; + /** Render dropdown item as disabled option */ + isDisabled?: boolean; + /** Forces display of the hover state of the element */ + isHovered?: boolean; + /** Default hyperlink location */ + href?: string; + index?: number; + context?: { + keyHandler?: (index: number, direction: string) => void, + sendRef?: (index: number, ref: any, isDisabled: boolean) => void + }; + /** Callback for click event */ + onClick?: () => void; +} \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/Dropdown/dropdownConstants.d.ts b/packages/patternfly-4/react-core/src/components/Dropdown/dropdownConstants.d.ts index a5b28878890..f780651ca46 100644 --- a/packages/patternfly-4/react-core/src/components/Dropdown/dropdownConstants.d.ts +++ b/packages/patternfly-4/react-core/src/components/Dropdown/dropdownConstants.d.ts @@ -1,9 +1,21 @@ -export const DropdownPosition: { - right: 'right'; - left: 'left'; -}; - -export const DropdownDirection: { - up: 'up'; - down: 'down'; -}; +import * as React from 'react'; +import { any } from 'glamor'; + +export enum DropdownPosition { + right = 'right', + left = 'left' +} + +export enum DropdownDirection { + up = 'up', + down = 'down' +} + +export const DropdownContext: React.Context< + (event: any) => void +> + +export const DropdownArrowContext: React.Context<{ + keyHandler: (index: number, position: any, custom: boolean) => void, + sendRef: (index: number, node: any, isDisabled: boolean) => void +}> diff --git a/packages/patternfly-4/react-integration/cypress/integration/applicationlauncher.spec.ts b/packages/patternfly-4/react-integration/cypress/integration/applicationlauncher.spec.ts new file mode 100644 index 00000000000..4cdd6c38bce --- /dev/null +++ b/packages/patternfly-4/react-integration/cypress/integration/applicationlauncher.spec.ts @@ -0,0 +1,28 @@ +describe('Application Launcher Demo Test', () => { + it('Navigate to demo section', () => { + cy.visit('http://localhost:3000/'); + cy.get('#application-launcher-demo-nav-item-link').click(); + cy.url().should('eq', 'http://localhost:3000/application-launcher-demo-nav-link'); + }); + + it('Verify application launcher button', () => { + cy.get('button').should('have.class', 'pf-c-button pf-m-plain'); + }); + + it('Verify app launcher menu toggle', () => { + cy.get('#pf-random-id-0').click(); + cy.get('ul').should('have.class', 'pf-c-app-launcher__menu'); + cy.get('#pf-random-id-0').click(); + cy.get('.pf-c-app-launcher__menu').should('not.exist'); + }); + + // it('Verify onSelect', () => { + // cy.window().then(win => { + // const spy = cy.spy(win.console, "log"); + // cy.get('#pf-random-id-0').click(); + // cy.get('.pf-c-app-launcher__menu-item').first().click(); + // win.console.log('hi'); + // expect(spy).to.be.called.callCount(2); + // }); + // }); +}); diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts b/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts index 5a6c6d32ae7..45d26594a40 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/Demos.ts @@ -20,6 +20,11 @@ export const Demos: DemoInterface[] = [ name: 'Alert Demo', componentType: Examples.AlertDemo }, + { + id: 'application-launcher-demo', + name: 'Application Launcher Demo', + componentType: Examples.ApplicationLauncherDemo + }, { id: 'avatar-demo', name: 'Avatar Demo', diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/ApplicationLauncherDemo/ApplicationLauncherDemo.tsx b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/ApplicationLauncherDemo/ApplicationLauncherDemo.tsx new file mode 100644 index 00000000000..f65293b6108 --- /dev/null +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/ApplicationLauncherDemo/ApplicationLauncherDemo.tsx @@ -0,0 +1,66 @@ +import React from 'react'; +import { ApplicationLauncher, DropdownItem, Tooltip } from '@patternfly/react-core'; + +interface ApplicationLauncherState { + isOpen: boolean; +} + + +export class ApplicationLauncherDemo extends React.Component { + onToggle: (isOpen: boolean) => void; + onSelect: (event: any) => void; + constructor(props) { + super(props); + this.state = { + isOpen: false + }; + this.onToggle = isOpen => { + this.setState({ + isOpen + }); + }; + this.onSelect = event => { + console.log("This works") + this.setState({ + isOpen: !this.state.isOpen + }); + }; + } + + render() { + const { isOpen } = this.state; + const dropdownItems = [ + Launch Application 1
}> + + Application 1 + + + , + Launch Application 2
} position="right"> + + Application 2 + + + , + Launch Application 3
} position="right"> + + Application 3 + + + , + Application Unavailable At This Time
} position="bottom"> + + Unavailable Application + + + ]; + return ( + + ); + } +} \ No newline at end of file diff --git a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts index 35aacf61847..8580ffa7ff8 100644 --- a/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts +++ b/packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/index.ts @@ -1,4 +1,5 @@ export * from './AboutModal/AboutModalDemo'; +export * from './ApplicationLauncherDemo/ApplicationLauncherDemo'; export * from './AlertDemo/AlertDemo'; export * from './AvatarDemo/AvatarDemo'; export * from './BackdropDemo/BackdropDemo'; From 783251851c9f1fd6503ca31df7ff9beeeabe767e Mon Sep 17 00:00:00 2001 From: Jessie Date: Tue, 11 Jun 2019 15:39:04 -0400 Subject: [PATCH 22/83] feat(Card): Add support for images and actions (#2122) * Get started on card image and actions support * Made checkbox functional * Add additional card examples * Fix images * Fix example images * Address comment * Change positioning of dropdown * Change Checkbox component to checked input --- .../react-core/src/components/Card/Card.md | 260 +++++++++++++++++- .../src/components/Card/CardActions.tsx | 21 ++ .../src/components/Card/CardHead.tsx | 20 ++ .../components/Card/examples/brandImg2.svg | 13 + .../src/components/Card/examples/pfLogo.svg | 37 +++ .../react-core/src/components/Card/index.ts | 2 + packages/patternfly-4/react-docs/package.json | 2 +- 7 files changed, 353 insertions(+), 2 deletions(-) create mode 100644 packages/patternfly-4/react-core/src/components/Card/CardActions.tsx create mode 100644 packages/patternfly-4/react-core/src/components/Card/CardHead.tsx create mode 100644 packages/patternfly-4/react-core/src/components/Card/examples/brandImg2.svg create mode 100644 packages/patternfly-4/react-core/src/components/Card/examples/pfLogo.svg diff --git a/packages/patternfly-4/react-core/src/components/Card/Card.md b/packages/patternfly-4/react-core/src/components/Card/Card.md index 0f9df1e0d64..c96ec63f988 100644 --- a/packages/patternfly-4/react-core/src/components/Card/Card.md +++ b/packages/patternfly-4/react-core/src/components/Card/Card.md @@ -5,7 +5,8 @@ typescript: true propComponents: ['Card', 'CardHeader', 'CardBody', 'CardFooter'] --- -import { Card, CardHeader, CardBody, CardFooter } from '@patternfly/react-core'; +import { Card, CardActions, CardHead, CardHeader, CardBody, CardFooter, Checkbox, DropdownActions } from '@patternfly/react-core'; +import pfLogo from './examples/pfLogo.svg'; ## Simple card ```js @@ -21,6 +22,263 @@ SimpleCard = () => ( ); ``` +## Card with image and actions +```js +import React from 'react'; +import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator, DropdownPosition, DropdownDirection, KebabToggle, Card, CardHead, CardActions, CardHeader, CardBody } from '@patternfly/react-core'; +import pfLogo from './examples/pfLogo.svg'; + +class KebabDropdown extends React.Component { + constructor(props) { + super(props); + this.state = { + isOpen: false, + check1: false + }; + this.onToggle = isOpen => { + this.setState({ + isOpen + }); + }; + this.onSelect = event => { + this.setState({ + isOpen: !this.state.isOpen + }); + }; + this.onClick = (checked, event) => { + const target = event.target; + const value = target.type === 'checkbox' ? target.checked : target.value; + const name = target.name; + this.setState({ [name]: value }); + }; + } + + render() { + const { isOpen } = this.state; + const dropdownItems = [ + Link, + + Action + , + + Disabled Link + , + + Disabled Action + , + , + Separated Link, + + Separated Action + + ]; + return ( + + + + + } + isOpen={isOpen} + isPlain + dropdownItems={dropdownItems} + position={'right'} + /> + + + + Header + Body + Footer + + ); + } +} +``` + +## Card header in card head +```js + import React from 'react'; +import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator, DropdownPosition, DropdownDirection, KebabToggle, Card, CardHead, CardActions, CardHeader, CardBody } from '@patternfly/react-core'; + +class KebabDropdown extends React.Component { + constructor(props) { + super(props); + this.state = { + isOpen: false, + check1: false + }; + this.onToggle = isOpen => { + this.setState({ + isOpen + }); + }; + this.onSelect = event => { + this.setState({ + isOpen: !this.state.isOpen + }); + }; + this.onClick = (checked, event) => { + const target = event.target; + const value = target.type === 'checkbox' ? target.checked : target.value; + const name = target.name; + this.setState({ [name]: value }); + }; + } + + render() { + const { isOpen } = this.state; + const dropdownItems = [ + Link, + + Action + , + + Disabled Link + , + + Disabled Action + , + , + Separated Link, + + Separated Action + + ]; + return ( + + + + } + isOpen={isOpen} + isPlain + dropdownItems={dropdownItems} + position={'right'} + /> + + + This is a really really really really really really really really really really long header + + Body + Footer + + ); + } +} +``` + +## Only actions in card head (no header/footer) +```js + import React from 'react'; +import { Dropdown, DropdownToggle, DropdownItem, DropdownSeparator, DropdownPosition, DropdownDirection, KebabToggle, Card, CardHead, CardActions, CardHeader, CardBody } from '@patternfly/react-core'; + +class KebabDropdown extends React.Component { + constructor(props) { + super(props); + this.state = { + isOpen: false, + check1: false + }; + this.onToggle = isOpen => { + this.setState({ + isOpen + }); + }; + this.onSelect = event => { + this.setState({ + isOpen: !this.state.isOpen + }); + }; + this.onClick = (checked, event) => { + const target = event.target; + const value = target.type === 'checkbox' ? target.checked : target.value; + const name = target.name; + this.setState({ [name]: value }); + }; + } + + render() { + const { isOpen } = this.state; + const dropdownItems = [ + Link, + + Action + , + + Disabled Link + , + + Disabled Action + , + , + Separated Link, + + Separated Action + + ]; + return ( + + + + } + isOpen={isOpen} + isPlain + dropdownItems={dropdownItems} + position={'right'} + /> + + + + This is the card body, there is only actions in the card head. + + ); + } +} +``` + +## Only image in the card head +```js +import React from 'react'; +import { Card, CardHeader, CardBody, CardFooter } from '@patternfly/react-core'; + +ImageCard = () => ( + + + + + Header + Body + Footer + +); +``` + ## Card with no footer ```js import React from 'react'; diff --git a/packages/patternfly-4/react-core/src/components/Card/CardActions.tsx b/packages/patternfly-4/react-core/src/components/Card/CardActions.tsx new file mode 100644 index 00000000000..7a036a97273 --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Card/CardActions.tsx @@ -0,0 +1,21 @@ +import * as React from 'react'; +import { css } from '@patternfly/react-styles'; +import styles from '@patternfly/react-styles/css/components/Card/card'; + + +export interface CardActionsProps extends React.HTMLProps { + /** Content rendered inside the Card Action */ + children?: React.ReactNode; + /** Additional classes added to the Action */ + className?: string; +} + +export const CardActions: React.FunctionComponent = ({ + children = null, + className = '', + ...props +}: CardActionsProps) => ( +
+ {children} +
+); \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/Card/CardHead.tsx b/packages/patternfly-4/react-core/src/components/Card/CardHead.tsx new file mode 100644 index 00000000000..5cabf77531c --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Card/CardHead.tsx @@ -0,0 +1,20 @@ +import * as React from 'react'; +import { css } from '@patternfly/react-styles'; +import styles from '@patternfly/react-styles/css/components/Card/card'; + +export interface CardHeadProps extends React.HTMLProps { + /** Content rendered inside the Card Head */ + children?: React.ReactNode; + /** Additional classes added to the Head */ + className?: string; +} + +export const CardHead: React.FunctionComponent = ({ + children = null, + className = '', + ...props +}: CardHeadProps) => ( +
+ {children} +
+); \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/Card/examples/brandImg2.svg b/packages/patternfly-4/react-core/src/components/Card/examples/brandImg2.svg new file mode 100644 index 00000000000..c02f48300d0 --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Card/examples/brandImg2.svg @@ -0,0 +1,13 @@ + + + + + + + \ No newline at end of file diff --git a/packages/patternfly-4/react-core/src/components/Card/examples/pfLogo.svg b/packages/patternfly-4/react-core/src/components/Card/examples/pfLogo.svg new file mode 100644 index 00000000000..efca381b551 --- /dev/null +++ b/packages/patternfly-4/react-core/src/components/Card/examples/pfLogo.svg @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + diff --git a/packages/patternfly-4/react-core/src/components/Card/index.ts b/packages/patternfly-4/react-core/src/components/Card/index.ts index 4da33a48e8f..7794f4b0dac 100644 --- a/packages/patternfly-4/react-core/src/components/Card/index.ts +++ b/packages/patternfly-4/react-core/src/components/Card/index.ts @@ -1,4 +1,6 @@ export * from './Card'; +export * from './CardActions'; export * from './CardBody'; export * from './CardFooter'; export * from './CardHeader'; +export * from './CardHead'; diff --git a/packages/patternfly-4/react-docs/package.json b/packages/patternfly-4/react-docs/package.json index 849ea732ca0..0a70b92d6e0 100644 --- a/packages/patternfly-4/react-docs/package.json +++ b/packages/patternfly-4/react-docs/package.json @@ -10,7 +10,7 @@ "build:static": "shx cp -r ../react-core/dist/styles/* static", "clean": "rimraf .cache public static/assets static/base.css", "clean:mdx": "rimraf .cache/caches/gatsby-mdx", - "develop": "yarn build:static && yarn clean:mdx && gatsby develop", + "develop": "yarn build:static && gatsby develop", "serve": "gatsby serve --prefix-paths" }, "dependencies": { From 9be5c0bb4b0c28c0c1cb4b02c50baa1a9cf85962 Mon Sep 17 00:00:00 2001 From: Titani Labaj <39532947+tlabaj@users.noreply.github.com> Date: Tue, 11 Jun 2019 15:41:07 -0400 Subject: [PATCH 23/83] chore(TextArea): Convert TextArea to typescript (#2168) * chore(TextArea): Convert TextArea to typescript #1953 * updates for review commnents * update for review commnets * fix linting error --- .../src/components/TextArea/TextArea.d.ts | 12 ---- .../src/components/TextArea/TextArea.js | 60 ------------------- .../src/components/TextArea/TextArea.md | 7 ++- .../src/components/TextArea/TextArea.test.js | 2 +- .../src/components/TextArea/TextArea.tsx | 60 +++++++++++++++++++ .../__snapshots__/TextArea.test.js.snap | 2 +- .../src/components/TextArea/index.d.ts | 1 - .../src/components/TextArea/index.js | 1 - .../src/components/TextArea/index.ts | 1 + .../cypress/integration/textarea.spec.ts | 37 ++++++++++++ .../demo-app-ts/src/Demos.ts | 5 ++ .../demos/TextAreaDemo/TextAreaDemo.tsx | 42 +++++++++++++ .../demo-app-ts/src/components/demos/index.ts | 1 + 13 files changed, 153 insertions(+), 78 deletions(-) delete mode 100644 packages/patternfly-4/react-core/src/components/TextArea/TextArea.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/TextArea/TextArea.js create mode 100644 packages/patternfly-4/react-core/src/components/TextArea/TextArea.tsx delete mode 100644 packages/patternfly-4/react-core/src/components/TextArea/index.d.ts delete mode 100644 packages/patternfly-4/react-core/src/components/TextArea/index.js create mode 100644 packages/patternfly-4/react-core/src/components/TextArea/index.ts create mode 100644 packages/patternfly-4/react-integration/cypress/integration/textarea.spec.ts create mode 100644 packages/patternfly-4/react-integration/demo-app-ts/src/components/demos/TextAreaDemo/TextAreaDemo.tsx diff --git a/packages/patternfly-4/react-core/src/components/TextArea/TextArea.d.ts b/packages/patternfly-4/react-core/src/components/TextArea/TextArea.d.ts deleted file mode 100644 index 7ae80fe116c..00000000000 --- a/packages/patternfly-4/react-core/src/components/TextArea/TextArea.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { FormEvent, FunctionComponent, HTMLProps } from 'react'; -import { Omit } from '../../helpers/typeUtils'; - -export interface TextAreaProps extends Omit, 'onChange'> { - isRequired?: boolean; - isValid?: boolean; - onChange?(value: string, event: FormEvent): void; -} - -declare const TextArea: FunctionComponent; - -export default TextArea; diff --git a/packages/patternfly-4/react-core/src/components/TextArea/TextArea.js b/packages/patternfly-4/react-core/src/components/TextArea/TextArea.js deleted file mode 100644 index af778cde576..00000000000 --- a/packages/patternfly-4/react-core/src/components/TextArea/TextArea.js +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import styles from '@patternfly/react-styles/css/components/FormControl/form-control'; -import { css } from '@patternfly/react-styles'; -import PropTypes from 'prop-types'; - -const propTypes = { - /** Additional classes added to the TextArea. */ - className: PropTypes.string, - /** Flag to show if the TextArea is required. */ - isRequired: PropTypes.bool, - /** Flag to show if the TextArea is valid or invalid. */ - isValid: PropTypes.bool, - /** Value of the TextArea. */ - value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]), - /** A callback for when the TextArea value changes. */ - onChange: PropTypes.func, - /** Custom flag to show that the TextArea requires an associated id or aria-label. */ - 'aria-label': props => { - if (!props.id && !props['aria-label']) { - return new Error('TextArea requires either an id or aria-label to be specified'); - } - return null; - }, - /** Additional props are spread to the container