px-react-ui-components 1.1.25 → 1.1.27
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.
|
@@ -51,6 +51,8 @@ const MyFileUploadAcceptType = exports.MyFileUploadAcceptType = {
|
|
|
51
51
|
Object.freeze(MyFileUploadAcceptType);
|
|
52
52
|
function MyFileUpload({
|
|
53
53
|
t = null,
|
|
54
|
+
name = null,
|
|
55
|
+
required = false,
|
|
54
56
|
multiple = false,
|
|
55
57
|
accept = MyFileUploadAcceptType.ALL,
|
|
56
58
|
camera = true,
|
|
@@ -120,7 +122,20 @@ function MyFileUpload({
|
|
|
120
122
|
});
|
|
121
123
|
(0, _MyAlert.MyAlert)("<br/><br/><div style='display: block;font-size:13px;width: 100%;text-align: left;'>" + message + "</div>", _MyAlert.MyAlertType.WARNING);
|
|
122
124
|
}
|
|
123
|
-
if (onData && (Array.isArray(resdata) && resdata.length > 0 || !Array.isArray(resdata) && resdata))
|
|
125
|
+
if (onData && (Array.isArray(resdata) && resdata.length > 0 || !Array.isArray(resdata) && resdata)) {
|
|
126
|
+
if (name) {
|
|
127
|
+
onData({
|
|
128
|
+
target: {
|
|
129
|
+
name: name,
|
|
130
|
+
files: Array.isArray(resdata) ? resdata : [resdata],
|
|
131
|
+
value: Array.isArray(resdata) ? resdata : [resdata]
|
|
132
|
+
},
|
|
133
|
+
value: Array.isArray(resdata) ? resdata : [resdata]
|
|
134
|
+
});
|
|
135
|
+
} else {
|
|
136
|
+
onData(resdata);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
124
139
|
setLoading(false);
|
|
125
140
|
};
|
|
126
141
|
const getBase64 = (files, callback = null) => {
|
|
@@ -256,7 +271,7 @@ function MyFileUpload({
|
|
|
256
271
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
257
272
|
style: {
|
|
258
273
|
display: 'flex',
|
|
259
|
-
flexDirection: '
|
|
274
|
+
flexDirection: 'column',
|
|
260
275
|
gap: '1px'
|
|
261
276
|
},
|
|
262
277
|
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
@@ -271,7 +286,21 @@ function MyFileUpload({
|
|
|
271
286
|
letterSpacing: "0.05em"
|
|
272
287
|
},
|
|
273
288
|
className: labelClassName ? labelClassName : '',
|
|
274
|
-
children:
|
|
289
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
290
|
+
style: {
|
|
291
|
+
display: 'flex',
|
|
292
|
+
flexDirection: 'row',
|
|
293
|
+
gap: '5px'
|
|
294
|
+
},
|
|
295
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
296
|
+
children: label
|
|
297
|
+
}), required && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
298
|
+
style: {
|
|
299
|
+
color: 'red'
|
|
300
|
+
},
|
|
301
|
+
children: "*"
|
|
302
|
+
})]
|
|
303
|
+
})
|
|
275
304
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
276
305
|
className: _MyFileUploadModule.default.myFileUploadContainer + (className != null ? " " + className : ''),
|
|
277
306
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -341,7 +370,7 @@ function MyFileUpload({
|
|
|
341
370
|
} : undefined
|
|
342
371
|
},
|
|
343
372
|
onTakePhoto: dataUri => {
|
|
344
|
-
console.log(dataUri);
|
|
373
|
+
// console.log(dataUri);
|
|
345
374
|
handleTakePhoto(dataUri);
|
|
346
375
|
},
|
|
347
376
|
onCameraError: handleCameraError,
|