@hzab/form-render-mobile 1.1.6 → 1.1.7
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -41,6 +41,7 @@ function Uploader(props, ref) {
|
|
|
41
41
|
uploadBtnNode,
|
|
42
42
|
// cordova插件上传类型 cordova-plugin-chooser | cordova-plugin-camera
|
|
43
43
|
cordovaPlugin = "cordova-plugin-camera",
|
|
44
|
+
uploaderProps
|
|
44
45
|
} = props;
|
|
45
46
|
const [loading, setLoading] = useState(false);
|
|
46
47
|
const [fileList, setFileList] = useState(handleInputFileList(value, maxCount));
|
|
@@ -142,13 +143,17 @@ function Uploader(props, ref) {
|
|
|
142
143
|
onGalleryUopload?.({
|
|
143
144
|
onUploadSuccess: (res) => {
|
|
144
145
|
onFileChange({
|
|
145
|
-
persist: () => {},
|
|
146
|
+
persist: () => { },
|
|
146
147
|
target: {
|
|
147
148
|
value: "",
|
|
148
149
|
files: [res],
|
|
149
150
|
},
|
|
150
151
|
});
|
|
151
152
|
},
|
|
153
|
+
options: {
|
|
154
|
+
cameraDirection: uploaderProps?.CameraConf?.frontCamera ? Camera.Direction.FRONT : null,
|
|
155
|
+
...uploaderProps?.CameraConf
|
|
156
|
+
}
|
|
152
157
|
});
|
|
153
158
|
} else if (window?.chooser && cordovaPlugin === "cordova-plugin-chooser") {
|
|
154
159
|
uploadManagerRef.current.uploadFile({
|
|
@@ -159,7 +164,7 @@ function Uploader(props, ref) {
|
|
|
159
164
|
},
|
|
160
165
|
onSuccess(values) {
|
|
161
166
|
onFileChange({
|
|
162
|
-
persist: () => {},
|
|
167
|
+
persist: () => { },
|
|
163
168
|
target: {
|
|
164
169
|
value: "",
|
|
165
170
|
files: [values.blob],
|
|
@@ -178,7 +183,7 @@ function Uploader(props, ref) {
|
|
|
178
183
|
case "captureImage":
|
|
179
184
|
getImage(props.imgPluginOpt, props.getImgOpt).then((res) => {
|
|
180
185
|
onFileChange({
|
|
181
|
-
persist: () => {},
|
|
186
|
+
persist: () => { },
|
|
182
187
|
target: {
|
|
183
188
|
value: "",
|
|
184
189
|
files: [res],
|
|
@@ -190,7 +195,7 @@ function Uploader(props, ref) {
|
|
|
190
195
|
case "captureVideo":
|
|
191
196
|
getVideo().then((res) => {
|
|
192
197
|
onFileChange({
|
|
193
|
-
persist: () => {},
|
|
198
|
+
persist: () => { },
|
|
194
199
|
target: {
|
|
195
200
|
value: "",
|
|
196
201
|
files: [res],
|