@douyinfe/semi-ui 2.43.2 → 2.44.0-beta.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/dist/css/semi.css +8 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +26957 -26900
- package/dist/umd/semi-ui.js.map +1 -1
- package/dist/umd/semi-ui.min.js +1 -1
- package/dist/umd/semi-ui.min.js.map +1 -1
- package/lib/cjs/calendar/monthCalendar.js +1 -5
- package/lib/cjs/cascader/index.js +4 -2
- package/lib/cjs/cascader/item.d.ts +5 -1
- package/lib/cjs/cascader/item.js +92 -55
- package/lib/cjs/cascader/virtualRow.d.ts +8 -0
- package/lib/cjs/cascader/virtualRow.js +21 -0
- package/lib/cjs/tag/index.d.ts +2 -0
- package/lib/cjs/tag/index.js +15 -5
- package/lib/cjs/tag/interface.d.ts +3 -1
- package/lib/cjs/tooltip/index.js +5 -3
- package/lib/es/calendar/monthCalendar.js +1 -5
- package/lib/es/cascader/index.js +4 -2
- package/lib/es/cascader/item.d.ts +5 -1
- package/lib/es/cascader/item.js +92 -55
- package/lib/es/cascader/virtualRow.d.ts +8 -0
- package/lib/es/cascader/virtualRow.js +14 -0
- package/lib/es/tag/index.d.ts +2 -0
- package/lib/es/tag/index.js +15 -5
- package/lib/es/tag/interface.d.ts +3 -1
- package/lib/es/tooltip/index.js +5 -3
- package/package.json +8 -8
package/lib/es/tag/index.js
CHANGED
|
@@ -111,9 +111,11 @@ export default class Tag extends Component {
|
|
|
111
111
|
shape,
|
|
112
112
|
avatarSrc,
|
|
113
113
|
avatarShape,
|
|
114
|
-
tabIndex
|
|
114
|
+
tabIndex,
|
|
115
|
+
prefixIcon,
|
|
116
|
+
suffixIcon
|
|
115
117
|
} = _a,
|
|
116
|
-
attr = __rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "shape", "avatarSrc", "avatarShape", "tabIndex"]);
|
|
118
|
+
attr = __rest(_a, ["tagKey", "children", "size", "color", "closable", "visible", "onClose", "onClick", "className", "type", "shape", "avatarSrc", "avatarShape", "tabIndex", "prefixIcon", "suffixIcon"]);
|
|
117
119
|
const {
|
|
118
120
|
visible: isVisible
|
|
119
121
|
} = this.state;
|
|
@@ -154,9 +156,13 @@ export default class Tag extends Component {
|
|
|
154
156
|
const contentCls = cls(`${prefixCls}-content`, `${prefixCls}-content-${stringChild ? 'ellipsis' : 'center'}`);
|
|
155
157
|
return /*#__PURE__*/React.createElement("div", Object.assign({
|
|
156
158
|
"aria-label": this.props['aria-label'] || stringChild ? `${closable ? 'Closable ' : ''}Tag: ${children}` : ''
|
|
157
|
-
}, wrapProps),
|
|
159
|
+
}, wrapProps), prefixIcon ? /*#__PURE__*/React.createElement("div", {
|
|
160
|
+
className: `${prefixCls}-prefix-icon`
|
|
161
|
+
}, prefixIcon) : null, avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/React.createElement("div", {
|
|
158
162
|
className: contentCls
|
|
159
|
-
}, children),
|
|
163
|
+
}, children), suffixIcon ? /*#__PURE__*/React.createElement("div", {
|
|
164
|
+
className: `${prefixCls}-suffix-icon`
|
|
165
|
+
}, suffixIcon) : null, closeIcon);
|
|
160
166
|
}
|
|
161
167
|
}
|
|
162
168
|
Tag.defaultProps = {
|
|
@@ -171,7 +177,9 @@ Tag.defaultProps = {
|
|
|
171
177
|
style: {},
|
|
172
178
|
className: '',
|
|
173
179
|
shape: 'square',
|
|
174
|
-
avatarShape: 'square'
|
|
180
|
+
avatarShape: 'square',
|
|
181
|
+
prefixIcon: null,
|
|
182
|
+
suffixIcon: null
|
|
175
183
|
};
|
|
176
184
|
Tag.propTypes = {
|
|
177
185
|
children: PropTypes.node,
|
|
@@ -183,6 +191,8 @@ Tag.propTypes = {
|
|
|
183
191
|
visible: PropTypes.bool,
|
|
184
192
|
onClose: PropTypes.func,
|
|
185
193
|
onClick: PropTypes.func,
|
|
194
|
+
prefixIcon: PropTypes.node,
|
|
195
|
+
suffixIcon: PropTypes.node,
|
|
186
196
|
style: PropTypes.object,
|
|
187
197
|
className: PropTypes.string,
|
|
188
198
|
avatarSrc: PropTypes.string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { PopoverProps } from '../popover/index';
|
|
3
3
|
export type TagColor = 'amber' | 'blue' | 'cyan' | 'green' | 'grey' | 'indigo' | 'light-blue' | 'light-green' | 'lime' | 'orange' | 'pink' | 'purple' | 'red' | 'teal' | 'violet' | 'yellow' | 'white';
|
|
4
4
|
export type TagType = 'ghost' | 'solid' | 'light';
|
|
@@ -15,6 +15,8 @@ export interface TagProps {
|
|
|
15
15
|
visible?: boolean;
|
|
16
16
|
onClose?: (tagChildren: React.ReactNode, event: React.MouseEvent<HTMLElement>, tagKey: string | number) => void;
|
|
17
17
|
onClick?: React.MouseEventHandler<HTMLDivElement>;
|
|
18
|
+
prefixIcon?: React.ReactNode;
|
|
19
|
+
suffixIcon?: React.ReactNode;
|
|
18
20
|
style?: React.CSSProperties;
|
|
19
21
|
className?: string;
|
|
20
22
|
avatarSrc?: string;
|
package/lib/es/tooltip/index.js
CHANGED
|
@@ -230,9 +230,11 @@ export default class Tooltip extends BaseComponent {
|
|
|
230
230
|
} = this.props;
|
|
231
231
|
const display = _get(elem, 'props.style.display');
|
|
232
232
|
const block = _get(elem, 'props.block');
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
233
|
+
const isStringElem = typeof elem == 'string';
|
|
234
|
+
const style = {};
|
|
235
|
+
if (!isStringElem) {
|
|
236
|
+
style.display = 'inline-block';
|
|
237
|
+
}
|
|
236
238
|
if (block || blockDisplays.includes(display)) {
|
|
237
239
|
style.width = '100%';
|
|
238
240
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@douyinfe/semi-ui",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.44.0-beta.0",
|
|
4
4
|
"description": "A modern, comprehensive, flexible design system and UI library. Connect DesignOps & DevOps. Quickly build beautiful React apps. Maintained by Douyin-fe team.",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es/index.js",
|
|
@@ -20,12 +20,12 @@
|
|
|
20
20
|
"@dnd-kit/core": "^6.0.8",
|
|
21
21
|
"@dnd-kit/sortable": "^7.0.2",
|
|
22
22
|
"@dnd-kit/utilities": "^3.2.1",
|
|
23
|
-
"@douyinfe/semi-animation": "2.
|
|
24
|
-
"@douyinfe/semi-animation-react": "2.
|
|
25
|
-
"@douyinfe/semi-foundation": "2.
|
|
26
|
-
"@douyinfe/semi-icons": "2.
|
|
27
|
-
"@douyinfe/semi-illustrations": "2.
|
|
28
|
-
"@douyinfe/semi-theme-default": "2.
|
|
23
|
+
"@douyinfe/semi-animation": "2.44.0-beta.0",
|
|
24
|
+
"@douyinfe/semi-animation-react": "2.44.0-beta.0",
|
|
25
|
+
"@douyinfe/semi-foundation": "2.44.0-beta.0",
|
|
26
|
+
"@douyinfe/semi-icons": "2.44.0-beta.0",
|
|
27
|
+
"@douyinfe/semi-illustrations": "2.44.0-beta.0",
|
|
28
|
+
"@douyinfe/semi-theme-default": "2.44.0-beta.0",
|
|
29
29
|
"async-validator": "^3.5.0",
|
|
30
30
|
"classnames": "^2.2.6",
|
|
31
31
|
"copy-text-to-clipboard": "^2.1.1",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
],
|
|
76
76
|
"author": "",
|
|
77
77
|
"license": "MIT",
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "f304407b2f9fb23f8464d59b685ff1f265f6869a",
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@babel/plugin-proposal-decorators": "^7.15.8",
|
|
81
81
|
"@babel/plugin-transform-runtime": "^7.15.8",
|