ywana-core8 0.1.44 → 0.1.45
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 +31 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +6 -0
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +31 -13
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +31 -13
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/widgets/upload/Upload.test.js +1 -1
- package/src/widgets/upload/UploadArea.css +6 -0
- package/src/widgets/upload/UploadArea.js +9 -6
- package/src/widgets/upload/UploadDialog.js +2 -2
- package/src/widgets/upload/Uploader.js +4 -4
package/dist/index.cjs
CHANGED
@@ -4160,8 +4160,11 @@ var EventCard = function EventCard(props) {
|
|
4160
4160
|
* Upload Area
|
4161
4161
|
*/
|
4162
4162
|
var UploadArea = function UploadArea(props) {
|
4163
|
-
var
|
4164
|
-
|
4163
|
+
var icon = props.icon,
|
4164
|
+
_props$label = props.label,
|
4165
|
+
label = _props$label === void 0 ? 'Add file or drop file here...' : _props$label,
|
4166
|
+
_props$disabled = props.disabled,
|
4167
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
4165
4168
|
var areaElement = React.useRef();
|
4166
4169
|
var _useState = React.useState(false),
|
4167
4170
|
drag = _useState[0],
|
@@ -4173,19 +4176,24 @@ var UploadArea = function UploadArea(props) {
|
|
4173
4176
|
}
|
4174
4177
|
}, []);
|
4175
4178
|
var onDragOver = function onDragOver() {
|
4179
|
+
if (disabled) return;
|
4176
4180
|
setDrag(true);
|
4177
4181
|
};
|
4178
4182
|
var onDragLeave = function onDragLeave() {
|
4183
|
+
if (disabled) return;
|
4179
4184
|
setDrag(false);
|
4180
4185
|
};
|
4181
4186
|
var dragging = drag === true ? 'drag-over' : '';
|
4187
|
+
var disabledStyle = disabled === true ? 'disabled' : '';
|
4182
4188
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
4183
|
-
className: "upload-area6 " + dragging,
|
4189
|
+
className: "upload-area6 " + dragging + " " + disabledStyle,
|
4184
4190
|
onDragOver: onDragOver,
|
4185
4191
|
onDragLeave: onDragLeave,
|
4186
4192
|
ref: areaElement
|
4187
4193
|
}, /*#__PURE__*/React__default["default"].createElement(UploadIcon, {
|
4188
|
-
|
4194
|
+
icon: icon,
|
4195
|
+
resumable: resumable,
|
4196
|
+
disabled: disabled
|
4189
4197
|
}), /*#__PURE__*/React__default["default"].createElement("label", null, label));
|
4190
4198
|
};
|
4191
4199
|
|
@@ -4195,7 +4203,9 @@ var UploadArea = function UploadArea(props) {
|
|
4195
4203
|
var UploadIcon = function UploadIcon(_ref) {
|
4196
4204
|
var _ref$icon = _ref.icon,
|
4197
4205
|
icon = _ref$icon === void 0 ? "folder_open" : _ref$icon,
|
4198
|
-
resumable = _ref.resumable
|
4206
|
+
resumable = _ref.resumable,
|
4207
|
+
_ref$disabled = _ref.disabled,
|
4208
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
4199
4209
|
var iconElement = React.useRef();
|
4200
4210
|
React.useEffect(function () {
|
4201
4211
|
if (resumable && iconElement.current) {
|
@@ -4207,7 +4217,8 @@ var UploadIcon = function UploadIcon(_ref) {
|
|
4207
4217
|
ref: iconElement
|
4208
4218
|
}, /*#__PURE__*/React__default["default"].createElement(Icon, {
|
4209
4219
|
icon: icon,
|
4210
|
-
clickable: true
|
4220
|
+
clickable: true,
|
4221
|
+
disabled: disabled
|
4211
4222
|
}));
|
4212
4223
|
};
|
4213
4224
|
|
@@ -4281,7 +4292,9 @@ var Uploader = function Uploader(_ref) {
|
|
4281
4292
|
onProgress = _ref.onProgress,
|
4282
4293
|
onSuccess = _ref.onSuccess,
|
4283
4294
|
onError = _ref.onError,
|
4284
|
-
onComplete = _ref.onComplete
|
4295
|
+
onComplete = _ref.onComplete,
|
4296
|
+
_ref$disabled = _ref.disabled,
|
4297
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled;
|
4285
4298
|
var resumable = React.useMemo(function () {
|
4286
4299
|
var config = {
|
4287
4300
|
target: target,
|
@@ -4338,18 +4351,21 @@ var Uploader = function Uploader(_ref) {
|
|
4338
4351
|
return /*#__PURE__*/React__default["default"].createElement(UploadArea, {
|
4339
4352
|
resumable: resumable,
|
4340
4353
|
icon: icon,
|
4341
|
-
label: label
|
4354
|
+
label: label,
|
4355
|
+
disabled: disabled
|
4342
4356
|
});
|
4343
4357
|
case "icon":
|
4344
4358
|
return /*#__PURE__*/React__default["default"].createElement(UploadIcon, {
|
4345
4359
|
resumable: resumable,
|
4346
|
-
icon: icon
|
4360
|
+
icon: icon,
|
4361
|
+
disabled: disabled
|
4347
4362
|
});
|
4348
4363
|
default:
|
4349
4364
|
return /*#__PURE__*/React__default["default"].createElement(UploadArea, {
|
4350
4365
|
resumable: resumable,
|
4351
4366
|
icon: icon,
|
4352
|
-
label: label
|
4367
|
+
label: label,
|
4368
|
+
disabled: disabled
|
4353
4369
|
});
|
4354
4370
|
}
|
4355
4371
|
}
|
@@ -4372,7 +4388,8 @@ var UploadDialog = function UploadDialog(_ref) {
|
|
4372
4388
|
onClose = _ref.onClose,
|
4373
4389
|
children = _ref.children,
|
4374
4390
|
className = _ref.className,
|
4375
|
-
disabled = _ref.disabled,
|
4391
|
+
_ref$disabled = _ref.disabled,
|
4392
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
4376
4393
|
onCanClose = _ref.onCanClose,
|
4377
4394
|
_ref$overlayCanClose = _ref.overlayCanClose,
|
4378
4395
|
overlayCanClose = _ref$overlayCanClose === void 0 ? true : _ref$overlayCanClose;
|
@@ -4409,12 +4426,13 @@ var UploadDialog = function UploadDialog(_ref) {
|
|
4409
4426
|
actions: actions,
|
4410
4427
|
className: className,
|
4411
4428
|
overlayCanClose: overlayCanClose
|
4412
|
-
},
|
4429
|
+
}, /*#__PURE__*/React__default["default"].createElement(Uploader, {
|
4413
4430
|
label: label,
|
4414
4431
|
accept: accept,
|
4415
4432
|
target: target,
|
4416
4433
|
onSuccess: success,
|
4417
|
-
onComplete: complete
|
4434
|
+
onComplete: complete,
|
4435
|
+
disabled: disabled
|
4418
4436
|
}), children);
|
4419
4437
|
};
|
4420
4438
|
|