-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactoring: replace innerComponentRef with ref for Web Components #44
Conversation
…Button to new ref api
packages/base/package.json
Outdated
@@ -16,7 +16,7 @@ | |||
"core-js": "^3.1.4", | |||
"deepmerge": "^3.2.0", | |||
"hoist-non-react-statics": "^3.3.0", | |||
"react-jss": "^8.6.1", | |||
"react-jss": "^10.0.0-alpha.21", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should use a fixed version for the alpha release
"react-jss": "^10.0.0-alpha.21", | |
"react-jss": "10.0.0-alpha.21", |
@@ -29,75 +30,58 @@ export interface PopoverPropTypes extends WithWebComponentPropTypes { | |||
open?: boolean; | |||
} | |||
|
|||
export interface Ui5PopoverDomRef extends Ui5DomRef { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should move that to the interfaces folder and add a lib export
import { ClassProps } from '../../interfaces/ClassProps'; | ||
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps'; | ||
import { ButtonDesign } from '../../lib/ButtonDesign'; | ||
import { PlacementType } from '../../lib/PlacementType'; | ||
import { Popover } from '../../lib/Popover'; | ||
import { ButtonPropTypes } from '../../webComponents/Button'; | ||
import styles from './ActionSheet.jss'; | ||
import { Ui5PopoverDomRef } from '../../webComponents/Popover'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After moving this interface, please import from lib
folder
@@ -1,12 +1,13 @@ | |||
import { Device, StyleClassHelper, withStyles } from '@ui5/webcomponents-react-base'; | |||
import React, { Children, cloneElement, Component, ReactElement, ReactNode } from 'react'; | |||
import React, { Children, cloneElement, Component, ReactElement, ReactNode, RefObject } from 'react'; | |||
import { ClassProps } from '../../interfaces/ClassProps'; | |||
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps'; | |||
import { ButtonDesign } from '../../lib/ButtonDesign'; | |||
import { PlacementType } from '../../lib/PlacementType'; | |||
import { Popover } from '../../lib/Popover'; | |||
import { ButtonPropTypes } from '../../webComponents/Button'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { ButtonPropTypes } from '../../webComponents/Button'; | |
import { ButtonPropTypes } from '../../lib/Button'; |
@@ -13,6 +13,7 @@ import { StandardListItem } from '../../../lib/StandardListItem'; | |||
import { Icon } from '../../../webComponents/Icon'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import { Icon } from '../../../webComponents/Icon'; | |
import { Icon } from '../../../lib/Icon'; |
@@ -13,6 +13,7 @@ import { StandardListItem } from '../../../lib/StandardListItem'; | |||
import { Icon } from '../../../webComponents/Icon'; | |||
import { FlexBox, FlexBoxAlignItems } from '../../FlexBox'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not your change, but just saw it
import { FlexBox, FlexBoxAlignItems } from '../../FlexBox'; | |
import { FlexBox } from '../../lib/FlexBox'; | |
import { FlexBoxAlignItems } from '../../lib/FlexBoxAlignItems'; |
@@ -13,6 +13,7 @@ import { StandardListItem } from '../../../lib/StandardListItem'; | |||
import { Icon } from '../../../webComponents/Icon'; | |||
import { FlexBox, FlexBoxAlignItems } from '../../FlexBox'; | |||
import { ColumnType } from '../types/ColumnType'; | |||
import { Ui5PopoverDomRef } from '../../../webComponents/Popover'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Import from lib then
import { withWebComponent, WithWebComponentPropTypes } from '../../internal/withWebComponent'; | ||
import { PlacementType } from '../../lib/PlacementType'; | ||
import { PopoverHorizontalAlign } from '../../lib/PopoverHorizontalAlign'; | ||
import { PopoverVerticalAlign } from '../../lib/PopoverVerticalAlign'; | ||
import { Ui5DomRef } from '../../interfaces/Ui5DomRef'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe also from lib
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚢
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [npm-run-all2](https://github.com/bcomnes/npm-run-all2) | [`^5.0.0` -> `^6.0.0`](https://renovatebot.com/diffs/npm/npm-run-all2/5.0.2/6.1.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/npm-run-all2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/npm-run-all2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/npm-run-all2/5.0.2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/npm-run-all2/5.0.2/6.1.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>bcomnes/npm-run-all2 (npm-run-all2)</summary> ### [`v6.1.1`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v611) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.1.0...v6.1.1) ##### Commits - Add an npm-run-all2 bin alias [`e6dc017`](https://github.com/bcomnes/npm-run-all2/commit/e6dc0175006a9a703c1256949f8424922043a33a) - Fix npx on node 16 [`cfbd974`](https://github.com/bcomnes/npm-run-all2/commit/cfbd974a5990e8d549ae8bf7bfb632424ff4990b) ### [`v6.1.0`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v610---2023-10-04) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.6...v6.1.0) ##### Merged - Upgrade: Bump actions/checkout from 3 to 4 [`#119`](https://github.com/bcomnes/npm-run-all2/pull/119) ##### Commits - Lets avoid spawn.sync [`a3ee6cd`](https://github.com/bcomnes/npm-run-all2/commit/a3ee6cd9e051471bfd7b1b4d153aa260fc9b6634) - Add support for pnpm ([#​117](https://github.com/bcomnes/npm-run-all2/issues/117)) [`3df3708`](https://github.com/bcomnes/npm-run-all2/commit/3df37084ab1ae55f873fcbb449ad0d7df8bc328f) ### [`v6.0.6`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v606---2023-07-04) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.5...v6.0.6) ##### Merged - Update all esm only packages [`#114`](https://github.com/bcomnes/npm-run-all2/pull/114) - Upgrade: Bump c8 from 7.14.0 to 8.0.0 [`#111`](https://github.com/bcomnes/npm-run-all2/pull/111) - Delete .nycrc [`#109`](https://github.com/bcomnes/npm-run-all2/pull/109) - Update CodeQL workflow [`#110`](https://github.com/bcomnes/npm-run-all2/pull/110) ##### Commits - Lint fix and a few hand fixes [`2c81236`](https://github.com/bcomnes/npm-run-all2/commit/2c8123694b73084f37b68eb6719632024331d2e9) - Fix tests [`79e2c97`](https://github.com/bcomnes/npm-run-all2/commit/79e2c97c5b32c46d5cf64ce37b3b78cf4035498e) - Update p-queue and ansi-styles [`10b075c`](https://github.com/bcomnes/npm-run-all2/commit/10b075c849153822e9abc1447222d186a1cd6136) ### [`v6.0.5`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v605---2023-04-03) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.4...v6.0.5) ##### Merged - Upgrade: Bump bcomnes/npm-bump from 2.1.0 to 2.2.1 [`#104`](https://github.com/bcomnes/npm-run-all2/pull/104) - Upgrade: Bump minimatch from 6.2.0 to 7.0.0 [`#103`](https://github.com/bcomnes/npm-run-all2/pull/103) - Upgrade: Bump minimatch from 5.1.4 to 6.0.4 [`#102`](https://github.com/bcomnes/npm-run-all2/pull/102) - Upgrade: Bump fs-extra from 10.1.0 to 11.1.0 [`#98`](https://github.com/bcomnes/npm-run-all2/pull/98) ##### Commits - Merge pull request [#​105](https://github.com/bcomnes/npm-run-all2/issues/105) from bcomnes/dependabot/npm_and_yarn/minimatch-8.0.2 [`cbf78c8`](https://github.com/bcomnes/npm-run-all2/commit/cbf78c8155365db9ec06cb8054bc821e057d06e2) - Upgrade: Bump minimatch from 7.4.4 to 8.0.2 [`c90d02b`](https://github.com/bcomnes/npm-run-all2/commit/c90d02b02df6dd33cbab01caac44b9729e012bb9) - Merge pull request [#​101](https://github.com/bcomnes/npm-run-all2/issues/101) from bcomnes/dependabot/npm_and_yarn/rimraf-4.0.4 [`d0d46a2`](https://github.com/bcomnes/npm-run-all2/commit/d0d46a2b0aa87a3c0c79b78a013415e7902c8324) ### [`v6.0.4`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v604---2022-11-09) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.3...v6.0.4) ##### Merged - When running through npx, use the npm that should be next to it. [`#96`](https://github.com/bcomnes/npm-run-all2/pull/96) ### [`v6.0.3`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v603---2022-11-09) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.2...v6.0.3) ##### Merged - Upgrade: Bump jsdoc from 3.6.11 to 4.0.0 [`#95`](https://github.com/bcomnes/npm-run-all2/pull/95) - Upgrade: Bump bcomnes/npm-bump from 2.0.2 to 2.1.0 [`#92`](https://github.com/bcomnes/npm-run-all2/pull/92) - docs: update minimum supported Node version [`#90`](https://github.com/bcomnes/npm-run-all2/pull/90) ##### Commits - Merge pull request [#​94](https://github.com/bcomnes/npm-run-all2/issues/94) from MarmadileManteater/runjs-being-called-instead-of-npm-run [`da913f9`](https://github.com/bcomnes/npm-run-all2/commit/da913f9481543907457bd2298ad17192a4420874) - Use NPM_CLI_JS over npm_execpath [`0224167`](https://github.com/bcomnes/npm-run-all2/commit/022416740f0d9cf8eae2f2e4ca4de8d09a6b67d8) - Add a proper check for yarn [`bb41ef6`](https://github.com/bcomnes/npm-run-all2/commit/bb41ef6fd85a803a4a22e8382f67ea9e3e235b7d) ### [`v6.0.2`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v602---2022-08-16) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.1...v6.0.2) ##### Merged - Update package shell quote [`#89`](https://github.com/bcomnes/npm-run-all2/pull/89) ### [`v6.0.1`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v601---2022-06-14) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v6.0.0...v6.0.1) ##### Commits - Lower bound node engine to ^14.18.0 || >=16.0.0 [`fc2957f`](https://github.com/bcomnes/npm-run-all2/commit/fc2957f4814848b55bc29b0a0a1def8bfadda18b) ### [`v6.0.0`](https://github.com/bcomnes/npm-run-all2/blob/HEAD/CHANGELOG.md#v600---2022-06-11) [Compare Source](https://github.com/bcomnes/npm-run-all2/compare/v5.0.2...v6.0.0) ##### Merged - Move support to node 16 and npm 8 [`#85`](https://github.com/bcomnes/npm-run-all2/pull/85) - Upgrade: Bump pidtree from 0.5.0 to 0.6.0 [`#84`](https://github.com/bcomnes/npm-run-all2/pull/84) - Upgrade: Bump mocha from 9.2.2 to 10.0.0 [`#83`](https://github.com/bcomnes/npm-run-all2/pull/83) - Upgrade: Bump github/codeql-action from 1 to 2 [`#82`](https://github.com/bcomnes/npm-run-all2/pull/82) - Upgrade: Bump fastify/github-action-merge-dependabot from 3.0.2 to 3.1 [`#78`](https://github.com/bcomnes/npm-run-all2/pull/78) - Upgrade: Bump codecov/codecov-action from 2 to 3 [`#77`](https://github.com/bcomnes/npm-run-all2/pull/77) - Upgrade: Bump actions/setup-node from 2 to 3 [`#75`](https://github.com/bcomnes/npm-run-all2/pull/75) - Upgrade: Bump actions/checkout from 2 to 3 [`#76`](https://github.com/bcomnes/npm-run-all2/pull/76) - Upgrade: Bump minimatch from 4.2.1 to 5.0.0 [`#74`](https://github.com/bcomnes/npm-run-all2/pull/74) - Upgrade: Bump minimatch from 3.1.1 to 4.1.1 [`#73`](https://github.com/bcomnes/npm-run-all2/pull/73) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.7.1 to 3.0.2 [`#72`](https://github.com/bcomnes/npm-run-all2/pull/72) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.7.0 to 2.7.1 [`#71`](https://github.com/bcomnes/npm-run-all2/pull/71) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.6.0 to 2.7.0 [`#70`](https://github.com/bcomnes/npm-run-all2/pull/70) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.5.0 to 2.6.0 [`#69`](https://github.com/bcomnes/npm-run-all2/pull/69) - Simplify npm scripts [`#64`](https://github.com/bcomnes/npm-run-all2/pull/64) - Update CI config [`#62`](https://github.com/bcomnes/npm-run-all2/pull/62) - Add CodeQL workflow [`#65`](https://github.com/bcomnes/npm-run-all2/pull/65) - Switch to c8 for coverage [`#66`](https://github.com/bcomnes/npm-run-all2/pull/66) - tests: switch to assert's strict mode [`#67`](https://github.com/bcomnes/npm-run-all2/pull/67) - Enforce LF in the repo. [`#61`](https://github.com/bcomnes/npm-run-all2/pull/61) - Upgrade: Bump actions/setup-node from 2.4.0 to 2.4.1 [`#59`](https://github.com/bcomnes/npm-run-all2/pull/59) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.4.0 to 2.5.0 [`#58`](https://github.com/bcomnes/npm-run-all2/pull/58) - Upgrade: Bump codecov/codecov-action from 2.0.2 to 2.1.0 [`#57`](https://github.com/bcomnes/npm-run-all2/pull/57) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.2.0 to 2.4.0 [`#54`](https://github.com/bcomnes/npm-run-all2/pull/54) - Upgrade: Bump actions/setup-node from 2.3.2 to 2.4.0 [`#53`](https://github.com/bcomnes/npm-run-all2/pull/53) - Upgrade: Bump actions/setup-node from 2.3.1 to 2.3.2 [`#52`](https://github.com/bcomnes/npm-run-all2/pull/52) - Upgrade: Bump actions/setup-node from 2.3.0 to 2.3.1 [`#51`](https://github.com/bcomnes/npm-run-all2/pull/51) - Upgrade: Bump codecov/codecov-action from 2.0.1 to 2.0.2 [`#50`](https://github.com/bcomnes/npm-run-all2/pull/50) - Upgrade: Bump actions/setup-node from 2.2.0 to 2.3.0 [`#49`](https://github.com/bcomnes/npm-run-all2/pull/49) - Upgrade: Bump codecov/codecov-action from 1.5.2 to 2.0.1 [`#48`](https://github.com/bcomnes/npm-run-all2/pull/48) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.1.1 to 2.2.0 [`#47`](https://github.com/bcomnes/npm-run-all2/pull/47) - Upgrade: Bump actions/setup-node from 2.1.5 to 2.2.0 [`#46`](https://github.com/bcomnes/npm-run-all2/pull/46) - Upgrade: Bump codecov/codecov-action from 1.5.0 to 1.5.2 [`#44`](https://github.com/bcomnes/npm-run-all2/pull/44) - Upgrade: Bump mocha from 8.4.0 to 9.0.0 [`#43`](https://github.com/bcomnes/npm-run-all2/pull/43) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.1.0 to 2.1.1 [`#42`](https://github.com/bcomnes/npm-run-all2/pull/42) - Upgrade: Bump fastify/github-action-merge-dependabot from 2.0.0 to 2.1.0 [`#41`](https://github.com/bcomnes/npm-run-all2/pull/41) - Upgrade: Bump gh-release from 5.0.2 to 6.0.0 [`#40`](https://github.com/bcomnes/npm-run-all2/pull/40) - Upgrade: Bump codecov/codecov-action from 1 to 1.5.0 [`#39`](https://github.com/bcomnes/npm-run-all2/pull/39) - Upgrade: Bump fs-extra from 9.1.0 to 10.0.0 [`#38`](https://github.com/bcomnes/npm-run-all2/pull/38) - Upgrade: Bump fastify/github-action-merge-dependabot from v1.2.1 to v2.0.0 [`#33`](https://github.com/bcomnes/npm-run-all2/pull/33) - Upgrade: Bump fastify/github-action-merge-dependabot [`#32`](https://github.com/bcomnes/npm-run-all2/pull/32) - Upgrade: Bump fastify/github-action-merge-dependabot from v1.1.1 to v1.2.0 [`#31`](https://github.com/bcomnes/npm-run-all2/pull/31) - Upgrade: Bump actions/setup-node from v2.1.4 to v2.1.5 [`#30`](https://github.com/bcomnes/npm-run-all2/pull/30) - Upgrade: Bump gh-release from 4.0.4 to 5.0.0 [`#29`](https://github.com/bcomnes/npm-run-all2/pull/29) - Upgrade: Bump actions/setup-node from v2.1.3 to v2.1.4 [`#28`](https://github.com/bcomnes/npm-run-all2/pull/28) - Upgrade: Bump actions/setup-node from v2.1.2 to v2.1.3 [`#27`](https://github.com/bcomnes/npm-run-all2/pull/27) ##### Fixed - Disable override tests on > npm 7 [`#79`](https://github.com/bcomnes/npm-run-all2/issues/79) ##### Commits - **Breaking change:** Bump engines to node 16 and npm 8 [`7d19dd4`](https://github.com/bcomnes/npm-run-all2/commit/7d19dd47ee70286878f380934d18823310355471) - Add auto merge [`e598066`](https://github.com/bcomnes/npm-run-all2/commit/e598066fea7478e0fce14b4f09d64fdf37b0420f) - Update test.yml [`96260d6`](https://github.com/bcomnes/npm-run-all2/commit/96260d6c088ce0aa2bd367ff0736d653f5b0b1f1) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/SAP/ui5-webcomponents-react). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNTMuMiIsInVwZGF0ZWRJblZlciI6IjM3LjE1My4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Refactored WithWebComponent to functional Component to be able to use ForwardRef
Refactored all components to use current React ref api (React.createRef / useRef)
Breaking Changes