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.modern.js
CHANGED
@@ -151,11 +151,16 @@ var Icon = function Icon(_ref) {
|
|
151
151
|
size = _ref$size === void 0 ? "normal" : _ref$size,
|
152
152
|
_ref$clickable = _ref.clickable,
|
153
153
|
clickable = _ref$clickable === void 0 ? false : _ref$clickable,
|
154
|
-
action = _ref.action
|
154
|
+
action = _ref.action,
|
155
|
+
_ref$eventPropagation = _ref.eventPropagation,
|
156
|
+
eventPropagation = _ref$eventPropagation === void 0 ? false : _ref$eventPropagation;
|
155
157
|
|
156
158
|
function click(event) {
|
157
|
-
|
158
|
-
|
159
|
+
if (!eventPropagation) {
|
160
|
+
event.stopPropagation();
|
161
|
+
event.preventDefault();
|
162
|
+
}
|
163
|
+
|
159
164
|
if (action) action(event);
|
160
165
|
}
|
161
166
|
|
@@ -2697,7 +2702,11 @@ var UploadArea = function UploadArea(props) {
|
|
2697
2702
|
|
2698
2703
|
useEffect(function () {
|
2699
2704
|
var resumable = props.resumable;
|
2700
|
-
|
2705
|
+
|
2706
|
+
if (resumable && areaElement) {
|
2707
|
+
resumable.assignDrop(areaElement.current);
|
2708
|
+
resumable.assignBrowse(areaElement.current);
|
2709
|
+
}
|
2701
2710
|
}, []);
|
2702
2711
|
|
2703
2712
|
var onDragOver = function onDragOver() {
|
@@ -2714,9 +2723,10 @@ var UploadArea = function UploadArea(props) {
|
|
2714
2723
|
onDragOver: onDragOver,
|
2715
2724
|
onDragLeave: onDragLeave,
|
2716
2725
|
ref: areaElement
|
2717
|
-
}, /*#__PURE__*/React.createElement(
|
2726
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
2718
2727
|
icon: icon,
|
2719
|
-
|
2728
|
+
clickable: true,
|
2729
|
+
eventPropagation: false
|
2720
2730
|
}), /*#__PURE__*/React.createElement("label", null, label));
|
2721
2731
|
};
|
2722
2732
|
/**
|
@@ -2730,8 +2740,8 @@ var UploadIcon = function UploadIcon(_ref) {
|
|
2730
2740
|
var iconElement = useRef();
|
2731
2741
|
useEffect(function () {
|
2732
2742
|
if (resumable && iconElement.current) {
|
2733
|
-
console.log('UploadIcon.effect', resumable, iconElement.current);
|
2734
2743
|
resumable.assignBrowse(iconElement.current);
|
2744
|
+
console.log('uploadicon');
|
2735
2745
|
}
|
2736
2746
|
}, [iconElement]);
|
2737
2747
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -2803,7 +2813,8 @@ var UploadProgress = function UploadProgress(_ref) {
|
|
2803
2813
|
*/
|
2804
2814
|
|
2805
2815
|
var Uploader = function Uploader(_ref) {
|
2806
|
-
var
|
2816
|
+
var icon = _ref.icon,
|
2817
|
+
label = _ref.label,
|
2807
2818
|
target = _ref.target,
|
2808
2819
|
accept = _ref.accept,
|
2809
2820
|
_ref$simultaneousUplo = _ref.simultaneousUploads,
|
@@ -2876,6 +2887,7 @@ var Uploader = function Uploader(_ref) {
|
|
2876
2887
|
className: "uploader " + className
|
2877
2888
|
}, state === UPLOAD_STATES.IDLE ? /*#__PURE__*/React.createElement(UploadArea, {
|
2878
2889
|
resumable: resumable,
|
2890
|
+
icon: icon,
|
2879
2891
|
label: label
|
2880
2892
|
}) : /*#__PURE__*/React.createElement(UploadProgress, {
|
2881
2893
|
files: files
|
@@ -3269,15 +3281,19 @@ var Dialog = function Dialog(props) {
|
|
3269
3281
|
title = _props$title === void 0 ? "Dialog" : _props$title,
|
3270
3282
|
children = props.children,
|
3271
3283
|
actions = props.actions,
|
3272
|
-
className = props.className
|
3284
|
+
className = props.className,
|
3285
|
+
_props$eventPropagati = props.eventPropagation,
|
3286
|
+
eventPropagation = _props$eventPropagati === void 0 ? false : _props$eventPropagati;
|
3273
3287
|
|
3274
3288
|
function close() {
|
3275
3289
|
site.closeDialog();
|
3276
3290
|
}
|
3277
3291
|
|
3278
3292
|
function prevent(e) {
|
3279
|
-
|
3280
|
-
|
3293
|
+
if (!eventPropagation) {
|
3294
|
+
e.preventDefault();
|
3295
|
+
e.stopPropagation();
|
3296
|
+
}
|
3281
3297
|
}
|
3282
3298
|
|
3283
3299
|
return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement("div", {
|
@@ -3379,7 +3395,8 @@ var UploadDialog = function UploadDialog(_ref) {
|
|
3379
3395
|
title: title,
|
3380
3396
|
open: true,
|
3381
3397
|
onAction: onAction,
|
3382
|
-
actions: actions
|
3398
|
+
actions: actions,
|
3399
|
+
eventPropagation: true
|
3383
3400
|
}, /*#__PURE__*/React.createElement(Uploader, {
|
3384
3401
|
label: label,
|
3385
3402
|
accept: accept,
|
@@ -5992,5 +6009,5 @@ var isFunction = function isFunction(value) {
|
|
5992
6009
|
return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
|
5993
6010
|
};
|
5994
6011
|
|
5995
|
-
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, CollectionTree, Content, ContentEditor, ContentForm, CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, Form, HTTPClient, Header, Icon, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, Page, PageContext, PageProvider, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, TEXTFORMATS, TYPES, Tab, TabbedContentEditor, TableEditor, TablePage, Tabs, Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile, Uploader, View, Viewer, WaitScreen, isFunction };
|
6012
|
+
export { Avatar, Button, CheckBox, Chip, Chips, CircularProgress, CollectionContext, CollectionEditor$1 as CollectionEditor, CollectionPage, CollectionTree, Content, ContentEditor, ContentForm, CreateContentDialog, DataTable, Dialog, DropDown, EditContentDialog, FORMATS, FieldEditor, Form, HTTPClient, Header, Icon, Kanban, KanbanCard, KanbanColumn, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, Page, PageContext, PageProvider, Planner, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, TEXTFORMATS, TYPES, Tab, TabbedContentEditor, TableEditor, TablePage, Tabs, Text, TextArea, TextField, Thumbnail, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UploadArea, UploadDialog, UploadFile, UploadIcon, Uploader, View, Viewer, WaitScreen, isFunction };
|
5996
6013
|
//# sourceMappingURL=index.modern.js.map
|