@sunggang/ui-lib 0.0.2 → 0.0.3
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/index.esm.js +14 -8
- package/package.json +1 -1
- package/src/lib/DropImage/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -3389,7 +3389,7 @@ function _unsupported_iterable_to_array$2(o, minLen) {
|
|
|
3389
3389
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$2(o, minLen);
|
|
3390
3390
|
}
|
|
3391
3391
|
var DropImage = function(param) {
|
|
3392
|
-
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles;
|
|
3392
|
+
var _param_preview = param.preview, preview = _param_preview === void 0 ? true : _param_preview, setFiles = param.setFiles, imageUrls = param.imageUrls;
|
|
3393
3393
|
var _useState = _sliced_to_array$2(useState([]), 2), previewFiles = _useState[0], setPreviewFiles = _useState[1];
|
|
3394
3394
|
var _useDropzone = useDropzone({
|
|
3395
3395
|
accept: {
|
|
@@ -3429,9 +3429,9 @@ var DropImage = function(param) {
|
|
|
3429
3429
|
children: /*#__PURE__*/ jsx("div", {
|
|
3430
3430
|
className: "w-full bg-gray-light rounded-lg",
|
|
3431
3431
|
children: /*#__PURE__*/ jsx("div", {
|
|
3432
|
-
className: "border-2 border-dashed border-
|
|
3432
|
+
className: "border-2 border-dashed border-gray-400 rounded-lg bg-gray-100",
|
|
3433
3433
|
children: /*#__PURE__*/ jsxs("div", {
|
|
3434
|
-
className: "flex items-center flex-col p-
|
|
3434
|
+
className: "flex items-center flex-col p-16",
|
|
3435
3435
|
children: [
|
|
3436
3436
|
/*#__PURE__*/ jsx("p", {
|
|
3437
3437
|
className: "font-normal text-sm text-gray-400 py-4",
|
|
@@ -3439,7 +3439,7 @@ var DropImage = function(param) {
|
|
|
3439
3439
|
}),
|
|
3440
3440
|
/*#__PURE__*/ jsx("h5", {
|
|
3441
3441
|
className: "mb-2 text-xl font-bold tracking-tight text-gray-700",
|
|
3442
|
-
children: "
|
|
3442
|
+
children: "拖曳圖片至此"
|
|
3443
3443
|
})
|
|
3444
3444
|
]
|
|
3445
3445
|
})
|
|
@@ -3450,15 +3450,22 @@ var DropImage = function(param) {
|
|
|
3450
3450
|
})),
|
|
3451
3451
|
preview && /*#__PURE__*/ jsx("div", {
|
|
3452
3452
|
className: "flex pt-2 gap-2",
|
|
3453
|
-
children: previewFiles
|
|
3453
|
+
children: (previewFiles === null || previewFiles === void 0 ? void 0 : previewFiles.length) ? previewFiles.length > 0 && previewFiles.map(function(item) {
|
|
3454
3454
|
return /*#__PURE__*/ jsx("div", {
|
|
3455
|
-
className: "",
|
|
3456
3455
|
children: /*#__PURE__*/ jsx("img", {
|
|
3457
3456
|
className: "w-24 h-24 object-cover",
|
|
3458
3457
|
src: item === null || item === void 0 ? void 0 : item.preview,
|
|
3459
3458
|
alt: ""
|
|
3460
3459
|
})
|
|
3461
3460
|
}, item === null || item === void 0 ? void 0 : item.uuid);
|
|
3461
|
+
}) : imageUrls && imageUrls.length && imageUrls.map(function(item) {
|
|
3462
|
+
return /*#__PURE__*/ jsx("div", {
|
|
3463
|
+
children: /*#__PURE__*/ jsx("img", {
|
|
3464
|
+
className: "w-24 h-24 object-cover",
|
|
3465
|
+
src: item,
|
|
3466
|
+
alt: ""
|
|
3467
|
+
})
|
|
3468
|
+
}, item);
|
|
3462
3469
|
})
|
|
3463
3470
|
})
|
|
3464
3471
|
]
|
|
@@ -5593,7 +5600,7 @@ var BaseTemplate = function(param) {
|
|
|
5593
5600
|
children: /*#__PURE__*/ jsx("div", {
|
|
5594
5601
|
className: "px-4 py-6 w-72 h-56",
|
|
5595
5602
|
children: tempImage || imageUrl ? /*#__PURE__*/ jsx("img", {
|
|
5596
|
-
className: "w-full h-full object-
|
|
5603
|
+
className: "w-full h-full object-contain border-dashed border-2 border-gray-400 p-6 rounded-lg",
|
|
5597
5604
|
src: tempImage || imageUrl,
|
|
5598
5605
|
alt: ""
|
|
5599
5606
|
}) : /*#__PURE__*/ jsx("div", {
|
|
@@ -5684,7 +5691,6 @@ var CustomUpload = function(param) {
|
|
|
5684
5691
|
var handleImageChange = function(event) {
|
|
5685
5692
|
var _event_target_files, _currentFile_type;
|
|
5686
5693
|
var currentFile = (_event_target_files = event.target.files) === null || _event_target_files === void 0 ? void 0 : _event_target_files[0];
|
|
5687
|
-
console.log(currentFile);
|
|
5688
5694
|
if (!currentFile) {
|
|
5689
5695
|
setFile(null);
|
|
5690
5696
|
return;
|
package/package.json
CHANGED