@sendoutcards/quantum-design-ui 1.8.25 → 1.8.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.
- package/dist/index.es.js +19 -19
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -22593,6 +22593,21 @@ var ImageUploadWidget = function (_a) {
|
|
|
22593
22593
|
shouldShowImageGrid = _e[0],
|
|
22594
22594
|
setShouldShowImageGrid = _e[1];
|
|
22595
22595
|
var inputRef = useRef(null);
|
|
22596
|
+
var handleUploadClick = function () {
|
|
22597
|
+
var _a;
|
|
22598
|
+
setShouldShowImageGrid(false);
|
|
22599
|
+
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
22600
|
+
};
|
|
22601
|
+
var handleFileChange = function (e) {
|
|
22602
|
+
var files = e.target.files;
|
|
22603
|
+
if (files) {
|
|
22604
|
+
var acceptedFiles = Array.from(files);
|
|
22605
|
+
onUpload({
|
|
22606
|
+
accepted: acceptedFiles,
|
|
22607
|
+
rejected: []
|
|
22608
|
+
}, files);
|
|
22609
|
+
}
|
|
22610
|
+
};
|
|
22596
22611
|
return jsx(AnimatePresence, null, isOpen && jsx(Div, {
|
|
22597
22612
|
initial: {
|
|
22598
22613
|
opacity: 0
|
|
@@ -22615,7 +22630,7 @@ var ImageUploadWidget = function (_a) {
|
|
|
22615
22630
|
borderRadius: "medium",
|
|
22616
22631
|
inset: "x1"
|
|
22617
22632
|
}, jsx(CloseButton, {
|
|
22618
|
-
fill: "
|
|
22633
|
+
fill: "inverseHeadingText",
|
|
22619
22634
|
top: "-16px",
|
|
22620
22635
|
size: "xSmall",
|
|
22621
22636
|
right: "-16px",
|
|
@@ -22712,13 +22727,7 @@ var ImageUploadWidget = function (_a) {
|
|
|
22712
22727
|
}, jsx(Div, {
|
|
22713
22728
|
width: "120px"
|
|
22714
22729
|
}, jsx(Button, {
|
|
22715
|
-
onClick:
|
|
22716
|
-
var _a;
|
|
22717
|
-
setShouldShowImageGrid(false);
|
|
22718
|
-
if (inputRef.current) {
|
|
22719
|
-
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
|
|
22720
|
-
}
|
|
22721
|
-
},
|
|
22730
|
+
onClick: handleUploadClick,
|
|
22722
22731
|
fullWidth: true,
|
|
22723
22732
|
size: "small",
|
|
22724
22733
|
type: "smoke",
|
|
@@ -22727,17 +22736,8 @@ var ImageUploadWidget = function (_a) {
|
|
|
22727
22736
|
ref: inputRef,
|
|
22728
22737
|
type: "file",
|
|
22729
22738
|
accept: "image/*",
|
|
22730
|
-
|
|
22731
|
-
|
|
22732
|
-
},
|
|
22733
|
-
onChange: function (e) {
|
|
22734
|
-
var _a, _b;
|
|
22735
|
-
var file = (_b = (_a = e.target) === null || _a === void 0 ? void 0 : _a.files) === null || _b === void 0 ? void 0 : _b[0];
|
|
22736
|
-
if (file) onUpload({
|
|
22737
|
-
accepted: [file],
|
|
22738
|
-
rejected: []
|
|
22739
|
-
});
|
|
22740
|
-
}
|
|
22739
|
+
onChange: handleFileChange,
|
|
22740
|
+
hidden: true
|
|
22741
22741
|
})), jsx(Div, {
|
|
22742
22742
|
width: "120px"
|
|
22743
22743
|
}, jsx(Button, {
|