react-ui-basics 0.0.226 → 0.0.228

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-ui-basics",
3
- "version": "0.0.226",
3
+ "version": "0.0.228",
4
4
  "description": "",
5
5
  "module": "index.js",
6
6
  "_main": "index.cjs.js",
package/src/DateTools.ts CHANGED
@@ -19,6 +19,7 @@ export const min = (a: Date, b: Date) => {
19
19
 
20
20
  // todo: add formatter base on
21
21
  //https://stevenlevithan.com/assets/misc/date.format.js
22
+ //https://github.com/felixge/node-dateformat/tree/master
22
23
 
23
24
  export class TimeUnit {
24
25
  static MILLISECOND = new TimeUnit('Milliseconds');
@@ -63,19 +63,19 @@ class FilteredList<T extends string|number> extends PureComponent<FilteredListPr
63
63
  this.updateList(this.props)
64
64
  }
65
65
 
66
- componentDidUpdate(prevProps, prevState, snapshot) {
66
+ componentDidUpdate(prevProps: FilteredListProps<T>, prevState: FilteredListState<T>, snapshot) {
67
67
  if (this.props.data === prevProps.data)
68
68
  return;
69
69
 
70
70
  this.updateList(this.props)
71
71
  }
72
72
 
73
- updateList = (props) => {
73
+ updateList = (props: FilteredListProps<T>) => {
74
74
  const {data} = props;
75
75
  const {selected} = this.state;
76
76
  this.list = data || [];
77
77
 
78
- if (!this.list.includes(selected))
78
+ if (selected && !this.list.includes(selected))
79
79
  this.setState({selected: null})
80
80
  };
81
81
 
package/src/HttpTools.ts CHANGED
@@ -50,7 +50,7 @@ export const fetch = <T>(url, options: FetchOptions = DEFAULT_OPTIONS) => {
50
50
 
51
51
  if (method === 'POST' || method === 'PUT') {
52
52
  if (options.multipart) {
53
- let formData;
53
+ let formData: FormData;
54
54
  if (params instanceof FormData) {
55
55
  formData = params;
56
56
  } else {
@@ -1825,6 +1825,6 @@ export interface MaterialIconProps {
1825
1825
  }
1826
1826
 
1827
1827
  const MaterialIcon = ({icon, className}: MaterialIconProps) => (
1828
- <i className={classNames('MaterialIcon', 'material-icons', className)}>{icon}</i>
1828
+ <i className={classNames('MaterialIcon', 'material-icons', className)} translate="no">{icon}</i>
1829
1829
  );
1830
1830
  export default MaterialIcon;