Skip to content

Commit

Permalink
fix(typing): Fixed TypeScript Definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcusNotheis committed May 16, 2019
1 parent cd15ff4 commit 440c097
Show file tree
Hide file tree
Showing 174 changed files with 882 additions and 377 deletions.
5 changes: 0 additions & 5 deletions config/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ module.exports = {
testMatch: ['<rootDir>/**/?(*.)(spec|test).{js,jsx,ts,tsx}'],
moduleNameMapper: {
'^@shared/(.*)$': '<rootDir>/shared/$1',
'^@lib/(.*)$': '<rootDir>/packages/fiori3/src/lib/$1',
'^@fiori-for-react/charts$': '<rootDir>/packages/charts/src',
'^@fiori-for-react/fiori3(.*)?': '<rootDir>/packages/fiori3/src$1',
'^@fiori-for-react/utils': '<rootDir>/packages/utils/src',
'^@fiori-for-react/styles': '<rootDir>/packages/styles/src',
'^@ui5/webcomponents/dist(.*)$': 'identity-obj-proxy', // ui5 web components can be mocked, not relevant for jest tests
'\\.(css|less)$': 'identity-obj-proxy'
},
Expand Down
5 changes: 0 additions & 5 deletions config/karma.webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@ module.exports = function() {
resolve: {
extensions: ['.ts', '.tsx', '.js', '.jsx', '.cjs', '.mjs', '.esm'],
alias: {
'@fiori-for-react/styles': path.join(PATHS.packages, 'styles', 'src', 'index.ts'),
'@fiori-for-react/utils': path.join(PATHS.packages, 'utils', 'src', 'index.ts'),
'@fiori-for-react/fiori3': path.join(PATHS.packages, 'fiori3', 'src', 'index.ts'),
'@fiori-for-react/charts': path.join(PATHS.packages, 'charts', 'src', 'index.ts'),
'@lib': path.join(PATHS.packages, 'fiori3', 'src', 'lib'),
'@shared': PATHS.shared
}
},
Expand Down
1 change: 1 addition & 0 deletions packages/charts/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
1 change: 0 additions & 1 deletion packages/docs/.storybook/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ SKIP_DOC_GENERATION=true
alias: {
...config.resolve.alias,
'@shared': path.join(PATHS.root, 'shared'),
'@lib': path.join(PATHS.root, 'packages', 'fiori3', 'src', 'lib'),
'@fiori-for-react/fiori3': path.join(PATHS.root, 'packages', 'fiori3', 'src', 'index.ts'),
'@fiori-for-react/charts': path.join(PATHS.root, 'packages', 'charts', 'src', 'index.ts'),
'@fiori-for-react/utils': path.join(PATHS.root, 'packages', 'utils', 'src', 'index.ts'),
Expand Down
517 changes: 517 additions & 0 deletions packages/fiori3/__karma_snapshots__/FilterBar.md

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/fiori3/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './src';
32 changes: 16 additions & 16 deletions packages/fiori3/scripts/wrapperGeneration/generateTypingsWeb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,67 +22,67 @@ import TimelineItem from '@ui5/webcomponents/dist/TimelineItem';

const mappings = {
[UI5ButtonType]: {
importStatement: "import { ButtonType } from '@lib/ButtonType';",
importStatement: "import { ButtonType } from '../../lib/ButtonType';",
tsType: 'ButtonType',
isEnum: true
},
[UI5PopoverPlacementTypes]: {
importStatement: "import { PlacementType } from '@lib/PlacementType';",
importStatement: "import { PlacementType } from '../../lib/PlacementType';",
tsType: 'PlacementType',
isEnum: true
},
[UI5PopoverHorizontalAligns]: {
importStatement: "import { PopoverHorizontalAlign } from '@lib/PopoverHorizontalAlign';",
importStatement: "import { PopoverHorizontalAlign } from '../../lib/PopoverHorizontalAlign';",
tsType: 'PopoverHorizontalAlign',
isEnum: true
},
[UI5PopoverVerticalAligns]: {
importStatement: "import { PopoverVerticalAlign } from '@lib/PopoverVerticalAlign';",
importStatement: "import { PopoverVerticalAlign } from '../../lib/PopoverVerticalAlign';",
tsType: 'PopoverVerticalAlign',
isEnum: true
},
[UI5LinkType]: {
importStatement: "import { LinkType } from '@lib/LinkType';",
importStatement: "import { LinkType } from '../../lib/LinkType';",
tsType: 'LinkType',
isEnum: true
},
[UI5IconColors]: {
importStatement: "import { IconColor } from '@lib/IconColor';",
importStatement: "import { IconColor } from '../../lib/IconColor';",
tsType: 'IconColor',
isEnum: true
},
[UI5ListItemTypes]: {
importStatement: "import { ListItemTypes } from '@lib/ListItemTypes';",
importStatement: "import { ListItemTypes } from '../../lib/ListItemTypes';",
tsType: 'ListItemTypes',
isEnum: true
},
[UI5PanelAccessibleRoles]: {
importStatement: "import { PanelAccessibleRoles } from '@lib/PanelAccessibleRoles';",
importStatement: "import { PanelAccessibleRoles } from '../../lib/PanelAccessibleRoles';",
tsType: 'PanelAccessibleRoles',
isEnum: true
},
[UI5ListSeparators]: {
importStatement: "import { ListSeparators } from '@lib/ListSeparators';",
importStatement: "import { ListSeparators } from '../../lib/ListSeparators';",
tsType: 'ListSeparators',
isEnum: true
},
[UI5ListMode]: {
importStatement: "import { ListMode } from '@lib/ListMode';",
importStatement: "import { ListMode } from '../../lib/ListMode';",
tsType: 'ListMode',
isEnum: true
},
[UI5TitleLevel]: {
importStatement: "import { TitleLevel } from '@lib/TitleLevel';",
importStatement: "import { TitleLevel } from '../../lib/TitleLevel';",
tsType: 'TitleLevel',
isEnum: true
},
[UI5BackgroundDesign]: {
importStatement: "import { BackgroundDesign } from '@lib/BackgroundDesign';",
importStatement: "import { BackgroundDesign } from '../../lib/BackgroundDesign';",
tsType: 'BackgroundDesign',
isEnum: true
},
[UI5InputType]: {
importStatement: "import { InputType } from '@lib/InputType';",
importStatement: "import { InputType } from '../../lib/InputType';",
tsType: 'InputType',
isEnum: true
},
Expand All @@ -91,17 +91,17 @@ const mappings = {
comment: 'UI5 Icon Web Component'
},
[UI5CalendarType]: {
importStatement: "import { CalendarType } from '@lib/CalendarType';",
importStatement: "import { CalendarType } from '../../lib/CalendarType';",
tsType: 'CalendarType',
isEnum: true
},
[UI5ValueState]: {
importStatement: "import { ValueState } from '@lib/ValueState';",
importStatement: "import { ValueState } from '../../lib/ValueState';",
tsType: 'ValueState',
isEnum: true
},
[UI5MessageStripType]: {
importStatement: "import { MessageStripType } from '@lib/MessageStripType';",
importStatement: "import { MessageStripType } from '../../lib/MessageStripType';",
tsType: 'MessageStripType',
isEnum: true
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Button } from '@lib/Button';
import { Button } from '../../lib/Button';
import { mountThemedComponent } from '@shared/tests/utils';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
Expand Down
6 changes: 3 additions & 3 deletions packages/fiori3/src/components/ActionSheet/demo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActionSheet } from '@lib/ActionSheet';
import { Button } from '@lib/Button';
import { PlacementType } from '@lib/PlacementType';
import { ActionSheet } from '../../lib/ActionSheet';
import { Button } from '../../lib/Button';
import { PlacementType } from '../../lib/PlacementType';
import { select } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import React from 'react';
Expand Down
6 changes: 3 additions & 3 deletions packages/fiori3/src/components/ActionSheet/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { withStyles } from '@fiori-for-react/styles';
import { Device, StyleClassHelper } from '@fiori-for-react/utils';
import { ButtonType } from '@lib/ButtonType';
import { PlacementType } from '@lib/PlacementType';
import { ResponsivePopover } from '@lib/ResponsivePopover';
import { ButtonType } from '../../lib/ButtonType';
import { PlacementType } from '../../lib/PlacementType';
import { ResponsivePopover } from '../../lib/ResponsivePopover';
import React, { Children, cloneElement, Component, ReactElement, ReactNode } from 'react';
import { ClassProps } from '../../interfaces/ClassProps';
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { AnalyticalCard } from '@lib/AnalyticalCard';
import { AnalyticalCardHeader } from '@lib/AnalyticalCardHeader';
import { DeviationIndicator } from '@lib/DeviationIndicator';
import { Text } from '@lib/Text';
import { ValueState } from '@lib/ValueState';
import { AnalyticalCard } from '../../lib/AnalyticalCard';
import { AnalyticalCardHeader } from '../../lib/AnalyticalCardHeader';
import { DeviationIndicator } from '../../lib/DeviationIndicator';
import { Text } from '../../lib/Text';
import { ValueState } from '../../lib/ValueState';
import { mountThemedComponent } from '@shared/tests/utils';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { LineChart } from '@fiori-for-react/charts';
import { AnalyticalCard } from '@lib/AnalyticalCard';
import { AnalyticalCardHeader } from '@lib/AnalyticalCardHeader';
import { DeviationIndicator } from '@lib/DeviationIndicator';
import { ValueState } from '@lib/ValueState';
import { AnalyticalCard } from '../../lib/AnalyticalCard';
import { AnalyticalCardHeader } from '../../lib/AnalyticalCardHeader';
import { DeviationIndicator } from '../../lib/DeviationIndicator';
import { ValueState } from '../../lib/ValueState';
import { action } from '@storybook/addon-actions';
import { boolean, select } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Event, StyleClassHelper } from '@fiori-for-react/utils';
import { BusyIndicator } from '@lib/BusyIndicator';
import { DeviationIndicator } from '@lib/DeviationIndicator';
import { Label } from '@lib/Label';
import { Text } from '@lib/Text';
import { ValueState } from '@lib/ValueState';
import { BusyIndicator } from '../../../lib/BusyIndicator';
import { DeviationIndicator } from '../../../lib/DeviationIndicator';
import { Label } from '../../../lib/Label';
import { Text } from '../../../lib/Text';
import { ValueState } from '../../../lib/ValueState';
import React, { Fragment, PureComponent } from 'react';
import { ClassProps } from '../../../interfaces/ClassProps';
import { CommonProps } from '../../../interfaces/CommonProps';
Expand Down
4 changes: 2 additions & 2 deletions packages/fiori3/src/components/AnalyticalCard/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StyleClassHelper } from '@fiori-for-react/utils';
import { ContentDensity } from '@lib/ContentDensity';
import { Themes } from '@lib/Themes';
import { ContentDensity } from '../../lib/ContentDensity';
import { Themes } from '../../lib/Themes';
import React, { PureComponent, ReactNode, ReactNodeArray } from 'react';
import { ClassProps } from '../../interfaces/ClassProps';
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps';
Expand Down
4 changes: 2 additions & 2 deletions packages/fiori3/src/components/Avatar/Avatar.karma.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { KeyCodes } from '@fiori-for-react/utils';
import { AvatarShape } from '@lib/AvatarShape';
import { AvatarSize } from '@lib/AvatarSize';
import { AvatarShape } from '../../lib/AvatarShape';
import { AvatarSize } from '../../lib/AvatarSize';
import { mountThemedComponent } from '@shared/tests/utils';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
Expand Down
8 changes: 4 additions & 4 deletions packages/fiori3/src/components/Avatar/demo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Avatar } from '@lib/Avatar';
import { AvatarShape } from '@lib/AvatarShape';
import { AvatarSize } from '@lib/AvatarSize';
import { Icon } from '@lib/Icon';
import { Avatar } from '../../lib/Avatar';
import { AvatarShape } from '../../lib/AvatarShape';
import { AvatarSize } from '../../lib/AvatarSize';
import { Icon } from '../../lib/Icon';
import { action } from '@storybook/addon-actions/';
import { select, text } from '@storybook/addon-knobs/';
import { storiesOf } from '@storybook/react';
Expand Down
4 changes: 2 additions & 2 deletions packages/fiori3/src/components/Avatar/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Event, KeyCodes } from '@fiori-for-react/utils';
import { AvatarShape } from '@lib/AvatarShape';
import { AvatarSize } from '@lib/AvatarSize';
import { AvatarShape } from '../../lib/AvatarShape';
import { AvatarSize } from '../../lib/AvatarSize';
import React, { CSSProperties, PureComponent } from 'react';
import { ClassProps } from '../../interfaces/ClassProps';
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps';
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori3/src/components/Bar/Bar.jss.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ContentDensity } from '@lib/ContentDensity';
import { ContentDensity } from '../../lib/ContentDensity';

