@carefrees/form-utils-react-taro 0.0.8 → 0.0.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.
- package/README.md +54 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -573,3 +573,57 @@ export declare const LayoutFormItem: React.MemoExoticComponent<
|
|
|
573
573
|
(props: LayoutFormItemProps) => import('react/jsx-runtime').JSX.Element
|
|
574
574
|
>;
|
|
575
575
|
```
|
|
576
|
+
|
|
577
|
+
### 表单项参数
|
|
578
|
+
|
|
579
|
+
```ts
|
|
580
|
+
import { RuleInstanceBase, FormInstanceBase, FormItemInstanceBase } from '@carefrees/form-utils';
|
|
581
|
+
import { RegisterFormItemOptions } from '@carefrees/form-utils-react-hooks';
|
|
582
|
+
import React from 'react';
|
|
583
|
+
export interface FormItemAttrOptions extends RegisterFormItemOptions {
|
|
584
|
+
/**依赖更新项*/
|
|
585
|
+
dependencies?: string[];
|
|
586
|
+
/**通知 只用于校验规则提示 字段 */
|
|
587
|
+
noticeOnlyRuleDataField?: string[];
|
|
588
|
+
/**通知父级字段监听方法更新*/
|
|
589
|
+
isNoticeParentField?: boolean;
|
|
590
|
+
/**通知watch监听方法更新*/
|
|
591
|
+
noticeWatchField?: string[];
|
|
592
|
+
/**是否保护值(不进行表单项组件卸载重置初始值)*/
|
|
593
|
+
preserve?: boolean;
|
|
594
|
+
/**重写规则*/
|
|
595
|
+
useRules?: (ruleInstance: RuleInstanceBase, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => void;
|
|
596
|
+
/**输入框属性重写*/
|
|
597
|
+
useAttrs?: (attrs: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => any;
|
|
598
|
+
/**输入框属性*/
|
|
599
|
+
attrs?: any;
|
|
600
|
+
/**传递组件字段*/
|
|
601
|
+
valuePropName?: string;
|
|
602
|
+
/**取值字段(默认和valuePropName值相同)*/
|
|
603
|
+
getValuePath?: string;
|
|
604
|
+
/**自定义获取值*/
|
|
605
|
+
getValueFromEvent?: (event: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase) => any;
|
|
606
|
+
/**值格式化*/
|
|
607
|
+
formatValue?: (value: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase, event: any) => any;
|
|
608
|
+
/**触发数据更新之后触发(用于数据联动之类的)*/
|
|
609
|
+
onAfterUpdate?: (value: any, form: FormInstanceBase, formItemInstance: FormItemInstanceBase, event: any) => void;
|
|
610
|
+
/**事件名称*/
|
|
611
|
+
trigger?: string;
|
|
612
|
+
/**子元素*/
|
|
613
|
+
children?: React.ReactNode;
|
|
614
|
+
}
|
|
615
|
+
/**表单项参数*/
|
|
616
|
+
export declare const useFormItemAttr: (options: FormItemAttrOptions) => {
|
|
617
|
+
children: string | number | boolean | React.ReactElement<any, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode>;
|
|
618
|
+
form: FormInstanceBase<any>;
|
|
619
|
+
formItemInstance: FormItemInstanceBase;
|
|
620
|
+
ruleInstance: RuleInstanceBase;
|
|
621
|
+
onChange: (event: any) => void;
|
|
622
|
+
htmlFor: string;
|
|
623
|
+
validateResult: {
|
|
624
|
+
tip: string | (string | undefined)[];
|
|
625
|
+
isInvalid: boolean;
|
|
626
|
+
};
|
|
627
|
+
};
|
|
628
|
+
|
|
629
|
+
```
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "SunLxy <1011771396@qq.com>",
|
|
4
4
|
"description": "taro react 表单组件",
|
|
5
5
|
"homepage": "https://github.com/SunLxy/carefrees-form-utils",
|
|
6
|
-
"version": "0.0.
|
|
6
|
+
"version": "0.0.10",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"types": "lib/index.d.ts",
|
|
9
9
|
"module": "esm/index.js",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"esm"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@carefrees/form-utils": "^0.0.
|
|
25
|
-
"@carefrees/form-utils-react-hooks": "^0.0.
|
|
24
|
+
"@carefrees/form-utils": "^0.0.10",
|
|
25
|
+
"@carefrees/form-utils-react-hooks": "^0.0.10",
|
|
26
26
|
"classnames": "2.5.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|