x-ui-design 0.6.16 → 0.6.17
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/lib/components/Form/Form.tsx +1 -0
- package/lib/components/Form/Item/Item.tsx +7 -26
- package/lib/hooks/useForm.ts +1 -1
- package/package.json +1 -1
- package/src/app/page.tsx +2 -0
- package/dist/esm/types/components/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Checkbox/Checkbox.d.ts +0 -8
- package/dist/esm/types/components/Checkbox/index.d.ts +0 -1
- package/dist/esm/types/components/ConditionalWrapper/index.d.ts +0 -7
- package/dist/esm/types/components/DatePicker/DatePicker.d.ts +0 -8
- package/dist/esm/types/components/DatePicker/RangePicker/RangePicker.d.ts +0 -5
- package/dist/esm/types/components/DatePicker/RangePicker/index.d.ts +0 -1
- package/dist/esm/types/components/DatePicker/TimePicker/TimePicker.d.ts +0 -5
- package/dist/esm/types/components/DatePicker/TimePicker/index.d.ts +0 -1
- package/dist/esm/types/components/DatePicker/index.d.ts +0 -1
- package/dist/esm/types/components/Empty/Empty.d.ts +0 -5
- package/dist/esm/types/components/Empty/index.d.ts +0 -1
- package/dist/esm/types/components/Form/Form.d.ts +0 -7
- package/dist/esm/types/components/Form/Item/Item.d.ts +0 -8
- package/dist/esm/types/components/Form/Item/index.d.ts +0 -1
- package/dist/esm/types/components/Form/index.d.ts +0 -1
- package/dist/esm/types/components/Icons/Icons.d.ts +0 -17
- package/dist/esm/types/components/Icons/index.d.ts +0 -1
- package/dist/esm/types/components/Input/Input.d.ts +0 -12
- package/dist/esm/types/components/Input/Textarea/Textarea.d.ts +0 -8
- package/dist/esm/types/components/Input/Textarea/index.d.ts +0 -1
- package/dist/esm/types/components/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Radio/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Group/Group.d.ts +0 -5
- package/dist/esm/types/components/Radio/Group/index.d.ts +0 -1
- package/dist/esm/types/components/Radio/Radio.d.ts +0 -8
- package/dist/esm/types/components/Radio/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Option/Option.d.ts +0 -5
- package/dist/esm/types/components/Select/Option/index.d.ts +0 -1
- package/dist/esm/types/components/Select/Select.d.ts +0 -10
- package/dist/esm/types/components/Select/Tag/Tag.d.ts +0 -5
- package/dist/esm/types/components/Select/Tag/index.d.ts +0 -1
- package/dist/esm/types/components/Select/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Avatar/Avatar.d.ts +0 -8
- package/dist/esm/types/components/Skeleton/Avatar/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Button/Button.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Button/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Image/Image.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Image/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Input/Input.d.ts +0 -5
- package/dist/esm/types/components/Skeleton/Input/index.d.ts +0 -1
- package/dist/esm/types/components/Skeleton/Skeleton.d.ts +0 -10
- package/dist/esm/types/components/Skeleton/index.d.ts +0 -1
- package/dist/esm/types/components/Switch/Switch.d.ts +0 -8
- package/dist/esm/types/components/Switch/index.d.ts +0 -1
- package/dist/esm/types/components/Upload/Upload.d.ts +0 -5
- package/dist/esm/types/components/Upload/index.d.ts +0 -1
- package/dist/esm/types/helpers/flatten.d.ts +0 -2
- package/dist/esm/types/helpers/index.d.ts +0 -4
- package/dist/esm/types/helpers/mask.d.ts +0 -7
- package/dist/esm/types/hooks/useForm.d.ts +0 -4
- package/dist/esm/types/hooks/useWatch.d.ts +0 -9
- package/dist/esm/types/index.d.ts +0 -40
- package/dist/esm/types/types/button.d.ts +0 -43
- package/dist/esm/types/types/checkbox.d.ts +0 -24
- package/dist/esm/types/types/datepicker.d.ts +0 -120
- package/dist/esm/types/types/empty.d.ts +0 -7
- package/dist/esm/types/types/form.d.ts +0 -116
- package/dist/esm/types/types/index.d.ts +0 -25
- package/dist/esm/types/types/input.d.ts +0 -53
- package/dist/esm/types/types/radio.d.ts +0 -58
- package/dist/esm/types/types/select.d.ts +0 -102
- package/dist/esm/types/types/skeleton.d.ts +0 -50
- package/dist/esm/types/types/switch.d.ts +0 -18
- package/dist/esm/types/types/upload.d.ts +0 -54
- package/dist/esm/types/utils/index.d.ts +0 -15
- package/dist/esm/types/utils/lazy.d.ts +0 -1
- package/dist/index.d.ts +0 -129
- package/dist/index.esm.js +0 -4125
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js +0 -4169
- package/dist/index.js.map +0 -1
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React, {
|
|
4
4
|
Children,
|
|
5
5
|
isValidElement,
|
|
6
|
+
memo,
|
|
6
7
|
ReactElement,
|
|
7
8
|
useContext,
|
|
8
9
|
useEffect,
|
|
@@ -23,21 +24,7 @@ import { prefixClsFormItem } from '../../../utils';
|
|
|
23
24
|
import { FormContext } from '../Form';
|
|
24
25
|
import './style.css';
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
-
let timeoutId: ReturnType<typeof setTimeout> | null = null;
|
|
28
|
-
|
|
29
|
-
return (...args: any[]) => {
|
|
30
|
-
if (timeoutId) {
|
|
31
|
-
clearTimeout(timeoutId);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
timeoutId = setTimeout(() => {
|
|
35
|
-
func(...args);
|
|
36
|
-
}, delay);
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const FormItem = ({
|
|
27
|
+
const FormItem = memo(({
|
|
41
28
|
prefixCls = prefixClsFormItem,
|
|
42
29
|
name,
|
|
43
30
|
label,
|
|
@@ -152,9 +139,9 @@ const FormItem = ({
|
|
|
152
139
|
})}
|
|
153
140
|
</div>
|
|
154
141
|
);
|
|
155
|
-
};
|
|
142
|
+
});
|
|
156
143
|
|
|
157
|
-
const FormItemChildComponent = ({
|
|
144
|
+
const FormItemChildComponent = memo(({
|
|
158
145
|
child,
|
|
159
146
|
name,
|
|
160
147
|
error,
|
|
@@ -200,12 +187,6 @@ const FormItemChildComponent = ({
|
|
|
200
187
|
}
|
|
201
188
|
}, [dependencies, name]);
|
|
202
189
|
|
|
203
|
-
const debouncedSetFieldValue = useRef(
|
|
204
|
-
debounce((name: string, value: any) => {
|
|
205
|
-
setFieldValue?.(name, value, undefined, undefined, true);
|
|
206
|
-
}, 10)
|
|
207
|
-
).current;
|
|
208
|
-
|
|
209
190
|
const handleChange = (e: SyntheticBaseEvent, option?: OptionProps) => {
|
|
210
191
|
let rawValue: RuleType | SyntheticBaseEvent = e?.target
|
|
211
192
|
? e.target.value
|
|
@@ -233,7 +214,7 @@ const FormItemChildComponent = ({
|
|
|
233
214
|
}
|
|
234
215
|
}
|
|
235
216
|
|
|
236
|
-
|
|
217
|
+
setFieldValue?.(name, rawValue, undefined, undefined, true);
|
|
237
218
|
onChange?.(e, option);
|
|
238
219
|
};
|
|
239
220
|
|
|
@@ -267,10 +248,10 @@ const FormItemChildComponent = ({
|
|
|
267
248
|
return <child.type
|
|
268
249
|
{...props}
|
|
269
250
|
ref={ref}
|
|
251
|
+
name={name}
|
|
270
252
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
271
253
|
// @ts-expect-error
|
|
272
254
|
{...child.props}
|
|
273
|
-
name={name}
|
|
274
255
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
275
256
|
// @ts-expect-error
|
|
276
257
|
size={childProps.size || props.size}
|
|
@@ -287,7 +268,7 @@ const FormItemChildComponent = ({
|
|
|
287
268
|
};
|
|
288
269
|
|
|
289
270
|
return injectPropsIntoFinalLeaf(child)
|
|
290
|
-
};
|
|
271
|
+
});
|
|
291
272
|
|
|
292
273
|
FormItem.displayName = 'FormItem';
|
|
293
274
|
|
package/lib/hooks/useForm.ts
CHANGED
|
@@ -281,7 +281,7 @@ const useForm = (
|
|
|
281
281
|
if (_scrollToFirstError.current) {
|
|
282
282
|
const firstErrorContent = document.querySelectorAll('.xUi-form-item-has-error')?.[0];
|
|
283
283
|
|
|
284
|
-
console.log(firstErrorContent);
|
|
284
|
+
console.log('firstErrorContent', firstErrorContent);
|
|
285
285
|
|
|
286
286
|
if (firstErrorContent) {
|
|
287
287
|
firstErrorContent.closest('.xUi-form-item')?.scrollIntoView({
|
package/package.json
CHANGED
package/src/app/page.tsx
CHANGED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { ButtonProps } from '../../types/button';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const ButtonComponent: ({ type, variant, color, shape, size, htmlType, className, rootClassName, classNames: customClassNames, styles, prefixCls, icon, iconPosition, loading, disabled, ghost, danger, block, children, href, __injected, child, ...restProps }: ButtonProps) => ReactElement;
|
|
5
|
-
export default ButtonComponent;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Button } from './Button';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
2
|
-
import { CheckboxProps } from '../../types/checkbox';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Checkbox: {
|
|
5
|
-
({ prefixCls, className, defaultChecked, checked, style, disabled, onChange, onClick, onMouseEnter, onMouseLeave, onKeyPress, onKeyDown, tabIndex, name, children, id, autoFocus, type, value, required, noStyle, titleClick, ref }: CheckboxProps): ReactElement;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Checkbox;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Checkbox } from './Checkbox';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TDatePickerProps } from '../../types/datepicker';
|
|
3
|
-
import './style.css';
|
|
4
|
-
export declare const NUMBER_SIX = 6;
|
|
5
|
-
export declare const MONTH_LENGTH = 11;
|
|
6
|
-
export declare const NEXT_DAYS_COUNT_AS_CURRENT_MUNTH = 35;
|
|
7
|
-
declare const DatePicker: ({ value, onChange, onCalendarChange, disabled, error, placeholder, prefixCls, noStyle, feedbackIcons, locale, placement, defaultValue, size, format, getPopupContainer, showToday, allowClear, disabledDate, suffixIcon, picker, prefix, defaultOpen, inputReadOnly, bordered }: TDatePickerProps) => React.JSX.Element;
|
|
8
|
-
export default DatePicker;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TRangePickerProps } from '../../../types/datepicker';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RangePicker: ({ prefixCls, value, onChange, placeholder, disabled, error, format, prefix, allowClear, inputReadOnly, size, picker, locale, disabledDate, onOpenChange, onCalendarChange, style, className, separator, defaultValue, bordered }: TRangePickerProps) => React.JSX.Element;
|
|
5
|
-
export default RangePicker;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RangePicker } from '../RangePicker/RangePicker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as TimePicker } from '../TimePicker/TimePicker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as DatePicker } from '../DatePicker/DatePicker';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Empty } from '../Empty/Empty';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { FormInstance, FormItemProps, FormProps } from '../../types/form';
|
|
3
|
-
export declare const FormContext: React.Context<FormInstance | null>;
|
|
4
|
-
declare const Form: FC<FormProps> & {
|
|
5
|
-
Item: FC<FormItemProps>;
|
|
6
|
-
};
|
|
7
|
-
export default Form;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { FormItemProps } from '../../../types/form';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const FormItem: {
|
|
5
|
-
({ prefixCls, name, label, rules, children, className, layout, style, extra, hideLabel, removeErrorMessageHeight, ...props }: FormItemProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default FormItem;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Item } from './Item';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Form } from './Form';
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
declare const ClearIcon: () => React.JSX.Element;
|
|
3
|
-
declare const ArrowIcon: ({ isOpen }: {
|
|
4
|
-
isOpen: boolean;
|
|
5
|
-
}) => React.JSX.Element;
|
|
6
|
-
declare const LoadingIcon: () => React.JSX.Element;
|
|
7
|
-
declare const CheckIcon: () => React.JSX.Element;
|
|
8
|
-
declare const SearchIcon: () => React.JSX.Element;
|
|
9
|
-
declare const CalendarIcon: () => React.JSX.Element;
|
|
10
|
-
declare const SuccessIcon: () => React.JSX.Element;
|
|
11
|
-
declare const ErrorIcon: () => React.JSX.Element;
|
|
12
|
-
declare const DateDistanceIcon: () => React.JSX.Element;
|
|
13
|
-
declare const TimeIcon: () => React.JSX.Element;
|
|
14
|
-
declare const StampleIcon: () => React.JSX.Element;
|
|
15
|
-
declare const TrashIcon: () => React.JSX.Element;
|
|
16
|
-
declare const SpinerIcon: () => React.JSX.Element;
|
|
17
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon } from './Icons';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { InputProps } from '../../types/input';
|
|
3
|
-
import Textarea from './Textarea/Textarea';
|
|
4
|
-
import './style.css';
|
|
5
|
-
declare const InputComponent: {
|
|
6
|
-
({ size, error, suffix, prefix, addonAfter, addonBefore, onPressEnter, disabled, allowClear, prefixCls, className, value, iconRender, noStyle, feedbackIcons, mask, maskChar, maskRegex, __injected, defaultValue, child, ref, ...props }: InputProps): React.JSX.Element;
|
|
7
|
-
displayName: string;
|
|
8
|
-
};
|
|
9
|
-
declare const Input: typeof InputComponent & {
|
|
10
|
-
TextArea: typeof Textarea;
|
|
11
|
-
};
|
|
12
|
-
export default Input;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TextareaProps } from '../../../types/input';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Textarea: {
|
|
5
|
-
({ prefixCls, value, className, style, autoSize, onPressEnter, onResize, styles, bordered, size, status, rootClassName, variant, error, allowClear, ref, ...props }: TextareaProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Textarea;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Textarea } from '../Textarea/Textarea';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Input } from '../Input/Input';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioButtonProps } from '../../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RadioButton: ({ prefixCls, className, checked, disabled, children, size, ...props }: RadioButtonProps) => React.JSX.Element;
|
|
5
|
-
export default RadioButton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RadioButton } from '../../Radio/Button/Button';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioGroupProps } from '../../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const RadioGroup: ({ defaultValue, value, size, disabled, name, id, style, buttonStyle, block, prefixCls, className, options, children, ...props }: RadioGroupProps) => React.JSX.Element;
|
|
5
|
-
export default RadioGroup;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as RadioGroup } from '../../Radio/Group/Group';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { RadioProps } from '../../types/radio';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Radio: {
|
|
5
|
-
({ prefixCls, className, value, onChange, onClick, disabled, children, name, title, defaultChecked, checked, onBlur, onFocus, onMouseEnter, onMouseLeave, noStyle, ref }: RadioProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Radio;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Radio } from '../Radio/Radio';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Option } from '../../Select/Option/Option';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { SelectProps } from '../../types/select';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Select: {
|
|
5
|
-
({ prefixCls, id, searchValue, autoClearSearchValue, filterOption, optionFilterProp, children, options, listHeight, menuItemSelectedIcon, mode, value, defaultValue, maxCount, disabled, loading, placeholder, allowClear, filterable, defaultOpen, size, error, dropdownClassName, className, suffixIcon, searchIcon, style, showSearch, open, closeFromParent, showArrow, notFoundContent, noStyle, feedbackIcons, placement, removeIcon, maxTagCount, onSearch, onSelect, onDeselect, onClear, onChange, onClose, tagRender, getPopupContainer, dropdownRender, onDropdownVisibleChange, ref }: SelectProps): ReactElement;
|
|
6
|
-
displayName: string;
|
|
7
|
-
} & {
|
|
8
|
-
Option: React.FC<import("../../types/select").OptionProps>;
|
|
9
|
-
};
|
|
10
|
-
export default Select;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Tag } from '../../Select/Tag/Tag';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Select } from '../Select/Select';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { SkeletonAvatarProps } from '../../../types/skeleton';
|
|
3
|
-
import './style.css';
|
|
4
|
-
export declare const AVATAR_DEFAULT_SIZE = 32;
|
|
5
|
-
export declare const AVATAR_GLOBAL_SIZE = 40;
|
|
6
|
-
export declare const GET_AVATAR_SKELETON_PROPS: (avatar: SkeletonAvatarProps | boolean) => SkeletonAvatarProps;
|
|
7
|
-
declare const SkeletonAvatar: FC<SkeletonAvatarProps>;
|
|
8
|
-
export default SkeletonAvatar;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SkeletonAvatar } from './Avatar';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SkeletonButton } from './Button';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SkeletonImage } from './Image';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as SkeletonInput } from './Input';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement } from 'react';
|
|
2
|
-
import { SkeletonProps } from '../../types/skeleton';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Skeleton: (({ prefixCls, active, className, style, avatar, paragraph, round, title, teamLogo }: SkeletonProps) => ReactElement) & {
|
|
5
|
-
Image: React.FC<import("../../types/skeleton").SkeletonImageProps>;
|
|
6
|
-
Input: React.FC<import("../../types/skeleton").SkeletonInputProps>;
|
|
7
|
-
Avatar: React.FC<import("../../types/skeleton").SkeletonAvatarProps>;
|
|
8
|
-
Button: React.FC<import("../../types/skeleton").SkeletonButtonProps>;
|
|
9
|
-
};
|
|
10
|
-
export default Skeleton;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Skeleton } from './Skeleton';
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { SwitchProps } from '../../types/switch';
|
|
3
|
-
import './index.css';
|
|
4
|
-
declare const Switch: {
|
|
5
|
-
({ prefixCls, checked, onChange, onClick, disabled, className, style, defaultChecked, value }: SwitchProps): React.JSX.Element;
|
|
6
|
-
displayName: string;
|
|
7
|
-
};
|
|
8
|
-
export default Switch;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Switch } from './Switch';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { UploadProps } from '../../types/upload';
|
|
3
|
-
import './style.css';
|
|
4
|
-
declare const Upload: ({ prefixCls, multiple, style, className, onChange, action, name, method, headers, directory, beforeUpload, rootClassName, onRemove, disabled, withCredentials, openFileDialogOnClick, maxCount, fileList: controlledFileList, customRequest, accept, listType, showUploadList, children, noStyle, defaultFileList }: UploadProps) => React.JSX.Element;
|
|
5
|
-
export default Upload;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Upload } from '../Upload/Upload';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare const MASK_CHAR = "_";
|
|
2
|
-
export declare const MASK_REGEX: RegExp;
|
|
3
|
-
export declare function stripMask(value: string, mask: string, maskChar?: string): string;
|
|
4
|
-
export declare function applyMask(raw: string, mask: string, maskChar?: string): {
|
|
5
|
-
masked: string;
|
|
6
|
-
rawIndex: number;
|
|
7
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { RuleTypes } from '../types';
|
|
2
|
-
import type { FieldData, FormInstance } from '../types/form';
|
|
3
|
-
declare const useForm: (initialValues?: Record<string, RuleTypes>, onFieldsChange?: (changedFields: FieldData[]) => void, onValuesChange?: (changedValues: Record<string, RuleTypes>, allValues: Record<string, RuleTypes>) => void, scrollToFirstError?: boolean, onFinish?: ((values: Record<string, RuleTypes>) => void) | undefined) => FormInstance;
|
|
4
|
-
export { useForm };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { RuleType } from '../types';
|
|
2
|
-
import { FormInstance } from '../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,40 +0,0 @@
|
|
|
1
|
-
import './styles/global.css';
|
|
2
|
-
declare const Button: import("react").ComponentType<import("@/types/button").ButtonProps>;
|
|
3
|
-
declare const Checkbox: import("react").ComponentType<import("@/types/checkbox").CheckboxProps>;
|
|
4
|
-
declare const Switch: import("react").ComponentType<import("./types/switch").SwitchProps>;
|
|
5
|
-
declare const Empty: import("react").ComponentType<import("./types/empty").EmptyContentProps>;
|
|
6
|
-
declare const Upload: import("react").ComponentType<import("@/types/upload").UploadProps>;
|
|
7
|
-
declare const DatePicker: import("react").ComponentType<import("@/types/datepicker").TDatePickerProps>;
|
|
8
|
-
declare const RangePicker: import("react").ComponentType<import("@/types/datepicker").TRangePickerProps>;
|
|
9
|
-
declare const TimePicker: import("react").ComponentType<import("@/types/datepicker").TimePickerProps>;
|
|
10
|
-
declare const Form: import("react").ComponentType<import("@/types/form").FormProps>;
|
|
11
|
-
declare const FormItem: import("react").ComponentType<import("@/types/form").FormItemProps>;
|
|
12
|
-
declare const Input: import("react").ComponentType<import("@/types/input").InputProps>;
|
|
13
|
-
declare const Textarea: import("react").ComponentType<import("@/types/input").TextareaProps>;
|
|
14
|
-
declare const Radio: import("react").ComponentType<import("@/types/radio").RadioProps>;
|
|
15
|
-
declare const RadioButton: import("react").ComponentType<import("@/types/radio").RadioButtonProps>;
|
|
16
|
-
declare const RadioGroup: import("react").ComponentType<import("@/types/radio").RadioGroupProps>;
|
|
17
|
-
declare const Select: import("react").ComponentType<import("@/types/select").SelectProps>;
|
|
18
|
-
declare const Option: import("react").ComponentType<import("@/types/select").OptionProps>;
|
|
19
|
-
declare const Tag: import("react").ComponentType<import("@/types/select").CustomTagProps>;
|
|
20
|
-
declare const Skeleton: import("react").ComponentType<import("./types/skeleton").SkeletonProps>;
|
|
21
|
-
declare const SkeletonAvatar: import("react").ComponentType<import("./types/skeleton").SkeletonAvatarProps>;
|
|
22
|
-
declare const SkeletonButton: import("react").ComponentType<import("./types/skeleton").SkeletonButtonProps>;
|
|
23
|
-
declare const SkeletonImage: import("react").ComponentType<import("./types/skeleton").SkeletonImageProps>;
|
|
24
|
-
declare const SkeletonInput: import("react").ComponentType<import("./types/skeleton").SkeletonInputProps>;
|
|
25
|
-
export { Button, Checkbox, Empty, DatePicker, RangePicker, TimePicker, Form, FormItem, Input, Textarea, Radio, RadioButton, RadioGroup, Select, Option, Tag, Skeleton, SkeletonAvatar, SkeletonButton, SkeletonImage, SkeletonInput, Upload, Switch };
|
|
26
|
-
export { ClearIcon, ArrowIcon, LoadingIcon, CheckIcon, SearchIcon, CalendarIcon, SuccessIcon, ErrorIcon, DateDistanceIcon, TimeIcon, StampleIcon, TrashIcon, SpinerIcon, } from '@/components/Icons';
|
|
27
|
-
export { useForm } from '@/hooks/useForm';
|
|
28
|
-
export { useWatch } from '@/hooks/useWatch';
|
|
29
|
-
export type { FormInstance, RuleObject, RuleRender, FieldData, FieldInstancesInputRef, FieldError, FormProps, FormItemChildComponentProps } from '@/types/form';
|
|
30
|
-
export type { DefaultProps, TargetProps, RuleTypes, RuleType, MouseEventHandlerSelect, SyntheticBaseEvent } from '@/types';
|
|
31
|
-
export type { CheckboxProps } from '@/types/checkbox';
|
|
32
|
-
export type { InputProps, TextareaProps } from '@/types/input';
|
|
33
|
-
export type { ButtonProps, BaseButtonProps, ButtonType } from '@/types/button';
|
|
34
|
-
export type { RadioProps, RadioGroupProps, RadioButtonProps } from '@/types/radio';
|
|
35
|
-
export type { TDatePickerProps, TRangePickerProps, TimePickerProps } from '@/types/datepicker';
|
|
36
|
-
export type { SelectProps, OptionType, OptionProps, CustomTagProps, TagProps, DisplayValueType } from '@/types/select';
|
|
37
|
-
export type { RcFile, UploadFile, UploadProps, UploadChangeParam } from '@/types/upload';
|
|
38
|
-
export { FormContext } from '@/components/Form/Form';
|
|
39
|
-
export { clsx, createArray, parseValue } from '@/helpers';
|
|
40
|
-
export { flattenChildren } from '@/helpers/flatten';
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { ButtonHTMLAttributes, CSSProperties, ReactNode } from 'react';
|
|
2
|
-
export declare const ButtonTypes: readonly ["default", "primary", "dashed", "link", "text", "ghost"];
|
|
3
|
-
export declare const ButtonShapes: readonly ["default", "circle", "round"];
|
|
4
|
-
export declare const ButtonVariantTypes: readonly ["outlined", "dashed", "solid", "filled", "text", "link"];
|
|
5
|
-
export declare const ButtonColorTypes: readonly ["default", "primary", "danger", "blue", "purple", "cyan", "green", "magenta", "pink", "red", "orange", "yellow", "volcano", "geekblue", "lime", "gold"];
|
|
6
|
-
export type ButtonType = (typeof ButtonTypes)[number];
|
|
7
|
-
export type ButtonShape = (typeof ButtonShapes)[number];
|
|
8
|
-
export type ButtonVariantType = (typeof ButtonVariantTypes)[number];
|
|
9
|
-
export type ButtonColorType = (typeof ButtonColorTypes)[number];
|
|
10
|
-
export type SizeType = 'small' | 'middle' | 'large' | undefined;
|
|
11
|
-
export type ButtonHTMLType = 'button' | 'submit' | 'reset';
|
|
12
|
-
export interface BaseButtonProps {
|
|
13
|
-
type?: ButtonType;
|
|
14
|
-
color?: ButtonColorType;
|
|
15
|
-
variant?: ButtonVariantType;
|
|
16
|
-
icon?: ReactNode;
|
|
17
|
-
iconPosition?: 'start' | 'end';
|
|
18
|
-
shape?: ButtonShape;
|
|
19
|
-
size?: SizeType;
|
|
20
|
-
disabled?: boolean;
|
|
21
|
-
loading?: boolean | {
|
|
22
|
-
delay?: number;
|
|
23
|
-
icon?: ReactNode;
|
|
24
|
-
};
|
|
25
|
-
prefixCls?: string;
|
|
26
|
-
className?: string;
|
|
27
|
-
rootClassName?: string;
|
|
28
|
-
ghost?: boolean;
|
|
29
|
-
danger?: boolean;
|
|
30
|
-
block?: boolean;
|
|
31
|
-
children?: ReactNode;
|
|
32
|
-
classNames?: {
|
|
33
|
-
icon?: string;
|
|
34
|
-
};
|
|
35
|
-
styles?: {
|
|
36
|
-
icon?: CSSProperties;
|
|
37
|
-
};
|
|
38
|
-
child?: ReactNode;
|
|
39
|
-
}
|
|
40
|
-
export interface ButtonProps extends BaseButtonProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color' | 'type'> {
|
|
41
|
-
href?: string;
|
|
42
|
-
htmlType?: ButtonHTMLType;
|
|
43
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ForwardedRef, 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
|
-
titleClick?: boolean;
|
|
23
|
-
ref?: ForwardedRef<HTMLDivElement>;
|
|
24
|
-
};
|