Skip to content

Commit 16c9dea

Browse files
committed
v2.0.0
1 parent f54e33b commit 16c9dea

File tree

6 files changed

+535
-538
lines changed

6 files changed

+535
-538
lines changed

components/Abstract/SelectionBase.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getConfig } from '../../config';
88
import { WithStyles } from '../../decorators/withStyles';
99

1010
export interface IPropsSelectionBase extends IPropsFieldBase {
11-
onChange: (value: any) => void;
11+
onChange: (value: any, event: React.ChangeEvent<any>) => void;
1212
label?: string;
1313
disabled?: boolean;
1414
checked: boolean;
@@ -60,10 +60,10 @@ export default class FieldSelectionBase extends FieldCoreBase<IProps> {
6060
}
6161

6262
getConfig().validationOn === 'onChange' && this.setState({ showError: true });
63-
this.props.onChange(value);
63+
this.props.onChange(value, event);
6464
}
6565

66-
onBlur = (e: any) => {
66+
onBlur = () => {
6767
getConfig().validationOn === 'onBlur' && this.setState({ showError: true });
6868
}
6969

components/Autocomplete/styles.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const styles: AppStyle = theme => ({
1818
overflow: 'hidden',
1919
},
2020
chip: {
21-
margin: `${theme.spacing.unit / 2}px ${theme.spacing.unit / 4}px`,
21+
margin: `${theme.spacing(1) / 2}px ${theme.spacing(1) / 4}px`,
2222
},
2323
chipFocused: {
2424
backgroundColor: emphasize(
@@ -27,7 +27,7 @@ const styles: AppStyle = theme => ({
2727
),
2828
},
2929
noOptionsMessage: {
30-
padding: `${theme.spacing.unit}px ${theme.spacing.unit * 2}px`,
30+
padding: `${theme.spacing(1)}px ${theme.spacing(2)}px`,
3131
},
3232
singleValue: {
3333
fontSize: 16,
@@ -43,7 +43,7 @@ const styles: AppStyle = theme => ({
4343
borderRadius: theme.shape.borderRadius,
4444
},
4545
divider: {
46-
height: theme.spacing.unit * 2,
46+
height: theme.spacing(2),
4747
},
4848
});
4949

components/Html/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export default class FieldHtml extends FieldCoreBase<IProps, IState> {
126126
<div className={classes.label}>
127127
<InputLabel error={!!this.errorMessage} required={this.isRequired} focused={focused}>{label}</InputLabel>
128128
{helperText || this.errorMessage ?
129-
<Typography variant='caption' color={this.errorMessage ? 'error' : 'default'}>
129+
<Typography variant='caption' color={this.errorMessage ? 'error' : null}>
130130
{this.errorMessage || helperText}
131131
</Typography>
132132
: null

decorators/withStyles.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
1-
import { StyleRules, StyleRulesCallback, Theme } from '@material-ui/core/styles';
2-
import withStyles, { WithStylesOptions } from '@material-ui/core/styles/withStyles';
1+
import { Theme } from '@material-ui/core/styles';
2+
import withStyles, { Styles, WithStylesOptions } from '@material-ui/core/styles/withStyles';
33

4-
export function WithStyles(
5-
styles: StyleRules<any> | StyleRulesCallback<any>,
6-
options?: WithStylesOptions
4+
export function WithStyles<
5+
ClassKey extends string,
6+
Options extends WithStylesOptions<Theme> = {},
7+
Props extends object = {}
8+
>(
9+
styles: Styles<Theme, Props, ClassKey>,
10+
options?: Options
711
) {
812
return function <T>(target: T): T {
913
return withStyles(styles, options)(target as any) as any;
1014
};
1115
}
1216

13-
export type AppStyle<Classkeys extends string = string> = StyleRules<Classkeys> | StyleRulesCallback<Classkeys>;
17+
export type AppStyle<Classkeys extends string = string> = Styles<Theme, {}, Classkeys>;
1418

1519
export interface IStyledProps {
1620
classes?: any;

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"validation",
1111
"material"
1212
],
13-
"version": "1.19.13",
13+
"version": "2.0.0",
1414
"main": "./dist/index.js",
1515
"types": "./dist/index.d.ts",
1616
"license": "MIT",
@@ -39,38 +39,38 @@
3939
}
4040
},
4141
"dependencies": {
42-
"@date-io/date-fns": "^1.1.0",
42+
"@date-io/date-fns": "^1.3.7",
4343
"@react-form-fields/core": "^1.5.4",
44-
"@types/classnames": "^2.2.7",
45-
"@types/jquery": "^3.3.29",
46-
"@types/react-autosuggest": "9.3.7",
47-
"@types/react-color": "2.17.0",
48-
"@types/react-select": "^2.0.15",
44+
"@types/classnames": "^2.2.8",
45+
"@types/jquery": "^3.3.30",
46+
"@types/react-autosuggest": "9.3.9",
47+
"@types/react-color": "3.0.1",
48+
"@types/react-select": "^2.0.19",
4949
"@types/validatorjs": "3.15.0",
5050
"classnames": "^2.2.6",
5151
"date-fns": "2.0.0-alpha.21",
52-
"jquery": ">=1.8",
52+
"jquery": ">=3.4",
5353
"material-ui-pickers": "^2.2.4",
54-
"react-color": ">=2.17.0",
55-
"react-select": "^2.4.2",
56-
"trumbowyg": "^2.15.1",
57-
"tslib": ">=1.9.3",
54+
"react-color": ">=2.17.3",
55+
"react-select": "^3.0.4",
56+
"trumbowyg": "^2.18.0",
57+
"tslib": ">=1.10.0",
5858
"validatorjs": ">=3.15.1"
5959
},
6060
"peerDependencies": {
61-
"@material-ui/core": ">=3.9.2",
62-
"@material-ui/icons": ">=3.0.2",
63-
"react": ">=16.0.0"
61+
"@material-ui/core": ">=4.1.2",
62+
"@material-ui/icons": ">=4.2.1",
63+
"react": ">=16.8.6"
6464
},
6565
"devDependencies": {
66-
"@material-ui/core": ">=3.9.2",
67-
"@material-ui/icons": ">=3.0.2",
66+
"@material-ui/core": ">=4.1.2",
67+
"@material-ui/icons": ">=4.2.1",
6868
"concurrently": "4.1.0",
69-
"husky": "1.3.1",
69+
"husky": "2.5.0",
7070
"react": ">=16.8.4",
71-
"tslint": "5.14.0",
71+
"tslint": "5.18.0",
7272
"tslint-eslint-rules": "5.4.0",
73-
"tslint-react": "3.6.0",
74-
"typescript": "3.3.4000"
73+
"tslint-react": "4.0.0",
74+
"typescript": "3.5.2"
7575
}
7676
}

0 commit comments

Comments
 (0)