x-ui-design 0.2.8 → 0.2.10

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.
Files changed (60) hide show
  1. package/compile.sh +14 -0
  2. package/dist/esm/types/components/Button/Button.client.d.ts +1 -1
  3. package/dist/esm/types/components/Button/Button.d.ts +1 -1
  4. package/dist/esm/types/components/Checkbox/Checkbox.client.d.ts +23 -0
  5. package/dist/esm/types/components/Checkbox/Checkbox.d.ts +7 -0
  6. package/dist/esm/types/components/Checkbox/index.d.ts +1 -0
  7. package/dist/esm/types/components/Empty/Empty.d.ts +4 -0
  8. package/dist/esm/types/components/Empty/index.d.ts +1 -0
  9. package/dist/esm/types/components/Form/Form.d.ts +7 -0
  10. package/dist/esm/types/components/Form/Item/Item.d.ts +7 -0
  11. package/dist/esm/types/components/Form/Item/index.d.ts +1 -0
  12. package/dist/esm/types/components/Form/index.d.ts +1 -0
  13. package/dist/esm/types/hooks/useForm.d.ts +4 -0
  14. package/dist/esm/types/hooks/useWatch.d.ts +9 -0
  15. package/dist/esm/types/index.d.ts +4 -0
  16. package/dist/esm/types/types/checkbox.d.ts +22 -0
  17. package/dist/esm/types/types/datepicker.d.ts +119 -0
  18. package/dist/esm/types/types/empty.d.ts +7 -0
  19. package/dist/esm/types/types/form.d.ts +107 -0
  20. package/dist/esm/types/types/input.d.ts +47 -0
  21. package/dist/esm/types/types/radio.d.ts +57 -0
  22. package/dist/esm/types/types/select.d.ts +97 -0
  23. package/dist/esm/types/types/skeleton.d.ts +50 -0
  24. package/dist/esm/types/types/upload.d.ts +54 -0
  25. package/dist/index.d.ts +23 -43
  26. package/dist/index.esm.js +592 -8
  27. package/dist/index.esm.js.map +1 -1
  28. package/dist/index.js +594 -6
  29. package/dist/index.js.map +1 -1
  30. package/lib/components/Button/Button.client.tsx +2 -2
  31. package/lib/components/Button/Button.tsx +3 -3
  32. package/{src/components/Checkbox/Checkbox.tsx → lib/components/Checkbox/Checkbox.client.tsx} +7 -8
  33. package/lib/components/Checkbox/Checkbox.tsx +59 -0
  34. package/lib/components/Checkbox/index.ts +1 -0
  35. package/{src → lib}/components/Empty/Empty.tsx +2 -2
  36. package/{src → lib}/components/Form/Form.tsx +1 -1
  37. package/{src → lib}/components/Form/Item/Item.tsx +5 -5
  38. package/{src → lib}/hooks/useForm.ts +2 -2
  39. package/{src → lib}/hooks/useWatch.ts +3 -3
  40. package/lib/index.ts +6 -0
  41. package/{src → lib}/types/checkbox.ts +1 -1
  42. package/package.json +2 -2
  43. package/src/app/page.tsx +2 -0
  44. package/rollup.sh +0 -5
  45. package/src/components/Checkbox/index.ts +0 -1
  46. package/src/types/index.ts +0 -27
  47. /package/{src → lib}/components/Checkbox/style.css +0 -0
  48. /package/{src → lib}/components/Empty/index.ts +0 -0
  49. /package/{src → lib}/components/Empty/style.css +0 -0
  50. /package/{src → lib}/components/Form/Item/index.ts +0 -0
  51. /package/{src → lib}/components/Form/Item/style.css +0 -0
  52. /package/{src → lib}/components/Form/index.ts +0 -0
  53. /package/{src → lib}/types/datepicker.ts +0 -0
  54. /package/{src → lib}/types/empty.ts +0 -0
  55. /package/{src → lib}/types/form.ts +0 -0
  56. /package/{src → lib}/types/input.ts +0 -0
  57. /package/{src → lib}/types/radio.ts +0 -0
  58. /package/{src → lib}/types/select.ts +0 -0
  59. /package/{src → lib}/types/skeleton.ts +0 -0
  60. /package/{src → lib}/types/upload.ts +0 -0
