@para-ui/core 3.0.28 → 3.0.30
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/AutoBox/index.js +48 -88
- package/AutoTips/index.js +25 -32
- package/Breadcrumbs/index.js +43 -63
- package/Button/SplitButton.d.ts +1 -1
- package/Button/index.d.ts +1 -1
- package/Button/index.js +88 -118
- package/ButtonGroup/index.js +27 -36
- package/Carousel/index.d.ts +2 -2
- package/Carousel/index.js +27 -28
- package/Cascader/index.js +52 -64
- package/Checkbox/index.js +23 -39
- package/CheckboxGroup/index.js +31 -48
- package/Collapse/collapsePanel.d.ts +1 -1
- package/Collapse/index.d.ts +1 -1
- package/Collapse/index.js +9 -29
- package/Collapse/util.d.ts +2 -2
- package/CollapseBox/index.js +45 -56
- package/CollapseLayout/index.js +35 -54
- package/ComboSelect/index.js +222 -349
- package/ComboSelect/interface.d.ts +3 -3
- package/Container/index.js +17 -20
- package/DatePicker/generatePicker/index.d.ts +17 -17
- package/DatePicker/index.d.ts +4 -4
- package/DatePicker/index.js +111 -167
- package/Desktop/index.js +62 -173
- package/Drawer/index.js +65 -58
- package/Drawer/interface.d.ts +7 -3
- package/Dropdown/index.d.ts +1 -1
- package/Dropdown/index.js +3 -3
- package/Empty/index.js +17 -22
- package/Form/index.d.ts +1 -1
- package/Form/index.js +38 -80
- package/FormItem/index.d.ts +1 -1
- package/FormItem/index.js +11 -11
- package/FormItem/validateFunction.d.ts +1 -1
- package/FunctionModal/index.js +11 -11
- package/GlobalContext/index.js +3 -3
- package/GlobalContext/usePopupContainer.d.ts +1 -1
- package/Help/index.js +11 -11
- package/HelperText/index.js +11 -12
- package/InputLang/index.js +47 -80
- package/InputNumber/index.js +65 -100
- package/Label/index.js +15 -16
- package/Loading/index.js +6 -7
- package/Menu/index.js +148 -328
- package/Menu/interface.d.ts +2 -2
- package/Menu/verticalMenuList.d.ts +1 -1
- package/Message/index.d.ts +1 -1
- package/Message/index.js +45 -64
- package/Modal/Confirm/index.d.ts +2 -2
- package/Modal/index.d.ts +1 -1
- package/Modal/index.js +119 -152
- package/MultiBox/index.js +44 -76
- package/Notification/index.d.ts +2 -2
- package/Notification/index.js +51 -72
- package/OperateBtn/index.js +42 -70
- package/PageHeader/index.js +120 -286
- package/PageHeader/interface.d.ts +1 -1
- package/Pagination/index.d.ts +2 -2
- package/Pagination/index.js +79 -131
- package/ParauiProvider/index.js +2 -3
- package/PasswordRules/index.js +12 -30
- package/PopConfirm/index.d.ts +1 -1
- package/PopConfirm/index.js +52 -59
- package/Popover/index.js +8 -9
- package/Progress/index.d.ts +6 -6
- package/Progress/index.js +50 -89
- package/Querying/index.js +14 -17
- package/README.md +813 -800
- package/Radio/index.js +21 -33
- package/RadioGroup/index.js +32 -47
- package/Search/index.js +44 -66
- package/Select/index.js +176 -343
- package/SelectInput/index.js +8 -9
- package/Selector/index.js +285 -681
- package/SelectorPicker/index.js +62 -97
- package/SingleBox/index.js +30 -55
- package/Slider/index.d.ts +1 -1
- package/Slider/index.js +29 -41
- package/Slider/interface.d.ts +2 -2
- package/Split/index.js +10 -23
- package/Status/index.js +8 -7
- package/Stepper/index.d.ts +1 -1
- package/Stepper/index.js +20 -25
- package/Styles/form.scss +5 -5
- package/Styles/index.scss +37 -37
- package/Styles/normalize.scss +348 -348
- package/Styles/scrollbar.scss +223 -223
- package/Styles/theme.scss +74 -74
- package/Switch/index.d.ts +2 -2
- package/Switch/index.js +19 -20
- package/Table/index.js +568 -1019
- package/Table/interface.d.ts +5 -5
- package/Tabs/index.d.ts +3 -3
- package/Tabs/index.js +47 -65
- package/Tag/TagGroup.d.ts +1 -1
- package/Tag/index.d.ts +2 -2
- package/Tag/index.js +72 -107
- package/TextEditor/index.d.ts +2 -2
- package/TextEditor/index.js +81 -105
- package/TextField/index.js +141 -220
- package/TimePicker/index.d.ts +1 -1
- package/TimePicker/index.js +12 -15
- package/Timeline/index.js +42 -52
- package/Title/index.js +10 -9
- package/ToggleButton/ToggleButtonGroup.d.ts +1 -1
- package/ToggleButton/index.js +50 -70
- package/Tooltip/index.js +64 -98
- package/Tooltip/interface.d.ts +1 -1
- package/Transfer/index.d.ts +1 -1
- package/Transfer/index.js +114 -137
- package/Transfer/useClick.d.ts +1 -1
- package/Tree/index.js +10 -10
- package/Tree/interface.d.ts +6 -6
- package/Upload/Dragger/index.d.ts +1 -1
- package/Upload/ImageUpload/index.d.ts +1 -1
- package/Upload/ImgCrop/EasyCrop.d.ts +1 -1
- package/Upload/index.d.ts +1 -1
- package/Upload/index.js +283 -475
- package/Upload/interface.d.ts +2 -2
- package/_verture/{constant-bf34e6fa.js → constant-66aa48a1.js} +0 -1
- package/_verture/defineProperty-62acccfc.js +34 -0
- package/_verture/{index-342379c6.js → index-06fea29b.js} +79 -124
- package/_verture/{index-48875ffd.js → index-131f8fe5.js} +80 -181
- package/_verture/{index-31ce5a11.js → index-92144ad3.js} +238 -445
- package/_verture/{index-bbed73a3.js → index-be4faaee.js} +19 -61
- package/_verture/{intl-336570e4.js → intl-5cbb940c.js} +4 -12
- package/_verture/{modalContext-d646d9db.js → modalContext-c749e1c6.js} +18 -43
- package/_verture/{slicedToArray-d7722f4b.js → slicedToArray-77980792.js} +23 -25
- package/_verture/{toConsumableArray-f8047a75.js → toConsumableArray-87c7d895.js} +1 -1
- package/_verture/{useFormatMessage-f4452258.js → useFormatMessage-703f8b20.js} +1 -3
- package/_verture/{useGlobalProps-af9a2af6.js → useGlobalProps-1b846a65.js} +1 -2
- package/_verture/{usePopupContainer-b8ab7cab.js → usePopupContainer-87febeb9.js} +10 -25
- package/_verture/{util-a77b261e.js → util-7e1fb1e2.js} +2 -3
- package/index.d.ts +2 -4
- package/index.js +15 -16
- package/package.json +167 -168
- package/Test/index.d.ts +0 -3
- package/Test/index.js +0 -9
- package/_verture/defineProperty-0590dc61.js +0 -16
package/Tag/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { _ as _defineProperty } from '../_verture/defineProperty-
|
|
2
|
-
import { _ as _slicedToArray } from '../_verture/slicedToArray-
|
|
1
|
+
import { _ as _defineProperty } from '../_verture/defineProperty-62acccfc.js';
|
|
2
|
+
import { _ as _slicedToArray } from '../_verture/slicedToArray-77980792.js';
|
|
3
3
|
import { _ as __rest } from '../_verture/tslib.es6-55ed4bd2.js';
|
|
4
4
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
5
5
|
import { useState, useRef, useEffect } from 'react';
|
|
6
6
|
import CloseIcon from '@para-ui/icons/Close';
|
|
7
7
|
import clsx from 'clsx';
|
|
8
|
-
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-
|
|
8
|
+
import { _ as _toConsumableArray } from '../_verture/toConsumableArray-87c7d895.js';
|
|
9
9
|
import { _ as _typeof } from '../_verture/typeof-498dd2b1.js';
|
|
10
|
-
import { $ as $prefixCls } from '../_verture/constant-
|
|
10
|
+
import { $ as $prefixCls } from '../_verture/constant-66aa48a1.js';
|
|
11
11
|
import AutoTips from '../AutoTips/index.js';
|
|
12
12
|
import { s as styleInject } from '../_verture/style-inject.es-300983ab.js';
|
|
13
13
|
import Plus from '@para-ui/icons/Plus';
|
|
@@ -18,47 +18,39 @@ import 'rc-tooltip/lib/placements';
|
|
|
18
18
|
var css_248z = "@charset \"UTF-8\";\n/**\n* @author Hanz\n* @date 2022/1/12 上午9:43\n* @description\n*/\n/**\n* @author Hanz\n* @date 2021/10/20 下午2:08\n* @description color\n*/\n.paraui-v3-tag {\n display: inline-flex;\n justify-content: center;\n align-items: center;\n max-width: 100%;\n height: 24px;\n margin: 0 8px 8px 0;\n padding: 0 12px;\n font-size: 12px;\n color: rgb(46, 55, 67);\n white-space: nowrap;\n background: rgba(171, 176, 185, 0.2);\n border-radius: 4px;\n /*&.paraui-v3-tag-small {\n line-height: 24px;\n\n &.paraui-v3-tag-bordered {\n line-height: 22px;\n }\n }*/\n}\n.paraui-v3-tag.paraui-v3-tag-bordered {\n border: 1px solid rgba(171, 176, 185, 0.2);\n line-height: 22px;\n}\n.paraui-v3-tag.paraui-v3-tag-large {\n line-height: 28px;\n}\n.paraui-v3-tag.paraui-v3-tag-large.paraui-v3-tag-bordered {\n line-height: 26px;\n}\n.paraui-v3-tag > svg {\n color: inherit;\n font-size: 16px;\n}\n.paraui-v3-tag .tag-close-icon {\n margin-left: 4px;\n color: inherit;\n font-size: 16px;\n cursor: pointer;\n}\n.paraui-v3-tag .tag-close-icon:hover {\n color: inherit;\n}\n.paraui-v3-tag > svg + .paraui-v3-auto-tips {\n margin-left: 4px;\n}\n.paraui-v3-tag.paraui-v3-tag-has-color, .paraui-v3-tag.paraui-v3-tag-has-color svg, .paraui-v3-tag.paraui-v3-tag-has-color svg:hover {\n color: inherit;\n}\n.paraui-v3-tag.paraui-v3-tag-blue {\n color: rgb(54, 102, 214);\n background-color: rgba(54, 102, 214, 0.05);\n}\n.paraui-v3-tag.paraui-v3-tag-green {\n color: rgb(83, 195, 27);\n background-color: rgba(83, 195, 27, 0.05);\n}\n.paraui-v3-tag.paraui-v3-tag-yellow {\n color: rgb(255, 161, 80);\n background-color: rgba(255, 161, 80, 0.05);\n}\n.paraui-v3-tag.paraui-v3-tag-red {\n color: rgb(235, 96, 84);\n background-color: rgba(235, 96, 84, 0.05);\n}\n.paraui-v3-tag.paraui-v3-tag-hidden {\n display: none;\n}\n\n.paraui-v3-tag-group {\n display: flex;\n align-items: center;\n flex-flow: row wrap;\n}\n.paraui-v3-tag-group .tag-group-input {\n width: 78px;\n height: 24px;\n align-self: flex-start;\n font-size: 12px;\n color: rgb(46, 55, 67);\n text-indent: 8px;\n border: 1px solid rgba(171, 176, 185, 0.4);\n border-radius: 4px;\n}\n.paraui-v3-tag-group .tag-group-input .tag-group-input-large {\n height: 28px;\n}\n.paraui-v3-tag-group .tag-group-new .tag-group-new-icon {\n padding: 0 5px;\n}";
|
|
19
19
|
styleInject(css_248z);
|
|
20
20
|
|
|
21
|
+
//tag group
|
|
21
22
|
var TagGroup = function TagGroup(props) {
|
|
22
23
|
var className = props.className,
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
_props$size = props.size,
|
|
25
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
26
|
+
style = props.style,
|
|
27
|
+
_props$bordered = props.bordered,
|
|
28
|
+
bordered = _props$bordered === void 0 ? false : _props$bordered,
|
|
29
|
+
defaultInputValue = props.defaultInputValue,
|
|
30
|
+
_props$increased = props.increased,
|
|
31
|
+
increased = _props$increased === void 0 ? false : _props$increased,
|
|
32
|
+
increasedTag = props.increasedTag,
|
|
33
|
+
onChange = props.onChange;
|
|
34
34
|
var _useState = useState([]),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
35
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
36
|
+
inData = _useState2[0],
|
|
37
|
+
setInData = _useState2[1]; //数据源
|
|
40
38
|
var _useState3 = useState(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : ''),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
|
+
inputValue = _useState4[0],
|
|
41
|
+
setInputValue = _useState4[1]; //input value
|
|
46
42
|
var _useState5 = useState(false),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
43
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
44
|
+
inputVisible = _useState6[0],
|
|
45
|
+
setInputVisible = _useState6[1]; //input visible
|
|
52
46
|
var inputRef = useRef(); //input ref
|
|
53
|
-
|
|
54
47
|
useEffect(function () {
|
|
55
48
|
if (props.data) {
|
|
56
|
-
var tArr = props.data;
|
|
57
|
-
|
|
49
|
+
var tArr = props.data;
|
|
50
|
+
//Item[]
|
|
58
51
|
var unObjType = tArr.some(function (v) {
|
|
59
52
|
return ['string', 'number'].includes(_typeof(v));
|
|
60
53
|
});
|
|
61
|
-
|
|
62
54
|
if (unObjType) {
|
|
63
55
|
tArr = tArr.map(function (_) {
|
|
64
56
|
return {
|
|
@@ -67,36 +59,30 @@ var TagGroup = function TagGroup(props) {
|
|
|
67
59
|
};
|
|
68
60
|
});
|
|
69
61
|
}
|
|
70
|
-
|
|
71
62
|
setInData(_toConsumableArray(tArr));
|
|
72
63
|
}
|
|
73
|
-
}, [props.data]);
|
|
74
|
-
|
|
64
|
+
}, [props.data]);
|
|
65
|
+
//tag value
|
|
75
66
|
var getTagGroupVal = function getTagGroupVal(data) {
|
|
76
67
|
return data.map(function (_) {
|
|
77
68
|
return _.value;
|
|
78
69
|
});
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
|
|
70
|
+
};
|
|
71
|
+
//show input
|
|
82
72
|
var showInput = function showInput() {
|
|
83
73
|
setInputVisible(true);
|
|
84
74
|
setTimeout(function () {
|
|
85
75
|
var _a;
|
|
86
|
-
|
|
87
76
|
(_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
88
77
|
});
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
};
|
|
79
|
+
//input change
|
|
92
80
|
var handleInputChange = function handleInputChange(e) {
|
|
93
81
|
setInputValue(e.target.value);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
|
|
82
|
+
};
|
|
83
|
+
//input confirm
|
|
97
84
|
var handleInputConfirm = function handleInputConfirm() {
|
|
98
85
|
var val = inputValue.trim();
|
|
99
|
-
|
|
100
86
|
if (val !== '') {
|
|
101
87
|
inData.push({
|
|
102
88
|
value: val,
|
|
@@ -106,36 +92,30 @@ var TagGroup = function TagGroup(props) {
|
|
|
106
92
|
setInData(_toConsumableArray(inData));
|
|
107
93
|
onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
|
|
108
94
|
}
|
|
109
|
-
|
|
110
95
|
setInputValue(defaultInputValue !== null && defaultInputValue !== void 0 ? defaultInputValue : '');
|
|
111
96
|
setInputVisible(false);
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
|
|
97
|
+
};
|
|
98
|
+
//input enter
|
|
115
99
|
var handleInputEnter = function handleInputEnter(e) {
|
|
116
100
|
if (e.keyCode === 13 || e.which === 13) {
|
|
117
101
|
handleInputConfirm();
|
|
118
102
|
}
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
|
|
103
|
+
};
|
|
104
|
+
//handle close
|
|
122
105
|
var handleClose = function handleClose(item) {
|
|
123
106
|
return function (e) {
|
|
124
107
|
var idx = inData.findIndex(function (_) {
|
|
125
108
|
return _.value === item.value;
|
|
126
109
|
});
|
|
127
|
-
|
|
128
110
|
if (idx > -1) {
|
|
129
111
|
inData.splice(idx, 1);
|
|
130
112
|
setInData(_toConsumableArray(inData));
|
|
131
113
|
}
|
|
132
|
-
|
|
133
114
|
if (item.onClose) item.onClose(e);
|
|
134
115
|
onChange === null || onChange === void 0 ? void 0 : onChange(inData, getTagGroupVal(inData));
|
|
135
116
|
};
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
|
|
117
|
+
};
|
|
118
|
+
//渲染Tag组
|
|
139
119
|
var renderTagGroup = function renderTagGroup() {
|
|
140
120
|
if (!(inData === null || inData === void 0 ? void 0 : inData.length)) return null;
|
|
141
121
|
return inData.map(function (item, idx) {
|
|
@@ -148,12 +128,10 @@ var TagGroup = function TagGroup(props) {
|
|
|
148
128
|
children: item.label
|
|
149
129
|
}), idx);
|
|
150
130
|
});
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
|
|
131
|
+
};
|
|
132
|
+
//动态增加tag
|
|
154
133
|
var renderNewInput = function renderNewInput() {
|
|
155
134
|
var _a;
|
|
156
|
-
|
|
157
135
|
if (inputVisible) {
|
|
158
136
|
var inputCls = clsx('tag-group-input', {
|
|
159
137
|
'tag-group-input-large': size === 'large'
|
|
@@ -168,16 +146,12 @@ var TagGroup = function TagGroup(props) {
|
|
|
168
146
|
onKeyDown: handleInputEnter
|
|
169
147
|
});
|
|
170
148
|
}
|
|
171
|
-
|
|
172
149
|
var icon = jsx(Plus, {});
|
|
173
|
-
|
|
174
150
|
var text = 'New Tag';
|
|
175
|
-
|
|
176
151
|
if (increasedTag) {
|
|
177
152
|
icon = increasedTag.icon || jsx(Plus, {});
|
|
178
153
|
text = (_a = increasedTag.text) !== null && _a !== void 0 ? _a : 'New Tag';
|
|
179
154
|
}
|
|
180
|
-
|
|
181
155
|
var newCls = clsx('tag-group-new', {
|
|
182
156
|
'tag-group-new-icon': !text
|
|
183
157
|
});
|
|
@@ -191,7 +165,6 @@ var TagGroup = function TagGroup(props) {
|
|
|
191
165
|
children: text
|
|
192
166
|
}));
|
|
193
167
|
};
|
|
194
|
-
|
|
195
168
|
return jsxs("div", Object.assign({
|
|
196
169
|
className: clsx("".concat($prefixCls, "-tag-group"), className),
|
|
197
170
|
style: style
|
|
@@ -200,65 +173,58 @@ var TagGroup = function TagGroup(props) {
|
|
|
200
173
|
}));
|
|
201
174
|
};
|
|
202
175
|
|
|
203
|
-
|
|
204
|
-
|
|
176
|
+
//预设颜色列表
|
|
177
|
+
var PresetColors = ['blue', 'green', 'yellow', 'red'];
|
|
178
|
+
//tag
|
|
205
179
|
var InternalTag = function InternalTag(props) {
|
|
206
180
|
var _clsx;
|
|
207
|
-
|
|
208
181
|
var className = props.className,
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
182
|
+
children = props.children,
|
|
183
|
+
icon = props.icon,
|
|
184
|
+
color = props.color,
|
|
185
|
+
onClose = props.onClose,
|
|
186
|
+
closeIcon = props.closeIcon,
|
|
187
|
+
_props$closable = props.closable,
|
|
188
|
+
closable = _props$closable === void 0 ? false : _props$closable,
|
|
189
|
+
_props$bordered = props.bordered,
|
|
190
|
+
bordered = _props$bordered === void 0 ? false : _props$bordered,
|
|
191
|
+
_props$size = props.size,
|
|
192
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
193
|
+
style = props.style,
|
|
194
|
+
visibleTag = props.visible,
|
|
195
|
+
restProps = __rest(props, ["className", "children", "icon", "color", "onClose", "closeIcon", "closable", "bordered", "size", "style", "visible"]);
|
|
224
196
|
var _useState = useState(true),
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
197
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
198
|
+
visible = _useState2[0],
|
|
199
|
+
setVisible = _useState2[1]; //显示tag
|
|
230
200
|
useEffect(function () {
|
|
231
201
|
if ('visible' in props) {
|
|
232
202
|
setVisible(!!visibleTag);
|
|
233
203
|
}
|
|
234
|
-
}, [visibleTag]);
|
|
235
|
-
|
|
204
|
+
}, [visibleTag]);
|
|
205
|
+
//是否预设颜色
|
|
236
206
|
var isPresetColor = function isPresetColor() {
|
|
237
207
|
if (!color) return false;
|
|
238
208
|
return PresetColors.includes(color);
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
|
|
209
|
+
};
|
|
210
|
+
//tag style
|
|
242
211
|
var tagStyle = Object.assign({
|
|
243
212
|
color: color && !isPresetColor() ? color : undefined
|
|
244
|
-
}, style);
|
|
245
|
-
|
|
246
|
-
var tagClassName = clsx("".concat($prefixCls, "-tag"), className, (_clsx = {}, _defineProperty(_clsx, "".concat($prefixCls, "-tag-has-color"), color), _defineProperty(_clsx, "".concat($prefixCls, "-tag-hidden"), !visible), _defineProperty(_clsx, "".concat($prefixCls, "-tag-bordered"), bordered), _defineProperty(_clsx, "".concat($prefixCls, "-tag-large"), size === 'large'), _defineProperty(_clsx, "".concat($prefixCls, "-tag-").concat(color), isPresetColor()), _clsx));
|
|
247
|
-
|
|
213
|
+
}, style);
|
|
214
|
+
//tag cls
|
|
215
|
+
var tagClassName = clsx("".concat($prefixCls, "-tag"), className, (_clsx = {}, _defineProperty(_clsx, "".concat($prefixCls, "-tag-has-color"), color), _defineProperty(_clsx, "".concat($prefixCls, "-tag-hidden"), !visible), _defineProperty(_clsx, "".concat($prefixCls, "-tag-bordered"), bordered), _defineProperty(_clsx, "".concat($prefixCls, "-tag-large"), size === 'large'), _defineProperty(_clsx, "".concat($prefixCls, "-tag-").concat(color), isPresetColor()), _clsx));
|
|
216
|
+
//tag close click
|
|
248
217
|
var handleCloseClick = function handleCloseClick(e) {
|
|
249
218
|
e.stopPropagation();
|
|
250
219
|
onClose === null || onClose === void 0 ? void 0 : onClose(e);
|
|
251
|
-
|
|
252
220
|
if (e.defaultPrevented) {
|
|
253
221
|
return;
|
|
254
222
|
}
|
|
255
|
-
|
|
256
223
|
if (!('visible' in props)) {
|
|
257
224
|
setVisible(false);
|
|
258
225
|
}
|
|
259
|
-
};
|
|
260
|
-
|
|
261
|
-
|
|
226
|
+
};
|
|
227
|
+
//渲染close icon
|
|
262
228
|
var renderCloseIcon = function renderCloseIcon() {
|
|
263
229
|
if (!closable) return null;
|
|
264
230
|
return closeIcon ? jsx("span", Object.assign({
|
|
@@ -271,7 +237,6 @@ var InternalTag = function InternalTag(props) {
|
|
|
271
237
|
onClick: handleCloseClick
|
|
272
238
|
});
|
|
273
239
|
};
|
|
274
|
-
|
|
275
240
|
return jsxs("span", Object.assign({}, restProps, {
|
|
276
241
|
className: tagClassName,
|
|
277
242
|
style: tagStyle
|
package/TextEditor/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { IDomEditor } from '@wangeditor/editor';
|
|
|
9
9
|
import { HelperTextDetailProps } from "../HelperText";
|
|
10
10
|
import './index.scss';
|
|
11
11
|
import '@wangeditor/editor/dist/css/style.css';
|
|
12
|
-
|
|
12
|
+
type InsertFnType = (url: string, alt: string, href: string) => void;
|
|
13
13
|
export interface IMenuGroup {
|
|
14
14
|
key: string;
|
|
15
15
|
title: string;
|
|
@@ -35,7 +35,7 @@ export interface UpLoadImgConfig {
|
|
|
35
35
|
customUpload: (file: File, insertFn: InsertFnType) => void;
|
|
36
36
|
customInsert: (res: any, insertFn: InsertFnType) => void;
|
|
37
37
|
}
|
|
38
|
-
export
|
|
38
|
+
export type UpLoadVideoConfig = Omit<UpLoadImgConfig, 'base64LimitSize'>;
|
|
39
39
|
export interface TextEditorProps extends HelperTextDetailProps {
|
|
40
40
|
/** 样式class */
|
|
41
41
|
className?: string;
|