@kdcloudjs/kdesign 1.6.8 → 1.6.10

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.
@@ -107,6 +107,11 @@
107
107
  background: #fafafa;
108
108
  }
109
109
 
110
+ .@{submenu-prefix-cls}:not(.@{submenu-prefix-cls}-disabled):not(.@{submenu-prefix-cls}-active):hover,
111
+ .@{submenu-prefix-cls}-hover {
112
+ .menu-light-hover();
113
+ }
114
+
110
115
  .@{menuitem-prefix-cls}:not(.@{menuitem-prefix-cls}-disabled):not(.@{menuitem-prefix-cls}-active):hover {
111
116
  .menu-light-hover();
112
117
  }
@@ -141,4 +141,11 @@ export interface UploadRequestOption<T = any> {
141
141
  headers?: HttpRequestHeader;
142
142
  method: UploadRequestMethod;
143
143
  }
144
+ export interface IFileItem {
145
+ file: UploadFile;
146
+ prefixCls: string;
147
+ listType: string;
148
+ handleReUpload: (file: UploadFile, e: React.MouseEvent) => void;
149
+ handleRemove: (file: UploadFile, e: React.MouseEvent) => void;
150
+ }
144
151
  export {};
@@ -147,6 +147,7 @@ var InternalUpload = function InternalUpload(props, ref) {
147
147
  onRemove = allProps.onRemove,
148
148
  directory = allProps.directory,
149
149
  className = allProps.className,
150
+ itemRender = allProps.itemRender,
150
151
  showUploadList = allProps.showUploadList,
151
152
  customPrefixcls = allProps.prefixCls;
152
153
 
@@ -391,13 +392,6 @@ var InternalUpload = function InternalUpload(props, ref) {
391
392
  directory: directory ? 'directory' : undefined,
392
393
  webkitdirectory: directory ? 'webkitdirectory' : undefined
393
394
  };
394
- var mapStatus = {
395
- uploading: 'loadding',
396
- error: 'warning-solid',
397
- done: 'attachment',
398
- success: 'attachment',
399
- notStart: 'attachment'
400
- };
401
395
  var dragEvents = {};
402
396
 
403
397
  var _React$useState3 = React.useState(false),
@@ -493,76 +487,105 @@ var InternalUpload = function InternalUpload(props, ref) {
493
487
  }, inputFileProps, {
494
488
  ref: mergedRef
495
489
  }))))), showUploadList && (0, _map.default)(fileList).call(fileList, function (file) {
496
- var _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20;
497
-
498
- return /*#__PURE__*/React.createElement("li", {
499
- key: file.uid,
500
- className: (0, _classnames.default)((0, _concat.default)(_context8 = "".concat(prefixCls, "-")).call(_context8, listType, "-list-item"), {
501
- error: file.status === 'error'
502
- })
503
- }, listType === 'text' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
504
- className: (0, _concat.default)(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon")
505
- }, /*#__PURE__*/React.createElement(_icon.default, {
506
- spin: file.status === 'uploading',
507
- type: mapStatus[file.status]
508
- })), /*#__PURE__*/React.createElement("span", {
509
- className: (0, _concat.default)(_context10 = "".concat(prefixCls, "-")).call(_context10, listType, "-list-item-name"),
510
- title: file.name
511
- }, file.name), /*#__PURE__*/React.createElement("span", {
512
- className: (0, _concat.default)(_context11 = "".concat(prefixCls, "-")).call(_context11, listType, "-list-item-size")
513
- }, "(", (0, _utils2.getFileSize)(file.size), ")"), /*#__PURE__*/React.createElement("div", {
514
- className: (0, _concat.default)(_context12 = "".concat(prefixCls, "-")).call(_context12, listType, "-list-item-action")
515
- }, file.status === 'error' && /*#__PURE__*/React.createElement("a", {
516
- href: "true",
517
- className: (0, _concat.default)(_context13 = "".concat(prefixCls, "-")).call(_context13, listType, "-list-item-reupload"),
518
- onClick: handleReUpload.bind(_this, file)
519
- }, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/React.createElement("a", {
520
- href: "true",
521
- className: (0, _concat.default)(_context14 = "".concat(prefixCls, "-")).call(_context14, listType, "-list-item-delete"),
522
- onClick: handleRemove.bind(_this, file)
523
- }, "\u5220\u9664"))) : file.status === 'uploading' ? /*#__PURE__*/React.createElement("div", {
524
- className: (0, _concat.default)(_context15 = "".concat(prefixCls, "-")).call(_context15, listType, "-list-item-loading")
525
- }, /*#__PURE__*/React.createElement(_progress.default, {
526
- percent: file.percent,
527
- textMap: ['文件上传中'],
528
- showInfo: false
529
- })) : file.status === 'error' ? /*#__PURE__*/React.createElement("div", {
530
- className: (0, _concat.default)(_context16 = "".concat(prefixCls, "-")).call(_context16, listType, "-list-item-error")
531
- }, /*#__PURE__*/React.createElement("div", {
532
- className: (0, _concat.default)(_context17 = "".concat(prefixCls, "-")).call(_context17, listType, "-list-item-error-text")
533
- }, /*#__PURE__*/React.createElement(_icon.default, {
534
- type: mapStatus[file.status],
535
- style: {
536
- verticalAlign: 'top'
537
- }
538
- }), "\u4E0A\u4F20\u5931\u8D25"), /*#__PURE__*/React.createElement("div", {
539
- className: (0, _concat.default)(_context18 = "".concat(prefixCls, "-")).call(_context18, listType, "-list-item-action")
540
- }, /*#__PURE__*/React.createElement("a", {
541
- href: "true",
542
- className: (0, _concat.default)(_context19 = "".concat(prefixCls, "-")).call(_context19, listType, "-list-item-reupload"),
543
- onClick: handleReUpload.bind(_this, file)
544
- }, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/React.createElement("a", {
545
- href: "true",
546
- className: (0, _concat.default)(_context20 = "".concat(prefixCls, "-")).call(_context20, listType, "-list-item-delete"),
547
- onClick: handleRemove.bind(_this, file)
548
- }, "\u5220\u9664"))) : /*#__PURE__*/React.createElement(_image.default, {
549
- previewType: "upload",
550
- name: file.name,
551
- size: (0, _utils2.getFileSize)(file.size),
552
- src: file.thumbUrl || file.url,
553
- style: {
554
- width: '100%',
555
- height: '100%'
556
- },
557
- operations: [/*#__PURE__*/React.createElement(_icon.default, {
558
- key: "1",
559
- type: "delete",
560
- onClick: handleRemove.bind(_this, file)
561
- })]
490
+ return itemRender ? itemRender( /*#__PURE__*/React.createElement(Item, (0, _extends2.default)({}, {
491
+ file: file,
492
+ prefixCls: prefixCls,
493
+ listType: listType,
494
+ handleReUpload: handleReUpload,
495
+ handleRemove: handleRemove
496
+ })), file, setFileList) : /*#__PURE__*/React.createElement(Item, (0, _extends2.default)({
497
+ key: file.uid
498
+ }, {
499
+ file: file,
500
+ prefixCls: prefixCls,
501
+ listType: listType,
502
+ handleReUpload: handleReUpload,
503
+ handleRemove: handleRemove
562
504
  }));
563
505
  })));
564
506
  };
