@fairys/taro-tools-simple-form 1.0.20 → 1.0.21
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/esm/item.config.d.ts +3 -0
- package/esm/item.config.js +4 -2
- package/package.json +2 -2
- package/src/item.config.tsx +5 -0
package/esm/item.config.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { FairysTaroCheckboxGroupProps } from '@fairys/taro-tools-simple-form-ui'
|
|
|
6
6
|
import { FairysTaroDatePickerProps } from '@fairys/taro-tools-simple-form-ui';
|
|
7
7
|
import { FairysTaroPickerProps } from '@fairys/taro-tools-simple-form-ui';
|
|
8
8
|
import { FairysTaroPopupSearchProps } from '@fairys/taro-tools-simple-form-ui';
|
|
9
|
+
import { FairysTaroUploaderBaseProps } from '@fairys/taro-tools-simple-form-ui';
|
|
9
10
|
import { TaroInputProps, TaroInputNumberProps, RadioGroupProps, RadioProps, RangeProps, RateProps, SignatureProps, SwitchProps, TextAreaProps, UploaderProps } from '@nutui/nutui-react-taro';
|
|
10
11
|
export type MObject<T> = {
|
|
11
12
|
[K in keyof T]: T[K];
|
|
@@ -75,6 +76,8 @@ export interface FormItemTypeConfing {
|
|
|
75
76
|
textarea: TextAreaProps;
|
|
76
77
|
/**上传组件*/
|
|
77
78
|
uploader: UploaderProps;
|
|
79
|
+
/**上传组件*/
|
|
80
|
+
fairysUploader: FairysTaroUploaderBaseProps;
|
|
78
81
|
}
|
|
79
82
|
/**
|
|
80
83
|
* 自定义表单列表项配置类型
|
package/esm/item.config.js
CHANGED
|
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { View } from "@tarojs/components";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
4
|
import { FormHideItem, FormHideList, FormItem, FormList } from "@carefrees/form-utils-react-taro";
|
|
5
|
-
import { FairysTaroCalendarBase, FairysTaroCascaderBase, FairysTaroCheckboxGroupBase, FairysTaroDatePickerBase, FairysTaroPickerBase, FairysTaroPopupSearchBase, FairysTaroRadioGroupBase } from "@fairys/taro-tools-simple-form-ui";
|
|
5
|
+
import { FairysTaroCalendarBase, FairysTaroCascaderBase, FairysTaroCheckboxGroupBase, FairysTaroDatePickerBase, FairysTaroPickerBase, FairysTaroPopupSearchBase, FairysTaroRadioGroupBase, FairysTaroUploaderBase } from "@fairys/taro-tools-simple-form-ui";
|
|
6
6
|
import { Input, InputNumber, Radio, RadioGroup, Range, Rate, Signature, Switch, TextArea, Uploader } from "@nutui/nutui-react-taro";
|
|
7
7
|
const create_itemConfig = (configList)=>/*#__PURE__*/ jsx(Fragment, {
|
|
8
8
|
children: configList.map((item, index)=>{
|
|
@@ -96,7 +96,9 @@ const create_itemConfig = (configList)=>/*#__PURE__*/ jsx(Fragment, {
|
|
|
96
96
|
...attrs,
|
|
97
97
|
title: title
|
|
98
98
|
});
|
|
99
|
-
}
|
|
99
|
+
} else if ('fairysUploader' === type) newItem.children = /*#__PURE__*/ jsx(FairysTaroUploaderBase, {
|
|
100
|
+
...attrs
|
|
101
|
+
});
|
|
100
102
|
if (isEmpty) return /*#__PURE__*/ jsx(View, {
|
|
101
103
|
className: "fairys-taro-simple-form-item-empty"
|
|
102
104
|
}, index);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"author": "SunLxy <1011771396@qq.com>",
|
|
4
4
|
"description": "框架组件库",
|
|
5
5
|
"homepage": "https://github.com/autumn-fairy-tales/fairys-taro-react",
|
|
6
|
-
"version": "1.0.
|
|
6
|
+
"version": "1.0.21",
|
|
7
7
|
"main": "lib/index.js",
|
|
8
8
|
"types": "esm/index.d.ts",
|
|
9
9
|
"module": "esm/index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@carefrees/form-utils-react-taro": "^0.0.18",
|
|
29
|
-
"@fairys/taro-tools-simple-form-ui": "^1.0.
|
|
29
|
+
"@fairys/taro-tools-simple-form-ui": "^1.0.21",
|
|
30
30
|
"@nutui/nutui-react-taro": "^3.0.18",
|
|
31
31
|
"clsx": "2.1.1",
|
|
32
32
|
"valtio": "~2.1.5"
|
package/src/item.config.tsx
CHANGED
|
@@ -13,6 +13,7 @@ import { FairysTaroCheckboxGroupBase, FairysTaroCheckboxGroupProps } from '@fair
|
|
|
13
13
|
import { FairysTaroDatePickerBase, FairysTaroDatePickerProps } from '@fairys/taro-tools-simple-form-ui';
|
|
14
14
|
import { FairysTaroPickerBase, FairysTaroPickerProps } from '@fairys/taro-tools-simple-form-ui';
|
|
15
15
|
import { FairysTaroPopupSearchBase, FairysTaroPopupSearchProps } from '@fairys/taro-tools-simple-form-ui';
|
|
16
|
+
import { FairysTaroUploaderBase, FairysTaroUploaderBaseProps } from '@fairys/taro-tools-simple-form-ui';
|
|
16
17
|
|
|
17
18
|
import {
|
|
18
19
|
Input,
|
|
@@ -108,6 +109,8 @@ export interface FormItemTypeConfing {
|
|
|
108
109
|
textarea: TextAreaProps;
|
|
109
110
|
/**上传组件*/
|
|
110
111
|
uploader: UploaderProps;
|
|
112
|
+
/**上传组件*/
|
|
113
|
+
fairysUploader: FairysTaroUploaderBaseProps;
|
|
111
114
|
}
|
|
112
115
|
|
|
113
116
|
/**
|
|
@@ -182,6 +185,8 @@ const create_itemConfig = (configList: InputConfigType[]) => {
|
|
|
182
185
|
} else if (type === 'fairysPopupSearch') {
|
|
183
186
|
const title = attrs.title || (typeof item.label === 'string' ? item.label : '') || '请选择';
|
|
184
187
|
newItem.children = <FairysTaroPopupSearchBase {...attrs} title={title} />;
|
|
188
|
+
} else if (type === 'fairysUploader') {
|
|
189
|
+
newItem.children = <FairysTaroUploaderBase {...attrs} />;
|
|
185
190
|
}
|
|
186
191
|
if (isEmpty) {
|
|
187
192
|
return <View key={index} className="fairys-taro-simple-form-item-empty" />;
|