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.
- package/Readme.md +35 -0
- package/dist/fan-standard-comp.umd.js +15 -10
- package/es/ButtonGroup/ButtonList.js +0 -3
- package/es/ButtonGroup/ButtonMenu.js +0 -3
- package/es/ButtonGroup/PopConfirmTitle.js +5 -15
- package/es/ButtonGroup/index.d.ts +2 -0
- package/es/ButtonGroup/index.js +223 -193
- package/es/ButtonGroup/style/index.less +1 -1
- package/es/DragContent/DragBar.js +2 -6
- package/es/DragContent/index.js +44 -75
- package/es/FormComp/ChunkUploader/api.js +6 -10
- package/es/FormComp/ChunkUploader/index.js +105 -171
- package/es/FormComp/ChunkUploader/lib.js +4 -17
- package/es/FormComp/ChunkUploader/upload-queue.class.js +10 -45
- package/es/FormComp/ChunkUploader/worker.js +0 -3
- package/es/FormComp/EditButton/index.js +24 -49
- package/es/FormComp/FieldComponent/ReUpload.js +18 -38
- package/es/FormComp/FieldComponent/RefactorTreeSelect.js +37 -75
- package/es/FormComp/FieldComponent/TitleNode.js +1 -3
- package/es/FormComp/FieldComponent/index.js +38 -74
- package/es/FormComp/FieldComponent/setReadonlyValues.js +34 -63
- package/es/FormComp/FieldComponent/style/index.less +6 -0
- package/es/FormComp/RenderItemGroup/index.js +46 -74
- package/es/FormComp/Uploader/index.js +36 -77
- package/es/FormComp/Uploader/util.js +0 -6
- package/es/FormComp/VarTemplate/index.js +58 -96
- package/es/NavLeafScroll/index.js +172 -154
- package/es/NavLeafScroll/style/index.less +33 -1
- package/es/RefactorTree/index.js +36 -53
- package/es/RefactorTree/indexTreeNode.js +35 -68
- package/es/RefactorTree/util.js +9 -43
- package/es/SpecIcon/fonts/iconfont.js +7 -12
- package/es/SpecIcon/index.js +16 -25
- package/es/SplitterLayout/Pane.js +2 -5
- package/es/SplitterLayout/index.js +20 -70
- package/es/StandardContent/SplitterLayout/Pane.js +6 -10
- package/es/StandardContent/SplitterLayout/index.js +12 -63
- package/es/StandardContent/SubfieldContent.js +12 -14
- package/es/StandardContent/WrapperContent.js +8 -10
- package/es/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/es/StandardDragModal/ChangeStandardModal.js +493 -0
- package/es/StandardDragModal/DraggableModal.d.ts +7 -0
- package/es/StandardDragModal/DraggableModal.js +31 -0
- package/es/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/es/StandardDragModal/DraggableModalContext.js +5 -0
- package/es/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/es/StandardDragModal/DraggableModalInner.js +114 -0
- package/es/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/es/StandardDragModal/DraggableModalProvider.js +40 -0
- package/es/StandardDragModal/Modal.d.ts +11 -0
- package/es/StandardDragModal/Modal.js +24 -0
- package/es/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/es/StandardDragModal/ResizeHandle.js +8 -0
- package/es/StandardDragModal/clamp.d.ts +1 -0
- package/es/StandardDragModal/clamp.js +3 -0
- package/es/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/es/StandardDragModal/draggableModalReducer.js +157 -0
- package/es/StandardDragModal/getWindowSize.d.ts +4 -0
- package/es/StandardDragModal/getWindowSize.js +6 -0
- package/es/StandardDragModal/index.d.ts +3 -11
- package/es/StandardDragModal/index.js +3 -30
- package/es/StandardDragModal/index.less +65 -0
- package/es/StandardDragModal/useDrag.d.ts +5 -0
- package/es/StandardDragModal/useDrag.js +66 -0
- package/es/StandardDragModal/usePrevious.d.ts +1 -0
- package/es/StandardDragModal/usePrevious.js +8 -0
- package/es/StandardDragModal/useResize.d.ts +7 -0
- package/es/StandardDragModal/useResize.js +74 -0
- package/es/StandardFilter/index.d.ts +1 -0
- package/es/StandardFilter/index.js +32 -70
- package/es/StandardForm/ActionList.js +5 -7
- package/es/StandardForm/StepForm.js +50 -71
- package/es/StandardForm/TabForm.js +58 -70
- package/es/StandardForm/index.js +37 -56
- package/es/StandardModal/UpdateFormRef.js +1 -4
- package/es/StandardModal/index.d.ts +0 -1
- package/es/StandardModal/index.js +115 -159
- package/es/StandardPanel/index.js +19 -35
- package/es/StandardTable/index.js +20 -30
- package/es/components/IconNode/index.js +0 -4
- package/es/index.d.ts +1 -0
- package/es/index.js +15 -14
- package/es/utils/ValueFormat.js +0 -9
- package/es/utils/dictSelectUtil.js +153 -0
- package/es/utils/filterPermission.js +16 -34
- package/es/utils/getParentNodes.js +24 -47
- package/es/utils/index.js +2 -1
- package/lib/ButtonGroup/ButtonList.js +1 -13
- package/lib/ButtonGroup/ButtonMenu.js +1 -8
- package/lib/ButtonGroup/PopConfirmTitle.js +3 -16
- package/lib/ButtonGroup/index.d.ts +2 -0
- package/lib/ButtonGroup/index.js +226 -216
- package/lib/ButtonGroup/style/index.less +1 -1
- package/lib/DragContent/DragBar.js +2 -10
- package/lib/DragContent/index.js +47 -85
- package/lib/FormComp/ChunkUploader/api.js +6 -15
- package/lib/FormComp/ChunkUploader/index.js +107 -185
- package/lib/FormComp/ChunkUploader/lib.js +8 -27
- package/lib/FormComp/ChunkUploader/upload-queue.class.js +10 -46
- package/lib/FormComp/ChunkUploader/worker.js +1 -5
- package/lib/FormComp/EditButton/index.js +26 -60
- package/lib/FormComp/FieldComponent/ReUpload.js +21 -50
- package/lib/FormComp/FieldComponent/RefactorTreeSelect.js +39 -90
- package/lib/FormComp/FieldComponent/TitleNode.js +1 -5
- package/lib/FormComp/FieldComponent/index.js +38 -110
- package/lib/FormComp/FieldComponent/setReadonlyValues.js +37 -79
- package/lib/FormComp/FieldComponent/style/index.less +6 -0
- package/lib/FormComp/RenderItemGroup/index.js +46 -87
- package/lib/FormComp/Uploader/index.js +38 -95
- package/lib/FormComp/Uploader/util.js +1 -9
- package/lib/FormComp/VarTemplate/index.js +62 -106
- package/lib/FormComp/index.js +0 -2
- package/lib/NavLeafScroll/index.js +174 -165
- package/lib/NavLeafScroll/style/index.less +33 -1
- package/lib/RefactorTree/index.js +36 -67
- package/lib/RefactorTree/indexTreeNode.js +37 -83
- package/lib/RefactorTree/util.js +11 -45
- package/lib/SpecIcon/fonts/iconfont.js +7 -12
- package/lib/SpecIcon/index.js +16 -30
- package/lib/SplitterLayout/Pane.js +0 -7
- package/lib/SplitterLayout/index.js +18 -72
- package/lib/StandardContent/SplitterLayout/Pane.js +6 -14
- package/lib/StandardContent/SplitterLayout/index.js +12 -68
- package/lib/StandardContent/SubfieldContent.js +12 -21
- package/lib/StandardContent/WrapperContent.js +8 -16
- package/lib/StandardDragModal/ChangeStandardModal.d.ts +44 -0
- package/lib/StandardDragModal/ChangeStandardModal.js +502 -0
- package/lib/StandardDragModal/DraggableModal.d.ts +7 -0
- package/lib/StandardDragModal/DraggableModal.js +40 -0
- package/lib/StandardDragModal/DraggableModalContext.d.ts +9 -0
- package/lib/StandardDragModal/DraggableModalContext.js +15 -0
- package/lib/StandardDragModal/DraggableModalInner.d.ts +16 -0
- package/lib/StandardDragModal/DraggableModalInner.js +124 -0
- package/lib/StandardDragModal/DraggableModalProvider.d.ts +4 -0
- package/lib/StandardDragModal/DraggableModalProvider.js +48 -0
- package/lib/StandardDragModal/Modal.d.ts +11 -0
- package/lib/StandardDragModal/Modal.js +32 -0
- package/lib/StandardDragModal/ResizeHandle.d.ts +2 -0
- package/lib/StandardDragModal/ResizeHandle.js +18 -0
- package/lib/StandardDragModal/clamp.d.ts +1 -0
- package/lib/StandardDragModal/clamp.js +10 -0
- package/lib/StandardDragModal/draggableModalReducer.d.ts +66 -0
- package/lib/StandardDragModal/draggableModalReducer.js +167 -0
- package/lib/StandardDragModal/getWindowSize.d.ts +4 -0
- package/lib/StandardDragModal/getWindowSize.js +13 -0
- package/lib/StandardDragModal/index.d.ts +3 -11
- package/lib/StandardDragModal/index.js +33 -38
- package/lib/StandardDragModal/index.less +65 -0
- package/lib/StandardDragModal/useDrag.d.ts +5 -0
- package/lib/StandardDragModal/useDrag.js +73 -0
- package/lib/StandardDragModal/usePrevious.d.ts +1 -0
- package/lib/StandardDragModal/usePrevious.js +15 -0
- package/lib/StandardDragModal/useResize.d.ts +7 -0
- package/lib/StandardDragModal/useResize.js +81 -0
- package/lib/StandardFilter/index.d.ts +1 -0
- package/lib/StandardFilter/index.js +30 -78
- package/lib/StandardForm/ActionList.js +5 -12
- package/lib/StandardForm/StepForm.js +52 -90
- package/lib/StandardForm/TabForm.js +61 -88
- package/lib/StandardForm/index.js +40 -75
- package/lib/StandardModal/UpdateFormRef.js +4 -12
- package/lib/StandardModal/index.d.ts +0 -1
- package/lib/StandardModal/index.js +117 -184
- package/lib/StandardPanel/index.js +22 -48
- package/lib/StandardTable/index.js +20 -39
- package/lib/components/IconNode/index.js +0 -7
- package/lib/components/index.js +0 -2
- package/lib/data/index.js +4 -7
- package/lib/index.d.ts +1 -0
- package/lib/index.js +50 -68
- package/lib/utils/ValueFormat.js +0 -10
- package/lib/utils/dictSelectUtil.js +161 -0
- package/lib/utils/filterPermission.js +15 -39
- package/lib/utils/getParentNodes.js +25 -52
- package/lib/utils/index.js +24 -9
- 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
|
|
29
|
-
|
|
30
|
-
function
|
|
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(
|
|
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
|
|
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
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
function
|
|
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
|
|
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
|
-
|
|
83
|
-
|
|
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
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
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
|
-
|
|
119
|
-
|
|
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(
|
|
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
|
|
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
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
42
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
43
|
+
fileList = _useState2[0],
|
|
44
|
+
setFileList = _useState2[1];
|
|
66
45
|
var _useState3 = (0, _react.useState)({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
115
|
-
|
|
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;
|