package/compile.sh ADDED
@@ -0,0 +1,14 @@
1
+ rm -rf .history
2
+ rm -rf .rollup.cache
3
+ rm -rf dist
4
+
5
+ yarn rollup
6
+
7
+ git add .
8
+ git commit -m "Push command from compile"
9
+
10
+ npm version patch
11
+
12
+ git push origin main
13
+
14
+ npm publish
@@ -1,3 +1,3 @@
1
- import { ButtonProps } from '../../types/button';
1
+ import { ButtonProps } from 'lib/types/button';
2
2
  declare const ButtonClient: (props: ButtonProps) => import("react/jsx-runtime").JSX.Element;
3
3
  export default ButtonClient;
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, ReactNode } from 'react';
2
- import { ButtonProps } from '../../types/button';
2
+ import { ButtonProps } from 'lib/types/button';
3
3
  import './style.css';
4
4
  declare const Button: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, iconPosition, disabled, ghost, danger, block, children, href, iconNode, isLoading, ...restProps }: ButtonProps & {
5
5
  iconNode?: ReactNode;
@@ -0,0 +1,23 @@
1
+ import { MouseEvent } from 'react';
2
+ import './style.css';
3
+ declare const CheckboxClient: import("react").ForwardRefExoticComponent<import("lib/types").DefaultProps & {
4
+ disabled?: boolean;
5
+ onChange?: (e: MouseEvent<HTMLInputElement> & import("lib/types").TargetProps) => void;
6
+ onClick?: import("react").MouseEventHandler<HTMLElement>;
7
+ onMouseEnter?: import("react").MouseEventHandler<HTMLElement>;
8
+ onMouseLeave?: import("react").MouseEventHandler<HTMLElement>;
9
+ onKeyPress?: import("react").KeyboardEventHandler<HTMLElement>;
10
+ onKeyDown?: import("react").KeyboardEventHandler<HTMLElement>;
11
+ value?: boolean;
12
+ tabIndex?: number;
13
+ name?: string;
14
+ children?: import("react").ReactNode;
15
+ id?: string;
16
+ autoFocus?: boolean;
17
+ type?: string;
18
+ skipGroup?: boolean;
19
+ required?: boolean;
20
+ defaultChecked?: boolean;
21
+ checked?: boolean;
22
+ } & import("react").RefAttributes<HTMLDivElement>>;
23
+ export default CheckboxClient;
@@ -0,0 +1,7 @@
1
+ import { ReactElement } from 'react';
2
+ import { CheckboxProps } from 'lib/types/checkbox';
3
+ declare const Checkbox: {
4
+ ({ prefixCls, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle }: CheckboxProps): ReactElement;
5
+ displayName: string;
6
+ };
7
+ export default Checkbox;
@@ -0,0 +1 @@
1
+ export { default as Checkbox } from './Checkbox';
@@ -0,0 +1,4 @@
1
+ import { EmptyContentProps } from 'lib/types/empty';
2
+ import './style.css';
3
+ declare const EmptyContent: ({ icon, style, className, title, description, prefixCls }: EmptyContentProps) => import("react/jsx-runtime").JSX.Element;
4
+ export default EmptyContent;
@@ -0,0 +1 @@
1
+ export { default as Empty } from '@/components/Empty/Empty';
@@ -0,0 +1,7 @@
1
+ import { FC } from 'react';
2
+ import { FormInstance, FormItemProps, FormProps } from '../../types/form';
3
+ export declare const FormContext: import("react").Context<FormInstance | null>;
4
+ declare const Form: FC<FormProps> & {
5
+ Item: FC<FormItemProps>;
6
+ };
7
+ export default Form;
@@ -0,0 +1,7 @@
1
+ import { FormItemProps } from 'lib/types/form';
2
+ import './style.css';
3
+ declare const FormItem: {
4
+ ({ prefixCls, name, label, rules, children, className, layout, style, valuePropName, dependencies, initialValue, feedbackIcons, ...props }: FormItemProps): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export default FormItem;
@@ -0,0 +1 @@
1
+ export { default as Item } from './Item';
@@ -0,0 +1 @@
1
+ export { default as Form } from './Form';
@@ -0,0 +1,4 @@
1
+ import { RuleTypes } from 'lib/types';
2
+ import type { FieldData, FormInstance } from 'lib/types/form';
3
+ declare const useForm: (initialValues?: Record<string, RuleTypes>, onFieldsChange?: (changedFields: FieldData[]) => void, onValuesChange?: (changedValues: Record<string, RuleTypes>, allValues: Record<string, RuleTypes>) => void) => FormInstance;
4
+ export { useForm };
@@ -0,0 +1,9 @@
1
+ import { RuleType } from 'lib/types';
2
+ import { FormInstance } from 'lib/types/form';
3
+ type UseWatchProps = {
4
+ name?: string;
5
+ defaultValue?: RuleType;
6
+ form?: FormInstance;
7
+ };
8
+ export declare const useWatch: ({ name, defaultValue, form }: UseWatchProps) => any;
9
+ export {};
@@ -1,2 +1,6 @@
1
1
  import './styles/global.css';
2
+ export { default as Empty } from "./components/Empty/Empty";
2
3
  export { default as Button } from "./components/Button/Button";
4
+ export { default as Checkbox } from "./components/Checkbox/Checkbox";
5
+ export { useForm } from './hooks/useForm';
6
+ export { useWatch } from './hooks/useWatch';
@@ -0,0 +1,22 @@
1
+ import { KeyboardEventHandler, MouseEvent, MouseEventHandler, ReactNode } from 'react';
2
+ import { DefaultProps, TargetProps } from '.';
3
+ export type CheckboxProps = DefaultProps & {
4
+ disabled?: boolean;
5
+ onChange?: (e: MouseEvent<HTMLInputElement> & TargetProps) => void;
6
+ onClick?: MouseEventHandler<HTMLElement>;
7
+ onMouseEnter?: MouseEventHandler<HTMLElement>;
8
+ onMouseLeave?: MouseEventHandler<HTMLElement>;
9
+ onKeyPress?: KeyboardEventHandler<HTMLElement>;
10
+ onKeyDown?: KeyboardEventHandler<HTMLElement>;
11
+ value?: boolean;
12
+ tabIndex?: number;
13
+ name?: string;
14
+ children?: ReactNode;
15
+ id?: string;
16
+ autoFocus?: boolean;
17
+ type?: string;
18
+ skipGroup?: boolean;
19
+ required?: boolean;
20
+ defaultChecked?: boolean;
21
+ checked?: boolean;
22
+ };
@@ -0,0 +1,119 @@
1
+ import { FocusEvent, ReactNode } from 'react';
2
+ import { DefaultProps, RuleType, SizeType } from '.';
3
+ export interface BaseInfo {
4
+ range?: 'start' | 'end';
5
+ source?: string;
6
+ }
7
+ export type CustomFormat<RuleType> = (value: RuleType) => string;
8
+ export type FormatType<DateType = RuleType> = string | CustomFormat<DateType>;
9
+ export type PanelMode = 'time' | 'date' | 'week' | 'month' | 'quarter' | 'year' | 'decade';
10
+ export type TDatePickerProps = DefaultProps & {
11
+ value?: Date;
12
+ disabled?: boolean;
13
+ placeholder?: string;
14
+ error?: boolean;
15
+ feedbackIcons?: boolean;
16
+ locale?: Locale;
17
+ placement?: string;
18
+ defaultOpen?: boolean;
19
+ allowClear?: boolean | {
20
+ clearIcon?: ReactNode;
21
+ };
22
+ defaultValue?: Date;
23
+ disabledDate?: (date: RuleType, info: {
24
+ to: RuleType;
25
+ from?: RuleType;
26
+ }) => boolean;
27
+ suffixIcon?: ReactNode;
28
+ prefix?: ReactNode;
29
+ size?: SizeType;
30
+ format?: FormatType<RuleType> | FormatType<RuleType>[] | {
31
+ format: string;
32
+ type?: 'mask';
33
+ };
34
+ onChange?: (date: RuleType | RuleType[], dateString: string | string[]) => void;
35
+ onCalendarChange?: (date: RuleType | RuleType[], dateString: string | string[], info: BaseInfo) => void;
36
+ getPopupContainer?: (node: HTMLElement) => HTMLElement;
37
+ showToday?: boolean;
38
+ inputReadOnly?: boolean;
39
+ picker?: PanelMode;
40
+ bordered?: boolean;
41
+ };
42
+ export type TRangePickerProps = Omit<TDatePickerProps, 'placeholder' | 'value' | 'defaultValue'> & {
43
+ placeholder?: string[];
44
+ value?: Date[];
45
+ defaultValue?: Date[];
46
+ separator?: ReactNode;
47
+ };
48
+ export type Locale = {
49
+ locale: string;
50
+ dateFormat?: string;
51
+ dateTimeFormat?: string;
52
+ fieldDateTimeFormat?: string;
53
+ fieldDateFormat?: string;
54
+ fieldTimeFormat?: string;
55
+ fieldMonthFormat?: string;
56
+ fieldYearFormat?: string;
57
+ fieldWeekFormat?: string;
58
+ fieldQuarterFormat?: string;
59
+ monthBeforeYear?: boolean;
60
+ yearFormat?: string;
61
+ monthFormat?: string;
62
+ cellYearFormat?: string;
63
+ cellQuarterFormat?: string;
64
+ dayFormat?: string;
65
+ cellDateFormat?: string;
66
+ cellMeridiemFormat?: string;
67
+ today: string;
68
+ now: string;
69
+ backToToday: string;
70
+ ok: string;
71
+ timeSelect: string;
72
+ dateSelect: string;
73
+ weekSelect?: string;
74
+ clear: string;
75
+ week: string;
76
+ month: string;
77
+ year: string;
78
+ previousMonth: string;
79
+ nextMonth: string;
80
+ monthSelect: string;
81
+ yearSelect: string;
82
+ decadeSelect: string;
83
+ previousYear: string;
84
+ nextYear: string;
85
+ previousDecade: string;
86
+ nextDecade: string;
87
+ previousCentury: string;
88
+ nextCentury: string;
89
+ shortWeekDays?: string[];
90
+ shortMonths?: string[];
91
+ };
92
+ export interface DisabledTimes {
93
+ disabledHours?: () => number[];
94
+ disabledMinutes?: (hour: number) => number[];
95
+ disabledSeconds?: (hour: number, minute: number) => number[];
96
+ }
97
+ export type PickerFocusEventHandler = (e: FocusEvent<HTMLElement>, info: BaseInfo) => void;
98
+ export type DisabledDate<DateType = RuleType> = (date: DateType, info: {
99
+ type: PanelMode;
100
+ from?: DateType;
101
+ }) => boolean;
102
+ export type TimePickerProps = DefaultProps & {
103
+ disabledTime?: (date: RuleType) => DisabledTimes;
104
+ inputReadOnly?: boolean;
105
+ format?: FormatType<RuleType> | FormatType<RuleType>[] | {
106
+ format: string;
107
+ type?: 'mask';
108
+ };
109
+ defaultValue?: RuleType | null;
110
+ value?: RuleType | null;
111
+ onChange?: (date: RuleType, dateString: string | string[]) => void;
112
+ onBlur?: PickerFocusEventHandler;
113
+ onSelect?: ((value: Date | null) => void) | undefined;
114
+ showNow?: boolean;
115
+ clearIcon?: ReactNode;
116
+ getPopupContainer?: (node: HTMLElement) => HTMLElement;
117
+ suffixIcon?: ReactNode;
118
+ placeholder?: string;
119
+ };
@@ -0,0 +1,7 @@
1
+ import { ReactNode } from 'react';
2
+ import { DefaultProps } from '.';
3
+ export type EmptyContentProps = DefaultProps & {
4
+ title?: string;
5
+ description?: string;
6
+ icon?: ReactNode;
7
+ };
@@ -0,0 +1,107 @@
1
+ import { ComponentClass, FC, FormEvent, ReactElement, ReactNode } from 'react';
2
+ import { DefaultProps, RuleType, RuleTypes, SizeType, SyntheticBaseEvent } from '.';
3
+ import { OptionProps } from './select';
4
+ export type RuleRender = (form: FormInstance) => RuleObject;
5
+ export type RuleObject = RuleRender | {
6
+ required?: boolean;
7
+ message?: string;
8
+ pattern?: RegExp;
9
+ min?: number;
10
+ max?: number;
11
+ warningPattern?: RegExp;
12
+ warningMessage?: string;
13
+ validator?: (rule: RuleObject, value: RuleTypes, callback: (error?: string) => void) => Promise<void> | void;
14
+ };
15
+ export interface FieldData {
16
+ name: string | string[];
17
+ value?: RuleTypes;
18
+ errors?: string[];
19
+ }
20
+ export type FieldInstancesInputRef = HTMLInputElement | null;
21
+ export type FieldInstancesRef = {
22
+ input?: FieldInstancesInputRef;
23
+ };
24
+ export interface FieldError {
25
+ name: string;
26
+ errors: string[];
27
+ }
28
+ type FormLayoutTypes = 'horizontal' | 'vertical' | 'inline';
29
+ export type FormProps = DefaultProps & {
30
+ colon?: boolean;
31
+ name?: string;
32
+ layout?: FormLayoutTypes;
33
+ form?: FormInstance;
34
+ size?: SizeType;
35
+ initialValues?: Record<string, RuleTypes>;
36
+ children?: ReactNode;
37
+ component?: false | string | FC<ReactNode> | ComponentClass<ReactNode>;
38
+ fields?: FieldData[];
39
+ onChange?: (e: FormEvent<HTMLFormElement>) => void;
40
+ onFieldsChange?: (changedFields: FieldData[]) => void;
41
+ onSubmitCapture?: (changedFields: FieldData[]) => void;
42
+ onValuesChange?: (changedValues: Record<string, RuleTypes>, allValues: Record<string, RuleTypes>) => void;
43
+ onFinish?: (values: Record<string, RuleTypes>) => void;
44
+ onFinishFailed?: (errorInfo: {
45
+ values: Record<string, RuleTypes>;
46
+ errorFields: Pick<FieldError, 'errors' | 'name'>[];
47
+ }) => void;
48
+ };
49
+ export type FormItemProps = DefaultProps & {
50
+ name: string;
51
+ label?: string | ReactNode;
52
+ rules?: RuleObject[];
53
+ initialValue?: RuleType;
54
+ children: (ReactElement & {
55
+ props: {
56
+ value: RuleTypes;
57
+ };
58
+ }) | (ReactElement & {
59
+ props: {
60
+ value: RuleTypes;
61
+ };
62
+ })[];
63
+ layout?: FormLayoutTypes;
64
+ valuePropName?: string;
65
+ dependencies?: string[];
66
+ normalize?: (value: RuleType, prevValue: RuleType, allValues: RuleType) => RuleType;
67
+ feedbackIcons?: boolean;
68
+ };
69
+ export interface FormItemChildComponentProps {
70
+ child: React.ReactElement;
71
+ name: string;
72
+ error: boolean;
73
+ fieldValue: RuleTypes;
74
+ value: RuleType;
75
+ setFieldValue: (name: string, value: RuleType) => void;
76
+ onChange?: (e: SyntheticBaseEvent, option?: OptionProps) => void;
77
+ valuePropName?: string;
78
+ size?: SizeType;
79
+ normalize?: (value: RuleType, prevValue: RuleType, allValues: RuleType) => RuleType;
80
+ noStyle?: boolean;
81
+ feedbackIcons?: boolean;
82
+ }
83
+ export interface FormInstance {
84
+ submit: () => Promise<Record<string, RuleTypes> | undefined>;
85
+ setFields: (fields: FieldData[]) => void;
86
+ resetFields: (nameList?: string[]) => void;
87
+ getFieldError: (name: string) => string[];
88
+ registerField: (name: string, rules?: RuleObject[]) => void;
89
+ setFieldValue: (name: string, value: RuleTypes) => void;
90
+ getFieldValue: (name: string) => RuleTypes;
91
+ validateFields: (nameList?: string[]) => Promise<boolean>;
92
+ setFieldsValue: (values: Partial<Record<string, RuleTypes>>) => void;
93
+ getFieldsValue: (nameList?: string[]) => Record<string, RuleTypes>;
94
+ isFieldTouched: (name: string) => boolean;
95
+ getFieldsError: () => Pick<FieldError, 'errors' | 'name'>[];
96
+ isFieldsTouched: (nameList?: string[], allFieldsTouched?: boolean) => boolean;
97
+ getFieldWarning: (name: string) => string[];
98
+ subscribeToField: (name: string, callback: (value: RuleTypes) => void) => () => void;
99
+ subscribeToForm: (callback: (values: Record<string, RuleTypes>) => void) => () => void;
100
+ subscribeToFields: (names: string[], callback: (values: Record<string, RuleTypes>) => void) => () => void;
101
+ isFieldValidating: (name: string) => boolean;
102
+ onFieldsChange?: (changedFields: FieldData[]) => void;
103
+ onValuesChange?: (changedValues: Record<string, RuleTypes>, allValues: Record<string, RuleTypes>) => void;
104
+ getFieldInstance: (fieldName: string) => FieldInstancesRef;
105
+ isReseting: boolean;
106
+ }
107
+ export {};
@@ -0,0 +1,47 @@
1
+ import { CSSProperties, InputHTMLAttributes, KeyboardEvent, KeyboardEventHandler, MouseEventHandler, ReactElement, ReactNode, TextareaHTMLAttributes } from 'react';
2
+ import { DefaultProps, SizeType, SyntheticBaseEvent } from '.';
3
+ export type InputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> & DefaultProps & {
4
+ addonBefore?: ReactNode;
5
+ addonAfter?: ReactNode;
6
+ size?: SizeType;
7
+ prefix?: ReactNode;
8
+ suffix?: ReactNode;
9
+ disabled?: boolean;
10
+ allowClear?: boolean;
11
+ error?: boolean;
12
+ bordered?: boolean;
13
+ iconRender?: (visible: boolean) => ReactElement;
14
+ onChange?: (event: SyntheticBaseEvent) => void;
15
+ onClick?: MouseEventHandler<HTMLElement>;
16
+ onMouseEnter?: MouseEventHandler<HTMLElement>;
17
+ onMouseLeave?: MouseEventHandler<HTMLElement>;
18
+ onKeyPress?: KeyboardEventHandler<HTMLElement>;
19
+ onKeyDown?: KeyboardEventHandler<HTMLElement>;
20
+ onPressEnter?: (event: KeyboardEvent<HTMLInputElement>) => void;
21
+ feedbackIcons?: boolean;
22
+ };
23
+ export type TextareaProps = Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, 'onResize'> & DefaultProps & {
24
+ value?: string;
25
+ className?: string;
26
+ style?: CSSProperties;
27
+ autoSize?: boolean | {
28
+ minRows?: number;
29
+ maxRows?: number;
30
+ };
31
+ onPressEnter?: KeyboardEventHandler<HTMLTextAreaElement>;
32
+ onResize?: (size: {
33
+ width: number;
34
+ height: number;
35
+ }) => void;
36
+ styles?: {
37
+ textarea?: CSSProperties;
38
+ count?: CSSProperties;
39
+ };
40
+ bordered?: boolean;
41
+ size?: SizeType;
42
+ status?: 'success' | 'error';
43
+ rootClassName?: string;
44
+ variant?: 'outlined' | 'borderless' | 'filled' | 'underlined';
45
+ error?: boolean;
46
+ allowClear?: boolean;
47
+ };
@@ -0,0 +1,57 @@
1
+ import { CSSProperties, FocusEventHandler, KeyboardEventHandler, MouseEventHandler, ReactNode } from 'react';
2
+ import { DefaultProps, RuleType, SizeType, SyntheticBaseEvent } from '.';
3
+ export type RadioValueType = string | number | readonly string[] | undefined;
4
+ export interface RadioGroupProps {
5
+ defaultValue?: RuleType;
6
+ value?: RuleType;
7
+ onChange?: (e: SyntheticBaseEvent) => void;
8
+ size?: SizeType;
9
+ disabled?: boolean;
10
+ onMouseEnter?: MouseEventHandler<HTMLDivElement>;
11
+ onMouseLeave?: MouseEventHandler<HTMLDivElement>;
12
+ name?: string;
13
+ children?: ReactNode;
14
+ id?: string;
15
+ optionType?: 'default' | 'button';
16
+ buttonStyle?: 'outline' | 'solid';
17
+ onFocus?: FocusEventHandler<HTMLDivElement>;
18
+ onBlur?: FocusEventHandler<HTMLDivElement>;
19
+ block?: boolean;
20
+ prefixCls?: string;
21
+ className?: string;
22
+ options?: Array<{
23
+ label: ReactNode;
24
+ value: RuleType;
25
+ disabled?: boolean;
26
+ }> | string[] | number[];
27
+ style?: CSSProperties;
28
+ }
29
+ export type RadioProps = DefaultProps & {
30
+ defaultChecked?: boolean;
31
+ checked?: boolean;
32
+ disabled?: boolean;
33
+ title?: string;
34
+ onChange?: (e: SyntheticBaseEvent) => void;
35
+ onClick?: MouseEventHandler<HTMLElement>;
36
+ onMouseEnter?: MouseEventHandler<HTMLElement>;
37
+ onMouseLeave?: MouseEventHandler<HTMLElement>;
38
+ onKeyPress?: KeyboardEventHandler<HTMLElement>;
39
+ onKeyDown?: KeyboardEventHandler<HTMLElement>;
40
+ onFocus?: FocusEventHandler<HTMLInputElement>;
41
+ onBlur?: FocusEventHandler<HTMLInputElement>;
42
+ value?: RuleType;
43
+ tabIndex?: number;
44
+ name?: string;
45
+ children?: ReactNode;
46
+ id?: string;
47
+ autoFocus?: boolean;
48
+ type?: string;
49
+ skipGroup?: boolean;
50
+ required?: boolean;
51
+ button?: boolean;
52
+ error?: boolean;
53
+ };
54
+ export type RadioButtonProps = RadioProps & {
55
+ children?: ReactNode;
56
+ size?: SizeType;
57
+ };
@@ -0,0 +1,97 @@
1
+ import { ChangeEventHandler, CSSProperties, FocusEventHandler, Key, KeyboardEventHandler, MouseEvent, MouseEventHandler, ReactElement, ReactEventHandler, ReactNode } from 'react';
2
+ import { DefaultProps, RuleType, RuleTypes, TargetProps } from '.';
3
+ export type SelectProps = DefaultProps & {
4
+ id?: string;
5
+ searchValue?: string;
6
+ onSearch?: (value: string) => void;
7
+ autoClearSearchValue?: boolean;
8
+ onSelect?: (value: RuleTypes, option?: OptionType) => void;
9
+ onDeselect?: (value: string, option?: OptionType) => void;
10
+ filterOption?: boolean | ((input: string, option: OptionType) => boolean);
11
+ optionFilterProp?: string;
12
+ options?: OptionType[];
13
+ children?: ReactNode;
14
+ defaultActiveFirstOption?: boolean;
15
+ listHeight?: number;
16
+ menuItemSelectedIcon?: ReactNode;
17
+ mode?: 'default' | 'multiple' | 'tags';
18
+ value?: RuleTypes;
19
+ defaultValue?: RuleTypes;
20
+ maxCount?: number;
21
+ onChange?: (e: RuleTypes, option?: OptionType) => void;
22
+ disabled?: boolean;
23
+ loading?: boolean;
24
+ placeholder?: string;
25
+ allowClear?: boolean;
26
+ filterable?: boolean;
27
+ defaultOpen?: boolean;
28
+ size?: 'small' | 'middle' | 'large';
29
+ onClear?: () => void;
30
+ error?: boolean;
31
+ showSearch?: boolean;
32
+ tagRender?: ((props: CustomTagProps) => ReactElement) | undefined;
33
+ maxTagPlaceholder?: ReactNode | ((omittedValues: DisplayValueType[]) => ReactNode);
34
+ dropdownClassName?: string;
35
+ showArrow?: boolean;
36
+ onBlur?: FocusEventHandler<HTMLElement> | undefined;
37
+ onDropdownVisibleChange?: ((open: boolean) => void) | undefined;
38
+ showAction?: ('click' | 'focus')[] | undefined;
39
+ suffixIcon?: ReactNode;
40
+ open?: boolean;
41
+ notFoundContent?: ReactNode;
42
+ getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
43
+ dropdownRender?: (menu: ReactNode) => ReactNode;
44
+ feedbackIcons?: boolean;
45
+ placement?: 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
46
+ removeIcon?: ReactNode;
47
+ };
48
+ export interface OptionType {
49
+ value: RuleType;
50
+ disabled?: boolean;
51
+ children?: ReactNode;
52
+ className?: string;
53
+ style?: CSSProperties;
54
+ onClick?: MouseEventHandler<HTMLDivElement>;
55
+ render?: (label: string) => ReactNode;
56
+ prefixCls?: string;
57
+ label?: RuleType;
58
+ }
59
+ export type CustomTagProps = DefaultProps & {
60
+ label?: ReactNode;
61
+ value: string;
62
+ onClose: (e: MouseEvent<HTMLSpanElement> & TargetProps) => void;
63
+ onMouseDown?: MouseEventHandler | undefined;
64
+ onLoadCapture?: ReactEventHandler | undefined;
65
+ closable?: boolean;
66
+ isMaxTag?: boolean;
67
+ color?: string;
68
+ icon?: ReactNode;
69
+ };
70
+ export type TagProps = DefaultProps & {
71
+ values?: string[];
72
+ onClose: (e: MouseEvent<HTMLSpanElement> & TargetProps) => void;
73
+ icon?: ReactNode;
74
+ closable?: boolean;
75
+ onChange?: ChangeEventHandler<HTMLInputElement>;
76
+ onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
77
+ };
78
+ export interface DisplayValueType {
79
+ key?: Key;
80
+ value?: RuleType;
81
+ label?: ReactNode;
82
+ title?: string | number;
83
+ disabled?: boolean;
84
+ }
85
+ export interface OptionProps {
86
+ value: RuleType;
87
+ disabled?: boolean;
88
+ children?: ReactNode;
89
+ className?: string;
90
+ style?: CSSProperties;
91
+ onClick?: MouseEventHandler<HTMLDivElement>;
92
+ render?: (label: string) => ReactNode;
93
+ onMouseEnter?: MouseEventHandler<HTMLDivElement>;
94
+ prefixCls?: string;
95
+ selected?: boolean;
96
+ title?: string;
97
+ }
@@ -0,0 +1,50 @@
1
+ import { CSSProperties, ReactNode } from 'react';
2
+ import { DefaultProps } from '.';
3
+ declare type widthUnit = number | string;
4
+ export interface SkeletonElementProps {
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ size?: 'large' | 'small' | 'default' | number;
8
+ shape?: 'circle' | 'square' | 'round';
9
+ active?: boolean;
10
+ }
11
+ export type SkeletonProps = DefaultProps & {
12
+ active?: boolean;
13
+ loading?: boolean;
14
+ className?: string;
15
+ style?: CSSProperties;
16
+ children?: ReactNode;
17
+ avatar?: SkeletonAvatarProps | boolean;
18
+ title?: SkeletonTitleProps | boolean;
19
+ paragraph?: SkeletonParagraphProps | boolean;
20
+ round?: boolean;
21
+ teamLogo?: boolean;
22
+ };
23
+ interface SkeletonTitleProps {
24
+ className?: string;
25
+ style?: CSSProperties;
26
+ width?: number | string;
27
+ }
28
+ interface SkeletonParagraphProps {
29
+ className?: string;
30
+ style?: CSSProperties;
31
+ width?: widthUnit | Array<widthUnit>;
32
+ rows?: number;
33
+ }
34
+ export type SkeletonAvatarProps = Omit<SkeletonElementProps, 'shape'> & DefaultProps & {
35
+ shape?: 'circle' | 'square';
36
+ active?: boolean;
37
+ applyElementStyle?: boolean;
38
+ wrapperStyle?: CSSProperties;
39
+ };
40
+ export type SkeletonImageProps = DefaultProps & Omit<SkeletonElementProps, 'size' | 'shape' | 'active'>;
41
+ export type SkeletonInputProps = Omit<SkeletonElementProps, 'size' | 'shape'> & DefaultProps & {
42
+ size?: 'large' | 'small' | 'default';
43
+ block?: boolean;
44
+ };
45
+ export type SkeletonButtonProps = Omit<SkeletonElementProps, 'size'> & DefaultProps & {
46
+ size?: 'large' | 'small' | 'default';
47
+ block?: boolean;
48
+ applyElementStyle?: boolean;
49
+ };
50
+ export {};