sti-antd-package 0.0.9 → 0.0.11
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/Checkbox/Group/Component.d.ts +3 -0
- package/dist/components/Checkbox/Group/types.d.ts +16 -0
- package/dist/components/Checkbox/types.d.ts +11 -6
- package/dist/components/DataGrid/Component.d.ts +6 -0
- package/dist/components/DataGrid/types.d.ts +6 -0
- package/dist/components/DatePicker/types.d.ts +2 -1
- package/dist/components/DateRangePicker/types.d.ts +2 -1
- package/dist/components/Form/Item/index.d.ts +2 -0
- package/dist/components/{FormItem → Form/Item}/types.d.ts +3 -2
- package/dist/components/Form/index.d.ts +1 -0
- package/dist/components/Input/types.d.ts +2 -1
- package/dist/components/NumberFormat/types.d.ts +6 -5
- package/dist/components/Radio/Component.d.ts +3 -0
- package/dist/components/Radio/index.d.ts +2 -0
- package/dist/components/Radio/types.d.ts +24 -0
- package/dist/components/Select/types.d.ts +3 -1
- package/dist/components/Switch/types.d.ts +2 -1
- package/dist/components/TextArea/types.d.ts +2 -1
- package/dist/components/index.d.ts +7 -2
- package/dist/context/DataGrid/Context.d.ts +3 -0
- package/dist/context/DataGrid/Provider.d.ts +4 -0
- package/dist/context/DataGrid/types.d.ts +8 -0
- package/dist/helpers/colInline/function.d.ts +6 -0
- package/dist/helpers/colInline/index.d.ts +1 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useFocus/hooks.d.ts +7 -0
- package/dist/hooks/useFocus/index.d.ts +1 -0
- package/dist/hooks/useRemoveError/hook.d.ts +1 -1
- package/dist/index.d.ts +129 -64
- package/dist/index.esm.js +151 -102
- package/dist/index.js +157 -101
- package/package.json +2 -1
- package/readme.md +368 -7
- /package/dist/components/{FormItem → Checkbox/Group}/index.d.ts +0 -0
- /package/dist/components/{FormItem → Form/Item}/Component.d.ts +0 -0
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { CheckboxGroupComponentProps } from "./types";
|
|
2
|
+
declare const CheckboxComponent: <T>({ noItem, loading, disabled, options, value, defaultValue, onChange, removeError, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, shouldUpdate, ref, }: CheckboxGroupComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default CheckboxComponent;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CheckboxForm } from "../types";
|
|
2
|
+
import { CheckboxOptionType } from "antd";
|
|
3
|
+
import React, { Ref } from "react";
|
|
4
|
+
export interface CheckboxGroupComponentRef<T> {
|
|
5
|
+
value: () => T[];
|
|
6
|
+
setValue: React.Dispatch<React.SetStateAction<T[]>>;
|
|
7
|
+
}
|
|
8
|
+
interface CheckboxGroup<T> {
|
|
9
|
+
options?: (CheckboxOptionType<T> | string | number)[];
|
|
10
|
+
value?: T[];
|
|
11
|
+
defaultValue?: T[];
|
|
12
|
+
onChange?: (checkedValue: T[]) => void;
|
|
13
|
+
ref?: Ref<CheckboxGroupComponentRef<T>>;
|
|
14
|
+
}
|
|
15
|
+
export type CheckboxGroupComponentProps<T> = CheckboxGroup<T> & CheckboxForm;
|
|
16
|
+
export {};
|
|
@@ -8,13 +8,18 @@ export interface CheckboxComponentRef {
|
|
|
8
8
|
checked: () => boolean;
|
|
9
9
|
setChecked: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
interface Checkbox {
|
|
12
|
+
checked?: boolean;
|
|
13
|
+
defaultChecked?: boolean;
|
|
14
|
+
onChange?: (event: CheckboxChangeEvent) => void;
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
ref?: Ref<CheckboxComponentRef>;
|
|
17
|
+
}
|
|
18
|
+
export interface CheckboxForm {
|
|
12
19
|
noItem?: boolean;
|
|
13
20
|
loading?: boolean;
|
|
14
21
|
disabled?: boolean;
|
|
15
|
-
|
|
16
|
-
defaultChecked?: boolean;
|
|
17
|
-
onChange?: (name: NamePath | undefined, event: CheckboxChangeEvent) => void;
|
|
22
|
+
removeError?: (name?: NamePath) => void;
|
|
18
23
|
formColLayout?: typeof formColLayout;
|
|
19
24
|
name?: NamePath;
|
|
20
25
|
label?: React.ReactNode;
|
|
@@ -25,6 +30,6 @@ export interface CheckboxComponentProps {
|
|
|
25
30
|
validateStatus?: ValidateStatus;
|
|
26
31
|
help?: React.ReactNode;
|
|
27
32
|
shouldUpdate?: ShouldUpdate<string | string[]>;
|
|
28
|
-
children?: React.ReactNode;
|
|
29
|
-
ref?: Ref<CheckboxComponentRef>;
|
|
30
33
|
}
|
|
34
|
+
export type CheckboxComponentProps = Checkbox & CheckboxForm;
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "react-data-grid/lib/styles.css";
|
|
3
|
+
export declare const filterColumnClassName: string;
|
|
4
|
+
declare const DataGridComponent: React.FC;
|
|
5
|
+
export default DataGridComponent;
|
|
6
|
+
export declare const FilterRenderer: (props: any) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -24,7 +24,8 @@ export interface DatePickerComponentProps {
|
|
|
24
24
|
disabledTime?: DatePickerProps['disabledTime'];
|
|
25
25
|
value?: DatePickerProps['value'];
|
|
26
26
|
defaultValue?: DatePickerProps['value'];
|
|
27
|
-
|
|
27
|
+
removeError?: (name?: NamePath) => void;
|
|
28
|
+
onChange?: (date: Dayjs, dateStrings: string | string[]) => void;
|
|
28
29
|
style?: React.CSSProperties;
|
|
29
30
|
formColLayout?: typeof formColLayout;
|
|
30
31
|
name?: NamePath;
|
|
@@ -25,7 +25,8 @@ export interface DateRangePickerComponentProps {
|
|
|
25
25
|
disabledTime?: RangePickerProps['disabledTime'];
|
|
26
26
|
value?: RangePickerProps['value'];
|
|
27
27
|
defaultValue?: RangePickerProps['value'];
|
|
28
|
-
|
|
28
|
+
removeError?: (name?: NamePath) => void;
|
|
29
|
+
onChange?: (date: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[0], dateStrings: Parameters<NonNullable<React.ComponentProps<typeof DatePicker.RangePicker>['onChange']>>[1]) => void;
|
|
29
30
|
style?: React.CSSProperties;
|
|
30
31
|
formColLayout?: typeof formColLayout;
|
|
31
32
|
name?: NamePath;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formColLayout } from "
|
|
1
|
+
import { formColLayout } from "../../../constants";
|
|
2
2
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
3
3
|
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
4
|
import { NamePath, Rule, RuleObject, Store, StoreValue } from "rc-field-form/lib/interface";
|
|
@@ -8,11 +8,12 @@ export interface FormItemComponentProps {
|
|
|
8
8
|
formColLayout?: typeof formColLayout;
|
|
9
9
|
name?: NamePath;
|
|
10
10
|
label?: React.ReactNode;
|
|
11
|
-
normalize?: (
|
|
11
|
+
normalize?: (value: StoreValue, prevValue: StoreValue, allValues: Store) => StoreValue;
|
|
12
12
|
required?: boolean;
|
|
13
13
|
rules?: Rule[];
|
|
14
14
|
ruleType?: RuleObject['type'];
|
|
15
15
|
ruleMessage?: string;
|
|
16
|
+
ruleTransform?: (value: StoreValue) => StoreValue;
|
|
16
17
|
ruleMin?: number;
|
|
17
18
|
ruleMax?: number;
|
|
18
19
|
valuePropName?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Form } from "antd";
|
|
@@ -31,7 +31,8 @@ export interface InputComponentProps {
|
|
|
31
31
|
placeholder?: string;
|
|
32
32
|
value?: valueType;
|
|
33
33
|
defaultValue?: valueType;
|
|
34
|
-
|
|
34
|
+
removeError?: (name?: NamePath) => void;
|
|
35
|
+
onChange?: React.ChangeEventHandler<HTMLInputElement>;
|
|
35
36
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
36
37
|
onPressEnter?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
37
38
|
onMouseEnter?: React.MouseEventHandler<HTMLInputElement>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { formColLayout } from "../../constants";
|
|
2
2
|
import { valueType } from "antd/es/statistic/utils";
|
|
3
3
|
import { ShouldUpdate } from "rc-field-form/lib/Field";
|
|
4
|
-
import { NamePath, Rule
|
|
4
|
+
import { NamePath, Rule } from "rc-field-form/lib/interface";
|
|
5
5
|
import { Ref } from "react";
|
|
6
|
-
import {
|
|
6
|
+
import { OnValueChange } from "react-number-format";
|
|
7
7
|
export interface NumberFormatComponentRef {
|
|
8
8
|
value: () => valueType;
|
|
9
9
|
setValue: React.Dispatch<React.SetStateAction<valueType>>;
|
|
@@ -13,7 +13,7 @@ export interface NumberFormatComponentProps {
|
|
|
13
13
|
text?: boolean;
|
|
14
14
|
size?: 'small';
|
|
15
15
|
align?: 'right';
|
|
16
|
-
|
|
16
|
+
classNames?: string[];
|
|
17
17
|
variant?: 'borderless' | 'underlined';
|
|
18
18
|
trailing?: number;
|
|
19
19
|
prefix?: string;
|
|
@@ -24,7 +24,9 @@ export interface NumberFormatComponentProps {
|
|
|
24
24
|
allowNegative?: boolean;
|
|
25
25
|
value?: valueType;
|
|
26
26
|
defaultValue?: valueType;
|
|
27
|
-
|
|
27
|
+
removeError?: (name?: NamePath) => void;
|
|
28
|
+
onValueChange?: OnValueChange;
|
|
29
|
+
onChange?: (value?: number) => void;
|
|
28
30
|
style?: React.CSSProperties;
|
|
29
31
|
onBlur?: React.FocusEventHandler<HTMLInputElement>;
|
|
30
32
|
onKeyDown?: React.KeyboardEventHandler<HTMLInputElement>;
|
|
@@ -37,7 +39,6 @@ export interface NumberFormatComponentProps {
|
|
|
37
39
|
label?: React.ReactNode;
|
|
38
40
|
required?: boolean;
|
|
39
41
|
rules?: Rule[];
|
|
40
|
-
ruleType?: RuleObject['type'];
|
|
41
42
|
ruleMessage?: string;
|
|
42
43
|
ruleMin?: number;
|
|
43
44
|
ruleMax?: number;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RadioComponentProps } from "./types";
|
|
2
|
+
declare const RadioComponent: <T>({ buttonStyle, options, optionType, onChange, noItem, loading, disabled, removeError, formColLayout, name, label, required, rules, ruleType, ruleMessage, validateStatus, help, }: RadioComponentProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export default RadioComponent;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { formColLayout } from "../../constants";
|
|
2
|
+
import { CheckboxOptionType, RadioChangeEvent } from "antd";
|
|
3
|
+
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
4
|
+
import { RadioGroupButtonStyle, RadioGroupOptionType } from "antd/lib/radio";
|
|
5
|
+
import { NamePath, Rule, RuleObject } from "rc-field-form/lib/interface";
|
|
6
|
+
export interface RadioComponentProps<T> {
|
|
7
|
+
buttonStyle?: RadioGroupButtonStyle;
|
|
8
|
+
options?: (CheckboxOptionType<T> | string | number)[];
|
|
9
|
+
optionType?: RadioGroupOptionType;
|
|
10
|
+
onChange?: (event: RadioChangeEvent) => void;
|
|
11
|
+
noItem?: boolean;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
removeError?: (name?: NamePath) => void;
|
|
15
|
+
formColLayout?: typeof formColLayout;
|
|
16
|
+
name?: NamePath;
|
|
17
|
+
label?: React.ReactNode;
|
|
18
|
+
required?: boolean;
|
|
19
|
+
rules?: Rule[];
|
|
20
|
+
ruleType?: RuleObject['type'];
|
|
21
|
+
ruleMessage?: string;
|
|
22
|
+
validateStatus?: ValidateStatus;
|
|
23
|
+
help?: React.ReactNode;
|
|
24
|
+
}
|
|
@@ -5,6 +5,7 @@ import { SizeType } from "antd/es/config-provider/SizeContext";
|
|
|
5
5
|
import { Rule, RuleObject } from "antd/es/form";
|
|
6
6
|
import { ValidateStatus } from "antd/es/form/FormItem";
|
|
7
7
|
import { DefaultOptionType } from "antd/es/select";
|
|
8
|
+
import { NamePath } from "rc-field-form/lib/interface";
|
|
8
9
|
export type SelectOption = (DefaultOptionType & {
|
|
9
10
|
text?: React.ReactNode;
|
|
10
11
|
encryption_id?: string;
|
|
@@ -24,7 +25,8 @@ export interface SelectComponentProps {
|
|
|
24
25
|
placeholder?: React.ReactNode;
|
|
25
26
|
value?: any;
|
|
26
27
|
defaultValue?: any;
|
|
27
|
-
|
|
28
|
+
removeError?: (name?: NamePath) => void;
|
|
29
|
+
onChange?: (value: any, option?: SelectOption | SelectOption[]) => void;
|
|
28
30
|
onKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
|
|
29
31
|
onSearch?: (value: string) => void;
|
|
30
32
|
onFocus?: React.FocusEventHandler<HTMLElement>;
|
|
@@ -12,7 +12,8 @@ export interface SwitchComponentProps {
|
|
|
12
12
|
disabled?: boolean;
|
|
13
13
|
checked?: boolean;
|
|
14
14
|
defaultChecked?: boolean;
|
|
15
|
-
|
|
15
|
+
removeError?: (name?: NamePath) => void;
|
|
16
|
+
onChange?: (checked: boolean, event: React.MouseEvent<HTMLButtonElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
|
|
16
17
|
formColLayout?: typeof formColLayout;
|
|
17
18
|
name?: NamePath;
|
|
18
19
|
label?: React.ReactNode;
|
|
@@ -23,7 +23,8 @@ export interface TextAreaComponentProps {
|
|
|
23
23
|
placeholder?: string;
|
|
24
24
|
value?: valueType;
|
|
25
25
|
defaultValue?: valueType;
|
|
26
|
-
|
|
26
|
+
removeError?: (name?: NamePath) => void;
|
|
27
|
+
onChange?: React.ChangeEventHandler<HTMLTextAreaElement>;
|
|
27
28
|
formColLayout?: typeof formColLayout;
|
|
28
29
|
name?: NamePath;
|
|
29
30
|
label?: React.ReactNode;
|
|
@@ -10,14 +10,17 @@ export { default as CascaderComponent } from "./Cascader";
|
|
|
10
10
|
export type { CascaderComponentProps, CascaderComponentRef } from "./Cascader";
|
|
11
11
|
export { default as CheckboxComponent } from "./Checkbox";
|
|
12
12
|
export type { CheckboxComponentProps, CheckboxComponentRef } from "./Checkbox";
|
|
13
|
+
export { default as CheckboxGroupComponent } from "./Checkbox/Group";
|
|
14
|
+
export type { CheckboxGroupComponentProps, CheckboxGroupComponentRef } from "./Checkbox/Group";
|
|
13
15
|
export { default as DatePickerComponent } from "./DatePicker";
|
|
14
16
|
export type { DatePickerComponentProps, DatePickerComponentRef } from "./DatePicker";
|
|
15
17
|
export { default as DateRangePickerComponent } from "./DateRangePicker";
|
|
16
18
|
export type { DateRangePickerComponentProps, DateRangePickerComponentRef } from "./DateRangePicker";
|
|
17
19
|
export { default as DropdownButtonComponent } from "./DropdownButton";
|
|
18
20
|
export type { DropdownButtonComponentProps, DropdownButtonMenuItem } from "./DropdownButton";
|
|
19
|
-
export {
|
|
20
|
-
export
|
|
21
|
+
export { Form } from "./Form";
|
|
22
|
+
export { default as FormItemComponent } from "./Form/Item";
|
|
23
|
+
export type { FormItemComponentProps } from "./Form/Item";
|
|
21
24
|
export { default as IconCheckOrClose } from "./Icon/CheckOrClose";
|
|
22
25
|
export type { IconCheckOrCloseProps } from "./Icon/CheckOrClose";
|
|
23
26
|
export { default as InputComponent } from "./Input";
|
|
@@ -26,6 +29,8 @@ export { default as LinkComponent } from "./Link";
|
|
|
26
29
|
export type { LinkComponentProps } from "./Link";
|
|
27
30
|
export { default as NumberFormatComponent } from "./NumberFormat";
|
|
28
31
|
export type { NumberFormatComponentProps, NumberFormatComponentRef } from "./NumberFormat";
|
|
32
|
+
export { default as RadioComponent } from "./Radio";
|
|
33
|
+
export type { RadioComponentProps } from "./Radio";
|
|
29
34
|
export { default as SelectComponent } from "./Select";
|
|
30
35
|
export type { SelectComponentProps, SelectOption } from "./Select";
|
|
31
36
|
export { default as SelectAsyncComponent } from "./Select/Async";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./function";
|
package/dist/helpers/index.d.ts
CHANGED
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "./hooks";
|