/**
* Style Class Generator Function
Expand Down
2 changes: 1 addition & 1 deletion packages/fiori3/src/components/Bar/Bar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Bar } from '@lib/Bar';
import { Bar } from '../../lib/Bar';
import { mountThemedComponent, renderThemedComponent } from '@shared/tests/utils';
import React from 'react';

Expand Down
4 changes: 2 additions & 2 deletions packages/fiori3/src/components/Bar/demo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { Bar } from '@lib/Bar';
import { Label } from '@lib/Label';
import { Bar } from '../../lib/Bar';
import { Label } from '../../lib/Label';

function renderStory() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { BusyIndicator } from '@lib/BusyIndicator';
import { BusyIndicator } from '../../lib/BusyIndicator';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
import { mountThemedComponent } from '@shared/tests/utils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BusyIndicator } from '@lib/BusyIndicator';
import { BusyIndicator } from '../../lib/BusyIndicator';
import { boolean } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import React from 'react';
Expand Down
8 changes: 4 additions & 4 deletions packages/fiori3/src/components/Carousel/Carousel.karma.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Carousel } from '@lib/Carousel';
import { CarouselArrowsPlacement } from '@lib/CarouselArrowsPlacement';
import { Icon } from '@lib/Icon';
import { PlacementType } from '@lib/PlacementType';
import { Carousel } from '../../lib/Carousel';
import { CarouselArrowsPlacement } from '../../lib/CarouselArrowsPlacement';
import { Icon } from '../../lib/Icon';
import { PlacementType } from '../../lib/PlacementType';
import { getEventFromCallback, mountThemedComponent } from '@shared/tests/utils';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Event, StyleClassHelper } from '@fiori-for-react/utils';
import { CarouselArrowsPlacement } from '@lib/CarouselArrowsPlacement';
import { Icon } from '@lib/Icon';
import { Label } from '@lib/Label';
import { PlacementType } from '@lib/PlacementType';
import { CarouselArrowsPlacement } from '../../lib/CarouselArrowsPlacement';
import { Icon } from '../../lib/Icon';
import { Label } from '../../lib/Label';
import { PlacementType } from '../../lib/PlacementType';
import React, { Children, Component } from 'react';
import { ClassProps } from '../../interfaces/ClassProps';
import { withStyles } from '@fiori-for-react/styles';
Expand Down
8 changes: 4 additions & 4 deletions packages/fiori3/src/components/Carousel/demo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Carousel } from '@lib/Carousel';
import { CarouselArrowsPlacement } from '@lib/CarouselArrowsPlacement';
import { Label } from '@lib/Label';
import { PlacementType } from '@lib/PlacementType';
import { Carousel } from '../../lib/Carousel';
import { CarouselArrowsPlacement } from '../../lib/CarouselArrowsPlacement';
import { Label } from '../../lib/Label';
import { PlacementType } from '../../lib/PlacementType';
import { boolean, number, select } from '@storybook/addon-knobs';
import { storiesOf } from '@storybook/react';
import React from 'react';
Expand Down
4 changes: 2 additions & 2 deletions packages/fiori3/src/components/Carousel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Event, StyleClassHelper } from '@fiori-for-react/utils';
import { CarouselArrowsPlacement } from '@lib/CarouselArrowsPlacement';
import { PlacementType } from '@lib/PlacementType';
import { CarouselArrowsPlacement } from '../../lib/CarouselArrowsPlacement';
import { PlacementType } from '../../lib/PlacementType';
import React, { Children, Component, CSSProperties, Fragment, ReactNode, ReactNodeArray } from 'react';
import { ClassProps } from '../../interfaces/ClassProps';
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps';
Expand Down
10 changes: 5 additions & 5 deletions packages/fiori3/src/components/FilterBar/FilterBar.karma.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { FilterBar } from '@lib/FilterBar';
import { FilterBar } from '../../lib/FilterBar';
import React from 'react';
import { mountThemedComponent } from '@shared/tests/utils';
import { expect, use } from 'chai';
import { matchSnapshot } from 'chai-karma-snapshot';
import { VariantManagement } from '@lib/VariantManagement';
import { FilterItem } from '@lib/FilterItem';
import { FilterType } from '@lib/FilterType';
import { Switch } from '@lib/Switch';
import { VariantManagement } from '../../lib/VariantManagement';
import { FilterItem } from '../../lib/FilterItem';
import { FilterType } from '../../lib/FilterType';
import { Switch } from '../../lib/Switch';

const variantItems = [{ label: 'Variant 1', key: '1' }, { label: 'Variant 2', key: '2' }];
const filterItems = [{ text: 'Text 1', key: '1' }, { text: 'Text 2', key: '2' }];
Expand Down
14 changes: 7 additions & 7 deletions packages/fiori3/src/components/FilterBar/demo.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from 'react';
import { storiesOf } from '@storybook/react';
import { boolean, select } from '@storybook/addon-knobs';
import { FilterBar } from '@lib/FilterBar';
import { VariantManagement } from '@lib/VariantManagement';
import { FilterItem } from '@lib/FilterItem';
import { PlacementType } from '@lib/PlacementType';
import { TitleLevel } from '@lib/TitleLevel';
import { FilterType } from '@lib/FilterType';
import { Switch } from '@lib/Switch';
import { FilterBar } from '../../lib/FilterBar';
import { VariantManagement } from '../../lib/VariantManagement';
import { FilterItem } from '../../lib/FilterItem';
import { PlacementType } from '../../lib/PlacementType';
import { TitleLevel } from '../../lib/TitleLevel';
import { FilterType } from '../../lib/FilterType';
import { Switch } from '../../lib/Switch';

const flavours = [];
for (let i = 1; i <= 9; i++) {
Expand Down
6 changes: 3 additions & 3 deletions packages/fiori3/src/components/FilterBar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { withStyles } from '@fiori-for-react/styles';
import React, { PureComponent, ReactNode, ReactNodeArray } from 'react';
import { Fiori3CommonProps } from '../../interfaces/Fiori3CommonProps';
import styles from './FilterBar.jss';
import { Input } from '@lib/Input';
import { Button } from '@lib/Button';
import { ButtonType } from '@lib/ButtonType';
import { Input } from '../../lib/Input';
import { Button } from '../../lib/Button';
import { ButtonType } from '../../lib/ButtonType';

export interface FilterBarPropTypes extends Fiori3CommonProps {
renderVariants?: () => JSX.Element;
Expand Down
Loading

0 comments on commit 440c097

Please sign in to comment.