x-ui-design 0.3.96 → 0.3.98
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/esm/types/components/Button/Button.d.ts +1 -1
- package/dist/esm/types/index.d.ts +1 -0
- package/dist/esm/types/types/form.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +7 -3
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/lib/components/Button/Button.tsx +4 -0
- package/lib/hooks/useForm.ts +2 -2
- package/lib/index.ts +2 -1
- package/lib/types/form.ts +4 -1
- package/package.json +1 -1
- package/src/app/page.tsx +6 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactElement } from 'react';
|
|
2
2
|
import { ButtonProps } from '../../types/button';
|
|
3
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, ...restProps }: ButtonProps) => ReactElement;
|
|
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, ...restProps }: ButtonProps) => ReactElement;
|
|
5
5
|
export default ButtonComponent;
|
|
@@ -170,3 +170,4 @@ export type { SelectProps, OptionType, OptionProps, CustomTagProps, TagProps, Di
|
|
|
170
170
|
export type { RcFile, UploadFile, UploadProps, UploadChangeParam } from '@/types/upload';
|
|
171
171
|
export { FormContext } from '@/components/Form/Form';
|
|
172
172
|
export { clsx, createArray, parseValue } from '@/helpers';
|
|
173
|
+
export { flattenChildren } from '@/helpers/flatten';
|
|
@@ -89,7 +89,7 @@ export interface FormInstance {
|
|
|
89
89
|
setFieldValue: (name: string, value: RuleTypes) => void;
|
|
90
90
|
getFieldValue: (name: string) => RuleTypes;
|
|
91
91
|
validateFields: (nameList?: string[]) => Promise<boolean>;
|
|
92
|
-
setFieldsValue: (values: Partial<Record<string, RuleTypes
|
|
92
|
+
setFieldsValue: (values: Partial<Record<string, RuleTypes>>, reset?: boolean | null | undefined) => void;
|
|
93
93
|
getFieldsValue: (nameList?: string[]) => Record<string, RuleTypes>;
|
|
94
94
|
isFieldTouched: (name: string) => boolean;
|
|
95
95
|
getFieldsError: () => Pick<FieldError, 'errors' | 'name'>[];
|
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,7 @@ export { CheckboxProps } from '@/types/checkbox';
|
|
|
21
21
|
export { InputProps, TextareaProps } from '@/types/input';
|
|
22
22
|
export { FormContext } from '@/components/Form/Form';
|
|
23
23
|
export { clsx, createArray, parseValue } from '@/helpers';
|
|
24
|
+
export { flattenChildren } from '@/helpers/flatten';
|
|
24
25
|
|
|
25
26
|
interface DefaultProps {
|
|
26
27
|
prefixCls?: string;
|
package/dist/index.esm.js
CHANGED
|
@@ -675,8 +675,8 @@ const useForm = (initialValues = {}, onFieldsChange, onValuesChange, scrollToFir
|
|
|
675
675
|
});
|
|
676
676
|
}
|
|
677
677
|
}
|
|
678
|
-
function setFieldsValue(values) {
|
|
679
|
-
Object.entries(values).forEach(([name, value]) => setFieldValue(name, value));
|
|
678
|
+
function setFieldsValue(values, reset) {
|
|
679
|
+
Object.entries(values).forEach(([name, value]) => setFieldValue(name, value, undefined, reset));
|
|
680
680
|
}
|
|
681
681
|
function setFields(fields) {
|
|
682
682
|
fields.forEach(({
|
|
@@ -1295,6 +1295,10 @@ const ButtonComponent = ({
|
|
|
1295
1295
|
block = false,
|
|
1296
1296
|
children,
|
|
1297
1297
|
href,
|
|
1298
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
1299
|
+
// @ts-expect-error
|
|
1300
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1301
|
+
__injected,
|
|
1298
1302
|
...restProps
|
|
1299
1303
|
}) => {
|
|
1300
1304
|
const [innerLoading, setInnerLoading] = useState(false);
|
|
@@ -3810,5 +3814,5 @@ var Skeleton$1 = /*#__PURE__*/Object.freeze({
|
|
|
3810
3814
|
default: Skeleton
|
|
3811
3815
|
});
|
|
3812
3816
|
|
|
3813
|
-
export { ArrowIcon, Button$3 as Button, CalendarIcon, CheckIcon, Checkbox$2 as Checkbox, ClearIcon, DateDistanceIcon, DatePicker$2 as DatePicker, Empty$1 as Empty, ErrorIcon, Form, FormContext, FormItem, Input$3 as Input, LoadingIcon, Option$2 as Option, Radio$3 as Radio, RadioButton$1 as RadioButton, RadioGroup$1 as RadioGroup, RangePicker$2 as RangePicker, SearchIcon, Select$2 as Select, Skeleton$2 as Skeleton, SkeletonAvatar$1 as SkeletonAvatar, SkeletonButton$1 as SkeletonButton, SkeletonImage$1 as SkeletonImage, SkeletonInput$1 as SkeletonInput, SpinerIcon, StampleIcon, SuccessIcon, Tag$2 as Tag, Textarea$2 as Textarea, TimeIcon, TimePicker$2 as TimePicker, TrashIcon, Upload$2 as Upload, clsx, createArray, parseValue, useForm, useWatch };
|
|
3817
|
+
export { ArrowIcon, Button$3 as Button, CalendarIcon, CheckIcon, Checkbox$2 as Checkbox, ClearIcon, DateDistanceIcon, DatePicker$2 as DatePicker, Empty$1 as Empty, ErrorIcon, Form, FormContext, FormItem, Input$3 as Input, LoadingIcon, Option$2 as Option, Radio$3 as Radio, RadioButton$1 as RadioButton, RadioGroup$1 as RadioGroup, RangePicker$2 as RangePicker, SearchIcon, Select$2 as Select, Skeleton$2 as Skeleton, SkeletonAvatar$1 as SkeletonAvatar, SkeletonButton$1 as SkeletonButton, SkeletonImage$1 as SkeletonImage, SkeletonInput$1 as SkeletonInput, SpinerIcon, StampleIcon, SuccessIcon, Tag$2 as Tag, Textarea$2 as Textarea, TimeIcon, TimePicker$2 as TimePicker, TrashIcon, Upload$2 as Upload, clsx, createArray, flattenChildren, parseValue, useForm, useWatch };
|
|
3814
3818
|
//# sourceMappingURL=index.esm.js.map
|