wargerm 0.2.0 → 0.2.4

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.
@@ -1,6 +1,10 @@
1
- import { FC } from 'react';
2
- import { InputProps } from 'antd/lib/input';
1
+ import React from 'react';
2
+ import { InputProps, TextAreaProps } from 'antd/lib/input';
3
3
  export interface IInputProps extends InputProps {
4
4
  }
5
- declare const WInput: FC<IInputProps>;
6
- export default WInput;
5
+ export declare type IndexComponent = React.FC<IInputProps> & {
6
+ TextArea: React.FC<TextAreaProps>;
7
+ Button: React.FC<any>;
8
+ };
9
+ declare const Index: IndexComponent;
10
+ export default Index;
@@ -0,0 +1,6 @@
1
+ import { FC } from 'react';
2
+ import { InputNumberProps } from 'antd/lib/input-number';
3
+ export interface IInputNumberProps extends InputNumberProps {
4
+ }
5
+ declare const WInputNumber: FC<IInputNumberProps>;
6
+ export default WInputNumber;
@@ -0,0 +1,9 @@
1
+ import React, { MutableRefObject } from 'react';
2
+ import { FormInstance } from 'antd';
3
+ export interface IFormInstance extends MutableRefObject<FormInstance> {
4
+ handleSubmit?: () => void;
5
+ resetFields?: () => void;
6
+ setFieldsValue?: (record: Record<string, any>) => void;
7
+ }
8
+ declare const _default: React.ForwardRefExoticComponent<Pick<Record<string, any>, string> & React.RefAttributes<unknown>>;
9
+ export default _default;
@@ -2,6 +2,7 @@ import React from 'react';
2
2
  declare type Props = {
3
3
  onChange?: (value: string) => void;
4
4
  onBlur?: () => void;
5
+ disabled?: boolean;
5
6
  value?: string;
6
7
  placeholder: string;
7
8
  };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const _default: React.ForwardRefExoticComponent<Pick<Record<string, any>, string> & React.RefAttributes<unknown>>;
3
+ export default _default;
@@ -1,7 +1,7 @@
1
1
  import React, { MutableRefObject } from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import { FormInstance, FormProps } from 'antd';
4
- interface ColumnProps {
4
+ export interface ColumnProps {
5
5
  title: string;
6
6
  dataIndex: string;
7
7
  key?: string | number;
@@ -12,7 +12,7 @@ interface ColumnProps {
12
12
  search?: {
13
13
  transform?: (value: any) => Record<string, any>;
14
14
  };
15
- valueType?: 'text' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'image';
15
+ valueType?: 'text' | 'textarea' | 'inputNumber' | 'select' | 'treeSelect' | 'date' | 'dateTime' | 'dateMonth' | 'dateYear' | 'dateRange' | 'dateTimeRange' | 'checkbox' | 'radio' | 'radioButton' | 'switch' | 'digit' | 'image';
16
16
  valueEnum?: Record<string, any>;
17
17
  options?: Record<string, any>[];
18
18
  fieldProps?: Record<string, any>;
@@ -22,6 +22,7 @@ interface ColumnProps {
22
22
  initialValue?: any;
23
23
  request?: () => Promise<any>;
24
24
  render?: (text: string, record: Record<string, any>, index: number) => ReactNode;
25
+ renderFormItem?: (item: any, { formItemProps, fieldProps, ...rest }: any, form: any) => ReactNode;
25
26
  }
26
27
  declare type defaultColConfig = {
27
28
  xs: 24;
@@ -31,7 +32,7 @@ declare type defaultColConfig = {
31
32
  xl: 8;
32
33
  xxl: 6;
33
34
  };
34
- interface Isearch {
35
+ export interface Isearch {
35
36
  labelWidth?: number | 'auto';
36
37
  span?: number | defaultColConfig;
37
38
  filterType?: 'query' | 'light';
@@ -46,6 +47,7 @@ export interface WFormProps extends FormProps {
46
47
  className?: string;
47
48
  style?: React.CSSProperties;
48
49
  columns: ColumnProps[];
50
+ disabled?: boolean;
49
51
  onSubmit?: (params: Record<string, any>) => void;
50
52
  onReset?: () => void;
51
53
  formRef?: MutableRefObject<FormInstance>;