Skip to content
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

feat(WebComponents): Updated to v1.0.0-rc.2 #51

Merged
merged 6 commits into from
Jul 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -21,7 +21,7 @@ const styles = () => ({
height: (props) => `${props.height}px`
}
}
});
};

export const withChartContainer = (Component: ComponentType<any>) => {
const ChartContainer = (props) => {
Expand Down
73 changes: 40 additions & 33 deletions packages/docs/.storybook/TableComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,43 +1,50 @@
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 = [
<TableColumn key="name" header={<Label>Prop</Label>} width="150px" />,
<TableColumn key="propType" header={<Label>PropType</Label>} width="150px" />,
<TableColumn key="required" header={<Label>Required</Label>} width="80px" />,
<TableColumn key="defaultValue" header={<Label>Default Value</Label>} width="100px" />,
<TableColumn key="desc" header={<Label>Description</Label>} />
<TableColumn key="name" width="150px">
<Label>Prop</Label>
</TableColumn>,
<TableColumn key="propType" width="150px">
<Label>PropType</Label>
</TableColumn>,
<TableColumn key="required" width="80px">
<Label>Required</Label>
</TableColumn>,
<TableColumn key="defaultValue" width="100px">
<Label>Default Value</Label>
</TableColumn>,
<TableColumn key="desc">
<Label>Description</Label>
</TableColumn>
];

export const TableComponent = (props) => {
const info = props.type.__docgenInfo;
if (!info || !info.props) {
return (
<ThemeProvider>
<Text>Unfortunately, there are no prop types available for this component.</Text>
</ThemeProvider>
);
}

const componentProps = info && info.props;

return (
<ThemeProvider>
<Table
columns={columns}
rows={Object.values(info.props).map((componentInfo: any) => (
<TableRow key={componentInfo.name}>
<TableCell>
<Text>{componentInfo.name}</Text>
</TableCell>
<TableCell>
<Text>{componentInfo.type.name}</Text>
</TableCell>
<TableCell>{componentInfo.required && <Badge colorScheme="8">Yes</Badge>}</TableCell>
<TableCell>{componentInfo.defaultValue && <Text>{componentInfo.defaultValue.value}</Text>}</TableCell>
<TableCell>
<Text>{componentInfo.description}</Text>
</TableCell>
</TableRow>
))}
/>
</ThemeProvider>
<Table
showNoData={componentProps === undefined}
noDataText="Unfortunately, there are no prop types available for this component"
columns={columns}
>
{Object.values(componentProps || {}).map((componentInfo: any) => (
<TableRow key={componentInfo.name}>
<TableCell>
<Text>{componentInfo.name}</Text>
</TableCell>
<TableCell>
<Text>{componentInfo.type.name}</Text>
</TableCell>
<TableCell>{componentInfo.required && <Badge colorScheme="8">Yes</Badge>}</TableCell>
<TableCell>{componentInfo.defaultValue && <Text>{componentInfo.defaultValue.value}</Text>}</TableCell>
<TableCell>
<Text>{componentInfo.description}</Text>
</TableCell>
</TableRow>
))}
</Table>
);
};
6 changes: 3 additions & 3 deletions packages/main/__karma_snapshots__/ActionSheet.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
<ThemeProvider theme={{...}}>
<WithStyles(ActionSheet) openBy={{...}} placement="Bottom">
<ActionSheet openBy={{...}} placement="Bottom" classes={{...}} theme={{...}}>
<Popover noHeader={true} openBy={{...}} placementType="Bottom" style={[undefined]} slot={[undefined]} initialFocus={{...}} headerText="" horizontalAlign="Center" verticalAlign="Center">
<Popover openBy={{...}} placementType="Bottom" style={[undefined]} slot={[undefined]} initialFocus={{...}} headerText="" horizontalAlign="Center" verticalAlign="Center">
<div style={{...}} onClick={[Function]}>
<Button design="Default">
<ui5-button design="Default" class="" />
</Button>
</div>
<WithWebComponent(Popover) noHeader={true} placementType="Bottom" style={[undefined]} slot={[undefined]} initialFocus={{...}} headerText="" horizontalAlign="Center" verticalAlign="Center">
<ui5-popover no-header={true} placement-type="Bottom" style={[undefined]} slot={[undefined]} initial-focus={{...}} header-text="" horizontal-align="Center" vertical-align="Center" class="">
<WithWebComponent(Popover) placementType="Bottom" style={[undefined]} slot={[undefined]} initialFocus={{...}} headerText="" horizontalAlign="Center" verticalAlign="Center">
<ui5-popover placement-type="Bottom" style={[undefined]} slot={[undefined]} initial-focus={{...}} header-text="" horizontal-align="Center" vertical-align="Center" class="">
<ul className="ActionSheet-actionSheet---" />
</ui5-popover>
</WithWebComponent(Popover)>
Expand Down
Loading