@douyinfe/semi-ui 2.6.0-beta.0 → 2.6.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/button/index.tsx +1 -1
- package/dist/css/semi.css +1 -0
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +27 -12
- 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/button/Button.d.ts +4 -4
- package/lib/cjs/button/buttonGroup.d.ts +2 -2
- package/lib/cjs/button/index.d.ts +5 -6
- package/lib/cjs/iconButton/index.d.ts +2 -2
- package/lib/cjs/navigation/Item.d.ts +2 -2
- package/lib/cjs/navigation/Item.js +8 -6
- package/lib/cjs/navigation/SubNav.js +2 -2
- package/lib/cjs/table/Body/index.d.ts +2 -0
- package/lib/cjs/table/Body/index.js +13 -4
- package/lib/cjs/tooltip/index.js +6 -2
- package/lib/es/button/Button.d.ts +4 -4
- package/lib/es/button/buttonGroup.d.ts +2 -2
- package/lib/es/button/index.d.ts +5 -6
- package/lib/es/iconButton/index.d.ts +2 -2
- package/lib/es/navigation/Item.d.ts +2 -2
- package/lib/es/navigation/Item.js +8 -6
- package/lib/es/navigation/SubNav.js +2 -2
- package/lib/es/table/Body/index.d.ts +2 -0
- package/lib/es/table/Body/index.js +13 -4
- package/lib/es/tooltip/index.js +6 -2
- package/navigation/Item.tsx +15 -12
- package/navigation/SubNav.tsx +4 -4
- package/package.json +9 -9
- package/table/Body/index.tsx +15 -4
- package/table/__test__/table.test.js +18 -0
- package/table/_story/v2/FixedExpandedRow/index.jsx +95 -0
- package/table/_story/v2/index.js +2 -1
- package/tooltip/_story/tooltip.stories.js +702 -625
- package/tooltip/index.tsx +2 -2
package/dist/umd/semi-ui.js
CHANGED
|
@@ -26895,7 +26895,9 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
26895
26895
|
} = _ref;
|
|
26896
26896
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", assign_default()({
|
|
26897
26897
|
className: classnames_default()(className, animateCls),
|
|
26898
|
-
style: assign_default()(assign_default()(assign_default()({
|
|
26898
|
+
style: assign_default()(assign_default()(assign_default()({
|
|
26899
|
+
visibility: 'visible'
|
|
26900
|
+
}, animateStyle), {
|
|
26899
26901
|
transformOrigin
|
|
26900
26902
|
}), style)
|
|
26901
26903
|
}, portalEventSet, animateEvents, {
|
|
@@ -26907,7 +26909,9 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
26907
26909
|
className: className
|
|
26908
26910
|
}, portalEventSet, {
|
|
26909
26911
|
"x-placement": placement,
|
|
26910
|
-
style:
|
|
26912
|
+
style: assign_default()({
|
|
26913
|
+
visibility: motion ? undefined : 'visible'
|
|
26914
|
+
}, style)
|
|
26911
26915
|
}), content, icon);
|
|
26912
26916
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(_portal, {
|
|
26913
26917
|
getPopupContainer: this.props.getPopupContainer,
|
|
@@ -66385,6 +66389,7 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66385
66389
|
var _context3;
|
|
66386
66390
|
|
|
66387
66391
|
let isToggleIcon = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
66392
|
+
let key = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
|
66388
66393
|
|
|
66389
66394
|
if (this.props.isSubNav) {
|
|
66390
66395
|
return null;
|
|
@@ -66405,7 +66410,8 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66405
66410
|
["".concat(Item_clsPrefix, "-icon-info")]: !isToggleIcon
|
|
66406
66411
|
});
|
|
66407
66412
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("i", {
|
|
66408
|
-
className: className
|
|
66413
|
+
className: className,
|
|
66414
|
+
key: key
|
|
66409
66415
|
}, Object(_utils["d" /* isSemiIcon */])(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, {
|
|
66410
66416
|
size: icon.props.size || iconSize
|
|
66411
66417
|
}) : icon);
|
|
@@ -66445,12 +66451,12 @@ class Item_NavItem extends baseComponent_BaseComponent {
|
|
|
66445
66451
|
|
|
66446
66452
|
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66447
66453
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66448
|
-
placeholderIcons = times_default()(iconAmount,
|
|
66454
|
+
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false, index));
|
|
66449
66455
|
}
|
|
66450
66456
|
|
|
66451
|
-
itemChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true), icon || indent || isInSubNav ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT) : null, !isNullOrUndefined(text) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
66457
|
+
itemChildren = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.Fragment, null, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true, 'key-toggle-pos-right'), icon || indent || isInSubNav ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT, false, 'key-position-left') : null, !isNullOrUndefined(text) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
66452
66458
|
className: "".concat(navigation_constants_cssClasses.PREFIX, "-item-text")
|
|
66453
|
-
}, text) : '', this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true));
|
|
66459
|
+
}, text) : '', this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIcon, navigation_constants_strings.ICON_POS_RIGHT, true, 'key-toggle-pos-right'));
|
|
66454
66460
|
}
|
|
66455
66461
|
|
|
66456
66462
|
if (typeof link === 'string') {
|
|
@@ -66891,7 +66897,7 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
66891
66897
|
if (mode === navigation_constants_strings.MODE_VERTICAL && !limitIndent && !isCollapsed) {
|
|
66892
66898
|
/* Different icons' amount means different indents.*/
|
|
66893
66899
|
const iconAmount = icon && !indent ? level : level - 1;
|
|
66894
|
-
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false,
|
|
66900
|
+
placeholderIcons = times_default()(iconAmount, index => this.renderIcon(null, navigation_constants_strings.ICON_POS_RIGHT, false, false, index));
|
|
66895
66901
|
}
|
|
66896
66902
|
|
|
66897
66903
|
const titleDiv = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
@@ -66903,7 +66909,7 @@ class SubNav_SubNav extends baseComponent_BaseComponent {
|
|
|
66903
66909
|
onKeyPress: this.handleKeyPress
|
|
66904
66910
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
66905
66911
|
className: "".concat(prefixCls, "-item-inner")
|
|
66906
|
-
}, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== navigation_constants_strings.MODE_HORIZONTAL ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT,
|
|
66912
|
+
}, placeholderIcons, this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_LEFT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-left'), icon || indent || isInSubNav && mode !== navigation_constants_strings.MODE_HORIZONTAL ? this.renderIcon(icon, navigation_constants_strings.ICON_POS_LEFT, false, false, 'key-inSubNav-position-left') : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", {
|
|
66907
66913
|
className: "".concat(prefixCls, "-item-text")
|
|
66908
66914
|
}, text), this.context.toggleIconPosition === navigation_constants_strings.TOGGLE_ICON_RIGHT && this.renderIcon(toggleIconType, navigation_constants_strings.ICON_POS_RIGHT, withTransition, true, 'key-toggle-position-right')));
|
|
66909
66915
|
return titleDiv;
|
|
@@ -84963,8 +84969,13 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
84963
84969
|
const {
|
|
84964
84970
|
flattenedColumns,
|
|
84965
84971
|
getCellWidths
|
|
84966
|
-
} = _this.context;
|
|
84967
|
-
|
|
84972
|
+
} = _this.context; // we use memoized cellWidths to avoid re-render expanded row (fix #686)
|
|
84973
|
+
|
|
84974
|
+
if (flattenedColumns !== _this.flattenedColumns) {
|
|
84975
|
+
_this.flattenedColumns = flattenedColumns;
|
|
84976
|
+
_this.cellWidths = getCellWidths(flattenedColumns);
|
|
84977
|
+
}
|
|
84978
|
+
|
|
84968
84979
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(ExpandedRow_TableExpandedRow, {
|
|
84969
84980
|
style: style,
|
|
84970
84981
|
components: components,
|
|
@@ -84976,7 +84987,7 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
84976
84987
|
index: index,
|
|
84977
84988
|
virtualized: virtualized,
|
|
84978
84989
|
key: genExpandedRowKey(key),
|
|
84979
|
-
cellWidths: cellWidths
|
|
84990
|
+
cellWidths: _this.cellWidths
|
|
84980
84991
|
});
|
|
84981
84992
|
};
|
|
84982
84993
|
/**
|
|
@@ -85154,7 +85165,9 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85154
85165
|
};
|
|
85155
85166
|
this.listRef = /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createRef();
|
|
85156
85167
|
const {
|
|
85157
|
-
getVirtualizedListRef
|
|
85168
|
+
getVirtualizedListRef,
|
|
85169
|
+
flattenedColumns,
|
|
85170
|
+
getCellWidths
|
|
85158
85171
|
} = context;
|
|
85159
85172
|
|
|
85160
85173
|
if (getVirtualizedListRef) {
|
|
@@ -85166,6 +85179,8 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85166
85179
|
}
|
|
85167
85180
|
|
|
85168
85181
|
this.foundation = new bodyFoundation_TableBodyFoundation(this.adapter);
|
|
85182
|
+
this.flattenedColumns = flattenedColumns;
|
|
85183
|
+
this.cellWidths = getCellWidths(flattenedColumns);
|
|
85169
85184
|
this.observer = null;
|
|
85170
85185
|
}
|
|
85171
85186
|
|