From edbbb4f52195ffdc508062014bc417e276f7b1e4 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 19 Feb 2024 09:37:04 -0500 Subject: [PATCH 1/7] CDC #114 - Updating DataTableColumnSelector to render "renderListHeader" prop if provided --- .../src/components/DataTableColumnSelector.js | 80 ++++++++++--------- .../src/semantic-ui/ListTable.stories.js | 2 +- 2 files changed, 43 insertions(+), 39 deletions(-) diff --git a/packages/semantic-ui/src/components/DataTableColumnSelector.js b/packages/semantic-ui/src/components/DataTableColumnSelector.js index 749b0877..744af115 100644 --- a/packages/semantic-ui/src/components/DataTableColumnSelector.js +++ b/packages/semantic-ui/src/components/DataTableColumnSelector.js @@ -144,9 +144,7 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( {...this.props} className={`data-table-column-selector ${this.props.className}`} columns={this.state.columns} - renderListHeader={this.props.configurable - ? this.renderHeader.bind(this) - : undefined} + renderListHeader={this.renderHeader.bind(this)} /> ); } @@ -157,45 +155,51 @@ const useColumnSelector = (WrappedComponent: ComponentType) => ( * @returns {*} */ renderHeader() { + if (!(this.props.configurable || this.props.renderListHeader)) { + return null; + } + return ( <> { this.props.renderListHeader && this.props.renderListHeader() } - - - { this.state.columns - .filter((c) => c.label && c.label.length) - .map((c, index) => ( - - e.stopPropagation()} + { this.props.configurable && ( + + + { this.state.columns + .filter((c) => c.label && c.label.length) + .map((c, index) => ( + - - - - - ))} - - + e.stopPropagation()} + > + + + + + ))} + + + )} ); } diff --git a/packages/storybook/src/semantic-ui/ListTable.stories.js b/packages/storybook/src/semantic-ui/ListTable.stories.js index e50a7521..f30534c7 100644 --- a/packages/storybook/src/semantic-ui/ListTable.stories.js +++ b/packages/storybook/src/semantic-ui/ListTable.stories.js @@ -611,4 +611,4 @@ export const NoColumnSelector = useDragDrop(() => ( onSave={action('save')} searchable={boolean('Searchable', true)} /> -)); \ No newline at end of file +)); From ab0538c1b0344128662c79a4914f13bcbc6243a6 Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 19 Feb 2024 10:32:04 -0500 Subject: [PATCH 2/7] CDC #114 - Publishing v1.1.5-beta.0 --- packages/controlled-vocabulary/package.json | 6 +++--- packages/geospatial/package.json | 2 +- packages/semantic-ui/package.json | 4 ++-- packages/shared/package.json | 2 +- packages/user-defined-fields/package.json | 6 +++--- packages/visualize/package.json | 2 +- react-components.json | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 1ac3016e..fd327917 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./build/index.js", @@ -12,8 +12,8 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/semantic-components": "^1.1.3", - "@performant-software/shared-components": "^1.1.3", + "@performant-software/semantic-components": "^1.1.5-beta.0", + "@performant-software/shared-components": "^1.1.5-beta.0", "i18next": "^21.9.2", "semantic-ui-react": "^2.1.2", "underscore": "^1.13.2" diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index e37e47ea..648af243 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "TODO: ADD", "license": "MIT", "main": "./build/index.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index d4fa3d8a..d88052e1 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./build/index.js", @@ -12,7 +12,7 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/shared-components": "^1.1.3", + "@performant-software/shared-components": "^1.1.5-beta.0", "@react-google-maps/api": "^2.8.1", "axios": "^0.26.1", "i18next": "^19.4.4", diff --git a/packages/shared/package.json b/packages/shared/package.json index 222c7b6f..425601ac 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./build/index.js", diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 46b6a08b..3f88d9a5 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./build/index.js", @@ -9,8 +9,8 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/semantic-components": "^1.1.3", - "@performant-software/shared-components": "^1.1.3", + "@performant-software/semantic-components": "^1.1.5-beta.0", + "@performant-software/shared-components": "^1.1.5-beta.0", "i18next": "^21.9.1", "semantic-ui-react": "^2.1.2", "underscore": "^1.13.2" diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 8327c66a..bdd3e8ca 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "1.1.3", + "version": "1.1.5-beta.0", "description": "A package of components used for data visualization", "license": "MIT", "main": "./build/index.js", diff --git a/react-components.json b/react-components.json index 51141891..f2ea785a 100644 --- a/react-components.json +++ b/react-components.json @@ -7,5 +7,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "1.1.3" + "version": "1.1.5-beta.0" } From 630edff95d867389c192102baec9c5f6ef46551f Mon Sep 17 00:00:00 2001 From: dleadbetter <> Date: Mon, 19 Feb 2024 10:36:23 -0500 Subject: [PATCH 3/7] CDC #114 - Updating ItemsToggle component to use renderListHeader prop if provided --- .../semantic-ui/src/components/ItemsToggle.js | 10 +++---- .../src/semantic-ui/ItemList.stories.js | 26 +++++++++++++++++++ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/semantic-ui/src/components/ItemsToggle.js b/packages/semantic-ui/src/components/ItemsToggle.js index 53c753e8..7ba94d71 100644 --- a/packages/semantic-ui/src/components/ItemsToggle.js +++ b/packages/semantic-ui/src/components/ItemsToggle.js @@ -17,6 +17,7 @@ type Props = { defaultView?: number, hideToggle?: boolean, onSort?: (sortColumn: string, sortDirection?: ?string) => void, + renderListHeader?: () => JSX.Element, sort?: Array, sortColor?: string, sortColumn?: string, @@ -80,7 +81,7 @@ const useItemsToggle = (WrappedComponent: ComponentType) => ( * @returns {boolean|*} */ isHidden() { - return this.props.hideToggle && _.isEmpty(this.props.sort); + return this.props.hideToggle && _.isEmpty(this.props.sort) && !this.props.renderListHeader; } /** @@ -110,14 +111,10 @@ const useItemsToggle = (WrappedComponent: ComponentType) => ( * @returns {*} */ render() { - const renderListHeader = this.isHidden() - ? undefined - : this.renderHeader.bind(this); - return ( ); @@ -139,6 +136,7 @@ const useItemsToggle = (WrappedComponent: ComponentType) => ( return ( <> + { this.props.renderListHeader && this.props.renderListHeader() } { !this.props.hideToggle && ( <>