px-react-ui-components 1.1.25 → 1.1.26
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) => {
|
|
@@ -259,7 +274,7 @@ function MyFileUpload({
|
|
|
259
274
|
flexDirection: 'row',
|
|
260
275
|
gap: '1px'
|
|
261
276
|
},
|
|
262
|
-
children: [label && /*#__PURE__*/(0, _jsxRuntime.
|
|
277
|
+
children: [label && /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
263
278
|
style: {
|
|
264
279
|
display: "block",
|
|
265
280
|
fontSize: 11,
|
|
@@ -271,7 +286,12 @@ function MyFileUpload({
|
|
|
271
286
|
letterSpacing: "0.05em"
|
|
272
287
|
},
|
|
273
288
|
className: labelClassName ? labelClassName : '',
|
|
274
|
-
children: label
|
|
289
|
+
children: [label, " ", required && /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
290
|
+
style: {
|
|
291
|
+
color: 'red'
|
|
292
|
+
},
|
|
293
|
+
children: "*"
|
|
294
|
+
})]
|
|
275
295
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
276
296
|
className: _MyFileUploadModule.default.myFileUploadContainer + (className != null ? " " + className : ''),
|
|
277
297
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
@@ -341,7 +361,7 @@ function MyFileUpload({
|
|
|
341
361
|
} : undefined
|
|
342
362
|
},
|
|
343
363
|
onTakePhoto: dataUri => {
|
|
344
|
-
console.log(dataUri);
|
|
364
|
+
// console.log(dataUri);
|
|
345
365
|
handleTakePhoto(dataUri);
|
|
346
366
|
},
|
|
347
367
|
onCameraError: handleCameraError,
|