fan-standard-comp 3.1.9 → 3.2.0

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.
Files changed (176) hide show
  1. package/Readme.md +35 -0
  2. package/dist/fan-standard-comp.umd.js +15 -10
  3. package/es/ButtonGroup/ButtonList.js +0 -3
  4. package/es/ButtonGroup/ButtonMenu.js +0 -3
  5. package/es/ButtonGroup/PopConfirmTitle.js +5 -15
  6. package/es/ButtonGroup/index.d.ts +2 -0
  7. package/es/ButtonGroup/index.js +223 -193
  8. package/es/ButtonGroup/style/index.less +1 -1
  9. package/es/DragContent/DragBar.js +2 -6
  10. package/es/DragContent/index.js +44 -75
  11. package/es/FormComp/ChunkUploader/api.js +6 -10
  12. package/es/FormComp/ChunkUploader/index.js +105 -171
  13. package/es/FormComp/ChunkUploader/lib.js +4 -17
  14. package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
  15. package/es/FormComp/ChunkUploader/worker.js +0 -3
  16. package/es/FormComp/EditButton/index.js +24 -49
  17. package/es/FormComp/FieldComponent/ReUpload.js +18 -38
  18. package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
  19. package/es/FormComp/FieldComponent/TitleNode.js +1 -3
  20. package/es/FormComp/FieldComponent/index.js +38 -74
  21. package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
  22. package/es/FormComp/FieldComponent/style/index.less +6 -0
  23. package/es/FormComp/RenderItemGroup/index.js +46 -74
  24. package/es/FormComp/Uploader/index.js +36 -77
  25. package/es/FormComp/Uploader/util.js +0 -6
  26. package/es/FormComp/VarTemplate/index.js +58 -96
  27. package/es/NavLeafScroll/index.js +172 -154
  28. package/es/NavLeafScroll/style/index.less +33 -1
  29. package/es/RefactorTree/index.js +36 -53
  30. package/es/RefactorTree/indexTreeNode.js +35 -68
  31. package/es/RefactorTree/util.js +9 -43
  32. package/es/SpecIcon/fonts/iconfont.js +7 -12
  33. package/es/SpecIcon/index.js +16 -25
  34. package/es/SplitterLayout/Pane.js +2 -5
  35. package/es/SplitterLayout/index.js +20 -70
  36. package/es/StandardContent/SplitterLayout/Pane.js +6 -10
  37. package/es/StandardContent/SplitterLayout/index.js +12 -63
  38. package/es/StandardContent/SubfieldContent.js +12 -14
  39. package/es/StandardContent/WrapperContent.js +8 -10
  40. package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  41. package/es/StandardDragModal/ChangeStandardModal.js +493 -0
  42. package/es/StandardDragModal/DraggableModal.d.ts +7 -0
  43. package/es/StandardDragModal/DraggableModal.js +31 -0
  44. package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
  45. package/es/StandardDragModal/DraggableModalContext.js +5 -0
  46. package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
  47. package/es/StandardDragModal/DraggableModalInner.js +114 -0
  48. package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  49. package/es/StandardDragModal/DraggableModalProvider.js +40 -0
  50. package/es/StandardDragModal/Modal.d.ts +11 -0
  51. package/es/StandardDragModal/Modal.js +24 -0
  52. package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
  53. package/es/StandardDragModal/ResizeHandle.js +8 -0
  54. package/es/StandardDragModal/clamp.d.ts +1 -0
  55. package/es/StandardDragModal/clamp.js +3 -0
  56. package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
  57. package/es/StandardDragModal/draggableModalReducer.js +157 -0
  58. package/es/StandardDragModal/getWindowSize.d.ts +4 -0
  59. package/es/StandardDragModal/getWindowSize.js +6 -0
  60. package/es/StandardDragModal/index.d.ts +3 -11
  61. package/es/StandardDragModal/index.js +3 -30
  62. package/es/StandardDragModal/index.less +65 -0
  63. package/es/StandardDragModal/useDrag.d.ts +5 -0
  64. package/es/StandardDragModal/useDrag.js +66 -0
  65. package/es/StandardDragModal/usePrevious.d.ts +1 -0
  66. package/es/StandardDragModal/usePrevious.js +8 -0
  67. package/es/StandardDragModal/useResize.d.ts +7 -0
  68. package/es/StandardDragModal/useResize.js +74 -0
  69. package/es/StandardFilter/index.d.ts +1 -0
  70. package/es/StandardFilter/index.js +32 -70
  71. package/es/StandardForm/ActionList.js +5 -7
  72. package/es/StandardForm/StepForm.js +50 -71
  73. package/es/StandardForm/TabForm.js +58 -70
  74. package/es/StandardForm/index.js +37 -56
  75. package/es/StandardModal/UpdateFormRef.js +1 -4
  76. package/es/StandardModal/index.d.ts +0 -1
  77. package/es/StandardModal/index.js +115 -159
  78. package/es/StandardPanel/index.js +19 -35
  79. package/es/StandardTable/index.js +20 -30
  80. package/es/components/IconNode/index.js +0 -4
  81. package/es/index.d.ts +1 -0
  82. package/es/index.js +15 -14
  83. package/es/utils/ValueFormat.js +0 -9
  84. package/es/utils/dictSelectUtil.js +153 -0
  85. package/es/utils/filterPermission.js +16 -34
  86. package/es/utils/getParentNodes.js +24 -47
  87. package/es/utils/index.js +2 -1
  88. package/lib/ButtonGroup/ButtonList.js +1 -13
  89. package/lib/ButtonGroup/ButtonMenu.js +1 -8
  90. package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
  91. package/lib/ButtonGroup/index.d.ts +2 -0
  92. package/lib/ButtonGroup/index.js +226 -216
  93. package/lib/ButtonGroup/style/index.less +1 -1
  94. package/lib/DragContent/DragBar.js +2 -10
  95. package/lib/DragContent/index.js +47 -85
  96. package/lib/FormComp/ChunkUploader/api.js +6 -15
  97. package/lib/FormComp/ChunkUploader/index.js +107 -185
  98. package/lib/FormComp/ChunkUploader/lib.js +8 -27
  99. package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
  100. package/lib/FormComp/ChunkUploader/worker.js +1 -5
  101. package/lib/FormComp/EditButton/index.js +26 -60
  102. package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
  103. package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
  104. package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
  105. package/lib/FormComp/FieldComponent/index.js +38 -110
  106. package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
  107. package/lib/FormComp/FieldComponent/style/index.less +6 -0
  108. package/lib/FormComp/RenderItemGroup/index.js +46 -87
  109. package/lib/FormComp/Uploader/index.js +38 -95
  110. package/lib/FormComp/Uploader/util.js +1 -9
  111. package/lib/FormComp/VarTemplate/index.js +62 -106
  112. package/lib/FormComp/index.js +0 -2
  113. package/lib/NavLeafScroll/index.js +174 -165
  114. package/lib/NavLeafScroll/style/index.less +33 -1
  115. package/lib/RefactorTree/index.js +36 -67
  116. package/lib/RefactorTree/indexTreeNode.js +37 -83
  117. package/lib/RefactorTree/util.js +11 -45
  118. package/lib/SpecIcon/fonts/iconfont.js +7 -12
  119. package/lib/SpecIcon/index.js +16 -30
  120. package/lib/SplitterLayout/Pane.js +0 -7
  121. package/lib/SplitterLayout/index.js +18 -72
  122. package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
  123. package/lib/StandardContent/SplitterLayout/index.js +12 -68
  124. package/lib/StandardContent/SubfieldContent.js +12 -21
  125. package/lib/StandardContent/WrapperContent.js +8 -16
  126. package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
  127. package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
  128. package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
  129. package/lib/StandardDragModal/DraggableModal.js +40 -0
  130. package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
  131. package/lib/StandardDragModal/DraggableModalContext.js +15 -0
  132. package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
  133. package/lib/StandardDragModal/DraggableModalInner.js +124 -0
  134. package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
  135. package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
  136. package/lib/StandardDragModal/Modal.d.ts +11 -0
  137. package/lib/StandardDragModal/Modal.js +32 -0
  138. package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
  139. package/lib/StandardDragModal/ResizeHandle.js +18 -0
  140. package/lib/StandardDragModal/clamp.d.ts +1 -0
  141. package/lib/StandardDragModal/clamp.js +10 -0
  142. package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
  143. package/lib/StandardDragModal/draggableModalReducer.js +167 -0
  144. package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
  145. package/lib/StandardDragModal/getWindowSize.js +13 -0
  146. package/lib/StandardDragModal/index.d.ts +3 -11
  147. package/lib/StandardDragModal/index.js +33 -38
  148. package/lib/StandardDragModal/index.less +65 -0
  149. package/lib/StandardDragModal/useDrag.d.ts +5 -0
  150. package/lib/StandardDragModal/useDrag.js +73 -0
  151. package/lib/StandardDragModal/usePrevious.d.ts +1 -0
  152. package/lib/StandardDragModal/usePrevious.js +15 -0
  153. package/lib/StandardDragModal/useResize.d.ts +7 -0
  154. package/lib/StandardDragModal/useResize.js +81 -0
  155. package/lib/StandardFilter/index.d.ts +1 -0
  156. package/lib/StandardFilter/index.js +30 -78
  157. package/lib/StandardForm/ActionList.js +5 -12
  158. package/lib/StandardForm/StepForm.js +52 -90
  159. package/lib/StandardForm/TabForm.js +61 -88
  160. package/lib/StandardForm/index.js +40 -75
  161. package/lib/StandardModal/UpdateFormRef.js +4 -12
  162. package/lib/StandardModal/index.d.ts +0 -1
  163. package/lib/StandardModal/index.js +117 -184
  164. package/lib/StandardPanel/index.js +22 -48
  165. package/lib/StandardTable/index.js +20 -39
  166. package/lib/components/IconNode/index.js +0 -7
  167. package/lib/components/index.js +0 -2
  168. package/lib/data/index.js +4 -7
  169. package/lib/index.d.ts +1 -0
  170. package/lib/index.js +50 -68
  171. package/lib/utils/ValueFormat.js +0 -10
  172. package/lib/utils/dictSelectUtil.js +161 -0
  173. package/lib/utils/filterPermission.js +15 -39
  174. package/lib/utils/getParentNodes.js +25 -52
  175. package/lib/utils/index.js +24 -9
  176. package/package.json +6 -5
