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.cjs
CHANGED
@@ -159,11 +159,16 @@ var Icon = function Icon(_ref) {
|
|
159
159
|
size = _ref$size === void 0 ? "normal" : _ref$size,
|
160
160
|
_ref$clickable = _ref.clickable,
|
161
161
|
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
162
|
-
action = _ref.action
|
162
|
+
action = _ref.action,
|
163
|
+
_ref$eventPropagation = _ref.eventPropagation,
|
164
|
+
eventPropagation = _ref$eventPropagation === void 0 ? false : _ref$eventPropagation;
|
163
165
|
|
164
166
|
function click(event) {
|
165
|
-
|
166
|
-
|
167
|
+
if (!eventPropagation) {
|
168
|
+
event.stopPropagation();
|
169
|
+
event.preventDefault();
|
170
|
+
}
|
171
|
+
|
167
172
|
if (action) action(event);
|
168
173
|
}
|
169
174
|
|
@@ -2705,7 +2710,11 @@ var UploadArea = function UploadArea(props) {
|
|
2705
2710
|
|
2706
2711
|
React.useEffect(function () {
|
2707
2712
|
var resumable = props.resumable;
|
2708
|
-
|
2713
|
+
|
2714
|
+
if (resumable && areaElement) {
|
2715
|
+
resumable.assignDrop(areaElement.current);
|
2716
|
+
resumable.assignBrowse(areaElement.current);
|
2717
|
+
}
|
2709
2718
|
}, []);
|
2710
2719
|
|
2711
2720
|
var onDragOver = function onDragOver() {
|
@@ -2722,9 +2731,10 @@ var UploadArea = function UploadArea(props) {
|
|
2722
2731
|
onDragOver: onDragOver,
|
2723
2732
|
onDragLeave: onDragLeave,
|
2724
2733
|
ref: areaElement
|
2725
|
-
}, /*#__PURE__*/React__default["default"].createElement(
|
2734
|
+
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
2726
2735
|
icon: icon,
|
2727
|
-
|
2736
|
+
clickable: true,
|
2737
|
+
eventPropagation: false
|
2728
2738
|
}), /*#__PURE__*/React__default["default"].createElement("label", null, label));
|
2729
2739
|
};
|
2730
2740
|
/**
|
@@ -2738,8 +2748,8 @@ var UploadIcon = function UploadIcon(_ref) {
|
|
2738
2748
|
var iconElement = React.useRef();
|
2739
2749
|
React.useEffect(function () {
|
2740
2750
|
if (resumable && iconElement.current) {
|
2741
|
-
console.log('UploadIcon.effect', resumable, iconElement.current);
|
2742
2751
|
resumable.assignBrowse(iconElement.current);
|
2752
|
+
console.log('uploadicon');
|
2743
2753
|
}
|
2744
2754
|
}, [iconElement]);
|
2745
2755
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -2811,7 +2821,8 @@ var UploadProgress = function UploadProgress(_ref) {
|
|
2811
2821
|
*/
|
2812
2822
|
|
2813
2823
|
var Uploader = function Uploader(_ref) {
|
2814
|
-
var
|
2824
|
+
var icon = _ref.icon,
|
2825
|
+
label = _ref.label,
|
2815
2826
|
target = _ref.target,
|
2816
2827
|
accept = _ref.accept,
|
2817
2828
|
_ref$simultaneousUplo = _ref.simultaneousUploads,
|
@@ -2884,6 +2895,7 @@ var Uploader = function Uploader(_ref) {
|
|
2884
2895
|
className: "uploader " + className
|
2885
2896
|
}, state === UPLOAD_STATES.IDLE ? /*#__PURE__*/React__default["default"].createElement(UploadArea, {
|
2886
2897
|
resumable: resumable,
|
2898
|
+
icon: icon,
|
2887
2899
|
label: label
|
2888
2900
|
}) : /*#__PURE__*/React__default["default"].createElement(UploadProgress, {
|
2889
2901
|
files: files
|
@@ -3277,15 +3289,19 @@ var Dialog = function Dialog(props) {
|
|
3277
3289
|
title = _props$title === void 0 ? "Dialog" : _props$title,
|
3278
3290
|
children = props.children,
|
3279
3291
|
actions = props.actions,
|
3280
|
-
className = props.className
|
3292
|
+
className = props.className,
|
3293
|
+
_props$eventPropagati = props.eventPropagation,
|
3294
|
+
eventPropagation = _props$eventPropagati === void 0 ? false : _props$eventPropagati;
|
3281
3295
|
|
3282
3296
|
function close() {
|
3283
3297
|
site.closeDialog();
|
3284
3298
|
}
|
3285
3299
|
|
3286
3300
|
function prevent(e) {
|
3287
|
-
|
3288
|
-
|
3301
|
+
if (!eventPropagation) {
|
3302
|
+
e.preventDefault();
|
3303
|
+
e.stopPropagation();
|
3304
|
+
}
|
3289
3305
|
}
|
3290
3306
|
|
3291
3307
|
return /*#__PURE__*/React__default["default"].createElement(React.Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
@@ -3387,7 +3403,8 @@ var UploadDialog = function UploadDialog(_ref) {
|
|
3387
3403
|
title: title,
|
3388
3404
|
open: true,
|
3389
3405
|
onAction: onAction,
|
3390
|
-
actions: actions
|
3406
|
+
actions: actions,
|
3407
|
+
eventPropagation: true
|
3391
3408
|
}, /*#__PURE__*/React__default["default"].createElement(Uploader, {
|
3392
3409
|
label: label,
|
3393
3410
|
accept: accept,
|
@@ -6069,6 +6086,7 @@ exports.TreededContentEditor = TreededContentEditor;
|
|
6069
6086
|
exports.UploadArea = UploadArea;
|
6070
6087
|
exports.UploadDialog = UploadDialog;
|
6071
6088
|
exports.UploadFile = UploadFile;
|
6089
|
+
exports.UploadIcon = UploadIcon;
|
6072
6090
|
exports.Uploader = Uploader;
|
6073
6091
|
exports.View = View;
|
6074
6092
|
exports.Viewer = Viewer;
|