sti-antd-package 0.0.6 → 0.0.7
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/dist/components/Card/types.d.ts +3 -0
- package/dist/components/Cascader/types.d.ts +2 -1
- package/dist/components/Checkbox/types.d.ts +5 -3
- package/dist/components/DatePicker/types.d.ts +5 -2
- package/dist/components/DateRangePicker/types.d.ts +5 -3
- package/dist/components/DropdownButton/Component.d.ts +1 -1
- package/dist/components/DropdownButton/types.d.ts +1 -1
- package/dist/components/FormItem/types.d.ts +4 -2
- package/dist/components/Input/types.d.ts +5 -3
- package/dist/components/NumberFormat/types.d.ts +5 -3
- package/dist/components/Select/types.d.ts +2 -2
- package/dist/components/Switch/types.d.ts +5 -3
- package/dist/components/TextArea/types.d.ts +5 -5
- package/dist/hooks/useRemoveError/hook.d.ts +1 -1
- package/dist/index.d.ts +34 -24
- package/dist/index.esm.js +35 -46
- package/dist/index.js +35 -46
- package/package.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { CardProps } from "antd";
|
|
2
|
+
import { CardSize } from "antd/es/card/Card";
|
|
2
3
|
export interface CardComponentProps {
|
|
4
|
+
size?: CardSize;
|
|
3
5
|
title?: React.ReactNode;
|
|
4
6
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
5
7
|
classNames?: string[];
|
|
6
8
|
className?: CardProps['classNames'];
|
|
7
9
|
style?: React.CSSProperties;
|
|
10
|
+
styles?: CardProps['styles'];
|
|
8
11
|
children?: React.ReactNode;
|
|
9
12
|
}
|
|
@@ -4,6 +4,7 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
|
4
4
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
5
5
|
import { CascaderProps, DefaultOptionType } from "rc-cascader";
|
|
6
6
|
import { Rule, RuleObject } from "rc-field-form/es/interface";
|
|
7
|
+
import { NamePath } from "rc-field-form/lib/interface";
|
|
7
8
|
import { Ref } from "react";
|
|
8
9
|
export interface CascaderComponentRef<OptionType extends DefaultOptionType, ValueField extends keyof OptionType> {
|
|
9
10
|
value: () => CascaderProps<OptionType, ValueField>['value'];
|
|
@@ -26,7 +27,7 @@ export interface CascaderComponentProps<OptionType extends DefaultOptionType, Va
|
|
|
26
27
|
onChange?: CascaderProps<OptionType, ValueField>['onChange'];
|
|
27
28
|
onSearch?: (value: string) => void;
|
|
28
29
|
formColLayout?: typeof formColLayout;
|
|
29
|
-
name?:
|
|
30
|
+
name?: NamePath;
|
|
30
31
|
label?: React.ReactNode;
|
|
31
32
|
required?: boolean;
|
|
32
33
|
rules?: Rule[];
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { CheckboxChangeEvent } from "antd";
|
|
3
3
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
4
|
-
import {
|
|
4
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
5
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
5
6
|
import { Ref } from "react";
|
|
6
7
|
export interface CheckboxComponentRef {
|
|
7
8
|
checked: () => boolean;
|
|
@@ -13,9 +14,9 @@ export interface CheckboxComponentProps {
|
|
|
13
14
|
disabled?: boolean;
|
|
14
15
|
checked?: boolean;
|
|
15
16
|
defaultChecked?: boolean;
|
|
16
|
-
onChange?: (name:
|
|
17
|
+
onChange?: (name: NamePath | undefined, event: CheckboxChangeEvent) => void;
|
|
17
18
|
formColLayout?: typeof formColLayout;
|
|
18
|
-
name?:
|
|
19
|
+
name?: NamePath;
|
|
19
20
|
label?: React.ReactNode;
|
|
20
21
|
required?: boolean;
|
|
21
22
|
rules?: Rule[];
|
|
@@ -23,6 +24,7 @@ export interface CheckboxComponentProps {
|
|
|
23
24
|
ruleMessage?: string;
|
|
24
25
|
validateStatus?: ValidateStatus;
|
|
25
26
|
help?: React.ReactNode;
|
|
27
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
26
28
|
children?: React.ReactNode;
|
|
27
29
|
ref?: Ref<CheckboxComponentRef>;
|
|
28
30
|
}
|
|
@@ -5,6 +5,8 @@ import { DatePickerProps } from "antd/es/date-picker";
|
|
|
5
5
|
import { Rule, RuleObject } from "antd/es/form";
|
|
6
6
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
7
7
|
import { Dayjs } from "dayjs";
|
|
8
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
9
|
+
import { NamePath } from "rc-field-form/lib/interface";
|
|
8
10
|
import { SemanticStructure } from "rc-picker/lib/interface";
|
|
9
11
|
import { Ref } from "react";
|
|
10
12
|
export interface DatePickerComponentRef {
|
|
@@ -22,10 +24,10 @@ export interface DatePickerComponentProps {
|
|
|
22
24
|
disabledTime?: DatePickerProps['disabledTime'];
|
|
23
25
|
value?: DatePickerProps['value'];
|
|
24
26
|
defaultValue?: DatePickerProps['value'];
|
|
25
|
-
onChange?: (name:
|
|
27
|
+
onChange?: (name: NamePath | undefined, date: Dayjs, dateStrings: string | string[]) => void;
|
|
26
28
|
style?: React.CSSProperties;
|
|
27
29
|
formColLayout?: typeof formColLayout;
|
|
28
|
-
name?:
|
|
30
|
+
name?: NamePath;
|
|
29
31
|
label?: React.ReactNode;
|
|
30
32
|
classNames?: string[];
|
|
31
33
|
className?: Partial<Record<SemanticStructure, string>>;
|
|
@@ -35,5 +37,6 @@ export interface DatePickerComponentProps {
|
|
|
35
37
|
ruleMessage?: string;
|
|
36
38
|
validateStatus?: ValidateStatus;
|
|
37
39
|
help?: React.ReactNode;
|
|
40
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
38
41
|
ref?: Ref<DatePickerComponentRef>;
|
|
39
42
|
}
|
|
@@ -5,7 +5,8 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
|
5
5
|
import { RangePickerProps } from "antd/es/date-picker";
|
|
6
6
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
7
7
|
import dayjs from "dayjs";
|
|
8
|
-
import {
|
|
8
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
9
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
9
10
|
import { SemanticStructure } from "rc-picker/lib/interface";
|
|
10
11
|
import { RangeValueType } from "rc-picker/lib/PickerInput/RangePicker";
|
|
11
12
|
import { Ref } from "react";
|
|
@@ -24,10 +25,10 @@ export interface DateRangePickerComponentProps {
|
|
|
24
25
|
disabledTime?: RangePickerProps['disabledTime'];
|
|
25
26
|
value?: RangePickerProps['value'];
|
|
26
27
|
defaultValue?: RangePickerProps['value'];
|
|
27
|
-
onChange?: (name:
|
|
28
|
+
onChange?: (name: NamePath | undefined, date: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[0], dateStrings: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[1]) => void;
|
|
28
29
|
style?: React.CSSProperties;
|
|
29
30
|
formColLayout?: typeof formColLayout;
|
|
30
|
-
name?:
|
|
31
|
+
name?: NamePath;
|
|
31
32
|
label?: React.ReactNode;
|
|
32
33
|
classNames?: string[];
|
|
33
34
|
className?: Partial<Record<SemanticStructure, string>>;
|
|
@@ -37,5 +38,6 @@ export interface DateRangePickerComponentProps {
|
|
|
37
38
|
ruleMessage?: string;
|
|
38
39
|
validateStatus?: ValidateStatus;
|
|
39
40
|
help?: React.ReactNode;
|
|
41
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
40
42
|
ref?: Ref<DateRangePickerComponentRef>;
|
|
41
43
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { DropdownButtonComponentProps } from "./types";
|
|
2
2
|
import React from "react";
|
|
3
|
-
declare const DropdownButtonComponent: <T>({
|
|
3
|
+
declare const DropdownButtonComponent: <T>({ trigger, placement, menuItems, disabled, data, }: DropdownButtonComponentProps<T>) => React.ReactElement;
|
|
4
4
|
export default DropdownButtonComponent;
|
|
@@ -8,7 +8,7 @@ export interface DropdownButtonMenuItem<T> {
|
|
|
8
8
|
onClick?: (data?: T) => void;
|
|
9
9
|
}
|
|
10
10
|
export interface DropdownButtonComponentProps<T> {
|
|
11
|
-
|
|
11
|
+
trigger?: DropDownProps['trigger'];
|
|
12
12
|
placement?: DropDownProps['placement'];
|
|
13
13
|
menuItems?: DropdownButtonMenuItem<T>[];
|
|
14
14
|
disabled?: boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
3
|
-
import {
|
|
3
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
+
import { NamePath, Rule, RuleObject, Store, StoreValue } from "rc-field-form/lib/interface";
|
|
4
5
|
import React from "react";
|
|
5
6
|
export interface FormItemComponentProps {
|
|
6
7
|
noItem?: boolean;
|
|
7
8
|
formColLayout?: typeof formColLayout;
|
|
8
|
-
name?:
|
|
9
|
+
name?: NamePath;
|
|
9
10
|
label?: React.ReactNode;
|
|
10
11
|
normalize?: ((value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue);
|
|
11
12
|
required?: boolean;
|
|
@@ -17,5 +18,6 @@ export interface FormItemComponentProps {
|
|
|
17
18
|
valuePropName?: string;
|
|
18
19
|
validateStatus?: ValidateStatus;
|
|
19
20
|
help?: React.ReactNode;
|
|
21
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
20
22
|
children?: React.ReactNode;
|
|
21
23
|
}
|
|
@@ -3,7 +3,8 @@ import { Variant } from "antd/es/config-provider";
|
|
|
3
3
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
4
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
5
5
|
import { valueType } from "antd/es/statistic/utils";
|
|
6
|
-
import {
|
|
6
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
7
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
7
8
|
import { Ref } from "react";
|
|
8
9
|
export interface InputComponentRef {
|
|
9
10
|
value: () => valueType;
|
|
@@ -30,7 +31,7 @@ export interface InputComponentProps {
|
|
|
30
31
|
placeholder?: string;
|
|
31
32
|
value?: valueType;
|
|
32
33
|
defaultValue?: valueType;
|
|
33
|
-
onChange?: (name:
|
|
34
|
+
onChange?: (name: NamePath | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
34
35
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
35
36
|
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
36
37
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -39,7 +40,7 @@ export interface InputComponentProps {
|
|
|
39
40
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
40
41
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
41
42
|
formColLayout?: typeof formColLayout;
|
|
42
|
-
name?:
|
|
43
|
+
name?: NamePath;
|
|
43
44
|
label?: React.ReactNode;
|
|
44
45
|
uppercase?: boolean;
|
|
45
46
|
number?: boolean;
|
|
@@ -51,5 +52,6 @@ export interface InputComponentProps {
|
|
|
51
52
|
ruleMax?: number;
|
|
52
53
|
validateStatus?: ValidateStatus;
|
|
53
54
|
help?: React.ReactNode;
|
|
55
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
54
56
|
ref?: Ref<InputComponentRef>;
|
|
55
57
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { valueType } from "antd/es/statistic/utils";
|
|
3
|
-
import {
|
|
3
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
4
5
|
import { Ref } from "react";
|
|
5
6
|
import { SourceInfo } from "react-number-format";
|
|
6
7
|
export interface NumberFormatComponentRef {
|
|
@@ -23,7 +24,7 @@ export interface NumberFormatComponentProps {
|
|
|
23
24
|
allowNegative?: boolean;
|
|
24
25
|
value?: valueType;
|
|
25
26
|
defaultValue?: valueType;
|
|
26
|
-
onChange?: (name:
|
|
27
|
+
onChange?: (name: NamePath | undefined, info: SourceInfo) => void;
|
|
27
28
|
style?: React.CSSProperties;
|
|
28
29
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
29
30
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
@@ -32,7 +33,7 @@ export interface NumberFormatComponentProps {
|
|
|
32
33
|
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
33
34
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
34
35
|
formColLayout?: typeof formColLayout;
|
|
35
|
-
name?:
|
|
36
|
+
name?: NamePath;
|
|
36
37
|
label?: React.ReactNode;
|
|
37
38
|
required?: boolean;
|
|
38
39
|
rules?: Rule[];
|
|
@@ -42,5 +43,6 @@ export interface NumberFormatComponentProps {
|
|
|
42
43
|
ruleMax?: number;
|
|
43
44
|
validateStatus?: 'error';
|
|
44
45
|
help?: React.ReactNode;
|
|
46
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
45
47
|
ref?: Ref<NumberFormatComponentRef>;
|
|
46
48
|
}
|
|
@@ -24,7 +24,7 @@ export interface SelectComponentProps {
|
|
|
24
24
|
placeholder?: React.ReactNode;
|
|
25
25
|
value?: any;
|
|
26
26
|
defaultValue?: any;
|
|
27
|
-
onChange?: (name: string | undefined, value: any, option?: SelectOption | SelectOption[]) => void;
|
|
27
|
+
onChange?: (name: string | string[] | undefined, value: any, option?: SelectOption | SelectOption[]) => void;
|
|
28
28
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
29
29
|
onSearch?: (value: string) => void;
|
|
30
30
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
@@ -36,7 +36,7 @@ export interface SelectComponentProps {
|
|
|
36
36
|
onClick?: (value: string) => void;
|
|
37
37
|
};
|
|
38
38
|
formColLayout?: typeof formColLayout;
|
|
39
|
-
name?: string;
|
|
39
|
+
name?: string | string[];
|
|
40
40
|
label?: React.ReactNode;
|
|
41
41
|
required?: boolean;
|
|
42
42
|
rules?: Rule[];
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
3
|
-
import {
|
|
3
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
4
5
|
import React from "react";
|
|
5
6
|
export interface SwitchComponentProps {
|
|
6
7
|
noItem?: boolean;
|
|
@@ -11,14 +12,15 @@ export interface SwitchComponentProps {
|
|
|
11
12
|
disabled?: boolean;
|
|
12
13
|
checked?: boolean;
|
|
13
14
|
defaultChecked?: boolean;
|
|
14
|
-
onChange?: (name:
|
|
15
|
+
onChange?: (name: NamePath | undefined, checked: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
15
16
|
formColLayout?: typeof formColLayout;
|
|
16
|
-
name?:
|
|
17
|
+
name?: NamePath;
|
|
17
18
|
label?: React.ReactNode;
|
|
18
19
|
required?: boolean;
|
|
19
20
|
rules?: Rule[];
|
|
20
21
|
ruleType?: RuleObject['type'];
|
|
21
22
|
ruleMessage?: string;
|
|
22
23
|
validateStatus?: ValidateStatus;
|
|
24
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
23
25
|
help?: React.ReactNode;
|
|
24
26
|
}
|
|
@@ -3,7 +3,8 @@ import { Variant } from "antd/es/config-provider";
|
|
|
3
3
|
import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
4
4
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
5
5
|
import { valueType } from "antd/es/statistic/utils";
|
|
6
|
-
import {
|
|
6
|
+
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
7
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
7
8
|
import { Ref } from "react";
|
|
8
9
|
export interface TextAreaComponentRef {
|
|
9
10
|
value: () => valueType;
|
|
@@ -22,17 +23,16 @@ export interface TextAreaComponentProps {
|
|
|
22
23
|
placeholder?: string;
|
|
23
24
|
value?: valueType;
|
|
24
25
|
defaultValue?: valueType;
|
|
25
|
-
onChange?: (name:
|
|
26
|
+
onChange?: (name: NamePath | undefined, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
26
27
|
formColLayout?: typeof formColLayout;
|
|
27
|
-
name?:
|
|
28
|
+
name?: NamePath;
|
|
28
29
|
label?: React.ReactNode;
|
|
29
30
|
required?: boolean;
|
|
30
31
|
rules?: Rule[];
|
|
31
32
|
ruleType?: RuleObject['type'];
|
|
32
33
|
ruleMessage?: string;
|
|
33
|
-
ruleMin?: number;
|
|
34
|
-
ruleMax?: number;
|
|
35
34
|
validateStatus?: ValidateStatus;
|
|
36
35
|
help?: React.ReactNode;
|
|
36
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
37
37
|
ref?: Ref<TextAreaComponentRef>;
|
|
38
38
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,13 @@ import { SizeType } from 'antd/es/config-provider/SizeContext';
|
|
|
3
3
|
import { TooltipPlacement } from 'antd/es/tooltip';
|
|
4
4
|
import React$1, { Ref, JSXElementConstructor } from 'react';
|
|
5
5
|
import { CardProps, CheckboxChangeEvent, DatePickerProps as DatePickerProps$1, DatePicker, DropDownProps, SelectProps, ThemeConfig, TablePaginationConfig as TablePaginationConfig$1, FormInstance, TagProps } from 'antd';
|
|
6
|
+
import { CardSize } from 'antd/es/card/Card';
|
|
6
7
|
import { Variant } from 'antd/es/config-provider';
|
|
7
8
|
import { ValidateStatus } from 'antd/es/form/FormItem';
|
|
8
9
|
import { DefaultOptionType, CascaderProps } from 'rc-cascader';
|
|
9
10
|
import { Rule, RuleObject } from 'rc-field-form/es/interface';
|
|
10
|
-
import { Rule as Rule$1, RuleObject as RuleObject$1, StoreValue, Store } from 'rc-field-form/lib/interface';
|
|
11
|
+
import { NamePath, Rule as Rule$1, RuleObject as RuleObject$1, StoreValue, Store } from 'rc-field-form/lib/interface';
|
|
12
|
+
import { ShouldUpdate } from 'rc-field-form/lib/Field';
|
|
11
13
|
import { DatePickerProps, RangePickerProps } from 'antd/es/date-picker';
|
|
12
14
|
import { Rule as Rule$2, RuleObject as RuleObject$2 } from 'antd/es/form';
|
|
13
15
|
import dayjs, { Dayjs } from 'dayjs';
|
|
@@ -124,11 +126,13 @@ interface ButtonGroupEditComponentProps {
|
|
|
124
126
|
declare const ButtonGroupEditComponent: React$1.FC<ButtonGroupEditComponentProps>;
|
|
125
127
|
|
|
126
128
|
interface CardComponentProps {
|
|
129
|
+
size?: CardSize;
|
|
127
130
|
title?: React.ReactNode;
|
|
128
131
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
129
132
|
classNames?: string[];
|
|
130
133
|
className?: CardProps['classNames'];
|
|
131
134
|
style?: React.CSSProperties;
|
|
135
|
+
styles?: CardProps['styles'];
|
|
132
136
|
children?: React.ReactNode;
|
|
133
137
|
}
|
|
134
138
|
|
|
@@ -155,7 +159,7 @@ interface CascaderComponentProps<OptionType extends DefaultOptionType, ValueFiel
|
|
|
155
159
|
onChange?: CascaderProps<OptionType, ValueField>['onChange'];
|
|
156
160
|
onSearch?: (value: string) => void;
|
|
157
161
|
formColLayout?: typeof _default;
|
|
158
|
-
name?:
|
|
162
|
+
name?: NamePath;
|
|
159
163
|
label?: React.ReactNode;
|
|
160
164
|
required?: boolean;
|
|
161
165
|
rules?: Rule[];
|
|
@@ -178,9 +182,9 @@ interface CheckboxComponentProps {
|
|
|
178
182
|
disabled?: boolean;
|
|
179
183
|
checked?: boolean;
|
|
180
184
|
defaultChecked?: boolean;
|
|
181
|
-
onChange?: (name:
|
|
185
|
+
onChange?: (name: NamePath | undefined, event: CheckboxChangeEvent) => void;
|
|
182
186
|
formColLayout?: typeof _default;
|
|
183
|
-
name?:
|
|
187
|
+
name?: NamePath;
|
|
184
188
|
label?: React.ReactNode;
|
|
185
189
|
required?: boolean;
|
|
186
190
|
rules?: Rule$1[];
|
|
@@ -188,6 +192,7 @@ interface CheckboxComponentProps {
|
|
|
188
192
|
ruleMessage?: string;
|
|
189
193
|
validateStatus?: ValidateStatus;
|
|
190
194
|
help?: React.ReactNode;
|
|
195
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
191
196
|
children?: React.ReactNode;
|
|
192
197
|
ref?: Ref<CheckboxComponentRef>;
|
|
193
198
|
}
|
|
@@ -209,10 +214,10 @@ interface DatePickerComponentProps {
|
|
|
209
214
|
disabledTime?: DatePickerProps['disabledTime'];
|
|
210
215
|
value?: DatePickerProps['value'];
|
|
211
216
|
defaultValue?: DatePickerProps['value'];
|
|
212
|
-
onChange?: (name:
|
|
217
|
+
onChange?: (name: NamePath | undefined, date: Dayjs, dateStrings: string | string[]) => void;
|
|
213
218
|
style?: React.CSSProperties;
|
|
214
219
|
formColLayout?: typeof _default;
|
|
215
|
-
name?:
|
|
220
|
+
name?: NamePath;
|
|
216
221
|
label?: React.ReactNode;
|
|
217
222
|
classNames?: string[];
|
|
218
223
|
className?: Partial<Record<SemanticStructure, string>>;
|
|
@@ -222,6 +227,7 @@ interface DatePickerComponentProps {
|
|
|
222
227
|
ruleMessage?: string;
|
|
223
228
|
validateStatus?: ValidateStatus;
|
|
224
229
|
help?: React.ReactNode;
|
|
230
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
225
231
|
ref?: Ref<DatePickerComponentRef>;
|
|
226
232
|
}
|
|
227
233
|
|
|
@@ -242,10 +248,10 @@ interface DateRangePickerComponentProps {
|
|
|
242
248
|
disabledTime?: RangePickerProps['disabledTime'];
|
|
243
249
|
value?: RangePickerProps['value'];
|
|
244
250
|
defaultValue?: RangePickerProps['value'];
|
|
245
|
-
onChange?: (name:
|
|
251
|
+
onChange?: (name: NamePath | undefined, date: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[0], dateStrings: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[1]) => void;
|
|
246
252
|
style?: React.CSSProperties;
|
|
247
253
|
formColLayout?: typeof _default;
|
|
248
|
-
name?:
|
|
254
|
+
name?: NamePath;
|
|
249
255
|
label?: React.ReactNode;
|
|
250
256
|
classNames?: string[];
|
|
251
257
|
className?: Partial<Record<SemanticStructure, string>>;
|
|
@@ -255,6 +261,7 @@ interface DateRangePickerComponentProps {
|
|
|
255
261
|
ruleMessage?: string;
|
|
256
262
|
validateStatus?: ValidateStatus;
|
|
257
263
|
help?: React.ReactNode;
|
|
264
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
258
265
|
ref?: Ref<DateRangePickerComponentRef>;
|
|
259
266
|
}
|
|
260
267
|
|
|
@@ -269,19 +276,19 @@ interface DropdownButtonMenuItem<T> {
|
|
|
269
276
|
onClick?: (data?: T) => void;
|
|
270
277
|
}
|
|
271
278
|
interface DropdownButtonComponentProps<T> {
|
|
272
|
-
|
|
279
|
+
trigger?: DropDownProps['trigger'];
|
|
273
280
|
placement?: DropDownProps['placement'];
|
|
274
281
|
menuItems?: DropdownButtonMenuItem<T>[];
|
|
275
282
|
disabled?: boolean;
|
|
276
283
|
data?: T;
|
|
277
284
|
}
|
|
278
285
|
|
|
279
|
-
declare const DropdownButtonComponent: <T>({
|
|
286
|
+
declare const DropdownButtonComponent: <T>({ trigger, placement, menuItems, disabled, data, }: DropdownButtonComponentProps<T>) => React$1.ReactElement;
|
|
280
287
|
|
|
281
288
|
interface FormItemComponentProps {
|
|
282
289
|
noItem?: boolean;
|
|
283
290
|
formColLayout?: typeof _default;
|
|
284
|
-
name?:
|
|
291
|
+
name?: NamePath;
|
|
285
292
|
label?: React$1.ReactNode;
|
|
286
293
|
normalize?: ((value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue);
|
|
287
294
|
required?: boolean;
|
|
@@ -293,6 +300,7 @@ interface FormItemComponentProps {
|
|
|
293
300
|
valuePropName?: string;
|
|
294
301
|
validateStatus?: ValidateStatus;
|
|
295
302
|
help?: React$1.ReactNode;
|
|
303
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
296
304
|
children?: React$1.ReactNode;
|
|
297
305
|
}
|
|
298
306
|
|
|
@@ -331,7 +339,7 @@ interface InputComponentProps {
|
|
|
331
339
|
placeholder?: string;
|
|
332
340
|
value?: valueType;
|
|
333
341
|
defaultValue?: valueType;
|
|
334
|
-
onChange?: (name:
|
|
342
|
+
onChange?: (name: NamePath | undefined, event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
335
343
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
336
344
|
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
337
345
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -340,7 +348,7 @@ interface InputComponentProps {
|
|
|
340
348
|
onFocus?: React.FocusEventHandler<HTMLInputElement>;
|
|
341
349
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
342
350
|
formColLayout?: typeof _default;
|
|
343
|
-
name?:
|
|
351
|
+
name?: NamePath;
|
|
344
352
|
label?: React.ReactNode;
|
|
345
353
|
uppercase?: boolean;
|
|
346
354
|
number?: boolean;
|
|
@@ -352,6 +360,7 @@ interface InputComponentProps {
|
|
|
352
360
|
ruleMax?: number;
|
|
353
361
|
validateStatus?: ValidateStatus;
|
|
354
362
|
help?: React.ReactNode;
|
|
363
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
355
364
|
ref?: Ref<InputComponentRef>;
|
|
356
365
|
}
|
|
357
366
|
|
|
@@ -384,7 +393,7 @@ interface NumberFormatComponentProps {
|
|
|
384
393
|
allowNegative?: boolean;
|
|
385
394
|
value?: valueType;
|
|
386
395
|
defaultValue?: valueType;
|
|
387
|
-
onChange?: (name:
|
|
396
|
+
onChange?: (name: NamePath | undefined, info: SourceInfo) => void;
|
|
388
397
|
style?: React.CSSProperties;
|
|
389
398
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
390
399
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
@@ -393,7 +402,7 @@ interface NumberFormatComponentProps {
|
|
|
393
402
|
onFocus?: React.FocusEventHandler<HTMLDivElement>;
|
|
394
403
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
395
404
|
formColLayout?: typeof _default;
|
|
396
|
-
name?:
|
|
405
|
+
name?: NamePath;
|
|
397
406
|
label?: React.ReactNode;
|
|
398
407
|
required?: boolean;
|
|
399
408
|
rules?: Rule$1[];
|
|
@@ -403,6 +412,7 @@ interface NumberFormatComponentProps {
|
|
|
403
412
|
ruleMax?: number;
|
|
404
413
|
validateStatus?: 'error';
|
|
405
414
|
help?: React.ReactNode;
|
|
415
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
406
416
|
ref?: Ref<NumberFormatComponentRef>;
|
|
407
417
|
}
|
|
408
418
|
|
|
@@ -427,7 +437,7 @@ interface SelectComponentProps {
|
|
|
427
437
|
placeholder?: React.ReactNode;
|
|
428
438
|
value?: any;
|
|
429
439
|
defaultValue?: any;
|
|
430
|
-
onChange?: (name: string | undefined, value: any, option?: SelectOption | SelectOption[]) => void;
|
|
440
|
+
onChange?: (name: string | string[] | undefined, value: any, option?: SelectOption | SelectOption[]) => void;
|
|
431
441
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
432
442
|
onSearch?: (value: string) => void;
|
|
433
443
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
@@ -439,7 +449,7 @@ interface SelectComponentProps {
|
|
|
439
449
|
onClick?: (value: string) => void;
|
|
440
450
|
};
|
|
441
451
|
formColLayout?: typeof _default;
|
|
442
|
-
name?: string;
|
|
452
|
+
name?: string | string[];
|
|
443
453
|
label?: React.ReactNode;
|
|
444
454
|
required?: boolean;
|
|
445
455
|
rules?: Rule$2[];
|
|
@@ -511,15 +521,16 @@ interface SwitchComponentProps {
|
|
|
511
521
|
disabled?: boolean;
|
|
512
522
|
checked?: boolean;
|
|
513
523
|
defaultChecked?: boolean;
|
|
514
|
-
onChange?: (name:
|
|
524
|
+
onChange?: (name: NamePath | undefined, checked: boolean, event: React$1.MouseEvent<HTMLButtonElement> | React$1.KeyboardEvent<HTMLButtonElement>) => void;
|
|
515
525
|
formColLayout?: typeof _default;
|
|
516
|
-
name?:
|
|
526
|
+
name?: NamePath;
|
|
517
527
|
label?: React$1.ReactNode;
|
|
518
528
|
required?: boolean;
|
|
519
529
|
rules?: Rule$1[];
|
|
520
530
|
ruleType?: RuleObject$1['type'];
|
|
521
531
|
ruleMessage?: string;
|
|
522
532
|
validateStatus?: ValidateStatus;
|
|
533
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
523
534
|
help?: React$1.ReactNode;
|
|
524
535
|
}
|
|
525
536
|
|
|
@@ -861,18 +872,17 @@ interface TextAreaComponentProps {
|
|
|
861
872
|
placeholder?: string;
|
|
862
873
|
value?: valueType;
|
|
863
874
|
defaultValue?: valueType;
|
|
864
|
-
onChange?: (name:
|
|
875
|
+
onChange?: (name: NamePath | undefined, event: React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
865
876
|
formColLayout?: typeof _default;
|
|
866
|
-
name?:
|
|
877
|
+
name?: NamePath;
|
|
867
878
|
label?: React.ReactNode;
|
|
868
879
|
required?: boolean;
|
|
869
880
|
rules?: Rule$1[];
|
|
870
881
|
ruleType?: RuleObject$1['type'];
|
|
871
882
|
ruleMessage?: string;
|
|
872
|
-
ruleMin?: number;
|
|
873
|
-
ruleMax?: number;
|
|
874
883
|
validateStatus?: ValidateStatus;
|
|
875
884
|
help?: React.ReactNode;
|
|
885
|
+
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
876
886
|
ref?: Ref<TextAreaComponentRef>;
|
|
877
887
|
}
|
|
878
888
|
|
|
@@ -887,7 +897,7 @@ declare enum DateFormat {
|
|
|
887
897
|
|
|
888
898
|
declare const useRemoveError: (setInputErrors: React.Dispatch<React.SetStateAction<{
|
|
889
899
|
[key: string]: any;
|
|
890
|
-
}>>) => (name?: string) => void;
|
|
900
|
+
}>>) => (name?: string | string[]) => void;
|
|
891
901
|
|
|
892
902
|
export { BaseModel, ButtonComponent, ButtonGroupAddComponent, ButtonGroupEditComponent, CardComponent, CascaderComponent, CheckboxComponent, ConfigProvider, DateFormat, DatePickerComponent, DateRangePickerComponent, DropdownButtonComponent, FeedbackProvider, FormItemComponent, IconCheckOrClose, InputComponent, LinkComponent, NumberFormatComponent, SelectAsyncComponent, SelectComponent, SwitchComponent, TableAsyncComponent, TableAsyncSearchComponent, TableCellEditableComponent, TableComponent, TableRowProvider, TabsComponent, TagComponent, TextAreaComponent, TransformBoolean, TransformDayjs, TransformNumber, colLayout, datePickerFormat, _default as formColLayout, getTableAsyncName, getTableFilterStorage, selectAsync, styleCSS, toCamel, useConfig, useFeedback, useRemoveError, useTableAsyncSearch, useTableRow };
|
|
893
903
|
export type { ButtonComponentProps, ButtonComponentRef, ButtonGroupAddComponentProps, ButtonGroupEditComponentProps, CardComponentProps, CascaderComponentProps, CascaderComponentRef, CheckboxComponentProps, CheckboxComponentRef, ConfigContextType, ConfigProviderProps, DatePickerComponentProps, DatePickerComponentRef, DateRangePickerComponentProps, DateRangePickerComponentRef, DefaultColumn, DefaultParams, DropdownButtonComponentProps, DropdownButtonMenuItem, FeedbackContextType, FormColLayout, FormColSizeSpan, FormItemComponentProps, IconCheckOrCloseProps, InputComponentProps, InputComponentRef, LinkComponentProps, LinkType, NumberFormatComponentProps, NumberFormatComponentRef, SelectAsyncComponentProps, SelectAsyncComponentRef, SelectAsyncFormat, SelectAsyncProps, SelectComponentProps, SelectOption, SwitchComponentProps, TableAsyncComponentProps, TableAsyncComponentRef, TableAsyncSearchCheckbox, TableAsyncSearchComponentProps, TableAsyncSearchContextType, TableAsyncSearchDate, TableAsyncSearchDateRange, TableAsyncSearchFetchSelectMultiple, TableAsyncSearchItem, TableAsyncSearchItemType, TableAsyncSearchLocalSelectMultiple, TableAsyncSearchProviderProps, TableAsyncSearchSelect, TableAsyncSearchSelectMultiple, TableAsyncSearchSwitch, TableAsyncSearchText, TableAsyncType, TableButtonMiddle, TableCellEditableProps, TableComponentProps, TableParams, TableParamsFormatter, TableRowContextType, TableRowProviderProps, TabsComponentProps, TagComponentProps, TextAreaComponentProps, TextAreaComponentRef, YajraColumn, YajraColumnParams, YajraOrderParams, YajraParams, YajraSearchParams };
|
package/dist/index.esm.js
CHANGED
|
@@ -3815,11 +3815,23 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
3815
3815
|
return col ? (jsxRuntimeExports.jsx(Row, { children: jsxRuntimeExports.jsx(Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
3816
3816
|
};
|
|
3817
3817
|
|
|
3818
|
-
const CardComponent = ({ title, onClick, classNames, className, style, children, }) => {
|
|
3819
|
-
return (jsxRuntimeExports.jsx(Card, { title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, children: children }));
|
|
3818
|
+
const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
|
|
3819
|
+
return (jsxRuntimeExports.jsx(Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
|
|
3820
|
+
};
|
|
3821
|
+
|
|
3822
|
+
const { Item: Item$1 } = Form$2;
|
|
3823
|
+
const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
|
|
3824
|
+
const rule = {
|
|
3825
|
+
required: required,
|
|
3826
|
+
message: ruleMessage,
|
|
3827
|
+
type: ruleType,
|
|
3828
|
+
whitespace: true,
|
|
3829
|
+
max: ruleMax,
|
|
3830
|
+
min: ruleMin,
|
|
3831
|
+
};
|
|
3832
|
+
return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
|
|
3820
3833
|
};
|
|
3821
3834
|
|
|
3822
|
-
const { Item: Item$2 } = Form$2;
|
|
3823
3835
|
const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, open, disabled, suffixIcon, placeholder, value, defaultValue, options, displayRender, onChange, onSearch, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3824
3836
|
const [valueCascader, setValueCascader] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : []);
|
|
3825
3837
|
useImperativeHandle(ref, () => ({
|
|
@@ -3829,30 +3841,11 @@ const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, o
|
|
|
3829
3841
|
const cascader = (jsxRuntimeExports.jsx(Cascader, { allowClear: !required, size: size, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), variant: variant, expandTrigger: expandTrigger, open: open, disabled: disabled, suffixIcon: suffixIcon, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueCascader, defaultValue: defaultValue, options: options === null || options === void 0 ? void 0 : options.filter(item => item.value !== undefined), displayRender: displayRender, showSearch: {
|
|
3830
3842
|
filter: (search, path) => path.some(option => option.search.toLowerCase().indexOf(search.toLowerCase()) > -1),
|
|
3831
3843
|
}, onChange: onChange, onSearch: onSearch }));
|
|
3832
|
-
|
|
3833
|
-
required: required,
|
|
3834
|
-
message: ruleMessage,
|
|
3835
|
-
type: ruleType,
|
|
3836
|
-
whitespace: true,
|
|
3837
|
-
};
|
|
3838
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(Item$2, Object.assign({}, formColLayout, { name: name, label: label, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], validateStatus: validateStatus, help: help, children: cascader })))
|
|
3844
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: cascader })))
|
|
3839
3845
|
: cascader }));
|
|
3840
3846
|
};
|
|
3841
3847
|
|
|
3842
|
-
const {
|
|
3843
|
-
const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, valuePropName, validateStatus, help, children, }) => {
|
|
3844
|
-
const rule = {
|
|
3845
|
-
required: required,
|
|
3846
|
-
message: ruleMessage,
|
|
3847
|
-
type: ruleType,
|
|
3848
|
-
whitespace: true,
|
|
3849
|
-
max: ruleMax,
|
|
3850
|
-
min: ruleMin,
|
|
3851
|
-
};
|
|
3852
|
-
return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, children: children }))) : children;
|
|
3853
|
-
};
|
|
3854
|
-
|
|
3855
|
-
const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, children, ref, }) => {
|
|
3848
|
+
const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, children, ref, }) => {
|
|
3856
3849
|
const [checkedValue, setCheckedValue] = useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
3857
3850
|
const handleChange = (event) => {
|
|
3858
3851
|
var _a;
|
|
@@ -3864,7 +3857,7 @@ const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked,
|
|
|
3864
3857
|
setChecked: setCheckedValue,
|
|
3865
3858
|
}));
|
|
3866
3859
|
const checkbox = !loading ? (jsxRuntimeExports.jsx(Checkbox, { disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedValue, defaultChecked: checkedValue, onChange: handleChange, children: children })) : jsxRuntimeExports.jsx(Skeleton.Input, { active: true });
|
|
3867
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, children: checkbox })))
|
|
3860
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: checkbox })))
|
|
3868
3861
|
: checkbox }));
|
|
3869
3862
|
};
|
|
3870
3863
|
|
|
@@ -3910,7 +3903,7 @@ var formColLayout = {
|
|
|
3910
3903
|
notInline: {},
|
|
3911
3904
|
};
|
|
3912
3905
|
|
|
3913
|
-
const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3906
|
+
const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
3914
3907
|
const [valueDate, setValueDate] = useState(defaultValue);
|
|
3915
3908
|
const handleChange = (date, dateString) => {
|
|
3916
3909
|
setValueDate(date);
|
|
@@ -3922,13 +3915,13 @@ const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disa
|
|
|
3922
3915
|
}));
|
|
3923
3916
|
const classDate = [styleCSS['w-100']];
|
|
3924
3917
|
classNames && classDate.push(...classNames);
|
|
3925
|
-
const datePicker = !loading ? (jsxRuntimeExports.jsx(DatePicker, {
|
|
3926
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: datePicker })))
|
|
3918
|
+
const datePicker = !loading ? (jsxRuntimeExports.jsx(DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[picker !== null && picker !== void 0 ? picker : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
3919
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
3927
3920
|
: datePicker }));
|
|
3928
3921
|
};
|
|
3929
3922
|
|
|
3930
3923
|
const { RangePicker } = DatePicker;
|
|
3931
|
-
const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3924
|
+
const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
3932
3925
|
var _a;
|
|
3933
3926
|
const [valueDateRange, setValueDateRange] = useState(defaultValue);
|
|
3934
3927
|
const handleChange = (date, dateStrings) => {
|
|
@@ -3941,8 +3934,8 @@ const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate,
|
|
|
3941
3934
|
}));
|
|
3942
3935
|
const classDateRange = [styleCSS['w-100']];
|
|
3943
3936
|
classNames && classDateRange.push(...classNames);
|
|
3944
|
-
const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, {
|
|
3945
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: datePicker })))
|
|
3937
|
+
const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[(_a = picker === null || picker === void 0 ? void 0 : picker.toString()) !== null && _a !== void 0 ? _a : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDateRange, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
3938
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
3946
3939
|
: datePicker }));
|
|
3947
3940
|
};
|
|
3948
3941
|
|
|
@@ -5939,7 +5932,7 @@ const LinkComponent = ({ href, children, }) => {
|
|
|
5939
5932
|
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
5940
5933
|
};
|
|
5941
5934
|
|
|
5942
|
-
const DropdownButtonComponent = ({
|
|
5935
|
+
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
5943
5936
|
const items = menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(menu => {
|
|
5944
5937
|
const classMenuItem = [];
|
|
5945
5938
|
switch (menu.type) {
|
|
@@ -5961,7 +5954,7 @@ const DropdownButtonComponent = ({ triger, placement, menuItems, disabled, data,
|
|
|
5961
5954
|
onClick: () => { var _a; return (_a = menu.onClick) === null || _a === void 0 ? void 0 : _a.call(menu, data); },
|
|
5962
5955
|
};
|
|
5963
5956
|
});
|
|
5964
|
-
return (jsxRuntimeExports.jsx(Dropdown, { menu: { items }, placement: placement !== null && placement !== void 0 ? placement : 'bottomRight', trigger:
|
|
5957
|
+
return (jsxRuntimeExports.jsx(Dropdown, { menu: { items }, placement: placement !== null && placement !== void 0 ? placement : 'bottomRight', trigger: trigger !== null && trigger !== void 0 ? trigger : ['hover'], disabled: disabled, children: jsxRuntimeExports.jsx(ButtonComponent, { size: "small", icon: jsxRuntimeExports.jsx(RefIcon$8, {}) }) }));
|
|
5965
5958
|
};
|
|
5966
5959
|
|
|
5967
5960
|
var css_248z$8 = ".style-module_icon__GHpNO {\n size: 1.5rem;\n}";
|
|
@@ -5975,12 +5968,10 @@ const IconCheckOrClose = ({ check, classNames, style, }) => {
|
|
|
5975
5968
|
return (jsxRuntimeExports.jsx(Icon, { className: classIcon.join(' '), style: style }));
|
|
5976
5969
|
};
|
|
5977
5970
|
|
|
5978
|
-
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, ref, }) => {
|
|
5971
|
+
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
5979
5972
|
const [valueInput, setValueInput] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
5980
5973
|
const handleChange = (event) => {
|
|
5981
5974
|
setValueInput(event.target.value);
|
|
5982
|
-
if (noItem && name)
|
|
5983
|
-
event.target.id = name;
|
|
5984
5975
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, event);
|
|
5985
5976
|
};
|
|
5986
5977
|
useImperativeHandle(ref, () => ({
|
|
@@ -5996,7 +5987,7 @@ const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNa
|
|
|
5996
5987
|
return value.replace(/\D/g, '');
|
|
5997
5988
|
return value;
|
|
5998
5989
|
};
|
|
5999
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, children: input })))
|
|
5990
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: input })))
|
|
6000
5991
|
: input }));
|
|
6001
5992
|
};
|
|
6002
5993
|
|
|
@@ -6033,7 +6024,7 @@ var css_248z$5 = ".style-module_number-format__F9NKi {\n box-sizing: border-box
|
|
|
6033
6024
|
var styleNumberFormat = {"number-format":"style-module_number-format__F9NKi","number-format-borderless":"style-module_number-format-borderless__DOdb8","number-format-underlined":"style-module_number-format-underlined__hUCaf","number-format-error":"style-module_number-format-error__rOvyp","number-format-sm":"style-module_number-format-sm__iLZdH","number-format-align-right":"style-module_number-format-align-right__qOFmQ"};
|
|
6034
6025
|
styleInject(css_248z$5);
|
|
6035
6026
|
|
|
6036
|
-
const NumberFormatComponent = ({ noItem, text, size, align, className, variant, trailing: trailingProps, prefix, suffix, placeholder, disabled, readOnly, allowNegative, value, defaultValue, onChange, style, onBlur, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onClick, formColLayout, name, label, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, ref, }) => {
|
|
6027
|
+
const NumberFormatComponent = ({ noItem, text, size, align, className, variant, trailing: trailingProps, prefix, suffix, placeholder, disabled, readOnly, allowNegative, value, defaultValue, onChange, style, onBlur, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onClick, formColLayout, name, label, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
6037
6028
|
const { trailing } = useConfig$1();
|
|
6038
6029
|
const { messageApi } = useFeedback();
|
|
6039
6030
|
const [valueNumberFormat, setValueNumberFormat] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
@@ -6071,7 +6062,7 @@ const NumberFormatComponent = ({ noItem, text, size, align, className, variant,
|
|
|
6071
6062
|
return formattedValue === '' || floatValue <= ruleMax;
|
|
6072
6063
|
return true;
|
|
6073
6064
|
}, fixedDecimalScale: true, style: style, value: value !== null && value !== void 0 ? value : valueNumberFormat, onValueChange: handleChange, onBlur: onBlur, onKeyDown: onKeyDown }) })));
|
|
6074
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, children: numberFormat })))
|
|
6065
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: numberFormat })))
|
|
6075
6066
|
: numberFormat }));
|
|
6076
6067
|
};
|
|
6077
6068
|
|
|
@@ -6815,7 +6806,7 @@ const SelectAsyncComponent = (_a) => {
|
|
|
6815
6806
|
}, onFocus: (!options.length || isInit) ? debounceFetcher : undefined, onSearch: debounceFetcher, notFoundContent: fetching ? jsxRuntimeExports.jsx(Spin, { size: "small" }) : null, options: getOptions() })));
|
|
6816
6807
|
};
|
|
6817
6808
|
|
|
6818
|
-
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
6809
|
+
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, }) => {
|
|
6819
6810
|
const [checkedSwitch, setCheckedSwitch] = useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
6820
6811
|
const handleChange = (value, event) => {
|
|
6821
6812
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, value, event);
|
|
@@ -6829,7 +6820,7 @@ const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loa
|
|
|
6829
6820
|
unCheckedChildren,
|
|
6830
6821
|
};
|
|
6831
6822
|
const switchComponent = !loading ? (jsxRuntimeExports.jsx(Switch, Object.assign({}, checkChildren, { onChange: handleChange, disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedSwitch, defaultChecked: checked !== null && checked !== void 0 ? checked : checkedSwitch }))) : jsxRuntimeExports.jsx(Skeleton.Input, { active: true });
|
|
6832
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: switchComponent })))
|
|
6823
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: switchComponent })))
|
|
6833
6824
|
: switchComponent }));
|
|
6834
6825
|
};
|
|
6835
6826
|
|
|
@@ -23143,15 +23134,13 @@ const TextArea = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
23143
23134
|
}))));
|
|
23144
23135
|
});
|
|
23145
23136
|
|
|
23146
|
-
const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage,
|
|
23137
|
+
const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
23147
23138
|
const classTextArea = [];
|
|
23148
23139
|
className && classTextArea.push(...className);
|
|
23149
23140
|
noResize && classTextArea.push(styleTextArea['resize-none']);
|
|
23150
23141
|
const [valueTextArea, setValueTextArea] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
23151
23142
|
const handleChange = (event) => {
|
|
23152
23143
|
setValueTextArea(event.target.value);
|
|
23153
|
-
if (noItem && name)
|
|
23154
|
-
event.target.id = name;
|
|
23155
23144
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, event);
|
|
23156
23145
|
};
|
|
23157
23146
|
useImperativeHandle(ref, () => ({
|
|
@@ -23159,13 +23148,13 @@ const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, l
|
|
|
23159
23148
|
setValue: () => setValueTextArea,
|
|
23160
23149
|
}));
|
|
23161
23150
|
const textArea = !loading ? (jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntimeExports.jsx(Skeleton.Input, { block: true, active: true });
|
|
23162
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: textArea })))
|
|
23151
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: textArea })))
|
|
23163
23152
|
: textArea }));
|
|
23164
23153
|
};
|
|
23165
23154
|
|
|
23166
23155
|
const useRemoveError = (setInputErrors) => {
|
|
23167
23156
|
const removeError = (name) => {
|
|
23168
|
-
name && setInputErrors(prevState => Object.keys(prevState)
|
|
23157
|
+
name && typeof name === 'string' && setInputErrors(prevState => Object.keys(prevState)
|
|
23169
23158
|
.filter(key => key !== name)
|
|
23170
23159
|
.reduce((result, current) => {
|
|
23171
23160
|
result[current] = prevState[current];
|
package/dist/index.js
CHANGED
|
@@ -3835,11 +3835,23 @@ const ButtonGroupEditComponent = ({ formColLayout, disabled, loading, allowEdit
|
|
|
3835
3835
|
return col ? (jsxRuntimeExports.jsx(antd.Row, { children: jsxRuntimeExports.jsx(antd.Col, Object.assign({}, col, { children: buttonGroup })) })) : buttonGroup;
|
|
3836
3836
|
};
|
|
3837
3837
|
|
|
3838
|
-
const CardComponent = ({ title, onClick, classNames, className, style, children, }) => {
|
|
3839
|
-
return (jsxRuntimeExports.jsx(antd.Card, { title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, children: children }));
|
|
3838
|
+
const CardComponent = ({ size, title, onClick, classNames, className, style, styles, children, }) => {
|
|
3839
|
+
return (jsxRuntimeExports.jsx(antd.Card, { size: size, title: title, onClick: onClick, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), classNames: className, style: style, styles: styles, children: children }));
|
|
3840
|
+
};
|
|
3841
|
+
|
|
3842
|
+
const { Item: Item$1 } = antd.Form;
|
|
3843
|
+
const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, valuePropName, validateStatus, help, shouldUpdate, children, }) => {
|
|
3844
|
+
const rule = {
|
|
3845
|
+
required: required,
|
|
3846
|
+
message: ruleMessage,
|
|
3847
|
+
type: ruleType,
|
|
3848
|
+
whitespace: true,
|
|
3849
|
+
max: ruleMax,
|
|
3850
|
+
min: ruleMin,
|
|
3851
|
+
};
|
|
3852
|
+
return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: children }))) : children;
|
|
3840
3853
|
};
|
|
3841
3854
|
|
|
3842
|
-
const { Item: Item$2 } = antd.Form;
|
|
3843
3855
|
const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, open, disabled, suffixIcon, placeholder, value, defaultValue, options, displayRender, onChange, onSearch, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3844
3856
|
const [valueCascader, setValueCascader] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : []);
|
|
3845
3857
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -3849,30 +3861,11 @@ const CascaderComponent = ({ noItem, size, classNames, variant, expandTrigger, o
|
|
|
3849
3861
|
const cascader = (jsxRuntimeExports.jsx(antd.Cascader, { allowClear: !required, size: size, className: classNames === null || classNames === void 0 ? void 0 : classNames.join(' '), variant: variant, expandTrigger: expandTrigger, open: open, disabled: disabled, suffixIcon: suffixIcon, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueCascader, defaultValue: defaultValue, options: options === null || options === void 0 ? void 0 : options.filter(item => item.value !== undefined), displayRender: displayRender, showSearch: {
|
|
3850
3862
|
filter: (search, path) => path.some(option => option.search.toLowerCase().indexOf(search.toLowerCase()) > -1),
|
|
3851
3863
|
}, onChange: onChange, onSearch: onSearch }));
|
|
3852
|
-
|
|
3853
|
-
required: required,
|
|
3854
|
-
message: ruleMessage,
|
|
3855
|
-
type: ruleType,
|
|
3856
|
-
whitespace: true,
|
|
3857
|
-
};
|
|
3858
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(Item$2, Object.assign({}, formColLayout, { name: name, label: label, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], validateStatus: validateStatus, help: help, children: cascader })))
|
|
3864
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: cascader })))
|
|
3859
3865
|
: cascader }));
|
|
3860
3866
|
};
|
|
3861
3867
|
|
|
3862
|
-
const {
|
|
3863
|
-
const FormItemComponent = ({ noItem, formColLayout, name, label, normalize, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, valuePropName, validateStatus, help, children, }) => {
|
|
3864
|
-
const rule = {
|
|
3865
|
-
required: required,
|
|
3866
|
-
message: ruleMessage,
|
|
3867
|
-
type: ruleType,
|
|
3868
|
-
whitespace: true,
|
|
3869
|
-
max: ruleMax,
|
|
3870
|
-
min: ruleMin,
|
|
3871
|
-
};
|
|
3872
|
-
return !noItem ? (jsxRuntimeExports.jsx(Item$1, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, rules: rules !== null && rules !== void 0 ? rules : [rule], valuePropName: valuePropName, validateStatus: validateStatus, help: help, children: children }))) : children;
|
|
3873
|
-
};
|
|
3874
|
-
|
|
3875
|
-
const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, children, ref, }) => {
|
|
3868
|
+
const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, children, ref, }) => {
|
|
3876
3869
|
const [checkedValue, setCheckedValue] = React.useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
3877
3870
|
const handleChange = (event) => {
|
|
3878
3871
|
var _a;
|
|
@@ -3884,7 +3877,7 @@ const CheckboxComponent = ({ noItem, loading, disabled, checked, defaultChecked,
|
|
|
3884
3877
|
setChecked: setCheckedValue,
|
|
3885
3878
|
}));
|
|
3886
3879
|
const checkbox = !loading ? (jsxRuntimeExports.jsx(antd.Checkbox, { disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedValue, defaultChecked: checkedValue, onChange: handleChange, children: children })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { active: true });
|
|
3887
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, children: checkbox })))
|
|
3880
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, valuePropName: "checked", validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: checkbox })))
|
|
3888
3881
|
: checkbox }));
|
|
3889
3882
|
};
|
|
3890
3883
|
|
|
@@ -3930,7 +3923,7 @@ var formColLayout = {
|
|
|
3930
3923
|
notInline: {},
|
|
3931
3924
|
};
|
|
3932
3925
|
|
|
3933
|
-
const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3926
|
+
const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
3934
3927
|
const [valueDate, setValueDate] = React.useState(defaultValue);
|
|
3935
3928
|
const handleChange = (date, dateString) => {
|
|
3936
3929
|
setValueDate(date);
|
|
@@ -3942,13 +3935,13 @@ const DatePickerComponent = ({ noItem, size, variant, picker, disabledDate, disa
|
|
|
3942
3935
|
}));
|
|
3943
3936
|
const classDate = [styleCSS['w-100']];
|
|
3944
3937
|
classNames && classDate.push(...classNames);
|
|
3945
|
-
const datePicker = !loading ? (jsxRuntimeExports.jsx(antd.DatePicker, {
|
|
3946
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: datePicker })))
|
|
3938
|
+
const datePicker = !loading ? (jsxRuntimeExports.jsx(antd.DatePicker, { className: classDate === null || classDate === void 0 ? void 0 : classDate.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[picker !== null && picker !== void 0 ? picker : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDate, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
3939
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
3947
3940
|
: datePicker }));
|
|
3948
3941
|
};
|
|
3949
3942
|
|
|
3950
3943
|
const { RangePicker } = antd.DatePicker;
|
|
3951
|
-
const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, ref, }) => {
|
|
3944
|
+
const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate, disabledTime, loading, disabled, value, defaultValue, onChange, style, formColLayout, name, label, classNames = [], className, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
3952
3945
|
var _a;
|
|
3953
3946
|
const [valueDateRange, setValueDateRange] = React.useState(defaultValue);
|
|
3954
3947
|
const handleChange = (date, dateStrings) => {
|
|
@@ -3961,8 +3954,8 @@ const DateRangePickerComponent = ({ noItem, size, variant, picker, disabledDate,
|
|
|
3961
3954
|
}));
|
|
3962
3955
|
const classDateRange = [styleCSS['w-100']];
|
|
3963
3956
|
classNames && classDateRange.push(...classNames);
|
|
3964
|
-
const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, {
|
|
3965
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: datePicker })))
|
|
3957
|
+
const datePicker = !loading ? (jsxRuntimeExports.jsx(RangePicker, { className: classDateRange.join(' '), classNames: className, size: size !== null && size !== void 0 ? size : 'middle', variant: variant, picker: picker, format: datePickerFormat[(_a = picker === null || picker === void 0 ? void 0 : picker.toString()) !== null && _a !== void 0 ? _a : 'default'], allowClear: !required, disabled: disabled, disabledDate: disabledDate, disabledTime: disabledTime, value: value !== null && value !== void 0 ? value : valueDateRange, onChange: handleChange, style: style })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
3958
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: datePicker })))
|
|
3966
3959
|
: datePicker }));
|
|
3967
3960
|
};
|
|
3968
3961
|
|
|
@@ -5959,7 +5952,7 @@ const LinkComponent = ({ href, children, }) => {
|
|
|
5959
5952
|
return (jsxRuntimeExports.jsx(Link$1, { to: href, children: children }));
|
|
5960
5953
|
};
|
|
5961
5954
|
|
|
5962
|
-
const DropdownButtonComponent = ({
|
|
5955
|
+
const DropdownButtonComponent = ({ trigger, placement, menuItems, disabled, data, }) => {
|
|
5963
5956
|
const items = menuItems === null || menuItems === void 0 ? void 0 : menuItems.map(menu => {
|
|
5964
5957
|
const classMenuItem = [];
|
|
5965
5958
|
switch (menu.type) {
|
|
@@ -5981,7 +5974,7 @@ const DropdownButtonComponent = ({ triger, placement, menuItems, disabled, data,
|
|
|
5981
5974
|
onClick: () => { var _a; return (_a = menu.onClick) === null || _a === void 0 ? void 0 : _a.call(menu, data); },
|
|
5982
5975
|
};
|
|
5983
5976
|
});
|
|
5984
|
-
return (jsxRuntimeExports.jsx(antd.Dropdown, { menu: { items }, placement: placement !== null && placement !== void 0 ? placement : 'bottomRight', trigger:
|
|
5977
|
+
return (jsxRuntimeExports.jsx(antd.Dropdown, { menu: { items }, placement: placement !== null && placement !== void 0 ? placement : 'bottomRight', trigger: trigger !== null && trigger !== void 0 ? trigger : ['hover'], disabled: disabled, children: jsxRuntimeExports.jsx(ButtonComponent, { size: "small", icon: jsxRuntimeExports.jsx(RefIcon$8, {}) }) }));
|
|
5985
5978
|
};
|
|
5986
5979
|
|
|
5987
5980
|
var css_248z$8 = ".style-module_icon__GHpNO {\n size: 1.5rem;\n}";
|
|
@@ -5995,12 +5988,10 @@ const IconCheckOrClose = ({ check, classNames, style, }) => {
|
|
|
5995
5988
|
return (jsxRuntimeExports.jsx(Icon, { className: classIcon.join(' '), style: style }));
|
|
5996
5989
|
};
|
|
5997
5990
|
|
|
5998
|
-
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, ref, }) => {
|
|
5991
|
+
const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNames, variant, loading, disabled, readOnly, maxLength, addonBefore, addonAfter, prefix, suffix, placeholder, value, onChange, onKeyDown, onPressEnter, onMouseEnter, onMouseLeave, onClick, onFocus, onBlur, defaultValue, formColLayout, name, label, uppercase, number, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
5999
5992
|
const [valueInput, setValueInput] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
6000
5993
|
const handleChange = (event) => {
|
|
6001
5994
|
setValueInput(event.target.value);
|
|
6002
|
-
if (noItem && name)
|
|
6003
|
-
event.target.id = name;
|
|
6004
5995
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, event);
|
|
6005
5996
|
};
|
|
6006
5997
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -6016,7 +6007,7 @@ const InputComponent = ({ noItem, password, autoFocus, allowClear, size, classNa
|
|
|
6016
6007
|
return value.replace(/\D/g, '');
|
|
6017
6008
|
return value;
|
|
6018
6009
|
};
|
|
6019
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, children: input })))
|
|
6010
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, normalize: normalize, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: input })))
|
|
6020
6011
|
: input }));
|
|
6021
6012
|
};
|
|
6022
6013
|
|
|
@@ -6053,7 +6044,7 @@ var css_248z$5 = ".style-module_number-format__F9NKi {\n box-sizing: border-box
|
|
|
6053
6044
|
var styleNumberFormat = {"number-format":"style-module_number-format__F9NKi","number-format-borderless":"style-module_number-format-borderless__DOdb8","number-format-underlined":"style-module_number-format-underlined__hUCaf","number-format-error":"style-module_number-format-error__rOvyp","number-format-sm":"style-module_number-format-sm__iLZdH","number-format-align-right":"style-module_number-format-align-right__qOFmQ"};
|
|
6054
6045
|
styleInject(css_248z$5);
|
|
6055
6046
|
|
|
6056
|
-
const NumberFormatComponent = ({ noItem, text, size, align, className, variant, trailing: trailingProps, prefix, suffix, placeholder, disabled, readOnly, allowNegative, value, defaultValue, onChange, style, onBlur, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onClick, formColLayout, name, label, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, ref, }) => {
|
|
6047
|
+
const NumberFormatComponent = ({ noItem, text, size, align, className, variant, trailing: trailingProps, prefix, suffix, placeholder, disabled, readOnly, allowNegative, value, defaultValue, onChange, style, onBlur, onKeyDown, onMouseEnter, onMouseLeave, onFocus, onClick, formColLayout, name, label, required, rules, ruleType, ruleMessage, ruleMin, ruleMax, validateStatus, help, shouldUpdate, ref, }) => {
|
|
6057
6048
|
const { trailing } = useConfig$1();
|
|
6058
6049
|
const { messageApi } = useFeedback();
|
|
6059
6050
|
const [valueNumberFormat, setValueNumberFormat] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
@@ -6091,7 +6082,7 @@ const NumberFormatComponent = ({ noItem, text, size, align, className, variant,
|
|
|
6091
6082
|
return formattedValue === '' || floatValue <= ruleMax;
|
|
6092
6083
|
return true;
|
|
6093
6084
|
}, fixedDecimalScale: true, style: style, value: value !== null && value !== void 0 ? value : valueNumberFormat, onValueChange: handleChange, onBlur: onBlur, onKeyDown: onKeyDown }) })));
|
|
6094
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, children: numberFormat })))
|
|
6085
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, ruleMax: ruleMax, ruleMin: ruleMin, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: numberFormat })))
|
|
6095
6086
|
: numberFormat }));
|
|
6096
6087
|
};
|
|
6097
6088
|
|
|
@@ -6835,7 +6826,7 @@ const SelectAsyncComponent = (_a) => {
|
|
|
6835
6826
|
}, onFocus: (!options.length || isInit) ? debounceFetcher : undefined, onSearch: debounceFetcher, notFoundContent: fetching ? jsxRuntimeExports.jsx(antd.Spin, { size: "small" }) : null, options: getOptions() })));
|
|
6836
6827
|
};
|
|
6837
6828
|
|
|
6838
|
-
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }) => {
|
|
6829
|
+
const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loading, disabled, checked, defaultChecked, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, }) => {
|
|
6839
6830
|
const [checkedSwitch, setCheckedSwitch] = React.useState(defaultChecked !== null && defaultChecked !== void 0 ? defaultChecked : false);
|
|
6840
6831
|
const handleChange = (value, event) => {
|
|
6841
6832
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, value, event);
|
|
@@ -6849,7 +6840,7 @@ const SwitchComponent = ({ noItem, icon, checkedChildren, unCheckedChildren, loa
|
|
|
6849
6840
|
unCheckedChildren,
|
|
6850
6841
|
};
|
|
6851
6842
|
const switchComponent = !loading ? (jsxRuntimeExports.jsx(antd.Switch, Object.assign({}, checkChildren, { onChange: handleChange, disabled: disabled, checked: checked !== null && checked !== void 0 ? checked : checkedSwitch, defaultChecked: checked !== null && checked !== void 0 ? checked : checkedSwitch }))) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { active: true });
|
|
6852
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: switchComponent })))
|
|
6843
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: switchComponent })))
|
|
6853
6844
|
: switchComponent }));
|
|
6854
6845
|
};
|
|
6855
6846
|
|
|
@@ -23163,15 +23154,13 @@ const TextArea = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
23163
23154
|
}))));
|
|
23164
23155
|
});
|
|
23165
23156
|
|
|
23166
|
-
const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage,
|
|
23157
|
+
const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, loading, disabled, readOnly, placeholder, value, defaultValue, onChange, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }) => {
|
|
23167
23158
|
const classTextArea = [];
|
|
23168
23159
|
className && classTextArea.push(...className);
|
|
23169
23160
|
noResize && classTextArea.push(styleTextArea['resize-none']);
|
|
23170
23161
|
const [valueTextArea, setValueTextArea] = React.useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
23171
23162
|
const handleChange = (event) => {
|
|
23172
23163
|
setValueTextArea(event.target.value);
|
|
23173
|
-
if (noItem && name)
|
|
23174
|
-
event.target.id = name;
|
|
23175
23164
|
onChange === null || onChange === void 0 ? void 0 : onChange(name, event);
|
|
23176
23165
|
};
|
|
23177
23166
|
React.useImperativeHandle(ref, () => ({
|
|
@@ -23179,13 +23168,13 @@ const TextAreaComponent = ({ noItem, noResize, size, className, rows, variant, l
|
|
|
23179
23168
|
setValue: () => setValueTextArea,
|
|
23180
23169
|
}));
|
|
23181
23170
|
const textArea = !loading ? (jsxRuntimeExports.jsx(TextArea, { size: size, className: className === null || className === void 0 ? void 0 : className.join(' '), rows: rows, variant: variant, disabled: disabled, readOnly: readOnly, onChange: handleChange, placeholder: placeholder, value: value !== null && value !== void 0 ? value : valueTextArea })) : jsxRuntimeExports.jsx(antd.Skeleton.Input, { block: true, active: true });
|
|
23182
|
-
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, children: textArea })))
|
|
23171
|
+
return (jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: !noItem ? (jsxRuntimeExports.jsx(FormItemComponent, Object.assign({}, formColLayout, { name: name, label: label, required: required, ruleMessage: ruleMessage, ruleType: ruleType, rules: rules, validateStatus: validateStatus, help: help, shouldUpdate: shouldUpdate, children: textArea })))
|
|
23183
23172
|
: textArea }));
|
|
23184
23173
|
};
|
|
23185
23174
|
|
|
23186
23175
|
const useRemoveError = (setInputErrors) => {
|
|
23187
23176
|
const removeError = (name) => {
|
|
23188
|
-
name && setInputErrors(prevState => Object.keys(prevState)
|
|
23177
|
+
name && typeof name === 'string' && setInputErrors(prevState => Object.keys(prevState)
|
|
23189
23178
|
.filter(key => key !== name)
|
|
23190
23179
|
.reduce((result, current) => {
|
|
23191
23180
|
result[current] = prevState[current];
|