@canvas-components/react-components 0.3.17 → 0.3.19
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/index.cjs +282 -172
- package/dist/index.d.cts +76 -57
- package/dist/index.d.ts +76 -57
- package/dist/index.js +283 -174
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { InputHTMLAttributes, ReactNode, KeyboardEvent as KeyboardEvent$1,
|
|
2
|
+
import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, KeyboardEvent as KeyboardEvent$1, ButtonHTMLAttributes, MouseEvent, RefObject, TextareaHTMLAttributes, ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ReactCheckboxRef {
|
|
5
5
|
focus: () => void;
|
|
@@ -102,6 +102,80 @@ declare function ReactFilterPanel(props: {
|
|
|
102
102
|
request: ReactFilterPanelRequest | null;
|
|
103
103
|
}): react.JSX.Element | null;
|
|
104
104
|
|
|
105
|
+
type ReactFormValues = Record<string, unknown>;
|
|
106
|
+
interface ReactFormRuleContext {
|
|
107
|
+
getFieldValue: (name: string) => unknown;
|
|
108
|
+
}
|
|
109
|
+
interface ReactFormRuleConfig {
|
|
110
|
+
required?: boolean;
|
|
111
|
+
message?: string;
|
|
112
|
+
type?: "number" | "integer" | "string";
|
|
113
|
+
min?: number;
|
|
114
|
+
max?: number;
|
|
115
|
+
validator?: (rule: ReactFormRuleConfig, value: unknown) => void | Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
type ReactFormRule = ReactFormRuleConfig | ((context: ReactFormRuleContext) => ReactFormRuleConfig);
|
|
118
|
+
interface ReactFormInstance<T extends object = Record<string, unknown>> {
|
|
119
|
+
getFieldValue: (name: string) => unknown;
|
|
120
|
+
setFieldsValue: (values: Partial<T>) => void;
|
|
121
|
+
resetFields: () => void;
|
|
122
|
+
validateFields: () => Promise<T>;
|
|
123
|
+
/** @internal */
|
|
124
|
+
__store: FormStore;
|
|
125
|
+
}
|
|
126
|
+
interface FormStore {
|
|
127
|
+
values: ReactFormValues;
|
|
128
|
+
initialValues: ReactFormValues;
|
|
129
|
+
errors: Record<string, string>;
|
|
130
|
+
rules: Map<string, ReactFormRule[]>;
|
|
131
|
+
listeners: Set<() => void>;
|
|
132
|
+
revision: number;
|
|
133
|
+
notify: () => void;
|
|
134
|
+
}
|
|
135
|
+
type ReactFormLayout = "vertical" | "horizontal" | "inline";
|
|
136
|
+
/** 创建表单实例。 */
|
|
137
|
+
declare function useReactForm<T extends object = Record<string, unknown>>(): readonly [ReactFormInstance<T>];
|
|
138
|
+
/** 订阅表单字段值。 */
|
|
139
|
+
declare function useReactFormWatch(name: string, form: ReactFormInstance): unknown;
|
|
140
|
+
interface ReactFormProps extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
141
|
+
form?: ReactFormInstance;
|
|
142
|
+
initialValues?: ReactFormValues;
|
|
143
|
+
layout?: ReactFormLayout;
|
|
144
|
+
noWrap?: boolean;
|
|
145
|
+
itemSpacing?: CSSProperties["marginBlockEnd"];
|
|
146
|
+
labelWidth?: CSSProperties["width"];
|
|
147
|
+
labelAlign?: "left" | "right";
|
|
148
|
+
colon?: boolean;
|
|
149
|
+
requiredMark?: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare function ReactFormRoot({ form: formProp, initialValues, layout, noWrap, itemSpacing, labelWidth, labelAlign, colon, requiredMark, className, children, ...props }: ReactFormProps): react.JSX.Element;
|
|
152
|
+
interface ReactFormItemProps {
|
|
153
|
+
label?: ReactNode;
|
|
154
|
+
name?: string;
|
|
155
|
+
children: ReactNode;
|
|
156
|
+
rules?: ReactFormRule[];
|
|
157
|
+
dependencies?: string[];
|
|
158
|
+
initialValue?: unknown;
|
|
159
|
+
required?: boolean;
|
|
160
|
+
colon?: boolean;
|
|
161
|
+
labelWidth?: CSSProperties["width"];
|
|
162
|
+
labelAlign?: "left" | "right";
|
|
163
|
+
labelStyle?: CSSProperties;
|
|
164
|
+
controlStyle?: CSSProperties;
|
|
165
|
+
help?: ReactNode;
|
|
166
|
+
extra?: ReactNode;
|
|
167
|
+
className?: string;
|
|
168
|
+
style?: CSSProperties;
|
|
169
|
+
noWrap?: boolean;
|
|
170
|
+
}
|
|
171
|
+
declare function ReactFormItem({ label, name, children, rules, initialValue, required, colon, labelWidth, labelAlign, labelStyle, controlStyle, help, extra, className, style, noWrap, }: ReactFormItemProps): react.JSX.Element;
|
|
172
|
+
/** Ant Design 风格表单,支持横向、纵向与行内布局。 */
|
|
173
|
+
declare const ReactForm: typeof ReactFormRoot & {
|
|
174
|
+
Item: typeof ReactFormItem;
|
|
175
|
+
useForm: typeof useReactForm;
|
|
176
|
+
useWatch: typeof useReactFormWatch;
|
|
177
|
+
};
|
|
178
|
+
|
|
105
179
|
interface ReactInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
106
180
|
/**
|
|
107
181
|
* 回车确认回调。
|
|
@@ -1323,61 +1397,6 @@ interface ReactTextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
1323
1397
|
}
|
|
1324
1398
|
/** 多行文本输入框。 */
|
|
1325
1399
|
declare function ReactTextArea({ className, ...props }: ReactTextAreaProps): react.JSX.Element;
|
|
1326
|
-
type ReactFormValues = Record<string, unknown>;
|
|
1327
|
-
interface ReactFormRuleContext {
|
|
1328
|
-
getFieldValue: (name: string) => any;
|
|
1329
|
-
}
|
|
1330
|
-
interface ReactFormRuleConfig {
|
|
1331
|
-
required?: boolean;
|
|
1332
|
-
message?: string;
|
|
1333
|
-
type?: "number" | "integer" | "string";
|
|
1334
|
-
min?: number;
|
|
1335
|
-
max?: number;
|
|
1336
|
-
validator?: (rule: ReactFormRuleConfig, value: any) => void | Promise<void>;
|
|
1337
|
-
}
|
|
1338
|
-
type ReactFormRule = ReactFormRuleConfig | ((context: ReactFormRuleContext) => ReactFormRuleConfig);
|
|
1339
|
-
interface ReactFormInstance<T extends object = any> {
|
|
1340
|
-
getFieldValue: (name: string) => any;
|
|
1341
|
-
setFieldsValue: (values: Partial<T>) => void;
|
|
1342
|
-
resetFields: () => void;
|
|
1343
|
-
validateFields: () => Promise<T>;
|
|
1344
|
-
/** @internal */
|
|
1345
|
-
__store: FormStore;
|
|
1346
|
-
}
|
|
1347
|
-
interface FormStore {
|
|
1348
|
-
values: ReactFormValues;
|
|
1349
|
-
initialValues: ReactFormValues;
|
|
1350
|
-
errors: Record<string, string>;
|
|
1351
|
-
rules: Map<string, ReactFormRule[]>;
|
|
1352
|
-
listeners: Set<() => void>;
|
|
1353
|
-
revision: number;
|
|
1354
|
-
notify: () => void;
|
|
1355
|
-
}
|
|
1356
|
-
/** 创建表单实例。 */
|
|
1357
|
-
declare function useReactForm<T extends object = any>(): readonly [ReactFormInstance<T>];
|
|
1358
|
-
/** 订阅表单字段值。 */
|
|
1359
|
-
declare function useReactFormWatch(name: string, form: ReactFormInstance): any;
|
|
1360
|
-
interface ReactFormProps extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
1361
|
-
form: ReactFormInstance;
|
|
1362
|
-
initialValues?: ReactFormValues;
|
|
1363
|
-
layout?: "vertical" | "horizontal";
|
|
1364
|
-
}
|
|
1365
|
-
declare function ReactFormRoot({ form, initialValues, layout, className, children, ...props }: ReactFormProps): react.JSX.Element;
|
|
1366
|
-
interface ReactFormItemProps {
|
|
1367
|
-
label?: ReactNode;
|
|
1368
|
-
name: string;
|
|
1369
|
-
children: ReactElement;
|
|
1370
|
-
rules?: ReactFormRule[];
|
|
1371
|
-
dependencies?: string[];
|
|
1372
|
-
initialValue?: unknown;
|
|
1373
|
-
}
|
|
1374
|
-
declare function ReactFormItem({ label, name, children, rules, initialValue, }: ReactFormItemProps): react.JSX.Element;
|
|
1375
|
-
/** 带字段绑定和异步校验的轻量表单。 */
|
|
1376
|
-
declare const ReactForm: typeof ReactFormRoot & {
|
|
1377
|
-
Item: typeof ReactFormItem;
|
|
1378
|
-
useForm: typeof useReactForm;
|
|
1379
|
-
useWatch: typeof useReactFormWatch;
|
|
1380
|
-
};
|
|
1381
1400
|
type ReactMessageType = "info" | "success" | "warning" | "error";
|
|
1382
1401
|
/** 全局消息提示服务。 */
|
|
1383
1402
|
declare const reactMessage: {
|
|
@@ -1410,4 +1429,4 @@ declare function useReactContentScale(): ReactContentScaleValue;
|
|
|
1410
1429
|
*/
|
|
1411
1430
|
declare const REACT_COMPONENT_PREFIX = "canvas-react";
|
|
1412
1431
|
|
|
1413
|
-
export { type CascaderCheckedStrategy, type CascaderPath, REACT_COMPONENT_PREFIX, ReactAutoComplete, type ReactAutoCompleteProps, ReactButton, type ReactButtonProps, ReactCascader, type ReactCascaderChangeInfo, type ReactCascaderOption, type ReactCascaderProps, ReactCheckbox, type ReactCheckboxProps, type ReactCheckboxRef, ReactCol, type ReactColProps, ReactColorPicker, type ReactColorPickerProps, ReactContentScaleProvider, type ReactContentScaleValue, ReactDatePicker, type ReactDatePickerProps, ReactDateRangePicker, type ReactDateRangePickerProps, ReactDateTimePicker, type ReactDateTimePickerProps, ReactDateTimeRangePicker, type ReactDateTimeRangePickerProps, type ReactFilterConditionOperator, ReactFilterPanel, type ReactFilterPanelCondition, type ReactFilterPanelOption, type ReactFilterPanelRequest, type ReactFilterPanelTexts, type ReactFilterPanelValue, ReactFlex, type ReactFlexProps, ReactForm, type ReactFormInstance, type ReactFormItemProps, type ReactFormProps, type ReactFormRule, type ReactFormRuleConfig, type ReactFormValues, ReactImagePreview, type ReactImagePreviewProps, ReactInput, ReactInputNumber, type ReactInputNumberProps, type ReactInputProps, ReactInputRange, type ReactInputRangeProps, type ReactInputRangeValue, type ReactMessageType, ReactModal, type ReactModalButtonProps, type ReactModalCancelEvent, type ReactModalProps, ReactMonthPicker, type ReactMonthPickerProps, ReactNumberInput, type ReactNumberInputProps, ReactPagination, type ReactPaginationProps, type ReactPaginationStyles, ReactPopconfirm, type ReactPopconfirmButtonProps, type ReactPopconfirmPlacement, type ReactPopconfirmProps, ReactPopup, type ReactPopupProps, ReactQuarterPicker, type ReactQuarterPickerProps, ReactRadio, type ReactRadioGroupProps, type ReactRadioProps, type ReactResizablePanel, type ReactResizablePanelSizes, ReactResizablePanels, type ReactResizablePanelsDirection, type ReactResizablePanelsProps, type ReactResizablePanelsResizeInfo, ReactRow, type ReactRowProps, ReactScrollbarPositionDialog, type ReactScrollbarSettings, ReactScrollbarSettingsDialog, ReactSelect, type ReactSelectChangeInfo, type ReactSelectFilterOption, type ReactSelectOption, type ReactSelectProps, ReactTextArea, type ReactTextAreaProps, ReactTimePicker, type ReactTimePickerProps, ReactTimeRangePicker, type ReactTimeRangePickerProps, ReactTooltip, type ReactTooltipProps, ReactTransition, type ReactTransitionDuration, type ReactTransitionOptions, type ReactTransitionPhase, type ReactTransitionProps, type ReactTransitionState, ReactTreeSelect, type ReactTreeSelectChangeInfo, type TreeSelectNode as ReactTreeSelectNode, type ReactTreeSelectProps, type ReactTreeSelectValue, ReactVirtualList, type ReactVirtualListProps, type ReactVirtualListRef, ReactYearPicker, type ReactYearPickerProps, type SharedScrollbarSettings, getSharedScrollbarSettings, reactMessage, resolveReactScrollbarMode, resolveResizablePanelSizes, setSharedScrollbarSettings, subscribeSharedScrollbarSettings, useReactContentScale, useReactForm, useReactFormWatch, useReactTransition };
|
|
1432
|
+
export { type CascaderCheckedStrategy, type CascaderPath, REACT_COMPONENT_PREFIX, ReactAutoComplete, type ReactAutoCompleteProps, ReactButton, type ReactButtonProps, ReactCascader, type ReactCascaderChangeInfo, type ReactCascaderOption, type ReactCascaderProps, ReactCheckbox, type ReactCheckboxProps, type ReactCheckboxRef, ReactCol, type ReactColProps, ReactColorPicker, type ReactColorPickerProps, ReactContentScaleProvider, type ReactContentScaleValue, ReactDatePicker, type ReactDatePickerProps, ReactDateRangePicker, type ReactDateRangePickerProps, ReactDateTimePicker, type ReactDateTimePickerProps, ReactDateTimeRangePicker, type ReactDateTimeRangePickerProps, type ReactFilterConditionOperator, ReactFilterPanel, type ReactFilterPanelCondition, type ReactFilterPanelOption, type ReactFilterPanelRequest, type ReactFilterPanelTexts, type ReactFilterPanelValue, ReactFlex, type ReactFlexProps, ReactForm, type ReactFormInstance, ReactFormItem, type ReactFormItemProps, type ReactFormLayout, type ReactFormProps, type ReactFormRule, type ReactFormRuleConfig, type ReactFormRuleContext, type ReactFormValues, ReactImagePreview, type ReactImagePreviewProps, ReactInput, ReactInputNumber, type ReactInputNumberProps, type ReactInputProps, ReactInputRange, type ReactInputRangeProps, type ReactInputRangeValue, type ReactMessageType, ReactModal, type ReactModalButtonProps, type ReactModalCancelEvent, type ReactModalProps, ReactMonthPicker, type ReactMonthPickerProps, ReactNumberInput, type ReactNumberInputProps, ReactPagination, type ReactPaginationProps, type ReactPaginationStyles, ReactPopconfirm, type ReactPopconfirmButtonProps, type ReactPopconfirmPlacement, type ReactPopconfirmProps, ReactPopup, type ReactPopupProps, ReactQuarterPicker, type ReactQuarterPickerProps, ReactRadio, type ReactRadioGroupProps, type ReactRadioProps, type ReactResizablePanel, type ReactResizablePanelSizes, ReactResizablePanels, type ReactResizablePanelsDirection, type ReactResizablePanelsProps, type ReactResizablePanelsResizeInfo, ReactRow, type ReactRowProps, ReactScrollbarPositionDialog, type ReactScrollbarSettings, ReactScrollbarSettingsDialog, ReactSelect, type ReactSelectChangeInfo, type ReactSelectFilterOption, type ReactSelectOption, type ReactSelectProps, ReactTextArea, type ReactTextAreaProps, ReactTimePicker, type ReactTimePickerProps, ReactTimeRangePicker, type ReactTimeRangePickerProps, ReactTooltip, type ReactTooltipProps, ReactTransition, type ReactTransitionDuration, type ReactTransitionOptions, type ReactTransitionPhase, type ReactTransitionProps, type ReactTransitionState, ReactTreeSelect, type ReactTreeSelectChangeInfo, type TreeSelectNode as ReactTreeSelectNode, type ReactTreeSelectProps, type ReactTreeSelectValue, ReactVirtualList, type ReactVirtualListProps, type ReactVirtualListRef, ReactYearPicker, type ReactYearPickerProps, type SharedScrollbarSettings, getSharedScrollbarSettings, reactMessage, resolveReactScrollbarMode, resolveResizablePanelSizes, setSharedScrollbarSettings, subscribeSharedScrollbarSettings, useReactContentScale, useReactForm, useReactFormWatch, useReactTransition };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { InputHTMLAttributes, ReactNode, KeyboardEvent as KeyboardEvent$1,
|
|
2
|
+
import { InputHTMLAttributes, ReactNode, HTMLAttributes, CSSProperties, KeyboardEvent as KeyboardEvent$1, ButtonHTMLAttributes, MouseEvent, RefObject, TextareaHTMLAttributes, ReactElement } from 'react';
|
|
3
3
|
|
|
4
4
|
interface ReactCheckboxRef {
|
|
5
5
|
focus: () => void;
|
|
@@ -102,6 +102,80 @@ declare function ReactFilterPanel(props: {
|
|
|
102
102
|
request: ReactFilterPanelRequest | null;
|
|
103
103
|
}): react.JSX.Element | null;
|
|
104
104
|
|
|
105
|
+
type ReactFormValues = Record<string, unknown>;
|
|
106
|
+
interface ReactFormRuleContext {
|
|
107
|
+
getFieldValue: (name: string) => unknown;
|
|
108
|
+
}
|
|
109
|
+
interface ReactFormRuleConfig {
|
|
110
|
+
required?: boolean;
|
|
111
|
+
message?: string;
|
|
112
|
+
type?: "number" | "integer" | "string";
|
|
113
|
+
min?: number;
|
|
114
|
+
max?: number;
|
|
115
|
+
validator?: (rule: ReactFormRuleConfig, value: unknown) => void | Promise<void>;
|
|
116
|
+
}
|
|
117
|
+
type ReactFormRule = ReactFormRuleConfig | ((context: ReactFormRuleContext) => ReactFormRuleConfig);
|
|
118
|
+
interface ReactFormInstance<T extends object = Record<string, unknown>> {
|
|
119
|
+
getFieldValue: (name: string) => unknown;
|
|
120
|
+
setFieldsValue: (values: Partial<T>) => void;
|
|
121
|
+
resetFields: () => void;
|
|
122
|
+
validateFields: () => Promise<T>;
|
|
123
|
+
/** @internal */
|
|
124
|
+
__store: FormStore;
|
|
125
|
+
}
|
|
126
|
+
interface FormStore {
|
|
127
|
+
values: ReactFormValues;
|
|
128
|
+
initialValues: ReactFormValues;
|
|
129
|
+
errors: Record<string, string>;
|
|
130
|
+
rules: Map<string, ReactFormRule[]>;
|
|
131
|
+
listeners: Set<() => void>;
|
|
132
|
+
revision: number;
|
|
133
|
+
notify: () => void;
|
|
134
|
+
}
|
|
135
|
+
type ReactFormLayout = "vertical" | "horizontal" | "inline";
|
|
136
|
+
/** 创建表单实例。 */
|
|
137
|
+
declare function useReactForm<T extends object = Record<string, unknown>>(): readonly [ReactFormInstance<T>];
|
|
138
|
+
/** 订阅表单字段值。 */
|
|
139
|
+
declare function useReactFormWatch(name: string, form: ReactFormInstance): unknown;
|
|
140
|
+
interface ReactFormProps extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
141
|
+
form?: ReactFormInstance;
|
|
142
|
+
initialValues?: ReactFormValues;
|
|
143
|
+
layout?: ReactFormLayout;
|
|
144
|
+
noWrap?: boolean;
|
|
145
|
+
itemSpacing?: CSSProperties["marginBlockEnd"];
|
|
146
|
+
labelWidth?: CSSProperties["width"];
|
|
147
|
+
labelAlign?: "left" | "right";
|
|
148
|
+
colon?: boolean;
|
|
149
|
+
requiredMark?: boolean;
|
|
150
|
+
}
|
|
151
|
+
declare function ReactFormRoot({ form: formProp, initialValues, layout, noWrap, itemSpacing, labelWidth, labelAlign, colon, requiredMark, className, children, ...props }: ReactFormProps): react.JSX.Element;
|
|
152
|
+
interface ReactFormItemProps {
|
|
153
|
+
label?: ReactNode;
|
|
154
|
+
name?: string;
|
|
155
|
+
children: ReactNode;
|
|
156
|
+
rules?: ReactFormRule[];
|
|
157
|
+
dependencies?: string[];
|
|
158
|
+
initialValue?: unknown;
|
|
159
|
+
required?: boolean;
|
|
160
|
+
colon?: boolean;
|
|
161
|
+
labelWidth?: CSSProperties["width"];
|
|
162
|
+
labelAlign?: "left" | "right";
|
|
163
|
+
labelStyle?: CSSProperties;
|
|
164
|
+
controlStyle?: CSSProperties;
|
|
165
|
+
help?: ReactNode;
|
|
166
|
+
extra?: ReactNode;
|
|
167
|
+
className?: string;
|
|
168
|
+
style?: CSSProperties;
|
|
169
|
+
noWrap?: boolean;
|
|
170
|
+
}
|
|
171
|
+
declare function ReactFormItem({ label, name, children, rules, initialValue, required, colon, labelWidth, labelAlign, labelStyle, controlStyle, help, extra, className, style, noWrap, }: ReactFormItemProps): react.JSX.Element;
|
|
172
|
+
/** Ant Design 风格表单,支持横向、纵向与行内布局。 */
|
|
173
|
+
declare const ReactForm: typeof ReactFormRoot & {
|
|
174
|
+
Item: typeof ReactFormItem;
|
|
175
|
+
useForm: typeof useReactForm;
|
|
176
|
+
useWatch: typeof useReactFormWatch;
|
|
177
|
+
};
|
|
178
|
+
|
|
105
179
|
interface ReactInputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"> {
|
|
106
180
|
/**
|
|
107
181
|
* 回车确认回调。
|
|
@@ -1323,61 +1397,6 @@ interface ReactTextAreaProps extends TextareaHTMLAttributes<HTMLTextAreaElement>
|
|
|
1323
1397
|
}
|
|
1324
1398
|
/** 多行文本输入框。 */
|
|
1325
1399
|
declare function ReactTextArea({ className, ...props }: ReactTextAreaProps): react.JSX.Element;
|
|
1326
|
-
type ReactFormValues = Record<string, unknown>;
|
|
1327
|
-
interface ReactFormRuleContext {
|
|
1328
|
-
getFieldValue: (name: string) => any;
|
|
1329
|
-
}
|
|
1330
|
-
interface ReactFormRuleConfig {
|
|
1331
|
-
required?: boolean;
|
|
1332
|
-
message?: string;
|
|
1333
|
-
type?: "number" | "integer" | "string";
|
|
1334
|
-
min?: number;
|
|
1335
|
-
max?: number;
|
|
1336
|
-
validator?: (rule: ReactFormRuleConfig, value: any) => void | Promise<void>;
|
|
1337
|
-
}
|
|
1338
|
-
type ReactFormRule = ReactFormRuleConfig | ((context: ReactFormRuleContext) => ReactFormRuleConfig);
|
|
1339
|
-
interface ReactFormInstance<T extends object = any> {
|
|
1340
|
-
getFieldValue: (name: string) => any;
|
|
1341
|
-
setFieldsValue: (values: Partial<T>) => void;
|
|
1342
|
-
resetFields: () => void;
|
|
1343
|
-
validateFields: () => Promise<T>;
|
|
1344
|
-
/** @internal */
|
|
1345
|
-
__store: FormStore;
|
|
1346
|
-
}
|
|
1347
|
-
interface FormStore {
|
|
1348
|
-
values: ReactFormValues;
|
|
1349
|
-
initialValues: ReactFormValues;
|
|
1350
|
-
errors: Record<string, string>;
|
|
1351
|
-
rules: Map<string, ReactFormRule[]>;
|
|
1352
|
-
listeners: Set<() => void>;
|
|
1353
|
-
revision: number;
|
|
1354
|
-
notify: () => void;
|
|
1355
|
-
}
|
|
1356
|
-
/** 创建表单实例。 */
|
|
1357
|
-
declare function useReactForm<T extends object = any>(): readonly [ReactFormInstance<T>];
|
|
1358
|
-
/** 订阅表单字段值。 */
|
|
1359
|
-
declare function useReactFormWatch(name: string, form: ReactFormInstance): any;
|
|
1360
|
-
interface ReactFormProps extends Omit<HTMLAttributes<HTMLFormElement>, "onSubmit"> {
|
|
1361
|
-
form: ReactFormInstance;
|
|
1362
|
-
initialValues?: ReactFormValues;
|
|
1363
|
-
layout?: "vertical" | "horizontal";
|
|
1364
|
-
}
|
|
1365
|
-
declare function ReactFormRoot({ form, initialValues, layout, className, children, ...props }: ReactFormProps): react.JSX.Element;
|
|
1366
|
-
interface ReactFormItemProps {
|
|
1367
|
-
label?: ReactNode;
|
|
1368
|
-
name: string;
|
|
1369
|
-
children: ReactElement;
|
|
1370
|
-
rules?: ReactFormRule[];
|
|
1371
|
-
dependencies?: string[];
|
|
1372
|
-
initialValue?: unknown;
|
|
1373
|
-
}
|
|
1374
|
-
declare function ReactFormItem({ label, name, children, rules, initialValue, }: ReactFormItemProps): react.JSX.Element;
|
|
1375
|
-
/** 带字段绑定和异步校验的轻量表单。 */
|
|
1376
|
-
declare const ReactForm: typeof ReactFormRoot & {
|
|
1377
|
-
Item: typeof ReactFormItem;
|
|
1378
|
-
useForm: typeof useReactForm;
|
|
1379
|
-
useWatch: typeof useReactFormWatch;
|
|
1380
|
-
};
|
|
1381
1400
|
type ReactMessageType = "info" | "success" | "warning" | "error";
|
|
1382
1401
|
/** 全局消息提示服务。 */
|
|
1383
1402
|
declare const reactMessage: {
|
|
@@ -1410,4 +1429,4 @@ declare function useReactContentScale(): ReactContentScaleValue;
|
|
|
1410
1429
|
*/
|
|
1411
1430
|
declare const REACT_COMPONENT_PREFIX = "canvas-react";
|
|
1412
1431
|
|
|
1413
|
-
export { type CascaderCheckedStrategy, type CascaderPath, REACT_COMPONENT_PREFIX, ReactAutoComplete, type ReactAutoCompleteProps, ReactButton, type ReactButtonProps, ReactCascader, type ReactCascaderChangeInfo, type ReactCascaderOption, type ReactCascaderProps, ReactCheckbox, type ReactCheckboxProps, type ReactCheckboxRef, ReactCol, type ReactColProps, ReactColorPicker, type ReactColorPickerProps, ReactContentScaleProvider, type ReactContentScaleValue, ReactDatePicker, type ReactDatePickerProps, ReactDateRangePicker, type ReactDateRangePickerProps, ReactDateTimePicker, type ReactDateTimePickerProps, ReactDateTimeRangePicker, type ReactDateTimeRangePickerProps, type ReactFilterConditionOperator, ReactFilterPanel, type ReactFilterPanelCondition, type ReactFilterPanelOption, type ReactFilterPanelRequest, type ReactFilterPanelTexts, type ReactFilterPanelValue, ReactFlex, type ReactFlexProps, ReactForm, type ReactFormInstance, type ReactFormItemProps, type ReactFormProps, type ReactFormRule, type ReactFormRuleConfig, type ReactFormValues, ReactImagePreview, type ReactImagePreviewProps, ReactInput, ReactInputNumber, type ReactInputNumberProps, type ReactInputProps, ReactInputRange, type ReactInputRangeProps, type ReactInputRangeValue, type ReactMessageType, ReactModal, type ReactModalButtonProps, type ReactModalCancelEvent, type ReactModalProps, ReactMonthPicker, type ReactMonthPickerProps, ReactNumberInput, type ReactNumberInputProps, ReactPagination, type ReactPaginationProps, type ReactPaginationStyles, ReactPopconfirm, type ReactPopconfirmButtonProps, type ReactPopconfirmPlacement, type ReactPopconfirmProps, ReactPopup, type ReactPopupProps, ReactQuarterPicker, type ReactQuarterPickerProps, ReactRadio, type ReactRadioGroupProps, type ReactRadioProps, type ReactResizablePanel, type ReactResizablePanelSizes, ReactResizablePanels, type ReactResizablePanelsDirection, type ReactResizablePanelsProps, type ReactResizablePanelsResizeInfo, ReactRow, type ReactRowProps, ReactScrollbarPositionDialog, type ReactScrollbarSettings, ReactScrollbarSettingsDialog, ReactSelect, type ReactSelectChangeInfo, type ReactSelectFilterOption, type ReactSelectOption, type ReactSelectProps, ReactTextArea, type ReactTextAreaProps, ReactTimePicker, type ReactTimePickerProps, ReactTimeRangePicker, type ReactTimeRangePickerProps, ReactTooltip, type ReactTooltipProps, ReactTransition, type ReactTransitionDuration, type ReactTransitionOptions, type ReactTransitionPhase, type ReactTransitionProps, type ReactTransitionState, ReactTreeSelect, type ReactTreeSelectChangeInfo, type TreeSelectNode as ReactTreeSelectNode, type ReactTreeSelectProps, type ReactTreeSelectValue, ReactVirtualList, type ReactVirtualListProps, type ReactVirtualListRef, ReactYearPicker, type ReactYearPickerProps, type SharedScrollbarSettings, getSharedScrollbarSettings, reactMessage, resolveReactScrollbarMode, resolveResizablePanelSizes, setSharedScrollbarSettings, subscribeSharedScrollbarSettings, useReactContentScale, useReactForm, useReactFormWatch, useReactTransition };
|
|
1432
|
+
export { type CascaderCheckedStrategy, type CascaderPath, REACT_COMPONENT_PREFIX, ReactAutoComplete, type ReactAutoCompleteProps, ReactButton, type ReactButtonProps, ReactCascader, type ReactCascaderChangeInfo, type ReactCascaderOption, type ReactCascaderProps, ReactCheckbox, type ReactCheckboxProps, type ReactCheckboxRef, ReactCol, type ReactColProps, ReactColorPicker, type ReactColorPickerProps, ReactContentScaleProvider, type ReactContentScaleValue, ReactDatePicker, type ReactDatePickerProps, ReactDateRangePicker, type ReactDateRangePickerProps, ReactDateTimePicker, type ReactDateTimePickerProps, ReactDateTimeRangePicker, type ReactDateTimeRangePickerProps, type ReactFilterConditionOperator, ReactFilterPanel, type ReactFilterPanelCondition, type ReactFilterPanelOption, type ReactFilterPanelRequest, type ReactFilterPanelTexts, type ReactFilterPanelValue, ReactFlex, type ReactFlexProps, ReactForm, type ReactFormInstance, ReactFormItem, type ReactFormItemProps, type ReactFormLayout, type ReactFormProps, type ReactFormRule, type ReactFormRuleConfig, type ReactFormRuleContext, type ReactFormValues, ReactImagePreview, type ReactImagePreviewProps, ReactInput, ReactInputNumber, type ReactInputNumberProps, type ReactInputProps, ReactInputRange, type ReactInputRangeProps, type ReactInputRangeValue, type ReactMessageType, ReactModal, type ReactModalButtonProps, type ReactModalCancelEvent, type ReactModalProps, ReactMonthPicker, type ReactMonthPickerProps, ReactNumberInput, type ReactNumberInputProps, ReactPagination, type ReactPaginationProps, type ReactPaginationStyles, ReactPopconfirm, type ReactPopconfirmButtonProps, type ReactPopconfirmPlacement, type ReactPopconfirmProps, ReactPopup, type ReactPopupProps, ReactQuarterPicker, type ReactQuarterPickerProps, ReactRadio, type ReactRadioGroupProps, type ReactRadioProps, type ReactResizablePanel, type ReactResizablePanelSizes, ReactResizablePanels, type ReactResizablePanelsDirection, type ReactResizablePanelsProps, type ReactResizablePanelsResizeInfo, ReactRow, type ReactRowProps, ReactScrollbarPositionDialog, type ReactScrollbarSettings, ReactScrollbarSettingsDialog, ReactSelect, type ReactSelectChangeInfo, type ReactSelectFilterOption, type ReactSelectOption, type ReactSelectProps, ReactTextArea, type ReactTextAreaProps, ReactTimePicker, type ReactTimePickerProps, ReactTimeRangePicker, type ReactTimeRangePickerProps, ReactTooltip, type ReactTooltipProps, ReactTransition, type ReactTransitionDuration, type ReactTransitionOptions, type ReactTransitionPhase, type ReactTransitionProps, type ReactTransitionState, ReactTreeSelect, type ReactTreeSelectChangeInfo, type TreeSelectNode as ReactTreeSelectNode, type ReactTreeSelectProps, type ReactTreeSelectValue, ReactVirtualList, type ReactVirtualListProps, type ReactVirtualListRef, ReactYearPicker, type ReactYearPickerProps, type SharedScrollbarSettings, getSharedScrollbarSettings, reactMessage, resolveReactScrollbarMode, resolveResizablePanelSizes, setSharedScrollbarSettings, subscribeSharedScrollbarSettings, useReactContentScale, useReactForm, useReactFormWatch, useReactTransition };
|