From 2c096150e387bfb7323d2ce2d050b196df785682 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 13:57:47 +0200 Subject: [PATCH 1/6] chore(WrapperGeneration): fixed default slot handling --- packages/main/scripts/wrapperGeneration/generateTypingsWeb.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/main/scripts/wrapperGeneration/generateTypingsWeb.js b/packages/main/scripts/wrapperGeneration/generateTypingsWeb.js index 243b3630fc6..1a41c88a193 100644 --- a/packages/main/scripts/wrapperGeneration/generateTypingsWeb.js +++ b/packages/main/scripts/wrapperGeneration/generateTypingsWeb.js @@ -136,7 +136,7 @@ const reactNodeType = { function parseSlots(meta, typings) { Object.entries(meta.slots).forEach(([slotKey, slot]) => { const typeMeta = mappings[slot.type]; - let propKey = slotKey === meta.defaultSlot ? 'children' : slotKey; + let propKey = slotKey === 'default' ? 'children' : slotKey; if (typeMeta) { typings[propKey] = { From ecc1e03d402d2b38b219561dabdd6c5f090e47ed Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 14:12:27 +0200 Subject: [PATCH 2/6] feat(WebComponents): Updated to v1.0.0-rc.2 BREAKING CHANGE **ShellBarItem**: prop `onPress` is renamed to `onClick` BREAKING CHANGE **Dialog**: remove prop `noHeader` BREAKING CHANGE **Popup**: remove prop `noHeader` --- .../main/__karma_snapshots__/ActionSheet.md | 6 +-- .../__karma_snapshots__/AnalyticalTable.md | 48 +++++++++---------- packages/main/__karma_snapshots__/Icon.md | 4 +- .../main/__karma_snapshots__/ObjectPage.md | 24 +++++----- .../main/__karma_snapshots__/ShellBarItem.md | 4 +- packages/main/package.json | 2 +- .../main/src/components/ActionSheet/index.tsx | 9 +--- .../columnHeader/ColumnHeaderModal.tsx | 1 - .../ObjectPage/ObjectPageAnchor.tsx | 1 - .../src/components/ThemeProvider/index.tsx | 4 +- .../main/src/webComponents/Button/index.tsx | 2 +- .../main/src/webComponents/Icon/index.tsx | 4 -- .../src/webComponents/MultiComboBox/index.tsx | 2 +- .../webComponents/Popover/demo.stories.tsx | 1 - .../main/src/webComponents/Popover/index.tsx | 1 - .../main/src/webComponents/Popup/index.tsx | 3 +- .../src/webComponents/ShellBarItem/index.tsx | 6 +-- yarn.lock | 32 ++++++------- 18 files changed, 67 insertions(+), 87 deletions(-) diff --git a/packages/main/__karma_snapshots__/ActionSheet.md b/packages/main/__karma_snapshots__/ActionSheet.md index 86b2812a780..5e06772dafb 100644 --- a/packages/main/__karma_snapshots__/ActionSheet.md +++ b/packages/main/__karma_snapshots__/ActionSheet.md @@ -8,14 +8,14 @@ - +
- - + +
    diff --git a/packages/main/__karma_snapshots__/AnalyticalTable.md b/packages/main/__karma_snapshots__/AnalyticalTable.md index fdf9f72c702..4d8f797204a 100644 --- a/packages/main/__karma_snapshots__/AnalyticalTable.md +++ b/packages/main/__karma_snapshots__/AnalyticalTable.md @@ -32,7 +32,7 @@ - +
    @@ -44,8 +44,8 @@
    - - + + @@ -71,7 +71,7 @@ - +
    @@ -83,8 +83,8 @@
    - - + + @@ -110,7 +110,7 @@ - +
    @@ -122,8 +122,8 @@
    - - + + @@ -149,7 +149,7 @@ - +
    @@ -163,8 +163,8 @@
    - - + + @@ -625,7 +625,7 @@ - +
    @@ -637,8 +637,8 @@
    - - + + @@ -664,7 +664,7 @@ - +
    @@ -676,8 +676,8 @@
    - - + + @@ -703,7 +703,7 @@ - +
    @@ -715,8 +715,8 @@
    - - + + @@ -742,7 +742,7 @@ - +
    @@ -756,8 +756,8 @@
    - - + + diff --git a/packages/main/__karma_snapshots__/Icon.md b/packages/main/__karma_snapshots__/Icon.md index 0617491a5bb..c94ce91fd96 100644 --- a/packages/main/__karma_snapshots__/Icon.md +++ b/packages/main/__karma_snapshots__/Icon.md @@ -6,8 +6,8 @@ - - + + diff --git a/packages/main/__karma_snapshots__/ObjectPage.md b/packages/main/__karma_snapshots__/ObjectPage.md index ceb57e1d79b..2a2c5ce7276 100644 --- a/packages/main/__karma_snapshots__/ObjectPage.md +++ b/packages/main/__karma_snapshots__/ObjectPage.md @@ -109,14 +109,14 @@ - +
    - - + + @@ -145,14 +145,14 @@ - +
    - - + + @@ -610,14 +610,14 @@ - +
    - - + + @@ -646,14 +646,14 @@ - +
    - - + + diff --git a/packages/main/__karma_snapshots__/ShellBarItem.md b/packages/main/__karma_snapshots__/ShellBarItem.md index 71dbf6250be..7877de5d9d7 100644 --- a/packages/main/__karma_snapshots__/ShellBarItem.md +++ b/packages/main/__karma_snapshots__/ShellBarItem.md @@ -6,8 +6,8 @@ - - + + diff --git a/packages/main/package.json b/packages/main/package.json index 7c98be743da..75ad54fc9cf 100644 --- a/packages/main/package.json +++ b/packages/main/package.json @@ -20,7 +20,7 @@ "test:karma:update": "cross-env UPDATE=1 yarn run test:karma" }, "dependencies": { - "@ui5/webcomponents": "1.0.0-rc.1", + "@ui5/webcomponents": "1.0.0-rc.2", "@ui5/webcomponents-react-base": "0.3.2-rc.10", "react-scroll": "^1.7.11", "react-table": "6.8.6", diff --git a/packages/main/src/components/ActionSheet/index.tsx b/packages/main/src/components/ActionSheet/index.tsx index cf358443267..b541ffffb7f 100644 --- a/packages/main/src/components/ActionSheet/index.tsx +++ b/packages/main/src/components/ActionSheet/index.tsx @@ -60,14 +60,7 @@ export class ActionSheet extends Component { } return ( - +
      {Children.map(children, (child: ReactElement) => this.renderActionSheetButton(child))}
    diff --git a/packages/main/src/components/AnalyticalTable/columnHeader/ColumnHeaderModal.tsx b/packages/main/src/components/AnalyticalTable/columnHeader/ColumnHeaderModal.tsx index 6252e757d17..7f44730e262 100644 --- a/packages/main/src/components/AnalyticalTable/columnHeader/ColumnHeaderModal.tsx +++ b/packages/main/src/components/AnalyticalTable/columnHeader/ColumnHeaderModal.tsx @@ -78,7 +78,6 @@ export class ColumnHeaderModal extends Component { {this.props.section.props.children diff --git a/packages/main/src/components/ThemeProvider/index.tsx b/packages/main/src/components/ThemeProvider/index.tsx index ba95ba87538..648b1538167 100644 --- a/packages/main/src/components/ThemeProvider/index.tsx +++ b/packages/main/src/components/ThemeProvider/index.tsx @@ -2,7 +2,7 @@ import { createGenerateClassName, sap_fiori_3 } from '@ui5/webcomponents-react-b import boot from '@ui5/webcomponents-base/src/boot'; import { getCompactSize, getTheme } from '@ui5/webcomponents-base/src/Configuration'; import { injectThemeProperties } from '@ui5/webcomponents-base/src/theming/StyleInjection'; -import fiori3ThemeProperties from '@ui5/webcomponents/dist/themes/sap_fiori_3/parameters-bundle.css.js'; +import fiori3ThemeProperties from '@ui5/webcomponents/dist/themes/sap_fiori_3/parameters-bundle.css.json'; import React, { Fragment, PureComponent, ReactNode } from 'react'; import { JssProvider, ThemeProvider as ReactJssThemeProvider } from 'react-jss'; import { ContentDensity } from '../../lib/ContentDensity'; @@ -25,7 +25,7 @@ export class ThemeProvider extends PureComponent { super(props); // inject default CSS custom parameters in head boot().then((_) => { - injectThemeProperties(fiori3ThemeProperties); + injectThemeProperties(fiori3ThemeProperties._); }); } diff --git a/packages/main/src/webComponents/Button/index.tsx b/packages/main/src/webComponents/Button/index.tsx index c7fa747337b..e1aac08fe4e 100644 --- a/packages/main/src/webComponents/Button/index.tsx +++ b/packages/main/src/webComponents/Button/index.tsx @@ -11,7 +11,7 @@ export interface ButtonPropTypes extends WithWebComponentPropTypes { iconEnd?: boolean; // @generated submits?: boolean; // @generated onClick?: (event: Event) => void; // @generated - default?: string; // @generated + children?: string; // @generated } const Button: FC = withWebComponent(UI5Button); diff --git a/packages/main/src/webComponents/Icon/index.tsx b/packages/main/src/webComponents/Icon/index.tsx index 3b715d9055d..ff5441d40c8 100644 --- a/packages/main/src/webComponents/Icon/index.tsx +++ b/packages/main/src/webComponents/Icon/index.tsx @@ -12,8 +12,4 @@ const Icon: FC = withWebComponent(UI5Icon); Icon.displayName = 'Icon'; -Icon.defaultProps = { - src: null // @generated -}; - export { Icon }; diff --git a/packages/main/src/webComponents/MultiComboBox/index.tsx b/packages/main/src/webComponents/MultiComboBox/index.tsx index f614ebd0dc5..a86904bed19 100644 --- a/packages/main/src/webComponents/MultiComboBox/index.tsx +++ b/packages/main/src/webComponents/MultiComboBox/index.tsx @@ -1,5 +1,5 @@ import { Event } from '@ui5/webcomponents-react-base'; -import '@ui5/webcomponents/dist/InputSuggestions'; +import '@ui5/webcomponents/dist/features/InputSuggestions'; import UI5MultiComboBox from '@ui5/webcomponents/dist/MultiComboBox'; import React, { FC, ReactNode } from 'react'; import { withWebComponent, WithWebComponentPropTypes } from '../../internal/withWebComponent'; diff --git a/packages/main/src/webComponents/Popover/demo.stories.tsx b/packages/main/src/webComponents/Popover/demo.stories.tsx index 8312226f2cf..de47c2aacfd 100644 --- a/packages/main/src/webComponents/Popover/demo.stories.tsx +++ b/packages/main/src/webComponents/Popover/demo.stories.tsx @@ -10,7 +10,6 @@ import { PopoverVerticalAlign } from '../../lib/PopoverVerticalAlign'; storiesOf('UI5 Web Components | Popover', module).add('Default', () => ( void; // @generated onAfterOpen?: (event: Event) => void; // @generated onBeforeClose?: (event: Event) => void; // @generated onAfterClose?: (event: Event) => void; // @generated - content?: ReactNode[]; // @generated + children?: any; // @generated header?: ReactNode; // @generated footer?: ReactNode; // @generated } diff --git a/packages/main/src/webComponents/ShellBarItem/index.tsx b/packages/main/src/webComponents/ShellBarItem/index.tsx index 0f28421a819..231f06d8032 100644 --- a/packages/main/src/webComponents/ShellBarItem/index.tsx +++ b/packages/main/src/webComponents/ShellBarItem/index.tsx @@ -6,15 +6,11 @@ import { withWebComponent, WithWebComponentPropTypes } from '../../internal/with export interface ShellBarItemPropTypes extends WithWebComponentPropTypes { src?: string; // @generated text?: string; // @generated - onPress?: (event: Event) => void; // @generated + onItemClick?: (event: Event) => void; // @generated } const ShellBarItem: FC = withWebComponent(UI5ShellBarItem); ShellBarItem.displayName = 'ShellBarItem'; -ShellBarItem.defaultProps = { - src: null // @generated -}; - export { ShellBarItem }; diff --git a/yarn.lock b/yarn.lock index cce4dde000b..328992e51d1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2720,7 +2720,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@16.8.19", "@types/react@^16.8.19": +"@types/react@*", "@types/react@^16.8.19": version "16.8.19" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.19.tgz#629154ef05e2e1985cdde94477deefd823ad9be3" integrity sha512-QzEzjrd1zFzY9cDlbIiFvdr+YUmefuuRYrPxmkwG0UQv5XF35gFIi7a95m1bNVcFU0VimxSZ5QVGSiBmlggQXQ== @@ -2785,28 +2785,28 @@ resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-12.0.12.tgz#45dd1d0638e8c8f153e87d296907659296873916" integrity sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw== -"@ui5/webcomponents-base@0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@ui5/webcomponents-base/-/webcomponents-base-0.14.0.tgz#05a42308959a31b2e0585eec638a3c0066577e2b" - integrity sha512-nYx1BMIDhCT+nQZE25M8PSGWrU0JjEpdIhGexWqnmKXKycMYJEsyxmTYJggiBlnur7gY/oMtaJTujVsS2IIw3Q== +"@ui5/webcomponents-base@0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@ui5/webcomponents-base/-/webcomponents-base-0.15.0.tgz#331b2cb577bc9b3eaae6ac79cc50965c184bf565" + integrity sha512-djR0i6COEIs6j5q/iLMgpk/xALohk/eV9UHdjV03kL2Augtl/+jv1MWIszb1/+q1xXDK8ZtD/yXCo542Syd8rg== dependencies: - "@ui5/webcomponents-core" "0.14.0" + "@ui5/webcomponents-core" "0.15.0" lit-html "^1.0.0" regenerator-runtime "0.12.1" url-search-params-polyfill "^5.0.0" -"@ui5/webcomponents-core@0.14.0": - version "0.14.0" - resolved "https://registry.yarnpkg.com/@ui5/webcomponents-core/-/webcomponents-core-0.14.0.tgz#c7827b0093470bbbb868e76cf60cf630628f1c53" - integrity sha512-sQYL5JJ0W0e+GFmUTPX5YYrwXJJhrUVDCCu9PSXL5+gxWwzqvr4Egfgd5pYPMNI362uRBLsTzmVTktclwW6mWw== +"@ui5/webcomponents-core@0.15.0": + version "0.15.0" + resolved "https://registry.yarnpkg.com/@ui5/webcomponents-core/-/webcomponents-core-0.15.0.tgz#13b7f4fb014e121e5e9e377f5a1277f183bc6838" + integrity sha512-3Q0hYYgyRmmHt/1UYxFlKH/k2PvC7/MwbQOGMQzf56D0FTv28HtSuh9MtaT3Ls+nkggHp1Y7008qECohXhBcRw== -"@ui5/webcomponents@1.0.0-rc.1": - version "1.0.0-rc.1" - resolved "https://registry.yarnpkg.com/@ui5/webcomponents/-/webcomponents-1.0.0-rc.1.tgz#7781a1d2fd7fd92375e002d462d2c661102a8fc3" - integrity sha512-abhs/oNMWR5ZmtzZ9e5NSnaMr9bwXr58vuCJv2igrkfihS41Iur3/OiehopcYsLVWlJ6zeu1HVDqu0K+JaF0+g== +"@ui5/webcomponents@1.0.0-rc.2": + version "1.0.0-rc.2" + resolved "https://registry.yarnpkg.com/@ui5/webcomponents/-/webcomponents-1.0.0-rc.2.tgz#c8f6a0c5688b6808103263dc9c35aeeb1ad128db" + integrity sha512-uis6wKlOoKt93MCzrrCKu7J0FrddCX9xcU/uKbFEt4nX4dGxB1i7qHn456omRZ05WpIrSqh3hEjrUKXIzeIpTQ== dependencies: - "@ui5/webcomponents-base" "0.14.0" - "@ui5/webcomponents-core" "0.14.0" + "@ui5/webcomponents-base" "0.15.0" + "@ui5/webcomponents-core" "0.15.0" "@webassemblyjs/ast@1.8.5": version "1.8.5" From 959daf5087f864be54883953745c7990e1f048c9 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 14:12:51 +0200 Subject: [PATCH 3/6] WIP: Updated bundle sizes --- scripts/rollup/results.json | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/scripts/rollup/results.json b/scripts/rollup/results.json index 75c68fb79aa..a684369d74c 100644 --- a/scripts/rollup/results.json +++ b/scripts/rollup/results.json @@ -60,29 +60,29 @@ "filename": "main.development.js", "bundleType": "NODE_ES_DEV", "packageName": "main", - "size": 182033, - "gzip": 32207 + "size": 181621, + "gzip": 32186 }, { "filename": "main.production.min.js", "bundleType": "NODE_ES_PROD", "packageName": "main", - "size": 182033, - "gzip": 32207 + "size": 181621, + "gzip": 32186 }, { "filename": "main.development.js", "bundleType": "NODE_DEV", "packageName": "main", - "size": 187506, - "gzip": 32311 + "size": 187094, + "gzip": 32292 }, { "filename": "main.production.min.js", "bundleType": "NODE_PROD", "packageName": "main", - "size": 96047, - "gzip": 24646 + "size": 95638, + "gzip": 24608 } ] } \ No newline at end of file From 4a6df9cb0cd2f1eb5c24c4d8ab18ce5ba45aa588 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 14:23:30 +0200 Subject: [PATCH 4/6] docs: Updated Storybook Prop Table --- packages/docs/.storybook/TableComponent.tsx | 37 +++++++++++++-------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/packages/docs/.storybook/TableComponent.tsx b/packages/docs/.storybook/TableComponent.tsx index da24a9203c8..16246fa1a39 100644 --- a/packages/docs/.storybook/TableComponent.tsx +++ b/packages/docs/.storybook/TableComponent.tsx @@ -2,27 +2,36 @@ import { Badge, Label, Table, TableCell, TableColumn, TableRow, Text, ThemeProvi import React from 'react'; const columns = [ - Prop} width="150px" />, - PropType} width="150px" />, - Required} width="80px" />, - Default Value} width="100px" />, - Description} /> + + + , + + + , + + + , + + + , + + + ]; export const TableComponent = (props) => { const info = props.type.__docgenInfo; - if (!info || !info.props) { - return ( - - Unfortunately, there are no prop types available for this component. - - ); - } + + const componentProps = info && info.props; + return ( ( + > + {Object.values(componentProps || {}).map((componentInfo: any) => ( {componentInfo.name} @@ -37,7 +46,7 @@ export const TableComponent = (props) => { ))} - /> +
    ); }; From e90d5514b497d30dbd361b6a55fafc62a02904dc Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 14:34:04 +0200 Subject: [PATCH 5/6] fix(ChartContainer): Remove style function and replace with object --- .../ChartContainer/withChartContainer.tsx | 4 +- packages/docs/.storybook/TableComponent.tsx | 46 +++++++++---------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/packages/charts/src/components/ChartContainer/withChartContainer.tsx b/packages/charts/src/components/ChartContainer/withChartContainer.tsx index 4c8339e963b..b218a1460da 100644 --- a/packages/charts/src/components/ChartContainer/withChartContainer.tsx +++ b/packages/charts/src/components/ChartContainer/withChartContainer.tsx @@ -6,7 +6,7 @@ import { ChartBaseProps } from '../../interfaces/ChartBaseProps'; import { mergeConfig } from '../../util/utils'; import { Loader } from '../Loader'; -const styles = () => ({ +const styles = { chart: { position: 'relative', paddingTop: '6px', @@ -21,7 +21,7 @@ const styles = () => ({ height: (props) => `${props.height}px` } } -}); +}; export const withChartContainer = (Component: ComponentType) => { const ChartContainer = (props) => { diff --git a/packages/docs/.storybook/TableComponent.tsx b/packages/docs/.storybook/TableComponent.tsx index 16246fa1a39..e260b643231 100644 --- a/packages/docs/.storybook/TableComponent.tsx +++ b/packages/docs/.storybook/TableComponent.tsx @@ -1,4 +1,4 @@ -import { Badge, Label, Table, TableCell, TableColumn, TableRow, Text, ThemeProvider } from '@ui5/webcomponents-react'; +import { Badge, Label, Table, TableCell, TableColumn, TableRow, Text } from '@ui5/webcomponents-react'; import React from 'react'; const columns = [ @@ -25,28 +25,26 @@ export const TableComponent = (props) => { const componentProps = info && info.props; return ( - - - {Object.values(componentProps || {}).map((componentInfo: any) => ( - - - {componentInfo.name} - - - {componentInfo.type.name} - - {componentInfo.required && Yes} - {componentInfo.defaultValue && {componentInfo.defaultValue.value}} - - {componentInfo.description} - - - ))} -
    -
    + + {Object.values(componentProps || {}).map((componentInfo: any) => ( + + + {componentInfo.name} + + + {componentInfo.type.name} + + {componentInfo.required && Yes} + {componentInfo.defaultValue && {componentInfo.defaultValue.value}} + + {componentInfo.description} + + + ))} +
    ); }; From 40301d3607973fa1f2d64f3a40a3a489207d17b6 Mon Sep 17 00:00:00 2001 From: MarcusNotheis Date: Thu, 4 Jul 2019 14:37:42 +0200 Subject: [PATCH 6/6] WIP: Update lock file --- yarn.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yarn.lock b/yarn.lock index 328992e51d1..658361c0cd0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2720,7 +2720,7 @@ dependencies: "@types/react" "*" -"@types/react@*", "@types/react@^16.8.19": +"@types/react@*", "@types/react@16.8.19", "@types/react@^16.8.19": version "16.8.19" resolved "https://registry.yarnpkg.com/@types/react/-/react-16.8.19.tgz#629154ef05e2e1985cdde94477deefd823ad9be3" integrity sha512-QzEzjrd1zFzY9cDlbIiFvdr+YUmefuuRYrPxmkwG0UQv5XF35gFIi7a95m1bNVcFU0VimxSZ5QVGSiBmlggQXQ==