565
507
 
508
+ var Item = function Item(_ref3) {
509
+ var _context8, _context9, _context10, _context11, _context12, _context13, _context14, _context15, _context16, _context17, _context18, _context19, _context20;
510
+
511
+ var file = _ref3.file,
512
+ prefixCls = _ref3.prefixCls,
513
+ listType = _ref3.listType,
514
+ handleReUpload = _ref3.handleReUpload,
515
+ handleRemove = _ref3.handleRemove;
516
+ var mapStatus = {
517
+ uploading: 'loadding',
518
+ error: 'warning-solid',
519
+ done: 'attachment',
520
+ success: 'attachment',
521
+ notStart: 'attachment'
522
+ };
523
+ return /*#__PURE__*/React.createElement("li", {
524
+ className: (0, _classnames.default)((0, _concat.default)(_context8 = "".concat(prefixCls, "-")).call(_context8, listType, "-list-item"), {
525
+ error: file.status === 'error'
526
+ })
527
+ }, listType === 'text' ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
528
+ className: (0, _concat.default)(_context9 = "".concat(prefixCls, "-")).call(_context9, listType, "-list-item-icon")
529
+ }, /*#__PURE__*/React.createElement(_icon.default, {
530
+ spin: file.status === 'uploading',
531
+ type: mapStatus[file.status]
532
+ })), /*#__PURE__*/React.createElement("span", {
533
+ className: (0, _concat.default)(_context10 = "".concat(prefixCls, "-")).call(_context10, listType, "-list-item-name"),
534
+ title: file.name
535
+ }, file.name), /*#__PURE__*/React.createElement("span", {
536
+ className: (0, _concat.default)(_context11 = "".concat(prefixCls, "-")).call(_context11, listType, "-list-item-size")
537
+ }, "(", (0, _utils2.getFileSize)(file.size), ")"), /*#__PURE__*/React.createElement("div", {
538
+ className: (0, _concat.default)(_context12 = "".concat(prefixCls, "-")).call(_context12, listType, "-list-item-action")
539
+ }, file.status === 'error' && /*#__PURE__*/React.createElement("a", {
540
+ href: "true",
541
+ className: (0, _concat.default)(_context13 = "".concat(prefixCls, "-")).call(_context13, listType, "-list-item-reupload"),
542
+ onClick: handleReUpload.bind(_this, file)
543
+ }, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/React.createElement("a", {
544
+ href: "true",
545
+ className: (0, _concat.default)(_context14 = "".concat(prefixCls, "-")).call(_context14, listType, "-list-item-delete"),
546
+ onClick: handleRemove.bind(_this, file)
547
+ }, "\u5220\u9664"))) : file.status === 'uploading' ? /*#__PURE__*/React.createElement("div", {
548
+ className: (0, _concat.default)(_context15 = "".concat(prefixCls, "-")).call(_context15, listType, "-list-item-loading")
549
+ }, /*#__PURE__*/React.createElement(_progress.default, {
550
+ percent: file.percent,
551
+ textMap: ['文件上传中'],
552
+ showInfo: false
553
+ })) : file.status === 'error' ? /*#__PURE__*/React.createElement("div", {
554
+ className: (0, _concat.default)(_context16 = "".concat(prefixCls, "-")).call(_context16, listType, "-list-item-error")
555
+ }, /*#__PURE__*/React.createElement("div", {
556
+ className: (0, _concat.default)(_context17 = "".concat(prefixCls, "-")).call(_context17, listType, "-list-item-error-text")
557
+ }, /*#__PURE__*/React.createElement(_icon.default, {
558
+ type: mapStatus[file.status],
559
+ style: {
560
+ verticalAlign: 'top'
561
+ }
562
+ }), "\u4E0A\u4F20\u5931\u8D25"), /*#__PURE__*/React.createElement("div", {
563
+ className: (0, _concat.default)(_context18 = "".concat(prefixCls, "-")).call(_context18, listType, "-list-item-action")
564
+ }, /*#__PURE__*/React.createElement("a", {
565
+ href: "true",
566
+ className: (0, _concat.default)(_context19 = "".concat(prefixCls, "-")).call(_context19, listType, "-list-item-reupload"),
567
+ onClick: handleReUpload.bind(_this, file)
568
+ }, "\u91CD\u65B0\u4E0A\u4F20"), /*#__PURE__*/React.createElement("a", {
569
+ href: "true",
570
+ className: (0, _concat.default)(_context20 = "".concat(prefixCls, "-")).call(_context20, listType, "-list-item-delete"),
571
+ onClick: handleRemove.bind(_this, file)
572
+ }, "\u5220\u9664"))) : /*#__PURE__*/React.createElement(_image.default, {
573
+ previewType: "upload",
574
+ name: file.name,
575
+ size: (0, _utils2.getFileSize)(file.size),
576
+ src: file.thumbUrl || file.url,
577
+ style: {
578
+ width: '100%',
579
+ height: '100%'
580
+ },
581
+ operations: [/*#__PURE__*/React.createElement(_icon.default, {
582
+ key: "1",
583
+ type: "delete",
584
+ onClick: handleRemove.bind(_this, file)
585
+ })]
586
+ }));
587
+ };
588
+
566
589
  var Upload = /*#__PURE__*/React.forwardRef(InternalUpload);
567
590
  Upload.displayName = 'Upload';
568
591
  var _default = Upload;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kdcloudjs/kdesign",
3
- "version": "1.6.8",
3
+ "version": "1.6.10",
4
4
  "description": "KDesign 金蝶前端react 组件库",
5
5
  "title": "kdesign",
6
6
  "keywords": [