wini-web-components 0.9.1 → 0.9.2

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.
@@ -4,7 +4,7 @@ interface CheckboxProps {
4
4
  onChange?: (value: boolean) => void;
5
5
  value?: boolean;
6
6
  checkColor?: string;
7
- disabled?: false;
7
+ disabled?: boolean;
8
8
  style?: CSSProperties;
9
9
  /** default 2.4rem **/
10
10
  size?: number | string;
@@ -3,8 +3,8 @@ import './date-picker.css';
3
3
  import { CalendarType } from '../../index';
4
4
  interface DatePickerProps {
5
5
  value?: string;
6
- min: Date;
7
- max: Date;
6
+ min?: Date;
7
+ max?: Date;
8
8
  onChange?: (e?: string) => void;
9
9
  disabled?: boolean;
10
10
  helperText?: string;
@@ -12,7 +12,7 @@ type ChangeFileFunction = (a?: File) => void;
12
12
  interface ImportFileProps {
13
13
  status?: ComponentStatus;
14
14
  value?: File | ObjWithKnownKeys;
15
- buttonOnly: boolean;
15
+ buttonOnly?: boolean;
16
16
  onChange?: ChangeFileFunction;
17
17
  label?: string;
18
18
  className?: string;
@@ -1,32 +1,24 @@
1
1
  import React, { CSSProperties } from 'react';
2
2
  import './input-multi-select.css';
3
+ import { OptionsItem } from '../../index';
3
4
  interface SelectMultipleProps {
4
5
  value?: Array<string | number>;
5
- options: Required<Array<{
6
- id: string | number;
7
- name: string;
8
- }>>;
6
+ options: Required<Array<OptionsItem>>;
9
7
  onChange?: (value?: Array<string | number>) => void;
10
8
  placeholder?: string;
11
- disabled: boolean;
9
+ disabled?: boolean;
12
10
  className?: string;
13
11
  helperText?: string;
14
12
  helperTextColor?: string;
15
13
  style?: CSSProperties;
16
- handleSearch?: (e: string) => Promise<Array<{
17
- id: string | number;
18
- name: string;
19
- }>>;
14
+ handleSearch?: (e: string) => Promise<Array<OptionsItem>>;
20
15
  }
21
16
  interface SelectMultipleState {
22
17
  value: Array<string | number>;
23
18
  offset: DOMRect;
24
19
  isOpen: boolean;
25
20
  onSelect: any;
26
- search?: Array<{
27
- id: string | number;
28
- name: string;
29
- }>;
21
+ search?: Array<OptionsItem>;
30
22
  style?: Object;
31
23
  }
32
24
  export declare class SelectMultiple extends React.Component<SelectMultipleProps, SelectMultipleState> {
@@ -137,7 +137,7 @@ var SelectMultiple = /** @class */ (function (_super) {
137
137
  this.setState(__assign(__assign({}, this.state), { search: res }));
138
138
  return [3 /*break*/, 3];
139
139
  case 2:
140
- this.setState(__assign(__assign({}, this.state), { search: this.props.options.filter(function (e) { return e.name.toLowerCase().includes(ev.target.value.trim().toLowerCase()); }) }));
140
+ this.setState(__assign(__assign({}, this.state), { search: this.props.options.filter(function (e) { return typeof e.name === "string" && e.name.toLowerCase().includes(ev.target.value.trim().toLowerCase()); }) }));
141
141
  _b.label = 3;
142
142
  case 3: return [3 /*break*/, 5];
143
143
  case 4:
@@ -4,7 +4,7 @@ import { UseFormRegister } from 'react-hook-form';
4
4
  interface RadioButtonProps {
5
5
  onChange?: React.ChangeEventHandler<HTMLInputElement>;
6
6
  value?: string | number | readonly string[];
7
- disabled: false;
7
+ disabled?: boolean;
8
8
  style: CSSProperties;
9
9
  size?: number | string;
10
10
  defaultChecked?: boolean;
@@ -1,6 +1,6 @@
1
1
  import React, { CSSProperties, ReactNode } from 'react';
2
2
  import './select1.css';
3
- interface OptionsItem {
3
+ export interface OptionsItem {
4
4
  id: string | number;
5
5
  name: string | ReactNode;
6
6
  title?: string | ReactNode;
@@ -8,7 +8,7 @@ interface OptionsItem {
8
8
  interface Select1Props {
9
9
  value?: any;
10
10
  options: Required<Array<OptionsItem>>;
11
- onChange?: Function;
11
+ onChange?: (v?: OptionsItem) => void;
12
12
  placeholder?: string;
13
13
  disabled?: boolean;
14
14
  className?: string;
@@ -3,7 +3,7 @@ import './switch.css';
3
3
  interface SwitchProps {
4
4
  onChange?: (value: boolean) => void;
5
5
  value?: boolean;
6
- disabled: false;
6
+ disabled?: boolean;
7
7
  style: CSSProperties;
8
8
  size?: number | string;
9
9
  dotColor?: string;
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import './skin/color.css';
2
2
  import './skin/layout.css';
3
3
  import './skin/typography.css';
4
4
  import { Checkbox } from './component/checkbox/checkbox';
5
- import { Select1 } from './component/select1/select1';
5
+ import { Select1, OptionsItem } from './component/select1/select1';
6
6
  import { Switch } from './component/switch/switch';
7
7
  import { showPopup, closePopup, Popup } from './component/popup/popup';
8
8
  import { showDialog, Dialog, DialogAlignment } from './component/dialog/dialog';
@@ -24,4 +24,4 @@ import { Rating } from './component/rating/rating';
24
24
  import { ProgressCircle } from './component/progress-circle/progress-circle';
25
25
  import { CustomSlider } from './component/slider/slider';
26
26
  import { ToastContainer } from 'react-toastify';
27
- export { Calendar, CalendarType, ComponentStatus, getStatusIcon, Checkbox, Select1, Switch, Popup, showPopup, closePopup, Dialog, showDialog, DialogAlignment, DatePicker, SelectMultiple, ProgressBar, Text, Pagination, Table, TbCell, TbHeader, TbBody, TbRow, CellAlignItems, TextField, RadioButton, TextArea, ImportFile, ToastMessage, InfiniteScroll, Rating, ProgressCircle, CustomSlider, ToastContainer };
27
+ export { Calendar, CalendarType, ComponentStatus, getStatusIcon, Checkbox, Select1, OptionsItem, Switch, Popup, showPopup, closePopup, Dialog, showDialog, DialogAlignment, DatePicker, SelectMultiple, ProgressBar, Text, Pagination, Table, TbCell, TbHeader, TbBody, TbRow, CellAlignItems, TextField, RadioButton, TextArea, ImportFile, ToastMessage, InfiniteScroll, Rating, ProgressCircle, CustomSlider, ToastContainer };