@chaoswise/business 0.0.14 → 0.0.16
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/lib/AggregateSearch/components/DropDown/index.js +11 -3
- package/lib/AggregateSearch/components/SwitchBtn/index.js +2 -1
- package/lib/AggregateSearch/components/SwitchBtn/index.less +12 -1
- package/lib/AggregateSearch/index.js +34 -8
- package/lib/AggregateSearch/index.less +79 -9
- package/lib/AggregateSearch/utils/index.js +33 -5
- package/lib/PropertyControlViewer/components/DoImage.js +11 -1
- package/package.json +5 -4
- package/lib/AggregateSearch/components/CloseAllIcon/assets/Close-Circle-Fill.svg +0 -18
|
@@ -213,8 +213,12 @@ var DropDown = function DropDown(props) {
|
|
|
213
213
|
setHistoryList = _useState12[1];
|
|
214
214
|
var _useState13 = useState(0),
|
|
215
215
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
width = _useState14[0],
|
|
217
|
+
setWidth = _useState14[1];
|
|
218
|
+
var _useState15 = useState(0),
|
|
219
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
220
|
+
height = _useState16[0],
|
|
221
|
+
setHeight = _useState16[1];
|
|
218
222
|
var watcher = useRef(null);
|
|
219
223
|
useEffect(function () {
|
|
220
224
|
// 监听外壳容器变化
|
|
@@ -227,8 +231,10 @@ var DropDown = function DropDown(props) {
|
|
|
227
231
|
var target = entry.target,
|
|
228
232
|
_entry$contentRect = entry.contentRect,
|
|
229
233
|
_entry$contentRect2 = _entry$contentRect === void 0 ? {} : _entry$contentRect,
|
|
234
|
+
_width = _entry$contentRect2.width,
|
|
230
235
|
_height = _entry$contentRect2.height;
|
|
231
236
|
if (target === containerWrapperRef.current) {
|
|
237
|
+
setWidth(_width);
|
|
232
238
|
setHeight(_height);
|
|
233
239
|
}
|
|
234
240
|
}
|
|
@@ -579,7 +585,9 @@ var DropDown = function DropDown(props) {
|
|
|
579
585
|
},
|
|
580
586
|
overlayStyle: {
|
|
581
587
|
top: Number(height + 2),
|
|
582
|
-
left: 0
|
|
588
|
+
left: 0,
|
|
589
|
+
minWidth: Number(width + 2),
|
|
590
|
+
maxWidth: Number(width + 2)
|
|
583
591
|
} // 2是边框高度
|
|
584
592
|
}, children);
|
|
585
593
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
border-radius: 0 2px 2px 0;
|
|
9
9
|
display: flex;
|
|
10
10
|
padding: 0 9px;
|
|
11
|
+
justify-content: center;
|
|
11
12
|
align-items: flex-start;
|
|
12
13
|
align-self: stretch; // 使得高度和父元素一致
|
|
13
14
|
width: 35px;
|
|
@@ -15,6 +16,16 @@
|
|
|
15
16
|
border-left-color: @input-hover-border-color;
|
|
16
17
|
}
|
|
17
18
|
img{
|
|
18
|
-
transform: translateY(
|
|
19
|
+
transform: translateY(7px);
|
|
20
|
+
&[mode="tag"]{
|
|
21
|
+
transform: translateY(8px);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.aggregate-search-text-wrapper.syntax-error{
|
|
26
|
+
.aggregate-search-switch-btn{
|
|
27
|
+
&:hover{
|
|
28
|
+
border-left-color: @red-5;
|
|
29
|
+
}
|
|
19
30
|
}
|
|
20
31
|
}
|
|
@@ -10,7 +10,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
|
|
|
10
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); }); }; }
|
|
11
11
|
import React, { useEffect, useRef, useState, useMemo } from "react";
|
|
12
12
|
import PropTypes from "prop-types";
|
|
13
|
-
import { textInit, getCursorPosition, getCursorNodeAndIndex, setCursorPosition, genHtmlAndSyntaxCheckResByString, checkSyntax } from "./utils";
|
|
13
|
+
import { textInit, getCursorPosition, getCursorNodeAndIndex, setCursorPosition, genHtmlAndSyntaxCheckResByString, checkSyntax, cloneDomRemoveCloseBtn } from "./utils";
|
|
14
14
|
import SwitchBtn from "./components/SwitchBtn";
|
|
15
15
|
import DropDown from "./components/DropDown";
|
|
16
16
|
import "./index.less";
|
|
@@ -71,6 +71,8 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
71
71
|
})) : _ref$onHistoryDelete,
|
|
72
72
|
_ref$onHelpClick = _ref.onHelpClick,
|
|
73
73
|
onHelpClick = _ref$onHelpClick === void 0 ? function () {} : _ref$onHelpClick,
|
|
74
|
+
_ref$onPressEnter = _ref.onPressEnter,
|
|
75
|
+
onPressEnter = _ref$onPressEnter === void 0 ? function () {} : _ref$onPressEnter,
|
|
74
76
|
mode = _ref.mode,
|
|
75
77
|
_ref$defaultMode = _ref.defaultMode,
|
|
76
78
|
defaultMode = _ref$defaultMode === void 0 ? "tag" : _ref$defaultMode,
|
|
@@ -210,6 +212,7 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
210
212
|
setVisible = _useDropDown.setVisible;
|
|
211
213
|
var onInput = /*#__PURE__*/function () {
|
|
212
214
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(e) {
|
|
215
|
+
var cloneDomRemoveCloseBtnDom;
|
|
213
216
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
214
217
|
while (1) switch (_context7.prev = _context7.next) {
|
|
215
218
|
case 0:
|
|
@@ -219,9 +222,10 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
219
222
|
}
|
|
220
223
|
return _context7.abrupt("return");
|
|
221
224
|
case 2:
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
+
cloneDomRemoveCloseBtnDom = cloneDomRemoveCloseBtn(e.target);
|
|
226
|
+
handleValueChange(cloneDomRemoveCloseBtnDom.innerText);
|
|
227
|
+
onChange(cloneDomRemoveCloseBtnDom.innerText);
|
|
228
|
+
case 5:
|
|
225
229
|
case "end":
|
|
226
230
|
return _context7.stop();
|
|
227
231
|
}
|
|
@@ -241,7 +245,9 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
241
245
|
useEffect(function () {
|
|
242
246
|
var handleClick = function handleClick(e) {
|
|
243
247
|
// 可编辑文本框边框线e.target !== containerWrapperRef.current
|
|
244
|
-
|
|
248
|
+
// e.target 为svg图标时,className为SVGAnimatedString类型(object)
|
|
249
|
+
var isClickClose = e.target.className && typeof e.target.className === "string" ? e.target.className.includes("tag-box-item-close") : false;
|
|
250
|
+
if (container.current && (!container.current.contains(e.target) || isClickClose) && e.target !== containerWrapperRef.current) {
|
|
245
251
|
setVisible(false);
|
|
246
252
|
setContentEditable(false);
|
|
247
253
|
} else {
|
|
@@ -249,6 +255,18 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
249
255
|
setContentEditable(true);
|
|
250
256
|
(_container$current = container.current) === null || _container$current === void 0 || _container$current.focus();
|
|
251
257
|
}
|
|
258
|
+
if (isClickClose) {
|
|
259
|
+
var CloseTagWrapper = e.target.parentNode;
|
|
260
|
+
var nextSiblingWrappr = CloseTagWrapper.nextSibling;
|
|
261
|
+
if (nextSiblingWrappr) {
|
|
262
|
+
// 将下个文本元素的第一个空格去掉
|
|
263
|
+
nextSiblingWrappr.nodeValue = nextSiblingWrappr.nodeValue.replace(/(^\s{1})/, "");
|
|
264
|
+
}
|
|
265
|
+
;
|
|
266
|
+
container.current.removeChild(CloseTagWrapper);
|
|
267
|
+
handleValueChange(container.current.innerText);
|
|
268
|
+
onChange(container.current.innerText);
|
|
269
|
+
}
|
|
252
270
|
};
|
|
253
271
|
document.addEventListener("click", handleClick);
|
|
254
272
|
return function () {
|
|
@@ -274,7 +292,10 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
274
292
|
if (keyCode === 13) {
|
|
275
293
|
// 回车阻止默认的换行行为
|
|
276
294
|
e.preventDefault();
|
|
277
|
-
|
|
295
|
+
var cloneDomRemoveCloseBtnDom = cloneDomRemoveCloseBtn(e.target);
|
|
296
|
+
onChange(cloneDomRemoveCloseBtnDom.innerText);
|
|
297
|
+
onPressEnter(cloneDomRemoveCloseBtnDom.innerText);
|
|
298
|
+
setContentEditable(false);
|
|
278
299
|
setVisible(false);
|
|
279
300
|
}
|
|
280
301
|
};
|
|
@@ -330,8 +351,9 @@ var AggregateSearch = function AggregateSearch(_ref) {
|
|
|
330
351
|
onCompositionEnd: function onCompositionEnd(e) {
|
|
331
352
|
isComposing.current = false;
|
|
332
353
|
// 输入中文结束再触发一次,保证文本框对应内容与当前返回值一致,选项效果不会丢失
|
|
333
|
-
|
|
334
|
-
|
|
354
|
+
var cloneDomRemoveCloseBtnDom = cloneDomRemoveCloseBtn(e.target);
|
|
355
|
+
handleValueChange(cloneDomRemoveCloseBtnDom.innerText);
|
|
356
|
+
onChange(cloneDomRemoveCloseBtnDom.innerText);
|
|
335
357
|
},
|
|
336
358
|
onCompositionStart: function onCompositionStart() {
|
|
337
359
|
return isComposing.current = true;
|
|
@@ -367,6 +389,10 @@ AggregateSearch.propTypes = {
|
|
|
367
389
|
* 文本内容变化的回调,(value) => {}
|
|
368
390
|
*/
|
|
369
391
|
onChange: PropTypes.func,
|
|
392
|
+
/**
|
|
393
|
+
* 文本内容回车变化的回调,(value) => {}
|
|
394
|
+
*/
|
|
395
|
+
onPressEnter: PropTypes.func,
|
|
370
396
|
/**
|
|
371
397
|
* 可生成标签对模式下触发搜索标签key的回调,需要返回promise,async(value)=>[],参数为当前光标所在标签的key值:需要该值请求下拉列表key值数据
|
|
372
398
|
*/
|
|
@@ -23,10 +23,12 @@
|
|
|
23
23
|
position: relative;
|
|
24
24
|
border: @border-width-base @border-style-base @input-border-color;
|
|
25
25
|
border-radius: @border-radius-base;
|
|
26
|
+
|
|
26
27
|
// 聚焦样式修改
|
|
27
28
|
&:focus-within {
|
|
28
29
|
.active();
|
|
29
30
|
}
|
|
31
|
+
|
|
30
32
|
&:hover {
|
|
31
33
|
.hover();
|
|
32
34
|
}
|
|
@@ -35,6 +37,7 @@
|
|
|
35
37
|
&:focus-visible {
|
|
36
38
|
outline: none;
|
|
37
39
|
}
|
|
40
|
+
|
|
38
41
|
.aggregate-search-input {
|
|
39
42
|
position: relative;
|
|
40
43
|
padding: 0 10px;
|
|
@@ -44,16 +47,20 @@
|
|
|
44
47
|
line-height: 26px;
|
|
45
48
|
// border-radius: @border-radius-base 0 0 @border-radius-base;
|
|
46
49
|
outline: none;
|
|
50
|
+
|
|
47
51
|
&:empty:before {
|
|
48
52
|
content: attr(data-placeholder);
|
|
49
53
|
font-size: 12px;
|
|
50
54
|
color: rgba(0, 0, 0, 0.45);
|
|
51
55
|
line-height: 20px;
|
|
52
56
|
}
|
|
53
|
-
|
|
57
|
+
|
|
58
|
+
&:empty+.close-all-icon {
|
|
54
59
|
display: none;
|
|
55
60
|
}
|
|
56
|
-
|
|
61
|
+
|
|
62
|
+
&:not(.syntax-error):focus:before {
|
|
63
|
+
// 需要排除掉syntax-error的样式不然报错内容丢失
|
|
57
64
|
content: ""; // 不能为none,否则placeholder不显示
|
|
58
65
|
}
|
|
59
66
|
|
|
@@ -68,13 +75,66 @@
|
|
|
68
75
|
margin-right: 2px;
|
|
69
76
|
padding-right: 5px;
|
|
70
77
|
|
|
78
|
+
.tag-box-item-close {
|
|
79
|
+
position: absolute;
|
|
80
|
+
height: 20px;
|
|
81
|
+
line-height: 20px;
|
|
82
|
+
display: none;
|
|
83
|
+
top: -1px;
|
|
84
|
+
right: -10px;
|
|
85
|
+
width: 12px;
|
|
86
|
+
border: @border-width-base @border-style-base #E3E3E3;
|
|
87
|
+
border-left: none;
|
|
88
|
+
z-index: 10;
|
|
89
|
+
background: #fff;
|
|
90
|
+
border-radius: 0 @border-radius-base @border-radius-base 0;
|
|
91
|
+
|
|
92
|
+
&::before,
|
|
93
|
+
&::after {
|
|
94
|
+
content: ''; // content为x时,样式突兀
|
|
95
|
+
width: 0.5px;
|
|
96
|
+
height: 8px;
|
|
97
|
+
background: @text-color-show;
|
|
98
|
+
position: absolute;
|
|
99
|
+
top: 5.5px;
|
|
100
|
+
right: 6px;
|
|
101
|
+
left: auto;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&::before {
|
|
105
|
+
transform: rotate(45deg);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
&::after {
|
|
109
|
+
transform: rotate(-45deg);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
&:hover {
|
|
113
|
+
border-color: @primary-5;
|
|
114
|
+
.tag-box-item-close {
|
|
115
|
+
display: inline-block;
|
|
116
|
+
border-color: @primary-5;
|
|
117
|
+
&:hover {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
&::before,
|
|
120
|
+
&::after {
|
|
121
|
+
background: @primary-5;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
&:not(.syntax-error):not(&:hover):has(.tag-con-keyword_AND_OR:nth-child(1)):has(.tag-box-item-close:nth-child(2)) {
|
|
128
|
+
border-color: transparent;
|
|
129
|
+
}
|
|
130
|
+
|
|
71
131
|
.tag-con {
|
|
72
132
|
display: inline-block;
|
|
73
133
|
height: 18px;
|
|
74
134
|
line-height: 18px;
|
|
75
135
|
|
|
76
136
|
&:first-child {
|
|
77
|
-
padding-left:5px;
|
|
137
|
+
padding-left: 5px;
|
|
78
138
|
}
|
|
79
139
|
}
|
|
80
140
|
|
|
@@ -98,13 +158,11 @@
|
|
|
98
158
|
color: #FA8C16;
|
|
99
159
|
padding-left: 2px;
|
|
100
160
|
}
|
|
101
|
-
&:not(.syntax-error):has(.tag-con-keyword_AND_OR:only-child){
|
|
102
|
-
border-color: transparent;
|
|
103
|
-
}
|
|
104
161
|
}
|
|
105
162
|
}
|
|
106
|
-
|
|
107
|
-
|
|
163
|
+
|
|
164
|
+
&.aggregate-search-text-wrapper {
|
|
165
|
+
.aggregate-search-input {
|
|
108
166
|
line-height: 20px;
|
|
109
167
|
padding-top: 3px;
|
|
110
168
|
padding-bottom: 3px;
|
|
@@ -115,8 +173,9 @@
|
|
|
115
173
|
|
|
116
174
|
.syntax-error {
|
|
117
175
|
// 语法错误,高亮样式
|
|
118
|
-
border: @border-width-base @border-style-base @red-5
|
|
176
|
+
border: @border-width-base @border-style-base @red-5 !important;
|
|
119
177
|
box-shadow: none !important;
|
|
178
|
+
|
|
120
179
|
&:hover {
|
|
121
180
|
|
|
122
181
|
// 伪类展示属性值
|
|
@@ -137,4 +196,15 @@
|
|
|
137
196
|
min-width: 100px;
|
|
138
197
|
}
|
|
139
198
|
}
|
|
199
|
+
&:hover {
|
|
200
|
+
.tag-box-item-close {
|
|
201
|
+
border-color: @red-5 !important;
|
|
202
|
+
&:hover {
|
|
203
|
+
&::before,
|
|
204
|
+
&::after {
|
|
205
|
+
background: @red-5 !important;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
140
210
|
}
|
|
@@ -75,22 +75,41 @@ export var checkSyntax = function checkSyntax(value) {
|
|
|
75
75
|
});
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
// 以空格分隔内容,但是不包括()内和NOT
|
|
78
|
+
// 以空格分隔内容,但是不包括()内和NOT后的空格和双引号内的空格
|
|
79
79
|
var splitBySpace = function splitBySpace(str) {
|
|
80
80
|
var res = [];
|
|
81
81
|
var temp = "";
|
|
82
|
-
var isBracket = false;
|
|
82
|
+
var isBracket = false; // 括号内不分割
|
|
83
|
+
var isQuote = false; // 引号内不分割
|
|
84
|
+
var isSquareBracket = false; // 方括号内不分割
|
|
85
|
+
var isOpenBracket = false; // 花括号内不分割
|
|
86
|
+
|
|
83
87
|
for (var i = 0; i < str.length; i++) {
|
|
84
88
|
var _char = str[i];
|
|
85
89
|
// 检测当前字符与前面的字符拼接是否为 "NOT "
|
|
86
90
|
var isNot = "".concat(temp).concat(_char).toUpperCase() === "NOT ";
|
|
91
|
+
if (['"'].includes(_char)) {
|
|
92
|
+
isQuote = !isQuote;
|
|
93
|
+
}
|
|
94
|
+
if (["["].includes(_char)) {
|
|
95
|
+
isSquareBracket = true;
|
|
96
|
+
}
|
|
97
|
+
if (["]"].includes(_char)) {
|
|
98
|
+
isSquareBracket = false;
|
|
99
|
+
}
|
|
100
|
+
if (["{"].includes(_char)) {
|
|
101
|
+
isOpenBracket = true;
|
|
102
|
+
}
|
|
103
|
+
if (["}"].includes(_char)) {
|
|
104
|
+
isOpenBracket = false;
|
|
105
|
+
}
|
|
87
106
|
if (["("].includes(_char)) {
|
|
88
107
|
isBracket = true;
|
|
89
108
|
}
|
|
90
109
|
if ([")"].includes(_char)) {
|
|
91
110
|
isBracket = false;
|
|
92
111
|
}
|
|
93
|
-
if (_char === " " && !isBracket && !isNot) {
|
|
112
|
+
if (_char === " " && !isBracket && !isNot && !isQuote && !isSquareBracket && !isOpenBracket) {
|
|
94
113
|
res.push(temp);
|
|
95
114
|
// '1 2 3 4' ==> ['1', ' ', '3', ' ', '4']
|
|
96
115
|
res.push(" ");
|
|
@@ -190,7 +209,7 @@ export var genHtmlAndSyntaxCheckResByString = function genHtmlAndSyntaxCheckResB
|
|
|
190
209
|
if (!html.trim()) {
|
|
191
210
|
return html;
|
|
192
211
|
}
|
|
193
|
-
return "<span class=\"tag-box\" data-attr=\"tag-box\" id=\"".concat(tagId, "\">").concat(html, "
|
|
212
|
+
return "<span class=\"tag-box\" data-attr=\"tag-box\" id=\"".concat(tagId, "\">").concat(html, "<span class=\"tag-box-item-close\" contenteditable=\"false\"></span></span>");
|
|
194
213
|
}).join("");
|
|
195
214
|
return htmlString;
|
|
196
215
|
};
|
|
@@ -361,4 +380,13 @@ export function isObjectEqual(obj1, obj2) {
|
|
|
361
380
|
}
|
|
362
381
|
}
|
|
363
382
|
return true;
|
|
364
|
-
}
|
|
383
|
+
}
|
|
384
|
+
// 将节点克隆并将标签里面所有的关闭按钮节点移出
|
|
385
|
+
export var cloneDomRemoveCloseBtn = function cloneDomRemoveCloseBtn(node) {
|
|
386
|
+
var cloneNode = node.cloneNode(true);
|
|
387
|
+
var closeBtns = cloneNode.querySelectorAll(".tag-box-item-close");
|
|
388
|
+
closeBtns.forEach(function (item) {
|
|
389
|
+
item.remove();
|
|
390
|
+
});
|
|
391
|
+
return cloneNode;
|
|
392
|
+
};
|
|
@@ -3,6 +3,11 @@ import "antd/es/modal/style";
|
|
|
3
3
|
import _Modal from "antd/es/modal";
|
|
4
4
|
import "antd/es/upload/style";
|
|
5
5
|
import _Upload from "antd/es/upload";
|
|
6
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
7
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8
|
+
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; }
|
|
9
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
10
|
+
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); }
|
|
6
11
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
7
12
|
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); } }
|
|
8
13
|
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); }); }; }
|
|
@@ -67,7 +72,12 @@ var DoImage = function DoImage(_ref) {
|
|
|
67
72
|
className: "ci-detail-image"
|
|
68
73
|
}, /*#__PURE__*/React.createElement(_Upload, {
|
|
69
74
|
listType: "picture-card",
|
|
70
|
-
fileList: list ||
|
|
75
|
+
fileList: (list === null || list === void 0 ? void 0 : list.map(function (v) {
|
|
76
|
+
var arr = v.url.split('.');
|
|
77
|
+
return _objectSpread(_objectSpread({}, v), {}, {
|
|
78
|
+
type: "image/" + arr[arr.length - 1]
|
|
79
|
+
});
|
|
80
|
+
})) || [],
|
|
71
81
|
onPreview: handlePreview,
|
|
72
82
|
showUploadList: {
|
|
73
83
|
showRemoveIcon: false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chaoswise/business",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "业务组件库",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ui",
|
|
@@ -72,11 +72,12 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@chaoswise/intl": "^1.2.2",
|
|
75
|
-
"@chaoswise/request": "^1.0.6",
|
|
76
|
-
"@chaoswise/ui": "^2.3.17",
|
|
77
75
|
"antlr4": "4.9.2",
|
|
78
76
|
"react-copy-to-clipboard": "^5.1.0"
|
|
79
77
|
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"@chaoswise/ui": ">=2.0.0"
|
|
80
|
+
},
|
|
80
81
|
"author": "cloudwiser",
|
|
81
82
|
"homepage": "",
|
|
82
83
|
"main": "lib/index.js",
|
|
@@ -105,5 +106,5 @@
|
|
|
105
106
|
"access": "public"
|
|
106
107
|
},
|
|
107
108
|
"license": "MIT",
|
|
108
|
-
"gitHead": "
|
|
109
|
+
"gitHead": "a7e3496c6e269a7d920121fafaac8ed4fc38d50c"
|
|
109
110
|
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="12px" height="12px" viewBox="0 0 12 12" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<title>Icon/Fill/Close-Circle-Fill</title>
|
|
4
|
-
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
-
<g id="聚合搜索框" transform="translate(-1278.000000, -2867.000000)">
|
|
6
|
-
<rect fill="#FFFFFF" x="0" y="0" width="1920" height="3346"></rect>
|
|
7
|
-
<g id="7" opacity="0.800000012" transform="translate(120.000000, 2665.000000)">
|
|
8
|
-
<g id="搜索框备份-2" transform="translate(0.000000, 194.000000)">
|
|
9
|
-
<path d="M1214.00697,0.5 C1214.41913,0.5 1214.7922,0.667699564 1215.06223,0.938862019 C1215.33288,1.21063804 1215.5,1.58624721 1215.5,2.00138927 L1215.5,2.00138927 L1215.5,45.9986107 C1215.5,46.4131621 1215.33227,46.7885021 1215.0616,47.0603047 C1214.79133,47.3317133 1214.41826,47.5 1214.00697,47.5 L1214.00697,47.5 L1.99303181,47.5 C1.58086837,47.5 1.20779551,47.3323004 0.937765379,47.061138 C0.667124252,46.789362 0.5,46.4137528 0.5,45.9986107 L0.5,45.9986107 L0.5,2.00138927 C0.5,1.58683787 0.667729281,1.2114979 0.938396858,0.939695326 C1.20867209,0.668286734 1.58174111,0.5 1.99303181,0.5 L1.99303181,0.5 L1214.00697,0.5 Z" id="Rectangle-26-Copy-23备份" stroke="#FF4D4F" fill="#FFFFFF"></path>
|
|
10
|
-
<g id="Icon/Fill/Close-Circle-Fill" transform="translate(1158.000000, 8.000000)" fill="#000000">
|
|
11
|
-
<rect id="矩形" fill-rule="nonzero" opacity="0" x="0" y="0" width="12" height="12"></rect>
|
|
12
|
-
<path d="M6,0.75 C3.10078125,0.75 0.75,3.10078125 0.75,6 C0.75,8.89921875 3.10078125,11.25 6,11.25 C8.89921875,11.25 11.25,8.89921875 11.25,6 C11.25,3.10078125 8.89921875,0.75 6,0.75 Z M7.93828125,7.99453125 L7.16484375,7.99101563 L6,6.60234375 L4.83632812,7.98984375 L4.06171875,7.99335937 C4.01015625,7.99335937 3.96796875,7.95234375 3.96796875,7.89960937 C3.96796875,7.87734375 3.97617188,7.85625 3.99023438,7.83867187 L5.51484375,6.02226562 L3.99023438,4.20703125 C3.97617188,4.18945312 3.96796875,4.16835937 3.96796875,4.14609375 C3.96796875,4.09453125 4.01015625,4.05234375 4.06171875,4.05234375 L4.83632813,4.05585938 L6,5.44453125 L7.16367187,4.05703125 L7.93710937,4.05351563 C7.98867187,4.05351563 8.03085937,4.09453125 8.03085937,4.14726563 C8.03085937,4.16953125 8.02265625,4.190625 8.00859375,4.20820313 L6.48632812,6.0234375 L8.00976562,7.83984375 C8.02382813,7.85742188 8.03203125,7.87851562 8.03203125,7.90078125 C8.03203125,7.95234375 7.98984375,7.99453125 7.93828125,7.99453125 Z" id="形状" fill-opacity="0.25"></path>
|
|
13
|
-
</g>
|
|
14
|
-
</g>
|
|
15
|
-
</g>
|
|
16
|
-
</g>
|
|
17
|
-
</g>
|
|
18
|
-
</svg>
|