@douyinfe/semi-ui 2.43.1 → 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.
@@ -51,6 +51,11 @@ export default class Popconfirm extends BaseComponent {
51
51
  });
52
52
  const showTitle = title !== null && typeof title !== 'undefined';
53
53
  const showContent = !(content === null || typeof content === 'undefined');
54
+ const hasIcon = /*#__PURE__*/React.isValidElement(icon);
55
+ const bodyCls = cls({
56
+ [`${prefixCls}-body`]: true,
57
+ [`${prefixCls}-body-withIcon`]: hasIcon
58
+ });
54
59
  return (
55
60
  /*#__PURE__*/
56
61
  /* eslint-disable-next-line jsx-a11y/no-static-element-interactions */
@@ -62,10 +67,10 @@ export default class Popconfirm extends BaseComponent {
62
67
  className: `${prefixCls}-inner`
63
68
  }, /*#__PURE__*/React.createElement("div", {
64
69
  className: `${prefixCls}-header`
65
- }, /*#__PURE__*/React.createElement("i", {
70
+ }, hasIcon ? /*#__PURE__*/React.createElement("i", {
66
71
  className: `${prefixCls}-header-icon`,
67
72
  "x-semi-prop": "icon"
68
- }, /*#__PURE__*/React.isValidElement(icon) ? icon : null), /*#__PURE__*/React.createElement("div", {
73
+ }, icon) : null, /*#__PURE__*/React.createElement("div", {
69
74
  className: `${prefixCls}-header-body`
70
75
  }, showTitle ? /*#__PURE__*/React.createElement("div", {
71
76
  className: `${prefixCls}-header-title`,
@@ -78,7 +83,7 @@ export default class Popconfirm extends BaseComponent {
78
83
  type: cancelType,
79
84
  onClick: this.handleCancel
80
85
  })), showContent ? /*#__PURE__*/React.createElement("div", {
81
- className: `${prefixCls}-body`,
86
+ className: bodyCls,
82
87
  "x-semi-prop": "content"
83
88
  }, _isFunction(content) ? content({
84
89
  initialFocusRef
@@ -95,7 +95,8 @@ function renderDropdown() {
95
95
  dropdownProps.visible = filterDropdownVisible;
96
96
  }
97
97
  return /*#__PURE__*/React.createElement(Dropdown, Object.assign({}, dropdownProps, {
98
- key: `Dropdown_level_${level}`
98
+ key: `Dropdown_level_${level}`,
99
+ className: `${cssClasses.PREFIX}-column-filter-dropdown`
99
100
  }), nestedElem);
100
101
  }
101
102
  export default function ColumnFilter() {
@@ -18,6 +18,8 @@ export default class Tag extends Component<TagProps, TagState> {
18
18
  visible: PropTypes.Requireable<boolean>;
19
19
  onClose: PropTypes.Requireable<(...args: any[]) => any>;
20
20
  onClick: PropTypes.Requireable<(...args: any[]) => any>;
21
+ prefixIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
22
+ suffixIcon: PropTypes.Requireable<PropTypes.ReactNodeLike>;
21
23
  style: PropTypes.Requireable<object>;
22
24
  className: PropTypes.Requireable<string>;
23
25
  avatarSrc: PropTypes.Requireable<string>;
@@ -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), avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/React.createElement("div", {
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), closeIcon);
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
- /// <reference types="react" />
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;
@@ -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 style = {
234
- display: 'inline-block'
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.43.1",
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.43.1",
24
- "@douyinfe/semi-animation-react": "2.43.1",
25
- "@douyinfe/semi-foundation": "2.43.1",
26
- "@douyinfe/semi-icons": "2.43.1",
27
- "@douyinfe/semi-illustrations": "2.43.1",
28
- "@douyinfe/semi-theme-default": "2.43.1",
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": "84abaef26e42768a44ba5db31b9891bf508a314e",
78
+ "gitHead": "f304407b2f9fb23f8464d59b685ff1f265f6869a",
79
79
  "devDependencies": {
80
80
  "@babel/plugin-proposal-decorators": "^7.15.8",
81
81
  "@babel/plugin-transform-runtime": "^7.15.8",