@@ -4,63 +4,47 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
-
8
7
  var _api = require("./api");
9
-
8
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
10
9
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
11
-
12
10
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
13
-
14
11
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
15
-
16
12
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
-
18
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
19
-
20
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
21
-
14
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
22
15
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
23
-
24
16
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
25
-
26
17
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
27
-
28
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
29
-
30
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
31
-
32
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
33
-
18
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
19
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
20
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
34
23
  var UploadQueue = /*#__PURE__*/function () {
35
24
  // 上传任务队列存储
36
25
  // 是否正在上传
37
26
  // 记录每个文件还剩下多少上传任务,作为判断文件是否完成上传的依据
27
+
38
28
  // 文件完成上传的回调函数
29
+
39
30
  function UploadQueue(_ref) {
40
31
  var fileFinishCb = _ref.fileFinishCb;
41
-
42
32
  _classCallCheck(this, UploadQueue);
43
-
44
33
  _defineProperty(this, "uploadQueue", []);
45
-
46
34
  _defineProperty(this, "isUploading", false);
47
-
48
35
  _defineProperty(this, "tasksSizePerFile", {});
49
-
50
36
  _defineProperty(this, "fileFinishCb", function () {});
51
-
52
37
  if (!!fileFinishCb && typeof fileFinishCb === 'function') {
53
38
  this.fileFinishCb = fileFinishCb;
54
39
  }
55
40
  }
41
+
56
42
  /**
57
43
  * 建立上传队列,规则:
58
44
  * 找出服务端记录里当前该文件所有状态为'wait'的文件分片
59
45
  * @param {Object} fileInfo 文件上传情况
60
46
  * @param {Array} chunksArr 分片数组
61
47
  */
62
-
63
-
64
48
  _createClass(UploadQueue, [{
65
49
  key: "addChunksToQueue",
66
50
  value: function addChunksToQueue(fileInfo, chunksArr) {
@@ -75,7 +59,6 @@ var UploadQueue = /*#__PURE__*/function () {
75
59
  };
76
60
  });
77
61
  /* 添加上传任务到队列中 */
78
-
79
62
  if (newTasks.length > 0) {
80
63
  this.uploadQueue = [].concat(_toConsumableArray(this.uploadQueue), _toConsumableArray(newTasks));
81
64
  this.tasksSizePerFile[newTasks[0].hash] = newTasks.length; // 记录当前文件有多少个上传任务
@@ -84,7 +67,6 @@ var UploadQueue = /*#__PURE__*/function () {
84
67
  /**
85
68
  * 触发上传
86
69
  */
87
-
88
70
  }, {
89
71
  key: "run",
90
72
  value: function run() {
@@ -96,13 +78,11 @@ var UploadQueue = /*#__PURE__*/function () {
96
78
  /**
97
79
  * 上传下一个分片
98
80
  */
99
-
100
81
  }, {
101
82
  key: "uploadNext",
102
83
  value: function () {
103
84
  var _uploadNext = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
104
85
  var _this$uploadQueue$shi, chunkIndex, chunk, fileHash, lockResult;
105
-
106
86
  return regeneratorRuntime.wrap(function _callee$(_context) {
107
87
  while (1) {
108
88
  switch (_context.prev = _context.next) {
@@ -111,47 +91,35 @@ var UploadQueue = /*#__PURE__*/function () {
111
91
  _context.next = 3;
112
92
  break;
113
93
  }
114
-
115
94
  this.isUploading = false;
116
95
  return _context.abrupt("return");
117
-
118
96
  case 3:
119
97
  _this$uploadQueue$shi = this.uploadQueue.shift(), chunkIndex = _this$uploadQueue$shi.index, chunk = _this$uploadQueue$shi.chunk, fileHash = _this$uploadQueue$shi.hash; // 从上传队列里取出一个上传任务
120
-
121
98
  console.log('请求接口lockChunk=>给分片加锁,避免多个客户端上传同一个分片');
122
99
  /* 给分片加锁,避免多个客户端上传同一个分片 */
123
-
124
100
  _context.next = 7;
125
101
  return (0, _api.lockChunk)(fileHash, chunkIndex);
126
-
127
102
  case 7:
128
103
  lockResult = _context.sent;
129
-
130
104
  if (!lockResult) {
131
105
  _context.next = 16;
132
106
  break;
133
107
  }
134
-
135
108
  _context.next = 11;
136
109
  return (0, _api.uploadChunk)(fileHash, chunkIndex, chunk);
137
-
138
110
  case 11:
139
111
  console.log('请求接口uploadChunk=>上传分片文件,执行任务数递减', this.tasksSizePerFile);
140
112
  /* 判断该文件的所有分片是否都上传完(任务数递减为0时) */
141
-
142
113
  if (--this.tasksSizePerFile[fileHash] === 0) {
143
114
  this.fileFinishCb(fileHash);
144
115
  console.log('fileFinishCb=>该文件的所有分片已都上传完');
145
116
  }
146
-
147
117
  this.uploadNext();
148
118
  _context.next = 17;
149
119
  break;
150
-
151
120
  case 16:
152
121
  // 加锁失败,表示已有另一个客户端上传此分片,因此丢弃当前上传任务
153
122
  this.uploadNext();
154
-
155
123
  case 17:
156
124
  case "end":
157
125
  return _context.stop();
@@ -159,16 +127,12 @@ var UploadQueue = /*#__PURE__*/function () {
159
127
  }
160
128
  }, _callee, this);
161
129
  }));
162
-
163
130
  function uploadNext() {
164
131
  return _uploadNext.apply(this, arguments);
165
132
  }
166
-
167
133
  return uploadNext;
168
134
  }()
169
135
  }]);
170
-
171
136
  return UploadQueue;
172
137
  }();
173
-
174
138
  exports.default = UploadQueue;
@@ -1,22 +1,18 @@
1
1
  "use strict";
2
2
 
3
3
  var _sparkMd = _interopRequireDefault(require("spark-md5"));
4
-
5
4
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
6
-
7
5
  /* eslint-disable no-restricted-globals */
6
+
8
7
  self.addEventListener('message', function (e) {
9
8
  var chunksArr = e.data.chunksArr; // 收到主线程传递来的文件分片
10
-
11
9
  console.log('监听\'message\'收到主线程传递来的文件分片', chunksArr);
12
10
  var spark = new _sparkMd.default.ArrayBuffer();
13
11
  var fileReader = new FileReader();
14
12
  fileReader.readAsArrayBuffer(chunksArr.pop());
15
13
  console.log('创建文件读取', fileReader);
16
-
17
14
  fileReader.onload = function (e) {
18
15
  spark.append(e.target.result);
19
-
20
16
  if (chunksArr.length === 0) {
21
17
  self.postMessage({
22
18
  hash: spark.end()
@@ -1,64 +1,39 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  require("antd/es/button/style");
11
-
12
9
  var _button = _interopRequireDefault(require("antd/es/button"));
13
-
14
10
  require("antd/es/input/style");
15
-
16
11
  var _input = _interopRequireDefault(require("antd/es/input"));
17
-
18
12
  var _react = _interopRequireWildcard(require("react"));
19
-
20
13
  var _classnames = _interopRequireDefault(require("classnames"));
21
-
22
14
  var _icons = require("@ant-design/icons");
23
-
24
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
25
-
26
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
-
15
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
16
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
28
17
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
29
-
30
18
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
31
-
32
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
33
-
34
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
35
-
36
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
37
-
38
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
39
-
19
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
20
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
21
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
22
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
23
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
24
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
40
25
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
41
-
42
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
43
-
26
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
44
27
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
45
-
46
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
47
-
48
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
49
-
28
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
29
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
50
30
  var EditButton = /*#__PURE__*/function (_Component) {
51
31
  _inherits(EditButton, _Component);
52
-
53
32
  var _super = _createSuper(EditButton);
54
-
55
33
  function EditButton(props) {
56
34
  var _this;
57
-
58
35
  _classCallCheck(this, EditButton);
59
-
60
36
  _this = _super.call(this, props);
61
-
62
37
  _this.handleClick = function () {
63
38
  _this.setState({
64
39
  inputVisible: true
@@ -66,57 +41,50 @@ var EditButton = /*#__PURE__*/function (_Component) {
66
41
  return _this.input.focus();
67
42
  });
68
43
  };
69
-
70
44
  _this.saveInputRef = function (input) {
71
45
  _this.input = input;
72
46
  };
73
-
74
47
  _this.handleInputChange = function (e) {
75
48
  _this.setState({
76
49
  inputValue: e.target.value
77
50
  });
78
51
  };
79
-
80
52
  _this.handleInputConfirm = function () {
81
53
  var _this$props = _this.props,
82
- onSave = _this$props.onSave,
83
- onChange = _this$props.onChange;
54
+ onSave = _this$props.onSave,
55
+ onChange = _this$props.onChange;
84
56
  var inputValue = _this.state.inputValue;
85
57
  if (onSave) onSave(inputValue);
86
58
  if (onChange) onChange(inputValue);
87
-
88
59
  _this.setState({
89
60
  inputVisible: false,
90
61
  inputValue: ''
91
62
  });
92
63
  };
93
-
94
64
  _this.state = {
95
65
  inputValue: '',
96
66
  inputVisible: false
97
67
  };
98
68
  return _this;
99
69
  }
100
-
101
70
  _createClass(EditButton, [{
102
71
  key: "render",
103
72
  value: function render() {
104
73
  var _this2 = this;
105
-
106
74
  var _this$props2 = this.props,
107
- _this$props2$size = _this$props2.size,
108
- size = _this$props2$size === void 0 ? 'middle' : _this$props2$size,
109
- label = _this$props2.label,
110
- _this$props2$icon = _this$props2.icon,
111
- icon = _this$props2$icon === void 0 ? /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null) : _this$props2$icon,
112
- style = _this$props2.style,
113
- className = _this$props2.className,
114
- disabled = _this$props2.disabled,
115
- _this$props2$width = _this$props2.width,
116
- width = _this$props2$width === void 0 ? 106 : _this$props2$width;
75
+ _this$props2$size = _this$props2.size,
76
+ size = _this$props2$size === void 0 ? 'middle' : _this$props2$size,
77
+ label = _this$props2.label,
78
+ _this$props2$icon = _this$props2.icon,
79
+ icon = _this$props2$icon === void 0 ? /*#__PURE__*/_react.default.createElement(_icons.PlusOutlined, null) : _this$props2$icon,
80
+ style = _this$props2.style,
81
+ className = _this$props2.className,
82
+ disabled = _this$props2.disabled,
83
+ _this$props2$width = _this$props2.width,
84
+ width = _this$props2$width === void 0 ? 106 : _this$props2$width;
117
85
  var _this$state = this.state,
118
- inputValue = _this$state.inputValue,
119
- inputVisible = _this$state.inputVisible;
86
+ inputValue = _this$state.inputValue,
87
+ inputVisible = _this$state.inputVisible;
120
88
  return /*#__PURE__*/_react.default.createElement("span", {
121
89
  style: Object.assign({
122
90
  display: 'inline-block',
@@ -151,9 +119,7 @@ var EditButton = /*#__PURE__*/function (_Component) {
151
119
  }, label));
152
120
  }
153
121
  }]);
154
-
155
122
  return EditButton;
156
123
  }(_react.Component);
157
-
158
124
  var _default = EditButton;
159
125
  exports.default = _default;
@@ -1,81 +1,58 @@
1
1
  "use strict";
2
2
 
3
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
-
3
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports.default = void 0;
9
-
10
8
  require("antd/es/upload/style");
11
-
12
9
  var _upload = _interopRequireDefault(require("antd/es/upload"));
13
-
14
10
  var _tslib = require("tslib");
15
-
16
11
  var _react = _interopRequireWildcard(require("react"));
17
-
18
12
  var _index = _interopRequireDefault(require("../../StandardModal/index"));
19
-
20
- function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
21
-
22
- function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
23
-
13
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
14
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
24
15
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
-
26
16
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
27
-
28
17
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
29
-
30
18
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
31
-
32
19
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
33
-
34
- function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
35
-
20
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0) { ; } } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
36
21
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
37
-
38
22
  function getBase64(file) {
39
23
  return new Promise(function (resolve, reject) {
40
24
  var reader = new FileReader();
41
25
  reader.readAsDataURL(file);
42
-
43
26
  reader.onload = function () {
44
27
  return resolve(reader.result);
45
28
  };
46
-
47
29
  reader.onerror = function (error) {
48
30
  return reject(error);
49
31
  };
50
32
  });
51
33
  }
52
-
53
34
  var ReUpload = /*#__PURE__*/_react.default.forwardRef(function (deProps, ref) {
54
35
  var viewOnly = deProps.viewOnly,
55
- onChange = deProps.onChange,
56
- value = deProps.value,
57
- _deProps$modalConfig = deProps.modalConfig,
58
- modalConfig = _deProps$modalConfig === void 0 ? {} : _deProps$modalConfig,
59
- otherProps = (0, _tslib.__rest)(deProps, ["viewOnly", "onChange", "value", "modalConfig"]);
60
-
36
+ onChange = deProps.onChange,
37
+ value = deProps.value,
38
+ _deProps$modalConfig = deProps.modalConfig,
39
+ modalConfig = _deProps$modalConfig === void 0 ? {} : _deProps$modalConfig,
40
+ otherProps = (0, _tslib.__rest)(deProps, ["viewOnly", "onChange", "value", "modalConfig"]);
61
41
  var _useState = (0, _react.useState)(),
62
- _useState2 = _slicedToArray(_useState, 2),
63
- fileList = _useState2[0],
64
- setFileList = _useState2[1];
65
-
42
+ _useState2 = _slicedToArray(_useState, 2),
43
+ fileList = _useState2[0],
44
+ setFileList = _useState2[1];
66
45
  var _useState3 = (0, _react.useState)({
67
- previewVisible: false,
68
- previewImage: '',
69
- previewTitle: ''
70
- }),
71
- _useState4 = _slicedToArray(_useState3, 2),
72
- previewConfig = _useState4[0],
73
- setPreviewConfig = _useState4[1];
74
-
46
+ previewVisible: false,
47
+ previewImage: '',
48
+ previewTitle: ''
49
+ }),
50
+ _useState4 = _slicedToArray(_useState3, 2),
51
+ previewConfig = _useState4[0],
52
+ setPreviewConfig = _useState4[1];
75
53
  (0, _react.useEffect)(function () {
76
54
  setFileList(value);
77
55
  }, [value]);
78
-
79
56
  var handlePreview = function handlePreview(file) {
80
57
  return (0, _tslib.__awaiter)(void 0, void 0, void 0, /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
81
58
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -86,20 +63,16 @@ var ReUpload = /*#__PURE__*/_react.default.forwardRef(function (deProps, ref) {
86
63
  _context.next = 4;
87
64
  break;
88
65
  }
89
-
90
66
  _context.next = 3;
91
67
  return getBase64(file.originFileObj);
92
-
93
68
  case 3:
94
69
  file.preview = _context.sent;
95
-
96
70
  case 4:
97
71
  setPreviewConfig({
98
72
  previewImage: file.url || file.preview,
99
73
  previewVisible: true,
100
74
  previewTitle: file.name || file.url.substring(file.url.lastIndexOf('/') + 1)
101
75
  });
102
-
103
76
  case 5:
104
77
  case "end":
105
78
  return _context.stop();
@@ -108,11 +81,10 @@ var ReUpload = /*#__PURE__*/_react.default.forwardRef(function (deProps, ref) {
108
81
  }, _callee);
109
82
  }));
110
83
  };
111
-
112
84
  var uploadChange = (0, _react.useCallback)(function (_ref) {
113
85
  var file = _ref.file,
114
- fileList = _ref.fileList,
115
- event = _ref.event;
86
+ fileList = _ref.fileList,
87
+ event = _ref.event;
116
88
  setFileList(fileList);
117
89
  onChange && onChange(fileList, {
118
90
  file: file,
@@ -149,6 +121,5 @@ var ReUpload = /*#__PURE__*/_react.default.forwardRef(function (deProps, ref) {
149
121
  alt: ""
150
122
  }))));
151
123
  });
152
-
153
124
  var _default = ReUpload;
154
125
  exports.default = _default;