ywana-core8 0.0.326 → 0.0.329
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.cjs +30 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +30 -13
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +30 -12
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/icon.js +5 -3
- package/src/site/dialog.js +5 -3
- package/src/widgets/upload/Upload.test.js +1 -1
- package/src/widgets/upload/UploadArea.js +7 -4
- package/src/widgets/upload/UploadDialog.js +1 -1
- package/src/widgets/upload/Uploader.js +2 -2
package/dist/index.umd.js
CHANGED
@@ -153,11 +153,16 @@
|
|
153
153
|
size = _ref$size === void 0 ? "normal" : _ref$size,
|
154
154
|
_ref$clickable = _ref.clickable,
|
155
155
|
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
156
|
-
action = _ref.action
|
156
|
+
action = _ref.action,
|
157
|
+
_ref$eventPropagation = _ref.eventPropagation,
|
158
|
+
eventPropagation = _ref$eventPropagation === void 0 ? false : _ref$eventPropagation;
|
157
159
|
|
158
160
|
function click(event) {
|
159
|
-
|
160
|
-
|
161
|
+
if (!eventPropagation) {
|
162
|
+
event.stopPropagation();
|
163
|
+
event.preventDefault();
|
164
|
+
}
|
165
|
+
|
161
166
|
if (action) action(event);
|
162
167
|
}
|
163
168
|
|
@@ -2699,7 +2704,11 @@
|
|
2699
2704
|
|
2700
2705
|
React.useEffect(function () {
|
2701
2706
|
var resumable = props.resumable;
|
2702
|
-
|
2707
|
+
|
2708
|
+
if (resumable && areaElement) {
|
2709
|
+
resumable.assignDrop(areaElement.current);
|
2710
|
+
resumable.assignBrowse(areaElement.current);
|
2711
|
+
}
|
2703
2712
|
}, []);
|
2704
2713
|
|
2705
2714
|
var onDragOver = function onDragOver() {
|
@@ -2716,9 +2725,10 @@
|
|
2716
2725
|
onDragOver: onDragOver,
|
2717
2726
|
onDragLeave: onDragLeave,
|
2718
2727
|
ref: areaElement
|
2719
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
2728
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
2720
2729
|
icon: icon,
|
2721
|
-
|
2730
|
+
clickable: true,
|
2731
|
+
eventPropagation: false
|
2722
2732
|
}), /*#__PURE__*/React__default["default"].createElement("label", null, label));
|
2723
2733
|
};
|
2724
2734
|
/**
|
@@ -2732,8 +2742,8 @@
|
|
2732
2742
|
var iconElement = React.useRef();
|
2733
2743
|
React.useEffect(function () {
|
2734
2744
|
if (resumable && iconElement.current) {
|
2735
|
-
console.log('UploadIcon.effect', resumable, iconElement.current);
|
2736
2745
|
resumable.assignBrowse(iconElement.current);
|
2746
|
+
console.log('uploadicon');
|
2737
2747
|
}
|
2738
2748
|
}, [iconElement]);
|
2739
2749
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -2805,7 +2815,8 @@
|
|
2805
2815
|
*/
|
2806
2816
|
|
2807
2817
|
var Uploader = function Uploader(_ref) {
|
2808
|
-
var
|
2818
|
+
var icon = _ref.icon,
|
2819
|
+
label = _ref.label,
|
2809
2820
|
target = _ref.target,
|
2810
2821
|
accept = _ref.accept,
|
2811
2822
|
_ref$simultaneousUplo = _ref.simultaneousUploads,
|
@@ -2878,6 +2889,7 @@
|
|
2878
2889
|
className: "uploader " + className
|
2879
2890
|
}, state === UPLOAD_STATES.IDLE ? /*#__PURE__*/React__default["default"].createElement(UploadArea, {
|
2880
2891
|
resumable: resumable,
|
2892
|
+
icon: icon,
|
2881
2893
|
label: label
|
2882
2894
|
}) : /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
2883
2895
|
files: files
|
@@ -3271,15 +3283,19 @@
|
|
3271
3283
|
title = _props$title === void 0 ? "Dialog" : _props$title,
|
3272
3284
|
children = props.children,
|
3273
3285
|
actions = props.actions,
|
3274
|
-
className = props.className
|
3286
|
+
className = props.className,
|
3287
|
+
_props$eventPropagati = props.eventPropagation,
|
3288
|
+
eventPropagation = _props$eventPropagati === void 0 ? false : _props$eventPropagati;
|
3275
3289
|
|
3276
3290
|
function close() {
|
3277
3291
|
site.closeDialog();
|
3278
3292
|
}
|
3279
3293
|
|
3280
3294
|
function prevent(e) {
|
3281
|
-
|
3282
|
-
|
3295
|
+
if (!eventPropagation) {
|
3296
|
+
e.preventDefault();
|
3297
|
+
e.stopPropagation();
|
3298
|
+
}
|
3283
3299
|
}
|
3284
3300
|
|
3285
3301
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -3381,7 +3397,8 @@
|
|
3381
3397
|
title: title,
|
3382
3398
|
open: true,
|
3383
3399
|
onAction: onAction,
|
3384
|
-
actions: actions
|
3400
|
+
actions: actions,
|
3401
|
+
eventPropagation: true
|
3385
3402
|
}, /*#__PURE__*/React__default["default"].createElement(Uploader, {
|
3386
3403
|
label: label,
|
3387
3404
|
accept: accept,
|
@@ -6063,6 +6080,7 @@
|
|
6063
6080
|
exports.UploadArea = UploadArea;
|
6064
6081
|
exports.UploadDialog = UploadDialog;
|
6065
6082
|
exports.UploadFile = UploadFile;
|
6083
|
+
exports.UploadIcon = UploadIcon;
|
6066
6084
|
exports.Uploader = Uploader;
|
6067
6085
|
exports.View = View;
|
6068
6086
|
exports.Viewer = Viewer;
|