@douyinfe/semi-ui 2.30.2 → 2.31.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 +66 -51
- package/dist/css/semi.min.css +1 -1
- package/dist/umd/semi-ui.js +186 -64
- 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/_base/base.d.ts +3 -3
- package/lib/cjs/anchor/index.d.ts +1 -1
- package/lib/cjs/autoComplete/index.d.ts +1 -1
- package/lib/cjs/button/Button.d.ts +1 -1
- package/lib/cjs/cascader/index.js +2 -1
- package/lib/cjs/checkbox/checkbox.d.ts +1 -1
- package/lib/cjs/checkbox/checkboxGroup.d.ts +1 -1
- package/lib/cjs/descriptions/index.d.ts +1 -1
- package/lib/cjs/layout/index.d.ts +1 -1
- package/lib/cjs/modal/confirm.d.ts +1 -1
- package/lib/cjs/popover/index.d.ts +1 -0
- package/lib/cjs/progress/index.d.ts +3 -3
- package/lib/cjs/radio/radio.d.ts +1 -1
- package/lib/cjs/table/Body/index.js +4 -8
- package/lib/cjs/table/Table.js +7 -4
- package/lib/cjs/table/TableCell.js +30 -7
- package/lib/cjs/table/TableContextProvider.d.ts +1 -1
- package/lib/cjs/table/TableContextProvider.js +5 -3
- package/lib/cjs/table/TableHeaderRow.js +28 -9
- package/lib/cjs/table/index.d.ts +3 -0
- package/lib/cjs/table/index.js +11 -3
- package/lib/cjs/table/interface.d.ts +1 -0
- package/lib/cjs/table/table-context.d.ts +2 -0
- package/lib/cjs/tabs/interface.d.ts +1 -1
- package/lib/cjs/tag/index.js +4 -2
- package/lib/cjs/tagInput/index.d.ts +1 -1
- package/lib/cjs/tagInput/index.js +1 -3
- package/lib/cjs/tooltip/index.d.ts +4 -0
- package/lib/cjs/tooltip/index.js +21 -6
- package/lib/cjs/typography/copyable.d.ts +3 -0
- package/lib/cjs/typography/copyable.js +30 -9
- package/lib/es/_base/base.d.ts +3 -3
- package/lib/es/anchor/index.d.ts +1 -1
- package/lib/es/autoComplete/index.d.ts +1 -1
- package/lib/es/button/Button.d.ts +1 -1
- package/lib/es/cascader/index.js +2 -1
- package/lib/es/checkbox/checkbox.d.ts +1 -1
- package/lib/es/checkbox/checkboxGroup.d.ts +1 -1
- package/lib/es/descriptions/index.d.ts +1 -1
- package/lib/es/layout/index.d.ts +1 -1
- package/lib/es/modal/confirm.d.ts +1 -1
- package/lib/es/popover/index.d.ts +1 -0
- package/lib/es/progress/index.d.ts +3 -3
- package/lib/es/radio/radio.d.ts +1 -1
- package/lib/es/table/Body/index.js +4 -7
- package/lib/es/table/Table.js +7 -4
- package/lib/es/table/TableCell.js +31 -8
- package/lib/es/table/TableContextProvider.d.ts +1 -1
- package/lib/es/table/TableContextProvider.js +5 -3
- package/lib/es/table/TableHeaderRow.js +29 -10
- package/lib/es/table/index.d.ts +3 -0
- package/lib/es/table/index.js +10 -3
- package/lib/es/table/interface.d.ts +1 -0
- package/lib/es/table/table-context.d.ts +2 -0
- package/lib/es/tabs/interface.d.ts +1 -1
- package/lib/es/tag/index.js +7 -2
- package/lib/es/tagInput/index.d.ts +1 -1
- package/lib/es/tagInput/index.js +1 -3
- package/lib/es/tooltip/index.d.ts +4 -0
- package/lib/es/tooltip/index.js +21 -6
- package/lib/es/typography/copyable.d.ts +3 -0
- package/lib/es/typography/copyable.js +28 -9
- package/package.json +8 -8
package/dist/umd/semi-ui.js
CHANGED
|
@@ -18209,6 +18209,10 @@ class foundation_Tooltip extends foundation {
|
|
|
18209
18209
|
this._adapter.removePortal();
|
|
18210
18210
|
};
|
|
18211
18211
|
|
|
18212
|
+
this.setDisplayNone = (displayNone, cb) => {
|
|
18213
|
+
this._adapter.setDisplayNone(displayNone, cb);
|
|
18214
|
+
};
|
|
18215
|
+
|
|
18212
18216
|
this.onResize = () => {
|
|
18213
18217
|
// this.log('resize');
|
|
18214
18218
|
// rePosition when window resize
|
|
@@ -18234,9 +18238,14 @@ class foundation_Tooltip extends foundation {
|
|
|
18234
18238
|
const trigger = this.getProp('trigger');
|
|
18235
18239
|
const clickTriggerToHide = this.getProp('clickTriggerToHide');
|
|
18236
18240
|
const {
|
|
18237
|
-
visible
|
|
18241
|
+
visible,
|
|
18242
|
+
displayNone
|
|
18238
18243
|
} = this.getStates();
|
|
18239
18244
|
|
|
18245
|
+
if (displayNone) {
|
|
18246
|
+
this.setDisplayNone(false);
|
|
18247
|
+
}
|
|
18248
|
+
|
|
18240
18249
|
if (visible) {
|
|
18241
18250
|
return;
|
|
18242
18251
|
}
|
|
@@ -20009,7 +20018,12 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20009
20018
|
|
|
20010
20019
|
|
|
20011
20020
|
this.didLeave = () => {
|
|
20012
|
-
this.
|
|
20021
|
+
if (this.props.keepDOM) {
|
|
20022
|
+
this.foundation.setDisplayNone(true);
|
|
20023
|
+
} else {
|
|
20024
|
+
this.foundation.removePortal();
|
|
20025
|
+
}
|
|
20026
|
+
|
|
20013
20027
|
this.foundation.unBindEvent();
|
|
20014
20028
|
};
|
|
20015
20029
|
|
|
@@ -20079,6 +20093,7 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20079
20093
|
visible,
|
|
20080
20094
|
portalEventSet,
|
|
20081
20095
|
placement,
|
|
20096
|
+
displayNone,
|
|
20082
20097
|
transitionState,
|
|
20083
20098
|
id,
|
|
20084
20099
|
isPositionUpdated
|
|
@@ -20133,7 +20148,9 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20133
20148
|
} = _ref;
|
|
20134
20149
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", Object.assign({
|
|
20135
20150
|
className: classnames_default()(className, animationClassName),
|
|
20136
|
-
style: Object.assign(Object.assign(Object.assign(Object.assign({}, animationStyle), {
|
|
20151
|
+
style: Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, animationStyle), displayNone ? {
|
|
20152
|
+
display: "none"
|
|
20153
|
+
} : {}), {
|
|
20137
20154
|
transformOrigin
|
|
20138
20155
|
}), style), {
|
|
20139
20156
|
opacity: isPositionUpdated ? opacity : "0"
|
|
@@ -20223,8 +20240,8 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20223
20240
|
placement: props.position || 'top',
|
|
20224
20241
|
transitionStyle: {},
|
|
20225
20242
|
isPositionUpdated: false,
|
|
20226
|
-
id: props.wrapperId
|
|
20227
|
-
|
|
20243
|
+
id: props.wrapperId,
|
|
20244
|
+
displayNone: false
|
|
20228
20245
|
};
|
|
20229
20246
|
this.foundation = new foundation_Tooltip(this.adapter);
|
|
20230
20247
|
this.eventManager = new Event_Event();
|
|
@@ -20348,6 +20365,11 @@ class tooltip_Tooltip extends baseComponent_BaseComponent {
|
|
|
20348
20365
|
this.eventManager.emit('positionUpdated');
|
|
20349
20366
|
});
|
|
20350
20367
|
},
|
|
20368
|
+
setDisplayNone: (displayNone, cb) => {
|
|
20369
|
+
this.setState({
|
|
20370
|
+
displayNone
|
|
20371
|
+
}, cb);
|
|
20372
|
+
},
|
|
20351
20373
|
updatePlacementAttr: placement => {
|
|
20352
20374
|
this.setState({
|
|
20353
20375
|
placement
|
|
@@ -20654,7 +20676,8 @@ tooltip_Tooltip.propTypes = {
|
|
|
20654
20676
|
wrapWhenSpecial: prop_types_default.a.bool,
|
|
20655
20677
|
guardFocus: prop_types_default.a.bool,
|
|
20656
20678
|
returnFocusOnClose: prop_types_default.a.bool,
|
|
20657
|
-
preventScroll: prop_types_default.a.bool
|
|
20679
|
+
preventScroll: prop_types_default.a.bool,
|
|
20680
|
+
keepDOM: prop_types_default.a.bool
|
|
20658
20681
|
};
|
|
20659
20682
|
tooltip_Tooltip.defaultProps = {
|
|
20660
20683
|
arrowBounding: numbers.ARROW_BOUNDING,
|
|
@@ -20680,7 +20703,8 @@ tooltip_Tooltip.defaultProps = {
|
|
|
20680
20703
|
returnFocusOnClose: false,
|
|
20681
20704
|
onEscKeyDown: noop_default.a,
|
|
20682
20705
|
disableFocusListener: false,
|
|
20683
|
-
disableArrowKeyDown: false
|
|
20706
|
+
disableArrowKeyDown: false,
|
|
20707
|
+
keepDOM: false
|
|
20684
20708
|
};
|
|
20685
20709
|
// EXTERNAL MODULE: /home/runner/work/semi-design/semi-design/node_modules/copy-text-to-clipboard/index.js
|
|
20686
20710
|
var copy_text_to_clipboard = __webpack_require__("HDX/");
|
|
@@ -23807,6 +23831,31 @@ class copyable_Copyable extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
23807
23831
|
}, locale => /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("span", null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconTick, null), locale.copied));
|
|
23808
23832
|
};
|
|
23809
23833
|
|
|
23834
|
+
this.renderCopyIcon = () => {
|
|
23835
|
+
const {
|
|
23836
|
+
icon
|
|
23837
|
+
} = this.props;
|
|
23838
|
+
const copyProps = {
|
|
23839
|
+
role: "button",
|
|
23840
|
+
tabIndex: 0,
|
|
23841
|
+
onClick: this.copy,
|
|
23842
|
+
onKeyPress: e => utils_isEnterPress(e) && this.copy(e)
|
|
23843
|
+
};
|
|
23844
|
+
{
|
|
23845
|
+
/* TODO: replace `a` tag with `span` in next major version
|
|
23846
|
+
NOTE: may have effect on style */
|
|
23847
|
+
}
|
|
23848
|
+
const defaultIcon =
|
|
23849
|
+
/*#__PURE__*/
|
|
23850
|
+
// eslint-disable-next-line jsx-a11y/anchor-is-valid
|
|
23851
|
+
external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("a", {
|
|
23852
|
+
className: `${copyable_prefixCls}-action-copy-icon`
|
|
23853
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCopy, Object.assign({
|
|
23854
|
+
onClick: this.copy
|
|
23855
|
+
}, copyProps)));
|
|
23856
|
+
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.isValidElement(icon) ? /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.cloneElement(icon, copyProps) : defaultIcon;
|
|
23857
|
+
};
|
|
23858
|
+
|
|
23810
23859
|
this.state = {
|
|
23811
23860
|
copied: false,
|
|
23812
23861
|
item: ''
|
|
@@ -23844,14 +23893,7 @@ class copyable_Copyable extends external_root_React_commonjs2_react_commonjs_rea
|
|
|
23844
23893
|
ref: forwardRef
|
|
23845
23894
|
}, copied ? this.renderSuccessTip() : /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(tooltip_Tooltip, {
|
|
23846
23895
|
content: typeof copyTip !== 'undefined' ? copyTip : locale.copy
|
|
23847
|
-
},
|
|
23848
|
-
className: `${copyable_prefixCls}-action-copy-icon`
|
|
23849
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconCopy, {
|
|
23850
|
-
role: "button",
|
|
23851
|
-
tabIndex: 0,
|
|
23852
|
-
onClick: this.copy,
|
|
23853
|
-
onKeyPress: e => utils_isEnterPress(e) && this.copy(e)
|
|
23854
|
-
})))));
|
|
23896
|
+
}, this.renderCopyIcon())));
|
|
23855
23897
|
}
|
|
23856
23898
|
|
|
23857
23899
|
}
|
|
@@ -23862,7 +23904,8 @@ copyable_Copyable.propTypes = {
|
|
|
23862
23904
|
copyTip: prop_types_default.a.node,
|
|
23863
23905
|
duration: prop_types_default.a.number,
|
|
23864
23906
|
style: prop_types_default.a.object,
|
|
23865
|
-
className: prop_types_default.a.string
|
|
23907
|
+
className: prop_types_default.a.string,
|
|
23908
|
+
icon: prop_types_default.a.node
|
|
23866
23909
|
};
|
|
23867
23910
|
copyable_Copyable.defaultProps = {
|
|
23868
23911
|
content: '',
|
|
@@ -39235,7 +39278,11 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
39235
39278
|
if (filterable && !multiple) {
|
|
39236
39279
|
const displayText = this.renderDisplayText(selectedKey, keyEntities);
|
|
39237
39280
|
updateStates.inputPlaceHolder = displayText;
|
|
39238
|
-
|
|
39281
|
+
/*
|
|
39282
|
+
* displayText should not be assign to inputValue,
|
|
39283
|
+
* cause inputValue should only change by user enter
|
|
39284
|
+
*/
|
|
39285
|
+
// updateStates.inputValue = displayText;
|
|
39239
39286
|
}
|
|
39240
39287
|
/**
|
|
39241
39288
|
* If selectedKeys does not meet the update conditions,
|
|
@@ -39269,7 +39316,11 @@ class foundation_CascaderFoundation extends foundation {
|
|
|
39269
39316
|
const displayText = this._defaultRenderText(valuePath);
|
|
39270
39317
|
|
|
39271
39318
|
updateStates.inputPlaceHolder = displayText;
|
|
39272
|
-
|
|
39319
|
+
/*
|
|
39320
|
+
* displayText should not be assign to inputValue,
|
|
39321
|
+
* cause inputValue should only change by user enter
|
|
39322
|
+
*/
|
|
39323
|
+
// updateStates.inputValue = displayText;
|
|
39273
39324
|
}
|
|
39274
39325
|
|
|
39275
39326
|
keyEntities[key] = optionNotExist; // Fix: 1155, if the data is loaded asynchronously to update treeData, the emptying operation should not be done when entering the updateSelectedKey method
|
|
@@ -41239,6 +41290,7 @@ var tag_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
41239
41290
|
|
|
41240
41291
|
|
|
41241
41292
|
|
|
41293
|
+
|
|
41242
41294
|
const tag_prefixCls = tag_constants_cssClasses.PREFIX;
|
|
41243
41295
|
const tagColors = tag_constants_strings.TAG_COLOR;
|
|
41244
41296
|
const tagSize = tag_constants_strings.TAG_SIZE;
|
|
@@ -41386,10 +41438,14 @@ class tag_Tag extends external_root_React_commonjs2_react_commonjs_react_amd_rea
|
|
|
41386
41438
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(IconClose, {
|
|
41387
41439
|
size: "small"
|
|
41388
41440
|
})) : null;
|
|
41441
|
+
|
|
41442
|
+
const stringChild = isString_default()(children);
|
|
41443
|
+
|
|
41444
|
+
const contentCls = classnames_default()(`${tag_prefixCls}-content`, `${tag_prefixCls}-content-${stringChild ? 'ellipsis' : 'center'}`);
|
|
41389
41445
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", Object.assign({
|
|
41390
|
-
"aria-label": this.props['aria-label'] ||
|
|
41446
|
+
"aria-label": this.props['aria-label'] || stringChild ? `${closable ? 'Closable ' : ''}Tag: ${children}` : ''
|
|
41391
41447
|
}, wrapProps), avatarSrc ? this.renderAvatar() : null, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
41392
|
-
className:
|
|
41448
|
+
className: contentCls
|
|
41393
41449
|
}, children), closeIcon);
|
|
41394
41450
|
}
|
|
41395
41451
|
|
|
@@ -43831,15 +43887,13 @@ class tagInput_TagInput extends baseComponent_BaseComponent {
|
|
|
43831
43887
|
key: elementKey,
|
|
43832
43888
|
visible: true,
|
|
43833
43889
|
"aria-label": `${!disabled ? 'Closable ' : ''}Tag: ${value}`
|
|
43834
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
43835
|
-
className: `${tagInput_prefixCls}-tag-content-wrapper`
|
|
43836
43890
|
}, showIconHandler && /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(DragHandle, null), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(paragraph_Paragraph, {
|
|
43837
43891
|
className: typoCls,
|
|
43838
43892
|
ellipsis: {
|
|
43839
43893
|
showTooltip: showContentTooltip,
|
|
43840
43894
|
rows: 1
|
|
43841
43895
|
}
|
|
43842
|
-
}, value))
|
|
43896
|
+
}, value));
|
|
43843
43897
|
}
|
|
43844
43898
|
});
|
|
43845
43899
|
};
|
|
@@ -45200,7 +45254,8 @@ class cascader_Cascader extends baseComponent_BaseComponent {
|
|
|
45200
45254
|
onChange: this.handleInputChange
|
|
45201
45255
|
};
|
|
45202
45256
|
const wrappercls = classnames_default()({
|
|
45203
|
-
[`${cascader_prefixcls}-search-wrapper`]: true
|
|
45257
|
+
[`${cascader_prefixcls}-search-wrapper`]: true,
|
|
45258
|
+
[`${cascader_prefixcls}-search-wrapper-${size}`]: size !== 'default'
|
|
45204
45259
|
});
|
|
45205
45260
|
const displayText = this.renderDisplayText();
|
|
45206
45261
|
const spanCls = classnames_default()({
|
|
@@ -80406,14 +80461,14 @@ function isAnyFixed(columns) {
|
|
|
80406
80461
|
function isAnyFixedRight(columns) {
|
|
80407
80462
|
return some_default()(columns, col => col.fixed === 'right');
|
|
80408
80463
|
}
|
|
80409
|
-
function
|
|
80464
|
+
function utils_isFixedLeft(column) {
|
|
80410
80465
|
return ['left', true].includes(get_default()(column, 'fixed'));
|
|
80411
80466
|
}
|
|
80412
|
-
function
|
|
80467
|
+
function utils_isFixedRight(column) {
|
|
80413
80468
|
return ['right'].includes(get_default()(column, 'fixed'));
|
|
80414
80469
|
}
|
|
80415
80470
|
function isFixed(column) {
|
|
80416
|
-
return
|
|
80471
|
+
return utils_isFixedLeft(column) || utils_isFixedRight(column);
|
|
80417
80472
|
}
|
|
80418
80473
|
function isInnerColumnKey(key) {
|
|
80419
80474
|
return [table_constants_strings.DEFAULT_KEY_COLUMN_EXPAND, table_constants_strings.DEFAULT_KEY_COLUMN_SCROLLBAR, table_constants_strings.DEFAULT_KEY_COLUMN_SELECTION].includes(key);
|
|
@@ -80802,6 +80857,22 @@ function isTreeTable(_ref2) {
|
|
|
80802
80857
|
|
|
80803
80858
|
return flag;
|
|
80804
80859
|
}
|
|
80860
|
+
function getRTLAlign(align, direction) {
|
|
80861
|
+
if (direction === 'rtl') {
|
|
80862
|
+
switch (align) {
|
|
80863
|
+
case 'left':
|
|
80864
|
+
return 'right';
|
|
80865
|
+
|
|
80866
|
+
case 'right':
|
|
80867
|
+
return 'left';
|
|
80868
|
+
|
|
80869
|
+
default:
|
|
80870
|
+
return align;
|
|
80871
|
+
}
|
|
80872
|
+
}
|
|
80873
|
+
|
|
80874
|
+
return align;
|
|
80875
|
+
}
|
|
80805
80876
|
// CONCATENATED MODULE: ../semi-foundation/utils/Store.ts
|
|
80806
80877
|
/* istanbul ignore next */
|
|
80807
80878
|
class Store {
|
|
@@ -82220,7 +82291,8 @@ const TableContextProvider = _ref => {
|
|
|
82220
82291
|
renderExpandIcon,
|
|
82221
82292
|
renderSelection,
|
|
82222
82293
|
getVirtualizedListRef,
|
|
82223
|
-
setBodyHasScrollbar
|
|
82294
|
+
setBodyHasScrollbar,
|
|
82295
|
+
direction
|
|
82224
82296
|
} = _ref;
|
|
82225
82297
|
const tableContextValue = Object(external_root_React_commonjs2_react_commonjs_react_amd_react_["useMemo"])(() => ({
|
|
82226
82298
|
anyColumnFixed,
|
|
@@ -82234,8 +82306,9 @@ const TableContextProvider = _ref => {
|
|
|
82234
82306
|
tableWidth,
|
|
82235
82307
|
handleRowExpanded,
|
|
82236
82308
|
getVirtualizedListRef,
|
|
82237
|
-
setBodyHasScrollbar
|
|
82238
|
-
|
|
82309
|
+
setBodyHasScrollbar,
|
|
82310
|
+
direction
|
|
82311
|
+
}), [anyColumnFixed, flattenedColumns, renderExpandIcon, renderSelection, setHeadWidths, getHeadWidths, getCellWidths, headWidths, tableWidth, handleRowExpanded, getVirtualizedListRef, setBodyHasScrollbar, direction]);
|
|
82239
82312
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_context.Provider, {
|
|
82240
82313
|
value: tableContextValue
|
|
82241
82314
|
}, children);
|
|
@@ -82832,8 +82905,10 @@ class TableHeaderRow_TableHeaderRow extends baseComponent_BaseComponent {
|
|
|
82832
82905
|
columns
|
|
82833
82906
|
} = this.props;
|
|
82834
82907
|
const {
|
|
82835
|
-
getCellWidths
|
|
82908
|
+
getCellWidths,
|
|
82909
|
+
direction
|
|
82836
82910
|
} = this.context;
|
|
82911
|
+
const isRTL = direction === 'rtl';
|
|
82837
82912
|
const slicedColumns = sliceColumnsByLevel(columns, index);
|
|
82838
82913
|
const headWidths = getCellWidths(slicedColumns);
|
|
82839
82914
|
|
|
@@ -82855,35 +82930,52 @@ class TableHeaderRow_TableHeaderRow extends baseComponent_BaseComponent {
|
|
|
82855
82930
|
let cellStyle = Object.assign({}, customProps.style);
|
|
82856
82931
|
|
|
82857
82932
|
if (column.align) {
|
|
82933
|
+
const textAlign = getRTLAlign(column.align, direction);
|
|
82858
82934
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82859
|
-
textAlign
|
|
82935
|
+
textAlign
|
|
82860
82936
|
});
|
|
82861
82937
|
customProps.className = classnames_default()(customProps.className, column.className, {
|
|
82862
|
-
[`${prefixCls}-align-${
|
|
82938
|
+
[`${prefixCls}-align-${textAlign}`]: Boolean(textAlign)
|
|
82863
82939
|
});
|
|
82864
82940
|
}
|
|
82865
82941
|
|
|
82942
|
+
let fixedLeft, fixedRight, fixedLeftLast, fixedRightFirst;
|
|
82943
|
+
|
|
82944
|
+
if (isRTL) {
|
|
82945
|
+
fixedLeft = utils_isFixedRight(column);
|
|
82946
|
+
fixedRight = utils_isFixedLeft(column);
|
|
82947
|
+
fixedLeftLast = isFirstFixedRight(slicedColumns, column);
|
|
82948
|
+
fixedRightFirst = isLastLeftFixed(slicedColumns, column);
|
|
82949
|
+
} else {
|
|
82950
|
+
fixedLeft = utils_isFixedLeft(column);
|
|
82951
|
+
fixedRight = utils_isFixedRight(column);
|
|
82952
|
+
fixedLeftLast = isLastLeftFixed(slicedColumns, column);
|
|
82953
|
+
fixedRightFirst = isFirstFixedRight(slicedColumns, column);
|
|
82954
|
+
}
|
|
82955
|
+
|
|
82866
82956
|
customProps.className = classnames_default()(`${prefixCls}-row-head`, column.className, customProps.className, // `${prefixCls}-fixed-columns`,
|
|
82867
82957
|
{
|
|
82868
|
-
[`${prefixCls}-cell-fixed-left`]:
|
|
82869
|
-
[`${prefixCls}-cell-fixed-left-last`]:
|
|
82870
|
-
[`${prefixCls}-cell-fixed-right`]:
|
|
82871
|
-
[`${prefixCls}-cell-fixed-right-first`]:
|
|
82958
|
+
[`${prefixCls}-cell-fixed-left`]: fixedLeft,
|
|
82959
|
+
[`${prefixCls}-cell-fixed-left-last`]: fixedLeftLast,
|
|
82960
|
+
[`${prefixCls}-cell-fixed-right`]: fixedRight,
|
|
82961
|
+
[`${prefixCls}-cell-fixed-right-first`]: fixedRightFirst
|
|
82872
82962
|
});
|
|
82873
82963
|
|
|
82874
82964
|
if (headWidths.length && slicedColumns.length) {
|
|
82875
82965
|
const indexOfSlicedColumns = findIndex_default()(slicedColumns, item => item && item.key != null && item.key === column.key);
|
|
82876
82966
|
|
|
82877
82967
|
if (indexOfSlicedColumns > -1) {
|
|
82878
|
-
if (
|
|
82968
|
+
if (utils_isFixedLeft(column)) {
|
|
82969
|
+
const xPositionKey = isRTL ? 'right' : 'left';
|
|
82879
82970
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82880
82971
|
position: 'sticky',
|
|
82881
|
-
|
|
82972
|
+
[xPositionKey]: arrayAdd(headWidths, 0, indexOfSlicedColumns)
|
|
82882
82973
|
});
|
|
82883
|
-
} else if (
|
|
82974
|
+
} else if (utils_isFixedRight(column)) {
|
|
82975
|
+
const xPositionKey = isRTL ? 'left' : 'right';
|
|
82884
82976
|
cellStyle = Object.assign(Object.assign({}, cellStyle), {
|
|
82885
82977
|
position: 'sticky',
|
|
82886
|
-
|
|
82978
|
+
[xPositionKey]: arrayAdd(headWidths, indexOfSlicedColumns + 1)
|
|
82887
82979
|
});
|
|
82888
82980
|
}
|
|
82889
82981
|
}
|
|
@@ -83665,13 +83757,17 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83665
83757
|
} = this.props;
|
|
83666
83758
|
let tdProps = {};
|
|
83667
83759
|
let customCellProps = {};
|
|
83760
|
+
const {
|
|
83761
|
+
direction
|
|
83762
|
+
} = this.context;
|
|
83763
|
+
const isRTL = direction === 'rtl';
|
|
83668
83764
|
const fixedLeftFlag = fixedLeft || typeof fixedLeft === 'number';
|
|
83669
83765
|
const fixedRightFlag = fixedRight || typeof fixedRight === 'number';
|
|
83670
83766
|
|
|
83671
83767
|
if (fixedLeftFlag) {
|
|
83672
|
-
set_default()(tdProps, 'style.left', typeof fixedLeft === 'number' ? fixedLeft : 0);
|
|
83768
|
+
set_default()(tdProps, isRTL ? 'style.right' : 'style.left', typeof fixedLeft === 'number' ? fixedLeft : 0);
|
|
83673
83769
|
} else if (fixedRightFlag) {
|
|
83674
|
-
set_default()(tdProps, 'style.right', typeof fixedRight === 'number' ? fixedRight : 0);
|
|
83770
|
+
set_default()(tdProps, isRTL ? 'style.left' : 'style.right', typeof fixedRight === 'number' ? fixedRight : 0);
|
|
83675
83771
|
}
|
|
83676
83772
|
|
|
83677
83773
|
if (width != null) {
|
|
@@ -83691,8 +83787,9 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83691
83787
|
}
|
|
83692
83788
|
|
|
83693
83789
|
if (column.align) {
|
|
83790
|
+
const textAlign = getRTLAlign(column.align, direction);
|
|
83694
83791
|
tdProps.style = Object.assign(Object.assign({}, tdProps.style), {
|
|
83695
|
-
textAlign
|
|
83792
|
+
textAlign
|
|
83696
83793
|
});
|
|
83697
83794
|
}
|
|
83698
83795
|
|
|
@@ -83830,6 +83927,10 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83830
83927
|
firstFixedRight,
|
|
83831
83928
|
colIndex
|
|
83832
83929
|
} = this.props;
|
|
83930
|
+
const {
|
|
83931
|
+
direction
|
|
83932
|
+
} = this.context;
|
|
83933
|
+
const isRTL = direction === 'rtl';
|
|
83833
83934
|
const {
|
|
83834
83935
|
className
|
|
83835
83936
|
} = column;
|
|
@@ -83860,11 +83961,25 @@ class TableCell_TableCell extends baseComponent_BaseComponent {
|
|
|
83860
83961
|
}
|
|
83861
83962
|
|
|
83862
83963
|
const inner = this.renderInner(text, indentText, realExpandIcon);
|
|
83964
|
+
let isFixedLeft, isFixedLeftLast, isFixedRight, isFixedRightFirst;
|
|
83965
|
+
|
|
83966
|
+
if (isRTL) {
|
|
83967
|
+
isFixedLeft = fixedRightFlag;
|
|
83968
|
+
isFixedLeftLast = firstFixedRight;
|
|
83969
|
+
isFixedRight = fixedLeftFlag;
|
|
83970
|
+
isFixedRightFirst = lastFixedLeft;
|
|
83971
|
+
} else {
|
|
83972
|
+
isFixedLeft = fixedLeftFlag;
|
|
83973
|
+
isFixedLeftLast = lastFixedLeft;
|
|
83974
|
+
isFixedRight = fixedRightFlag;
|
|
83975
|
+
isFixedRightFirst = firstFixedRight;
|
|
83976
|
+
}
|
|
83977
|
+
|
|
83863
83978
|
const columnCls = classnames_default()(className, `${prefixCls}-row-cell`, get_default()(customCellProps, 'className'), {
|
|
83864
|
-
[`${prefixCls}-cell-fixed-left`]:
|
|
83865
|
-
[`${prefixCls}-cell-fixed-left-last`]:
|
|
83866
|
-
[`${prefixCls}-cell-fixed-right`]:
|
|
83867
|
-
[`${prefixCls}-cell-fixed-right-first`]:
|
|
83979
|
+
[`${prefixCls}-cell-fixed-left`]: isFixedLeft,
|
|
83980
|
+
[`${prefixCls}-cell-fixed-left-last`]: isFixedLeftLast,
|
|
83981
|
+
[`${prefixCls}-cell-fixed-right`]: isFixedRight,
|
|
83982
|
+
[`${prefixCls}-cell-fixed-right-first`]: isFixedRightFirst
|
|
83868
83983
|
});
|
|
83869
83984
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(BodyCell, Object.assign({
|
|
83870
83985
|
role: "gridcell",
|
|
@@ -84137,9 +84252,9 @@ class BaseRow_TableRow extends baseComponent_BaseComponent {
|
|
|
84137
84252
|
index: index,
|
|
84138
84253
|
record: record,
|
|
84139
84254
|
component: BodyCell,
|
|
84140
|
-
fixedLeft:
|
|
84255
|
+
fixedLeft: utils_isFixedLeft(column) && arrayAdd(cellWidths, 0, columnIndex),
|
|
84141
84256
|
lastFixedLeft: isLastLeftFixed(columns, column),
|
|
84142
|
-
fixedRight:
|
|
84257
|
+
fixedRight: utils_isFixedRight(column) && arrayAdd(cellWidths, columnIndex + 1),
|
|
84143
84258
|
firstFixedRight: isFirstFixedRight(columns, column),
|
|
84144
84259
|
selected: selected,
|
|
84145
84260
|
expanded: expanded,
|
|
@@ -84683,7 +84798,6 @@ var Body_rest = undefined && undefined.__rest || function (s, e) {
|
|
|
84683
84798
|
|
|
84684
84799
|
|
|
84685
84800
|
|
|
84686
|
-
|
|
84687
84801
|
class Body_Body extends baseComponent_BaseComponent {
|
|
84688
84802
|
constructor(props, context) {
|
|
84689
84803
|
var _this;
|
|
@@ -85447,12 +85561,10 @@ class Body_Body extends baseComponent_BaseComponent {
|
|
|
85447
85561
|
const {
|
|
85448
85562
|
virtualized
|
|
85449
85563
|
} = this.props;
|
|
85450
|
-
|
|
85451
|
-
|
|
85452
|
-
|
|
85453
|
-
|
|
85454
|
-
return virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction);
|
|
85455
|
-
});
|
|
85564
|
+
const {
|
|
85565
|
+
direction
|
|
85566
|
+
} = this.context;
|
|
85567
|
+
return virtualized ? this.renderVirtualizedBody(direction) : this.renderBody(direction);
|
|
85456
85568
|
}
|
|
85457
85569
|
|
|
85458
85570
|
}
|
|
@@ -85765,8 +85877,9 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
85765
85877
|
const node = this.bodyWrapRef.current;
|
|
85766
85878
|
|
|
85767
85879
|
if (node && node.children && node.children.length) {
|
|
85768
|
-
const scrollToLeft = node.scrollLeft === 0;
|
|
85769
|
-
|
|
85880
|
+
const scrollToLeft = node.scrollLeft === 0; // why use Math.abs? @see https://bugzilla.mozilla.org/show_bug.cgi?id=1447743
|
|
85881
|
+
|
|
85882
|
+
const scrollToRight = Math.abs(node.scrollLeft) + 1 >= node.children[0].getBoundingClientRect().width - node.getBoundingClientRect().width;
|
|
85770
85883
|
|
|
85771
85884
|
if (scrollToLeft && scrollToRight) {
|
|
85772
85885
|
this.setScrollPosition('both');
|
|
@@ -86957,11 +87070,13 @@ class Table_Table extends baseComponent_BaseComponent {
|
|
|
86957
87070
|
});
|
|
86958
87071
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
86959
87072
|
ref: this.rootWrapRef,
|
|
86960
|
-
className: classnames_default()(className, `${prefixCls}-wrapper`),
|
|
87073
|
+
className: classnames_default()(className, `${prefixCls}-wrapper`, `${prefixCls}-wrapper-${props.direction}`),
|
|
86961
87074
|
"data-column-fixed": anyColumnFixed,
|
|
86962
87075
|
style: wrapStyle,
|
|
86963
87076
|
id: id
|
|
86964
|
-
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_TableContextProvider, Object.assign({}, tableContextValue
|
|
87077
|
+
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_TableContextProvider, Object.assign({}, tableContextValue, {
|
|
87078
|
+
direction: props.direction
|
|
87079
|
+
}), /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(spin_0, {
|
|
86965
87080
|
spinning: loading,
|
|
86966
87081
|
size: "large"
|
|
86967
87082
|
}, /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement("div", {
|
|
@@ -87349,6 +87464,7 @@ const ResizableTable = function () {
|
|
|
87349
87464
|
|
|
87350
87465
|
|
|
87351
87466
|
|
|
87467
|
+
|
|
87352
87468
|
class table_Table_0 extends external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.PureComponent {
|
|
87353
87469
|
constructor(props) {
|
|
87354
87470
|
super(props);
|
|
@@ -87359,16 +87475,21 @@ class table_Table_0 extends external_root_React_commonjs2_react_commonjs_react_a
|
|
|
87359
87475
|
}
|
|
87360
87476
|
|
|
87361
87477
|
render() {
|
|
87362
|
-
// eslint-disable-next-line prefer-destructuring
|
|
87478
|
+
var _a; // eslint-disable-next-line prefer-destructuring
|
|
87479
|
+
|
|
87480
|
+
|
|
87363
87481
|
const props = this.props;
|
|
87482
|
+
const direction = (_a = this.props.direction) !== null && _a !== void 0 ? _a : this.context.direction;
|
|
87364
87483
|
|
|
87365
87484
|
if (props.resizable) {
|
|
87366
87485
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_ResizableTable, Object.assign({}, props, {
|
|
87367
|
-
ref: this.tableRef
|
|
87486
|
+
ref: this.tableRef,
|
|
87487
|
+
direction: direction
|
|
87368
87488
|
}));
|
|
87369
87489
|
} else {
|
|
87370
87490
|
return /*#__PURE__*/external_root_React_commonjs2_react_commonjs_react_amd_react_default.a.createElement(table_Table, Object.assign({}, props, {
|
|
87371
|
-
ref: this.tableRef
|
|
87491
|
+
ref: this.tableRef,
|
|
87492
|
+
direction: direction
|
|
87372
87493
|
}));
|
|
87373
87494
|
}
|
|
87374
87495
|
}
|
|
@@ -87384,6 +87505,7 @@ table_Table_0.propTypes = Object.assign(Object.assign({}, table_Table.propTypes)
|
|
|
87384
87505
|
table_Table_0.defaultProps = {
|
|
87385
87506
|
hideExpandedColumn: true
|
|
87386
87507
|
};
|
|
87508
|
+
table_Table_0.contextType = configProvider_context;
|
|
87387
87509
|
|
|
87388
87510
|
/* harmony default export */ var table_0 = (table_Table_0);
|
|
87389
87511
|
// CONCATENATED MODULE: ../semi-foundation/tabs/constants.ts
|